|
|
|
@ -16,7 +16,7 @@ import {printRF_RFIDLabel} from '../../../printFormat/RF_RFID' |
|
|
|
|
|
|
|
import getLodop from '@/utils/LodopFuncs.js' |
|
|
|
import {getTableDefaultListLanguage, getTableUserListLanguage} from '../../../api/table' |
|
|
|
import {getCategoryList} from '../../../api/category/categoty' |
|
|
|
import {getCategory, getCategoryList} from '../../../api/category/category' |
|
|
|
import QrCode from './QrCode.vue' |
|
|
|
import {savePrintRollLabelRecord} from '../../../api/label/printRollLabelRecord' |
|
|
|
import {print_roll_label} from '../../../printFormat/roll_label' |
|
|
|
@ -53,6 +53,7 @@ export default { |
|
|
|
}, |
|
|
|
data(){ |
|
|
|
return{ |
|
|
|
rowSpan: 8, |
|
|
|
printerSetupList:[], |
|
|
|
currentPrinter: '', |
|
|
|
printType: 'alphaHardTag', |
|
|
|
@ -548,8 +549,28 @@ export default { |
|
|
|
}, |
|
|
|
handlePrint(status){ |
|
|
|
this.printCurrentPart = JSON.parse(JSON.stringify(this.currentPart)) |
|
|
|
let labelList = []; |
|
|
|
if (status === 1){ |
|
|
|
labelList = this.labelFormatList.filter((item)=> item.labelType === 'Roll Label') |
|
|
|
this.printCurrentPart.rollsPerCarton = 1; |
|
|
|
this.$set(this.printCurrentPart,'orderNo','') |
|
|
|
}else { |
|
|
|
labelList = this.labelFormatList.filter((item)=> item.labelType === 'Shipment Carton') |
|
|
|
} |
|
|
|
if (labelList.length === 0){ |
|
|
|
this.$message.warning("There is no maintenance of print label format") |
|
|
|
return |
|
|
|
} |
|
|
|
for (let label of labelList) { |
|
|
|
if (!label.defaultPrinterName){ |
|
|
|
this.$message.warning("The default printer name is not set") |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
this.status = status; |
|
|
|
this.$set(this.printCurrentPart,'cartonCount',1) |
|
|
|
this.$set(this.printCurrentPart,'manufacturerNo','') |
|
|
|
this.$set(this.printCurrentPart,'totalShipQty',undefined) |
|
|
|
this.$set(this.printCurrentPart,'moldCode','') |
|
|
|
this.$set(this.printCurrentPart,'serialNumber',undefined) |
|
|
|
this.$set(this.printCurrentPart,'manufacturerTime',dayjs().format('YYYY-MM-DD HH:mm:ss')) |
|
|
|
@ -562,6 +583,7 @@ export default { |
|
|
|
this.printCurrentPart.qtyPerCarton = this.currentPart.qtyPerCarton; |
|
|
|
this.printCurrentPart.qtyPerRoll = this.currentPart.qtyPerRoll; |
|
|
|
this.printCurrentPart.rollsPerCarton = this.currentPart.rollsPerCarton; |
|
|
|
this.printCurrentPart.totalShipQty = this.totalShipQty(); |
|
|
|
} |
|
|
|
if (this.currentPart.manufacturerRequired === 'Y'){ |
|
|
|
// 查询所有的 manufacturer |
|
|
|
@ -570,26 +592,44 @@ export default { |
|
|
|
if (this.currentPart.moldCodeRequired === 'Y'){ |
|
|
|
this.printCurrentPart.moldCode = this.currentPart.moldCode; |
|
|
|
} |
|
|
|
let labelList = []; |
|
|
|
if (status === 1){ |
|
|
|
labelList = this.labelFormatList.filter((item)=> item.labelType === 'Roll Label') |
|
|
|
this.printCurrentPart.rollsPerCarton = 1; |
|
|
|
this.$set(this.printCurrentPart,'orderNo','') |
|
|
|
}else { |
|
|
|
labelList = this.labelFormatList.filter((item)=> item.labelType === 'Shipment Carton') |
|
|
|
} |
|
|
|
if (labelList.length === 0){ |
|
|
|
this.$message.warning("There is no maintenance of print label format") |
|
|
|
return |
|
|
|
// 获取 category |
|
|
|
let params = { |
|
|
|
categoryValue: this.currentPart.category, |
|
|
|
} |
|
|
|
for (let label of labelList) { |
|
|
|
if (!label.defaultPrinterName){ |
|
|
|
this.$message.warning("The default printer name is not set") |
|
|
|
return |
|
|
|
getCategory(params).then(({data})=>{ |
|
|
|
if (data && data.code === 0){ |
|
|
|
this.$set(this.printCurrentPart,'qtyPerRollLabel',data.data.qtyPerRollLabel) |
|
|
|
this.$set(this.printCurrentPart,'cartonCountLabel',data.data.cartonCountLabel) |
|
|
|
this.$set(this.printCurrentPart,'rollCountLabel',data.data.rollCountLabel) |
|
|
|
this.$set(this.printCurrentPart,'showCartonQtyPerRoll',data.data.showCartonQtyPerRoll) |
|
|
|
this.$set(this.printCurrentPart,'showCartonRollsPerCarton',data.data.showCartonRollsPerCarton) |
|
|
|
this.$set(this.printCurrentPart,'showRollQtyPerRoll',data.data.showRollQtyPerRoll) |
|
|
|
this.$set(this.printCurrentPart,'editQtyPerCarton',data.data.editQtyPerCarton) |
|
|
|
this.printRules.qtyPerRoll[0].message = `Please input ${data.data.qtyPerRollLabel}` |
|
|
|
if (this.status === 0){ |
|
|
|
if (data.data.showCartonRollsPerCarton === 'N' && data.data.showCartonQtyPerRoll === 'N'){ |
|
|
|
this.rowSpan = 8 |
|
|
|
}else if (data.data.showCartonRollsPerCarton === 'N' || data.data.showCartonQtyPerRoll === 'N'){ |
|
|
|
this.rowSpan = 6 |
|
|
|
}else { |
|
|
|
this.rowSpan = 5 |
|
|
|
} |
|
|
|
this.printRules.cartonCount[0].message = `Please input ${data.data.cartonCountLabel}` |
|
|
|
}else { |
|
|
|
if (data.data.showRollQtyPerRoll === 'N'){ |
|
|
|
this.rowSpan = 12 |
|
|
|
}else { |
|
|
|
this.rowSpan = 8 |
|
|
|
} |
|
|
|
this.printRules.cartonCount[0].message = `Please input ${data.data.rollCountLabel}` |
|
|
|
} |
|
|
|
this.printVisible = true; |
|
|
|
}else { |
|
|
|
this.$message.warning(data.msg) |
|
|
|
} |
|
|
|
} |
|
|
|
this.status = status; |
|
|
|
this.printVisible = true; |
|
|
|
}).catch((error)=>{ |
|
|
|
this.$message.error(error) |
|
|
|
}) |
|
|
|
}, |
|
|
|
getExternalPartManufacturerList(){ |
|
|
|
let params = { |
|
|
|
@ -988,7 +1028,7 @@ export default { |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="16" v-if="status !== 0"> |
|
|
|
<el-form-item label="PO" prop="orderNo" :show-message="false"> |
|
|
|
<el-form-item label="PO" prop="orderNo" v-if="false" :show-message="false"> |
|
|
|
<el-input v-model="printCurrentPart.orderNo"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
@ -997,15 +1037,15 @@ export default { |
|
|
|
<el-input v-model="printCurrentPart.partDesc" disabled></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="status === 0? 5:8"> |
|
|
|
<el-form-item v-if="printCurrentPart.serialNumberRequired === 'Y'" label="Qty Per Roll" :show-message="false"> |
|
|
|
<el-col :span="rowSpan" v-if="(status === 0 && printCurrentPart.showCartonQtyPerRoll === 'Y') || (status === 1 && printCurrentPart.showRollQtyPerRoll === 'Y')"> |
|
|
|
<el-form-item v-if="printCurrentPart.serialNumberRequired === 'Y'" :label="printCurrentPart.qtyPerRollLabel" :show-message="false"> |
|
|
|
<el-input-number :step="0" :min="1" :controls="false" v-model="printCurrentPart.qtyPerRoll" disabled></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-else key="qtyPerRoll" label="Qty Per Roll" prop="qtyPerRoll" :show-message="false"> |
|
|
|
<el-form-item v-else key="qtyPerRoll" :label="printCurrentPart.qtyPerRollLabel" prop="qtyPerRoll" :show-message="false"> |
|
|
|
<el-input-number :step="0" :min="1" :controls="false" v-model="printCurrentPart.qtyPerRoll"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="5" v-if="status === 0"> |
|
|
|
<el-col :span="rowSpan" v-if="status === 0 && printCurrentPart.showCartonRollsPerCarton === 'Y'"> |
|
|
|
<el-form-item v-if="printCurrentPart.serialNumberRequired === 'Y'" label="Rolls Per Carton" :show-message="false"> |
|
|
|
<el-input-number :step="0" :min="1" :controls="false" v-model="printCurrentPart.rollsPerCarton" disabled></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
@ -1013,23 +1053,23 @@ export default { |
|
|
|
<el-input-number :step="0" :min="1" :controls="false" v-model="printCurrentPart.rollsPerCarton"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="5" v-if="status === 0"> |
|
|
|
<el-col :span="rowSpan" v-if="status === 0"> |
|
|
|
<el-form-item v-if="printCurrentPart.serialNumberRequired === 'Y'" label="Qty Per Carton" :show-message="false"> |
|
|
|
<el-input-number :step="0" :controls="false" v-model="printCurrentPart.qtyPerCarton" disabled></el-input-number> |
|
|
|
<el-input-number :step="0" :controls="false" v-model="printCurrentPart.qtyPerCarton" :disabled="printCurrentPart.editQtyPerCarton === 'N'"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-else label="Qty Per Carton" prop="qtyPerCarton" key="qtyPerCarton" :show-message="false"> |
|
|
|
<el-input-number :step="0" :controls="false" v-model="printCurrentPart.qtyPerCarton" disabled></el-input-number> |
|
|
|
<el-input-number :step="0" :controls="false" v-model="printCurrentPart.qtyPerCarton" :disabled="printCurrentPart.editQtyPerCarton === 'N'"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="status === 0? 4:8"> |
|
|
|
<el-form-item v-if="printCurrentPart.serialNumberRequired === 'Y'" label="Carton Count" :show-message="false"> |
|
|
|
<el-col :span="(status === 0 && rowSpan === 5)? rowSpan-1:rowSpan"> |
|
|
|
<el-form-item v-if="printCurrentPart.serialNumberRequired === 'Y'" :label="status === 0 ? printCurrentPart.cartonCountLabel:printCurrentPart.rollCountLabel" :show-message="false"> |
|
|
|
<el-input-number :step="0" :min="1" :controls="false" v-model="printCurrentPart.cartonCount" disabled></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-else key="cartonCount" :label="status === 0 ? 'Carton Count':'Roll Count'" prop="cartonCount" :show-message="false"> |
|
|
|
<el-form-item v-else key="cartonCount" :label="status === 0 ? printCurrentPart.cartonCountLabel:printCurrentPart.rollCountLabel" prop="cartonCount" :show-message="false"> |
|
|
|
<el-input-number :step="0" :min="1" :controls="false" v-model="printCurrentPart.cartonCount"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="status === 0? 5:8"> |
|
|
|
<el-col :span="rowSpan"> |
|
|
|
<el-form-item v-if="printCurrentPart.serialNumberRequired === 'Y'" label="Total Ship Qty" :show-message="false"> |
|
|
|
<el-input-number :step="0" :min="0" :controls="false" v-model="printCurrentPart.totalShipQty" disabled></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
|