فهرست منبع

采购询价管理重构:拆分原组件为index和indexView,优化采购计划ID相关查询逻辑

yusheng 10 ماه پیش
والد
کامیت
9c4f977c7c

+ 1 - 15
src/views/purchasingManage/inquiryManage/index.vue

@@ -184,15 +184,7 @@
       addContractBookDialog,
       generateContractsDialog
     },
-    props: {
-      purchasePlanId: '',
-      sonPurchasePlanIds: {
-        type: Array,
-        default: () => {
-          return [];
-        }
-      }
-    },
+
     data() {
       return {
         selection: [], //单选中集合
@@ -361,12 +353,6 @@
     methods: {
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {
-        if (this.purchasePlanId) {
-          where['planId'] = this.purchasePlanId;
-        }
-        if (this.sonPurchasePlanIds) {
-          where['planIds'] = this.sonPurchasePlanIds;
-        }
         return getTableList({
           pageNum: page,
           size: limit,

+ 251 - 0
src/views/purchasingManage/inquiryManage/indexView.vue

@@ -0,0 +1,251 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <div class="ele-border-lighter form-content" v-loading="loading">
+        <search-quotation @search="reload"> </search-quotation>
+
+        <!-- 数据表格 -->
+        <ele-pro-table
+          ref="table"
+          :columns="columns"
+          :datasource="datasource"
+          height="calc(100vh - 375px)"
+          full-height="calc(100vh - 116px)"
+          tool-class="ele-toolbar-form"
+          :page-size="20"
+          @columns-change="handleColumnChange"
+          :cache-key="cacheKeyUrl"
+        >
+          <!-- 查看详情列 -->
+          <template v-slot:inquiryCode="{ row }">
+            <el-link type="primary" :underline="false" @click="openDetail(row)">
+              {{ row.inquiryCode }}</el-link
+            >
+          </template>
+        </ele-pro-table>
+      </div>
+    </el-card>
+
+    <detail-dialog ref="contactDetailDialogRef"></detail-dialog>
+  </div>
+</template>
+
+<script>
+  import searchQuotation from './components/searchIndex.vue';
+  import detailDialog from './components/detailDialog.vue';
+
+  import dictMixins from '@/mixins/dictMixins';
+  import { getTableList } from '@/api/purchasingManage/inquiryManage';
+
+  import tabMixins from '@/mixins/tableColumnsMixin';
+  import { reviewStatus } from '@/enum/dict';
+
+  export default {
+    mixins: [dictMixins, tabMixins],
+    components: {
+      searchQuotation,
+
+      detailDialog
+    },
+    props: {
+      purchasePlanId: '',
+      sonPurchasePlanIds: {
+        type: Array,
+        default: () => {
+          return [];
+        }
+      }
+    },
+    data() {
+      return {
+        loading: false, // 加载状态
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'inquiryCode',
+            slot: 'inquiryCode',
+            label: '采购询价编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            sortable: true,
+            minWidth: 200
+          },
+          {
+            prop: 'inquiryName',
+            label: '采购询价名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'planCode',
+            slot: 'planCode',
+
+            label: '采购计划编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            sortable: true,
+            minWidth: 200
+          },
+          {
+            prop: 'planName',
+            label: '采购计划名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'productNames',
+            label: '产品名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          // {
+          //   prop: 'supplierNames',
+          //   label: '供应商名称',
+          //   align: 'center',
+          //   showOverflowTooltip: true,
+          //   minWidth: 200
+          // },
+          {
+            prop: 'winnerSupples',
+            label: '中标供应商',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          // {
+          //   prop: 'requireDeptName',
+          //   label: '需求部门',
+          //   align: 'center',
+          //   slot: 'requireDeptName',
+          //   showOverflowTooltip: true,
+          //   minWidth: 200
+          // },
+          // {
+          //   prop: 'requireUserName',
+          //   label: '需求人',
+          //   align: 'center',
+          //   showOverflowTooltip: true,
+          //   minWidth: 140
+          // },
+          // {
+          //   prop: 'responsibleName',
+          //   label: '负责人',
+          //   align: 'center',
+          //   showOverflowTooltip: true,
+          //   minWidth: 120
+          // },
+          // {
+          //   prop: 'detailCount',
+          //   label: '明细条数',
+          //   align: 'center',
+          //   showOverflowTooltip: true,
+          //   minWidth: 140
+          // },
+
+          // {
+          //   prop: 'finishDate',
+          //   label: '完成日期',
+          //   align: 'center',
+          //   showOverflowTooltip: true,
+          //   minWidth: 140
+          // },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 180
+          },
+          {
+            prop: 'status',
+            label: '状态',
+            align: 'center',
+            formatter: (_row, _column, cellValue) => {
+              return reviewStatus[cellValue];
+            },
+
+            showOverflowTooltip: true,
+            minWidth: 120
+          },
+          {
+            prop: 'remark',
+            label: '备注',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 230,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true,
+            fixed: 'right'
+          }
+        ],
+        cacheKeyUrl: 'eos-151ba34e-inquiryManage'
+      };
+    },
+    computed: {},
+    created() {},
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        if (this.purchasePlanId) {
+          where['planId'] = this.purchasePlanId;
+        }
+        if (this.sonPurchasePlanIds) {
+          where['planIds'] = this.sonPurchasePlanIds;
+        }
+        return getTableList({
+          pageNum: page,
+          size: limit,
+          ...where
+        });
+      },
+
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where });
+      },
+
+      //查看详情
+      openDetail(row) {
+        this.$refs.contactDetailDialogRef.open(row);
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  :deep(.el-link--inner) {
+    margin-left: 0px !important;
+  }
+
+  .sys-organization-list {
+    height: calc(100vh - 264px);
+    box-sizing: border-box;
+    border-width: 1px;
+    border-style: solid;
+    overflow: auto;
+  }
+  .sys-organization-list :deep(.el-tree-node__content) {
+    height: 40px;
+    & > .el-tree-node__expand-icon {
+      margin-left: 10px;
+    }
+  }
+</style>

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

@@ -251,11 +251,11 @@
       ref="contactDetailDialogRef"
       :isModal="false"
     ></detail-dialog>
-    <inquiryManageIndex
+    <inquiryManageView
       v-if="activeComp === 'inquiryManage'"
       :purchasePlanId="form.id"
       :sonPurchasePlanIds="sonPurchasePlanList.map((item) => item.id)"
-    ></inquiryManageIndex>
+    ></inquiryManageView>
     <!--入库详情-->
     <innerBoundDetails
       v-if="
@@ -280,7 +280,7 @@
   import outsourcing from './outsourcing.vue';
   import { orderSourceType } from '@/enum/dict';
   import tabMixins from '@/mixins/tableColumnsMixin';
-  import inquiryManageIndex from '@/views/purchasingManage/inquiryManage/index.vue';
+  import inquiryManageView from '@/views/purchasingManage/inquiryManage/indexView.vue';
   import innerBoundDetails from '@/BIZComponents/innerdetails.vue';
   import { levelList } from '@/enum/dict.js';
 
@@ -292,7 +292,7 @@
       bpmDetail,
       timeDialog,
       outsourcing,
-      inquiryManageIndex,
+      inquiryManageView,
       innerBoundDetails
     },
     props: {

+ 2 - 1
src/views/purchasingManage/purchasePlanManage/index.vue

@@ -250,7 +250,8 @@
         orderSourceType,
         params: {},
         cacheKeyUrl: 'eos-c2e9664a-purchasingManage-purchasePlanManage',
-        columnsVersion: 1
+        columnsVersion: 1,
+        selection:[]
       };
     },
     //客户管理数据