From 6cc705d10d7d0366eb7aa4797acdf137e4b7576f Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期五, 26 五月 2023 16:36:38 +0800
Subject: [PATCH] #平库盘点完成

---
 src/main/webapp/static/js/orderCheck/orderCheck.js |  222 +++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 197 insertions(+), 25 deletions(-)

diff --git a/src/main/webapp/static/js/orderCheck/orderCheck.js b/src/main/webapp/static/js/orderCheck/orderCheck.js
index e78f013..c27b889 100644
--- a/src/main/webapp/static/js/orderCheck/orderCheck.js
+++ b/src/main/webapp/static/js/orderCheck/orderCheck.js
@@ -87,6 +87,7 @@
         showEditModel();
     });
 
+
     // 宸ュ叿鏉$偣鍑讳簨浠�
     table.on('tool(order)', function (obj) {
         var data = obj.data;
@@ -101,8 +102,6 @@
             btnPrint(data.id, data.orderNo, 4);
         } else if (layEvent === 'manPrint') {
             addPakOut(data.orderNo);
-        }else if (layEvent === 'examine'){
-            examine(data);
         }else if (layEvent === 'look') {
             var $a = $(obj.tr).find('a[lay-event="look"]');
             var offset = $a.offset();
@@ -113,7 +112,7 @@
                 type: 1,
                 title: false,
                 area: '900px',
-                offset: [top + 'px', (left - 530 + $a.outerWidth()) + 'px'],
+                offset: [top + 'px', (left - 600 + $a.outerWidth()) + 'px'],
                 shade: .01,
                 shadeClose: true,
                 fixed: false,
@@ -135,9 +134,11 @@
                             {field: 'maktx', title: '鍟嗗搧鍚嶇О', width: 160},
                             {field: 'locNo', title: '搴撲綅鍙�'},
                             {field: 'anfme', title: '鏁伴噺'},
-                            {field: 'realAnfme', title: '鐪熷疄鏁伴噺'},
+                            {field: 'realAnfme', title: '鐪熷疄鏁伴噺',style: 'color: blue;font-weight: bold', edit: true},
                             {field: 'diffAnfme', title: '宸紓鏁伴噺', style: 'font-weight: bold'},
                             {field: 'type$', title: '鐘舵��'},
+                            {field: 'owner$', title: '璐т富'},
+                            {field: 'payment$', title: '璐х墿鐘舵��'},
                             {align: 'center', title: '鎿嶄綔', toolbar: '#formSSXMTableBar3', minWidth: 80, width: 80, fixed: 'right'}
                         ]],
                         request: {
@@ -169,6 +170,14 @@
             showWrkTrace(data.id);
         }
     });
