فهرست منبع

fix:4988【核价管理】全部核价完了,还显示部分核价,看详情都是全部的了

mlchen 1 هفته پیش
والد
کامیت
ca2d3bcb0d
1فایلهای تغییر یافته به همراه21 افزوده شده و 0 حذف شده
  1. 21 0
      src/views/purchasingManage/inquiryManage/components/addDialog.vue

+ 21 - 0
src/views/purchasingManage/inquiryManage/components/addDialog.vue

@@ -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);