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.
 
 
 
 
 
 

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