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.
 
 
 
 
 
 

335 lines
14 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 = request('isUser');
  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. $('#MPDepartment').lrselect({
  38. type: 'tree',
  39. // 展开最大高度
  40. maxHeight: 200,
  41. // 是否允许搜索
  42. allowSearch: true,
  43. // 访问数据接口地址
  44. url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree',
  45. select: function (val) {
  46. if (val) {
  47. var departmentIds = val.id;
  48. $('#MPReceiveUser').lrselectRefresh({
  49. url: top.$.rootUrl + '/LR_OrganizationModule/User/GetListByDepartmentIds?departmentId=' + departmentIds
  50. });
  51. }
  52. }
  53. });
  54. $('#MPReceiveUser').lrselect({ type: 'default', allowSearch: true, value: 'F_UserId', text: 'F_RealName' })
  55. // 刷新
  56. $('#lr_refresh').on('click', function () {
  57. location.reload();
  58. });
  59. // 新增
  60. $('#lr_add').on('click', function () {
  61. learun.layerForm({
  62. id: 'form',
  63. title: '新增',
  64. url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/Form',
  65. width: 600,
  66. height: 400,
  67. callBack: function (id) {
  68. return top[id].acceptClick(refreshGirdData);
  69. }
  70. });
  71. });
  72. // 编辑
  73. $('#lr_edit').on('click', function () {
  74. var keyValue = $('#gridtable').jfGridValue('MPId');
  75. if (learun.checkrow(keyValue)) {
  76. if (keyValue.indexOf(',') != -1) {
  77. learun.alert.warning("只能选择一条记录进行编辑!");
  78. return;
  79. }
  80. learun.layerForm({
  81. id: 'form',
  82. title: '编辑',
  83. url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/Form?keyValue=' + keyValue,
  84. width: 600,
  85. height: 400,
  86. callBack: function (id) {
  87. return top[id].acceptClick(refreshGirdData);
  88. }
  89. });
  90. }
  91. });
  92. // 查看提交材料
  93. $('#lr_uploadView').on('click', function () {
  94. var keyValue = $('#gridtable').jfGridValue('MPId');
  95. if (learun.checkrow(keyValue)) {
  96. if (keyValue.indexOf(',') != -1) {
  97. learun.alert.warning("只能选择一条记录进行操作!");
  98. return;
  99. }
  100. learun.layerFormForPercent({
  101. id: 'form',
  102. title: '提交材料',
  103. url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/IndexChildren?ParentId=' + keyValue,
  104. width: '80%',
  105. height: '80%',
  106. callBack: function (id) {
  107. return top[id].acceptClick(refreshGirdData);
  108. }
  109. });
  110. }
  111. });
  112. // 删除
  113. $('#lr_delete').on('click', function () {
  114. var keyValue = $('#gridtable').jfGridValue('MPId');
  115. if (learun.checkrow(keyValue)) {
  116. learun.layerConfirm('是否确认删除该项!', function (res) {
  117. if (res) {
  118. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/DeleteForm', { keyValue: keyValue }, function () {
  119. refreshGirdData();
  120. });
  121. }
  122. });
  123. }
  124. });
  125. //访问情况统计
  126. $("#lr_statistics").on('click', function () {
  127. var keyValue = $('#gridtable').jfGridValue('MPId');
  128. if (learun.checkrow(keyValue)) {
  129. if (keyValue.indexOf(',') != -1) {
  130. learun.alert.warning("只能选择一条记录进行操作!");
  131. return;
  132. }
  133. learun.layerFormForPercent({
  134. id: 'form',
  135. title: '访问情况统计',
  136. url: top.$.rootUrl + '/PersonnelManagement/MP_BrowseRecord/Index?keyValue=' + keyValue,
  137. width: '70%',
  138. height: '70%',
  139. btn: null
  140. });
  141. }
  142. });
  143. // 合格
  144. $('#lr_qualified').on('click', function () {
  145. var keyValue = $('#gridtable').jfGridValue('MPId');
  146. if (learun.checkrow(keyValue)) {
  147. learun.layerConfirm('是否确认合格!', function (res) {
  148. if (res) {
  149. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/Qqualified', { keyValue: keyValue, status: true }, function () {
  150. refreshGirdData();
  151. });
  152. }
  153. });
  154. }
  155. });
  156. // 不合格
  157. $('#lr_noqualified').on('click', function () {
  158. var keyValue = $('#gridtable').jfGridValue('MPId');
  159. if (learun.checkrow(keyValue)) {
  160. learun.layerConfirm('是否确认不合格!', function (res) {
  161. if (res) {
  162. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/Qqualified', { keyValue: keyValue, status: false }, function () {
  163. refreshGirdData();
  164. });
  165. }
  166. });
  167. }
  168. });
  169. // 打印
  170. $('#lr_print').on('click', function () {
  171. $('#gridtable').jqprintTable();
  172. });
  173. },
  174. // 初始化列表
  175. initGird: function () {
  176. $('#gridtable').lrAuthorizeJfGrid({
  177. url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/GetPageList',
  178. headData: [
  179. { label: "年度", name: "MPAcademicYearNo", width: 100, align: "left" },
  180. //{ label: "学期", name: "MPSemester", width: 100, align: "left" },
  181. //2021-03-29 客户要求改成1、2、3
  182. //{
  183. // label: "月份", name: "MPMonth", width: 100, align: "left",
  184. // formatterAsync: function (callback, value, row, op, $cell) {
  185. // learun.clientdata.getAsync('dataItem',
  186. // {
  187. // key: value,
  188. // code: 'MPMonth',
  189. // callback: function (_data) {
  190. // callback(_data.text);
  191. // }
  192. // });
  193. // }
  194. //},
  195. {
  196. label: "月份", name: "MPMonth", width: 100, align: "left"
  197. },
  198. {
  199. label: "部门", name: "MPDepartment", width: 250, align: "left",
  200. formatterAsync: function (callback, value, row, op, $cell) {
  201. learun.httpAsyncGet(top.$.rootUrl + '/LR_OrganizationModule/Department/GetDepartmentList?listId=' + value, function (res) {
  202. if (res.code == learun.httpCode.success) {
  203. callback(res.data);
  204. }
  205. });
  206. }
  207. },
  208. {
  209. label: "上传人", name: "MPUploader", width: 250, align: "left",
  210. formatterAsync: function (callback, value, row, op, $cell) {
  211. learun.clientdata.getAsync('custmerData', {
  212. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata',
  213. key: value,
  214. keyId: 'f_userid',
  215. callback: function (_data) {
  216. callback(_data['f_realname']);
  217. }
  218. });
  219. }
  220. //formatterAsync: function (callback, value, row, op, $cell) {
  221. // learun.httpAsyncGet(top.$.rootUrl + '/LR_OrganizationModule/User/GetListByUserIds?keyValue=' + value, function (res) {
  222. // if (res.code == learun.httpCode.success) {
  223. // callback(res.data);
  224. // }
  225. // });
  226. //}
  227. },
  228. //{
  229. // label: "接收人", name: "MPReceiveUser", width: 250, align: "left",
  230. // formatterAsync: function (callback, value, row, op, $cell) {
  231. // learun.httpAsyncGet(top.$.rootUrl + '/LR_OrganizationModule/User/GetListByUserIds?keyValue=' + value, function (res) {
  232. // if (res.code == learun.httpCode.success) {
  233. // callback(res.data);
  234. // }
  235. // });
  236. // }
  237. //},
  238. { label: "材料名称", name: "MPProjectName", width: 150, align: "left" },
  239. {
  240. label: "上传材料",
  241. name: "MPFileTwo",
  242. width: 200,
  243. align: "left",
  244. formatterAsync: function (callback, value, row, op, $cell) {
  245. $.ajax({
  246. url: '/LR_SystemModule/Annexes/GetAnnexesFileList',
  247. data: { folderId: value },
  248. type: 'GET',
  249. dataType: "json",
  250. async: false,
  251. cache: false,
  252. success: function (res) {
  253. var bb = '';
  254. $.each(res.data, function (i, item) {
  255. bb += '<span onclick="downLoad(\'' +
  256. item.F_Id +
  257. '\',)" style="color:blue">' +
  258. item.F_FileName +
  259. '</span>,&nbsp;&nbsp;&nbsp;';
  260. })
  261. callback(bb);
  262. }
  263. });
  264. }
  265. },
  266. {
  267. label: "是否合格", name: "MPConclusion", width: 100, align: "left", formatter: function (val) {
  268. if (val === 1) {
  269. return "合格";
  270. } else if (val === 0) {
  271. return "不合格";
  272. } else {
  273. return "";
  274. }
  275. }
  276. },
  277. ],
  278. mainId: 'MPId',
  279. sidx: 'cast(MPMonth as int) asc',
  280. isPage: true,
  281. isMultiselect: true
  282. })
  283. page.search();
  284. },
  285. search: function (param) {
  286. param = param || {};
  287. if (isUser) {
  288. param.isUser = 'true';
  289. }
  290. if (!param.MPAcademicYearNo) {
  291. var jsdate = new Date();
  292. param.MPAcademicYearNo = jsdate.getFullYear();
  293. }
  294. if (!param.MPMonth) {
  295. var jsdate = new Date();
  296. param.MPMonth = jsdate.getMonth() + 1;
  297. }
  298. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  299. },
  300. downLoad: function (fileId) {
  301. top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: top.$.lrToken }, method: 'POST' });
  302. }
  303. };
  304. refreshGirdData = function () {
  305. page.search();
  306. };
  307. page.init();
  308. }
  309. function downLoad(fileId, fileTwo) {
  310. if (fileTwo) {
  311. top.learun.postFormSilence(top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/AddRecord', { fileId: fileTwo }, function () {
  312. });
  313. }
  314. top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: $.lrToken }, method: 'POST' });
  315. }