From 1c13bd7a2cd2c8ba69a185da69344c8b59f4e561 Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期四, 04 七月 2024 09:29:15 +0800
Subject: [PATCH] 选中求和功能以及还原双击回车才能点击单元格
---
north-glass-erp/northglass-erp/src/views/pp/processCard/PrintProcess.vue | 222 ++++++++++++++++++++++++++++++------------------------
1 files changed, 123 insertions(+), 99 deletions(-)
diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintProcess.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintProcess.vue
index 2fbc3f9..37c7ca6 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintProcess.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintProcess.vue
@@ -8,7 +8,9 @@
import {useI18n} from 'vue-i18n'
import deepClone from "@/utils/deepClone";
import QRCode from "qrcode";
+import companyInfo from "@/stores/sd/companyInfo";
//璇█鑾峰彇
+const company = companyInfo()
const {t} = useI18n()
let router = useRouter()
let produceList = ref([])
@@ -22,6 +24,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,6 +36,46 @@
if (res.code == 200) {
produceList.value = deepClone(res.data.data)
+ if (printMerge !== null && printMerge !== undefined && printMerge !== "") {
+
+ produceList.value.forEach(item => {
+ item.detail[0].technologyNumber = printMerge;
+ });
+ }
+ let technologyNumberMerge = printMerge.split('').join(',');
+ console.log(technologyNumberMerge)
+ produceList.value[0].detail[0].technologyNumberMerge = technologyNumberMerge
+ console.log(produceList.value[0].detail[0])
+ const s01Values = [];
+ // 閬嶅巻 res.data.numberList 鏁扮粍锛岃幏鍙栨瘡涓厓绱犵殑 S01 鍊煎苟瀛樺偍鍒� s01Values 鏁扮粍涓�
+ produceList.value[0].detailList.forEach(element => {
+ try {
+ const otherColumnsObject = JSON.parse(element.other_columns);
+ const s01Value = otherColumnsObject.S01;
+ if (s01Value) {
+ s01Values.push(s01Value);
+ } else {
+ // 濡傛灉 S01 鍊间负绌猴紝鍙互閫夋嫨娣诲姞榛樿鍊兼垨鑰呭拷鐣ヨ繖涓厓绱�
+ s01Values.push(''); // 渚嬪娣诲姞绌哄瓧绗︿覆
+ }
+ } catch (error) {
+ // console.error('Error parsing JSON or accessing S01 value:', error);
+ // 澶勭悊 JSON 瑙f瀽閿欒鎴栧叾浠栧紓甯告儏鍐�
+ }
+ });
+ // 閬嶅巻 res.data.Detail 鏁扮粍锛屽皢 s01Values 涓殑鍊艰祴缁欐瘡涓鍗曡鎯呭璞$殑 s01Value 灞炴��
+ produceList.value[0].detailList.forEach((detail, index) => {
+ if (index < s01Values.length) {
+ detail.s01Value = s01Values[index]; // 娣诲姞涓�涓悕涓� s01Value 鐨勬柊灞炴�э紝瀛樺偍瀵瑰簲鐨� S01 鍊�
+ } else {
+ detail.s01Value = ''; // 濡傛灉 s01Values 涓殑鍊间笉瓒筹紝鍙互娣诲姞榛樿鍊兼垨鑰呬笉杩涜璧嬪�煎鐞�
+ }
+ });
+
+
+
+
+
handleGetQRCode()
} else {
ElMessage.warning(res.msg)
@@ -41,73 +84,83 @@
})
}
-
)
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]
+ });
+
+ }
}
};
-
-
// 鎵撳嵃鏂规硶
- 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>
- <el-button id="printButton" @click="printFlowCard();">鎵撳嵃</el-button>
+ <el-button id="printButton" @click="printFlowCard();">{{ $t('basicData.print') }}</el-button>
<div id="printFlowCard">
<table v-for="(item,id) in produceList" id="contentTable" :key="id">
<thead>
<tr v-for="(itemFlow,index) in item.detail" :key="index">
<td colspan="24">
<div id="bj" style="float: right;font-size: 28px">{{ id + 1 }}</div>
- <div>甯稿窞甯傚悏鍒╃幓鐠冩湁闄愬叕鍙�</div>
+ <div>{{company.companyName}}</div>
<div>鐢熶骇娴佺▼鍗�</div>
- <div style="text-align: right;font-weight: bolder">娴佺▼鍗″彿锛� {{
+ <div v-if="itemFlow.technologyNumberMerge!=''" style="text-align: right;font-weight: bolder">娴佺▼鍗″彿锛� {{
+ itemFlow.process_id
+ }}/{{ itemFlow.technologyNumberMerge }} 鍏� {{ flowCardCount }} 鏋�
+ </div>
+ <div v-else style="text-align: right;font-weight: bolder">娴佺▼鍗″彿锛� {{
itemFlow.process_id
}}/{{ itemFlow.technologyNumber }} 鍏� {{ flowCardCount }} 鏋�
</div>
@@ -119,7 +172,7 @@
<td class="tdNowrap">椤圭洰鍚嶇О锛�</td>
<td colspan="2">{{ items.project }}</td>
<td class="tdNowrap">宸ヨ壓娴佺▼锛�</td>
- <td colspan="16">{{ items.process }}</td>
+ <td colspan="17">{{ items.process }}</td>
</tr>
<tr v-for="(itemTr,index) in item.detail" :key="index">
<td class="tdNowrap">纾ㄨ竟绫诲瀷锛�</td>
@@ -127,10 +180,11 @@
<td class="tdNowrap">鍗曠墖鍚嶇О锛�</td>
<td colspan="2">{{ itemTr.glass_child }}</td>
<td class="tdNowrap">浜у搧鍚嶇О锛�</td>
- <td colspan="16">{{ itemTr.product_name }}</td>
+ <td colspan="17">{{ itemTr.product_name }}</td>
</tr>
<tr>
<td rowspan='2'>搴忓彿</td>
+ <td rowspan='2'>缂栧彿</td>
<td rowspan='2'>瀹�*楂�</td>
<td rowspan='2'>鏁伴噺</td>
<td rowspan='2'>闈㈢Н</td>
@@ -170,12 +224,13 @@
<tr v-for="(itemDatile,index) in item.detailList" :key="index">
<td>{{ itemDatile.order_number }}</td>
+ <td>{{itemDatile.s01Value}}</td>
<td>{{ itemDatile.child_width }}</td>
<td class="item">{{ itemDatile.quantity }}</td>
<td>{{ itemDatile.total_area }}</td>
<td>{{ itemDatile.perimeter }}</td>
<td>{{ itemDatile.bend_radius }}</td>
- <td>{{ itemDatile.order_number }}</td>
+ <td>{{ itemDatile.remarks }}</td>
<td></td>
<td></td>
<td></td>
@@ -200,9 +255,9 @@
鏁伴噺锛�
<label>{{ itemsum.quantity }}</label>
闈㈢Н锛�
- <label>{{ parseFloat(itemsum.gross_area,2) }}</label>
+ <label>{{ parseFloat(itemsum.gross_area.toFixed(2)) }}</label>
閲嶉噺锛�
- <label>{{ itemsum.weight }}</label>
+ <label>{{ parseFloat(itemsum.weight.toFixed(2)) }}</label>
</td>
</tr>
<tr v-for="(itemtextarea,index) in item.detail" :key="index">
@@ -226,28 +281,12 @@
<td></td>
<td></td>
<td></td>
+ <td></td>
+ <td></td>
</tr>
-<!-- <tr>-->
-<!-- <td>鎺ュ彈绛惧悕</td>-->
-<!-- <td></td>-->
-<!-- <td></td>-->
-<!-- <td></td>-->
-<!-- <td></td>-->
-<!-- <td></td>-->
-<!-- <td></td>-->
-<!-- <td></td>-->
-<!-- <td></td>-->
-<!-- <td></td>-->
-<!-- <td></td>-->
-<!-- <td></td>-->
-<!-- <td></td>-->
-<!-- <td></td>-->
-<!-- <td></td>-->
-<!-- <td></td>-->
-<!-- <td></td>-->
-<!-- </tr>-->
<tr>
<td>鐢熶骇鏃ユ湡</td>
+ <td></td>
<td></td>
<td></td>
<td></td>
@@ -283,39 +322,20 @@
<td></td>
<td></td>
<td></td>
+ <td></td>
</tr>
- <!-- <tr>-->
- <!-- <td>鏋跺瓙缂栧彿</td>-->
- <!-- <td></td>-->
- <!-- <td></td>-->
- <!-- <td></td>-->
- <!-- <td></td>-->
- <!-- <td></td>-->
- <!-- <td></td>-->
- <!-- <td></td>-->
- <!-- <td></td>-->
- <!-- <td></td>-->
- <!-- <td></td>-->
- <!-- <td></td>-->
- <!-- <td></td>-->
- <!-- <td></td>-->
- <!-- <td></td>-->
- <!-- <td></td>-->
- <!-- <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>
-<!-- {{-->
-<!-- getUrl(qrCodeItem.process_id)-->
-<!-- }}-->
-
+ <td colspan="19">
+ <span style="display: flex;">
+ <span v-for="(qrCodeItems,index) in qrCodeItem.qrcodeList" :key="index" style="display: flex;width: 35%">
+ <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>
@@ -337,7 +357,6 @@
}
#printFlowCard {
- margin-top: -40px;
text-align: center;
//font-weight: bolder; height: 600px;
}
@@ -380,6 +399,11 @@
font-weight: bolder;
}
+@page {
+ size: auto; /* auto is the initial value */
+ margin: 13mm 6mm 0mm 6mm /* this affects the margin in the printer settings */
+
+}
@media print {
--
Gitblit v1.8.0