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.

IndexOfMyApply.js 13 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2021-02-21 10:07
  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. }, 220, 400);
  20. $('#MeetingPlace').lrselect({
  21. allowSearch: true,
  22. url: top.$.rootUrl + '/PersonnelManagement/ConferenceRoom/GetList',
  23. value: "ID",
  24. text: "Name"
  25. });
  26. $('#CreateUser').lrUserSelect(0);
  27. // 刷新
  28. $('#lr_refresh').on('click', function () {
  29. location.reload();
  30. });
  31. // 新增
  32. $('#lr_add').on('click', function () {
  33. learun.layerForm({
  34. id: 'addform',
  35. title: '新增',
  36. url: top.$.rootUrl + '/PersonnelManagement/MeetingManagement/Form',
  37. width: 1000,
  38. height: 800,
  39. callBack: function (id) {
  40. var res = false;
  41. // 验证数据
  42. res = top[id].validForm();
  43. // 保存数据
  44. if (res) {
  45. res = top[id].save('', function () {
  46. page.search();
  47. });
  48. }
  49. return res;
  50. }
  51. });
  52. });
  53. // 编辑
  54. $('#lr_edit').on('click', function () {
  55. var keyValue = $('#gridtable').jfGridValue('Id');
  56. if (learun.checkrow(keyValue)) {
  57. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  58. if (CheckStatus == "1") {
  59. learun.alert.warning("当前项已审核通过!");
  60. return false;
  61. } else if (CheckStatus == "3") {
  62. learun.alert.warning("当前项审核中!");
  63. return false;
  64. }
  65. learun.layerForm({
  66. id: 'editform',
  67. title: '编辑',
  68. url: top.$.rootUrl + '/PersonnelManagement/MeetingManagement/Form?keyValue=' + keyValue,
  69. width: 1000,
  70. height: 800,
  71. callBack: function (id) {
  72. var res = false;
  73. // 验证数据
  74. res = top[id].validForm();
  75. // 保存数据
  76. if (res) {
  77. res = top[id].save('', function () {
  78. page.search();
  79. });
  80. }
  81. return res;
  82. }
  83. });
  84. }
  85. });
  86. // 删除
  87. $('#lr_delete').on('click', function () {
  88. var keyValue = $('#gridtable').jfGridValue('Id');
  89. if (learun.checkrow(keyValue)) {
  90. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  91. if (CheckStatus != "0") {
  92. learun.alert.warning("当前项已审核或审核中!");
  93. return false;
  94. }
  95. learun.layerConfirm('是否确认删除该项!', function (res) {
  96. if (res) {
  97. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/MeetingManagement/DeleteForm', { keyValue: keyValue }, function () {
  98. refreshGirdData();
  99. });
  100. }
  101. });
  102. }
  103. });
  104. // 查看
  105. $('#lr_view').on('click', function () {
  106. var keyValue = $('#gridtable').jfGridValue('Id');
  107. if (learun.checkrow(keyValue)) {
  108. learun.layerForm({
  109. id: 'viewform',
  110. title: '查看会议工作',
  111. url: top.$.rootUrl + '/PersonnelManagement/MeetingManagement/FormView?keyValue=' + keyValue,
  112. width: 1000,
  113. height: 800,
  114. btn: null
  115. });
  116. }
  117. });
  118. //提交
  119. $('#lr_submit').on('click', function () {
  120. var keyValue = $('#gridtable').jfGridValue('Id');
  121. if (learun.checkrow(keyValue)) {
  122. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  123. if (CheckStatus == "1") {
  124. learun.alert.warning("当前项已审核通过!");
  125. return false;
  126. } else if (CheckStatus == "3") {
  127. learun.alert.warning("当前项审核中!");
  128. return false;
  129. }
  130. learun.layerConfirm('是否确认提交该项!', function (res) {
  131. if (res) {
  132. processId = learun.newGuid();
  133. learun.postForm(top.$.rootUrl + '/PersonnelManagement/MeetingManagement/DoSubmit', { keyValue: keyValue, status: '3', processId: processId }, function (res) {
  134. refreshGirdData(res, {});
  135. });
  136. }
  137. });
  138. }
  139. });
  140. // 纪要
  141. $('#lr_minutes').on('click', function () {
  142. var keyValue = $('#gridtable').jfGridValue('Id');
  143. if (learun.checkrow(keyValue)) {
  144. learun.layerForm({
  145. id: 'MeetingMinutesIndex',
  146. title: '会议纪要',
  147. url: top.$.rootUrl + '/PersonnelManagement/MeetingMinutes/Index?MeetID=' + keyValue,
  148. width: 1000,
  149. height: 800,
  150. btn: null
  151. });
  152. }
  153. });
  154. // 通知
  155. $('#lr_notice').on('click', function () {
  156. var keyValue = $('#gridtable').jfGridValue('Id');
  157. if (learun.checkrow(keyValue)) {
  158. learun.layerForm({
  159. id: 'MeetingNoticeIndex',
  160. title: '会议通知',
  161. url: top.$.rootUrl + '/PersonnelManagement/MeetingNotice/Index?MeetID=' + keyValue,
  162. width: 1000,
  163. height: 800,
  164. btn: null
  165. });
  166. }
  167. });
  168. // 审核通过
  169. $('#lr_checkyes').on('click', function () {
  170. var keyValue = $('#gridtable').jfGridValue('Id');
  171. if (learun.checkrow(keyValue)) {
  172. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  173. if (CheckStatus == '1') {
  174. learun.alert.warning("该项已审核通过!");
  175. return false;
  176. }
  177. learun.layerConfirm('是否确认审核通过该项!', function (res) {
  178. if (res) {
  179. learun.postForm(top.$.rootUrl + '/PersonnelManagement/MeetingManagement/DoCheck', { keyValue: keyValue, status: '1' }, function () {
  180. refreshGirdData();
  181. });
  182. }
  183. });
  184. }
  185. });
  186. // 审核不通过
  187. $('#lr_checkno').on('click', function () {
  188. var keyValue = $('#gridtable').jfGridValue('Id');
  189. if (learun.checkrow(keyValue)) {
  190. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  191. if (CheckStatus == '2') {
  192. learun.alert.warning("该项已审核不通过!");
  193. return false;
  194. }
  195. learun.layerConfirm('是否确认审核不通过该项!', function (res) {
  196. if (res) {
  197. learun.postForm(top.$.rootUrl + '/PersonnelManagement/MeetingManagement/DoCheck', { keyValue: keyValue, status: '2' }, function () {
  198. refreshGirdData();
  199. });
  200. }
  201. });
  202. }
  203. });
  204. },
  205. // 初始化列表
  206. initGird: function () {
  207. $('#gridtable').lrAuthorizeJfGrid({
  208. url: top.$.rootUrl + '/PersonnelManagement/MeetingManagement/GetPageList',
  209. headData: [
  210. { label: "会议主题", name: "MeetingTitle", width: 150, align: "left" },
  211. { label: "会议场地", name: "ConferenceRoomName", width: 100, align: "left" },
  212. { label: "开始时间", name: "BeginTime", width: 120, align: "left" },
  213. { label: "结束时间", name: "EndTime", width: 120, align: "left" },
  214. {
  215. label: "会议记录者", name: "RecordPerson", width: 100, align: "left",
  216. formatterAsync: function (callback, value, row, op, $cell) {
  217. learun.clientdata.getAsync('user', {
  218. key: value,
  219. callback: function (_data) {
  220. callback(_data.name);
  221. }
  222. });
  223. }
  224. },
  225. { label: "联系人", name: "Linkman", width: 100, align: "left" },
  226. { label: "联系电话", name: "LinkPhone", width: 100, align: "left" },
  227. {
  228. label: "申请人", name: "CreateUser", width: 100, align: "left",
  229. formatterAsync: function (callback, value, row, op, $cell) {
  230. learun.clientdata.getAsync('user', {
  231. key: value,
  232. callback: function (_data) {
  233. callback(_data.name);
  234. }
  235. });
  236. }
  237. },
  238. { label: "申请时间", name: "CreateTime", width: 120, align: "left" },
  239. {
  240. label: "会议状态", name: "CheckStatus", width: 100, align: "left", formatter: function (cellvalue) {
  241. return cellvalue == "1" ? "<span class=\"label label-success\">已通过</span>" : cellvalue == "2" ? "<span class=\"label label-danger\">未通过</span>" : cellvalue == "3" ? "<span class=\"label label-warning\">审核中</span>" : "<span class=\"label label-default\">未审核</span>";
  242. }
  243. },
  244. {
  245. label: "审核人", name: "CheckUser", width: 100, align: "left",
  246. formatterAsync: function (callback, value, row, op, $cell) {
  247. learun.clientdata.getAsync('user', {
  248. key: value,
  249. callback: function (_data) {
  250. //callback(_data.name);
  251. return row.CheckStatus != "1" && row.CheckStatus != "2" ? "" : callback(_data.name);
  252. }
  253. });
  254. }
  255. },
  256. {
  257. label: "审核时间", name: "CheckTime", width: 120, align: "left", formatter: function (value, row) {
  258. return row.CheckStatus != "1" && row.CheckStatus != "2" ? "" : value;
  259. }
  260. },
  261. ],
  262. mainId: 'Id',
  263. isPage: true,
  264. sidx: 'CreateTime desc'
  265. });
  266. page.search();
  267. },
  268. search: function (param) {
  269. param = param || {};
  270. param.CreateUser = learun.clientdata.get(['userinfo']).userId;
  271. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  272. }
  273. };
  274. refreshGirdData = function (res, postData) {
  275. if (res && res.code && res.code == 200) {
  276. // 发起流程
  277. var postData = {
  278. schemeCode: 'MeetingManagementApply',// 填写流程对应模板编号
  279. processId: processId,
  280. level: '1',
  281. };
  282. learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) {
  283. learun.loading(false);
  284. });
  285. }
  286. page.search();
  287. };
  288. page.init();
  289. }