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.
 
 
 
 
 
 

214 lines
8.9 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 = '1';
  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. // 刷新
  38. $('#lr_refresh').on('click', function () {
  39. location.reload();
  40. });
  41. // 查看提交材料
  42. $('#lr_uploadView').on('click', function () {
  43. var ParentId = $('#gridtable').jfGridValue('MPId');
  44. var loginInfo = top.learun.clientdata.get(['userinfo']);
  45. if (learun.checkrow(ParentId)) {
  46. learun.layerFormForPercent({
  47. id: 'form',
  48. title: '提交材料',
  49. url: top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/IndexChildren?ParentId=' + ParentId + '&&MPUploaderTwo=' + loginInfo.userId,
  50. width: '80%',
  51. height: '80%',
  52. callBack: function (id) {
  53. return top[id].acceptClick(refreshGirdData);
  54. }
  55. });
  56. }
  57. });
  58. $('#lr_down').on('click', function () {
  59. var FileId = $('#gridtable').jfGridValue('MPFile');
  60. if (!!FileId) {
  61. var url = top.$.rootUrl + '/LR_SystemModule/Annexes/DownForm?keyVaule=' + FileId;
  62. learun.layerForm({
  63. id: 'downform',
  64. title: '文件下载',
  65. url: url,
  66. width: 600,
  67. height: 400,
  68. maxmin: true,
  69. btn: null
  70. });
  71. }
  72. });
  73. // 上传
  74. $('#lr_upload').on('click', function () {
  75. var keyValue = $('#gridtable').jfGridValue('MPId');
  76. if (learun.checkrow(keyValue)) {
  77. learun.layerForm({
  78. id: 'formupload',
  79. title: '上传',
  80. url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/UploadForm?keyValue=' + keyValue,
  81. width: 600,
  82. height: 400,
  83. callBack: function (id) {
  84. return top[id].acceptClick(refreshGirdData);
  85. }
  86. });
  87. }
  88. });
  89. },
  90. // 初始化列表
  91. initGird: function () {
  92. $('#gridtable').lrAuthorizeJfGrid({
  93. url: top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/GetPageList',
  94. headData: [
  95. { label: "学年", name: "MPAcademicYearNo", width: 100, align: "left" },
  96. { label: "学期", name: "MPSemester", width: 100, align: "left" },
  97. {
  98. label: "月份", name: "MPMonth", width: 100, align: "left",
  99. formatterAsync: function (callback, value, row, op, $cell) {
  100. learun.clientdata.getAsync('dataItem',
  101. {
  102. key: value,
  103. code: 'MPMonth',
  104. callback: function (_data) {
  105. callback(_data.text);
  106. }
  107. });
  108. }
  109. },
  110. //{
  111. // label: "模板材料", name: "MPFile", width: 200, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  112. // $.ajax({
  113. // url: '/LR_SystemModule/Annexes/GetAnnexesFileList',
  114. // data: { folderId: value },
  115. // type: 'GET',
  116. // dataType: "json",
  117. // async: false,
  118. // cache: false,
  119. // success: function (res) {
  120. // var bb = '';
  121. // $.each(res.data, function (i, item) {
  122. // bb += '<span onclick="downLoad(\'' +
  123. // item.F_Id +
  124. // '\',\'' + item.F_FolderId + '\')" style="color:blue">' +
  125. // item.F_FileName +
  126. // '</span>,&nbsp;&nbsp;&nbsp;';
  127. // })
  128. // callback(bb);
  129. // }
  130. // });
  131. // }
  132. //},
  133. { label: "材料名称", name: "MPProjectName", width: 100, align: "left" },
  134. {
  135. label: "上传文件",
  136. name: "MPFileTwo",
  137. width: 200,
  138. align: "left",
  139. formatterAsync: function (callback, value, row, op, $cell) {
  140. $.ajax({
  141. url: '/LR_SystemModule/Annexes/GetAnnexesFileList',
  142. data: { folderId: value },
  143. type: 'GET',
  144. dataType: "json",
  145. async: false,
  146. cache: false,
  147. success: function (res) {
  148. var bb = '';
  149. $.each(res.data, function (i, item) {
  150. bb += '<span onclick="downLoad(\'' +
  151. item.F_Id +
  152. '\',)" style="color:blue">' +
  153. item.F_FileName +
  154. '</span>,&nbsp;&nbsp;&nbsp;';
  155. })
  156. callback(bb);
  157. }
  158. });
  159. }
  160. },
  161. {
  162. label: "是否合格", name: "MPConclusion", width: 100, align: "left", formatter: function (val) {
  163. if (val === 1) {
  164. return "合格";
  165. } else if (val === 0) {
  166. return "不合格";
  167. } else {
  168. return "";
  169. }
  170. }
  171. },
  172. //{ label: "截止时间", name: "MPOverTime", width: 100, align: "left" },
  173. //{ label: "说明", name: "MPRemark", width: 200, align: "left" },
  174. ],
  175. mainId: 'ID',
  176. isPage: true
  177. });
  178. page.search();
  179. },
  180. search: function (param) {
  181. param = param || {};
  182. if (isUser) {
  183. param.isUser = 'true';
  184. }
  185. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  186. }
  187. };
  188. refreshGirdData = function () {
  189. page.search();
  190. };
  191. page.init();
  192. }
  193. function downLoad(fileId, fileTwo) {
  194. if (fileTwo) {
  195. top.learun.postFormSilence(top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/AddRecord', { fileId: fileTwo }, function () {
  196. });
  197. }
  198. top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: $.lrToken }, method: 'POST' });
  199. }