選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 
 

288 行
12 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 上海力软信息技术有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-09-24 15:37
  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_QualityObjectives/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. if (keyValue.indexOf(',') != -1) {
  76. learun.alert.warning("只能选择一条记录进行编辑!");
  77. return;
  78. }
  79. learun.layerForm({
  80. id: 'form',
  81. title: '编辑',
  82. url: top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/Form?keyValue=' + keyValue,
  83. width: 600,
  84. height: 400,
  85. callBack: function (id) {
  86. return top[id].acceptClick(refreshGirdData);
  87. }
  88. });
  89. }
  90. });
  91. // 删除
  92. $('#lr_delete').on('click', function () {
  93. var keyValue = $('#gridtable').jfGridValue('MPId');
  94. if (learun.checkrow(keyValue)) {
  95. learun.layerConfirm('是否确认删除该项!', function (res) {
  96. if (res) {
  97. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/DeleteForm', { keyValue: keyValue }, function () {
  98. refreshGirdData();
  99. });
  100. }
  101. });
  102. }
  103. });
  104. // 查看提交材料
  105. $('#lr_uploadView').on('click', function () {
  106. var keyValue = $('#gridtable').jfGridValue('MPId');
  107. if (learun.checkrow(keyValue)) {
  108. if (keyValue.indexOf(',') != -1) {
  109. learun.alert.warning("只能选择一条记录进行编辑!");
  110. return;
  111. }
  112. learun.layerFormForPercent({
  113. id: 'form',
  114. title: '提交材料',
  115. url: top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/IndexChildren?ParentId=' + keyValue,
  116. width: '80%',
  117. height: '80%',
  118. callBack: function (id) {
  119. return top[id].acceptClick(refreshGirdData);
  120. }
  121. });
  122. }
  123. });
  124. //访问情况统计
  125. $("#lr_statistics").on('click', function () {
  126. var keyValue = $('#gridtable').jfGridValue('MPId');
  127. if (learun.checkrow(keyValue)) {
  128. if (keyValue.indexOf(',') != -1) {
  129. learun.alert.warning("只能选择一条记录进行编辑!");
  130. return;
  131. }
  132. learun.layerFormForPercent({
  133. id: 'form',
  134. title: '访问情况统计',
  135. url: top.$.rootUrl + '/PersonnelManagement/MP_BrowseRecord/Index?keyValue=' + keyValue,
  136. width: '70%',
  137. height: '70%',
  138. btn: null
  139. });
  140. }
  141. });
  142. // 合格
  143. $('#lr_qualified').on('click', function () {
  144. var keyValue = $('#gridtable').jfGridValue('MPId');
  145. if (learun.checkrow(keyValue)) {
  146. learun.layerConfirm('是否确认合格!', function (res) {
  147. if (res) {
  148. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/Qqualified', {keyValue:keyValue, status: true }, function () {
  149. refreshGirdData();
  150. });
  151. }
  152. });
  153. }
  154. });
  155. // 不合格
  156. $('#lr_noqualified').on('click', function () {
  157. var keyValue = $('#gridtable').jfGridValue('MPId');
  158. if (learun.checkrow(keyValue)) {
  159. learun.layerConfirm('是否确认不合格!', function (res) {
  160. if (res) {
  161. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/Qqualified', {keyValue:keyValue, status: false }, function () {
  162. refreshGirdData();
  163. });
  164. }
  165. });
  166. }
  167. });
  168. // 打印
  169. $('#lr_print').on('click', function () {
  170. $('#gridtable').jqprintTable();
  171. });
  172. },
  173. // 初始化列表
  174. initGird: function () {
  175. $('#gridtable').lrAuthorizeJfGrid({
  176. url: top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/GetPageList',
  177. headData: [
  178. { label: "年度", name: "MPAcademicYearNo", width: 100, align: "left" },
  179. //{ label: "学期", name: "MPSemester", width: 100, align: "left" },
  180. {
  181. label: "月份", name: "MPMonth", width: 100, align: "left"
  182. },
  183. {
  184. label: "部门", name: "MPDepartment", width: 250, align: "left",
  185. formatterAsync: function (callback, value, row, op, $cell) {
  186. learun.httpAsyncGet(top.$.rootUrl + '/LR_OrganizationModule/Department/GetDepartmentList?listId=' + value, function (res) {
  187. console.log(res);
  188. if (res.code == learun.httpCode.success) {
  189. callback(res.data);
  190. }
  191. });
  192. }
  193. },
  194. {
  195. label: "接收人", name: "MPReceiveUser", width: 250, align: "left",
  196. formatterAsync: function (callback, value, row, op, $cell) {
  197. learun.httpAsyncGet(top.$.rootUrl + '/LR_OrganizationModule/User/GetListByUserIds?keyValue=' + value, function (res) {
  198. if (res.code == learun.httpCode.success) {
  199. callback(res.data);
  200. }
  201. });
  202. }
  203. },
  204. { label: "材料名称", name: "MPProjectName", width: 100, align: "left" },
  205. {
  206. label: "上传文件",
  207. name: "MPFileTwo",
  208. width: 200,
  209. align: "left",
  210. formatterAsync: function (callback, value, row, op, $cell) {
  211. $.ajax({
  212. url: '/LR_SystemModule/Annexes/GetAnnexesFileList',
  213. data: { folderId: value },
  214. type: 'GET',
  215. dataType: "json",
  216. async: false,
  217. cache: false,
  218. success: function (res) {
  219. var bb = '';
  220. $.each(res.data, function (i, item) {
  221. bb += '<span onclick="downLoad(\'' +
  222. item.F_Id +
  223. '\',)" style="color:blue">' +
  224. item.F_FileName +
  225. '</span>,&nbsp;&nbsp;&nbsp;';
  226. })
  227. callback(bb);
  228. }
  229. });
  230. }
  231. },
  232. {
  233. label: "是否合格", name: "MPConclusion", width: 100, align: "left", formatter: function (val) {
  234. if (val === 1) {
  235. return "合格";
  236. } else if (val === 0) {
  237. return "不合格";
  238. } else {
  239. return "";
  240. }
  241. }
  242. },
  243. ],
  244. mainId: 'ID',
  245. sidx: 'cast(MPMonth as int) asc',
  246. isPage: true,
  247. isMultiselect: true
  248. });
  249. page.search();
  250. },
  251. search: function (param) {
  252. param = param || {};
  253. if (isUser) {
  254. param.isUser = 'true';
  255. }
  256. if (!param.MPAcademicYearNo) {
  257. var jsdate = new Date();
  258. param.MPAcademicYearNo = jsdate.getFullYear();
  259. }
  260. if (!param.MPMonth) {
  261. var jsdate = new Date();
  262. param.MPMonth = jsdate.getMonth() + 1;
  263. }
  264. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  265. }
  266. };
  267. refreshGirdData = function () {
  268. page.search();
  269. };
  270. page.init();
  271. }
  272. function downLoad(fileId, fileTwo) {
  273. if (fileTwo) {
  274. top.learun.postFormSilence(top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/AddRecord', { fileId: fileTwo }, function () {
  275. });
  276. }
  277. top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: $.lrToken }, method: 'POST' });
  278. }