list.html 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns:th="http://www.thymeleaf.org">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  6. <title>项目任务书</title>
  7. <link rel="stylesheet" th:href="@{/lib/layui/css/layui.css}" media="all">
  8. <link rel="stylesheet" th:href="@{/css/public.css}" media="all">
  9. <link rel="stylesheet" th:href="@{/lib/font-awesome-4.7.0/css/font-awesome.min.css}" media="all">
  10. </head>
  11. <body>
  12. <div class="layuimini-container">
  13. <div class="layuimini-main">
  14. <fieldset class="table-search-fieldset">
  15. <legend>搜索信息(<b>收起-展开</b>)</legend>
  16. <div id="search-div" style="margin: 5px 10px -10px 0px">
  17. <form class="layui-form" action="" lay-filter="search-form">
  18. <div class="layui-form-item">
  19. <div class="layui-inline">
  20. <label class="layui-form-label" style="width: 60px">中文名称</label>
  21. <div class="layui-input-inline" style="width: 250px">
  22. <input type="text" name="zwmc" autocomplete="off" class="layui-input">
  23. </div>
  24. </div>
  25. <div class="layui-inline">
  26. <label class="layui-form-label" style="width: 60px">ERP编号</label>
  27. <div class="layui-input-inline" style="width: 150px">
  28. <input type="text" name="erpbh" autocomplete="off" class="layui-input">
  29. </div>
  30. </div>
  31. <div class="layui-inline">
  32. <label class="layui-form-label" style="width: 60px">项目类型</label>
  33. <div class="layui-input-inline" style="width: 150px">
  34. <select name="xmlx" id="xmlx" lay-filter="status">
  35. <option value="">全部</option>
  36. <option th:each="item:${xmlxList}" th:text="${item.name}"
  37. th:value="${item.code}"></option>
  38. </select>
  39. </div>
  40. </div>
  41. <div class="layui-inline">
  42. <label class="layui-form-label" style="width: 60px">审批状态</label>
  43. <div class="layui-input-inline" style="width: 150px">
  44. <select name="spzt" lay-filter="status">
  45. <option value="">全部</option>
  46. <option th:each="item:${dictList}" th:text="${item.name}"
  47. th:value="${item.name}"></option>
  48. </select>
  49. </div>
  50. </div>
  51. <div class="layui-inline" style="margin-left: 0px">
  52. <button type="submit" class="layui-btn" lay-submit lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索</button>
  53. <button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="data-reset-btn"><i class="layui-icon layui-icon-refresh"></i> 重 置 </button>
  54. </div>
  55. </div>
  56. </form>
  57. </div>
  58. </fieldset>
  59. <script type="text/html" id="toolbarDemo">
  60. <div class="layui-btn-container">
  61. <button class="layui-btn layui-btn-sm data-add-btn" lay-event="add">
  62. <i class="layui-icon layui-icon-addition" style="font-size: 10px;"></i>新增
  63. </button>
  64. <button class="layui-btn layui-btn-sm layui-btn-normal" lay-event="edit">
  65. <i class="layui-icon layui-icon-edit" style="font-size: 10px;"></i>编辑
  66. </button>
  67. <button class="layui-btn layui-btn-sm layui-btn-normal" lay-event="view">
  68. <i class="layui-icon layui-icon-file" style="font-size: 10px;"></i>查看
  69. </button>
  70. <button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="delete">
  71. <i class="layui-icon layui-icon-delete" style="font-size: 10px;"></i>删除
  72. </button>
  73. <button class="layui-btn layui-btn-sm data-add-btn" lay-event="tjApprove">
  74. <i class="layui-icon layui-icon-ok" style="font-size: 10px;"></i>提交审批
  75. </button>
  76. <button class="layui-btn layui-btn-sm data-add-btn" lay-event="tjrevokeApprove">
  77. <i class="layui-icon layui-icon-edit" style="font-size: 10px;"></i>撤销审批
  78. </button>
  79. <button class="layui-btn layui-btn-sm layui-btn-normal" lay-event="spOption">
  80. <i class="layui-icon layui-icon-edit" style="font-size: 10px;"></i>审核
  81. </button>
  82. <button class="layui-btn layui-btn-sm layui-btn-normal" lay-event="spList">
  83. <i class="layui-icon layui-icon-list" style="font-size: 10px;"></i>审批列表
  84. </button>
  85. <button class="layui-btn layui-btn-sm" lay-event="downloadWord">
  86. <i class="layui-icon layui-icon-export" style="font-size: 10px;"></i>导出
  87. </button>
  88. <!-- <button class="layui-btn layui-btn-sm" lay-event="exportExcel">-->
  89. <!-- <i class="layui-icon layui-icon-export" style="font-size: 10px;"></i>导出列表-->
  90. <!-- </button>-->
  91. <button class="layui-btn layui-btn-sm" lay-event="backSpacing" style="background: #FF8040" id="myButton">
  92. <i class="layui-icon layui-icon-return" style="font-size: 10px;"></i>审批回退
  93. </button>
  94. </div>
  95. </script>
  96. <input type="hidden" id="userId" name="userId" class="layui-input" th:value="${userId}">
  97. <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
  98. <!-- <script type="text/html" id="currentTableBar">-->
  99. <!-- <a class="layui-btn layui-btn-xs layui-btn-warm data-count-view" lay-event="view">-->
  100. <!-- <i class="layui-icon layui-icon-set" style="font-size: 10px;"></i>查看-->
  101. <!-- </a>-->
  102. <!-- <a class="layui-btn layui-btn-xs data-count-update" lay-event="update">-->
  103. <!-- <i class="layui-icon layui-icon-edit" style="font-size: 10px;"></i>编辑-->
  104. <!-- </a>-->
  105. <!-- <a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delFlag">-->
  106. <!-- <i class="layui-icon layui-icon-delete" style="font-size: 10px;"></i>删除-->
  107. <!-- </a>-->
  108. <!-- </script>-->
  109. </div>
  110. </div>
  111. <script th:src="@{/lib/jquery-3.4.1/jquery-3.4.1.min.js}" charset="utf-8"></script>
  112. <script th:src="@{/lib/layui/layui.js}" charset="utf-8"></script>
  113. <script th:src="@{/lib/coco-message/coco-message.js}" charset="utf-8"></script>
  114. <script th:src="@{/js/lay-config.js}" charset="utf-8"></script>
  115. <script th:src="@{/lib/xm-select-v1.2.2/xm-select.js}" charset="utf-8"></script>
  116. <script th:inline="javascript" type="text/javascript">
  117. AjaxUtil.ctx = /*[[@{/}]]*/'';
  118. var updateflag = 0;
  119. var xmApproval = {};
  120. layui.use(['form', 'table'], function () {
  121. var form = layui.form,
  122. table = layui.table;
  123. var userId = $("#userId").val();
  124. var currTable = table.render({
  125. elem: '#currentTableId',
  126. url: AjaxUtil.ctx + 'prjProject/list',
  127. method: 'post',
  128. toolbar: '#toolbarDemo',
  129. defaultToolbar: ['filter', 'exports', 'print'],
  130. cols: [
  131. [
  132. {type: "checkbox", fixed: 'left'},
  133. {type: 'numbers', align: 'center'},
  134. {field: 'zwmc', width: '26%', title: '中文名称'},
  135. {field: 'spzt', width: '10%',title: '审批状态', sort: true},
  136. {field: 'erpbh', width: '10%', title: 'ERP编号'},
  137. {field: 'xmlxmc', width: '15%', title: '项目类型'},
  138. {field: 'qs', width: '8%', title: '起始', align: 'center'},
  139. {field: 'wc', width: '8%', title: '完成', align: 'center'},
  140. {field: 'cjrxm', width: '7%', title: '创建人', align: 'center'},
  141. {field: 'cjrq', width: '8%', title: '创建时间', align: 'center'}
  142. // {title: '操作', toolbar: '#currentTableBar', align: 'center', fixed: 'right'}
  143. ]
  144. ],
  145. autoSort: false,
  146. limits: [10, 15, 20, 25, 50, 100],
  147. limit: 10,
  148. page: true,
  149. skin: 'grid',
  150. parseData: function(res){ //res 即为原始返回的数据
  151. return {
  152. "code": res.code, //解析接口状态
  153. "msg": res.message, //解析提示文本
  154. "count": res.data.total, //解析数据长度
  155. "data": res.data.rows //解析数据列表
  156. };
  157. },
  158. done: function(res, curr, count) { // done为数据渲染完的回调
  159. // 测试打印出后端返回的权限列表
  160. // let permissionSet = [[${permissionSet}]];
  161. // console.log(JSON.stringify(permissionSet));
  162. if ( userId != 40 && userId != 42 && userId != 1) {
  163. document.getElementById("myButton").style.display = 'none';
  164. }
  165. }
  166. });
  167. // 监听搜索操作
  168. form.on('submit(data-search-btn)', function (data) {
  169. // 执行搜索重载
  170. currTable.reload({
  171. page: {
  172. curr: 1 // 页码从1开始
  173. },
  174. where: form.val("search-form")
  175. });
  176. return false;
  177. });
  178. // 监听重置操作
  179. form.on('submit(data-reset-btn)', function (data) {
  180. form.val("search-form", {
  181. "zwmc": '',
  182. "erpbh": '',
  183. "xmlx": '',
  184. "spzt": ''
  185. });
  186. // 执行搜索重载
  187. currTable.reload({
  188. page: {
  189. curr: 1
  190. },
  191. where: form.val("search-form")
  192. });
  193. return false;
  194. });
  195. // 监听排序事件
  196. table.on('sort(currentTableFilter)', function(obj){ //注:sort 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值"
  197. // console.log(obj.field); //当前排序的字段名
  198. // console.log(obj.type); //当前排序类型:desc(降序)、asc(升序)、null(空对象,默认排序)
  199. // console.log(this); //当前排序的 th 对象
  200. //尽管我们的 table 自带排序功能,但并没有请求服务端。
  201. //有些时候,你可能需要根据当前排序的字段,重新向服务端发送请求,从而实现服务端排序,如:
  202. currTable.reload({
  203. initSort: obj, //记录初始排序,如果不设的话,将无法标记表头的排序状态。
  204. where: { //请求参数(注意:这里面的参数可任意定义,并非下面固定的格式)
  205. sortName: toLine(obj.field), //排序字段
  206. sortOrder: toLine(obj.type) //排序方式
  207. }
  208. });
  209. });
  210. // 监听行工具事件
  211. table.on('toolbar(currentTableFilter)', function (obj) {
  212. if (obj.event === 'add') { // 监听添加操作
  213. layer.open({
  214. title: '新建项目任务书',
  215. type: 2,
  216. shade: 0.3,
  217. maxmin: true,
  218. area: ['1090px', layerheight + 'px'],
  219. content: AjaxUtil.ctx + 'prjProject/forAdd',
  220. end: function (index) {
  221. // 重载表格
  222. if(updateflag == 1)
  223. currTable.reload();
  224. updateflag =0;
  225. }
  226. });
  227. // layer.full(index);
  228. }
  229. else if (obj.event == 'edit') {
  230. var projects = table.cache["currentTableId"];
  231. if(projects.length == 0)
  232. return;
  233. var checkStatus = table.checkStatus('currentTableId')
  234. , data = checkStatus.data;
  235. if (data == null || data.length === 0) {
  236. Message.warning("请选择要编辑的任务书!", 1500);
  237. } else if (data.length > 1) {
  238. Message.warning("请选择一条记录进行编辑操作!", 1500);
  239. } else if (data[0].spzt == "审批结束") {
  240. Message.warning("该任务书已审批结束,不能修改!", 1500);
  241. } else if (data[0].spzt != null && data[0].spzt.indexOf("未提交") < 0) {
  242. Message.warning("该任务书审批中,不能修改!", 1500);
  243. } else if (data[0].cjr != userId) {
  244. Message.error("您不是该任务书的创建人!", 1500);
  245. } else {
  246. console.log("修改项目任务书");
  247. layer.open({
  248. title: '修改项目任务书',
  249. type: 2,
  250. shade: 0.3,
  251. maxmin: true,
  252. shadeClose: true,
  253. area: ['1090px', layerheight + 'px'],
  254. content: AjaxUtil.ctx + 'prjProject/forUpdate/' + data[0].id,
  255. end: function (index) {
  256. if(updateflag == 1)
  257. currTable.reload();
  258. updateflag =0;
  259. }
  260. });
  261. // layer.full(index);
  262. }
  263. }
  264. else if (obj.event == 'view') {
  265. var projects = table.cache["currentTableId"];
  266. if(projects.length == 0)
  267. return;
  268. var checkStatus = table.checkStatus('currentTableId')
  269. , data = checkStatus.data;
  270. if (data == null || data.length === 0) {
  271. Message.warning("请选择要查看的任务书!", 1500);
  272. } else if (data.length > 1) {
  273. Message.warning("请选择一条记录进行查看!", 1500);
  274. } else {
  275. layer.open({
  276. title: '查看项目任务书',
  277. type: 2,
  278. shade: 0.3,
  279. maxmin: true,
  280. shadeClose: true,
  281. area: ['1090px', layerheight + 'px'],
  282. content: AjaxUtil.ctx + 'prjProject/forView/' + data[0].id,
  283. end: function (index) {
  284. layer.close(index);
  285. }
  286. });
  287. // layer.full(index);
  288. }
  289. }
  290. else if (obj.event === 'delete') { // 监听删除操作
  291. var projects = table.cache["currentTableId"];
  292. if(projects.length == 0)
  293. return;
  294. var checkStatus = table.checkStatus('currentTableId')
  295. , data = checkStatus.data;
  296. if (data == null || data.length === 0) {
  297. Message.warning("请选择要删除的任务书!", 1000);
  298. return;
  299. } else {
  300. for (let item of data) {
  301. if(item.cjr != userId) {
  302. Message.error("存在您不是创建人的任务书,不能直接删除!", 2000);
  303. return;
  304. }
  305. if(item.spzt != "未提交") {
  306. if(item.spzt == "审批结束")
  307. Message.warning("存在已审批结束的可研报告,不能直接删除!", 2000);
  308. else if (data[0].spzt != null)
  309. Message.warning("存在审批中的可研报告,不能直接删除!", 2000);
  310. return;
  311. }
  312. }
  313. }
  314. layer.confirm('确定批量删除项目任务书吗?', function (index) {
  315. layer.close(index);
  316. AjaxUtil.post({
  317. url: AjaxUtil.ctx + "prjProject/batchDelete",
  318. contentType: "application/json",
  319. data: JSON.stringify(data),
  320. success: function (res) {
  321. if (res.code === 0) {
  322. Message.success(1500, res.message, function () {
  323. // 重载表格
  324. currTable.reload();
  325. });
  326. } else {
  327. Message.error(res.message, 1000);
  328. }
  329. },
  330. error: function (error) {
  331. }
  332. });
  333. });
  334. }
  335. else if (obj.event === 'exportExcel') {
  336. var projects = table.cache["currentTableId"];
  337. if (projects.length == 0)
  338. return;
  339. let a = document.createElement('a');
  340. a.href = AjaxUtil.ctx + 'prjProject/exportExcel';
  341. a.click();
  342. a.parentNode.removeChild(a);
  343. }
  344. else if (obj.event === 'tjApprove') {
  345. var projects = table.cache["currentTableId"];
  346. if (projects.length == 0)
  347. return;
  348. var checkStatus = table.checkStatus('currentTableId')
  349. , data = checkStatus.data;
  350. if (data == null || data.length === 0) {
  351. Message.warning("请选择要提交审批的任务书!", 1500);
  352. } else if (data.length > 1) {
  353. Message.warning("请选择一条记录进行提交!", 1500);
  354. } else if (data[0].spzt == "审批结束") {
  355. Message.warning("该任务书已审批结束!", 1500);
  356. } else if (data[0].spzt != null && data[0].spzt.indexOf("未提交") < 0) {
  357. Message.warning("该任务书正在审批中……", 1500);
  358. } else if (data[0].cjr != userId) {
  359. Message.error("您不是该任务书的创建人!", 1500);
  360. } else {
  361. xmApproval = {
  362. "xmid": data[0].id,
  363. "xm": data[0].zwmc,
  364. "zt": data[0].spzt
  365. };
  366. if(data[0].spzt == null) {
  367. xmApproval.zt = "未提交";
  368. data[0].spzt = "未提交";
  369. }
  370. var content = AjaxUtil.ctx + 'prjProject/forApproveAdd';
  371. if (data[0].spzt != "未提交")
  372. // content = AjaxUtil.ctx + 'prjProject/forApproveUpdate/' + data[0].id + '?spzt=' + data[0].spzt;
  373. content = AjaxUtil.ctx + 'prjProject/forApproveUpdate/' + data[0].id + '/' + data[0].ysje + '?spzt=' + data[0].spzt;
  374. layer.open({
  375. title: '提交审批',
  376. type: 2,
  377. shade: 0.3,
  378. maxmin: true,
  379. shadeClose: true,
  380. area: ['1025px', layerheight + 'px'],
  381. content: content,
  382. end: function (index) {
  383. if (updateflag == 1)
  384. currTable.reload();
  385. updateflag = 0;
  386. }
  387. });
  388. }
  389. }
  390. else if (obj.event === 'spOption') {
  391. var projects = table.cache["currentTableId"];
  392. if (projects.length == 0)
  393. return;
  394. var checkStatus = table.checkStatus('currentTableId')
  395. , data = checkStatus.data;
  396. if (data == null || data.length === 0) {
  397. Message.warning("请选择要审批的任务书!", 1500);
  398. } else if (data.length > 1) {
  399. Message.warning("请选择一条记录进行审批!", 1500);
  400. } else if (data[0].spzt == null || data[0].spzt.indexOf("未提交") >= 0) {
  401. Message.warning("该任务书尚未提交审批!", 1500);
  402. } else if (data[0].spzt == "审批结束") {
  403. Message.warning("该任务书已审批结束!", 1500);
  404. } else {
  405. xmApproval = {
  406. "xmid": data[0].id,
  407. "xm": data[0].zwmc,
  408. "ysje": data[0].ysje
  409. };
  410. layer.open({
  411. title: '审批意见',
  412. type: 2,
  413. shade: 0.3,
  414. maxmin: true,
  415. shadeClose: true,
  416. area: ['1025px', layerheight + 'px'],
  417. content: AjaxUtil.ctx + 'prjProject/forApproveUpdate/' + data[0].id + '/' + data[0].ysje + '?spzt=' + data[0].spzt,
  418. end: function (index) {
  419. if (updateflag == 1)
  420. currTable.reload();
  421. updateflag = 0;
  422. }
  423. });
  424. }
  425. }
  426. else if (obj.event === 'spList') {
  427. var projects = table.cache["currentTableId"];
  428. if (projects.length == 0)
  429. return;
  430. var checkStatus = table.checkStatus('currentTableId')
  431. , data = checkStatus.data;
  432. if (data == null || data.length === 0) {
  433. Message.warning("请选择要查看审批列表的任务书!", 1500);
  434. } else if (data.length > 1) {
  435. Message.warning("请选择一条记录进行查看!", 1500);
  436. } else if (data[0].spzt == null || data[0].spzt == "未提交") {
  437. Message.warning("该任务书尚未提交审批!", 1500);
  438. } else {
  439. xmApproval = {
  440. "xmid": data[0].id,
  441. "xm": data[0].zwmc
  442. };
  443. var index = layer.open({
  444. title: '审批列表',
  445. type: 2,
  446. shade: 0.3,
  447. maxmin: true,
  448. shadeClose: true,
  449. area: ['1300px', layerheight + 'px'],
  450. content: AjaxUtil.ctx + 'prjProject/forApproveList',
  451. end: function () {
  452. layer.close(index);
  453. }
  454. });
  455. }
  456. }
  457. else if(obj.event == 'backSpacing'){
  458. var project = table.cache["currentTableId"];
  459. if (project.length == 0){
  460. return;
  461. }
  462. var checkStatus = table.checkStatus('currentTableId')
  463. , data = checkStatus.data;
  464. if (data == null || data.length === 0){
  465. Message.warning("请选择要回退的任务书!",1500);
  466. } else if (data.length > 1){
  467. Message.warning("请选择一条记录进行回退!",1500);
  468. } else if (data[0].spzt != "审批结束"){
  469. Message.warning("该任务书未审批结束,不能回退!",1500);
  470. } else {
  471. layer.confirm('确定要将任务书回退至未提交状态吗?', function (index) {
  472. layer.close(index);
  473. AjaxUtil.post({
  474. url: AjaxUtil.ctx + "prjProject/upDataSpzt/"+userId,
  475. contentType: "application/json",
  476. data: JSON.stringify(data),
  477. success: function (res) {
  478. if (res.code === 0) {
  479. Message.success(1500, res.message, function () {
  480. // 重载表格
  481. currTable.reload();
  482. });
  483. } else {
  484. Message.error(res.message, 1000);
  485. }
  486. },
  487. error: function (error) {
  488. }
  489. });
  490. });
  491. }
  492. }
  493. else if (obj.event === 'downloadWord') { // 监听查看操作
  494. var projects = table.cache["currentTableId"];
  495. if (projects.length == 0)
  496. return;
  497. var checkStatus = table.checkStatus('currentTableId')
  498. , data = checkStatus.data;
  499. if (data == null || data.length === 0) {
  500. Message.warning("请选择要导出的任务书!", 1500);
  501. } else if (data.length > 1) {
  502. Message.warning("请选择一条记录进行导出!", 1500)
  503. } else {
  504. layer.confirm('是否确定导出任务书——'+data[0].zwmc+'?', {
  505. btn: ['导出', '取消']
  506. }, function(index, layero){
  507. window.location.href=AjaxUtil.ctx + "prjProject/exportWord/" + data[0].id;
  508. layer.close(index);
  509. }, function(index){
  510. });
  511. }
  512. }
  513. else if(obj.event==='tjrevokeApprove'){
  514. var projects = table.cache["currentTableId"];
  515. if (projects.length == 0)
  516. return;
  517. var checkStatus = table.checkStatus('currentTableId')
  518. , data = checkStatus.data;
  519. if (data == null || data.length === 0) {
  520. Message.warning("请选择要撤销的任务书!", 1500);
  521. } else if (data.length > 1) {
  522. Message.warning("请选择一条记录进行撤销!", 1500);
  523. } else if (data[0].spzt == "审批结束") {
  524. Message.warning("该任务书已审批结束!", 1500);
  525. }
  526. //else if (data[0].cjr != userId) {
  527. // Message.error("您不是该任务书的创建人!", 1500);}
  528. else {
  529. xmApproval = {
  530. "xmid": data[0].id,
  531. "xm": data[0].zwmc,
  532. "zt": "未提交"
  533. };
  534. if(data[0].spzt == null) {
  535. xmApproval.zt = "未提交";
  536. data[0].spzt = "未提交";
  537. }
  538. var project = {
  539. "id": xmApproval.xmid,
  540. "spzt": '未提交'
  541. }
  542. layer.confirm('确定撤销项目任务书吗?', function (index) {
  543. layer.close(index);
  544. AjaxUtil.post({
  545. url: AjaxUtil.ctx + "prjProject/TJrevokeApprove",
  546. contentType: "application/json",
  547. data: JSON.stringify(project),
  548. success: function (res) {
  549. if (res.code === 0) {
  550. Message.success(1500, res.message, function () {
  551. // 重载表格
  552. currTable.reload();
  553. });
  554. } else {
  555. Message.error(res.message, 1000);
  556. }
  557. },
  558. error: function (error) {
  559. }
  560. });
  561. });
  562. }
  563. }
  564. });
  565. //双击
  566. table.on('rowDouble(currentTableFilter)', function (obj) {
  567. var data = obj.data;
  568. layer.open({
  569. title: '查看项目任务书',
  570. type: 2,
  571. shade: 0.3,
  572. maxmin: true,
  573. shadeClose: true,
  574. area: ['1090px', layerheight + 'px'],
  575. content: AjaxUtil.ctx + 'prjProject/forView/' + data.id,
  576. end: function (index) {
  577. layer.close(index);
  578. }
  579. });
  580. // layer.full(index);
  581. });
  582. });
  583. function setUpdateFlag() {
  584. updateflag = 1;
  585. }
  586. function getXmApproval() {
  587. return xmApproval;
  588. }
  589. </script>
  590. </body>
  591. </html>