han\hanst 2 months ago
parent
commit
6849088e7b
  1. 21
      src/views/modules/production-inbound/inboundRegister.vue

21
src/views/modules/production-inbound/inboundRegister.vue

@ -403,13 +403,6 @@ export default {
return; return;
} }
const qtyToReceive = parseFloat(this.inboundItem.transQty) || 0;
if (qtyToReceive <= 0) {
this.$message.warning('入库数量为0,无法创建HU');
this.hanlingItem.perQty = '';
return;
}
const perQtyValue = parseFloat(perQty); const perQtyValue = parseFloat(perQty);
const packageQty = Math.floor(qtyToReceive / perQtyValue); const packageQty = Math.floor(qtyToReceive / perQtyValue);
const remainder = qtyToReceive - (packageQty * perQtyValue); const remainder = qtyToReceive - (packageQty * perQtyValue);
@ -547,7 +540,13 @@ export default {
// unitIds // unitIds
const unitIds = data.unitIds || []; const unitIds = data.unitIds || [];
if (unitIds.length > 0) { if (unitIds.length > 0) {
this.printViaServer(unitIds);
let printLabelType;
if (this.inboundItem.partNo && this.inboundItem.partNo.startsWith("80")) {
printLabelType = '库存成品标签';
} else {
printLabelType = 'BIL标签';
}
this.printViaServer(unitIds,printLabelType);
} }
this.processFlag = 1; this.processFlag = 1;
@ -568,13 +567,13 @@ export default {
/** /**
* 通过服务器打印 * 通过服务器打印
* @param {Array} unitIds - HU unitId列表 * @param {Array} unitIds - HU unitId列表
* @param printLabelType
*/ */
async printViaServer(unitIds) {
async printViaServer(unitIds, printLabelType) {
if (!unitIds || unitIds.length === 0) { if (!unitIds || unitIds.length === 0) {
console.warn('没有可打印的标签'); console.warn('没有可打印的标签');
return; return;
} }
this.$emit('print-start') this.$emit('print-start')
try { try {
const printRequest = { const printRequest = {
@ -582,7 +581,7 @@ export default {
username: localStorage.getItem('userName'), username: localStorage.getItem('userName'),
site: localStorage.getItem('site'), site: localStorage.getItem('site'),
unitIds: unitIds, unitIds: unitIds,
labelType: "库存成品标签"
labelType: printLabelType
} }
console.log('打印请求:', printRequest); console.log('打印请求:', printRequest);

Loading…
Cancel
Save