From 470e647b6920774e4a297c46b7b7300bd22037b7 Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期四, 06 六月 2024 14:57:31 +0800
Subject: [PATCH] Merge branch 'master' of http://bore.pub:10439/r/ERP_override

---
 north-glass-erp/northglass-erp/src/assets/base.css                             |    4 +-
 north-glass-erp/northglass-erp/package.json                                    |    1 
 north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue              |   29 +++++++++-----
 north-glass-erp/src/main/java/com/example/erp/service/sd/BasicDateService.java |    7 +++
 north-glass-erp/northglass-erp/package-lock.json                               |   39 +++++++++++++++----
 north-glass-erp/northglass-erp/src/components/sd/order/OrderOtherMoney.vue     |    4 +-
 north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java     |   10 +++--
 7 files changed, 67 insertions(+), 27 deletions(-)

diff --git a/north-glass-erp/northglass-erp/package-lock.json b/north-glass-erp/northglass-erp/package-lock.json
index d486086..0e3380f 100644
--- a/north-glass-erp/northglass-erp/package-lock.json
+++ b/north-glass-erp/northglass-erp/package-lock.json
@@ -18,6 +18,7 @@
         "qrcode": "^1.5.3",
         "sortablejs": "^1.15.1",
         "vue": "^3.3.4",
+        "vue-draggable-plus": "^0.5.0",
         "vue-i18n": "^9.10.1",
         "vue-router": "^4.2.4",
         "vxe-table": "^4.5.15",
@@ -557,10 +558,9 @@
       }
     },
     "node_modules/@types/sortablejs": {
-      "version": "1.15.7",
-      "resolved": "https://registry.npmmirror.com/@types/sortablejs/-/sortablejs-1.15.7.tgz",
-      "integrity": "sha512-PvgWCx1Lbgm88FdQ6S7OGvLIjWS66mudKPlfdrWil0TjsO5zmoZmzoKiiwRShs1dwPgrlkr0N4ewuy0/+QUXYQ==",
-      "dev": true
+      "version": "1.15.8",
+      "resolved": "https://registry.npmmirror.com/@types/sortablejs/-/sortablejs-1.15.8.tgz",
+      "integrity": "sha512-b79830lW+RZfwaztgs1aVPgbasJ8e7AXtZYHTELNXZPsERt4ymJdjV4OccDbHQAvHrCcFpbF78jkm0R6h/pZVg=="
     },
     "node_modules/@types/web-bluetooth": {
       "version": "0.0.16",
@@ -1778,6 +1778,22 @@
         "@vue/shared": "3.3.4"
       }
     },
+    "node_modules/vue-draggable-plus": {
+      "version": "0.5.0",
+      "resolved": "https://registry.npmmirror.com/vue-draggable-plus/-/vue-draggable-plus-0.5.0.tgz",
+      "integrity": "sha512-A5TT5+M5JceROSjPO9aDZTsrSN1TetEs419czPlboomarSiGIBIxTp2WD7XH53EHMrbO7Qo+leRiHWV/rMlyjA==",
+      "dependencies": {
+        "@types/sortablejs": "^1.15.8"
+      },
+      "peerDependencies": {
+        "@types/sortablejs": "^1.15.0"
+      },
+      "peerDependenciesMeta": {
+        "@vue/composition-api": {
+          "optional": true
+        }
+      }
+    },
     "node_modules/vue-i18n": {
       "version": "9.10.1",
       "resolved": "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-9.10.1.tgz",
@@ -2216,10 +2232,9 @@
       }
     },
     "@types/sortablejs": {
-      "version": "1.15.7",
-      "resolved": "https://registry.npmmirror.com/@types/sortablejs/-/sortablejs-1.15.7.tgz",
-      "integrity": "sha512-PvgWCx1Lbgm88FdQ6S7OGvLIjWS66mudKPlfdrWil0TjsO5zmoZmzoKiiwRShs1dwPgrlkr0N4ewuy0/+QUXYQ==",
-      "dev": true
+      "version": "1.15.8",
+      "resolved": "https://registry.npmmirror.com/@types/sortablejs/-/sortablejs-1.15.8.tgz",
+      "integrity": "sha512-b79830lW+RZfwaztgs1aVPgbasJ8e7AXtZYHTELNXZPsERt4ymJdjV4OccDbHQAvHrCcFpbF78jkm0R6h/pZVg=="
     },
     "@types/web-bluetooth": {
       "version": "0.0.16",
@@ -3037,6 +3052,14 @@
         "@vue/shared": "3.3.4"
       }
     },
