From 4955996ab044bc275ac78da3543b9d9f5ad7f8d9 Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期五, 12 十二月 2025 16:21:26 +0800
Subject: [PATCH] 提交浏览发货信息

---
 north-glass-erp/northglass-erp/src/views/pp/replenish/PrintReplenishFlowCard.vue |  125 ++++++++++++++++++++++++++++++++++++-----
 1 files changed, 108 insertions(+), 17 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/pp/replenish/PrintReplenishFlowCard.vue b/north-glass-erp/northglass-erp/src/views/pp/replenish/PrintReplenishFlowCard.vue
index a203bfe..f324be1 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/replenish/PrintReplenishFlowCard.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/replenish/PrintReplenishFlowCard.vue
@@ -22,11 +22,14 @@
 //import PrintCustomLabel from '@/components/pp/PrintCustomLabelDetails.vue'
 import QueuePrinter from "@/hook/queue";
 import PrintCustomLabelProject from "@/components/pp/PrintCustomLabelProject.vue";
+import PrintProcessConsolidated from '@/components/pp/PrintConsolidatedReplenish.vue'
+import {createTemplate} from "@/hook/createTemplateTag";
 const company = companyInfo()
 //璇█鑾峰彇
 const {t} = useI18n()
 let router = useRouter()
 const dialogTableVisible = ref(false)
+const dialogTableConsolidated = ref(false)
 const dialogTableVisibleLabel = ref(false)
 const dialogTableVisibleCustomLabel = ref(false)
 const printVisible= ref(false)
@@ -46,6 +49,7 @@
   value: null,
   size: null
 })
