| | |
| | | technologyNumber = produceList.value[i].detail[0].technologyNumber.toString(); // 转换为字符串以便处理每个字符 |
| | | } |
| | | produceList.value[i].detail[0]["qrcodeList"] = []; // 初始化一个空数组用来存储 QR Code |
| | | if (compound == null ){ |
| | | 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 |
| | | }); |
| | | } |
| | | else { |
| | | technologyNumber = compound |
| | | 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 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 |
| | | }); |
| | | |
| | | // 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] |
| | | // }); |
| | | // |
| | | // } |
| | | |
| | | |
| | | } |
| | | }; |
| | | |
| | |
| | | <tr v-for="(qrCodeItem,index) in item.detail" :key="index"> |
| | | <td colspan="31"> |
| | | <span style="display: flex;"> |
| | | <span v-for="(qrCodeItems,index) in qrCodeItem.qrcodeList" :key="index" style="display: flex;width: 35%"> |
| | | <span v-for="(qrCodeItems,index) in qrCodeItem.qrcodeList" :key="index" style="display: flex;width: 20%"> |
| | | <div class='qrCode' style="width: 80px;height: 80px;"> |
| | | <img :src=qrCodeItems.qrcode> |
| | | </div> |