From b1b78ed80b8bc68c31b7c8ab006bda8899b9b0f4 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期六, 20 六月 2020 15:15:19 +0800
Subject: [PATCH] #

---
 src/main/webapp/static/js/wrkMast/wrkMast.js |  151 +++++++++++++++++++++++++++-----------------------
 1 files changed, 82 insertions(+), 69 deletions(-)

diff --git a/src/main/webapp/static/js/wrkMast/wrkMast.js b/src/main/webapp/static/js/wrkMast/wrkMast.js
index bdb6c00..9cff5c9 100644
--- a/src/main/webapp/static/js/wrkMast/wrkMast.js
+++ b/src/main/webapp/static/js/wrkMast/wrkMast.js
@@ -13,23 +13,24 @@
         headers: {token: localStorage.getItem('token')},
         url: baseUrl+'/wrkMast/list/auth',
         page: true,
-        limit: 10,
+        limit: 16,
+        limits: [16, 30, 50, 100, 200, 500],
         even: true,
         toolbar: '#toolbar',
         cellMinWidth: 50,
         cols: [[
             {type: 'checkbox'}
-            ,{field: 'wrkNo', align: 'center',title: '宸ヤ綔鍙�',sort: true,event: 'detlShow'}
-            ,{field: 'ioTime$', align: 'center',title: '宸ヤ綔鏃堕棿',sort: true,event: 'detlShow', width:200}
-            ,{field: 'wrkSts$', align: 'center',title: '宸ヤ綔鐘舵��',event: 'detlShow', width:150}
-            ,{field: 'ioType$', align: 'center',title: '鍏ュ嚭搴撶被鍨�',event: 'detlShow', width:150}
-            ,{field: 'ioPri', align: 'center',title: '浼樺厛绾�',event: 'detlShow'}
-            ,{field: 'crnNo$', align: 'center',title: '鍫嗗灈鏈�',event: 'detlShow'}
-            ,{field: 'sourceStaNo$', align: 'center',title: '婧愮珯',event: 'detlShow'}
-            ,{field: 'staNo$', align: 'center',title: '鐩爣绔�',event: 'detlShow'}
-            ,{field: 'sourceLocNo$', align: 'center',title: '婧愬簱浣�',event: 'detlShow', width:100}
-            ,{field: 'locNo$', align: 'center',title: '鐩爣搴撲綅',event: 'detlShow', width:100}
-            ,{field: 'barcode', align: 'center',title: '鏉$爜',event: 'detlShow'}
+            ,{field: 'wrkNo', align: 'center',title: '宸ヤ綔鍙�',sort: true}
+            ,{field: 'ioTime$', align: 'center',title: '宸ヤ綔鏃堕棿',sort: true, width: 160}
+            ,{field: 'wrkSts$', align: 'center',title: '宸ヤ綔鐘舵��'}
+            ,{field: 'ioType$', align: 'center',title: '鍏ュ嚭搴撶被鍨�'}
+            ,{field: 'ioPri', align: 'center',title: '浼樺厛绾�'}
+            ,{field: 'crnNo$', align: 'center',title: '鍫嗗灈鏈�'}
+            ,{field: 'sourceStaNo$', align: 'center',title: '婧愮珯'}
+            ,{field: 'staNo$', align: 'center',title: '鐩爣绔�'}
+            ,{field: 'sourceLocNo$', align: 'center',title: '婧愬簱浣�'}
+            ,{field: 'locNo$', align: 'center',title: '鐩爣搴撲綅'}
+            ,{field: 'barcode', align: 'center',title: '鏉$爜'}
             // ,{field: 'picking', align: 'center',title: '鎷f枡', templet:function(row){
             //         var html = "<input value='picking' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
             //         if(row.picking === 'Y'){html += " checked ";}
@@ -63,7 +64,7 @@
             //         return html;
             //     }}
 
-            ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:130}
+            ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:200}
         ]],
         request: {
             pageName: 'curr',
@@ -82,7 +83,7 @@
         },
         done: function(res, curr, count) {
             if (res.code === 403) {
-                top.location.href = baseUrl;
+                top.location.href = baseUrl+"/";
             }
             pageCurr=curr;
             limit();
@@ -112,7 +113,7 @@
             },
             done: function (res, curr, count) {
                 if (res.code === 403) {
-                    top.location.href = baseUrl;
+                    top.location.href = baseUrl+"/";
                 }
                 pageCurr=curr;
                 limit();
@@ -134,30 +135,25 @@
                         ioPri: track.ioPri
                     });
                 });
-                if (list.length === 0){
-                    layer.msg('璇烽�夋嫨鏁版嵁');
-                } else {
-                    layer.confirm('纭畾澧炲姞'+(list.length===1?'姝�':list.length)+'鏉℃暟鎹殑浼樺厛绾у悧', function(){
-                        $.ajax({
-                            url: baseUrl+"/wrkMast/add/pri/auth",
-                            headers: {'token': localStorage.getItem('token')},
-                            contentType:'application/json;charset=UTF-8',
-                            data: JSON.stringify(list),
-                            method: 'POST',
-                            traditional:true,
-                            success: function (res) {
-                                layer.closeAll();
-                                if (res.code === 200){
-                                    $(".layui-laypage-btn")[0].click();
-                                } else if (res.code === 403){
-                                    top.location.href = baseUrl;
-                                } else {
-                                    layer.msg(res.msg)
-                                }
-                            }
-                        })
-                    });
-                }
+                $.ajax({
+                    url: baseUrl+"/wrkMast/add/pri/auth",
+                    headers: {'token': localStorage.getItem('token')},
+                    contentType:'application/json;charset=UTF-8',
+                    data: JSON.stringify(list),
+                    method: 'POST',
+                    traditional:true,
+                    success: function (res) {
+                        layer.closeAll();
+                        if (res.code === 200){
+                            $(".layui-laypage-btn")[0].click();
+                            layer.msg(res.msg);
+                        } else if (res.code === 403){
+                            top.location.href = baseUrl+"/";
+                        } else {
+                            layer.msg(res.msg)
+                        }
+                    }
+                })
                 break;
             // 闄嶄綆浼樺厛绾�
             case 'priRed':
