From 1ca8b748a3541b88b12b7e9e7f5f77a5c8df7fd2 Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期五, 31 十月 2025 15:29:28 +0800
Subject: [PATCH] #1

---
 src/main/webapp/static/js/order/order.js |  139 +++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 124 insertions(+), 15 deletions(-)

diff --git a/src/main/webapp/static/js/order/order.js b/src/main/webapp/static/js/order/order.js
index e277615..752301b 100644
--- a/src/main/webapp/static/js/order/order.js
+++ b/src/main/webapp/static/js/order/order.js
@@ -10,6 +10,7 @@
     var admin = layui.admin;
     var xmSelect = layui.xmSelect;
     var layDate = layui.laydate;
+    var laytpl = layui.laytpl;
 
     // 娓叉煋鎼滅储妯℃澘
     $.ajax({
@@ -41,7 +42,8 @@
         cellMinWidth: 100,
         cols: [[
             {type: 'numbers'},
-            {field: 'orderNo', title: '鍗曟嵁缂栧彿'},
+            {field: 'orderNo', title: '鍗曟嵁缂栧彿', templet: '#orderNoTpl'},
+            {field: 'po', title: '鍗曟嵁缂栧彿', templet: '#orderNoTpl'},
             {field: 'docType$', align: 'center', title: '绫诲瀷',  minWidth: 160, width: 160},
             {align: 'center', title: '鏄庣粏', toolbar: '#tbLook', minWidth: 160, width: 160},
             {field: 'createTime$', title: '鍒涘缓鏃堕棿', minWidth: 200, width: 200},
@@ -89,10 +91,14 @@
         var layEvent = obj.event;
         if (layEvent === 'edit') {
             showEditModel(data);
+        } else if (layEvent === 'wrkTrace') {
+            showWrkTrace(data.id);
         } else if (layEvent === 'del') {
             doDel(data.id);
         } else if (layEvent === 'complete') {
-            doModify(data.id, data.orderNo, 4);
+            doModify(data.id, data.orderNo, 6);
+        } else if (layEvent === 'continueExecution') {
+            doModify99(data.id, data.orderNo, 99);
         } else if (layEvent === 'look') {
             var $a = $(obj.tr).find('a[lay-event="look"]');
             var offset = $a.offset();
@@ -119,12 +125,13 @@
                         cellMinWidth: 100,
                         cols: [[
                             {type: 'numbers'},
-                            {field: 'matnr', title: '鍟嗗搧缂栫爜', width: 160},
-                            {field: 'maktx', title: '鍟嗗搧鍚嶇О', width: 160},
-                            {field: 'batch', title: '鎵瑰彿'},
-                            {field: 'anfme', title: '鏁伴噺'},
-                            {field: 'workQty', title: '浣滀笟鏁伴噺'},
-                            {field: 'qty', title: '瀹屾垚鏁伴噺', style: 'font-weight: bold'},
+                            {field: 'matnr', title: 'sku', width: 160},
+                            {field: 'maktx', title: '鍚嶇О', width: 80},
+                            {field: 'standby1', title: 'po'},
+                            {field: 'standby2', title: 'upc'},
+                            {field: 'anfme', title: '鏁伴噺', width: 80},
+                            {field: 'qty', title: '涓婃姤鏁伴噺', style: 'font-weight: bold'},
+                            {field: 'workQty', title: '鍘嗗彶涓婃姤鏁伴噺'},
                             // {field: 'unit', title: '鍗曚綅'},
                             // {
                             //     field: 'createTime$', title: '鍒涘缓鏃堕棿', sort: true, templet: function (d) {
@@ -132,8 +139,7 @@
                             //     },  width: 180
                             // },
                             // {field: 'inQty', title: '宸插叆搴撻噺'},
-                            // {field: 'color', title: '棰滆壊'},
-                            {field: 'specs', title: '瑙勬牸'}
+                            // {field: 'color', title: '棰滆壊'}
                         ]],
                         request: {
                             pageName: 'curr',
@@ -231,10 +237,12 @@
                     cellMinWidth: 100,
                     cols: [[
                         {type: 'numbers', title: '#'},
-                        {field: 'matnr', title: '鍟嗗搧缂栫爜', width: 160},
-                        {field: 'maktx', title: '鍟嗗搧鍚嶇О', width: 200},
-                        {field: 'batch', title: '鎵瑰彿', edit: true},
-                        {field: 'specs', title: '瑙勬牸'},
+                        {field: 'matnr', title: 'sku', width: 160},
+                        {field: 'maktx', title: '鍚嶇О', width: 80},
+                        // {field: 'batch', title: '鎵瑰彿', edit: true},
+                        // {field: 'specs', title: '瑙勬牸'},
+                        {field: 'standby1', title: 'po'},
+                        {field: 'standby2', title: 'upc'},
                         {field: 'anfme', title: '鏁伴噺(淇敼)', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110},
                         {field: 'workQty', title: '浣滀笟鏁伴噺',  minWidth: 100, width: 100},
                         // {field: 'unit', title: '鍗曚綅', width: 80},
@@ -436,7 +444,7 @@
 
     // 淇敼璁㈠崟鐘舵��
     function doModify(orderId, orderNo, settle) {
-        layer.confirm('纭畾瑕佹墜鍔ㄥ畬缁撳悧锛�', {
+        layer.confirm('纭畾瑕佸交搴曠粨鏉熷崟鎹悧锛燂紙灏嗚浆涓哄巻鍙叉。妗堬級', {
             shade: .1,
             skin: 'layui-layer-admin'
         }, function (i) {
@@ -472,6 +480,107 @@
         });
     }
 
+    // 淇敼璁㈠崟鐘舵��
+    function doModify99(orderId, orderNo, settle) {
+        layer.confirm('纭畾瑕佺户缁墽琛屽悧锛燂紙浼氬皢鏈墽琛屾暟閲忛噸鏂扮敓鎴愭墽琛屽崟鎹級', {
+            shade: .1,
+            skin: 'layui-layer-admin'
+        }, function (i) {
+            layer.close(i);
+            layer.load(2);
+            console.log(orderId);
+            console.log(settle);
+            $.ajax({
+                url: baseUrl+"/order/update/auth",
+                headers: {'token': localStorage.getItem('token')},
+                data: {
+                    id: orderId,
+                    orderNo: orderNo,
+                    settle: settle
+                },
+                method: 'POST',
+                success: function (res) {
+                    layer.closeAll('loading');
+                    if (res.code === 200){
+                        if (insTbCount === 0) {
+                            insTb.reload({page: {curr: 1}});
+                        } else {
+                            $(".layui-laypage-btn")[0].click();
+                        }
+                        layer.msg(res.msg, {icon: 1});
+                    } else if (res.code === 403){
+                        top.location.href = baseUrl+"/";
+                    }else {
+                        layer.msg(res.msg, {icon: 2});
+                    }
+                }
+            })
+        });
+    }
+
+    // 浠诲姟杩芥函
+    function showWrkTrace(orderId) {
+        let loadIndex = layer.msg('璇锋眰涓�...', {icon: 16, shade: 0.01, time: false});
+        $.ajax({
+            url: baseUrl+"/order/wrk/trace/auth",
+            headers: {'token': localStorage.getItem('token')},
+            data: {
+                orderId: orderId
+            },
+            method: 'POST',
+            success: function (res) {
+                layer.close(loadIndex);
+                if (res.code === 200){
+                    laytpl(wrkTraceDialog.innerHTML).render(res.data, function (html) {
+                        admin.open({
+                            type: 1,
+                            title: '浠诲姟杩芥函',
+                            area: ['800px', '450px'],
+                            shadeClose: true,
+                            content: html,
+                            success: function (layero, dIndex) {
+                                $(layero).children('.layui-layer-content').css('overflow', 'visible');
+                                /** 缁熻鍥捐〃 */
+                                var traceCharts = echarts.init(document.getElementById('wrkTraceCharts'));
+                                var traceOptions = {
+                                    title: {
+                                        text: '鎬婚噺/寰呬笂鎶�/宸蹭笂鎶�', x: 'center', y: '38%',
+                                        textStyle: {fontSize: 18, color: '#262626', fontWeight: 'normal'},
+                                        subtextStyle: {fontSize: 36, color: '#10B4E8'},
+                                        itemGap: 20
+                                    },
+                                    color: ['#10B4E8', '#E0E0E0', '#FF0000'],
+                                    tooltip: {trigger: 'item'},
+                                    series: [{name: '鏁伴噺', type: 'pie', radius: ['75%', '80%'], label: {normal: {show: false}}}]
+                                };
+                                traceCharts.setOption(traceOptions);
+                                // 璧嬪��
+                                traceCharts.setOption({
+                                    title: {
+                                        subtext: res.data.totalQty+"/"+res.data.endQty+"/"+res.data.wrkQty
+                                    },
+                                    series: [
+                                        {
+                                            data: [
+                                                {name: '宸蹭綔涓�', value: res.data.wrkQty+res.data.endQty},
+                                                {name: '鏈綔涓�', value: res.data.totalQty-res.data.wrkQty-res.data.endQty-res.data.lackQty},
+                                                {name: '搴撳瓨涓嶈冻', value: res.data.lackQty},
+                                            ]
+                                        }
+                                    ]
+                                });
+                            }
+                        });
+                    });
+                } else if (res.code === 403){
+                    top.location.href = baseUrl+"/";
+                }else {
+                    layer.msg(res.msg, {icon: 2});
+                }
+            }
+        })
+    }
+
     layDate.render({
         elem: '.layui-laydate-range'
         ,type: 'datetime'

--
Gitblit v1.9.1