| | |
| | | |
| | | 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(() => { |
| | |
| | | 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) |
| | |
| | | |
| | | 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] |
| | | }); |
| | | |
| | | } |
| | | } |
| | | }; |
| | | |
| | |
| | | </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>天津北方玻璃技术股份有限公司</div> |
| | | <div>生产流程卡</div> |
| | | <div style="text-align: right;font-weight: bolder">流程卡号: {{ |
| | | itemFlow.process_id |
| | |
| | | <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> |
| | | </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 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> |
| | |
| | | } |
| | | |
| | | #printFlowCard { |
| | | margin-top: -40px; |
| | | text-align: center; |
| | | //font-weight: bolder; height: 600px; |
| | | } |