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.

IndexChildren.js 10 KiB

4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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 MPUploaderTwo = request('MPUploaderTwo');
  9. var ParentId = request('ParentId');
  10. var bootstrap = function ($, learun) {
  11. "use strict";
  12. var page = {
  13. init: function () {
  14. page.initGird();
  15. page.bind();
  16. },
  17. bind: function () {
  18. if (MPUploaderTwo) {
  19. $("#lr_qualified").hide();
  20. $("#lr_noqualified").hide();
  21. } else {
  22. $('#lr_upload').hide();
  23. $('#lr_againupload').hide();
  24. $('#lr_delete').hide();
  25. }
  26. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  27. page.search(queryJson);
  28. }, 220, 400);
  29. //学年
  30. $('#MPAcademicYearNo').lrselect({
  31. placeholder: "请选择学年",
  32. allowSearch: true,
  33. url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/GetAcademicYear',
  34. value: 'value',
  35. text: 'text'
  36. });
  37. //学期
  38. $('#MPSemester').lrselect({
  39. placeholder: "请选择学期",
  40. allowSearch: true,
  41. url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetSemesterDataTwo',
  42. value: 'value',
  43. text: 'text'
  44. });
  45. $('#MPMonth').lrDataItemSelect({ code: 'MPMonth' });
  46. // 刷新
  47. $('#lr_refresh').on('click', function () {
  48. location.reload();
  49. });
  50. // 上传资料
  51. $('#lr_upload').on('click', function () {
  52. learun.layerForm({
  53. id: 'formupload',
  54. title: '提交材料',
  55. url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/UploadForm?ParentId=' + ParentId,
  56. width: 600,
  57. height: 400,
  58. callBack: function (id) {
  59. return top[id].acceptClick(refreshGirdData);
  60. }
  61. });
  62. });
  63. // 重新上传
  64. $('#lr_againupload').on('click', function () {
  65. var keyValue = $('#gridtable').jfGridValue('MPId');
  66. if (learun.checkrow(keyValue)) {
  67. learun.layerForm({
  68. id: 'formupload',
  69. title: '重新提交',
  70. url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/UploadForm?keyValue=' + keyValue,
  71. width: 600,
  72. height: 400,
  73. callBack: function (id) {
  74. return top[id].acceptClick(refreshGirdData);
  75. }
  76. });
  77. }
  78. });
  79. // 删除
  80. $('#lr_delete').on('click', function () {
  81. var keyValue = $('#gridtable').jfGridValue('MPId');
  82. if (learun.checkrow(keyValue)) {
  83. learun.layerConfirm('是否确认删除该项!', function (res) {
  84. if (res) {
  85. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/DeleteForm', { keyValue: keyValue }, function () {
  86. refreshGirdData();
  87. });
  88. }
  89. });
  90. }
  91. });
  92. // 合格
  93. $('#lr_qualified').on('click', function () {
  94. var keyValue = $('#gridtable').jfGridValue('MPId');
  95. if (learun.checkrow(keyValue)) {
  96. learun.layerConfirm('是否确认合格!', function (res) {
  97. if (res) {
  98. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/Qqualified', {keyValue:keyValue, status: true }, function () {
  99. refreshGirdData();
  100. });
  101. }
  102. });
  103. }
  104. });
  105. // 不合格
  106. $('#lr_noqualified').on('click', function () {
  107. var keyValue = $('#gridtable').jfGridValue('MPId');
  108. if (learun.checkrow(keyValue)) {
  109. learun.layerConfirm('是否确认不合格!', function (res) {
  110. if (res) {
  111. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/Qqualified', {keyValue:keyValue, status: false }, function () {
  112. refreshGirdData();
  113. });
  114. }
  115. });
  116. }
  117. });
  118. },
  119. // 初始化列表
  120. initGird: function () {
  121. $('#gridtable').jfGrid({
  122. url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/GetPageList',
  123. headData: [
  124. {
  125. label: "上传材料", name: "MPFileTwo", width: 200, align: "left",
  126. formatterAsync: function (callback, value, row, op, $cell) {
  127. console.log(value);
  128. $.ajax({
  129. url: '/LR_SystemModule/Annexes/GetAnnexesFileList',
  130. data: { folderId: value },
  131. type: 'GET',
  132. dataType: "json",
  133. async: false,
  134. cache: false,
  135. success: function (res) {
  136. console.log(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: "MPDepartment", width: 250, align: "left",
  152. formatterAsync: function (callback, value, row, op, $cell) {
  153. learun.httpAsyncGet(top.$.rootUrl + '/LR_OrganizationModule/Department/GetDepartmentList?listId=' + value, function (res) {
  154. console.log(res);
  155. if (res.code == learun.httpCode.success) {
  156. callback(res.data);
  157. }
  158. });
  159. }
  160. },
  161. {
  162. label: "上传者", name: "MPUploaderTwo", width: 100, align: "left",
  163. formatterAsync: function (callback, value, row, op, $cell) {
  164. learun.clientdata.getAsync('custmerData',
  165. {
  166. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BaseUser',
  167. key: value,
  168. keyId: 'f_userid',
  169. sync: true,
  170. callback: function (_data) {
  171. callback(_data['f_realname']);
  172. }
  173. });
  174. }
  175. },
  176. { label: "上传时间", name: "MPUploadTimes", width: 100, align: "left" },
  177. {
  178. label: "状态", name: "MPStatus", width: 100, align: "left",
  179. formatterAsync: function (callback, value, row, op, $cell) {
  180. learun.clientdata.getAsync('dataItem', {
  181. key: value,
  182. code: 'SubmissionState',
  183. callback: function (_data) {
  184. callback(_data.text);
  185. }
  186. });
  187. }
  188. },
  189. {
  190. label: "是否合格", name: "MPConclusion", width: 100, align: "left", formatter: function (val) {
  191. if (val) {
  192. return "合格";
  193. } else {
  194. return "不合格";
  195. }
  196. }
  197. },
  198. { label: "修改次数", name: "SUpdateTime", width: 100, align: "left" },
  199. { label: "提交说明", name: "MPFileTwoRemark", width: 200, align: "left" },
  200. ],
  201. mainId: 'MPId',
  202. isPage: true
  203. })
  204. page.search();
  205. },
  206. search: function (param) {
  207. param = param || {};
  208. if (MPUploaderTwo) {
  209. param.MPUploaderTwo = MPUploaderTwo;
  210. }
  211. param.ParentId = ParentId;
  212. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  213. },
  214. downLoad: function (fileId) {
  215. top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: top.$.lrToken }, method: 'POST' });
  216. }
  217. };
  218. refreshGirdData = function () {
  219. page.search();
  220. };
  221. page.init();
  222. }
  223. function downLoad(fileId, fileTwo) {
  224. if (fileTwo) {
  225. top.learun.postFormSilence(top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/AddRecord', { fileId: fileTwo }, function () {
  226. });
  227. }
  228. top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: $.lrToken }, method: 'POST' });
  229. }