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.
 
 
 
 
 
 

208 lines
8.4 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 上海力软信息技术有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-09-24 15:32
  5. * 描 述:内控管理
  6. */
  7. var refreshGirdData;
  8. var isUser = '1';
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var page = {
  12. init: function () {
  13. page.initGird();
  14. page.bind();
  15. },
  16. bind: function () {
  17. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  18. page.search(queryJson);
  19. }, 220, 400);
  20. //学年
  21. $('#MPAcademicYearNo').lrselect({
  22. placeholder: "请选择学年",
  23. allowSearch: true,
  24. url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/GetAcademicYear',
  25. value: 'value',
  26. text: 'text'
  27. });
  28. //学期
  29. $('#MPSemester').lrselect({
  30. placeholder: "请选择学期",
  31. allowSearch: true,
  32. url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetSemesterDataTwo',
  33. value: 'value',
  34. text: 'text'
  35. });
  36. $('#MPMonth').lrDataItemSelect({ code: 'MPMonth' });
  37. // 刷新
  38. $('#lr_refresh').on('click', function () {
  39. location.reload();
  40. });
  41. // 查看提交材料
  42. $('#lr_uploadView').on('click', function () {
  43. var ParentId = $('#gridtable').jfGridValue('MPId');
  44. var loginInfo = top.learun.clientdata.get(['userinfo']);
  45. if (learun.checkrow(ParentId)) {
  46. learun.layerFormForPercent({
  47. id: 'form',
  48. title: '提交材料',
  49. url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/IndexChildren?ParentId=' + ParentId + '&&MPUploaderTwo=' + loginInfo.userId,
  50. width: '80%',
  51. height: '80%',
  52. callBack: function (id) {
  53. return top[id].acceptClick(refreshGirdData);
  54. }
  55. });
  56. }
  57. });
  58. $('#lr_down').on('click',
  59. function () {
  60. var FileId = $('#gridtable').jfGridValue('MPFile');
  61. if (!!FileId) {
  62. var url = top.$.rootUrl + '/LR_SystemModule/Annexes/DownForm?keyVaule=' + FileId;
  63. learun.layerForm({
  64. id: 'downform',
  65. title: '文件下载',
  66. url: url,
  67. width: 600,
  68. height: 400,
  69. maxmin: true,
  70. btn: null
  71. });
  72. }
  73. });
  74. // 上传
  75. $('#lr_upload').on('click', function () {
  76. var keyValue = $('#gridtable').jfGridValue('MPId');
  77. if (learun.checkrow(keyValue)) {
  78. learun.layerForm({
  79. id: 'formupload',
  80. title: '上传',
  81. url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/UploadForm?keyValue=' + keyValue,
  82. width: 600,
  83. height: 400,
  84. callBack: function (id) {
  85. return top[id].acceptClick(refreshGirdData);
  86. }
  87. });
  88. }
  89. });
  90. },
  91. // 初始化列表
  92. initGird: function () {
  93. $('#gridtable').lrAuthorizeJfGrid({
  94. url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/GetPageList',
  95. headData: [
  96. { label: "学年", name: "MPAcademicYearNo", width: 100, align: "left" },
  97. { label: "学期", name: "MPSemester", width: 100, align: "left" },
  98. {
  99. label: "月份", name: "MPMonth", width: 100, align: "left",
  100. formatterAsync: function (callback, value, row, op, $cell) {
  101. learun.clientdata.getAsync('dataItem',
  102. {
  103. key: value,
  104. code: 'MPMonth',
  105. callback: function (_data) {
  106. callback(_data.text);
  107. }
  108. });
  109. }
  110. },
  111. {
  112. label: "部门", name: "MPDepartment", width: 250, align: "left",
  113. formatterAsync: function (callback, value, row, op, $cell) {
  114. learun.httpAsyncGet(top.$.rootUrl + '/LR_OrganizationModule/Department/GetDepartmentList?listId=' + value, function (res) {
  115. console.log(res);
  116. if (res.code == learun.httpCode.success) {
  117. callback(res.data);
  118. }
  119. });
  120. }
  121. },
  122. { label: "材料名称", name: "MPProjectName", width: 150, align: "left" },
  123. {
  124. label: "上传文件",
  125. name: "MPFileTwo",
  126. width: 200,
  127. align: "left",
  128. formatterAsync: function (callback, value, row, op, $cell) {
  129. $.ajax({
  130. url: '/LR_SystemModule/Annexes/GetAnnexesFileList',
  131. data: { folderId: value },
  132. type: 'GET',
  133. dataType: "json",
  134. async: false,
  135. cache: false,
  136. success: function (res) {
  137. var bb = '';
  138. $.each(res.data, function (i, item) {
  139. bb += '<span onclick="downLoad(\'' +
  140. item.F_Id +
  141. '\',)" style="color:blue">' +
  142. item.F_FileName +
  143. '</span>,&nbsp;&nbsp;&nbsp;';
  144. })
  145. callback(bb);
  146. }
  147. });
  148. }
  149. },
  150. {
  151. label: "是否合格", name: "MPConclusion", width: 100, align: "left", formatter: function (val) {
  152. if (val === 1) {
  153. return "合格";
  154. } else if (val === 0) {
  155. return "不合格";
  156. } else {
  157. return "";
  158. }
  159. }
  160. },
  161. //{ label: "说明", name: "MPRemark", width: 200, align: "left" },
  162. ],
  163. mainId: 'MPId',
  164. isPage: true
  165. })
  166. page.search();
  167. },
  168. search: function (param) {
  169. param = param || {};
  170. if (isUser) {
  171. param.isUser = 'true';
  172. }
  173. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  174. },
  175. downLoad: function (fileId) {
  176. top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: top.$.lrToken }, method: 'POST' });
  177. }
  178. };
  179. refreshGirdData = function () {
  180. page.search();
  181. };
  182. page.init();
  183. }
  184. function downLoad(fileId, fileTwo) {
  185. if (fileTwo) {
  186. top.learun.postFormSilence(top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/AddRecord', { fileId: fileTwo }, function () {
  187. });
  188. }
  189. top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: $.lrToken }, method: 'POST' });
  190. }