25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

IndexManagement.js 12 KiB

4 년 전
4 년 전
4 년 전
4 년 전
4 년 전
4 년 전
4 년 전
4 년 전
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  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. learun.layerForm({
  76. id: 'form',
  77. title: '编辑',
  78. url: top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/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_delete').on('click', function () {
  89. var keyValue = $('#gridtable').jfGridValue('MPId');
  90. if (learun.checkrow(keyValue)) {
  91. learun.layerConfirm('是否确认删除该项!', function (res) {
  92. if (res) {
  93. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/DeleteForm', { keyValue: keyValue }, function () {
  94. refreshGirdData();
  95. });
  96. }
  97. });
  98. }
  99. });
  100. // 查看提交材料
  101. $('#lr_uploadView').on('click', function () {
  102. var keyValue = $('#gridtable').jfGridValue('MPId');
  103. if (learun.checkrow(keyValue)) {
  104. learun.layerFormForPercent({
  105. id: 'form',
  106. title: '提交材料',
  107. url: top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/IndexChildren?ParentId=' + keyValue,
  108. width: '80%',
  109. height: '80%',
  110. callBack: function (id) {
  111. return top[id].acceptClick(refreshGirdData);
  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_QualityObjectives/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. console.log(res);
  186. if (res.code == learun.httpCode.success) {
  187. callback(res.data);
  188. }
  189. });
  190. }
  191. },
  192. {
  193. label: "接收人", name: "MPReceiveUser", width: 250, align: "left",
  194. formatterAsync: function (callback, value, row, op, $cell) {
  195. learun.httpAsyncGet(top.$.rootUrl + '/LR_OrganizationModule/User/GetListByUserIds?keyValue=' + value, function (res) {
  196. if (res.code == learun.httpCode.success) {
  197. callback(res.data);
  198. }
  199. });
  200. }
  201. },
  202. { label: "材料名称", name: "MPProjectName", width: 100, align: "left" },
  203. {
  204. label: "上传文件",
  205. name: "MPFileTwo",
  206. width: 200,
  207. align: "left",
  208. formatterAsync: function (callback, value, row, op, $cell) {
  209. $.ajax({
  210. url: '/LR_SystemModule/Annexes/GetAnnexesFileList',
  211. data: { folderId: value },
  212. type: 'GET',
  213. dataType: "json",
  214. async: false,
  215. cache: false,
  216. success: function (res) {
  217. var bb = '';
  218. $.each(res.data, function (i, item) {
  219. bb += '<span onclick="downLoad(\'' +
  220. item.F_Id +
  221. '\',)" style="color:blue">' +
  222. item.F_FileName +
  223. '</span>,&nbsp;&nbsp;&nbsp;';
  224. })
  225. callback(bb);
  226. }
  227. });
  228. }
  229. },
  230. {
  231. label: "是否合格", name: "MPConclusion", width: 100, align: "left", formatter: function (val) {
  232. if (val === 1) {
  233. return "合格";
  234. } else if (val === 0) {
  235. return "不合格";
  236. } else {
  237. return "";
  238. }
  239. }
  240. },
  241. ],
  242. mainId: 'ID',
  243. isPage: true
  244. });
  245. page.search();
  246. },
  247. search: function (param) {
  248. param = param || {};
  249. if (isUser) {
  250. param.isUser = 'true';
  251. }
  252. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  253. }
  254. };
  255. refreshGirdData = function () {
  256. page.search();
  257. };
  258. page.init();
  259. }
  260. function downLoad(fileId, fileTwo) {
  261. if (fileTwo) {
  262. top.learun.postFormSilence(top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/AddRecord', { fileId: fileTwo }, function () {
  263. });
  264. }
  265. top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: $.lrToken }, method: 'POST' });
  266. }