companyShareholderTable.vue
3.62 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
<template>
<div>
<a-card title="企业股东信息" :bordered="false">
<a-button v-if="!disableSubmit" style="margin-bottom:10px;float:right;position:relative;z-index:10;" @click="handleAddModal('企业股东信息')" type="primary" icon="plus">增加企业股东信息</a-button>
<a-table ref="table" size="middle" bordered :columns="shareholderInfoData" :dataSource="stockholders" :pagination="false" :loading="loading" :rowKey="record => record.id" @change="handleTableChange">
<span v-if="!disableSubmit" slot="action" slot-scope="text, record">
<a @click="handleEditModal('企业股东信息',record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record)">
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
</a-card>
<company-shareholder-modal ref="companyShareholderModal" @ok="companyShareholderModalOk"></company-shareholder-modal>
</div>
</template>
<script>
import { JeecgListMixin } from '@/mixins/CoreListMixin'
import companyShareholderModal from './companyShareholderModal'
import { deleteCusEnterpriseStockholder } from '@/api/configApi'
export default {
name: 'companyShareholderTable',
mixins: [JeecgListMixin],
props: {
userType: {
type: Number,
default: '',
},
stockholders: {
type: Array,
default: () => {
return [];
}
},
customerNo: {
type: String,
default: ''
},
disableSubmit: {
type: Boolean,
default: false
}
},
components: {
companyShareholderModal,
},
data () {
return {
shareholderInfoData: [
{
title: '序号',
dataIndex: '',
key: 'rowIndex',
align: 'center',
width: 60,
customRender: function (t, r, index) {
return parseInt(index) + 1
}
},
{
title: '股东名称',
align: 'center',
width: '100px',
dataIndex: 'stockholderName'
},
{
title: '持股比例',
align: 'center',
dataIndex: 'shareholdingRatio'
},
{
title: '认缴出资额(万元)',
align: 'center',
dataIndex: 'capitalContributions'
},
{
title: '认缴日期',
align: 'center',
dataIndex: 'subscriptionDate'
},
{
title: '操作',
dataIndex: 'action',
scopedSlots: { customRender: 'action' },
align: 'center',
width: 120,
fixed: 'right'
}
],
disableMixinCreated: true,
}
},
methods: {
handleAddModal (title) {
this.$refs.companyShareholderModal.add(this.customerNo)
this.$refs.companyShareholderModal.title = title ? title : '新增'
this.$refs.companyShareholderModal.disableSubmit = false
},
handleEditModal (title, record) {
this.$refs.companyShareholderModal.edit(record)
this.$refs.companyShareholderModal.title = title ? title : '修改'
this.$refs.companyShareholderModal.disableSubmit = false
},
companyShareholderModalOk () {
this.$emit('editReload');
},
handleDelete (record) {
console.log(record)
let _p = { 'id': record.id }
deleteCusEnterpriseStockholder(_p).then(res => {
if (res.status.statusCode == 0) {
this.$emit('editReload');
this.$message.success(res.status.statusReason)
} else {
this.$message.warning(res.status.statusReason)
}
})
},
}
}
</script>
<style>
</style>