Browse Source

20250310

master
qiezi 10 months ago
parent
commit
7b414e5ee6
  1. 4
      src/views/modules/label/logisticLabelRecord.vue
  2. 60
      src/views/modules/label/printer.vue
  3. 10
      src/views/modules/label/record.vue
  4. 104
      src/views/modules/label/roll.vue

4
src/views/modules/label/logisticLabelRecord.vue

@ -294,7 +294,7 @@ export default {
let qrCodeList = this.$refs.qrCode.init([row.qrCode])
row.qrCode = qrCodeList[0]
for (let j = 0; j < printer.length; j++) {
printLogisticLabel([row],printer[0].defaultPrinterName,this.printTest)
printLogisticLabel([row],printer[0].defaultPrinterName,true)
}
}
this.printTest = false
@ -389,7 +389,7 @@ export default {
<el-form-item label=" ">
<el-button type="primary" style="width: 60px" @click="handleQuery">Query</el-button>
<el-button type="primary" style="width: 60px" @click="handlePrint">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>

60
src/views/modules/label/printer.vue

@ -896,15 +896,15 @@ export default {
params.qrCode = qrCodeList[0]
if (item.printType === 'Alpha/Hard Tag'){
printAlphaHardTagLabel([params],icons,item.printerName,this.printTest)
printAlphaHardTagLabel([params],icons,item.printerName,true)
}else if (item.printType === 'Hardware(Antenna)'){
if (this.printCurrentPart.category === 'Hardware(Antenna)-Serials'){
printAntennaLabel([params],icons,item.printerName,this.$store.state.user.autoSerialNumber,this.printTest)
printAntennaLabel([params],icons,item.printerName,this.$store.state.user.autoSerialNumber,true)
}else {
printAntennaLabel([params],icons,item.printerName,'N',this.printTest)
printAntennaLabel([params],icons,item.printerName,'N',true)
}
}else if (item.printType === 'RF' || this.currentPart.category === 'RFID'){
printRF_RFIDLabel([params],icons,item.printerName,this.printTest)
printRF_RFIDLabel([params],icons,item.printerName,true)
}
}
this.printTest = false
@ -1156,7 +1156,7 @@ export default {
notFound.push(label.defaultPrinterName)
continue
}
print_roll_label(prints,label.defaultPrinterName,this.printTest)
print_roll_label(prints,label.defaultPrinterName,true)
}
this.printTest = false
if (notFound.length > 0){
@ -1257,7 +1257,7 @@ export default {
notFound.push(label.defaultPrinterName)
continue
}
printLogisticLabel([row],label.defaultPrinterName,this.printTest)
printLogisticLabel([row],label.defaultPrinterName,true)
}
if (notFound.length > 0){
this.$message.warning(`The printer ${notFound.join(',')} is not found`)
@ -1655,16 +1655,20 @@ export default {
</el-col>
</el-row>
</el-form>
<div slot="footer" style="text-align: center; margin-top: 10px">
<el-row :gutter="10">
<el-col :span="8">
<el-button type="primary" icon="el-icon-printer" :loading="printLoading" style="width: 40px;float:left;" @click="handlePrintTest(0)"></el-button>
</el-col>
<el-col :span="8">
<el-button type="primary" :loading="printLoading" style="width: 60px" @click="handlePrintOrSave">Print</el-button>
<el-button style="width: 60px" @click="printVisible = false">Cancel</el-button>
</el-col>
</el-row>
<!-- <div slot="footer" style="text-align: center; margin-top: 10px">-->
<!-- <el-row :gutter="10">-->
<!-- <el-col :span="8">-->
<!-- <el-button type="primary" icon="el-icon-printer" :loading="printLoading" style="width: 40px;float:left;" @click="handlePrintTest(0)"></el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="8">-->
<!-- <el-button type="primary" :loading="printLoading" style="width: 60px" @click="handlePrintOrSave">Print</el-button>-->
<!-- <el-button style="width: 60px" @click="printVisible = false">Cancel</el-button>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- </div>-->
<div slot="footer">
<el-button type="primary" :loading="printLoading" style="width: 60px" @click="handlePrintOrSave">Print</el-button>
<el-button style="width: 60px" @click="printVisible = false">Cancel</el-button>
</div>
</el-dialog>
@ -1703,16 +1707,20 @@ export default {
</el-col>
</el-row>
</el-form>
<div slot="footer" style="text-align: center; margin-top: 10px">
<el-row :gutter="10">
<el-col :span="7">
<el-button type="primary" icon="el-icon-printer" :loading="printLoading" style="width: 40px;float:left;" @click="handlePrintTest(1)"></el-button>
</el-col>
<el-col :span="10">
<el-button type="primary" :loading="printLoading" style="width: 60px" @click="handlePrintLogistic">Print</el-button>
<el-button style="width: 60px" @click="logisticVisible = false">Cancel</el-button>
</el-col>
</el-row>
<!-- <div slot="footer" style="text-align: center; margin-top: 10px">-->
<!-- <el-row :gutter="10">-->
<!-- <el-col :span="7">-->
<!-- <el-button type="primary" icon="el-icon-printer" :loading="printLoading" style="width: 40px;float:left;" @click="handlePrintTest(1)"></el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="10">-->
<!-- <el-button type="primary" :loading="printLoading" style="width: 60px" @click="handlePrintLogistic">Print</el-button>-->
<!-- <el-button style="width: 60px" @click="logisticVisible = false">Cancel</el-button>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- </div>-->
<div slot="footer" >
<el-button type="primary" :loading="printLoading" style="width: 60px" @click="handlePrintLogistic">Print</el-button>
<el-button style="width: 60px" @click="logisticVisible = false">Cancel</el-button>
</div>
</el-dialog>

10
src/views/modules/label/record.vue

@ -460,15 +460,15 @@ export default {
continue
}
if (str[1] === 'Alpha/Hard Tag'){
printAlphaHardTagLabel(dataList,base64List,str[0],this.printTest)
printAlphaHardTagLabel(dataList,base64List,str[0],true)
}else if (str[1] === 'Hardware(Antenna)'){
if (print.category === 'Alpha/Hard Tag-Serials'){
printAlphaHardTagLabel(dataList,base64List,str[0],this.printTest)
printAlphaHardTagLabel(dataList,base64List,str[0],true)
}else {
printAntennaLabel(dataList,base64List,str[0],this.$store.state.user.autoSerialNumber,this.printTest)
printAntennaLabel(dataList,base64List,str[0],this.$store.state.user.autoSerialNumber,true)
}
}else if (str[1] === 'RF' || str[1] === 'RFID'){
printRF_RFIDLabel(dataList,base64List,str[0],this.printTest)
printRF_RFIDLabel(dataList,base64List,str[0],true)
}
}
this.printTest = false;
@ -610,7 +610,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>

104
src/views/modules/label/roll.vue

@ -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>

Loading…
Cancel
Save