From 103b03d9b18cc713550ddfa3f5772123568dc6c3 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期一, 29 十二月 2025 16:40:01 +0800
Subject: [PATCH] 标签打印预览界面中修改可同步变更的字段光标自动前移问题,流程卡进度打印界面增加列

---
 north-glass-erp/northglass-erp/src/views/pp/processCard/PrintProgressProcessCard.vue |  198 +++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 166 insertions(+), 32 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintProgressProcessCard.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintProgressProcessCard.vue
index af2a3bc..36c76a3 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintProgressProcessCard.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintProgressProcessCard.vue
@@ -15,6 +15,8 @@
 import PrintProcess from "@/components/pp/PrintProcess.vue";
 import PrintCustomLabelXJ from "@/components/pp/PrintCustomLabelTwo.vue";
 import companyInfo from "@/stores/sd/companyInfo";
+import {createTemplate} from "@/hook/createTemplateTag";
+import {hiprint} from "vue-plugin-hiprint";
 //璇█鑾峰彇
 const { t } = useI18n()
 let router=useRouter()
@@ -25,15 +27,14 @@
 const dialogTableVisible = ref(false)
 const dialogTableVisibleLabel = ref(false)
 
+let lastList = ref([])
+
 let props = defineProps({
   orderId:null
 })
 onMounted(()=>{
   getTags()
-  filterData.value = orderInfo.selectProcessCardFilter.data
-  orderInfo.selectProcessCardFilter.list.forEach(item =>{
-    xGrid.value.getColumnByField(item.field).filters = item.column.filters
-  })
+
   //鍚敤琛ㄦ牸鎷栧姩閫変腑
   addListener(xGrid.value, gridOptions)
   if(props.orderId===null  || props.orderId===undefined || props.orderId===''){
@@ -86,6 +87,84 @@
   }
 })
 
+//鏍囩
+let labelRow = ref({
+  list: null,//鍕鹃�夌殑鏁版嵁
+  faceOrientation: null,//鍐呭闈�
+  type: null,//鏍囩妯℃澘
+  lableType: null//鏍囩绫诲瀷
+})
+//閫変腑鍐呭
+let selectRecords = ref(null)
+
+//鍚堢墖娴佺▼鍗℃墦鍗颁笅鎷夐�夐」
+const printMerge = ref('')
+const printMergeOptions = [{}]
+
+//鍊掑彊
+let  flashback = ref(1)
+//钀芥灦椤哄簭
+let landingSequence= ref(1)
+//鍚堟灦鎵撳嵃
+let compound = ref(null)
+
+const printContent = ref({
+  id: 'child',
+
+})
+
+let hiprintTemplate = ref(null)
+
+const printContentLabel = ref({
+  id: 'childLabel',
+})
+
+const printContentLabelSemi = ref({
+  id: 'childLabelSemi',
+})
+
+const changeTag = () => {
+  hiprintTemplate.value = new hiprint.PrintTemplate({});
+  hiprintTemplate.value.design("#hiprint-printTemplate1",{grid:true});
+  const json = tag.value.value
+  hiprintTemplate.value.update(json)
+}
+
+const printOrder = (type) => {
+  printNumberLabel()
+  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
+      }
+    }
+  })
+
+  //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)
+
+}
 
 //闇�瑕佸悎骞剁殑鍒�
 let column = [1,3,8]
@@ -243,18 +322,20 @@
     {field: 'process_id',width: 150, title: t('processCard.processId'),filters: [{data: ''}],
       slots: {filter: 'num1_filter'},
       filterMethod: filterChanged},
+    {field: 'technology_number', width: 110,title: t('processCard.technologyNumber'),showOverflow:"ellipsis",filters: [{data: ''}],
+      slots: {filter: 'num1_filter'},
+      filterMethod: filterChanged},
     {field: 'print_status', width: 120,title: t('processCard.numberTimesProcessCardPrinted')},
     {field: 'print_number', width: 110,title: t('processCard.numberLabelPrintingOperations')},
     {field: 'order_number', width: 100,title: t('order.OrderNum'),showOverflow:"ellipsis",filters: [{data: ''}],
       slots: {filter: 'num1_filter'},
       filterMethod: filterChanged},