+let hiprintTemplate = ref(null)
 let lastList = ref([])
 const getTableRow = (row,type) =>{
   switch (type) {
@@ -174,10 +178,11 @@
 
 onMounted(async () => {
   await getTags();
+  await hiprint.init();
 })
 
 //鎵撳嵃绫诲瀷
-const printType = ref('灏忕墖鏍囩')
+const printType = ref(t('replenish.label'))
 
 //瀹氫箟鎺ユ敹鍔犺浇琛ㄥご涓嬫媺鏁版嵁
 const titleSelectJson = ref({
@@ -223,6 +228,7 @@
 const getWorkOrder = () => {
   let startTime = form.date1[0]
   let endTime = form.date1[1]
+  gridOptions.loading=true
 // 绗竴娆″姞杞芥煡璇�
   request.post(`/Replenish/selectPrint/${startTime}/${endTime}`, filterData.value).then((res) => {
 
@@ -353,7 +359,7 @@
     {field: 'patch_area', title:  t('order.area'),width:80,filters: [{data: ''}],slots: {filter: 'num1_filter'}, filterMethod: filterChanged},
     {field: 'responsible_team', title:  t('reportingWorks.responsibleTeam'),width:110,filters: [{data: ''}],slots: {filter: 'num1_filter'}, filterMethod: filterChanged},
     {field: 'responsible_equipment', title:  t('reportingWorks.responsibleEquipment'),width:110,filters: [{data: ''}],slots: {filter: 'num1_filter'}, filterMethod: filterChanged},
-    {field: 'responsible_personnel', title:  '璐d换淇℃伅',width:110,filters: [{data: ''}],slots: {filter: 'num1_filter'}, filterMethod: filterChanged},
+    {field: 'responsible_personnel', title:  t('rework.responsibilityInformation'),width:110,filters: [{data: ''}],slots: {filter: 'num1_filter'}, filterMethod: filterChanged},
     {field: 'patch_type', title:  t('reportingWorks.breakageType'),width:110,filters: [{data: ''}],slots: {filter: 'num1_filter'}, filterMethod: filterChanged},
     {field: 'patch_reason', title:  t('reportingWorks.breakageReason'),width:110,filters: [{data: ''}],slots: {filter: 'num1_filter'}, filterMethod: filterChanged},
     {field: 'patch_processes', title:  t('reportingWorks.responsibleProcess'),width:110,filters: [{data: ''}],slots: {filter: 'num1_filter'}, filterMethod: filterChanged},
@@ -361,11 +367,17 @@
     {field: 'glass_child', title: t('reportingWorks.glassChild'),width:110,filters: [{data: ''}],slots: {filter: 'num1_filter'}, filterMethod: filterChanged},
     {field: 'reporting_work_id', title: t('reportingWorks.reportingWorkId'),width:120,filters: [{data: ''}],slots: {filter: 'num1_filter'}, filterMethod: filterChanged},
     {field: 'create_time', title: t('basicData.reportData'),width:120},
+    {
+      field: 'print_num',
+      title: t('processCard.printStatus'),
+       width: 120
+    },
   ],//琛ㄥご鎸夐挳
 
   toolbarConfig: {
     buttons: [
       {code: 'print', name: t('processCard.print'), status: 'primary'},
+      {code: 'printConsolidated', name: t('processCard.mergePrinting'), status: 'primary'},
       {code: 'customLabel', name: t('processCard.customLabelPrinting'), status: 'primary'},
       {code: 'printLabel', name: t('processCard.labelPrinting'), status: 'primary'},
       {code: 'printLabel2', name: t('processCard.labelPrinting2'), status: 'primary'},
@@ -420,11 +432,37 @@
               technologyNumber+=selectRecords[i].technology_number
             }
           }
+
           printRow.value.list = JSON.stringify(selectRecords)
           printRow.value.printMergeVal=printMerge.value
           printRow.value.mergeTechnologyNumber=technologyNumber
           // router.push({path: '/main/processCard/printProcess', query: {printList: JSON.stringify(selectRecords),printMerge:printMergeVal}})
           dialogTableVisible.value=true
+          break
+        }
+        case 'printConsolidated': {
+          if(selectRecords===null ||selectRecords===''||selectRecords.length===0){
+            ElMessage.warning(t('searchOrder.msgList.checkOrder'))
+            return
+          }
+
+          let id = ""
+          let technologyNumber = ""
+          for (let i = 0; i < selectRecords.length; i++) {
+            if (i + 1 === selectRecords.length) {
+              id += selectRecords[i].id
+              technologyNumber+=selectRecords[i].technology_number
+            } else {
+              id += selectRecords[i].id + "|"
+              technologyNumber+=selectRecords[i].technology_number
+            }
+          }
+
+          printRow.value.list = JSON.stringify(selectRecords)
+          printRow.value.printMergeVal=printMerge.value
+          printRow.value.mergeTechnologyNumber=technologyNumber
+          // router.push({path: '/main/processCard/printProcess', query: {printList: JSON.stringify(selectRecords),printMerge:printMergeVal}})
+          dialogTableConsolidated.value=true
           break
         }
 
@@ -494,7 +532,7 @@
             return
           }
           if(printMerge.value===null ||printMerge.value===''){
-            ElMessage.warning('璇峰~鍏ラ渶瑕佸悎骞剁殑灞�')
+            ElMessage.warning(t('rework.msg1'))
             return
           }
 
@@ -661,24 +699,27 @@
   })
 }
 
-const getTags = () => {
-  request.get('tagStyle/getTagList').then(res => {
-    tags.value = res.data
-  })
-}
-let hiprintTemplate = ref()
 const changeTag = () => {
   hiprintTemplate.value = new hiprint.PrintTemplate({});
-  const json = JSON.parse(tag.value.value)
+  hiprintTemplate.value.design("#hiprint-printTemplate1",{grid:true});
+  const json = tag.value.value
   hiprintTemplate.value.update(json)
+}
+
+const getTags = () => {
+  request.get('tagStyle/getTagList').then(res => {
+    res.data.forEach(item => {
+      item.value = JSON.parse(item.value)
+    })
+    tags.value = res.data
+  })
 }
 
 // 鐩戝惉鎵撳嵃瀹屾垚浜嬩欢
 const printNumber = () =>{
-
-  selectRecordsData.value.printList=selectRecords
-  let printState=0
-  request.post(`/processCard/updatePrintState/${printState}`, selectRecordsData.value).then((res) => {
+  const $grid = xGrid.value
+  selectRecords = $grid.getCheckboxRecords()
+  request.post(`/Replenish/updatePrintNum`, selectRecords).then((res) => {
     if (res.code == 200 && res.data === true) {
     } else {
 
@@ -689,16 +730,35 @@
 }
 
 const printOrder = (type) => {
-  const list = hiprintTemplate.value.getJson()
+  const list = tag.value.value
   list.panels[0].printElements.forEach(element => {
     element.options.fontFamily = 'Arial'
+    if( element.options.field !== undefined){
+      if(type===3 ){
+        element.options.hideTitle = true
+      }
+    }
+    if(type!==3){
+      element.options.hideTitle = false
+      if( element.options.field === undefined){
+        element.options.hideTitle = true
+      }
+    }
   })
-  let object =  lastList.value
+
+  //hiprintTemplate.value.update(list)
+  let object =  JSON.parse(JSON.stringify(lastList.value))
   //鍒ゆ柇鏄惁涓鸿〃鏍�
   let columnsNum = null
   if(list.panels[0].printElements[0].options.field==='table'){
     object = {table:lastList.value}
     columnsNum = (list.panels[0].printElements[0].options.gridColumns || 1)
+  }
+  //鍒ゆ柇鏄惁鏈� 宓屽鑷畾涔夌焊寮�
+  if(tag.value.tagHeight && tag.value.tagWidth){
+    const print =createTemplate(list,object,tag.value.tagWidth,tag.value.tagHeight)
+    hiprintTemplate.value.update(print.template)
+    object = print.printData
   }
   hiprintTemplate.value.print(object)
 
@@ -792,9 +852,23 @@
         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"   :icon="Printer" circle @click="printNumber"/>
       </template>
       <print-process id="child" :printList="printRow.list" :printMerge="printRow.printMergeVal" :printLike="printRow.like"
+                     :mergeTechnologyNumber="printRow.mergeTechnologyNumber"
+                     style="width: 100%;height: 100%" />
+    </el-dialog>
+
+    <el-dialog
+        id="sizePrintCalrd"
+        v-model="dialogTableConsolidated"
+        :title="$t('processCard.print')"
+        destroy-on-close
+        style="width: 75%;height:75% ">
+      <template #header="{ close, titleId, titleClass }">
+        <el-button v-print="printContent"   :icon="Printer" circle />
+      </template>
+      <print-process-consolidated id="child" :printList="printRow.list" :printMerge="printRow.printMergeVal" :printLike="printRow.like"
                      :mergeTechnologyNumber="printRow.mergeTechnologyNumber"
                      style="width: 100%;height: 100%" />
     </el-dialog>
@@ -834,7 +908,24 @@
         destroy-on-close
         style="width: 80%;height:75% ">
       <template #header="{ close, titleId, titleClass }">
+        <el-tooltip
+            class="box-item"
+            effect="dark"
+            :content="$t('processCard.yesTitle')"
+            placement="top"
+        >
         <el-button :icon="Printer" circle @click="printOrder(1)"/>
+        </el-tooltip>
+        <el-tooltip
+            class="box-item"
+            effect="dark"
+            :content="$t('processCard.noTitle')"
+            placement="top"
+        >
+          <el-button @click="printOrder(3)">
+            <i class="vxe-icon-print"></i>
+          </el-button>
+        </el-tooltip>
       </template>
       <print-custom-label id="childLabel"
                                   :detailType="labelRow.detailType"

--
Gitblit v1.8.0