소스 검색

fix:3790【采购订单】选择来源采购计划单,这里的已采数量跟待采数量统计了此计划单来源的需求跟计划都统计,但计划详情那是区分开的,应一致区分

mlchen 1 주 전
부모
커밋
c1fd2e1c96

+ 8 - 1
src/views/purchasingManage/purchaseOrder/components/billDetailDialog.vue

@@ -64,6 +64,8 @@ export default {
       },
       spanArr: [],
       type: '',
+      // 来源类型(1需求/2计划/3核价/4合同),已采下钻时由订单物料清单传入
+      sourceRelationType: '',
       datasource: []
     };
   },
@@ -170,8 +172,10 @@ export default {
     },
   },
   methods: {
-    async open(row, type) {
+    async open(row, type, sourceRelationType) {
       this.type = type
+      // 来源类型(1需求/2计划/3核价/4合同),仅已采下钻使用:后端按它区分已采口径
+      this.sourceRelationType = sourceRelationType
       await this.getInquiryData(row, type);
       this.getSpanArr()
     },
@@ -184,6 +188,9 @@ export default {
         batchNo: row.batchNo,
         relationIds: this.type != 5 ? (row[arrName] || []) : ([...row.requirementIds, ...row.planIds, ...row.inquiryIds, ...row.contractIds] || [])
       }
+      if (this.type == 5) {
+        params.sourceRelationType = this.sourceRelationType
+      }
       this.loading = true;
       try {
         this.datasource = await getProductsNumberDetail(params);

+ 2 - 1
src/views/purchasingManage/purchaseOrder/components/inventoryTableNew.vue

@@ -1276,7 +1276,8 @@
       handleGetBillDetail(row, type) {
         this.billDetailDialogFlag = true;
         this.$nextTick(() => {
-          this.$refs.billDetailDialogRef.open(row, type);
+          // 已采下钻(type=5)需要按当前来源类型区分口径,其余下钻各自带自己的 id 集合
+          this.$refs.billDetailDialogRef.open(row, type, this.form.relationType);
         });
       },
 

+ 4 - 2
src/views/purchasingManage/purchasePlanManage/components/detailDialog.vue

@@ -495,7 +495,8 @@
             label: '已采数量',
             align: 'center',
             formatter: (row, column) => {
-              if (row.doneTotalCount) {
+              // 已采数量后端按计量口径下发,0 也是有效值(未下单),不能当空值吞掉
+              if (row.doneTotalCount !== null && row.doneTotalCount !== undefined) {
                 return row.doneTotalCount + ' ' + (row.measuringUnit || '');
               }
             }
@@ -506,7 +507,8 @@
             label: '待采数量',
             align: 'center',
             formatter: (row, column) => {
-              if (row.waitTotalCount) {
+              // 待采数量为 0 表示已采足,需显示 0 而不是留空
+              if (row.waitTotalCount !== null && row.waitTotalCount !== undefined) {
                 return row.waitTotalCount + ' ' + (row.measuringUnit || '');
               }
             }