Przeglądaj źródła

fix:984【企业运营】营销管理的报价单支持新建导入bom清单查询物料价格

mlchen 4 dni temu
rodzic
commit
5d708f81e1

+ 34 - 1
src/BIZComponents/inventoryTableDetails.vue

@@ -90,6 +90,16 @@
           {{ scope.row[countObj.unitKey] }}
         </el-form-item>
       </template> -->
+      <template v-slot:bomAction="scope">
+        <el-link
+          type="primary"
+          :underline="false"
+          icon="el-icon-document"
+          @click.native="openBomDetail(scope.row)"
+        >
+          BOM详情<span v-if="rowBomCount(scope.row)">({{ rowBomCount(scope.row) }})</span>
+        </el-link>
+      </template>
       <!-- 表头工具栏 -->
       <template v-slot:toolbar>
         <div class="headbox">
@@ -139,6 +149,11 @@
       timeDialog
     },
     props: {
+      // 是否显示「操作」列(BOM详情):只有报价单审批详情传 true,其它单据不受影响
+      showBomDetail: {
+        default: false,
+        type: Boolean
+      },
       isDiscountTotalPrice: {
         default: false,
         type: Boolean
@@ -885,11 +900,22 @@
           }
         ];
         // 合并所有列
-        return [
+        const mergedColumns = [
           ...baseColumns,
           ...additionalColumns,
           ...remainingColumns
         ].filter((item) => !item.isNone);
+        if (this.showBomDetail) {
+          mergedColumns.push({
+            width: 130,
+            columnKey: 'bomAction',
+            label: '操作',
+            slot: 'bomAction',
+            fixed: 'right',
+            align: 'center'
+          });
+        }
+        return mergedColumns;
       }
     },
 
@@ -1058,6 +1084,13 @@
         return isNaN(num) ? 0 : formatPrice(num);
       },
       //修改回显
+      rowBomCount(row) {
+        return row && Array.isArray(row.bomList) ? row.bomList.length : 0;
+      },
+      // 交给父组件(报价单审批详情)打开 BOM 详情弹窗
+      openBomDetail(row) {
+        this.$emit('showBomDetail', row);
+      },
       async putTableValue(data) {
         let productList =
           (data &&

+ 12 - 1
src/views/bpm/handleTask/components/quotation/detailDialog.vue

@@ -91,7 +91,11 @@
       v-if="taskDefinitionKey != 'technicianApprove'"
       :isDiscount="false"
       ref="inventoryTabledetailRef"
+      showBomDetail
+      @showBomDetail="openBomDetail"
     ></inventoryTabledetail>
+
+    <bomDetailDialog ref="bomDetailDialogRef"></bomDetailDialog>
   </div>
   <!-- </ele-modal> -->
 </template>
@@ -105,6 +109,7 @@
   import inventoryTable from '@/BIZComponents/inventoryTable.vue';
 
   import { getDetail } from '@/api/bpm/components/saleManage/quotation';
+  import bomDetailDialog from './bomDetailDialog.vue';
   // import fileMain from "@/components/addDoc/index.vue";
   export default {
     mixins: [dictMixins],
@@ -119,7 +124,8 @@
     components: {
       // fileMain,
       inventoryTable,
-      inventoryTabledetail
+      inventoryTabledetail,
+      bomDetailDialog
     },
     data() {
       return {
@@ -297,6 +303,11 @@
           this.form = data;
         }
       },
+      // 查看该物品清单行已导入的 BOM(数据来自 eom/quote/getById 的 quoteProductList[].bomList)
+      openBomDetail(row) {
+        this.$refs.bomDetailDialogRef &&
+          this.$refs.bomDetailDialogRef.open({ row: row });
+      },
       /**
        * 取当前明细数据,供审批组件在「技术主管审批 / 销售员补充 / 发起人」节点回写报价单。
        * 1. 技术员节点渲染可编辑的 inventoryTable,其余节点渲染只读的 inventoryTabledetail,