Browse Source

20240909

dev
qiezi 1 year ago
parent
commit
c0641afba9
  1. 10
      src/printFormat/RF_RFID.js
  2. 10
      src/printFormat/alphaHardTagPrintFormat.js
  3. 12
      src/printFormat/antenna.js
  4. 44
      src/printFormat/roll_label.js
  5. 9
      src/views/modules/label/printer.vue
  6. 9
      src/views/modules/label/record.vue
  7. 56
      src/views/modules/part/external.vue

10
src/printFormat/RF_RFID.js

@ -22,8 +22,8 @@ export const printRF_RFIDLabel = (printList, icons, printerName) => {
LODOP.NewPage();
LODOP.SET_PRINTER_INDEXA(printerName)
LODOP.SET_PRINT_PAGESIZE(0,1100,512,"");
LODOP.ADD_PRINT_BARCODE(6,23,115,83,"QRCode",row.qrCode);
LODOP.ADD_PRINT_IMAGE(4,275,96,15,"<img src=\"data:image/png;base64," + ckpLogo + "\"/>");
LODOP.ADD_PRINT_BARCODE(12,33,115,83,"QRCode",row.qrCode);
LODOP.ADD_PRINT_IMAGE(4,275,96,20,"<img src=\"data:image/png;base64," + ckpLogo + "\"/>");
LODOP.SET_PRINT_STYLEA(0,"Stretch",2);
LODOP.SET_PRINT_STYLEA(0,"Alignment",3);
LODOP.ADD_PRINT_TEXT(20,126,40,20,"REF");
@ -46,19 +46,21 @@ export const printRF_RFIDLabel = (printList, icons, printerName) => {
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(63,175,186,35,row.desc);
LODOP.SET_PRINT_STYLEA(0,"FontName","Arial");
LODOP.SET_PRINT_STYLEA(0,"LineSpacing",-5);
LODOP.SET_PRINT_STYLEA(0,"FontSize",9);
if (row.tradingMark && row.tradingMark === 'Y'){
LODOP.ADD_PRINT_TEXT(63,350,50,35,'®');
LODOP.ADD_PRINT_TEXT(65,360,50,35,'®');
LODOP.SET_PRINT_STYLEA(0,"FontName","Arial");
LODOP.SET_PRINT_STYLEA(0,"FontSize",18);
}
LODOP.ADD_PRINT_TEXT(42,274,40,20,"UoM");
LODOP.SET_PRINT_STYLEA(0,"FontName","Arial");
LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
LODOP.ADD_PRINT_TEXT(40,321,60,20,row.uom);
LODOP.ADD_PRINT_TEXT(32,301,70,20,row.uom);
LODOP.SET_PRINT_STYLEA(0,"FontName","Arial");
LODOP.SET_PRINT_STYLEA(0,"FontSize",14);
LODOP.SET_PRINT_STYLEA(0,"Alignment",3);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_LINE(100,-2,99,406,0,1);

10
src/printFormat/alphaHardTagPrintFormat.js

@ -23,9 +23,9 @@ export function printAlphaHardTagLabel (printList, icons, printerName) {
LODOP.NewPage();
LODOP.SET_PRINTER_INDEXA(printerName)
LODOP.SET_PRINT_PAGESIZE(0,1100,512,"");
LODOP.ADD_PRINT_BARCODE(6,23,115,83,"QRCode",row.qrCode);
LODOP.ADD_PRINT_BARCODE(12,33,115,83,"QRCode",row.qrCode);
LODOP.SET_PRINT_STYLEA(0,"FontSize",7);
LODOP.ADD_PRINT_IMAGE(4,275,96,15,"<img src=\"data:image/png;base64," + ckpLogo + "\"/>");
LODOP.ADD_PRINT_IMAGE(4,275,96,20,"<img src=\"data:image/png;base64," + ckpLogo + "\"/>");
LODOP.SET_PRINT_STYLEA(0,"Stretch",2);
LODOP.SET_PRINT_STYLEA(0,"Alignment",3);
LODOP.ADD_PRINT_TEXT(17,126,40,20,"REF");
@ -50,19 +50,21 @@ export function printAlphaHardTagLabel (printList, icons, printerName) {
// LODOP.ADD_PRINT_HTM(50,175,186,35,`<div>${row.desc}</div>`);
LODOP.ADD_PRINT_TEXT(50,175,186,35,row.desc);
LODOP.SET_PRINT_STYLEA(0,"FontName","Arial");
LODOP.SET_PRINT_STYLEA(0,"LineSpacing",-5);
LODOP.SET_PRINT_STYLEA(0,"FontSize",9);
if (row.tradingMark && row.tradingMark === 'Y'){
LODOP.ADD_PRINT_TEXT(53,350,50,35,'®');
LODOP.ADD_PRINT_TEXT(55,360,50,35,'®');
LODOP.SET_PRINT_STYLEA(0,"FontName","Arial");
LODOP.SET_PRINT_STYLEA(0,"FontSize",18);
}
LODOP.ADD_PRINT_TEXT(34,274,40,20,"UoM");
LODOP.SET_PRINT_STYLEA(0,"FontName","Arial");
LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
LODOP.ADD_PRINT_TEXT(32,321,60,20,row.uom);
LODOP.ADD_PRINT_TEXT(32,301,70,20,row.uom);
LODOP.SET_PRINT_STYLEA(0,"FontName","Arial");
LODOP.SET_PRINT_STYLEA(0,"FontSize",14);
LODOP.SET_PRINT_STYLEA(0,"Alignment",3);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_LINE(86,-2,85,406,0,1);

12
src/printFormat/antenna.js

@ -22,8 +22,8 @@ export const printAntennaLabel = (printList, icons, printerName) => {
LODOP.NewPage()
LODOP.SET_PRINTER_INDEXA(printerName)
LODOP.SET_PRINT_PAGESIZE(0, 1100, 512, '')
LODOP.ADD_PRINT_BARCODE(6, 23, 115, 83, 'QRCode', row.qrCode)
LODOP.ADD_PRINT_IMAGE(4, 275, 96, 14, '<img src="data:image/png;base64,' + ckpLogo + '"/>')
LODOP.ADD_PRINT_BARCODE(12, 33, 115, 83, 'QRCode', row.qrCode)
LODOP.ADD_PRINT_IMAGE(4, 275, 96, 20, '<img src="data:image/png;base64,' + ckpLogo + '"/>')
LODOP.SET_PRINT_STYLEA(0, 'Stretch', 2)
LODOP.SET_PRINT_STYLEA(0,"Alignment",3);
LODOP.ADD_PRINT_TEXT(17, 126, 40, 20, 'REF')
@ -47,19 +47,21 @@ export const printAntennaLabel = (printList, icons, printerName) => {
LODOP.ADD_PRINT_TEXT(55, 175, 186, 35, row.desc)
LODOP.SET_PRINT_STYLEA(0, 'FontName', 'Arial')
LODOP.SET_PRINT_STYLEA(0,"LineSpacing",-5);
LODOP.SET_PRINT_STYLEA(0,"FontSize",9);
if (row.tradingMark && row.tradingMark === 'Y'){
LODOP.ADD_PRINT_TEXT(55,350,50,35,'®');
LODOP.ADD_PRINT_TEXT(55,360,50,35,'®');
LODOP.SET_PRINT_STYLEA(0,"FontName","Arial");
LODOP.SET_PRINT_STYLEA(0,"FontSize",18);
}
LODOP.ADD_PRINT_TEXT(35, 274, 40, 20, 'UoM')
LODOP.SET_PRINT_STYLEA(0, 'FontName', 'Arial')
LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
LODOP.ADD_PRINT_TEXT(33, 321, 60, 20, row.uom)
LODOP.SET_PRINT_STYLEA(0, 'FontName', 'Arial')
LODOP.ADD_PRINT_TEXT(32,301,70,20,row.uom);
LODOP.SET_PRINT_STYLEA(0,"FontName","Arial");
LODOP.SET_PRINT_STYLEA(0,"FontSize",14);
LODOP.SET_PRINT_STYLEA(0,"Alignment",3);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_LINE(92, -2, 91, 406, 0, 1)

44
src/printFormat/roll_label.js

@ -27,45 +27,57 @@ export const print_roll_label = (printList,printerName)=>{
LODOP.SET_PRINT_STYLEA(0,"FontSize",5);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(27,73,25,20,"QTY");
LODOP.ADD_PRINT_TEXT(13,93,80,30,row.ref);
LODOP.SET_PRINT_STYLEA(0,"FontName","Arial");
LODOP.SET_PRINT_STYLEA(0,"FontSize",5);
LODOP.SET_PRINT_STYLEA(0,"FontSize",8);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(27,122,25,20,"UOM");
LODOP.ADD_PRINT_TEXT(24,73,25,20,"QTY");
LODOP.SET_PRINT_STYLEA(0,"FontName","Arial");
LODOP.SET_PRINT_STYLEA(0,"FontSize",5);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(38,73,30,20,"DESC");
LODOP.ADD_PRINT_TEXT(24,93,35,20,row.qty);
LODOP.SET_PRINT_STYLEA(0,"FontName","Arial");
LODOP.SET_PRINT_STYLEA(0,"FontSize",5);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(13,93,80,30,row.ref);
LODOP.ADD_PRINT_TEXT(24,122,25,20,"UOM");
LODOP.SET_PRINT_STYLEA(0,"FontName","Arial");
LODOP.SET_PRINT_STYLEA(0,"FontSize",8);
LODOP.SET_PRINT_STYLEA(0,"FontSize",5);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(27,93,35,20,row.qty);
LODOP.ADD_PRINT_TEXT(24,140,50,20,row.uom);
LODOP.SET_PRINT_STYLEA(0,"FontName","Arial");
LODOP.SET_PRINT_STYLEA(0,"FontSize",5);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(27,140,50,20,row.uom);
LODOP.ADD_PRINT_TEXT(32,73,30,20,"DESC");
LODOP.SET_PRINT_STYLEA(0,"FontName","Arial");
LODOP.SET_PRINT_STYLEA(0,"FontSize",5);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(38,96,80,35,row.desc);
LODOP.ADD_PRINT_TEXT(32,96,80,35,row.desc);
LODOP.SET_PRINT_STYLEA(0,"FontName","Arial");
LODOP.SET_PRINT_STYLEA(0,"LineSpacing",-3);
LODOP.SET_PRINT_STYLEA(0,"FontSize",5);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
if (row.rollLabelRequired === 'Y'){
LODOP.ADD_PRINT_TEXT(58,73,30,20,"ROLL");
LODOP.ADD_PRINT_TEXT(56,73,30,20,"ROLL");
}else if (row.serialNumberRequired === 'Y'){
LODOP.ADD_PRINT_TEXT(58,73,50,20,"SERIAL");
LODOP.ADD_PRINT_TEXT(56,73,50,20,"SERIAL");
}
if (row.rollLabelRequired === 'Y' || row.serialNumberRequired === 'Y'){
LODOP.SET_PRINT_STYLEA(0,"FontName","Arial");
LODOP.SET_PRINT_STYLEA(0,"FontSize",5);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
}
if (row.rollLabelRequired === 'Y'){
LODOP.ADD_PRINT_TEXT(56,95,80,20,row.rollNo);
}else if (row.serialNumberRequired === 'Y'){
LODOP.ADD_PRINT_TEXT(56,95,80,20,row.serialNumber);
}
if (row.rollLabelRequired === 'Y' || row.serialNumberRequired === 'Y'){
LODOP.SET_PRINT_STYLEA(0,"FontName","Arial");
@ -83,16 +95,6 @@ export const print_roll_label = (printList,printerName)=>{
LODOP.SET_PRINT_STYLEA(0,"FontSize",5);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
if (row.rollLabelRequired === 'Y'){
LODOP.ADD_PRINT_TEXT(58,95,80,20,row.rollNo);
}else if (row.serialNumberRequired === 'Y'){
LODOP.ADD_PRINT_TEXT(58,95,80,20,row.serialNumber);
}
if (row.rollLabelRequired === 'Y' || row.serialNumberRequired === 'Y'){
LODOP.SET_PRINT_STYLEA(0,"FontName","Arial");
LODOP.SET_PRINT_STYLEA(0,"FontSize",5);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
}
LODOP.PRINT();
// LODOP.PRINT_DESIGN()
}

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

@ -738,8 +738,8 @@ export default {
let labelList = this.labelFormatList.filter((item)=> item.labelType === 'Shipment Carton')
for (let label of labelList) {
let prints = data.rows.map((item) => {
return {
qrCode: `(00)${item.partNo}(01)${item.qtyPerCarton}(02)${item.umName}(03)${item.manufacturerDate}(04)${item.serialNumber? item.serialNumber : ''}(05)${item.manufacturerNo? item.manufacturerNo : ''}(06)${item.moldCode? item.moldCode : ''}(07)(08)`,
let params = {
qrCode: `(00)${item.partNo}(01)${item.qtyPerCarton}(02)${item.umName}(03)${item.manufacturerDate}(04)${item.serialNumber? item.serialNumber : ''}(05)${item.manufacturerNo? item.manufacturerNo : ''}(06)${item.moldCode? item.moldCode : ''}(07)${item.boxNo? item.boxNo : ''}(08)`,
ref: item.partNo,
productRev: item.rev,
qty: item.qtyPerCarton,
@ -753,8 +753,11 @@ export default {
freeInfo2: item.freeInfo2,
tradingMark: item.tradingMark,
weightUmName: item.weightUmName,
weight: new Decimal(item.packingWeight).mul(item.qtyPerCarton).toNumber(),
}
if (item.packingWeight){
params.weight = new Decimal(item.packingWeight).mul(item.qtyPerCarton).toNumber();
}
return params
});
// let value = this.printCurrentPart.totalShipQty % this.printCurrentPart.qtyPerCarton
// if (value !== 0){

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

@ -396,8 +396,8 @@ 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? item.serialNumber : ''}(05)${item.manufacturerNo? item.manufacturerNo : ''}(06)${item.moldCode? item.moldCode : ''}(07)(08)`,
let params = {
qrCode: `(00)${item.partNo}(01)${item.qtyPerCarton}(02)${item.umName}(03)${item.manufacturerDate}(04)${item.serialNumber? item.serialNumber : ''}(05)${item.manufacturerNo? item.manufacturerNo : ''}(06)${item.moldCode? item.moldCode : ''}(07)${item.boxNo? item.boxNo : ''}(08)`,
ref: item.partNo,
qty: item.qtyPerCarton,
productRev: item.rev,
@ -411,8 +411,11 @@ export default {
freeInfo2:item.freeInfo2,
tradingMark: item.tradingMark,
weightUmName: item.weightUmName,
weight: new Decimal(item.packingWeight).mul(item.qtyPerCarton).toNumber(),
}
if (item.packingWeight){
params.weight = new Decimal(item.packingWeight).mul(item.qtyPerCarton).toNumber();
}
return params
})
let notFound = [];

56
src/views/modules/part/external.vue

@ -767,22 +767,22 @@ export default {
"savePart.category"(newVal,oldVal){
const category = this.partCategoryList.find((item)=>item.categoryValue === newVal);
if (category){
this.savePart.manufacturerRequired = category.manufacturerRequired;
this.savePart.moldCodeRequired = category.moldCodeRequired;
this.savePart.serialNumberRequired = category.serialNumberRequired;
this.savePart.rollLabelRequired = category.rollLabelRequired;
if (this.savePart.serialNumberRequired === 'Y'){
this.savePart.qtyPerRoll = 1;
this.savePart.rollsPerCarton = 1;
}
if (category.showCartonQtyPerRoll === 'N'){
this.savePart.qtyPerRoll = 1;
}
if (category.showCartonRollsPerCarton === 'N'){
this.savePart.rollsPerCarton = 1;
}
this.partRules.rollsPerCarton[0].message = `Please input ${category.qtyPerRollPart}`
this.savePart.qtyPerCarton = this.qtyPerCarton();
// this.savePart.manufacturerRequired = category.manufacturerRequired;
// this.savePart.moldCodeRequired = category.moldCodeRequired;
// this.savePart.serialNumberRequired = category.serialNumberRequired;
// this.savePart.rollLabelRequired = category.rollLabelRequired;
// if (this.savePart.serialNumberRequired === 'Y'){
// this.savePart.qtyPerRoll = 1;
// this.savePart.rollsPerCarton = 1;
// }
// if (category.showCartonQtyPerRoll === 'N'){
// this.savePart.qtyPerRoll = 1;
// }
// if (category.showCartonRollsPerCarton === 'N'){
// this.savePart.rollsPerCarton = 1;
// }
// this.partRules.rollsPerCarton[0].message = `Please input ${category.qtyPerRollPart}`
// this.savePart.qtyPerCarton = this.qtyPerCarton();
this.category = JSON.parse(JSON.stringify(category))
}
},
@ -1168,6 +1168,28 @@ export default {
this.no = val;
this.handleSelectExternalPartPage();
},
changeCategory(val){
const category = this.partCategoryList.find((item)=>item.categoryValue === val);
if (category){
this.savePart.manufacturerRequired = category.manufacturerRequired;
this.savePart.moldCodeRequired = category.moldCodeRequired;
this.savePart.serialNumberRequired = category.serialNumberRequired;
this.savePart.rollLabelRequired = category.rollLabelRequired;
if (this.savePart.serialNumberRequired === 'Y'){
this.savePart.qtyPerRoll = 1;
this.savePart.rollsPerCarton = 1;
}
if (category.showCartonQtyPerRoll === 'N'){
this.savePart.qtyPerRoll = 1;
}
if (category.showCartonRollsPerCarton === 'N'){
this.savePart.rollsPerCarton = 1;
}
this.partRules.rollsPerCarton[0].message = `Please input ${category.qtyPerRollPart}`
this.savePart.qtyPerCarton = this.qtyPerCarton();
this.category = JSON.parse(JSON.stringify(category))
}
}
},
computed:{
@ -1281,7 +1303,7 @@ export default {
</el-col>
<el-col :span="8">
<el-form-item label="Part Category" prop="category" :show-message="false">
<el-select v-model="savePart.category" placeholder="" style="width: 100%">
<el-select v-model="savePart.category" placeholder="" @change="changeCategory" style="width: 100%">
<el-option :label="item.categoryName" :value="item.categoryValue" :key="item.id" v-for="item in partCategoryList"></el-option>
</el-select>
</el-form-item>

Loading…
Cancel
Save