Browse Source

feat: 应收应付增加合计

liujt 2 weeks ago
parent
commit
0f6312561c

+ 88 - 76
src/views/financialManage/payableManage/index.vue

@@ -3,82 +3,86 @@
     <el-card shadow="never" v-loading="loading">
       <search-table @search="reload"></search-table>
       <!-- 数据表格 -->
-      <ele-pro-table
-        ref="table"
-        :columns="columns"
-        :datasource="datasource"
-        height="calc(100vh - 375px)"
-        full-height="calc(100vh - 116px)"
-        tool-class="ele-toolbar-form"
-        :selection.sync="selection"
-        :page-size="20"
-        @columns-change="handleColumnChange"
-        :cache-key="cacheKeyUrl"
-      >
-        <!-- 表头工具栏 -->
-        <template v-slot:toolbar>
-          <el-button
-            v-if="$hasPermission('eom:finpayable:push')"
-            size="small"
-            type="primary"
-            class="ele-btn-icon"
-            @click="allPushBtn"
-            :disabled="selection?.length === 0"
-          >
-            批量推送
-          </el-button>
-        </template>
-        <!-- 操作 -->
-        <template v-slot:action="{ row }">
-          <el-link
-            type="primary"
-            v-if="canAddInvoice(row)"
-            :underline="false"
-            icon="el-icon-plus"
-            @click="openEdit(row)"
-          >
-            新增发票
-          </el-link>
-          <el-link
-            type="primary"
-            v-if="[2].includes(row.approvalStatus)"
-            :underline="false"
-            icon="el-icon-plus"
-            @click="handleCollection(row, 'update')"
-          >
-            付款
-          </el-link>
-          <el-link
-            type="primary"
-            :underline="false"
-            icon="el-icon-plus"
-            @click="sub(row)"
-            v-if="[0, 3].includes(row.approvalStatus)"
-          >
-            提交
-          </el-link>
-        </template>
-        <!-- 收款信息 -->
-        <template v-slot:code="{ row }">
-          <el-link
-            type="primary"
-            :underline="false"
-            @click="handleDetail(row, 'view')"
-          >
-            {{ row.code }}
-          </el-link>
-        </template>
-        <!-- 开票信息 -->
-        <template v-slot:invoiceCode="{ row }">
-          <el-link
-            type="primary"
-            :underline="false"
-            @click="handleInvoiceDetail(row, 'view')"
-          >
-            {{ row.invoiceCode }}
-          </el-link>
-        </template>
-      </ele-pro-table>
+      <div>
+        <ele-pro-table
+          ref="table"
+          :columns="columns"
+          :datasource="datasource"
+          height="calc(100vh - 375px)"
+          full-height="calc(100vh - 116px)"
+          tool-class="ele-toolbar-form"
+          :selection.sync="selection"
+          :page-size="20"
+          @columns-change="handleColumnChange"
+          :cache-key="cacheKeyUrl"
+          show-summary
+          :summary-method="getSummaries"
+        >
+          <!-- 表头工具栏 -->
+          <template v-slot:toolbar>
+            <el-button
+              v-if="$hasPermission('eom:finpayable:push')"
+              size="small"
+              type="primary"
+              class="ele-btn-icon"
+              @click="allPushBtn"
+              :disabled="selection?.length === 0"
+            >
+              批量推送
+            </el-button>
+          </template>
+          <!-- 操作 -->
+          <template v-slot:action="{ row }">
+            <el-link
+              type="primary"
+              v-if="canAddInvoice(row)"
+              :underline="false"
+              icon="el-icon-plus"
+              @click="openEdit(row)"
+            >
+              新增发票
+            </el-link>
+            <el-link
+              type="primary"
+              v-if="[2].includes(row.approvalStatus)"
+              :underline="false"
+              icon="el-icon-plus"
+              @click="handleCollection(row, 'update')"
+            >
+              付款
+            </el-link>
+            <el-link
+              type="primary"
+              :underline="false"
+              icon="el-icon-plus"
+              @click="sub(row)"
+              v-if="[0, 3].includes(row.approvalStatus)"
+            >
+              提交
+            </el-link>
+          </template>
+          <!-- 收款信息 -->
+          <template v-slot:code="{ row }">
+            <el-link
+              type="primary"
+              :underline="false"
+              @click="handleDetail(row, 'view')"
+            >
+              {{ row.code }}
+            </el-link>
+          </template>
+          <!-- 开票信息 -->
+          <template v-slot:invoiceCode="{ row }">
+            <el-link
+              type="primary"
+              :underline="false"
+              @click="handleInvoiceDetail(row, 'view')"
+            >
+              {{ row.invoiceCode }}
+            </el-link>
+          </template>
+        </ele-pro-table>
+      </div>
     </el-card>
     <!--    付款信息-->
     <payment-dialog
@@ -119,6 +123,7 @@
 </template>
 
 <script>
+  import { getSummaries } from '@/utils/util.js';
   import { reviewStatus } from '@/enum/dict';
   import dictMixins from '@/mixins/dictMixins';
   import { finPayablePageListAPI, purchasePayableBill } from '@/api/financialManage/payableManage';
