From 42b24af07f1ec2d1a375232d754128ba41d56f0a Mon Sep 17 00:00:00 2001
From: chen.lin <1442464845@qq.com>
Date: 星期四, 29 一月 2026 15:35:55 +0800
Subject: [PATCH] pda匹配单号

---
 src/main/webapp/static/js/salesOrder/salsesOrder.js |  123 ++++++++++++++++++++++++++++++++--------
 1 files changed, 98 insertions(+), 25 deletions(-)

diff --git a/src/main/webapp/static/js/salesOrder/salsesOrder.js b/src/main/webapp/static/js/salesOrder/salsesOrder.js
index 2508d00..ecb3352 100644
--- a/src/main/webapp/static/js/salesOrder/salsesOrder.js
+++ b/src/main/webapp/static/js/salesOrder/salsesOrder.js
@@ -4,23 +4,32 @@
 function getCol() {
     var cols = [];
     cols.push(
-        {field: 'orderCode', align: 'center', title: '璁㈠崟缂栧彿', width: 110}
-        , {field: 'orderDate', align: 'center', title: '璁㈠崟鏃ユ湡', width: 120}
-        , {field: 'invCode', align: 'center', title: '鐗╂枡缂栫爜', width: 130}
-        , {field: 'invName', align: 'center', title: '鐗╂枡鍚嶇О', width: 350}
-        , {field: 'invStd', align: 'center', title: '瑙勬牸鍨嬪彿', width: 160}
-        , {field: 'invUnit', align: 'center', title: '鍗曚綅', width: 80, hide: true}
-        , {field: 'orderQty', align: 'center', title: '璁㈠崟鏁伴噺', width: 120}
-        , {field: 'izMrp', align: 'center', title: '澶ц鍗�(mrp)',width: 115}
-        , {field: 'productQty', align: 'center', title: '浠诲姟鍗�', width: 110}
-        , {field: 'izReceive', align: 'center', title: '灏忚鍗�', width: 80}
-        , {field: 'inQty', align: 'center', title: '鍏ュ簱鏁伴噺', width: 110}
-        , {field: 'disQty', align: 'center', title: '閫氱煡鍗�', width: 110}
-        , {field: 'outQty', align: 'center', title: '鍑哄簱鏁伴噺', width: 110}
-        , {field: 'invoiceQty', align: 'center', title: '寮�绁ㄦ暟閲�'}
-        , {field: 'unInvoiceQty', align: 'center', title: '鏈紑绁ㄦ暟閲�'}
-        , {field: 'deliveryDate', align: 'center', title: '浜よ揣鏃ユ湡'}
-        , {field: 'personName', align: 'center', title: '涓氬姟鍛�'}
+        { type: 'checkbox', fixed: 'left' }
+        , { field: 'orderCode', align: 'center', title: '璁㈠崟缂栧彿', width: 110 }
+        , { field: 'orderDate', align: 'center', title: '璁㈠崟鏃ユ湡', width: 120 }
+        , { field: 'invCode', align: 'center', title: '鐗╂枡缂栫爜', width: 130 }
+        , { field: 'invName', align: 'center', title: '鐗╂枡鍚嶇О', width: 350 }
+        , { field: 'invStd', align: 'center', title: '瑙勬牸鍨嬪彿', width: 160 }
+        , { field: 'invUnit', align: 'center', title: '鍗曚綅', width: 80, hide: true }
+        , { field: 'orderQty', align: 'center', title: '璁㈠崟鏁伴噺', width: 120 }
+        , { field: 'izMrp', align: 'center', title: '澶ц鍗�(mrp)', width: 115 }
+        , { field: 'productQty', align: 'center', title: '浠诲姟鍗�', width: 110 }
+        , { field: 'izReceive', align: 'center', title: '灏忚鍗�', width: 80 }
+        , { field: 'inQty', align: 'center', title: '鍏ュ簱鏁伴噺', width: 110 }
+        , { field: 'disQty', align: 'center', title: '閫氱煡鍗�', width: 110 }
+        , { field: 'icsbeqty', align: 'center', title: '鍑鸿揣閫氱煡鏁�', width: 110 }
+        // , { field: 'seoseqty', align: 'center', title: '瀹炲嚭鏁伴噺', width: 110 }
+        , { field: 'outQty', align: 'center', title: '瀵硅处鏁伴噺', width: 110 }
+        , { field: 'invoiceQty', align: 'center', title: '寮�绁ㄦ暟閲�', width: 110 }
+        , { field: 'unInvoiceQty', align: 'center', title: '鏈紑绁ㄦ暟閲�', width: 110 }
+        , { field: 'deliveryDate', align: 'center', title: '浜よ揣鏃ユ湡', width: 110 }
+        , { field: 'personName', align: 'center', title: '涓氬姟鍛�', width: 110 }
+        , { field: 'outDate', align: 'center', title: '鍑哄簱鏃ユ湡', width: 110 }
+        , { field: 'outPrice', align: 'center', title: '鍑哄簱鍗曚环', width: 110 }
+        , { field: 'outAmount', align: 'center', title: '鍑哄簱閲戦', width: 110 }
+        , { field: 'invoiceDate', align: 'center', title: '寮�绁ㄦ棩鏈�', width: 110 }
+        , { field: 'invoiceAmount', align: 'center', title: '寮�绁ㄩ噾棰�', width: 110 }
+        , { field: 'custName', align: 'center', title: '瀹㈡埛鍚嶇О', width: 110 }
     );
     return cols;
 }
