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.
 
 
 
 
 
 

263 lines
11 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. var jsdate = new Date();
  38. $('#MPAcademicYearNo').lrselectSet(jsdate.getFullYear());
  39. $('#MPMonth').lrselectSet(jsdate.getMonth() + 1);
  40. // 刷新
  41. $('#lr_refresh').on('click', function () {
  42. location.reload();
  43. });
  44. // 查看提交材料
  45. $('#lr_uploadView').on('click', function () {
  46. var ParentId = $('#gridtable').jfGridValue('MPId');
  47. var loginInfo = top.learun.clientdata.get(['userinfo']);
  48. if (learun.checkrow(ParentId)) {
  49. learun.layerFormForPercent({
  50. id: 'form',
  51. title: '提交材料',
  52. url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/IndexChildren?ParentId=' + ParentId + '&&MPUploaderTwo=' + loginInfo.userId,
  53. width: '80%',
  54. height: '80%',
  55. callBack: function (id) {
  56. return top[id].acceptClick(refreshGirdData);
  57. }
  58. });
  59. }
  60. });
  61. $('#lr_down').on('click',
  62. function () {
  63. var FileId = $('#gridtable').jfGridValue('MPFile');
  64. if (!!FileId) {
  65. var url = top.$.rootUrl + '/LR_SystemModule/Annexes/DownForm?keyVaule=' + FileId;
  66. learun.layerForm({
  67. id: 'downform',
  68. title: '文件下载',
  69. url: url,
  70. width: 600,
  71. height: 400,
  72. maxmin: true,
  73. btn: null
  74. });
  75. }
  76. });
  77. // 上传
  78. $('#lr_upload').on('click', function () {
  79. var keyValue = $('#gridtable').jfGridValue('MPId');
  80. if (learun.checkrow(keyValue)) {
  81. learun.layerForm({
  82. id: 'formupload',
  83. title: '上传',
  84. url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/UploadForm?keyValue=' + keyValue,
  85. width: 600,
  86. height: 400,
  87. callBack: function (id) {
  88. return top[id].acceptClick(refreshGirdData);
  89. }
  90. });
  91. }
  92. });
  93. },
  94. // 初始化列表
  95. initGird: function () {
  96. $('#gridtable').lrAuthorizeJfGrid({
  97. url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/GetPageList',
  98. headData: [
  99. { label: "年度", name: "MPAcademicYearNo", width: 100, align: "left" },
  100. //{ label: "学期", name: "MPSemester", width: 100, align: "left" },
  101. {
  102. label: "月份", name: "MPMonth", width: 100, align: "left"
  103. //formatterAsync: function (callback, value, row, op, $cell) {
  104. // learun.clientdata.getAsync('dataItem',
  105. // {
  106. // key: value,
  107. // code: 'MPMonth',
  108. // callback: function (_data) {
  109. // callback(_data.text);
  110. // }
  111. // });
  112. //}
  113. },
  114. {
  115. label: "部门", name: "MPDepartment", width: 250, align: "left",
  116. formatterAsync: function (callback, value, row, op, $cell) {
  117. if (value && value.indexOf(',') != -1) {
  118. var content = '';
  119. var deptarr = value.split(',');
  120. for (var i = 0; i < deptarr.length; i++) {
  121. learun.clientdata.getAsync('custmerData',
  122. {
  123. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata',
  124. key: deptarr[i],
  125. keyId: 'id',
  126. callback: function (_data) {
  127. content += _data['name'];
  128. }
  129. });
  130. }
  131. content = content.substring(0, content.length - 1);
  132. callback(content);
  133. } else {
  134. learun.clientdata.getAsync('custmerData',
  135. {
  136. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata',
  137. key: value,
  138. keyId: 'id',
  139. callback: function (_data) {
  140. callback(_data['name']);
  141. }
  142. });
  143. }
  144. }
  145. },
  146. {
  147. label: "上传人", name: "MPUploader", width: 250, align: "left",
  148. formatterAsync: function (callback, value, row, op, $cell) {
  149. learun.clientdata.getAsync('custmerData', {
  150. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata',
  151. key: value,
  152. keyId: 'f_userid',
  153. callback: function (_data) {
  154. callback(_data['f_realname']);
  155. }
  156. });
  157. }
  158. //formatterAsync: function (callback, value, row, op, $cell) {
  159. // learun.httpAsyncGet(top.$.rootUrl + '/LR_OrganizationModule/User/GetListByUserIds?keyValue=' + value, function (res) {
  160. // if (res.code == learun.httpCode.success) {
  161. // callback(res.data);
  162. // }
  163. // });
  164. //}
  165. },
  166. { label: "材料名称", name: "MPProjectName", width: 150, align: "left" },
  167. {
  168. label: "上传文件",
  169. name: "MPFileTwo",
  170. width: 200,
  171. align: "left",
  172. formatterAsync: function (callback, value, row, op, $cell) {
  173. $.ajax({
  174. url: '/LR_SystemModule/Annexes/GetAnnexesFileList',
  175. data: { folderId: value },
  176. type: 'GET',
  177. dataType: "json",
  178. async: false,
  179. cache: false,
  180. success: function (res) {
  181. var bb = '';
  182. $.each(res.data, function (i, item) {
  183. bb += '<span onclick="downLoad(\'' +
  184. item.F_Id +
  185. '\',)" style="color:blue">' +
  186. item.F_FileName +
  187. '</span>,&nbsp;&nbsp;&nbsp;';
  188. })
  189. callback(bb);
  190. }
  191. });
  192. }
  193. },
  194. {
  195. label: "是否合格", name: "MPConclusion", width: 100, align: "left", formatter: function (val) {
  196. if (val === 1) {
  197. return "合格";
  198. } else if (val === 0) {
  199. return "不合格";
  200. } else {
  201. return "";
  202. }
  203. }
  204. },
  205. //{ label: "说明", name: "MPRemark", width: 200, align: "left" },
  206. ],
  207. mainId: 'MPId',
  208. isPage: true
  209. })
  210. page.search();
  211. },
  212. search: function (param) {
  213. param = param || {};
  214. if (isUser) {
  215. param.isUser = 'true';
  216. }
  217. var jsdate = new Date();
  218. if (!param.MPAcademicYearNo && param.MPAcademicYearNo == undefined) {
  219. param.MPAcademicYearNo = jsdate.getFullYear();
  220. }
  221. if (!param.MPMonth && param.MPMonth == undefined) {
  222. param.MPMonth = jsdate.getMonth() + 1;
  223. }
  224. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  225. },
  226. downLoad: function (fileId) {
  227. top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: top.$.lrToken }, method: 'POST' });
  228. }
  229. };
  230. refreshGirdData = function () {
  231. page.search();
  232. };
  233. page.init();
  234. }
  235. function downLoad(fileId, fileTwo) {
  236. if (fileTwo) {
  237. top.learun.postFormSilence(top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/AddRecord', { fileId: fileTwo }, function () {
  238. });
  239. }
  240. top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: $.lrToken }, method: 'POST' });
  241. }