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.
 
 
 
 
 
 

236 lines
9.9 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. {
  123. label: "上传人", name: "MPUploader", width: 250, align: "left",
  124. formatterAsync: function (callback, value, row, op, $cell) {
  125. learun.clientdata.getAsync('custmerData', {
  126. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata',
  127. key: value,
  128. keyId: 'f_userid',
  129. callback: function (_data) {
  130. callback(_data['f_realname']);
  131. }
  132. });
  133. }
  134. //formatterAsync: function (callback, value, row, op, $cell) {
  135. // learun.httpAsyncGet(top.$.rootUrl + '/LR_OrganizationModule/User/GetListByUserIds?keyValue=' + value, function (res) {
  136. // if (res.code == learun.httpCode.success) {
  137. // callback(res.data);
  138. // }
  139. // });
  140. //}
  141. },
  142. { label: "材料名称", name: "MPProjectName", width: 150, align: "left" },
  143. {
  144. label: "上传文件",
  145. name: "MPFileTwo",
  146. width: 200,
  147. align: "left",
  148. formatterAsync: function (callback, value, row, op, $cell) {
  149. $.ajax({
  150. url: '/LR_SystemModule/Annexes/GetAnnexesFileList',
  151. data: { folderId: value },
  152. type: 'GET',
  153. dataType: "json",
  154. async: false,
  155. cache: false,
  156. success: function (res) {
  157. var bb = '';
  158. $.each(res.data, function (i, item) {
  159. bb += '<span onclick="downLoad(\'' +
  160. item.F_Id +
  161. '\',)" style="color:blue">' +
  162. item.F_FileName +
  163. '</span>,&nbsp;&nbsp;&nbsp;';
  164. })
  165. callback(bb);
  166. }
  167. });
  168. }
  169. },
  170. {
  171. label: "是否合格", name: "MPConclusion", width: 100, align: "left", formatter: function (val) {
  172. if (val === 1) {
  173. return "合格";
  174. } else if (val === 0) {
  175. return "不合格";
  176. } else {
  177. return "";
  178. }
  179. }
  180. },
  181. //{ label: "说明", name: "MPRemark", width: 200, align: "left" },
  182. ],
  183. mainId: 'MPId',
  184. isPage: true
  185. })
  186. page.search();
  187. },
  188. search: function (param) {
  189. param = param || {};
  190. if (isUser) {
  191. param.isUser = 'true';
  192. }
  193. if (!param.MPAcademicYearNo) {
  194. var jsdate = new Date();
  195. param.MPAcademicYearNo = jsdate.getFullYear();
  196. }
  197. if (!param.MPMonth) {
  198. var jsdate = new Date();
  199. param.MPMonth = jsdate.getMonth() + 1;
  200. }
  201. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  202. },
  203. downLoad: function (fileId) {
  204. top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: top.$.lrToken }, method: 'POST' });
  205. }
  206. };
  207. refreshGirdData = function () {
  208. page.search();
  209. };
  210. page.init();
  211. }
  212. function downLoad(fileId, fileTwo) {
  213. if (fileTwo) {
  214. top.learun.postFormSilence(top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/AddRecord', { fileId: fileTwo }, function () {
  215. });
  216. }
  217. top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: $.lrToken }, method: 'POST' });
  218. }