+    "vue-draggable-plus": {
+      "version": "0.5.0",
+      "resolved": "https://registry.npmmirror.com/vue-draggable-plus/-/vue-draggable-plus-0.5.0.tgz",
+      "integrity": "sha512-A5TT5+M5JceROSjPO9aDZTsrSN1TetEs419czPlboomarSiGIBIxTp2WD7XH53EHMrbO7Qo+leRiHWV/rMlyjA==",
+      "requires": {
+        "@types/sortablejs": "^1.15.8"
+      }
+    },
     "vue-i18n": {
       "version": "9.10.1",
       "resolved": "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-9.10.1.tgz",
diff --git a/north-glass-erp/northglass-erp/package.json b/north-glass-erp/northglass-erp/package.json
index 6af8a11..91869c3 100644
--- a/north-glass-erp/northglass-erp/package.json
+++ b/north-glass-erp/northglass-erp/package.json
@@ -18,6 +18,7 @@
     "qrcode": "^1.5.3",
     "sortablejs": "^1.15.1",
     "vue": "^3.3.4",
+    "vue-draggable-plus": "^0.5.0",
     "vue-i18n": "^9.10.1",
     "vue-router": "^4.2.4",
     "vxe-table": "^4.5.15",
diff --git a/north-glass-erp/northglass-erp/src/assets/base.css b/north-glass-erp/northglass-erp/src/assets/base.css
index 1cb3948..19b8f97 100644
--- a/north-glass-erp/northglass-erp/src/assets/base.css
+++ b/north-glass-erp/northglass-erp/src/assets/base.css
@@ -86,8 +86,8 @@
 }
 /*婊氬姩鏉℃暣浣撻儴鍒�*/
 .mytable-scrollbar ::-webkit-scrollbar {
-  width: 10px;
-  height: 10px;
+  width: 15px;
+  height: 15px;
 }
 /*婊氬姩鏉$殑杞ㄩ亾*/
 .mytable-scrollbar ::-webkit-scrollbar-track {
diff --git a/north-glass-erp/northglass-erp/src/components/sd/order/OrderOtherMoney.vue b/north-glass-erp/northglass-erp/src/components/sd/order/OrderOtherMoney.vue
index d2cd57e..622e4a3 100644
--- a/north-glass-erp/northglass-erp/src/components/sd/order/OrderOtherMoney.vue
+++ b/north-glass-erp/northglass-erp/src/components/sd/order/OrderOtherMoney.vue
@@ -144,10 +144,10 @@
   otherMoney:{}
 })
 onMounted(()=>{
-  xGrid.value.reloadData(prop.otherMoney)
+  xGrid.value.reloadData(prop.otherMoney.filter(item => item.column.indexOf('M')>-1))
 })
 watch(prop,(newVal)=>{
-  xGrid.value.reloadData(prop.otherMoney)
+  xGrid.value.reloadData(prop.otherMoney.filter(item => item.column.indexOf('M')>-1))
 })
 
 const countAmount = (row) => {
diff --git a/north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue b/north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue
index fcab099..5e2b1cb 100644
--- a/north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue
+++ b/north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue
@@ -569,7 +569,7 @@
       orderDetails.forEach(item => {
         item.otherColumns = JSON.parse(item.otherColumns)
       })
-      otherMoney.value =res.data.orderOtherMoneyList
+      otherMoney.value =res.data.orderOtherMoneyList.filter(item => item.column.indexOf('M')>-1)
           //鍔犺浇鍓〃鏁版嵁
       xGrid.value.reloadData(orderDetails)
       gridOptions.loading = false
@@ -606,21 +606,30 @@
     otherMoney.value.forEach(item => {
       let column = {
         field: `otherColumns.${item.column}`,
-        width:50,  title: item.alias,
+        width:100,
+        title: item.alias,
         editRender: {
           name: 'input',
         }
       }
-      gridOptions.editRules[`otherColumns.${item.column}`] = [
-        {
-          validator ({ cellValue }) {
-            const regex = /^(0|[1-9][0-9]{0,4}([.][0-9]{1,2})?)$/
-            if (cellValue && !regex.test(cellValue)) {
-              return new Error(t('basicData.msg.range99999Dec2'))
+      //鍒ゆ柇  鍏朵粬鍒楁槸鍚︽槸鏁板瓧
+      if(item.column.indexOf('M')>-1){
+        gridOptions.editRules[`otherColumns.${item.column}`] = [
+          {
+            validator ({ cellValue }) {
+              const regex = /^(0|[1-9][0-9]{0,4}([.][0-9]{1,2})?)$/
+              if (cellValue && !regex.test(cellValue)) {
+                return new Error(t('basicData.msg.range99999Dec2'))
+              }
             }
           }
-        }
-      ]
+        ]
+      }else{
+        gridOptions.editRules[`otherColumns.${item.column}`] = [
+          { required: false},
+          { min: 0, max: 255, message: t('basicData.msg.max255') }
+        ]
+      }
 
       //columns.push(column)
       gridOptions.columns.push(column)
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/sd/BasicDateService.java b/north-glass-erp/src/main/java/com/example/erp/service/sd/BasicDateService.java
index 54b6899..9b6ecad 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/sd/BasicDateService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/sd/BasicDateService.java
@@ -1,7 +1,9 @@
 package com.example.erp.service.sd;
 
 import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.example.erp.entity.sd.BasicData;
+import com.example.erp.entity.sd.BasicOtherMoney;
 import com.example.erp.entity.sd.Customer;
 import com.example.erp.mapper.sd.BasicDateMapper;
 import com.example.erp.mapper.sd.BasicOtherMoneyMapper;
@@ -42,7 +44,10 @@
             orderBasicDataMap.get("customer").add(customer);
         }
 
-        orderBasicDataMap.put("orderOtherMoney", Collections.singletonList(basicOtherMoneyMapper.selectList(null)));
+        orderBasicDataMap.put("orderOtherMoney",
+                Collections.singletonList(
+                        basicOtherMoneyMapper.selectList(new QueryWrapper<BasicOtherMoney>().eq("state",1))
+                ));
 
 
         //杩斿洖Map瀵硅薄
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java b/north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java
index d00f41c..64baf4d 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java
@@ -49,6 +49,7 @@
         Order order = JSONObject.parseObject(JSONObject.toJSONString(orderJson.get("title")), Order.class);
         List<OrderDetail> OrderDetails = JSONArray.parseArray(JSONObject.toJSONString(orderJson.get("detail")), OrderDetail.class);
         List<OrderOtherMoney> orderOtherMoneyList = JSONArray.parseArray(JSONObject.toJSONString(orderJson.get("otherMoney")), OrderOtherMoney.class);
+
         boolean saveState = true;
         //璁剧疆鍥炴粴鐐�
         Object savePoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint();
@@ -101,6 +102,7 @@
         //鍒犻櫎鍏朵粬閲戦鏄庣粏琛�
         orderOtherMoneyMapper.delete(new LambdaQueryWrapper<OrderOtherMoney>().eq(OrderOtherMoney::getOrderId, order.getOrderId()));
 
+
         //鍒犻櫎璁㈠崟宸ヨ壓琛�
        // orderProcessDetailMapper.delete(new LambdaQueryWrapper<OrderProcessDetail>().eq(OrderProcessDetail::getOrderId, order.getOrderId()));
         insertOtherDetail(order.getOrderId(),OrderDetails,orderOtherMoneyList);
@@ -109,6 +111,7 @@
 
     //鎻掑叆鍏朵粬鍓〃鏁版嵁锛岃鍏朵粬鏂规硶寮曠敤
     public void insertOtherDetail(String orderId,List<OrderDetail> OrderDetails,List<OrderOtherMoney> orderOtherMoneyList) {
+
         //鍏堟妸鍏朵粬閲戦鍓〃鐨勯噾棰濅笌鏁伴噺缃�0
         orderOtherMoneyList.forEach(orderOtherMoney -> {
             orderOtherMoney.setQuantity(0.0);
@@ -120,16 +123,15 @@
             OrderDetails.get(i).setOrderId(orderId);
             OrderDetails.get(i).setPerimeter(OrderDetails.get(i).getWidth()*OrderDetails.get(i).getHeight()*2/1000);
             OrderDetails.get(i).setWeight(1.0);
-            Map<String,Double> otherColumns = JSON.parseObject(OrderDetails.get(i).getOtherColumns(), new TypeReference<Map<String, Double>>(){});
+            Map<String,Object> otherColumns = JSON.parseObject(OrderDetails.get(i).getOtherColumns(), new TypeReference<Map<String, Object>>(){});
             int finalI = i;
-
 
             if(otherColumns!=null){
                 otherColumns.forEach((key, value) ->{
-                    if(value!=null) {
+                    if(value!=null && key.contains("M")) {
                         orderOtherMoneyList.forEach(orderOtherMoney -> {
                             if (orderOtherMoney.getColumn().equals(key)) {
-                                orderOtherMoney.setQuantity(orderOtherMoney.getQuantity()+(value * OrderDetails.get(finalI).getQuantity()));
+                                orderOtherMoney.setQuantity(orderOtherMoney.getQuantity()+(Double.parseDouble((String) value)  * OrderDetails.get(finalI).getQuantity()));
                             }
                         });
                     }

--
Gitblit v1.8.0