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.
 
 
 
 
 
 

265 lines
12 KiB

  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. // 纪要
  142. // 通知
  143. // 审核通过
  144. $('#lr_checkyes').on('click', function () {
  145. var keyValue = $('#gridtable').jfGridValue('Id');
  146. if (learun.checkrow(keyValue)) {
  147. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  148. if (CheckStatus == '1') {
  149. learun.alert.warning("该项已审核通过!");
  150. return false;
  151. }
  152. learun.layerConfirm('是否确认审核通过该项!', function (res) {
  153. if (res) {
  154. learun.postForm(top.$.rootUrl + '/PersonnelManagement/MeetingManagement/DoCheck', { keyValue: keyValue, status: '1' }, function () {
  155. refreshGirdData();
  156. });
  157. }
  158. });
  159. }
  160. });
  161. // 审核不通过
  162. $('#lr_checkno').on('click', function () {
  163. var keyValue = $('#gridtable').jfGridValue('Id');
  164. if (learun.checkrow(keyValue)) {
  165. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  166. if (CheckStatus == '2') {
  167. learun.alert.warning("该项已审核不通过!");
  168. return false;
  169. }
  170. learun.layerConfirm('是否确认审核不通过该项!', function (res) {
  171. if (res) {
  172. learun.postForm(top.$.rootUrl + '/PersonnelManagement/MeetingManagement/DoCheck', { keyValue: keyValue, status: '2' }, function () {
  173. refreshGirdData();
  174. });
  175. }
  176. });
  177. }
  178. });
  179. },
  180. // 初始化列表
  181. initGird: function () {
  182. $('#gridtable').lrAuthorizeJfGrid({
  183. url: top.$.rootUrl + '/PersonnelManagement/MeetingManagement/GetPageList',
  184. headData: [
  185. { label: "会议主题", name: "MeetingTitle", width: 150, align: "left" },
  186. { label: "会议场地", name: "ConferenceRoomName", width: 100, align: "left" },
  187. { label: "开始时间", name: "BeginTime", width: 120, align: "left" },
  188. { label: "结束时间", name: "EndTime", width: 120, align: "left" },
  189. {
  190. label: "会议记录者", name: "RecordPerson", width: 100, align: "left",
  191. formatterAsync: function (callback, value, row, op, $cell) {
  192. learun.clientdata.getAsync('user', {
  193. key: value,
  194. callback: function (_data) {
  195. callback(_data.name);
  196. }
  197. });
  198. }
  199. },
  200. { label: "联系人", name: "Linkman", width: 100, align: "left" },
  201. { label: "联系电话", name: "LinkPhone", width: 100, align: "left" },
  202. {
  203. label: "申请人", name: "CreateUser", width: 100, align: "left",
  204. formatterAsync: function (callback, value, row, op, $cell) {
  205. learun.clientdata.getAsync('user', {
  206. key: value,
  207. callback: function (_data) {
  208. callback(_data.name);
  209. }
  210. });
  211. }
  212. },
  213. { label: "申请时间", name: "CreateTime", width: 120, align: "left" },
  214. {
  215. label: "会议状态", name: "CheckStatus", width: 100, align: "left", formatter: function (cellvalue) {
  216. 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>";
  217. }
  218. },
  219. {
  220. label: "审核人", name: "CheckUser", width: 100, align: "left",
  221. formatterAsync: function (callback, value, row, op, $cell) {
  222. learun.clientdata.getAsync('user', {
  223. key: value,
  224. callback: function (_data) {
  225. //callback(_data.name);
  226. return row.CheckStatus != "1" && row.CheckStatus != "2" ? "" : callback(_data.name);
  227. }
  228. });
  229. }
  230. },
  231. {
  232. label: "审核时间", name: "CheckTime", width: 120, align: "left", formatter: function (value, row) {
  233. return row.CheckStatus != "1" && row.CheckStatus != "2" ? "" : value;
  234. }
  235. },
  236. ],
  237. mainId: 'Id',
  238. isPage: true,
  239. sidx: 'CreateTime desc'
  240. });
  241. page.search();
  242. },
  243. search: function (param) {
  244. param = param || {};
  245. param.CreateUser = learun.clientdata.get(['userinfo']).userId;
  246. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  247. }
  248. };
  249. refreshGirdData = function (res, postData) {
  250. if (res && res.code && res.code == 200) {
  251. // 发起流程
  252. var postData = {
  253. schemeCode: 'MeetingManagementApply',// 填写流程对应模板编号
  254. processId: processId,
  255. level: '1',
  256. };
  257. learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) {
  258. learun.loading(false);
  259. });
  260. }
  261. page.search();
  262. };
  263. page.init();
  264. }