From 2c98be64470f8298d3083ce337b0ffb948bee5f7 Mon Sep 17 00:00:00 2001
From: guoyujie <guoyujie@ng.com>
Date: 星期一, 09 六月 2025 16:45:34 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override

---
 north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue |   42 ++++++++++++++++++++++++++++++------------
 1 files changed, 30 insertions(+), 12 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue
index bd7012d..98a9ca4 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue
@@ -73,6 +73,7 @@
 
 const orderId = route.query.orderId
 const productionId = route.query.productionId
+const orderQuantity = route.query.quantity
 
 const orderOtherMoney = ref(null)
 
@@ -147,7 +148,7 @@
   },
   formConfig: {
     data: {
-      shelfThickness: 2000,
+      shelfThickness: 800,
       spacerThickness: 0,
       inWeight: 4000,
       inMaxQuantity: 20,
@@ -164,6 +165,9 @@
         { required: true, message: t('delivery.pleaseEnterANumericalValueGreaterThanOrEqualTo0'),type:'number',pattern:/^[0-9]\d*$/ }
       ],
       inWeight: [
+        { required: true, message: t('basicData.msg.greater0'),type:'number',pattern:/^[1-9]\d*$/ }
+      ],
+      inMaxQuantity: [
         { required: true, message: t('basicData.msg.greater0'),type:'number',pattern:/^[1-9]\d*$/ }
       ]
     },
@@ -310,6 +314,7 @@
       path: '/main/processCard/AddProcessCard',
       query: {orderId: orderId,
         productionId: productionId,
+        quantity: orderQuantity,
         random:Math.random()
       }
     })
@@ -792,6 +797,7 @@
             if (item.baiscQuantity === 0) {
               $grid.remove(item)
             }
+            $gridLeft.reloadData([...$gridLeft.getTableData().fullData])
             //delete item._X_ROW_KEY
           } else {
             item.quantity = checkedNum.value
@@ -843,9 +849,8 @@
       checkedList.forEach((item) => {
         item.processId = checkedListLeft[0].processId
         item.landingSequence = checkedListLeft[0].landingSequence
-        item.quantity = checkedListLeft[0].baiscQuantity
+        item.quantity = item.baiscQuantity
         item.computeGrossArea = (item.computeGrossArea - checkedListLeft[0].width * checkedListLeft[0].height * checkedListLeft[0].baiscQuantity / 1000000).toFixed(2)
-
         delete item._X_ROW_KEY
       })
       $gridLeft.insertAt(checkedList)
@@ -891,6 +896,15 @@
               gridLeftOptions.toolbarConfig.buttons[0].disabled=false
               return;
             }
+
+            // 璁$畻 $table 閲� quantity 瀛楁鐨勬�诲拰
+            let totalQuantity = selectRecords.reduce((sum, record) => sum + (Number(record.quantity) || 0), 0);
+            // 瀵规瘮鍏ㄥ眬鍙橀噺 orderQuantity
+            if (totalQuantity !== orderQuantity*1) {
+              ElMessage.warning(`鎵�閫夋暟鎹殑鏁伴噺鎬诲拰 (${totalQuantity}) 涓庤鍗曟暟閲� (${orderQuantity}) 涓嶅尮閰嶏紝璇锋鏌ュ悗閲嶈瘯锛乣);
+              gridLeftOptions.toolbarConfig.buttons[0].disabled = false;
+              return;
+            }
             // if (leftData.length!=selectRecords.length){
             //   ElMessage.warning('璇峰嬀閫夋墍鏈夋暟鎹繘琛屼繚瀛�')
             //   gridLeftOptions.toolbarConfig.buttons[0].disabled=false
@@ -934,19 +948,22 @@
 
 let quantit = ref('')
 let weight = ref('')
-const handleCheckboxChange = ({row}) => {
-  const $grid = xGrid.value
-  //鑾峰彇鍙宠竟琛ㄦ牸checkbox閫変腑鐨勬暟鎹�
-  const checkedList = $grid.getCheckboxRecords()
+const handleCheckboxChange = ({ row }) => {
+  const $grid = xGrid.value;
+  // 鑾峰彇鍙宠竟琛ㄦ牸 checkbox 閫変腑鐨勬暟鎹�
+  const checkedList = $grid.getCheckboxRecords();
   let quantitySum = 0;
   let weightsum = 0;
+
   checkedList.forEach(item => {
-    quantitySum += item.baiscQuantity;
+    quantitySum += Number(item.baiscQuantity) || 0; // 纭繚杞崲涓烘暟瀛�
     weightsum += weightSum(item);
   });
-  quantit.value = quantitySum;
+
+  quantit.value = Number(quantitySum) || 0; // 纭繚鏈�缁堝�兼槸鏁板瓧
   weight.value = parseFloat(weightsum.toFixed(2));
-}
+};
+
 </script>
 
 <template>
@@ -1004,8 +1021,8 @@
         <div height="100%" style="margin: 5px" width="11%">
           <el-main style="">
             <div>
-              <span><el-input v-model="quantit" style="width: 80px;"/></span>
-              <span><el-input v-model="weight" style="width: 80px;"/></span>
+              <span><el-input :readonly="true" v-model="quantit" style="width: 80px;"/></span>
+              <span><el-input :readonly="true" v-model="weight" style="width: 80px;"/></span>
             </div>
             <span>{{ $t('processCard.selectedQuantity') }}:<el-input id="checkedNum" v-model="checkedNum" clearable
                                                                      type="number"></el-input></span><br>
@@ -1037,6 +1054,7 @@
                 v-bind="gridOptions"
                 v-on="gridEventsRight"
                 @checkbox-change="handleCheckboxChange"
+                @checkbox-all="handleCheckboxChange"
             >
               <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
               <!--      涓嬫媺鏄剧ず鎵�鏈変俊鎭彃妲�-->

--
Gitblit v1.8.0