Browse Source

自动计算bug

master
han\hanst 3 weeks ago
parent
commit
e0d3d8a850
  1. 15
      src/views/modules/production-inbound/inboundRegister.vue
  2. 14
      src/views/modules/recv/recv.vue

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

@ -139,7 +139,7 @@
>
</el-switch>
<span v-if="autoCalculate" style="font-size: 13px; color: #17B3A3; margin-top: 5px; display: block; font-weight: bold;">
💡 输入单包装数量后按回车键或点击确定按钮
💡 输入单包装数量后按回车将根据未完成数量自动分配包装
</span>
<span v-else style="font-size: 12px; color: #999; margin-top: 5px; display: block;">
手动输入单包装数量和包装数然后点击"创建"按钮
@ -402,7 +402,7 @@ export default {
},
handlingUnitStep() {
this.processFlag = 3;
this.autoCalculate = false; // 使
this.autoCalculate = false; // 使
const saved = localStorage.getItem(this.huKey);
this.handlingUnit = saved ? JSON.parse(saved) : [];
},
@ -417,15 +417,20 @@ export default {
return;
}
const qtyToReceive = parseFloat(this.inboundItem.transQty) || 0;
// 使""使""
let qtyToReceive = parseFloat(this.inboundItem.transQty) || 0;
if (qtyToReceive <= 0) {
this.$message.warning('请先输入入库数量');
qtyToReceive = parseFloat(this.inboundItem.unCompleteQty) || 0;
}
if (qtyToReceive <= 0) {
this.$message.warning('未完成数量为0,无法自动计算包装');
return;
}
const perQtyValue = parseFloat(perQty);
const packageQty = Math.floor(qtyToReceive / perQtyValue);
// 使
const remainderInCents = Math.round(qtyToReceive * 100) - Math.round(perQtyValue * 100) * packageQty;
const remainder = remainderInCents / 100;

14
src/views/modules/recv/recv.vue

@ -121,7 +121,7 @@
>
</el-switch>
<span v-if="autoCalculate" style="font-size: 13px; color: #17B3A3; margin-top: 5px; display: block; font-weight: bold;">
💡 输入单包装数量后按回车键或点击确定按钮
💡 输入单包装数量后按回车将根据待收数量自动分配包装
</span>
<span v-else style="font-size: 12px; color: #999; margin-top: 5px; display: block;">
手动输入单包装数量和包装数然后点击"创建"按钮
@ -346,7 +346,7 @@ export default {
},
handlingUnitStep() {
this.processFlag = 3;
this.autoCalculate = false; //
this.autoCalculate = false; // 使
const saved = localStorage.getItem(this.huKey);
this.handlingUnit = saved ? JSON.parse(saved) : [];
},
@ -362,10 +362,14 @@ export default {
return;
}
//
const qtyToReceive = parseFloat(this.recvItem.qtyToReceive) || 0;
// 使""使""
let qtyToReceive = parseFloat(this.recvItem.transQty) || 0;
if (qtyToReceive <= 0) {
this.$message.warning('待收数量为0,无法创建HU');
qtyToReceive = parseFloat(this.recvItem.qtyToReceive) || 0;
}
if (qtyToReceive <= 0) {
this.$message.warning('待收数量为0,无法自动计算包装');
this.hanlingItem.perQty = '';
return;
}

Loading…
Cancel
Save