|
@@ -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
|