commonBankAccountTable.vue
4.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<template>
<div>
<a-card :title="title" :bordered="false">
<!-- <a-button v-if="!disableSubmit" style="margin-bottom:10px;float:right;position:relative;z-index:10;" @click="handleAddModal(titleModal)" type="primary" icon="plus">增加银行卡</a-button> -->
<div>
<a-table
ref="table"
size="middle"
bordered
:columns="bankData"
:dataSource="collCusBankAccountList"
:pagination="false"
:loading="loading"
:rowKey="(record, index) => index"
@change="handleTableChange"
>
<!-- 字符串超长截取省略号显示-->
<span slot="esContent" slot-scope="text">
<j-ellipsis :value="text" :length="10" />
</span>
<span v-if="!disableSubmit" slot="action" slot-scope="text, record">
<a-button
type="link"
size="small"
@click="handleAddModalEdit(title, record)"
icon="edit"
style="font-size: 12px"
>
修改</a-button
>
<!-- <a-divider type="vertical" /> -->
<!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record)">
<a>删除</a>
</a-popconfirm> -->
</span>
</a-table>
</div>
</a-card>
<common-bank-account-modal
ref="commonBankAccountModal"
@commonBankAccountModalOk="commonBankAccountModalOk"
></common-bank-account-modal>
</div>
</template>
<script>
import { JeecgListMixin } from '@/mixins/CoreListMixin'
import commonBankAccountModal from './commonBankAccountModal'
import { deleteCusBankAccount } from '@/api/configApi'
export default {
name: 'commonBankAccountTable',
mixins: [JeecgListMixin],
components: {
commonBankAccountModal, // 联系人信息
},
props: {
userType: {
type: Number,
default: '',
},
collCusBankAccountList: {
type: Array,
default: () => {
return []
},
},
customerNo: {
type: String,
default: '',
},
disableSubmit: {
type: Boolean,
default: false,
},
},
data() {
return {
title: '',
titleModal: '',
bankData: [
{
title: '序号',
dataIndex: '',
key: 'rowIndex',
align: 'center',
width: 60,
customRender: function (t, r, index) {
return parseInt(index) + 1
},
},
{
title: '开户行名称',
align: 'center',
width: '100px',
dataIndex: 'bankName',
},
{
title: '账户名',
align: 'center',
dataIndex: 'bankCardName',
},
{
title: '银行卡号',
align: 'center',
dataIndex: 'bankCardNoView',
},
{
title: '银行预留手机号',
align: 'center',
dataIndex: 'bankCardPhoneView',
},
// {
// title: '银行卡类别',
// align: 'center',
// dataIndex: 'bankCardType',
// customRender: function (t, r, index) {
// return t == 1 ? '借记卡' : ''
// }
// },
{
title: '操作',
dataIndex: 'action',
scopedSlots: { customRender: 'action' },
align: 'center',
width: 120,
fixed: 'right',
},
],
disableMixinCreated: true,
}
},
created() {
console.log(this.userType)
switch (this.userType) {
case 1:
this.titleModal = '个人银行账户信息'
this.title = '个人银行账户信息'
break
case 2:
this.titleModal = '企业银行账户信息'
this.title = '法定代表人银行账户信息'
break
case 3:
this.titleModal = '企业法人银行账户信息'
this.title = '法定代表人银行账户信息'
break
}
},
methods: {
handleAddModal(title) {
this.$refs.commonBankAccountModal.add(this.customerNo)
this.$refs.commonBankAccountModal.title = title ? title : '新增'
this.$refs.commonBankAccountModal.disableSubmit = false
},
handleAddModalEdit(title, record) {
// console.log('1111111111',record)
this.$refs.commonBankAccountModal.edit(record)
this.$refs.commonBankAccountModal.title = title ? title : '修改'
this.$refs.commonBankAccountModal.disableSubmit = false
},
handleDelete(record) {
console.log(record)
let _p = { id: record.id }
deleteCusBankAccount(_p).then((res) => {
if (res.status.statusCode == 0) {
this.$emit('editReload')
this.$message.success(res.status.statusReason)
} else {
this.$message.warning(res.status.statusReason)
}
})
},
commonBankAccountModalOk() {
this.$emit('editReload')
},
},
}
</script>
<style>
</style>