Преглед изворни кода

feat(财务模块): 添加应付应收单批量推送功能

liujt пре 5 месеци
родитељ
комит
bb1461efc1

+ 10 - 0
src/api/financialManage/payableManage/index.js

@@ -38,3 +38,13 @@ export async function finPayableRemoveAPI(data) {
   return Promise.reject(new Error(res.data.message));
 }
 
+// 推送
+export async function purchasePayableBill(data) {
+  const res = await request.post('/port/Jd/purchasePayableBill', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+

+ 9 - 0
src/api/financialManage/receivableManage/index.js

@@ -12,6 +12,15 @@ export async function finReceivablePageListAPI(data) {
   return Promise.reject(new Error(res.data.message));
 }
 
+// 推送
+export async function receivableBill(data) {
+  const res = await request.post('/port/Jd/receivableBill', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
 
 //保存收款记录
 export async function finReceivableSaveAPI(data) {

+ 37 - 1
src/views/financialManage/payableManage/index.vue

@@ -15,6 +15,19 @@
         @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
@@ -99,7 +112,7 @@
 <script>
   import { reviewStatus } from '@/enum/dict';
   import dictMixins from '@/mixins/dictMixins';
-  import { finPayablePageListAPI } from '@/api/financialManage/payableManage';
+  import { finPayablePageListAPI, purchasePayableBill } from '@/api/financialManage/payableManage';
   import paymentDialog from './components/paymentDialog.vue';
   import searchTable from './searchTable.vue';
   import detailDialog from './components/detailDialog.vue';
@@ -148,6 +161,12 @@
         // 当columnsVersion变化时会重新计算,用作更新列配置
         const version = this.columnsVersion;
         return [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center'
+          },
           {
             width: 60,
             label: '序号',
@@ -272,6 +291,16 @@
               return reviewStatus[_row.approvalStatus];
             }
           },
+          {
+            prop: 'externalId',
+            label: '是否推送',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120,
+            formatter: (_row, _column, cellValue) => {
+              return _row.externalId? '已推送' : '未推送';
+            }
+          },
           {
             columnKey: 'action',
             label: '操作',
@@ -287,6 +316,13 @@
     },
     created() {},
     methods: {
+      allPushBtn() {
+        const dataId = this.selection.map((v) => v.id);
+        purchasePayableBill(dataId).then((res) => {
+          this.$message.success('推送成功!');
+          this.reload();
+        });
+      },
       handleCollection(row = {}, type) {
         this.paymentDialogFlag = true;
         this.$nextTick(() => {

+ 38 - 2
src/views/financialManage/receivableManage/index.vue

@@ -14,7 +14,20 @@
         :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
@@ -98,7 +111,7 @@
 <script>
   import { reviewStatus } from '@/enum/dict';
   import dictMixins from '@/mixins/dictMixins';
-  import { finReceivablePageListAPI } from '@/api/financialManage/receivableManage';
+  import { finReceivablePageListAPI, receivableBill } from '@/api/financialManage/receivableManage';
   import collectionDialog from './components/collectionDialog.vue';
   import searchTable from './searchTable.vue';
   import detailDialog from './components/detailDialog.vue';
@@ -161,6 +174,12 @@
         // 当columnsVersion变化时会重新计算,用作更新列配置
         const version = this.columnsVersion;
         return [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center'
+          },
           {
             width: 60,
             label: '序号',
@@ -267,6 +286,16 @@
           slot: 'createTime',
           showOverflowTooltip: true
         },
+        {
+          prop: 'externalId',
+          label: '是否推送',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120,
+          formatter: (_row, _column, cellValue) => {
+            return _row.externalId? '已推送' : '未推送';
+          }
+        },
         {
           minWidth: 100,
           prop: 'createTime',
@@ -301,6 +330,13 @@
     },
     created() {},
     methods: {
+      allPushBtn() {
+        const dataId = this.selection.map((v) => v.id);
+        receivableBill(dataId).then((res) => {
+          this.$message.success('推送成功!');
+          this.reload();
+        });
+      },
       handleCollection(row = {}, type) {
         this.collectionDialogFlag = true;
         this.$nextTick(() => {