Преглед на файлове

fix:资方对账记录新增一个批量划扣按钮

lazy преди 3 дни
родител
ревизия
b612edbcff
променени са 2 файла, в които са добавени 56 реда и са изтрити 3 реда
  1. 8 0
      src/api/capitalFinancialManage/index.js
  2. 48 3
      src/views/capitalFinancingManage/billRecords/index.vue

+ 8 - 0
src/api/capitalFinancialManage/index.js

@@ -234,6 +234,14 @@ export function getCapitalAccountRecord(params) {
   })
 }
 
+// 资方授信-资方队长记录-手动批量划扣
+export function execBatchDiscount(params) {
+  return request({
+    url: `/financing/reconciliation/info/repaymentFileProcess?dateStr=${params}`,
+    method: 'get'
+  })
+}
+
 // 资方授信列表--核心企业查询
 export function getCoreEnterpriseList(params) {
   return request({

+ 48 - 3
src/views/capitalFinancingManage/billRecords/index.vue

@@ -3,7 +3,9 @@
     <router-view />
     <template v-if="!$route.query.type">
       <div class="search">
-        <div />
+        <div>
+          <el-button v-power="'manuallyBatchDeduction'" type="primary" @click="handleBatchDiscount">手动批量划扣</el-button>
+        </div>
         <div class="right">
           <div>
             <el-input v-model="search.keyword" style="width: 210px;" placeholder="请输入借据编号/贷款编号" clearable></el-input>
@@ -41,13 +43,28 @@
         :table-options="tableOptions"
       />
     </template>
+    <cy-dialog ref="discountDialogRef" title="手动批量划扣" width="360px">
+      <el-form v-model="dialogForm">
+        <el-form-item label="请选择划扣时间">
+          <el-date-picker
+            type="date"
+            value-format="yyyy-MM-dd"
+            v-model="dialogForm.date"
+          />
+        </el-form-item>
+      </el-form>
+      <template slot="footer">
+        <el-button type="primary" :loading="confirmLoading" @click="confirmBatch">确定</el-button>
+        <el-button type="normal" @click="$refs.discountDialogRef.show = false">关闭</el-button>
+      </template>
+    </cy-dialog>
   </div>
 </template>
 
 <script>
 import { mapGetters } from 'vuex'
 import { formatMoney } from '@/utils/index'
-import { getCapitalAccountRecord } from '@/api/capitalFinancialManage/index'
+import { getCapitalAccountRecord, execBatchDiscount } from '@/api/capitalFinancialManage/index'
 
 export default {
   name: 'CapitalAuth',
@@ -173,7 +190,11 @@ export default {
             return <div>{ row.repaymentCompoundInterest ? this.formatMoney(row.repaymentCompoundInterest) : '' }</div>
           }
         }
-      ]
+      ],
+      confirmLoading: false,
+      dialogForm: {
+        date: ''
+      }
     }
   },
   computed: {
@@ -190,6 +211,30 @@ export default {
     this.fetchData()
   },
   methods: {
+    // 手动批量划扣点击
+    handleBatchDiscount() {
+      this.$refs.discountDialogRef.show = true
+    },
+    async confirmBatch() {
+      if (this.dialogForm.date === '') {
+        this.$message.warning('请选择划扣时间')
+        return
+      }
+
+      try {
+        this.confirmLoading = true
+        const res = await execBatchDiscount(this.dialogForm.date)
+
+        if (res.success) {
+          this.confirmLoading = false
+          this.$message.success('操作成功')
+          this.$router.go(0)
+        }
+      } catch (e) {
+        console.log(e)
+        this.confirmLoading = false
+      }
+    },
     async fetchData(type) {
       if (type === 'search') {
         this.page = 1