From 82a5de6d2ec80b45660149c84be28734032562f6 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期五, 11 十月 2024 15:21:53 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override

---
 north-glass-erp/northglass-erp/src/views/pp/processCard/PrintCustomLabelSemi1.vue |  119 ++++++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 80 insertions(+), 39 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintCustomLabelSemi1.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintCustomLabelSemi1.vue
index 5e6d4a8..0315791 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintCustomLabelSemi1.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintCustomLabelSemi1.vue
@@ -33,34 +33,56 @@
 const type = route.query.type
 const faceOrientation = route.query.faceOrientation
 const lableType = route.query.lableType
+const printType=route.query.printType
 
 onMounted(() => {
-  console.log(lableType)
-      request.post(`/processCard/getSelectPrintCustomLabel/${type}/1`, data.value).then((res) => {
-        if (res.code == 200) {
-          produceList.value = deepClone(res.data.title)
-          list.value = deepClone(res.data.data)
-          const data = produceList.value[0].value
-          dataList = JSON.parse(`[${data}]`);
-          labelList = dataList[0]
-          for (let i = 0; i < list.value.length; i++) {
-            let count= list.value[i].data.length
-            for (let j = 0; j < count; j++) {
-              for (let k = 0; k < list.value[i].data[j].quantity; k++){
-                lastList.value.push(list.value[i].data[j])
-              }
+  if (printType == 1) {
+    request.post(`/processCard/getSelectPrintCustomLabel/${type}/1`, data.value).then((res) => {
+      if (res.code == 200) {
+        produceList.value = deepClone(res.data.title)
+        list.value = deepClone(res.data.data)
+        const data = produceList.value[0].value
+        dataList = JSON.parse(`[${data}]`);
+        labelList = dataList[0]
+        for (let i = 0; i < list.value.length; i++) {
+          let count = list.value[i].data.length
+          for (let j = 0; j < count; j++) {
+            for (let k = 0; k < list.value[i].data[j].quantity; k++) {
+              lastList.value.push(list.value[i].data[j])
             }
           }
-          console.log(lastList.value)
-        } else {
-          ElMessage.warning(res.msg)
-          router.push("/login")
         }
-      })
+      } else {
+        ElMessage.warning(res.msg)
+        router.push("/login")
+      }
+    })
 
-    }
+  }else if(printType==2){
+    request.post(`/processCard/getSelectPrintCustomLabelDetails/${type}/1`, data.value).then((res) => {
+      if (res.code == 200) {
+        produceList.value = deepClone(res.data.title)
+        list.value = deepClone(res.data.data)
+        const data = produceList.value[0].value
+        dataList = JSON.parse(`[${data}]`);
 
-)
+        labelList = dataList[0]
+
+        for (let i = 0; i < list.value.length; i++) {
+          let count = list.value[i].data.length
+          for (let j = 0; j < count; j++) {
+            for (let k = 0; k < list.value[i].data[j].quantity; k++) {
+              lastList.value.push(list.value[i].data[j])
+            }
+          }
+        }
+      } else {
+        ElMessage.warning(res.msg)
+      }
+    })
+  }
+
+})
 
 
 // 鎵撳嵃鏂规硶
@@ -80,7 +102,11 @@
   style.innerHTML =
       "body>#" +
       printId +
-      "{display:none}@media print{body>:not(#" +
+      "{display:none}@media print{" +
+      "@page {" +
+      "    size: auto; " +
+      "    margin: 2mm 2mm 2mm 2mm;  " +
+      "  }body>:not(#" +
       printId +
       "){display:none !important}body>#" +
       printId +
@@ -104,7 +130,8 @@
 <template>
   <el-button id="printButton" @click="printFlowCard();">{{ $t('basicData.print') }}</el-button>
   <div id="printFlowCard" >
-    <div id="entirety" v-for="(item,id) in lastList" >
+    <template v-for="(item,id) in lastList">
+    <div id="entirety" >
       <div class="row1">
         <span>{{ item.customerAbbreviation }}</span>&nbsp;
         <span>{{ item.orderId }}</span>
@@ -113,12 +140,15 @@
         <span>{{ item.project }}</span>&nbsp;
         <span>{{ item.buildingNumber }}</span>
       </div>
-      <div class="row3">{{item.width}}*{{item.height}}={{item.quantity}}</div>
+      <div class="row3" v-if="item.other_columns!=null&&(JSON.parse(item.other_columns).S02!=null)">{{JSON.parse(item.other_columns).S02}}={{item.quantity}}</div>
+      <div class="row3" v-else>{{Math.round(item.width)}}x{{Math.round(item.height)}}={{item.quantity}}</div>
       <div class="row5">
-        <span>{{item.remarks}}</span>&nbsp;
+        <span>{{item.filmNumber}}</span>&nbsp;
         <span>{{ item.processingNote }}</span>
       </div>
     </div>
+    <div style="width: 20px" v-if="id%2===0"></div>
+    </template>
   </div>
 
 </template>
@@ -138,25 +168,33 @@
   display: flex;
   justify-content: left;
   flex-wrap: wrap;
-  margin-left: 5px;
+  width: 500px;
 }
 
 #entirety{
   text-align: center;
-  width: 50%;
-  height: 105px;
+  width: 48%;
+  height: 160px;
+  border: black 1px;
+  word-wrap: break-word;
 }
 
 .row1 {
   font-size: 12pt;
   font-weight: bold;
-  height: 25px;
+  height: 35px;
+}
+.row1 span {
+  font-size: 17pt;
 }
 
 .row2 {
-  font-size: 12pt;
+  font-size: 14pt;
   font-weight: bold;
-  height: 25px;
+  height: 35px;
+}
+.row2 span {
+  font-size: 16pt;
 }
 span {
   font-size: 12pt;
@@ -165,18 +203,20 @@
 
 .row3 {
   margin-top: -5px;
-  height: 30px;
-  font-size: 20pt;
+  height: 35px;
+  font-size: 24pt;
   font-weight: bolder;
+  line-height: 35px;
 }
 
 .row5 {
-  height: 25px;
+  height: 50px;
   font-weight: bold;
   font-size: 12pt;
+  margin-left: 20px;
 }
 .row5 span {
-  font-size: 10pt;
+  font-size: 16pt;
 }
 
 .row6 {
@@ -187,16 +227,17 @@
 
 
 
-@page {
-  size: auto;  /* auto is the initial value */
-  margin: 2mm 2mm 2mm 2mm  /* this affects the margin in the printer settings */
 
-}
 
 @media print {
   div {
     page-break-inside: avoid;
   }
+  @page {
+    size: auto;  /* auto is the initial value */
+    margin: 2mm 2mm 2mm 2mm;  /* this affects the margin in the printer settings */
+
+  }
 }
 
 </style>
\ No newline at end of file

--
Gitblit v1.8.0