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.
 
 
 
 
 
 

323 lines
14 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 数字化智慧校园
  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. $('#lr_case').on('click', function () {
  206. var keyValue = $('#gridtable').jfGridValue('Id');
  207. if (learun.checkrow(keyValue)) {
  208. learun.layerForm({
  209. id: 'viewform',
  210. title: '签到情况',
  211. url: top.$.rootUrl + '/PersonnelManagement/MeetingSignInRecord/Index?MeetID=' + keyValue,
  212. width: 1000,
  213. height: 800,
  214. btn: null
  215. });
  216. }
  217. });
  218. // 查看
  219. $('#lr_print').on('click', function () {
  220. var keyValue = $('#gridtable').jfGridValue('Id');
  221. if (learun.checkrow(keyValue)) {
  222. learun.layerForm({
  223. id: 'viewform',
  224. title: '二维码',
  225. url: top.$.rootUrl + '/PersonnelManagement/MeetingManagement/qrCode?keyValue=' + keyValue,
  226. width: 700,
  227. height: 800,
  228. btn: null
  229. });
  230. }
  231. });
  232. // 打印
  233. $('#lr_print1').on('click', function () {
  234. $('#gridtable').jqprintTable();
  235. });
  236. },
  237. // 初始化列表
  238. initGird: function () {
  239. $('#gridtable').lrAuthorizeJfGrid({
  240. url: top.$.rootUrl + '/PersonnelManagement/MeetingManagement/GetPageList',
  241. headData: [
  242. { label: "会议主题", name: "MeetingTitle", width: 150, align: "left" },
  243. { label: "会议场地", name: "ConferenceRoomName", width: 100, align: "left" },
  244. { label: "开始时间", name: "BeginTime", width: 120, align: "left" },
  245. { label: "结束时间", name: "EndTime", width: 120, align: "left" },
  246. {
  247. label: "会议记录者", name: "RecordPerson", width: 100, align: "left",
  248. formatterAsync: function (callback, value, row, op, $cell) {
  249. learun.clientdata.getAsync('user', {
  250. key: value,
  251. callback: function (_data) {
  252. callback(_data.name);
  253. }
  254. });
  255. }
  256. },
  257. { label: "联系人", name: "Linkman", width: 100, align: "left" },
  258. { label: "联系电话", name: "LinkPhone", width: 100, align: "left" },
  259. {
  260. label: "申请人", name: "CreateUser", width: 100, align: "left",
  261. formatterAsync: function (callback, value, row, op, $cell) {
  262. learun.clientdata.getAsync('user', {
  263. key: value,
  264. callback: function (_data) {
  265. callback(_data.name);
  266. }
  267. });
  268. }
  269. },
  270. { label: "申请时间", name: "CreateTime", width: 120, align: "left" },
  271. {
  272. label: "会议状态", name: "CheckStatus", width: 100, align: "left", formatter: function (cellvalue) {
  273. 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>";
  274. }
  275. },
  276. {
  277. label: "审核人", name: "CheckUser", width: 100, align: "left",
  278. formatterAsync: function (callback, value, row, op, $cell) {
  279. learun.clientdata.getAsync('user', {
  280. key: value,
  281. callback: function (_data) {
  282. //callback(_data.name);
  283. return row.CheckStatus != "1" && row.CheckStatus != "2" ? "" : callback(_data.name);
  284. }
  285. });
  286. }
  287. },
  288. {
  289. label: "审核时间", name: "CheckTime", width: 120, align: "left", formatter: function (value, row) {
  290. return row.CheckStatus != "1" && row.CheckStatus != "2" ? "" : value;
  291. }
  292. },
  293. ],
  294. mainId: 'Id',
  295. isPage: true,
  296. sidx: 'CreateTime desc'
  297. });
  298. page.search();
  299. },
  300. search: function (param) {
  301. param = param || {};
  302. param.CreateUser = learun.clientdata.get(['userinfo']).userId;
  303. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  304. }
  305. };
  306. refreshGirdData = function (res, postData) {
  307. if (res && res.code && res.code == 200) {
  308. // 发起流程
  309. var postData = {
  310. schemeCode: 'MeetingManagementApply',// 填写流程对应模板编号
  311. processId: processId,
  312. level: '1',
  313. };
  314. learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) {
  315. learun.loading(false);
  316. });
  317. }
  318. page.search();
  319. };
  320. page.init();
  321. }