|
@@ -218,7 +218,9 @@
|
|
|
businessId: '',
|
|
businessId: '',
|
|
|
// 采购订单关联的采购计划 id / 计划回写的默认仓库映射(按产品匹配)
|
|
// 采购订单关联的采购计划 id / 计划回写的默认仓库映射(按产品匹配)
|
|
|
purchasePlanId: '',
|
|
purchasePlanId: '',
|
|
|
- planWarehouse: null
|
|
|
|
|
|
|
+ planWarehouse: null,
|
|
|
|
|
+ // 订单详情请求序号:切换订单时丢弃过期响应
|
|
|
|
|
+ orderDetailSeq: 0
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -230,6 +232,8 @@
|
|
|
this.row = row;
|
|
this.row = row;
|
|
|
this.purchasePlanId = purchasePlanId || '';
|
|
this.purchasePlanId = purchasePlanId || '';
|
|
|
this.planWarehouse = null;
|
|
this.planWarehouse = null;
|
|
|
|
|
+ // 使上一次打开时未返回的订单详情请求失效,避免把旧数据写进本次弹窗
|
|
|
|
|
+ this.orderDetailSeq = this.orderDetailSeq + 1;
|
|
|
if (orderId) {
|
|
if (orderId) {
|
|
|
await this.getPurchaseOrderDetail(orderId);
|
|
await this.getPurchaseOrderDetail(orderId);
|
|
|
}
|
|
}
|
|
@@ -304,15 +308,18 @@
|
|
|
},
|
|
},
|
|
|
//获取订单详情
|
|
//获取订单详情
|
|
|
async getPurchaseOrderDetail(id) {
|
|
async getPurchaseOrderDetail(id) {
|
|
|
|
|
+ const seq = (this.orderDetailSeq = this.orderDetailSeq + 1);
|
|
|
this.loading = true;
|
|
this.loading = true;
|
|
|
const data = await getByIdCondition(id, 1);
|
|
const data = await getByIdCondition(id, 1);
|
|
|
- this.loading = false;
|
|
|
|
|
|
|
+ if (seq !== this.orderDetailSeq) return;
|
|
|
if (data) {
|
|
if (data) {
|
|
|
// 订单未直接带出仓库时,按关联采购计划回写的默认仓库预选明细行仓库
|
|
// 订单未直接带出仓库时,按关联采购计划回写的默认仓库预选明细行仓库
|
|
|
- this.planWarehouse =
|
|
|
|
|
- (await this.getPlanWarehouse(
|
|
|
|
|
- this.purchasePlanId || data.purchasePlanId
|
|
|
|
|
- )) || null;
|
|
|
|
|
|
|
+ const planWarehouse = await this.getPlanWarehouse(
|
|
|
|
|
+ this.purchasePlanId || data.purchasePlanId
|
|
|
|
|
+ );
|
|
|
|
|
+ if (seq !== this.orderDetailSeq) return;
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ this.planWarehouse = planWarehouse || null;
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
let {
|
|
let {
|
|
|
partbId,
|
|
partbId,
|
|
@@ -344,6 +351,8 @@
|
|
|
this.$refs.inventoryTableref &&
|
|
this.$refs.inventoryTableref &&
|
|
|
this.$refs.inventoryTableref.putTableValue(productList);
|
|
this.$refs.inventoryTableref.putTableValue(productList);
|
|
|
});
|
|
});
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.loading = false;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|