danbaoren.vue
6.27 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<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="newTable"
:pagination="false"
:loading="loading"
:rowKey="(record, index) => index"
@change="handleTableChange"
>
<!-- 字符串超长截取省略号显示-->
<span slot="esContent" slot-scope="text">
<j-ellipsis :value="text" :length="10" />
</span>
<span slot="actionOpen" slot-scope="text, record">
<a-switch size="small" :disabled="disableSubmit" :checked="record.status == 1 ? true : false" @change="onChange(record)" />
</span>
<span v-if="typeBtn == 'edit'" 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-button
type="link"
size="small"
icon="delete"
style="font-size: 12px"
>删除</a-button
>
</a-popconfirm>
</span>
</a-table>
</div>
</a-card>
<DanbaorenModal
ref="commonBankAccountModal"
:typeBtn.sync="typeBtn"
@commonBankAccountModalOk="commonBankAccountModalOk"
@ok="commonBankAccountModalOk"
>
</DanbaorenModal>
</div>
</template>
<script>
import { JeecgListMixin } from '@/mixins/CoreListMixin'
import { delGuaranteeInfoFollow, setGuaranteeInfoFollwStatus,queryGuarantorInfoByName } from '@/api/configApi'
import DanbaorenModal from './danbaorenModal.vue'
export default {
name: 'Danbaoren',
mixins: [JeecgListMixin],
components: {
DanbaorenModal,
},
props: {
model2: {
type: Array,
default: () => {
return []
},
},
modelList:{
default: () => {
return []
},
},
disableSubmit: {
type: Boolean,
default: false,
},
typeBtn: {
type: String,
},
},
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: 'guaranteeManType',
customRender: (t, r, index) => {
if (t == 1) {
return '个人'
} else if (t == 2) {
return '企业'
}
},
},
{
title: '担保人名称',
align: 'center',
width: '100px',
dataIndex: 'guaranteeManName',
},
{
title: '担保人证件号',
align: 'center',
dataIndex: 'guaranteeIdCardNo',
},
{
title: '担保签约日期',
align: 'center',
dataIndex: 'guaranteeTimeContract',
},
{
title: '联系人手机号',
align: 'center',
dataIndex: 'guaranteeMobilePhone',
},
{
title: '本次担保金额(元)',
align: 'center',
dataIndex: 'guaranteeAmount',
customRender: (t, r, index) => {
return this.$numMoney(t)
},
},
{
title: '备注',
align: 'center',
dataIndex: 'remark',
},
{
title: '状态',
align: 'center',
dataIndex: '',
scopedSlots: { customRender: 'actionOpen' },
},
{
title: '操作',
dataIndex: 'action',
scopedSlots: { customRender: 'action' },
align: 'center',
width: 180,
fixed: 'right',
},
],
disableMixinCreated: true,
newTable: [],
}
},
created() {},
mounted() {
this.newTable = []
this.newTable = this.model2
// ref绑定自定义事件
this.$refs.commonBankAccountModal.$on('tableList', this.getTableList)
},
methods: {
handleAddModal(title) {
this.$emit('handleSubmit2')
this.$refs.commonBankAccountModal.updateBtn = 'add'
this.$refs.commonBankAccountModal.modelList = this.modelList
this.$refs.commonBankAccountModal.guaranteeFileIdentifyingCode = []
},
getTableList(res) {
this.newTable.push(res)
},
add(res) {
console.log(res)
this.$refs.commonBankAccountModal.add(this.applyNo)
this.$refs.commonBankAccountModal.title = '新增'
this.$refs.commonBankAccountModal.disableSubmit = false
this.$emit('success')
},
handleAddModalEdit(title, record) {
this.$refs.commonBankAccountModal.edit(record)
this.$refs.commonBankAccountModal.title = '修改'
this.$refs.commonBankAccountModal.modelList = this.modelList
this.$refs.commonBankAccountModal.disableSubmit = false
this.$emit('success')
this.$refs.commonBankAccountModal.updateBtn = 'edit'
},
handleDelete(record) {
console.log(record)
let _p = { id: record.id }
delGuaranteeInfoFollow(_p).then((res) => {
if (res.status.statusCode == 0) {
this.$emit('load')
this.$message.success(res.status.statusReason)
} else {
this.$message.warning(res.status.statusReason)
}
})
},
commonBankAccountModalOk() {
this.$emit('load')
},
onChange: function (v) {
let _p = {
id: v.id,
status: v.status == 1 ? 2 : 1,
}
setGuaranteeInfoFollwStatus(_p).then((res) => {
this.$emit('load')
})
},
},
}
</script>
<style>
</style>