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.

IndexManagement.js 16 KiB

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