|
@@ -94,6 +94,9 @@
|
94
|
94
|
<!-- <button class="layui-btn layui-btn-sm" lay-event="exportExcel">-->
|
95
|
95
|
<!-- <i class="layui-icon layui-icon-export" style="font-size: 10px;"></i>导出列表-->
|
96
|
96
|
<!-- </button>-->
|
|
97
|
+ <button class="layui-btn layui-btn-sm" lay-event="backSpacing" style="background: #FF8040" id="myButton">
|
|
98
|
+ <i class="" style="font-size: 10px;"></i>审批回退
|
|
99
|
+ </button>
|
97
|
100
|
</div>
|
98
|
101
|
</script>
|
99
|
102
|
|
|
@@ -119,6 +122,7 @@
|
119
|
122
|
<script th:src="@{/js/lay-config.js}" charset="utf-8"></script>
|
120
|
123
|
<script th:src="@{/lib/xm-select-v1.2.2/xm-select.js}" charset="utf-8"></script>
|
121
|
124
|
<script th:inline="javascript" type="text/javascript">
|
|
125
|
+
|
122
|
126
|
AjaxUtil.ctx = /*[[@{/}]]*/'';
|
123
|
127
|
var updateflag = 0;
|
124
|
128
|
var xmApproval = {};
|
|
@@ -126,7 +130,6 @@
|
126
|
130
|
var form = layui.form,
|
127
|
131
|
table = layui.table;
|
128
|
132
|
var userId = $("#userId").val();
|
129
|
|
-
|
130
|
133
|
var currTable = table.render({
|
131
|
134
|
elem: '#currentTableId',
|
132
|
135
|
url: AjaxUtil.ctx + 'prjProject/list',
|
|
@@ -167,9 +170,15 @@
|
167
|
170
|
// console.log(JSON.stringify(permissionSet));
|
168
|
171
|
}
|
169
|
172
|
});
|
|
173
|
+/* console.log("这是我要获取的当前账户userid" + userId)
|
|
174
|
+ if (userId != 119 ){
|
|
175
|
+ document.getElementById("myButton").style.display = 'none';
|
|
176
|
+ }*/
|
|
177
|
+
|
170
|
178
|
|
171
|
179
|
// 监听搜索操作
|
172
|
180
|
form.on('submit(data-search-btn)', function (data) {
|
|
181
|
+
|
173
|
182
|
// 执行搜索重载
|
174
|
183
|
currTable.reload({
|
175
|
184
|
page: {
|
|
@@ -214,6 +223,10 @@
|
214
|
223
|
});
|
215
|
224
|
});
|
216
|
225
|
|
|
226
|
+ if(userId != 119){
|
|
227
|
+ document.getElementById("myButton").style.display = 'none';
|
|
228
|
+ }
|
|
229
|
+
|
217
|
230
|
// 监听行工具事件
|
218
|
231
|
table.on('toolbar(currentTableFilter)', function (obj) {
|
219
|
232
|
if (obj.event === 'add') { // 监听添加操作
|
|
@@ -240,6 +253,8 @@
|
240
|
253
|
|
241
|
254
|
var checkStatus = table.checkStatus('currentTableId')
|
242
|
255
|
, data = checkStatus.data;
|
|
256
|
+
|
|
257
|
+
|
243
|
258
|
if (data == null || data.length === 0) {
|
244
|
259
|
Message.warning("请选择要编辑的任务书!", 1500);
|
245
|
260
|
} else if (data.length > 1) {
|
|
@@ -270,6 +285,7 @@
|
270
|
285
|
}
|
271
|
286
|
}
|
272
|
287
|
else if (obj.event == 'view') {
|
|
288
|
+
|
273
|
289
|
var projects = table.cache["currentTableId"];
|
274
|
290
|
if(projects.length == 0)
|
275
|
291
|
return;
|
|
@@ -471,6 +487,50 @@
|
471
|
487
|
});
|
472
|
488
|
}
|
473
|
489
|
}
|
|
490
|
+ else if(obj.event == 'backSpacing'){
|
|
491
|
+ // 这段代码尝试从Layui表格组件的缓存中获取名为"currentTableId"的表格中的数据,
|
|
492
|
+ // 并将这些数据存储在变量project中。然后,它检查这个project数组的长度是否为0,
|
|
493
|
+ // 即是否没有数据(或没有选中的行)。
|
|
494
|
+ // 如果没有数据,代码执行return;语句,意味着如果没有选中任何项目(或表格为空),则不执行任何后续操作。
|
|
495
|
+
|
|
496
|
+ var project = table.cache["currentTableId"];
|
|
497
|
+ if (project.length == 0){
|
|
498
|
+ return;
|
|
499
|
+ }
|
|
500
|
+ var checkStatus = table.checkStatus('currentTableId')
|
|
501
|
+ , data = checkStatus.data;
|
|
502
|
+ if (data == null || data.length === 0){
|
|
503
|
+ Message.warning("请选择要回退的任务书!",1500);
|
|
504
|
+ } else if (data.length > 1){
|
|
505
|
+ Message.warning("请选择一条记录进行回退!",1500);
|
|
506
|
+ } else if (data[0].spzt != "审批结束"){
|
|
507
|
+ Message.warning("该任务书未审批结束,不能回退!",1500);
|
|
508
|
+ } else {
|
|
509
|
+
|
|
510
|
+ layer.confirm('确定要将任务书回退至未提交状态吗?', function (index) {
|
|
511
|
+ layer.close(index);
|
|
512
|
+ AjaxUtil.post({
|
|
513
|
+ url: AjaxUtil.ctx + "prjProject/upDataSpzt",
|
|
514
|
+ contentType: "application/json",
|
|
515
|
+ data: JSON.stringify(data),
|
|
516
|
+ success: function (res) {
|
|
517
|
+ if (res.code === 0) {
|
|
518
|
+ Message.success(1500, res.message, function () {
|
|
519
|
+ // 重载表格
|
|
520
|
+ currTable.reload();
|
|
521
|
+ });
|
|
522
|
+ } else {
|
|
523
|
+ Message.error(res.message, 1000);
|
|
524
|
+ }
|
|
525
|
+ },
|
|
526
|
+ error: function (error) {
|
|
527
|
+ }
|
|
528
|
+ });
|
|
529
|
+ });
|
|
530
|
+
|
|
531
|
+ }
|
|
532
|
+
|
|
533
|
+ }
|
474
|
534
|
else if (obj.event === 'downloadWord') { // 监听查看操作
|
475
|
535
|
var projects = table.cache["currentTableId"];
|
476
|
536
|
if (projects.length == 0)
|
|
@@ -545,6 +605,8 @@
|
545
|
605
|
});
|
546
|
606
|
}
|
547
|
607
|
}
|
|
608
|
+
|
|
609
|
+
|
548
|
610
|
});
|
549
|
611
|
|
550
|
612
|
//双击
|
|
@@ -571,6 +633,7 @@
|
571
|
633
|
function getXmApproval() {
|
572
|
634
|
return xmApproval;
|
573
|
635
|
}
|
|
636
|
+
|
574
|
637
|
</script>
|
575
|
638
|
</body>
|
576
|
639
|
</html>
|