| | |
| | | flowCardCount=produceList.value.length |
| | | |
| | | handleSummary() |
| | | handleGetQRCode() |
| | | if (name=='天津北玻玻璃工业技术有限公司(TJBB-QR7.1-01)'){ |
| | | handleGetQRCodeTj()//天津扫码枪报工需要合并层号二维码 |
| | | }else{ |
| | | handleGetQRCode()//拆分层号二维码 |
| | | } |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | |
| | | |
| | | } |
| | | ) |
| | | |
| | | const handleGetQRCode = async () => { |
| | | for (let i = 0; i < produceList.value.length; i++) { |
| | | const detail = produceList.value[i].detail[0]; |
| | | const processId = detail.process_id; |
| | | const mergeStr = detail.mergeTechnologyNumber?.toString() || ''; |
| | | const detailItem = produceList.value[i].detail[0]; |
| | | const detailList = produceList.value[i].detailList; |
| | | |
| | | detail.qrcodeList = []; // 初始化 |
| | | const mergeTechNumber = detailItem.mergeTechnologyNumber.toString(); |
| | | const processId = detailItem.process_id; |
| | | const url = `${processId}/${mergeTechNumber}`; |
| | | |
| | | for (let j = 0; j < mergeStr.length; j++) { |
| | | const singleTech = mergeStr[j]; // 取出每一位字符 |
| | | const url = `${processId}/${singleTech}`; |
| | | const qrcodeData = await QRCode.toDataURL(url); |
| | | detail.qrcodeList.push({ |
| | | const qrcodeData = await QRCode.toDataURL(url); |
| | | detailItem.qrcodeList = []; |
| | | |
| | | //储存层号 |
| | | const seenTechNumbers = new Set(); |
| | | |
| | | for (let j = 0; j < detailList.length; j++) { |
| | | const techNum = detailList[j].technology_number; |
| | | //有则跳过 |
| | | if (seenTechNumbers.has(techNum)) continue; |
| | | detailItem.qrcodeList.push({ |
| | | qrcode: qrcodeData, |
| | | technologyNumber: singleTech |
| | | technologyNumber: techNum |
| | | }); |
| | | |
| | | seenTechNumbers.add(techNum); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | |
| | | // const handleGetQRCode = async () => { |
| | | // let technologyNumber='' |
| | | // for (let i = 0; i < produceList.value.length; i++) { |
| | | // |
| | | // const technologyNumber = produceList.value[i].detail[0].technologyNumber.toString(); // 转换为字符串以便处理每个字符 |
| | | // produceList.value[i].detail[0]["qrcodeList"] = []; // 初始化一个空数组用来存储 QR Code |
| | | // const merge = produceList.value[i].detail[0].mergeTechnologyNumber.toString(); |
| | | // const processId = produceList.value[i].detail[0].process_id; |
| | | // const url = `${processId}/${technologyNumber}`; |
| | | // // 生成 QR Code 并存储到数组中 |
| | | // const qrcodeData = await QRCode.toDataURL(url); |
| | | // produceList.value[i].detail[0]["qrcodeList"].push({ |
| | | // qrcode: qrcodeData, |
| | | // technologyNumber: technologyNumber |
| | | // }); |
| | | // } |
| | | // }; |
| | | |
| | | const handleGetQRCodeTj = async () => { |
| | | let technologyNumber='' |
| | | for (let i = 0; i < produceList.value.length; i++) { |
| | | const technologyNumber = produceList.value[i].detail[0].mergeTechnologyNumber.toString(); // 转换为字符串以便处理每个字符 |
| | | produceList.value[i].detail[0]["qrcodeList"] = []; // 初始化一个空数组用来存储 QR Code |
| | | |
| | | const processId = produceList.value[i].detail[0].process_id; |
| | | const url = `${processId}/${technologyNumber}`; |
| | | // 生成 QR Code 并存储到数组中 |
| | | const qrcodeData = await QRCode.toDataURL(url); |
| | | produceList.value[i].detail[0]["qrcodeList"].push({ |
| | | qrcode: qrcodeData, |
| | | technologyNumber: technologyNumber |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | |
| | | //根据输入的数量重新汇总 |