@@ -434,6 +439,13 @@
     },
     created() {},
     methods: {
+      getSummaries(param) {
+        return getSummaries(
+          param,
+          ['payableTotalPrice', 'paidTotalPrice', 'unpaidTotalPrice', 'invoiceAmount', 'unInvoiceAmount'],
+          ' '
+        );
+      },
       //新增发票
       openEdit(row) {
 

+ 89 - 77
src/views/financialManage/receivableManage/index.vue

@@ -2,83 +2,87 @@
   <div class="ele-body">
     <el-card shadow="never" v-loading="loading" style="width: 100%">
       <search-table @search="reload"></search-table>
-      <!-- 数据表格 -->
-      <ele-pro-table
-        ref="table"
-        :columns="columns"
-        :datasource="datasource"
-        height="calc(100vh - 375px)"
-        full-height="calc(100vh - 116px)"
-        tool-class="ele-toolbar-form"
-        :selection.sync="selection"
-        :page-size="20"
-        @columns-change="handleColumnChange"
-        :cache-key="cacheKeyUrl"
-      > 
-        <!-- 表头工具栏 -->
-        <template v-slot:toolbar>
-          <el-button
-            v-if="$hasPermission('eom:finreceivable:push')"
-            size="small"
-            type="primary"
-            class="ele-btn-icon"
-            @click="allPushBtn"
-            :disabled="selection?.length === 0"
-          >
-            批量推送
-          </el-button>
-        </template>
-        <!-- 操作 -->
-        <template v-slot:action="{ row }">
-          <el-link
-            type="primary"
-            v-if="[2].includes(row.approvalStatus)"
-            :underline="false"
-            icon="el-icon-plus"
-            @click="handleCollection(row, 'update')"
-          >
-            收款
-          </el-link>
-          <el-link
-            type="primary"
-            :underline="false"
-            icon="el-icon-plus"
-            @click="sub(row)"
-            v-if="[0, 3].includes(row.approvalStatus)"
-          >
-            提交
-          </el-link>
-          <el-link
-            type="primary"
-            :underline="false"
-            icon="el-icon-plus"
-            @click="openEdit(row)"
-            v-if="canAddInvoice(row)"
-          >
-            新增发票
-          </el-link>
-        </template>
-        <!-- 收款信息 -->
-        <template v-slot:code="{ row }">
-          <el-link
-            type="primary"
-            :underline="false"
-            @click="handleDetail(row, 'view')"
-          >
-            {{ row.code }}
-          </el-link>
-        </template>
-        <!-- 开票信息 -->
-        <template v-slot:invoiceCode="{ row }">
-          <el-link
-            type="primary"
-            :underline="false"
-            @click="handleInvoiceDetail(row, 'view')"
-          >
-            {{ row.invoiceCode }}
-          </el-link>
-        </template>
-      </ele-pro-table>
+      <div>
+        <!-- 数据表格 -->
+        <ele-pro-table
+          ref="table"
+          :columns="columns"
+          :datasource="datasource"
+          height="calc(100vh - 375px)"
+          full-height="calc(100vh - 116px)"
+          tool-class="ele-toolbar-form"
+          :selection.sync="selection"
+          :page-size="20"
+          @columns-change="handleColumnChange"
+          :cache-key="cacheKeyUrl"
+          show-summary
+          :summary-method="getSummaries"
+        > 
+          <!-- 表头工具栏 -->
+          <template v-slot:toolbar>
+            <el-button
+              v-if="$hasPermission('eom:finreceivable:push')"
+              size="small"
+              type="primary"
+              class="ele-btn-icon"
+              @click="allPushBtn"
+              :disabled="selection?.length === 0"
+            >
+              批量推送
+            </el-button>
+          </template>
+          <!-- 操作 -->
+          <template v-slot:action="{ row }">
+            <el-link
+              type="primary"
+              v-if="[2].includes(row.approvalStatus)"
+              :underline="false"
+              icon="el-icon-plus"
+              @click="handleCollection(row, 'update')"
+            >
+              收款
+            </el-link>
+            <el-link
+              type="primary"
+              :underline="false"
+              icon="el-icon-plus"
+              @click="sub(row)"
+              v-if="[0, 3].includes(row.approvalStatus)"
+            >
+              提交
+            </el-link>
+            <el-link
+              type="primary"
+              :underline="false"
+              icon="el-icon-plus"
+              @click="openEdit(row)"
+              v-if="canAddInvoice(row)"
+            >
+              新增发票
+            </el-link>
+          </template>
+          <!-- 收款信息 -->
+          <template v-slot:code="{ row }">
+            <el-link
+              type="primary"
+              :underline="false"
+              @click="handleDetail(row, 'view')"
+            >
+              {{ row.code }}
+            </el-link>
+          </template>
+          <!-- 开票信息 -->
+          <template v-slot:invoiceCode="{ row }">
+            <el-link
+              type="primary"
+              :underline="false"
+              @click="handleInvoiceDetail(row, 'view')"
+            >
+              {{ row.invoiceCode }}
+            </el-link>
+          </template>
+        </ele-pro-table>
+      </div>
     </el-card>
     <!--    收款信息-->
     <collection-dialog
@@ -117,6 +121,7 @@
 </template>
 
 <script>
+  import { getSummaries } from '@/utils/util.js';
   import { reviewStatus } from '@/enum/dict';
   import dictMixins from '@/mixins/dictMixins';
   import { finReceivablePageListAPI, receivableBill } from '@/api/financialManage/receivableManage';
@@ -447,6 +452,13 @@
     },
     created() {},
     methods: {
+      getSummaries(param) {
+        return getSummaries(
+          param,
+          ['receivableTotalPrice', 'receivedTotalPrice', 'unreceiveTotalPrice', 'invoiceAmount', 'unInvoiceAmount'],
+          ' '
+        );
+      },
       allPushBtn() {
         const dataId = this.selection.map((v) => v.id);
         receivableBill(dataId).then((res) => {