From a660db06773007b1be690e0674829c00a57aeb7b Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期三, 24 十二月 2025 16:21:23 +0800
Subject: [PATCH] 订单首页流程卡新增楼层编号显示

---
 north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/ComputeCard.vue |   85 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 85 insertions(+), 0 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/ComputeCard.vue b/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/ComputeCard.vue
index 023b7e7..f2aa11a 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/ComputeCard.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/ComputeCard.vue
@@ -4,6 +4,7 @@
 import {useI18n} from "vue-i18n";
 import {ElMessage} from "element-plus";
 import deepClone from "@/utils/deepClone";
+import {addListener, toolbarButtonClickEvent} from "@/hook/mouseMove";
 const { t } = useI18n()
 
 const xGrid = ref()
@@ -31,6 +32,16 @@
   scrollX:{enabled: true},
   scrollY:{ enabled: true ,gt:0},//寮�鍚櫄鎷熸粴鍔�
   showOverflow:true,
+  menuConfig: {
+    body: {
+      options: [
+        [
+          { code: 'copyChecked', name: t('basicData.selectSame'), prefixIcon: 'vxe-icon-copy', visible: true, disabled: false },
+          { code: 'copyAll', name: t('basicData.sameAfterwards'), prefixIcon: 'vxe-icon-feedback', visible: true, disabled: false },
+        ]
+      ]
+    }
+  },
   columnConfig: {
     resizable: true,
     useKey: true
@@ -89,6 +100,8 @@
   processId: null,
   technologyNumber: null,
   patchState: null,
+  glassThickness: String,  // 娣诲姞鐜荤拑鍘氬害灞炴��
+  glassType: String        // 娣诲姞鐜荤拑绫诲瀷灞炴��
 });
 
 
@@ -96,6 +109,7 @@
 
 watch(() => props.tableData, async (newData) => {
   if (Array.isArray(newData)) {
+    addListener(xGrid.value,gridOptions)
     console.log(newData)
     xGrid.value.loadData(deepClone(newData))
     const data = xGrid.value.getTableData().fullData
@@ -119,6 +133,70 @@
     // Emit 浜嬩欢灏嗘洿鏂板悗鐨勫�间紶閫掔粰鐖剁粍浠�
     emit('upProcessId', rowClickIndex.value.processId,rowClickIndex.value.patch_state,rowClickIndex.value.technologyNumber);
     emit('updateTechnologyNumber', rowClickIndex.value.processId,rowClickIndex.value.patch_state,rowClickIndex.value.technologyNumber);
+  },
+  menuClick ({ menu, row, column }) {
+    const $grid = xGrid.value
+    if ($grid) {
+      switch (menu.code) {
+
+        case 'copyChecked' :{
+          let result = toolbarButtonClickEvent()
+          if(result){
+            const dataList = xGrid.value.getTableData().visibleData
+            let firstVal=null;
+            if(result.cell.indexOf('.')>-1){
+              firstVal = eval("dataList["+result.start +"]."+result.cell)
+            }else {
+              firstVal=dataList[result.start][result.cell];
+            }
+            dataList.forEach((item,index) =>{
+              if(index>=result.start && index<=result.end){
+                //鍙栨秷閫変腑
+                if(parseInt(firstVal)<=0){
+                  xGrid.value.setCheckboxRow(item, false);
+                }
+                if(result.cell.indexOf('.')>-1){
+                  const  columnArr = result.cell.split('.')
+                  item[columnArr[0]][columnArr[1]]  = firstVal
+                }else{
+                  item[result.cell]  = firstVal
+                }
+
+              }
+            })
+          }
+          break
+        }
+        case 'copyAll' :{
+          let result = toolbarButtonClickEvent()
+          if(result){
+            const dataList = xGrid.value.getTableData().visibleData
+            let firstVal=null;
+            if(result.cell.indexOf('.')>-1){
+              firstVal = eval("dataList["+result.start +"]."+result.cell)
+            }else {
+              firstVal=dataList[result.start][result.cell];
+            }
+            dataList.forEach((item,index) =>{
+              if(index>=result.start){
+                //鍙栨秷閫変腑
+                if(parseInt(firstVal)<=0){
+                  xGrid.value.setCheckboxRow(item, false);
+                }
+                if(result.cell.indexOf('.')>-1){
+                  const  columnArr = result.cell.split('.')
+                  item[columnArr[0]][columnArr[1]]  = firstVal
+                }else{
+                  item[result.cell]  = firstVal
+                }
+
+              }
+            })
+          }
+          break
+        }
+      }
+    }
   }
 }
 
@@ -181,5 +259,12 @@
   height: 20px;
   margin-top: -20px;
 }
+.vxe-grid {
+  /* 绂佺敤娴忚鍣ㄩ粯璁ら�変腑 */
+  -webkit-user-select: none;
+  -moz-user-select: none;
+  -ms-user-select: none;
+  user-select: none;
+}
 
 </style>
\ No newline at end of file

--
Gitblit v1.8.0