|
|
@@ -548,6 +548,16 @@
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ // 与后端拆单口径一致:有报价的供应商各成一张核价单;一个都没报价时不拆
|
|
|
+ countSplitOrders() {
|
|
|
+ const quotedSupplierIds = new Set();
|
|
|
+ (this.form.supplierList || []).forEach((item) => {
|
|
|
+ if (item.supplierId && (item.resultList || []).length) {
|
|
|
+ quotedSupplierIds.add(item.supplierId);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return quotedSupplierIds.size || 1;
|
|
|
+ },
|
|
|
setIsInquiry(supplierList) {
|
|
|
this.$nextTick(() => {
|
|
|
// this.supplierList.forEach((item) => {
|
|
|
@@ -723,6 +733,17 @@
|
|
|
.then((res) => {
|
|
|
this.loading = false;
|
|
|
|
|
|
+ // 不同供应商一起核价时后端按供应商拆单(每家一张),这里按同一口径提示实际生成张数
|
|
|
+ const orderCount = this.countSplitOrders();
|
|
|
+ if (orderCount > 1) {
|
|
|
+ this.$message.success(
|
|
|
+ `已生成 ${orderCount} 张核价单(每家供应商一张),请在列表中逐张提交审批`
|
|
|
+ );
|
|
|
+ this.cancel();
|
|
|
+ this.$emit('done');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
this.$message.success('操作成功');
|
|
|
|
|
|
updateRelationStatus(supplierIds);
|