From 12f2fd73462da331478fabc7eaa79fc35b1a59b3 Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期五, 19 七月 2024 16:41:17 +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 |   92 ++++++++++++++++++++++++++++++++++++---------
 1 files changed, 73 insertions(+), 19 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 34ad8fd..711b7d1 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
@@ -29,6 +29,10 @@
 const printVisible= ref(false)
 let selectRecords = ref(null)
 
+const selectRecordsData = ref({
+  printList: []
+})
+
 const xGrid = ref(null)
 const xGridDetail =ref(null)
 
@@ -41,8 +45,11 @@
 //鎵撳嵃
 let  printRow = ref({
   list:null,
-  printMergeVal:null
+  printMergeVal:null,
+  like:null
 })
+
+
 
 const getTableRow = (row,type) => {
   switch (type) {
@@ -140,26 +147,30 @@
   dataType: [],
 })
 
+const data = ref({
+  printList: []
+})
+
 const {currentRoute} = useRouter()
 const route = currentRoute.value
 
 let orderId = route.query.orderId
+data.value.printList=JSON.parse(route.query.printList)
+
 
 // 绗竴娆″姞杞芥煡璇�
-request.post(`/processCard/selectPrint/${orderId}`, filterData.value).then((res) => {
+request.post(`/processCard/selectPrint`, data.value).then((res) => {
 
   if (res.code == 200) {
-    produceList = produceList.value.concat(deepClone(res.data.data))
+    let newDataCollection = [];
+    for (let i = 0; i <res.data.data.length ; i++) {
+      res.data.data[i].detail.forEach((item) =>{
+        newDataCollection.push(item);
+      })
+    }
+
     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='鏈墦鍗�'
-      }
-    });
-    xGrid.value.reloadData(produceList)
+    xGrid.value.reloadData(newDataCollection)
     gridOptions.loading = false
     hideButton()
   } else {
@@ -271,6 +282,7 @@
       {code: 'customLabel', name: t('processCard.customLabelPrinting'), status: 'primary'},
       {code: 'printLabel', name: t('processCard.labelPrinting'), status: 'primary'},
       {code: 'printLabel2', name: t('processCard.labelPrinting2'), status: 'primary'},
+      {code: 'printLike', name: "鍚岄厤缃墦鍗�", status: 'primary'},
     ],
     // import: false,
     // export: true,
@@ -302,9 +314,9 @@
   toolbarButtonClick ({ code}) {
     const $grid = xGrid.value
     selectRecords = $grid.getCheckboxRecords()
-    selectRecords.forEach(obj => {
-      delete obj.print_status;
-    });
+    // selectRecords.forEach(obj => {
+    //   delete obj.print_status;
+    // });
     let type=printType.value
     let faceOrientation=stateValue.value
     let lableTypes=lableType.value
@@ -327,6 +339,7 @@
           }
           printRow.value.list = JSON.stringify(selectRecords)
           printRow.value.printMergeVal=printMerge.value
+          printRow.value.like=null
         // router.push({path: '/main/processCard/printProcess', query: {printList: JSON.stringify(selectRecords),printMerge:printMergeVal}})
           dialogTableVisible.value=true
           break
@@ -430,6 +443,31 @@
 
           break
         }
+        case 'printLike': {
+          if(selectRecords===null ||selectRecords===''||selectRecords.length===0){
+            ElMessage.warning(t('searchOrder.msgList.checkOrder'))
+            return
+          }
+          if(printMerge.value===null ||printMerge.value===''){
+            ElMessage.warning('璇峰~鍏ラ渶瑕佸悎骞剁殑灞�')
+            return
+          }
+
+          let id = ""
+          for (let i = 0; i < selectRecords.length; i++) {
+            if (i + 1 === selectRecords.length) {
+              id += selectRecords[i].id
+            } else {
+              id += selectRecords[i].id + "|"
+            }
+          }
+          printRow.value.list = JSON.stringify(selectRecords)
+          printRow.value.printMergeVal=printMerge.value
+          printRow.value.like="1"
+          // router.push({path: '/main/processCard/printProcess', query: {printList: JSON.stringify(selectRecords),printMerge:printMergeVal}})
+          dialogTableVisible.value=true
+          break
+        }
       }
     }
   },
@@ -447,9 +485,25 @@
   gridOptions.toolbarConfig.buttons = gridOptions.toolbarConfig.buttons.filter(button => {
     // 杩欓噷鏍规嵁 hidePrintLabels 鐨勫�煎喅瀹氭槸鍚﹂殣钘� printLabel 鍜� printLabel2
     if (hidePrintLabels=='true') {
-      return button.code !== 'printLabel' && button.code !== 'printLabel2';
+      return button.code !== 'printLabel' && button.code !== 'printLabel2' ;
     } else {
-      return true; // 涓嶉殣钘忎换浣曟寜閽�
+      return true && button.code !=='printLike'; // 鏄剧ず璇ユ寜閽�
+    }
+  })
+}
+
+
+// 鐩戝惉鎵撳嵃瀹屾垚浜嬩欢
+const printNumber = () =>{
+
+  selectRecordsData.value.printList=selectRecords
+  let printState=0
+  request.post(`/processCard/updatePrintState/${printState}`, selectRecordsData.value).then((res) => {
+    if (res.code == 200 && res.data === true) {
+    } else {
+
+      ElMessage.warning(t('basicData.msg.saveFail'))
+
     }
   })
 }
@@ -541,9 +595,9 @@
         destroy-on-close
         style="width: 75%;height:75% ">
       <template #header="{ close, titleId, titleClass }">
-        <el-button v-print="printContent"  :icon="Printer" circle />
+        <el-button v-print="printContent" @click="printNumber"  :icon="Printer" circle />
       </template>
-      <print-process id="child" :printList="printRow.list" :printMerge="printRow.printMergeVal"
+      <print-process id="child" :printList="printRow.list" :printMerge="printRow.printMergeVal" :printLike="printRow.like"
                     style="width: 100%;height: 100%" />
     </el-dialog>
 

--
Gitblit v1.8.0