@@ -169,30 +165,25 @@
                         ioPri: track.ioPri
                     });
                 });
-                if (list.length === 0){
-                    layer.msg('璇烽�夋嫨鏁版嵁');
-                } else {
-                    layer.confirm('纭畾闄嶄綆'+(list.length===1?'姝�':list.length)+'鏉℃暟鎹殑浼樺厛绾у悧', function(){
-                        $.ajax({
-                            url: baseUrl+"/wrkMast/red/pri/auth",
-                            headers: {'token': localStorage.getItem('token')},
-                            contentType:'application/json;charset=UTF-8',
-                            data: JSON.stringify(list),
-                            method: 'POST',
-                            traditional:true,
-                            success: function (res) {
-                                layer.closeAll();
-                                if (res.code === 200){
-                                    $(".layui-laypage-btn")[0].click();
-                                } else if (res.code === 403){
-                                    top.location.href = baseUrl;
-                                } else {
-                                    layer.msg(res.msg)
-                                }
-                            }
-                        })
-                    });
-                }
+                $.ajax({
+                    url: baseUrl+"/wrkMast/red/pri/auth",
+                    headers: {'token': localStorage.getItem('token')},
+                    contentType:'application/json;charset=UTF-8',
+                    data: JSON.stringify(list),
+                    method: 'POST',
+                    traditional:true,
+                    success: function (res) {
+                        layer.closeAll();
+                        if (res.code === 200){
+                            $(".layui-laypage-btn")[0].click();
+                            layer.msg(res.msg);
+                        } else if (res.code === 403){
+                            top.location.href = baseUrl+"/";
+                        } else {
+                            layer.msg(res.msg)
+                        }
+                    }
+                })
                 break;
             case 'addData':
                 layer.open({
@@ -226,7 +217,7 @@
                                     layer.closeAll();
                                     tableReload(false);
                                 } else if (res.code === 403){
-                                    top.location.href = baseUrl;
+                                    top.location.href = baseUrl+"/";
                                 } else {
                                     layer.msg(res.msg)
                                 }
@@ -236,7 +227,7 @@
                 }
                 break;
             case 'exportData':
-                layer.confirm('纭畾瀵煎嚭Excel鍚�', function(){
+                layer.confirm('纭畾瀵煎嚭Excel鍚�', {shadeClose: true}, function(){
                     var titles=[];
                     var fields=[];
                     obj.config.cols[0].map(function (col) {
@@ -265,7 +256,7 @@
                             if (res.code === 200) {
                                 table.exportFile(titles,res.data,'xls');
                             } else if (res.code === 403) {
-                                top.location.href = baseUrl;
+                                top.location.href = baseUrl+"/";
                             } else {
                                 layer.msg(res.msg)
                             }
@@ -295,6 +286,27 @@
                     content: 'wrkDetl.html',
                     success: function(layero, index){
                     }
+                });
+                break;
+            // 瀹屾垚
+            case 'complete':
+                layer.confirm('纭瀹屾垚璇ョ瑪宸ヤ綔妗o紵', {title: '宸ヤ綔鍙凤細'+data.wrkNo, shadeClose: true}, function(){
+                    http.post(baseUrl+"/hand/control/wrkMast", {workNo: data.wrkNo, type:1}, function (res) {
+                        $(".layui-laypage-btn")[0].click();
+                        layer.msg(data.wrkNo + res.msg);
+                    })
+                    layer.closeAll();
+
+                });
+                break;
+            // 鍙栨秷
+            case 'cancel':
+                layer.confirm('纭鍙栨秷璇ョ瑪宸ヤ綔妗o紵', {title: '宸ヤ綔鍙凤細'+data.wrkNo, shadeClose: true}, function(){
+                    http.post(baseUrl+"/hand/control/wrkMast", {workNo: data.wrkNo, type:2}, function (res) {
+                        $(".layui-laypage-btn")[0].click();
+                        layer.msg(data.wrkNo + res.msg);
+                    })
+                    layer.closeAll();
                 });
                 break;
             // 璇︽儏
@@ -575,7 +587,7 @@
                         $(this).val("");
                     });
                 } else if (res.code === 403){
-                    top.location.href = baseUrl;
+                    top.location.href = baseUrl+"/";
                 }else {
                     layer.msg(res.msg)
                 }
@@ -672,6 +684,7 @@
             where: {wrk_no: param},
             page: true,
             limit: 16,
+            limits: [16, 30, 50, 100, 200, 500],
             even: true,
             toolbar: '#toolbar',
             cellMinWidth: 50,
@@ -711,7 +724,7 @@
             },
             done: function(res, curr, count) {
                 if (res.code === 403) {
-                    top.location.href = baseUrl;
+                    top.location.href = baseUrl+"/";
                 }
                 pageCur=curr;
                 form.on('checkbox(tableCheckbox)', function (data) {
@@ -745,7 +758,7 @@
         },
         done: function (res, curr, count) {
             if (res.code === 403) {
-                top.location.href = baseUrl;
+                top.location.href = baseUrl+"/";
             }
             pageCurr=curr;
             if (res.data.length === 0 && count !== 0) {

--
Gitblit v1.9.1