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.

ReadIndex.js 6.9 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2021-06-01 11:49
  5. * 描 述:收文报告
  6. */
  7. var refreshGirdData;
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var processId = '';
  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. }, 100, 400);
  20. $('#WorkName').lrDataItemSelect({ code: 'Dispatch' });
  21. // 刷新
  22. $('#lr_refresh').on('click', function () {
  23. location.reload();
  24. });
  25. //查阅
  26. $('#lr_read').on('click', function () {
  27. var keyValue = $('#gridtable').jfGridValue('Id');
  28. var reader = $('#gridtable').jfGridValue('Reader');
  29. if (learun.checkrow(keyValue)) {
  30. var FlowNo = $('#gridtable').jfGridValue('FlowNo');
  31. if (FlowNo != 2) {
  32. learun.alert.warning("当前项目不能查阅!");
  33. return;
  34. }
  35. learun.layerForm({
  36. id: 'form',
  37. title: '查阅',
  38. url: top.$.rootUrl + '/EducationalAdministration/Dispatch/ReadForm?keyValue=' + keyValue +'&reader='+reader,
  39. width: 800,
  40. height: 380,
  41. callBack: function (id) {
  42. learun.postForm(top.$.rootUrl + '/EducationalAdministration/Dispatch/Read', { keyValue: keyValue ,reader: reader }, function (res) {
  43. });
  44. }
  45. });
  46. }
  47. });
  48. },
  49. // 初始化列表
  50. initGird: function () {
  51. $('#gridtable').lrAuthorizeJfGrid({
  52. url: top.$.rootUrl + '/EducationalAdministration/Dispatch/GetPageList',
  53. headData: [
  54. {
  55. label: "来源",name: "WorkName",width: 300,align: "center",
  56. formatterAsync: function(callback, value, row, op, $cell) {
  57. learun.clientdata.getAsync('dataItem',
  58. {
  59. key: value,
  60. code: 'Dispatch',
  61. callback: function(_data) {
  62. callback(_data.text);
  63. }
  64. });
  65. }
  66. },
  67. { label: "来文单位", name: "DisFrom", width: 300, align: "center" },
  68. { label: "字", name: "DisWork", width: 100, align: "center" },
  69. { label: "号", name: "DisMark", width: 100, align: "center" },
  70. //{ label: "份数", name: "Copies", width: 100, align: "center" },
  71. { label: "年", name: "DisYear", width: 100, align: "center" },
  72. { label: "月", name: "DisMonth", width: 100, align: "center" },
  73. { label: "日", name: "DisDay", width: 100, align: "center" },
  74. { label: "事由", name: "Reasons", width: 400, align: "center" ,
  75. formatterAsync: function (callback, value, row, op, $cell) {
  76. $.ajax({
  77. url: '/LR_SystemModule/Annexes/GetAnnexesFileList',
  78. data: { folderId: value },
  79. type: 'GET',
  80. dataType: "json",
  81. async: false,
  82. cache: false,
  83. success: function (res) {
  84. var bb = '';
  85. $.each(res.data, function (i, item) {
  86. bb += item.F_FileName.substring(0, item.F_FileName.indexOf("."))
  87. })
  88. callback(bb);
  89. }
  90. });
  91. }},
  92. { label: "传阅人员", name: "Reader", width: 100, align: "center",hidden:true},
  93. //{ label: "呈送意见", name: "Render", width: 200, align: "center" },
  94. //{ label: "呈送时间", name: "RenderDate", width: 100, align: "center" },
  95. //{
  96. {
  97. label: "审批状态", name: "FlowNo", width: 100, align: "center",
  98. formatter: function (cellvalue, row) {
  99. if (cellvalue == 0) {
  100. return '<span class=\"label label-warning\">草稿</span>';
  101. } if (cellvalue == 1) {
  102. return '<span class=\"label label-warning\">审批中</span>';
  103. } else if (cellvalue == 2) {
  104. return '<span class=\"label label-success\">审批通过</span>';
  105. }
  106. }
  107. }
  108. ],
  109. mainId: 'Id',
  110. isPage: true
  111. });
  112. page.search();
  113. },
  114. search: function (param) {
  115. param = param || {};
  116. param.userId = userId;
  117. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  118. },
  119. downLoad: function (fileId) {
  120. top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: top.$.lrToken }, method: 'POST' });
  121. }
  122. };
  123. refreshGirdData = function (res, postData) {
  124. if (res.code == 200) {
  125. // 发起流程
  126. var postData = {
  127. //schemeCode: 'Dispatch',// 本地
  128. schemeCode: 'DBSW',//线上
  129. processId: processId,
  130. level: '1',
  131. };
  132. learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) {
  133. learun.loading(false);
  134. });
  135. page.search();
  136. }
  137. };
  138. page.init();
  139. }
  140. function downLoad(fileId, fileTwo) {
  141. if (fileTwo) {
  142. top.learun.postFormSilence(top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/AddRecord', { fileId: fileTwo }, function () {
  143. });
  144. }
  145. top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: $.lrToken }, method: 'POST' });
  146. }