From 0ed8d9ed041efec0b726a33be20d879c9457e319 Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期四, 06 六月 2024 09:39:49 +0800
Subject: [PATCH] Merge branch 'master' of http://bore.pub:10439/r/ERP_override

---
 north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue |   42 ++++++++++++++++++++++--------------------
 1 files changed, 22 insertions(+), 20 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 bba91c1..6944a60 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
@@ -13,6 +13,7 @@
 import {VXETable} from "vxe-table";
 import useUserInfoStore from "@/stores/userInfo";
 import {useI18n} from 'vue-i18n'
+import footSum from "@/hook/footSum"
 //璇█鑾峰彇
 const {t} = useI18n()
 let productGlassTypeStore = useProductGlassTypeStore()
@@ -221,15 +222,15 @@
   },
   data: [],//table body瀹為檯鏁版嵁
   //鑴氶儴姹傚拰
-  footerMethod({columns, data}) {//椤佃剼鍑芥暟
-    let footList = ['', '', '', '', '']
-    return [
+  footerMethod ({ columns, data }) {//椤佃剼鍑芥暟
+    return[
       columns.map((column, columnIndex) => {
         if (columnIndex === 0) {
           return t('basicData.total')
         }
-        if (footList.includes(column.field)) {
-          return sumNum(data, column.field)
+        const List = ["baiscQuantity",'computeGrossArea','weight','perimeter']
+        if (List.includes(column.field)) {
+          return footSum(data, column.field)
         }
         return ''
       })
@@ -318,15 +319,15 @@
   },
   data: [],//table body瀹為檯鏁版嵁
   //鑴氶儴姹傚拰
-  footerMethod({columns, data}) {//椤佃剼鍑芥暟
-    let footList = ['']
-    return [
+  footerMethod ({ columns, data }) {//椤佃剼鍑芥暟
+    return[
       columns.map((column, columnIndex) => {
         if (columnIndex === 0) {
           return t('basicData.total')
         }
-        if (footList.includes(column.field)) {
-          return sumNum(data, column.field)
+        const List = ["quantity",'goodsQuantity','area','perimeter']
+        if (List.includes(column.field)) {
+          return footSum(data, column.field)
         }
         return ''
       })
@@ -369,7 +370,7 @@
       item.processId = processId
       item.landingSequence = index
       item.baiscQuantity = item.baiscQuantity - checkedNum.value
-      item.computeGrossArea = item.computeGrossArea - item.width * item.height * checkedNum.value / 1000000
+      item.computeGrossArea = (item.computeGrossArea - item.width * item.height * checkedNum.value / 1000000).toFixed(2)
 
       //鍒犻櫎key
       let key = item._X_ROW_KEY
@@ -443,7 +444,7 @@
           //鏁伴噺
           rightData[filterIndex].baiscQuantity = rightData[filterIndex].baiscQuantity * 1 + checkedNum.value * 1
           //闈㈢Н
-          rightData[filterIndex].computeGrossArea=rightData[filterIndex].width*rightData[filterIndex].height*rightData[filterIndex].baiscQuantity/1000000
+          rightData[filterIndex].computeGrossArea=(rightData[filterIndex].width*rightData[filterIndex].height*rightData[filterIndex].baiscQuantity/1000000).toFixed(2)
           //濡傛灉宸﹁竟鏁伴噺涓�0鏃跺垹闄ゆ鏉℃暟鎹�
           //鍒犻櫎key
           let key = item._X_ROW_KEY
@@ -455,7 +456,7 @@
         } else {
           //鍙宠竟琛ㄦ牸娌℃湁姝ゆ潯鏁版嵁鍒欏線鍙宠竟琛ㄦ牸鎻掑叆鏁版嵁
           item.baiscQuantity = checkedNum.value
-          item.computeGrossArea=item.width*item.height*checkedNum.value/1000000
+          item.computeGrossArea=(item.width*item.height*checkedNum.value/1000000).toFixed(2)
           if (item.quantity === 0) {
             $gridLeft.remove(item)
           }
@@ -474,11 +475,12 @@
         if (filterIndex > -1) {
           rightData[filterIndex].baiscQuantity = rightData[filterIndex].baiscQuantity * 1 + item.quantity * 1
           //闈㈢Н
-          rightData[filterIndex].computeGrossArea=rightData[filterIndex].width*rightData[filterIndex].height*rightData[filterIndex].baiscQuantity/1000000
+          rightData[filterIndex].computeGrossArea=(rightData[filterIndex].width*rightData[filterIndex].height*rightData[filterIndex].baiscQuantity/1000000).toFixed(2)
 
         } else {
           delete item._X_ROW_KEY
-          $grid.insert(item)
+          console.log(item)
+          //$grid.insert(item)
         }
 
         $gridLeft.remove(item)
@@ -524,7 +526,7 @@
         //鍒ゆ柇鍙敤鏁伴噺鏄惁澶т簬绛変簬杈撳叆鐨勬暟閲�,涓嶆弧瓒冲垯鎶涘嚭寮傚父
         if (item.baiscQuantity * 1 < checkedNum.value * 1) throw new Error("璇疯緭鍏ュ皬浜庣瓑浜庡緟鍒嗘暟閲忕殑鏁板瓧");
         item.baiscQuantity = item.baiscQuantity - checkedNum.value
-        item.computeGrossArea=item.computeGrossArea-item.width*item.height*checkedNum.value/1000000
+        item.computeGrossArea=(item.computeGrossArea-item.width*item.height*checkedNum.value/1000000).toFixed(2)
         //瀹氫箟key鍊间繚鎸�
         let key = item._X_ROW_KEY
         //宸﹁竟琛ㄦ牸鏁版嵁
@@ -537,7 +539,7 @@
           //濡傛灉鍙宠竟琛ㄦ牸鏁版嵁涓瓨鍦ㄥ綋鍓嶆暟鎹垯鏁伴噺鐩稿姞
           if (filterIndex >= 0) {
             leftData[filterIndex].quantity = leftData[filterIndex].quantity * 1 + checkedNum.value * 1
-            leftData[filterIndex].computeGrossArea=leftData[filterIndex].computeGrossArea-leftData[filterIndex].width*leftData[filterIndex].height*leftData[filterIndex].baiscQuantity/1000000
+            leftData[filterIndex].computeGrossArea=(leftData[filterIndex].computeGrossArea-leftData[filterIndex].width*leftData[filterIndex].height*leftData[filterIndex].baiscQuantity/1000000).toFixed(2)
 
             if (item.baiscQuantity === 0) {
               $grid.remove(checkedList)
@@ -547,7 +549,7 @@
             item.quantity = checkedNum.value
             item.processId = checkedListLeft[0].processId
             item.landingSequence = checkedListLeft[0].landingSequence
-            item.computeGrossArea=item.computeGrossArea-checkedListLeft[0].width*checkedListLeft[0].height*checkedNum.value/1000000
+            item.computeGrossArea=(item.computeGrossArea-checkedListLeft[0].width*checkedListLeft[0].height*checkedNum.value/1000000).toFixed(2)
             delete item._X_ROW_KEY
             $gridLeft.insert(item)
             item._X_ROW_KEY = key
@@ -566,7 +568,7 @@
           for (let i = 0; i < leftData.length; i++) {
             if (leftData[i].orderNumber === item.orderNumber && leftData[i].processId === item.processId) {
               leftData[i].quantity = leftData[i].quantity * 1 + checkedNum.value * 1
-              leftData[i].computeGrossArea=leftData[i].computeGrossArea-leftData[i].width*leftData[i].height*leftData[i].baiscQuantity/1000000
+              leftData[i].computeGrossArea=(leftData[i].computeGrossArea-leftData[i].width*leftData[i].height*leftData[i].baiscQuantity/1000000).toFixed(2)
 
               break
             } else if (leftData[i].orderNumber === item.orderNumber && leftData[i].processId !== item.processId) {
@@ -591,7 +593,7 @@
         item.processId = checkedListLeft[0].processId
         item.landingSequence = checkedListLeft[0].landingSequence
         item.quantity = checkedListLeft[0].baiscQuantity
-        item.computeGrossArea=item.computeGrossArea-checkedListLeft[0].width*checkedListLeft[0].height*checkedListLeft[0].baiscQuantity/1000000
+        item.computeGrossArea=(item.computeGrossArea-checkedListLeft[0].width*checkedListLeft[0].height*checkedListLeft[0].baiscQuantity/1000000).toFixed(2)
 
         delete item._X_ROW_KEY
       })

--
Gitblit v1.8.0