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.
 
 
 
 
 
 

288 lines
12 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. console.log(val);
  47. var departmentIds = val.id;
  48. $('#MPReceiveUser').lrselectRefresh({
  49. url: top.$.rootUrl + '/LR_OrganizationModule/User/GetListByDepartmentIds?departmentId=' + departmentIds
  50. })
  51. }
  52. });
  53. $('#MPReceiveUser').lrselect({ type: 'default', allowSearch: true, value: 'F_UserId', text: 'F_RealName' })
  54. // 刷新
  55. $('#lr_refresh').on('click', function () {
  56. location.reload();
  57. });
  58. // 新增
  59. $('#lr_add').on('click', function () {
  60. learun.layerForm({
  61. id: 'form',
  62. title: '新增',
  63. url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/Form',
  64. width: 600,
  65. height: 400,
  66. callBack: function (id) {
  67. return top[id].acceptClick(refreshGirdData);
  68. }
  69. });
  70. });
  71. // 编辑
  72. $('#lr_edit').on('click', function () {
  73. var keyValue = $('#gridtable').jfGridValue('MPId');
  74. if (learun.checkrow(keyValue)) {
  75. learun.layerForm({
  76. id: 'form',
  77. title: '编辑',
  78. url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/Form?keyValue=' + keyValue,
  79. width: 600,
  80. height: 400,
  81. callBack: function (id) {
  82. return top[id].acceptClick(refreshGirdData);
  83. }
  84. });
  85. }
  86. });
  87. // 查看提交材料
  88. $('#lr_uploadView').on('click', function () {
  89. var keyValue = $('#gridtable').jfGridValue('MPId');
  90. if (learun.checkrow(keyValue)) {
  91. learun.layerFormForPercent({
  92. id: 'form',
  93. title: '提交材料',
  94. url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/IndexChildren?ParentId=' + keyValue,
  95. width: '80%',
  96. height: '80%',
  97. callBack: function (id) {
  98. return top[id].acceptClick(refreshGirdData);
  99. }
  100. });
  101. }
  102. });
  103. // 删除
  104. $('#lr_delete').on('click', function () {
  105. var keyValue = $('#gridtable').jfGridValue('MPId');
  106. if (learun.checkrow(keyValue)) {
  107. learun.layerConfirm('是否确认删除该项!', function (res) {
  108. if (res) {
  109. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/DeleteForm', { keyValue: keyValue }, function () {
  110. refreshGirdData();
  111. });
  112. }
  113. });
  114. }
  115. });
  116. //访问情况统计
  117. $("#lr_statistics").on('click', function () {
  118. var keyValue = $('#gridtable').jfGridValue('MPId');
  119. if (learun.checkrow(keyValue)) {
  120. learun.layerFormForPercent({
  121. id: 'form',
  122. title: '访问情况统计',
  123. url: top.$.rootUrl + '/PersonnelManagement/MP_BrowseRecord/Index?keyValue=' + keyValue,
  124. width: '70%',
  125. height: '70%',
  126. btn: null
  127. });
  128. }
  129. });
  130. // 合格
  131. $('#lr_qualified').on('click', function () {
  132. var keyValue = $('#gridtable').jfGridValue('MPId');
  133. if (learun.checkrow(keyValue)) {
  134. learun.layerConfirm('是否确认合格!', function (res) {
  135. if (res) {
  136. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/Qqualified', {keyValue:keyValue, status: true }, function () {
  137. refreshGirdData();
  138. });
  139. }
  140. });
  141. }
  142. });
  143. // 不合格
  144. $('#lr_noqualified').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: false }, function () {
  150. refreshGirdData();
  151. });
  152. }
  153. });
  154. }
  155. });
  156. // 打印
  157. $('#lr_print').on('click', function () {
  158. $('#gridtable').jqprintTable();
  159. });
  160. },
  161. // 初始化列表
  162. initGird: function () {
  163. $('#gridtable').lrAuthorizeJfGrid({
  164. url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/GetPageList',
  165. headData: [
  166. { label: "学年", name: "MPAcademicYearNo", width: 100, align: "left" },
  167. { label: "学期", name: "MPSemester", width: 100, align: "left" },
  168. {
  169. label: "月份", name: "MPMonth", width: 100, align: "left",
  170. formatterAsync: function (callback, value, row, op, $cell) {
  171. learun.clientdata.getAsync('dataItem',
  172. {
  173. key: value,
  174. code: 'MPMonth',
  175. callback: function (_data) {
  176. callback(_data.text);
  177. }
  178. });
  179. }
  180. },
  181. {
  182. label: "部门", name: "MPDepartment", width: 250, align: "left",
  183. formatterAsync: function (callback, value, row, op, $cell) {
  184. learun.httpAsyncGet(top.$.rootUrl + '/LR_OrganizationModule/Department/GetDepartmentList?listId=' + value, function (res) {
  185. if (res.code == learun.httpCode.success) {
  186. callback(res.data);
  187. }
  188. });
  189. }
  190. },
  191. {
  192. label: "接收人", name: "MPReceiveUser", width: 250, align: "left",
  193. formatterAsync: function (callback, value, row, op, $cell) {
  194. learun.httpAsyncGet(top.$.rootUrl + '/LR_OrganizationModule/User/GetListByUserIds?keyValue=' + value, function (res) {
  195. if (res.code == learun.httpCode.success) {
  196. callback(res.data);
  197. }
  198. });
  199. }
  200. },
  201. { label: "材料名称", name: "MPProjectName", width: 150, align: "left" },
  202. {
  203. label: "上传文件",
  204. name: "MPFileTwo",
  205. width: 200,
  206. align: "left",
  207. formatterAsync: function (callback, value, row, op, $cell) {
  208. $.ajax({
  209. url: '/LR_SystemModule/Annexes/GetAnnexesFileList',
  210. data: { folderId: value },
  211. type: 'GET',
  212. dataType: "json",
  213. async: false,
  214. cache: false,
  215. success: function (res) {
  216. var bb = '';
  217. $.each(res.data, function (i, item) {
  218. bb += '<span onclick="downLoad(\'' +
  219. item.F_Id +
  220. '\',)" style="color:blue">' +
  221. item.F_FileName +
  222. '</span>,&nbsp;&nbsp;&nbsp;';
  223. })
  224. callback(bb);
  225. }
  226. });
  227. }
  228. },
  229. {
  230. label: "是否合格", name: "MPConclusion", width: 100, align: "left", formatter: function (val) {
  231. if (val===1) {
  232. return "合格";
  233. } else if (val===0) {
  234. return "不合格";
  235. } else {
  236. return "";
  237. }
  238. }
  239. },
  240. ],
  241. mainId: 'MPId',
  242. isPage: true
  243. })
  244. page.search();
  245. },
  246. search: function (param) {
  247. param = param || {};
  248. if (isUser) {
  249. param.isUser = 'true';
  250. }
  251. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  252. },
  253. downLoad: function (fileId) {
  254. top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: top.$.lrToken }, method: 'POST' });
  255. }
  256. };
  257. refreshGirdData = function () {
  258. page.search();
  259. };
  260. page.init();
  261. }
  262. function downLoad(fileId, fileTwo) {
  263. if (fileTwo) {
  264. top.learun.postFormSilence(top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/AddRecord', { fileId: fileTwo }, function () {
  265. });
  266. }
  267. top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: $.lrToken }, method: 'POST' });
  268. }