Browse Source

保存后清除hu

master
han\hanst 4 months ago
parent
commit
0af5125766
  1. 22
      src/views/modules/recv/recv.vue

22
src/views/modules/recv/recv.vue

@ -103,8 +103,8 @@
<el-form label-position="top" class="form-section" style="margin: 5px;">
<el-row :gutter="20">
<el-col :span="12"><el-form-item label="商品编码"><el-input v-model="recvItem.partNo" disabled /></el-form-item></el-col>
<el-col :span="12"><el-form-item label="计量单位"><el-input v-model="recvItem.unit" disabled /></el-form-item></el-col>
<el-col :span="24"><el-form-item label="商品名称"><el-input v-model="recvItem.desc" disabled /></el-form-item></el-col>
<el-col :span="12"><el-form-item label="计量单位"><el-input v-model="recvItem.purchaseUOM" disabled /></el-form-item></el-col>
<el-col :span="24"><el-form-item label="商品名称"><el-input v-model="recvItem.description" disabled /></el-form-item></el-col>
<el-col :span="8"><el-form-item label="单包装数量"><el-input v-model="hanlingItem.perQty" /></el-form-item></el-col>
<el-col :span="8"><el-form-item label="包装数"><el-input v-model="hanlingItem.packageQty" /></el-form-item></el-col>
<el-col :span="8" style="margin-top: 24px"><el-form-item>
@ -203,7 +203,7 @@ export default {
...row,
poNo: row.poNumber || this.scanCode,
dueinQty: row.qtyToReceive || row.invQtyToReceive,
transQty: row.invQtyToReceive || 0,
transQty: row.needHandlingUnit==='Y'?0:row.invQtyToReceive || 0,
batchNo: row.partNo+'-'+row.lineNo+'-'+row.releaseNo+'-'+1,
deliveryDate: row.plannedDeliveryDate || '',
arrivalDate: this.getCurrentDate(),
@ -241,6 +241,16 @@ export default {
this.handlingUnit.splice(index, 1);
localStorage.setItem(this.huKey, JSON.stringify(this.handlingUnit));
},
// handlingUnit
clearAllHandlingUnitCache() {
this.hanlingItem = { code: '', qty: '', perQty: '', packageQty: '' };
const keys = Object.keys(localStorage);
keys.forEach(key => {
if (key.startsWith('hu_')) {
localStorage.removeItem(key);
}
});
},
receivePo() {
if (this.fullscreenLoading) return; //
this.fullscreenLoading = true;
@ -285,14 +295,14 @@ export default {
manufactureDate: item.manufactureDate,
//
handlingUnitList: item.needHandlingUnit === 'Y' ? this.handlingUnit.map(hu => ({
perQty: hu.qty,
packageQty: 1
perQty: hu.perQty,
packageQty: hu.packageQty
})) : []
};
receivePo(receiveData).then(({ data }) => {
if (data.code === 0) {
this.$message.success("操作成功");
localStorage.removeItem(this.huKey);
this.clearAllHandlingUnitCache();
this.processFlag = 1;
this.scanCode = '';
this.poList = [];

Loading…
Cancel
Save