commonLinkManTable.vue
3.39 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
<template>
<div>
<a-card title="联系人信息" :bordered="false">
<a-table ref="table" size="middle" bordered :columns="linkManData" :rowKey="record => record.id" :dataSource="contactsInfoList" :pagination="false" :loading="loading" @change="handleTableChange">
<!-- 字符串超长截取省略号显示-->
<span slot="esContent" slot-scope="text">
<j-ellipsis :value="text" :length="10" />
</span>
</a-table>
</a-card>
</div>
</template>
<script>
import { JeecgListMixin } from '@/mixins/CoreListMixin'
import { deleteCollCusContactInfo } from '@/api/configApi'
export default {
name: 'commonLinkManTable',
mixins: [JeecgListMixin],
props: {
userType: {
type: Number,
default: '',
},
contactsInfoList:{
type:Array,
default:()=>{
return [];
}
},
customerNo:{
type:String,
default:''
}
},
data () {
return {
selectTionRelation:JSON.parse(sessionStorage.getItem('SELECTION_RELATION')), // 联系关系
title:'',
linkManData: [
{
title: '序号',
dataIndex: '',
key: 'rowIndex',
align: 'center',
width: 60,
customRender: function (t, r, index) {
return parseInt(index) + 1
}
},
{
title: '联系人姓名',
align: 'center',
width: '100px',
dataIndex: 'contactsName'
},
{
title: '联系人手机号',
align: 'center',
dataIndex: 'mobilePhoneView'
},
{
title: '联系人地址',
align: 'center',
dataIndex: 'address'
},
{
title: '与联系人关系',
align: 'center',
dataIndex: 'relation',
customRender: (t,r,index) =>{
for(var i=0; i<this.selectTionRelation.length; i++){
if(t === this.selectTionRelation[i].name){
return this.selectTionRelation[i].title
}
}
}
},
],
disableMixinCreated:true,
}
},
created () {
switch(this.userType){
case 1:
this.title = '个人联系人信息'
break;
case 2:
this.title = '企业联系人信息'
break;
case 3:
this.title = '企业法人联系人信息'
break;
}
},
methods: {
handleAddModal (title) {
this.$refs.personLinkManModal.add(this.customerNo)
this.$refs.personLinkManModal.title = title ? title : '新增'
this.$refs.personLinkManModal.disableSubmit = false
},
handleAddModalEdit(title,record){
this.$refs.personLinkManModal.edit(record)
this.$refs.personLinkManModal.title = title ? title : '修改'
this.$refs.personLinkManModal.disableSubmit = false
},
handleDelete(record){
console.log(record)
let _p = {'id':record.id}
deleteCollCusContactInfo(_p).then(res=>{
if (res.status.statusCode == 0) {
this.$emit('editReload');
this.$message.success(res.status.statusReason)
} else {
this.$message.warning(res.status.statusReason)
}
})
},
personLinkManModalOk () {
this.$emit('editReload');
},
companyLinkManModalOk () {
this.$emit('editReload');
},
childMethod() {
}
}
}
</script>
<style>
</style>