|
|
@@ -793,7 +793,8 @@
|
|
|
getpurchaseorderDetail,
|
|
|
getPurchasePlanByContractIdAPI,
|
|
|
UpdateInformation,
|
|
|
- getSupplierInfo
|
|
|
+ getSupplierInfo,
|
|
|
+ getByIdForEdit
|
|
|
} from '@/api/purchasingManage/purchaseOrder';
|
|
|
import { getplanDetail } from '@/api/purchasingManage/purchasePlanManage';
|
|
|
import { getpurchaseinquiry } from '@/api/purchasingManage/inquiryManage';
|
|
|
@@ -2500,24 +2501,25 @@
|
|
|
// console.log('提交数据', commitData);
|
|
|
|
|
|
if (this.isUpdate) {
|
|
|
- UpdateInformation(commitData)
|
|
|
- .then((res) => {
|
|
|
- this.loading = false;
|
|
|
- this.$message.success('修改成功');
|
|
|
- updateRelationStatus([this.form.partbId]);
|
|
|
- if (this.form.contractId) {
|
|
|
- updateContractStatus([this.form.contractId]);
|
|
|
- }
|
|
|
- if (type === 'sub') {
|
|
|
- this.sub(res);
|
|
|
- return;
|
|
|
- }
|
|
|
- this.cancel();
|
|
|
- this.$emit('done');
|
|
|
- })
|
|
|
- .catch((e) => {
|
|
|
- //this.loading = false;
|
|
|
- });
|
|
|
+ try {
|
|
|
+ // 更新前先拉取最新编辑数据,确保基于最新版本提交
|
|
|
+ await getByIdForEdit(this.form.id || this.businessId);
|
|
|
+ const res = await UpdateInformation(commitData);
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.success('修改成功');
|
|
|
+ updateRelationStatus([this.form.partbId]);
|
|
|
+ if (this.form.contractId) {
|
|
|
+ updateContractStatus([this.form.contractId]);
|
|
|
+ }
|
|
|
+ if (type === 'sub') {
|
|
|
+ this.sub(res);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.cancel();
|
|
|
+ this.$emit('done');
|
|
|
+ } catch (e) {
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
} else {
|
|
|
addInformation(commitData)
|
|
|
.then((res) => {
|