-    // {field: 'glassNumber', width: 110,title: t('reportingWorks.glassNumber'),showOverflow:"ellipsis",filters: [{data: ''}],
-    //   slots: {filter: 'num1_filter'},
-    //   filterMethod: filterChanged},
-    {field: 'technology_number', width: 110,title: t('processCard.technologyNumber'),showOverflow:"ellipsis",filters: [{data: ''}],
+    {field: 'child_width', title: t('order.width'),width: 80,filters: [{data: ''}],
+      slots: {filter: 'num1_filter'},
+      filterMethod: filterChanged },
+    {field: 'child_height', title: t('order.height'),width: 80 ,filters: [{data: ''}],
       slots: {filter: 'num1_filter'},
       filterMethod: filterChanged},
-
     {field: 'quantity', width: 90,title: t('order.quantity')},
     {field: 'grossArea', width: 90,title: t('order.area')},
     {field: 'broken_num',width: 90, title: t('reportingWorks.quantityBroken')},
@@ -305,9 +386,9 @@
     //   delete obj.print_status;
     // });
     let type = tag.value.name
-    let faceOrientation = stateValue.value
-    let lableTypes = lableType.value
-    let lableTitle = lableType.text
+    let faceOrientation = ''
+    let lableTypes = 1
+    let lableTitle = ''
     if ($grid) {
       switch (code) {
           //鎵撳嵃娴佺▼鍗�
@@ -316,20 +397,20 @@
             ElMessage.warning(t('searchOrder.msgList.checkOrder'))
             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)
+          //鍘婚櫎閲嶅鐨勫嬀閫夊唴瀹�
+          const uniqueRecords = Array.from(
+              new Map(
+                  selectRecords.map(item => [
+                    `${item.process_id}_${item.technology_number}`,
+                    item
+                  ])
+              ).values()
+          )
+          printRow.value.list = JSON.stringify(uniqueRecords)
           printRow.value.printMergeVal = printMerge.value
           printRow.value.like = null
           printRow.value.merge = company.flowCardMerge
-          printRow.value.printFc= printFc
+          printRow.value.printFc= true
           printRow.value.flashback = flashback.value
           printRow.value.landingSequence=landingSequence.value
           printRow.value.compound = compound.value
@@ -348,15 +429,7 @@
             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 + "|"
-            }
-          }
-
+          lastList.value = []
           labelRow.value.list = JSON.stringify(selectRecords)
           labelRow.value.faceOrientation = faceOrientation
           labelRow.value.type = tag.value.name
@@ -385,6 +458,38 @@
 
 const handleCellDblClick = ({ row, column, cell, $event }) => {
   VxeUI.clipboard.copy(row[column.property])
+}
+
+const selectRecordsData = ref({
+  printList: []
+})
+// 鐩戝惉娴佺▼鍗℃墦鍗板畬鎴愪簨浠�
+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'))
+
+    }
+  })
+}
+
+// 鐩戝惉鏍囩鎵撳嵃瀹屾垚浜嬩欢
+const printNumberLabel = () => {
+
+  selectRecordsData.value.printList = selectRecords
+  request.post(`/tagStyle/updatePrintNumber`, selectRecordsData.value).then((res) => {
+    if (res.code == 200 && res.data === true) {
+    } else {
+
+      ElMessage.warning(t('basicData.msg.saveFail'))
+
+    }
+  })
 }
 </script>
 
@@ -429,6 +534,8 @@
           v-bind="gridOptions"
           :merge-cells="mergeCells"
           @cell-dblclick="handleCellDblClick"
+          v-on="gridEvents"
+          :checkbox-config="{labelField: 'name', highlight: true, range: true}"
 
       >
         <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
@@ -534,6 +641,33 @@
   height: calc(100% - 35px);
 }
 
+:deep(#sizeCheck .el-dialog__body) {
+  height: 90%;
+  width: 100%;
+}
+
+:deep(#sizePrintCalrd .el-dialog__body) {
+  height: 85%;
+  width: 100%;
+  overflow-y: auto;
+}
+
+:deep(#sizeCustom .el-dialog__body) {
+  height: 85%;
+  width: 100%;
+  overflow-y: auto;
+}
+
+:deep(#sizeCustomSemi .el-dialog__body) {
+  height: 85%;
+  width: 100%;
+  overflow-y: auto;
+}
+
+:deep(#titleStyle .el-dialog__body){
+  height: 93%;
+  width: 100%;
+}
 .vxe-grid {
   /* 绂佺敤娴忚鍣ㄩ粯璁ら�変腑 */
   -webkit-user-select: none;

--
Gitblit v1.8.0