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.
 
 
 
 
 
 

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