From 615d0a9e2011510b589ccc3b4bc58894a39e8295 Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期五, 05 七月 2024 10:17:03 +0800
Subject: [PATCH] Merge branch 'master' of http://bore.pub:10439/r/ERP_override

---
 north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCard.vue |   51 +++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 39 insertions(+), 12 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCard.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCard.vue
index 06c0cf3..c767311 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCard.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCard.vue
@@ -91,6 +91,7 @@
 ]
 
 //鏍囩绫诲瀷
+let  filteredOptions=[]
 const lableType = ref('1')
 const lableTypeOptions = [
   {
@@ -110,6 +111,13 @@
     label: `${company.printLabel.labelType3}`,
   },
 ]
+let hidePrintLabels = company.printLabel.hideButton;
+
+if (hidePrintLabels=='true'){
+  filteredOptions = lableTypeOptions.filter((option, index) => index !== 2);
+}else {
+  filteredOptions = lableTypeOptions;
+}
 
 //鍚堢墖娴佺▼鍗℃墦鍗颁笅鎷夐�夐」
 const printMerge = ref('')
@@ -135,16 +143,17 @@
   if (res.code == 200) {
     produceList = produceList.value.concat(deepClone(res.data.data))
     titleSelectJson.value.dataType = res.data.type
-    // produceList.forEach(item => {
-    //   if(item.print_status == 1){
-    //     item.print_status='宸叉墦鍗�'
-    //   }
-    //   else if (item.print_status == 0){
-    //     item.print_status='鏈墦鍗�'
-    //   }
-    // });
+    produceList.forEach(item => {
+      if(item.print_status == 1){
+        item.print_status='宸叉墦鍗�'
+      }
+      else if (item.print_status == 0){
+        item.print_status='鏈墦鍗�'
+      }
+    });
     xGrid.value.reloadData(produceList)
     gridOptions.loading = false
+    hideButton()
   } else {
     ElMessage.warning(res.msg)
   }
@@ -276,13 +285,18 @@
         return ''
       })
     ]
-  }
+  },
+
+
 })
 
 const gridEvents = {
   toolbarButtonClick ({ code}) {
     const $grid = xGrid.value
     selectRecords = $grid.getCheckboxRecords()
+    selectRecords.forEach(obj => {
+      delete obj.print_status;
+    });
     let type=printType.value
     let faceOrientation=stateValue.value
     let lableTypes=lableType.value
@@ -290,6 +304,7 @@
     if ($grid) {
       switch (code) {
         case 'print': {
+          console.log(selectRecords)
           if(selectRecords===null ||selectRecords===''||selectRecords.length===0){
             ElMessage.warning(t('searchOrder.msgList.checkOrder'))
             return
@@ -564,14 +579,14 @@
           },
           {
             code: 'addAutomatically',
-            name: "鑷姩濉厖",
+            name: t('processCard.addAutomatically'),
             prefixIcon: 'vxe-icon-indicator',
             visible: true,
             disabled: false
           },
           {
             code: 'selectFill',
-            name: "閫変腑濉厖",
+            name: t('processCard.selectFill'),
             prefixIcon: 'vxe-icon-indicator',
             visible: true,
             disabled: false
@@ -704,6 +719,18 @@
   addListener(xGridDetail.value, detailGridOptions)
 }
 
+const hideButton = () =>{
+  // 鏍规嵁鏉′欢鍊� hidePrintLabels 杩囨护鎸夐挳鏁扮粍
+  gridOptions.toolbarConfig.buttons = gridOptions.toolbarConfig.buttons.filter(button => {
+    // 杩欓噷鏍规嵁 hidePrintLabels 鐨勫�煎喅瀹氭槸鍚﹂殣钘� printLabel 鍜� printLabel2
+    if (hidePrintLabels=='true') {
+      return button.code !== 'printLabel' && button.code !== 'printLabel2';
+    } else {
+      return true; // 涓嶉殣钘忎换浣曟寜閽�
+    }
+  })
+}
+
 </script>
 
 <template>
@@ -722,7 +749,7 @@
     &nbsp;
     <el-select v-model="lableType" class="m-2" :placeholder="lableTypeOptions[0].label" style="width: 140px">
       <el-option
-          v-for="item in lableTypeOptions"
+          v-for="item in filteredOptions"
           :key="item.value"
           :label="item.label"
           :value="item.value"

--
Gitblit v1.8.0