|
|
@@ -79,6 +79,22 @@
|
|
|
prop="creditLimit"
|
|
|
label="授信额度">
|
|
|
</el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="debtAmount"
|
|
|
+ width="130">
|
|
|
+ <template slot="header">
|
|
|
+ 当前总欠款
|
|
|
+ <Tip msg="授信支付未还总额"></Tip>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="debtNums"
|
|
|
+ width="130">
|
|
|
+ <template slot="header">
|
|
|
+ 当前总欠款单数
|
|
|
+ <Tip msg="授信支付未还总数"></Tip>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
prop="remark"
|
|
|
label="备注">
|
|
|
@@ -87,49 +103,57 @@
|
|
|
width="350px"
|
|
|
label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-link
|
|
|
- type="primary"
|
|
|
- v-if="hasPermission('team-money-manage')"
|
|
|
- @click="openRechargeDialog(scope.row)"
|
|
|
- >
|
|
|
- 充值
|
|
|
- </el-link>
|
|
|
+ <div v-if="hasPermission('team-money-manage')">
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ @click="openRechargeDialog(scope.row)"
|
|
|
+ >
|
|
|
+ 充值
|
|
|
+ </el-link>
|
|
|
+
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ @click="openDeductDialog(scope.row)"
|
|
|
+ >
|
|
|
+ 扣款
|
|
|
+ </el-link>
|
|
|
|
|
|
- <el-link
|
|
|
- type="primary"
|
|
|
- v-if="hasPermission('team-money-manage')"
|
|
|
- @click="openDeductDialog(scope.row)"
|
|
|
- >
|
|
|
- 扣款
|
|
|
- </el-link>
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ @click="openRepaymentDialog(scope.row)"
|
|
|
+ >
|
|
|
+ 还款
|
|
|
+ </el-link>
|
|
|
|
|
|
- <el-link
|
|
|
- type="primary"
|
|
|
- v-if="hasPermission('team-money-manage')"
|
|
|
- @click="openAdjustDialog(scope.row)"
|
|
|
- >
|
|
|
- 调整授信额度
|
|
|
- </el-link>
|
|
|
- <el-link
|
|
|
- type="primary"
|
|
|
- @click="gotoRecord(scope.row)"
|
|
|
- >
|
|
|
- 账户记录
|
|
|
- </el-link>
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ @click="openAdjustDialog(scope.row)"
|
|
|
+ >
|
|
|
+ 调整授信额度
|
|
|
+ </el-link>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ @click="gotoRecord(scope.row)"
|
|
|
+ >
|
|
|
+ 账户记录
|
|
|
+ </el-link>
|
|
|
|
|
|
- <el-link
|
|
|
- type="primary"
|
|
|
- @click="openEditDialog(scope.row)"
|
|
|
- >
|
|
|
- 编辑
|
|
|
- </el-link>
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ @click="openEditDialog(scope.row)"
|
|
|
+ >
|
|
|
+ 编辑
|
|
|
+ </el-link>
|
|
|
|
|
|
- <el-link
|
|
|
- type="primary"
|
|
|
- @click="deleteGroup(scope.row)"
|
|
|
- >
|
|
|
- 删除
|
|
|
- </el-link>
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ @click="deleteGroup(scope.row)"
|
|
|
+ >
|
|
|
+ 删除
|
|
|
+ </el-link>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -296,11 +320,144 @@
|
|
|
<el-button type="primary" @click="confirmAdjust">确定</el-button>
|
|
|
</div>
|
|
|
</ElDialog>
|
|
|
+
|
|
|
+ <!-- 还款弹框 -->
|
|
|
+ <ElDialog
|
|
|
+ title="还款"
|
|
|
+ width="1300px"
|
|
|
+ v-model="repaymentDialogVisible"
|
|
|
+ @close="handleRepaymentClose"
|
|
|
+ >
|
|
|
+ <div class="dialog-body-scroll">
|
|
|
+ <div class="transfer-container">
|
|
|
+ <div class="transfer-left">
|
|
|
+ <div class="transfer-header">
|
|
|
+ 欠款记录
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ :disabled="!leftCheckedList.length"
|
|
|
+ @click="addToSelected"
|
|
|
+ style="float: right;"
|
|
|
+ >
|
|
|
+ 添加至已选 >>
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <el-table
|
|
|
+ border
|
|
|
+ ref="debtTableRef"
|
|
|
+ :data="debtList"
|
|
|
+ v-loading="debtLoading"
|
|
|
+ @selection-change="onDebtSelectionChange"
|
|
|
+ size="small"
|
|
|
+ >
|
|
|
+ <el-table-column type="selection" width="40" />
|
|
|
+ <el-table-column prop="createTime" label="创建时间" width="140" />
|
|
|
+ <el-table-column prop="teamName" label="团队名称" width="110" show-overflow-tooltip />
|
|
|
+ <el-table-column label="交易类型" width="120">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ formatTransactionType(scope.row.transactionType) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="amount" label="交易金额" width="100" />
|
|
|
+ <el-table-column prop="remainingDebt" label="剩余欠款" width="100" />
|
|
|
+ <el-table-column prop="balanceBefore" label="交易前余额" width="100" />
|
|
|
+ <el-table-column prop="balanceAfter" label="交易后余额" width="100" />
|
|
|
+ <el-table-column prop="debtAmountBefore" label="欠款调整前" width="100" />
|
|
|
+ <el-table-column prop="debtAmountAfter" label="欠款调整后" width="100" />
|
|
|
+ <el-table-column prop="creditLimitBefore" label="额度调整前" width="100" />
|
|
|
+ <el-table-column prop="creditLimitAfter" label="额度调整后" width="100" />
|
|
|
+ <el-table-column prop="ticketCheckNum" label="票总人数" width="80" />
|
|
|
+ <el-table-column prop="price" label="订单总额" width="100" />
|
|
|
+ <el-table-column prop="ticketCancelCheckNum" label="退票人数" width="80" />
|
|
|
+ <el-table-column prop="cancelPrice" label="退票总额" width="100" />
|
|
|
+ <el-table-column prop="operatorName" label="操作员" width="90" />
|
|
|
+ <el-table-column prop="operateTime" label="操作时间" width="140" />
|
|
|
+ <el-table-column prop="linkOrderId" label="关联订单" width="80" />
|
|
|
+ <el-table-column prop="remark" label="备注" min-width="120" show-overflow-tooltip />
|
|
|
+ </el-table>
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ small
|
|
|
+ layout="total, prev, pager, next"
|
|
|
+ :current-page="debtPageNum"
|
|
|
+ :page-size="debtPageSize"
|
|
|
+ @current-change="handleDebtPageChange"
|
|
|
+ :total="debtTotal"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="transfer-right">
|
|
|
+ <div class="transfer-header">
|
|
|
+ 已选记录
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ :disabled="!rightSelectedList.length"
|
|
|
+ @click="clearSelected"
|
|
|
+ style="float: right;"
|
|
|
+ >
|
|
|
+ 清除已选
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <el-table
|
|
|
+ border
|
|
|
+ :data="rightSelectedList"
|
|
|
+ size="small"
|
|
|
+ >
|
|
|
+ <el-table-column type="index" label="序号" width="50" />
|
|
|
+ <el-table-column prop="createTime" label="创建时间" width="140" />
|
|
|
+ <el-table-column prop="teamName" label="团队名称" width="110" show-overflow-tooltip />
|
|
|
+ <el-table-column label="交易类型" width="120">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ formatTransactionType(scope.row.transactionType) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="amount" label="交易金额" width="100" />
|
|
|
+ <el-table-column prop="remainingDebt" label="剩余欠款" width="100" />
|
|
|
+ <el-table-column prop="balanceBefore" label="交易前余额" width="100" />
|
|
|
+ <el-table-column prop="balanceAfter" label="交易后余额" width="100" />
|
|
|
+ <el-table-column prop="debtAmountBefore" label="欠款调整前" width="100" />
|
|
|
+ <el-table-column prop="debtAmountAfter" label="欠款调整后" width="100" />
|
|
|
+ <el-table-column prop="creditLimitBefore" label="额度调整前" width="100" />
|
|
|
+ <el-table-column prop="creditLimitAfter" label="额度调整后" width="100" />
|
|
|
+ <el-table-column prop="ticketCheckNum" label="票总人数" width="80" />
|
|
|
+ <el-table-column prop="price" label="订单总额" width="100" />
|
|
|
+ <el-table-column prop="ticketCancelCheckNum" label="退票人数" width="80" />
|
|
|
+ <el-table-column prop="cancelPrice" label="退票总额" width="100" />
|
|
|
+ <el-table-column prop="operatorName" label="操作员" width="90" />
|
|
|
+ <el-table-column prop="operateTime" label="操作时间" width="140" />
|
|
|
+ <el-table-column prop="linkOrderId" label="关联订单" width="80" />
|
|
|
+ <el-table-column prop="remark" label="备注" min-width="120" show-overflow-tooltip />
|
|
|
+ <el-table-column label="操作" width="60" fixed="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-link type="danger" @click="removeSelectedItem(scope.row)">移除</el-link>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="transfer-total">
|
|
|
+ 还款总额:<span class="total-amount">¥ {{ totalRepaymentAmount }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-form class="form-wrap" label-width="80px" style="margin-top: 16px;">
|
|
|
+ <el-form-item label="备注">
|
|
|
+ <el-input v-model="repaymentForm.remark" placeholder="请输入还款备注" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div style="margin: 16px 0 0; float: right;">
|
|
|
+ <el-button @click="repaymentDialogVisible = false">取消</el-button>
|
|
|
+ <el-button type="primary" :disabled="!rightSelectedList.length" @click="confirmRepayment">确定还款</el-button>
|
|
|
+ </div>
|
|
|
+ </ElDialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getTeamList, addTeam, updateTeam, deleteTeam, teamRecharge, teamDeduct, teamAdjust } from '@/api/checker'
|
|
|
+import { getTeamList, addTeam, updateTeam, deleteTeam, teamRecharge, teamDeduct, teamAdjust, getDebtList, teamRepayment } from '@/api/checker'
|
|
|
import ElDialog from '@/components/Dialog'
|
|
|
|
|
|
const TeamAccountFlow = () => import('./TeamAccountFlow.vue')
|
|
|
@@ -336,6 +493,18 @@ export default {
|
|
|
teamId: null,
|
|
|
amount: 0,
|
|
|
remark: ''
|
|
|
+ },
|
|
|
+ repaymentDialogVisible: false,
|
|
|
+ debtList: [],
|
|
|
+ debtTotal: 0,
|
|
|
+ debtPageNum: 1,
|
|
|
+ debtPageSize: 10,
|
|
|
+ debtLoading: false,
|
|
|
+ leftCheckedList: [],
|
|
|
+ rightSelectedList: [],
|
|
|
+ repaymentForm: {
|
|
|
+ teamId: null,
|
|
|
+ remark: ''
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -345,6 +514,9 @@ export default {
|
|
|
},
|
|
|
permissionList () {
|
|
|
return this.$store.state.user.menuList || []
|
|
|
+ },
|
|
|
+ totalRepaymentAmount () {
|
|
|
+ return this.rightSelectedList.reduce((sum, item) => sum + (item.remainingDebt || 0), 0)
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
|
@@ -474,10 +646,140 @@ export default {
|
|
|
}).catch(() => {
|
|
|
this.$message.error('导出失败。')
|
|
|
})
|
|
|
+ },
|
|
|
+ openRepaymentDialog (row) {
|
|
|
+ this.repaymentForm = {
|
|
|
+ teamId: row.id,
|
|
|
+ remark: ''
|
|
|
+ }
|
|
|
+ this.rightSelectedList = []
|
|
|
+ this.leftCheckedList = []
|
|
|
+ this.debtPageNum = 1
|
|
|
+ this.debtList = []
|
|
|
+ this.debtTotal = 0
|
|
|
+ this.repaymentDialogVisible = true
|
|
|
+ this.loadDebtList()
|
|
|
+ },
|
|
|
+ loadDebtList () {
|
|
|
+ this.debtLoading = true
|
|
|
+ const params = {
|
|
|
+ id: 0,
|
|
|
+ teamId: this.repaymentForm.teamId,
|
|
|
+ pageNum: this.debtPageNum,
|
|
|
+ pageSize: this.debtPageSize,
|
|
|
+ export: false,
|
|
|
+ exportDetail: false,
|
|
|
+ removeSubtotal: false,
|
|
|
+ remark: ''
|
|
|
+ }
|
|
|
+ getDebtList(params).then(res => {
|
|
|
+ this.debtList = res.data?.records || []
|
|
|
+ this.debtTotal = res.data?.total || 0
|
|
|
+ }).finally(() => {
|
|
|
+ this.debtLoading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleDebtPageChange (num) {
|
|
|
+ this.debtPageNum = num
|
|
|
+ this.loadDebtList()
|
|
|
+ },
|
|
|
+ onDebtSelectionChange (selection) {
|
|
|
+ this.leftCheckedList = selection
|
|
|
+ },
|
|
|
+ formatTransactionType (type) {
|
|
|
+ const map = {
|
|
|
+ 'RECHARGE': '充值',
|
|
|
+ 'DEDUCT': '扣款',
|
|
|
+ 'PREPAY_PAY': '预付款支付',
|
|
|
+ 'PREPAY_REFUND': '预付款退款',
|
|
|
+ 'CREDIT_PAY': '授信支付',
|
|
|
+ 'CREDIT_REFUND': '授信退款',
|
|
|
+ 'REPAYMENT': '还款',
|
|
|
+ 'ADJUST': '调整授信额度'
|
|
|
+ }
|
|
|
+ return map[type] || type || '-'
|
|
|
+ },
|
|
|
+ addToSelected () {
|
|
|
+ const existingIds = this.rightSelectedList.map(item => item.id)
|
|
|
+ const newItems = this.leftCheckedList.filter(item => !existingIds.includes(item.id))
|
|
|
+ this.rightSelectedList = [...this.rightSelectedList, ...newItems]
|
|
|
+ this.$message.success(`已添加 ${newItems.length} 条欠款记录`)
|
|
|
+ this.$refs.debtTableRef && this.$refs.debtTableRef.clearSelection()
|
|
|
+ },
|
|
|
+ removeSelectedItem (row) {
|
|
|
+ this.rightSelectedList = this.rightSelectedList.filter(item => item.id !== row.id)
|
|
|
+ },
|
|
|
+ clearSelected () {
|
|
|
+ this.rightSelectedList = []
|
|
|
+ },
|
|
|
+ handleRepaymentClose () {
|
|
|
+ this.$refs.debtTableRef && this.$refs.debtTableRef.clearSelection()
|
|
|
+ this.leftCheckedList = []
|
|
|
+ },
|
|
|
+ confirmRepayment () {
|
|
|
+ if (!this.rightSelectedList.length) {
|
|
|
+ this.$message.warning('请先选择欠款记录')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const debtList = this.rightSelectedList.map(item => ({
|
|
|
+ flowId: item.id,
|
|
|
+ amount: item.remainingDebt
|
|
|
+ }))
|
|
|
+ const params = {
|
|
|
+ teamId: this.repaymentForm.teamId,
|
|
|
+ amount: this.totalRepaymentAmount,
|
|
|
+ remark: this.repaymentForm.remark,
|
|
|
+ debtList
|
|
|
+ }
|
|
|
+ teamRepayment(params).then(() => {
|
|
|
+ this.$message.success('还款成功')
|
|
|
+ this.repaymentDialogVisible = false
|
|
|
+ this.getList()
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
+.dialog-body-scroll {
|
|
|
+ max-height: 60vh;
|
|
|
+ overflow-y: auto;
|
|
|
+ padding-right: 4px;
|
|
|
+}
|
|
|
+.transfer-container {
|
|
|
+ display: block;
|
|
|
+}
|
|
|
+.transfer-left,
|
|
|
+.transfer-right {
|
|
|
+ border: 1px solid #ebeef5;
|
|
|
+ border-radius: 4px;
|
|
|
+ padding: 12px;
|
|
|
+ margin-bottom: 16px;
|
|
|
+}
|
|
|
+.transfer-right {
|
|
|
+ margin-bottom: 0;
|
|
|
+}
|
|
|
+.transfer-header {
|
|
|
+ font-weight: bold;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ padding-bottom: 8px;
|
|
|
+ border-bottom: 1px solid #ebeef5;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #303133;
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+.transfer-total {
|
|
|
+ margin-top: 12px;
|
|
|
+ text-align: right;
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #303133;
|
|
|
+ padding: 8px 4px;
|
|
|
+ border-top: 1px solid #ebeef5;
|
|
|
+}
|
|
|
+.total-amount {
|
|
|
+ color: #f56c6c;
|
|
|
+ font-size: 18px;
|
|
|
+}
|
|
|
</style>
|