From c46cb6a71c35f38c7f23a2d01ad686f46a3d0e0b Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期三, 26 六月 2024 15:14:44 +0800
Subject: [PATCH] Merge branch 'master' of http://bore.pub:10439/r/ERP_override

---
 north-glass-erp/northglass-erp/src/views/pp/Replenish/PrintRepairProcess.vue |  108 +++++++++++++++++++++++++++++++-----------------------
 1 files changed, 62 insertions(+), 46 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/pp/Replenish/PrintRepairProcess.vue b/north-glass-erp/northglass-erp/src/views/pp/Replenish/PrintRepairProcess.vue
index 78e0d09..4a746e1 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/Replenish/PrintRepairProcess.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/Replenish/PrintRepairProcess.vue
@@ -22,6 +22,7 @@
 
 const {currentRoute} = useRouter()
 const route = currentRoute.value
+const printMerge = route.query.printMerge
 data.value.printList = JSON.parse(route.query.printList)
 let flowCardCount = data.value.printList.length
 onMounted(() => {
@@ -33,7 +34,12 @@
         if (res.code == 200) {
 
           produceList.value = deepClone(res.data.data)
-          console.log(produceList.value)
+          if (printMerge!==null && printMerge!==undefined && printMerge!==""){
+
+            produceList.value.forEach(item => {
+              item.detail[0].technologyNumber = printMerge;
+            });
+          }
           handleGetQRCode()
         } else {
           ElMessage.warning(res.msg)
@@ -48,12 +54,21 @@
 
 const handleGetQRCode = async () => {
   for (let i = 0; i < produceList.value.length; i++) {
-    list= produceList.value[i].detail[0].processIdNumber;
-    const url = `${list}`;
-    // 鐢熸垚 QR Code 骞跺瓨鍌ㄥ埌鍙橀噺涓�
-    const qrcode = ref('');
-    qrcode.value =  await QRCode.toDataURL(url);
-    produceList.value[i].detail[0]["qrcode"]=qrcode.value
+    const technologyNumber = produceList.value[i].detail[0].technologyNumber.toString(); // 杞崲涓哄瓧绗︿覆浠ヤ究澶勭悊姣忎釜瀛楃
+    produceList.value[i].detail[0]["qrcodeList"] = []; // 鍒濆鍖栦竴涓┖鏁扮粍鐢ㄦ潵瀛樺偍 QR Code
+
+    for (let j = 0; j < technologyNumber.length; j++) {
+      const processId = produceList.value[i].detail[0].process_id;
+      const url = `${processId}/${technologyNumber[j]}`;
+
+      // 鐢熸垚 QR Code 骞跺瓨鍌ㄥ埌鏁扮粍涓�
+      const qrcodeData = await QRCode.toDataURL(url);
+      produceList.value[i].detail[0]["qrcodeList"].push({
+        qrcode: qrcodeData,
+        technologyNumber: technologyNumber[j]
+      });
+
+    }
   }
 };
 
@@ -61,41 +76,41 @@
 
 
 // 鎵撳嵃鏂规硶
-  const printFlowCard = () => {
-    // 闇�瑕佹墦鍗扮殑灞�閮ㄥ尯鍩熻祴浜�"print-wrap"鐨刬d
-    let el = document.getElementById("printFlowCard");
-    let doc = document;
-    let body = doc.body || doc.getElementsByTagName("body")[0];
-    let printId = "print-" + Date.now();
+const printFlowCard = () => {
+  // 闇�瑕佹墦鍗扮殑灞�閮ㄥ尯鍩熻祴浜�"print-wrap"鐨刬d
+  let el = document.getElementById("printFlowCard");
+  let doc = document;
+  let body = doc.body || doc.getElementsByTagName("body")[0];
+  let printId = "print-" + Date.now();
 
-    // 鍒涘缓鏃犲壇浣滅敤鐨勬墦鍗板鍣�(鍥犱笉纭畾椤甸潰鐨勬墦鍗板厓绱犳湁鏃犲叾瀹冩牱寮�)
-    let content = doc.createElement("div");
-    content.id = printId;
+  // 鍒涘缓鏃犲壇浣滅敤鐨勬墦鍗板鍣�(鍥犱笉纭畾椤甸潰鐨勬墦鍗板厓绱犳湁鏃犲叾瀹冩牱寮�)
+  let content = doc.createElement("div");
+  content.id = printId;
 
-    // 鏍峰紡鎺у埗涓庢墦鍗版棤鍏崇殑鍏冪礌闅愯棌
-    let style = doc.createElement("style");
-    style.innerHTML =
-        "body>#" +
-        printId +
-        "{display:none}@media print{body>:not(#" +
-        printId +
-        "){display:none !important}body>#" +
-        printId +
-        "{display:block;padding-top:1px}}";
-    //
-    content.innerHTML = el.outerHTML;
-    // // console.log("el.outerHTML", el.outerHTML);
-    body.appendChild(style);
+  // 鏍峰紡鎺у埗涓庢墦鍗版棤鍏崇殑鍏冪礌闅愯棌
+  let style = doc.createElement("style");
+  style.innerHTML =
+      "body>#" +
+      printId +
+      "{display:none}@media print{body>:not(#" +
+      printId +
+      "){display:none !important}body>#" +
+      printId +
+      "{display:block;padding-top:1px}}";
+  //
+  content.innerHTML = el.outerHTML;
+  // // console.log("el.outerHTML", el.outerHTML);
+  body.appendChild(style);
 
-    // 涓巗tyle鍏冪礌璁剧疆鐨勬牱寮忕浉閰嶅悎
-    // 鎶婃墦鍗板唴瀹圭殑鍏冪礌娣诲姞鍒癰ody(浣滀负body鐨勫瓙鍏冪礌锛屽彲鐢╞ody鐨勫瓙閫夋嫨鍣� '>' 鎺у埗鎵撳嵃鏍峰紡)
-    body.appendChild(content);
-    setTimeout(() => {
-      window.print();
-      body.removeChild(content);
-      body.removeChild(style);
-    }, 20);
-  }
+  // 涓巗tyle鍏冪礌璁剧疆鐨勬牱寮忕浉閰嶅悎
+  // 鎶婃墦鍗板唴瀹圭殑鍏冪礌娣诲姞鍒癰ody(浣滀负body鐨勫瓙鍏冪礌锛屽彲鐢╞ody鐨勫瓙閫夋嫨鍣� '>' 鎺у埗鎵撳嵃鏍峰紡)
+  body.appendChild(content);
+  setTimeout(() => {
+    window.print();
+    body.removeChild(content);
+    body.removeChild(style);
+  }, 20);
+}
 </script>
 
 <template>
@@ -267,14 +282,15 @@
         <td></td>
       </tr>
       <tr v-for="(qrCodeItem,index) in item.detail" :key="index">
-        <td rowspan="2">
-          <div class='qrCode' style="width: 80px;height: 80px;">
-            <img :src= qrCodeItem.qrcode>
+        <td colspan="19" >
+          <span style="display: flex;">
+            <span style="display: flex;width: 25%" v-for="(qrCodeItems,index) in qrCodeItem.qrcodeList" :key="index">
+            <div class='qrCode' style="width: 80px;height: 80px;">
+            <img :src= qrCodeItems.qrcode>
           </div>
-
-        </td>
-        <td colspan="16">
-          <span style="float: left;font-weight: bolder">{{ qrCodeItem.processIdNumber }}</span>
+          <span style="float: left;font-weight: bolder">{{ qrCodeItem.process_id+"/"+qrCodeItems.technologyNumber }}</span>
+          </span>
+          </span>
         </td>
 
       </tr>

--
Gitblit v1.8.0