You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

174 lines
7.6 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2021-08-11 11:57
  5. * 描 述:基础信息采集
  6. */
  7. var refreshGirdData;
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var page = {
  11. init: function () {
  12. page.initGird();
  13. page.bind();
  14. },
  15. bind: function () {
  16. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  17. page.search(queryJson);
  18. }, 220, 400);
  19. //年度
  20. $('#YearNo').lrselect({
  21. placeholder: "请选择年度",
  22. allowSearch: true,
  23. url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/GetAcademicYear',
  24. value: 'value',
  25. text: 'text'
  26. });
  27. $('#MouthNo').lrDataItemSelect({ code: 'MPMonth' });
  28. // 刷新
  29. $('#lr_refresh').on('click', function () {
  30. location.reload();
  31. });
  32. // 新增
  33. $('#lr_add').on('click', function () {
  34. learun.layerForm({
  35. id: 'form',
  36. title: '新增',
  37. url: top.$.rootUrl + '/PersonnelManagement/FD_BudgetFile/Form',
  38. width: 600,
  39. height: 400,
  40. callBack: function (id) {
  41. return top[id].acceptClick(refreshGirdData);
  42. }
  43. });
  44. });
  45. // 编辑
  46. $('#lr_edit').on('click', function () {
  47. var keyValue = $('#gridtable').jfGridValue('Id');
  48. if (learun.checkrow(keyValue)) {
  49. learun.layerForm({
  50. id: 'form',
  51. title: '编辑',
  52. url: top.$.rootUrl + '/PersonnelManagement/FD_BudgetFile/Form?keyValue=' + keyValue,
  53. width: 600,
  54. height: 400,
  55. callBack: function (id) {
  56. return top[id].acceptClick(refreshGirdData);
  57. }
  58. });
  59. }
  60. });
  61. // 删除
  62. $('#lr_delete').on('click', function () {
  63. var keyValue = $('#gridtable').jfGridValue('Id');
  64. if (learun.checkrow(keyValue)) {
  65. learun.layerConfirm('是否确认删除该项!', function (res) {
  66. if (res) {
  67. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/FD_BudgetFile/DeleteForm', { keyValue: keyValue }, function () {
  68. refreshGirdData();
  69. });
  70. }
  71. });
  72. }
  73. });
  74. // 打印
  75. $('#lr_print').on('click', function () {
  76. $('#gridtable').jqprintTable();
  77. });
  78. //$('.fileurl').on('click', function () {
  79. // console.log("下载!!!");
  80. // var id = $(this).id;
  81. // top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: id, __RequestVerificationToken: top.$.lrToken }, method: 'POST' });
  82. //});
  83. },
  84. // 初始化列表
  85. initGird: function () {
  86. $('#gridtable').jfGrid({
  87. url: top.$.rootUrl + '/PersonnelManagement/FD_BudgetFile/GetPageList',
  88. headData: [
  89. {
  90. label: "年度", name: "YearNo", width: 100, align: "left"
  91. //formatterAsync: function (callback, value, row, op,$cell) {
  92. // learun.clientdata.getAsync('dataItem', {
  93. // key: value,
  94. // code: '',
  95. // callback: function (_data) {
  96. // callback(_data.text);
  97. // }
  98. // });
  99. //}
  100. },
  101. {
  102. label: "月份", name: "MouthNo", width: 100, align: "left",
  103. formatterAsync: function (callback, value, row, op, $cell) {
  104. learun.clientdata.getAsync('dataItem', {
  105. key: value,
  106. code: 'MPMonth',
  107. callback: function (_data) {
  108. callback(_data.text);
  109. }
  110. });
  111. }
  112. },
  113. {
  114. label: "接收部门", name: "DeptId", width: 100, align: "left",
  115. formatterAsync: function (callback, value, row, op, $cell) {
  116. learun.clientdata.getAsync('custmerData', {
  117. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata',
  118. key: value,
  119. keyId: 'id',
  120. callback: function (_data) {
  121. callback(_data['name']);
  122. }
  123. });
  124. }
  125. },
  126. { label: "材料名称", name: "FileName", width: 100, align: "left" },
  127. //{
  128. // label: "附件", name: "Url", width: 200, align: "left",
  129. // formatterAsync: function (callback, value, row, op, $cell) {
  130. // $.ajax({
  131. // url: '/LR_SystemModule/Annexes/GetAnnexesFileList',
  132. // data: { folderId: value },
  133. // type: 'GET',
  134. // dataType: "json",
  135. // async: false,
  136. // cache: false,
  137. // success: function (res) {
  138. // var bb = '';
  139. // //console.log(res);
  140. // $.each(res.data, function (i, item) {
  141. // bb += '<span onclick="downLoad(\'' +
  142. // item.F_Id +
  143. // '\',)" style="color:blue">' +
  144. // item.F_FileName +
  145. // '</span>,&nbsp;&nbsp;&nbsp;';
  146. // })
  147. // callback(bb);
  148. // }
  149. // });
  150. // }
  151. //},
  152. { label: "说明", name: "Remark", width: 100, align: "left" },
  153. ],
  154. mainId: 'Id',
  155. isPage: true
  156. });
  157. page.search();
  158. },
  159. search: function (param) {
  160. param = param || {};
  161. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  162. },
  163. downLoad: function (fileId) {
  164. top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: top.$.lrToken }, method: 'POST' });
  165. }
  166. };
  167. refreshGirdData = function () {
  168. $('#gridtable').jfGridSet('reload');
  169. };
  170. page.init();
  171. }