From c46f9c28f8d40d2a4efcc7ef6e528661d97a4be0 Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期二, 14 二月 2023 13:48:18 +0800
Subject: [PATCH] #

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

diff --git a/src/main/webapp/static/js/order/order.js b/src/main/webapp/static/js/order/order.js
index bf48418..3622707 100644
--- a/src/main/webapp/static/js/order/order.js
+++ b/src/main/webapp/static/js/order/order.js
@@ -1,5 +1,6 @@
 var insTbCount = 0;
 var admin;
+var insTb
 layui.config({
     base: baseUrl + "/static/layui/lay/modules/"
 }).use(['layer', 'form', 'table', 'util', 'admin', 'xmSelect', 'laydate'], function () {
@@ -35,7 +36,7 @@
     })
 
     // 娓叉煋琛ㄦ牸
-    var insTb = table.render({
+    insTb = table.render({
         elem: '#order',
         url: baseUrl+'/order/head/page/auth',
         headers: {token: localStorage.getItem('token')},
@@ -240,6 +241,7 @@
                         {field: 'batch', title: '搴忓垪鐮�', edit: true},
                         {field: 'specs', title: '瑙勬牸'},
                         {field: 'anfme', title: '鏁伴噺(淇敼)', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110},
+                        {field: 'sum', title: '搴撳瓨鏁伴噺', style: 'color: red;font-weight: bold',  minWidth: 110, width: 110},
                         // {field: 'inQty', title: '宸插叆搴撻噺',  minWidth: 100, width: 100},
                         // {field: 'unit', title: '鍗曚綅', width: 80},
                         {field: 'memo', title: '澶囨敞' , edit: true},
@@ -339,8 +341,17 @@
                                         async: false,
                                         success: function (res) {
                                             if (res.code === 200){
-                                                xxDataList.push(res.data);
-                                                insTbSSXM.reload({data: xxDataList, page: {curr: 1}});
+                                                var bige=true;
+                                                for (var j = 0; j < xxDataList.length; j++) {
+                                                    if (xxDataList[j].matnr === res.data.matnr && xxDataList[j].batch === res.data.batch) {
+                                                        bige=false;
+                                                        break;
+                                                    }
+                                                }
+                                                if (bige){
+                                                    xxDataList.push(res.data);
+                                                    insTbSSXM.reload({data: xxDataList, page: {curr: 1}});
+                                                }
                                             } else if (res.code === 403){
                                                 top.location.href = baseUrl+"/";
                                             }else {
@@ -565,7 +576,7 @@
     let res = JSON.parse(evt.target.responseText);
     if(res.code === 200) {
         layer.msg(res.msg, {icon: 1});
-        tableReload();
+        insTb.reload({page: {curr: 1}});
     } else {
         alert(res.msg);
         // layer.msg(res.msg, {icon: 2});

--
Gitblit v1.9.1