@@ -36,8 +45,8 @@
     // 鏁版嵁娓叉煋
     tableIns = table.render({
         elem: '#salesOrder',
-        headers: {token: localStorage.getItem('token')},
-        url: 'http://192.168.0.253:8073/api/report/getorderreport',
+        headers: { token: localStorage.getItem('token') },
+        url: 'http://127.0.0.1:8133/api/report/getorderreport2',
         height: 650,
         width: '100%',
         page: true,
@@ -70,6 +79,46 @@
         }
     });
 
+    // 宸ュ叿鏍忎簨浠�
+    table.on('toolbar(salesOrder)', function (obj) {
+        var checkStatus = table.checkStatus(obj.config.id);
+        var data = checkStatus.data;
+
+        switch (obj.event) {
+            case 'saveToErp':
+                if (data.length === 0) {
+                    layer.msg('璇峰厛閫夋嫨瑕佷繚瀛樼殑鏁版嵁', { icon: 5 });
+                    return;
+                }
+                layer.confirm('纭畾瑕佸皢閫変腑鐨� ' + data.length + ' 鏉℃暟鎹繚瀛樺埌ERP鍚楋紵', { icon: 3, title: '鎻愮ず' }, function (index) {
+                    layer.close(index);
+                    // 鎵归噺淇濆瓨
+                    var loadIndex = layer.load(2);
+                    $.ajax({
+                        url: baseUrl + '/saleOrder/batchSave/auth',
+                        type: 'POST',
+                        contentType: 'application/json',
+                        headers: { 'token': localStorage.getItem('token') },
+                        data: JSON.stringify(data),
+                        success: function (res) {
+                            layer.close(loadIndex);
+                            if (res.code === 200) {
+                                layer.msg('淇濆瓨鎴愬姛锛屽叡淇濆瓨 ' + data.length + ' 鏉℃暟鎹�', { icon: 1 });
+                                tableReload(false);
+                            } else {
+                                layer.msg(res.msg || '淇濆瓨澶辫触', { icon: 2 });
+                            }
+                        },
+                        error: function () {
+                            layer.close(loadIndex);
+                            layer.msg('缃戠粶閿欒锛岃绋嶅悗閲嶈瘯', { icon: 2 });
+                        }
+                    });
+                });
+                break;
+        }
+    });
+
     // 鎼滅储鏍忛噸缃簨浠�
     form.on('submit(reset)', function (data) {
         pageCurr = 1;
@@ -88,20 +137,44 @@
 
     // 鏃堕棿閫夋嫨鍣�
     layDate.render({
-        elem: '.layui-laydate-range'
-        ,style: 'width: 150px'
+        elem: '#orderTimeRange'
+        , style: 'width: 150px'
         , range: true
     });
+    layDate.render({
+        elem: '#orderTimeDeliveryRange'
+        , style: 'width: 150px'
+        , range: true
+    });
+    layDate.render({
+        elem: '#orderTimeOutRange'
+        , style: 'width: 150px'
+        , range: true
+    });
+
+    // layDate.render({
+    //     elem: '.layui-laydate-range'
+    //     ,style: 'width: 150px'
+    //     , range: true
+    // });
 });
 
 /* 琛ㄦ牸鏁版嵁閲嶈浇 */
 function tableReload(child) {
     var searchData = {};
-    $.each($('#search-box [name]').serializeArray(), function() {
+    $.each($('#search-box [name]').serializeArray(), function () {
         searchData[this.name] = this.value;
         if (this.name == 'orderTime') {
             searchData.startTime = this.value.substring(0, 10);
             searchData.endTime = this.value.substring(13, this.value.length);
+        }
+        if (this.name == 'orderTimeDelivery') {
+            searchData.startTimeDelivery = this.value.substring(0, 10);
+            searchData.endTimeDelivery = this.value.substring(13, this.value.length);
+        }
+        if (this.name == 'orderTimeOut') {
+            searchData.startTimeOut = this.value.substring(0, 10);
+            searchData.endTimeOut = this.value.substring(13, this.value.length);
         }
     });
     (child ? parent.tableIns : tableIns).reload({
@@ -111,14 +184,14 @@
         },
         done: function (res, curr, count) {
             if (res.code === 403) {
-                top.location.href = baseUrl+"/";
+                top.location.href = baseUrl + "/";
             }
-            pageCurr=curr;
+            pageCurr = curr;
             if (res.data.length === 0 && count !== 0) {
                 tableIns.reload({
                     where: searchData,
                     page: {
-                        curr: pageCurr-1
+                        curr: pageCurr - 1
                     }
                 });
                 pageCurr -= 1;

--
Gitblit v1.9.1