+    //鍗曟嵁鏄庣粏琛� 瀹℃牳鎸夐挳
+    table.on('tool(lookSSXMTable)', function (obj) {
+        var data = obj.data;
+        var layEvent = obj.event;
+        if (layEvent === 'examine') {
+            examine(data);
+        }
+    })
 
     function showWrkTrace(orderId) {
         console.log(orderId);
@@ -194,6 +203,10 @@
                     // 缁勮鏁版嵁
                     if (xxDataList.length <= 0) {
                         layer.tips('璇锋坊鍔犲崟鎹槑缁�', '#matAddBtnComment', {tips: [1, '#ff4c4c']});
+                        return false;
+                    }
+                    if (data.field.orderNo == "" || data.field.orderNo == null) {
+                        layer.tips('璇疯緭鍏ョ洏鐐瑰崟缂栧彿', '#orderNo', {tips: [1, '#ff4c4c']});
                         return false;
                     }
                     let nList = admin.util.deepClone(xxDataList);
@@ -249,10 +262,13 @@
                         {field: 'matnr', title: '鍟嗗搧缂栫爜', width: 160},
                         {field: 'maktx', title: '鍟嗗搧鍚嶇О', width: 160},
                         {field: 'locNo', title: '搴撲綅鍙�'},
+                        {field: 'owner$', title: '璐т富'},
+                        {field: 'payment$', title: '璐х墿鐘舵��'},
                         {field: 'anfme', title: '搴撳瓨鏁伴噺'},
                         {field: 'realAnfme', title: '鐪熷疄鏁伴噺'},
                         {field: 'diffAnfme', title: '宸紓鏁伴噺', style: 'font-weight: bold'},
                         {field: 'type$', title: '鐘舵��'},
+
                         {align: 'center', title: '鎿嶄綔', toolbar: '#formSSXMTableBarr', minWidth: 80, width: 80, fixed: 'right'}
                     ]],
                     done: function (res) {
@@ -346,12 +362,17 @@
                 function showEditModel2(exp) {
                     var checkType = $("#checkType option:selected").val();
                     var tp = '';
-                    if (checkType == 'loc'){
+                    if (checkType == 'locno'){
                         tp = 2;
                     }
                     if (checkType == 'matnr'){
                         tp = 3;
                     }
+                    if (checkType == 'owner'){
+                        tp = 4;
+                    }
+
+
                     admin.open({
                         type: 1,
                         offset: '150px',
@@ -365,9 +386,25 @@
                             form.on('submit(matEditSubmit)', function (data) {
                                 var prec = $("#selectPerc option:selected").val();
                                 var selectList;
+                                if (tp == 2){
+                                    prec = $("#selectPerc2 option:selected").val();
+                                    selectList = matXmSelect2.getValue();
+                                    console.log(selectList);
+                                    for (let i = 0; i<selectList.length; i++) {
+                                        selectList[i].children="";
+                                    }
+                                }
                                 if (tp == 3){
                                     prec = $("#selectPerc3 option:selected").val();
                                     selectList = matXmSelect.getValue();
+                                    console.log(selectList);
+                                    for (let i = 0; i<selectList.length; i++) {
+                                        selectList[i].children="";
+                                    }
+                                }
+                                if (tp == 4){
+                                    prec = $("#selectPerc4 option:selected").val();
+                                    selectList = matXmSelect3.getValue();
                                     console.log(selectList);
                                     for (let i = 0; i<selectList.length; i++) {
                                         selectList[i].children="";
@@ -381,28 +418,78 @@
 
                                 json.data = selectList;
                                 console.log(json);
-                                $.ajax({
-                                    url: baseUrl+"/orderCheck/create/auth",
-                                    headers: {'token': localStorage.getItem('token')},
-                                    contentType:'application/json;charset=UTF-8',
-                                    data: JSON.stringify(json),
-                                    method: 'POST',
-                                    async: false,
-                                    success: function (res) {
-                                        if (res.code === 200){
-                                            for (var i =0;i<res.data.length;i++){
-                                                xxDataList.push(res.data[i]);
-                                                console.log(xxDataList);
-                                                insTbSSXM.reload({data: xxDataList, page: {curr: 1}});
-                                            }
 
-                                        } else if (res.code === 403){
-                                            top.location.href = baseUrl+"/";
-                                        }else {
-                                            layer.msg(res.msg, {icon: 2})
+                                if ( tp == 2 || tp == ''){
+                                    $.ajax({
+                                        url: baseUrl+"/orderCheck/create/auth",
+                                        headers: {'token': localStorage.getItem('token')},
+                                        contentType:'application/json;charset=UTF-8',
+                                        data: JSON.stringify(json),
+                                        method: 'POST',
+                                        async: false,
+                                        success: function (res) {
+                                            if (res.code === 200){
+                                                for (var i =0;i<res.data.length;i++){
+                                                    xxDataList.push(res.data[i]);
+                                                    console.log(xxDataList);
+                                                    insTbSSXM.reload({data: xxDataList, page: {curr: 1}});
+                                                }
+
+                                            } else if (res.code === 403){
+                                                top.location.href = baseUrl+"/";
+                                            }else {
+                                                layer.msg(res.msg, {icon: 2})
+                                            }
                                         }
-                                    }
-                                })
+                                    })
+                                }else if (tp == 3){
+                                    $.ajax({
+                                        url: baseUrl+"/orderCheck/create/loc/auth",
+                                        headers: {'token': localStorage.getItem('token')},
+                                        contentType:'application/json;charset=UTF-8',
+                                        data: JSON.stringify(json),
+                                        method: 'POST',
+                                        async: false,
+                                        success: function (res) {
+                                            if (res.code === 200){
+                                                for (var i =0;i<res.data.length;i++){
+                                                    xxDataList.push(res.data[i]);
+                                                    console.log(xxDataList);
+                                                    insTbSSXM.reload({data: xxDataList, page: {curr: 1}});
+                                                }
+
+                                            } else if (res.code === 403){
+                                                top.location.href = baseUrl+"/";
+                                            }else {
+                                                layer.msg(res.msg, {icon: 2})
+                                            }
+                                        }
+                                    })
+                                }else if (tp == 4){
+                                    $.ajax({
+                                        url: baseUrl+"/orderCheck/create/owner/auth",
+                                        headers: {'token': localStorage.getItem('token')},
+                                        contentType:'application/json;charset=UTF-8',
+                                        data: JSON.stringify(json),
+                                        method: 'POST',
+                                        async: false,
+                                        success: function (res) {
+                                            if (res.code === 200){
+                                                for (var i =0;i<res.data.length;i++){
+                                                    xxDataList.push(res.data[i]);
+                                                    console.log(xxDataList);
+                                                    insTbSSXM.reload({data: xxDataList, page: {curr: 1}});
+                                                }
+
+                                            } else if (res.code === 403){
+                                                top.location.href = baseUrl+"/";
+                                            }else {
+                                                layer.msg(res.msg, {icon: 2})
+                                            }
+                                        }
+                                    })
+                                }
+
                                 layer.close(dIndex);
                                 return false;
                             });
@@ -435,6 +522,62 @@
                                     });
                                 }
                             })
+
+                            // 娓叉煋鐗╂枡閫夋嫨
+                            var matXmSelect2 = xmSelect.render({
+                                el: '#mat2',
+                                style: {
+                                    width: '340px',
+                                },
+                                autoRow: true,
+                                toolbar: { show: true },
+                                filterable: true,
+                                remoteSearch: true,
+                                remoteMethod: function(val, cb, show){
+                                    $.ajax({
+                                        url: baseUrl+"/orderCheck/all/get/loc",
+                                        headers: {'token': localStorage.getItem('token')},
+                                        method: 'POST',
+                                        success: function (res) {
+                                            if (res.code === 200){
+                                                cb(res.data)
+                                            } else {
+                                                cb([]);
+                                                layer.msg(res.msg, {icon: 2});
+                                            }
+                                        }
+                                    });
+                                }
+                            })
+                            // 娓叉煋鐗╂枡閫夋嫨
+                            var matXmSelect3 = xmSelect.render({
+                                el: '#mat4',
+                                style: {
+                                    width: '340px',
+                                },
+                                autoRow: true,
+                                toolbar: { show: true },
+                                filterable: true,
+                                remoteSearch: true,
+                                remoteMethod: function(val, cb, show){
+                                    $.ajax({
+                                        url: baseUrl+"/orderCheck/all/get/owner",
+                                        headers: {'token': localStorage.getItem('token')},
+                                        method: 'POST',
+                                        success: function (res) {
+                                            if (res.code === 200){
+                                                cb(res.data)
+                                            } else {
+                                                cb([]);
+                                                layer.msg(res.msg, {icon: 2});
+                                            }
+                                        }
+                                    });
+                                }
+                            })
+
+
+
                             // 寮圭獥涓嶅嚭鐜版粴鍔ㄦ潯
                             $(layero).children('.layui-layer-content').css('overflow', 'visible');
                             layui.form.render('select');
@@ -590,7 +733,36 @@
         })
     }
 
+    function examine(data){
+        console.log(data)
+        layer.confirm('璇风‘瀹氱湡瀹炴暟閲忎互鍙婂樊寮傛暟閲�!', {
+            shade: .1,
+            skin: 'layui-layer-admin'
+        }, function (i) {
+            $.ajax({
+                url: baseUrl + "/orderCheck/mxamine",
+                headers: {'token': localStorage.getItem('token')},
+                contentType:'application/json;charset=UTF-8',
+                data: JSON.stringify(data),
+                method: 'POST',
+                async: false,
+                success: function (res) {
+                    if (res.code === 200){
+                        layer.msg(res.msg);
+                    }else {
+                        layer.msg(res.msg);
+                    }
+                }
+            });
 
 
+        });
+    }
+
+    // 椤甸潰淇敼
+    table.on('edit(lookSSXMTable)', function (obj) {
+        console.log(obj.data)
+    })
+
 
 });

--
Gitblit v1.9.1