Browse Source

fix:680【应付管理】界面增加状态tab

mlchen 5 days ago
parent
commit
02fca4def4
1 changed files with 59 additions and 3 deletions
  1. 59 3
      src/views/financialManage/payableManage/index.vue

+ 59 - 3
src/views/financialManage/payableManage/index.vue

@@ -2,6 +2,15 @@
   <div class="ele-body">
     <el-card shadow="never" v-loading="loading">
       <search-table ref="searchTableRef" @search="reload"></search-table>
+      <!-- 付款状态页签:对应 t_eom_fin_payable.status(0未付款/1部分付款/2已付全款),默认看未付 -->
+      <el-tabs v-model="activeName" type="card" @tab-click="handleTabClick">
+        <el-tab-pane
+          v-for="tab in paymentTabs"
+          :key="tab.name"
+          :label="tab.label"
+          :name="tab.name"
+        ></el-tab-pane>
+      </el-tabs>
       <!-- 数据表格 -->
       <div>
         <ele-pro-table
@@ -9,7 +18,7 @@
           :columns="columns"
           :datasource="datasource"
           :where="drillWhere"
-          height="calc(100vh - 375px)"
+          height="calc(100vh - 416px)"
           full-height="calc(100vh - 116px)"
           tool-class="ele-toolbar-form"
           :selection.sync="selection"
@@ -211,6 +220,26 @@
             value: 2
           }
         ],
+        // 付款状态页签(name 与 t_eom_fin_payable.status 一一对应)
+        activeName: '0',
+        paymentTabs: [
+          {
+            name: '0',
+            label: '未付'
+          },
+          {
+            name: '1',
+            label: '部分付'
+          },
+          {
+            name: '2',
+            label: '已付'
+          },
+          {
+            name: 'all',
+            label: '全部'
+          }
+        ],
         cacheKeyUrl: 'eos-7a7a5e23-payableManage',
         columnsVersion: 1,
         // 首页看板下钻带入的首屏查询条件(无 drill 参数时为 {},与原有默认查询一致)
@@ -498,6 +527,8 @@
       // 审核状态 APPROVED 落到 approvalStatus=2(已审核);INVOICED 在本页无可映射状态字段,忽略状态只应用日期
       const query = this.$route.query;
       if (query.drill !== '1') return;
+      // 首页看板下钻进来落在「全部」,避免被默认的「未付」页签改掉下钻行数
+      this.activeName = 'all';
       const where = {};
       if (query.drillStart) {
         where.createTimeStart = query.drillStart + ' 00:00:00';
@@ -620,11 +651,35 @@
       },
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {
-        return finPayablePageListAPI({
+        const params = {
           pageNum: page,
           size: limit,
           ...where
-        });
+        };
+        // 页签选中的付款状态优先,避免与搜索表单里的「付款状态」互相矛盾;「全部」页签不按付款状态下发
+        if (this.activeName !== 'all') {
+          params.status = Number(this.activeName);
+        }
+        return finPayablePageListAPI(params);
+      },
+      /* 付款状态页签切换:按新状态回到第一页重查 */
+      handleTabClick() {
+        this.$refs.table.reload({ page: 1 });
+      },
+      /* 搜索表单里选了「付款状态」时同步选中对应页签,保持页签与筛选条件一致 */
+      syncActiveName(where) {
+        if (
+          !where ||
+          where.status === undefined ||
+          where.status === null ||
+          where.status === ''
+        ) {
+          return;
+        }
+        const name = String(where.status);
+        if (this.paymentTabs.some((tab) => tab.name === name)) {
+          this.activeName = name;
+        }
       },
       sub(res) {
         this.processSubmitDialogFlag = true;
@@ -644,6 +699,7 @@
       },
       /* 刷新表格 */
       reload(where) {
+        this.syncActiveName(where);
         this.$nextTick(() => {
           this.$refs.table.reload({ page: 1, where });
         });