|
|
|
@ -392,7 +392,7 @@ export default { |
|
|
|
for (let i = 0; i < qrCodeList.length; i++) { |
|
|
|
arr[i].qrCode = qrCodeList[i] |
|
|
|
} |
|
|
|
print_roll_label(arr,printerNameList[j].defaultPrinterName,this.printTest) |
|
|
|
print_roll_label(arr,printerNameList[j].defaultPrinterName,true) |
|
|
|
} |
|
|
|
} |
|
|
|
this.printTest = false |
|
|
|
@ -406,56 +406,56 @@ export default { |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
printLabel(pictureList,formatList){ |
|
|
|
let prints = this.selectionPrintLabelRecordList.map((item) => { |
|
|
|
return { |
|
|
|
qrCode: `(00)${item.partNo}(01)${item.qtyPerCarton}(02)${item.umName}(03)${item.manufacturerDate}(04)${item.serialNumber}(05)${item.manufacturerNo}(06)${item.moldCode}(07)${item.boxNo}(08)`, |
|
|
|
ref: item.partNo, |
|
|
|
qty: item.qtyPerCarton, |
|
|
|
productRev: item.rev, |
|
|
|
uom: item.umName, |
|
|
|
desc: item.partDesc, |
|
|
|
rollCount: item.qtyPerRoll, |
|
|
|
date: item.manufacturerDate, |
|
|
|
manufacturer: item.manufacturerNo, |
|
|
|
moldCode: item.moldCode, |
|
|
|
sn: item.serialNumber, |
|
|
|
} |
|
|
|
}) |
|
|
|
let notFound = []; |
|
|
|
for (let i = 0; i < prints.length; i++) { |
|
|
|
let print = prints[i] |
|
|
|
let dataList = [] |
|
|
|
dataList.push(print); |
|
|
|
// 获取模板数量 |
|
|
|
let format = formatList[i] |
|
|
|
let base64List = pictureList[i].map((item)=>{return {icon:item}}) |
|
|
|
|
|
|
|
for (let formatElement of format) { |
|
|
|
let str = formatElement.split('(type)') |
|
|
|
if (!this.printerSetupList.includes(str[0])) { |
|
|
|
if (notFound.includes(str[0])){ |
|
|
|
continue |
|
|
|
} |
|
|
|
notFound.push(str[0]) |
|
|
|
continue |
|
|
|
} |
|
|
|
if (str[1] === 'Alpha/Hard Tag'){ |
|
|
|
printAlphaHardTagLabel(dataList,base64List,str[0]) |
|
|
|
}else if (str[1] === 'Hardware(Antenna)'){ |
|
|
|
printAntennaLabel(dataList,base64List,str[0]) |
|
|
|
}else if (str[1] === 'RF' || str[1] === 'RFID'){ |
|
|
|
printRF_RFIDLabel(dataList,base64List,str[0]) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.$refs.table.clearSelection() |
|
|
|
if (notFound.length > 0){ |
|
|
|
this.$message.warning(`The printer ${notFound.join(',')} is not found`) |
|
|
|
}else { |
|
|
|
this.$message.success("Print label success") |
|
|
|
} |
|
|
|
}, |
|
|
|
// printLabel(pictureList,formatList){ |
|
|
|
// let prints = this.selectionPrintLabelRecordList.map((item) => { |
|
|
|
// return { |
|
|
|
// qrCode: `(00)${item.partNo}(01)${item.qtyPerCarton}(02)${item.umName}(03)${item.manufacturerDate}(04)${item.serialNumber}(05)${item.manufacturerNo}(06)${item.moldCode}(07)${item.boxNo}(08)`, |
|
|
|
// ref: item.partNo, |
|
|
|
// qty: item.qtyPerCarton, |
|
|
|
// productRev: item.rev, |
|
|
|
// uom: item.umName, |
|
|
|
// desc: item.partDesc, |
|
|
|
// rollCount: item.qtyPerRoll, |
|
|
|
// date: item.manufacturerDate, |
|
|
|
// manufacturer: item.manufacturerNo, |
|
|
|
// moldCode: item.moldCode, |
|
|
|
// sn: item.serialNumber, |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// let notFound = []; |
|
|
|
// for (let i = 0; i < prints.length; i++) { |
|
|
|
// let print = prints[i] |
|
|
|
// let dataList = [] |
|
|
|
// dataList.push(print); |
|
|
|
// // 获取模板数量 |
|
|
|
// let format = formatList[i] |
|
|
|
// let base64List = pictureList[i].map((item)=>{return {icon:item}}) |
|
|
|
// |
|
|
|
// for (let formatElement of format) { |
|
|
|
// let str = formatElement.split('(type)') |
|
|
|
// if (!this.printerSetupList.includes(str[0])) { |
|
|
|
// if (notFound.includes(str[0])){ |
|
|
|
// continue |
|
|
|
// } |
|
|
|
// notFound.push(str[0]) |
|
|
|
// continue |
|
|
|
// } |
|
|
|
// if (str[1] === 'Alpha/Hard Tag'){ |
|
|
|
// printAlphaHardTagLabel(dataList,base64List,str[0]) |
|
|
|
// }else if (str[1] === 'Hardware(Antenna)'){ |
|
|
|
// printAntennaLabel(dataList,base64List,str[0]) |
|
|
|
// }else if (str[1] === 'RF' || str[1] === 'RFID'){ |
|
|
|
// printRF_RFIDLabel(dataList,base64List,str[0]) |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
// this.$refs.table.clearSelection() |
|
|
|
// if (notFound.length > 0){ |
|
|
|
// this.$message.warning(`The printer ${notFound.join(',')} is not found`) |
|
|
|
// }else { |
|
|
|
// this.$message.success("Print label success") |
|
|
|
// } |
|
|
|
// }, |
|
|
|
handleSizeChange(val){ |
|
|
|
this.size = val |
|
|
|
this.getPrintLabelRecordList() |
|
|
|
@ -586,7 +586,7 @@ export default { |
|
|
|
<el-form-item label=" "> |
|
|
|
<el-button type="primary" style="width: 60px" @click="getPrintLabelRecordList">Query</el-button> |
|
|
|
<el-button type="primary" style="width: 60px" @click="handlePrintLabel">Print</el-button> |
|
|
|
<el-button type="primary" style="width: 80px" @click="handlePrintTest">Print Test</el-button> |
|
|
|
<!-- <el-button type="primary" style="width: 80px" @click="handlePrintTest">Print Test</el-button>--> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|