personalInfo.vue
5.86 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
<!-- 个人信息 -->
<template>
<d2-container class="personalInfo">
<div class="d2-container-content">
<p class="title">
个人信息
</p>
<el-form>
<template v-for="(item, index) in (formData.userType == 2 ? userformList : formList)">
<el-form-item
:key="index"
:label="item.label"
label-width="120px"
v-show="!item.hasOwnProperty('isDisabled') || formData[item.isDisabled]">
<template v-if="item.type === 'photo'">
<img
class="info-img"
v-for="(subItem, subIndex) in formData[item.name]"
:key="subIndex"
:src="subItem.fileUrl">
</template>
<template v-else-if="Array.isArray(formData[item.name])">
<el-tag
class="tag"
type="warning"
v-for="(subItem, subIndex) in formData[item.name]"
:key="subIndex">
{{ item.attrName ? subItem.brandName : subItem }}
</el-tag>
</template>
<span v-else-if="item.formatter">{{ item.formatter(formData) }}</span>
<span v-else-if="item.parentName">{{ formData[item.parentName][item.name] }}</span>
<span v-else>{{ formData[item.name] }}</span>
</el-form-item>
</template>
<el-form-item v-if="formData.userType != 2">
<a
class="info-link"
href="http://dj.glsx.com.cn/web-dj-site/#/system/personallnfo"
target="_blank">修改个人信息请到嘀加平台,点击快速修改</a>
</el-form-item>
<el-form-item v-if="formData.userType != 2">
<a
class="info-link"
href="https://sso.glsx.com.cn/#/login"
target="_blank">修改账户权限请到运营平台,点击快速修改</a>
</el-form-item>
</el-form>
</div>
</d2-container>
</template>
<script>
import { getUserInfo } from '@api/personalInfo'
export default {
name: 'PersonalInfo',
data() {
return {
formData: {},
formList: [{
name: 'loginAccout',
label: '登录账户'
}, {
name: 'merchantLegalPersonPhone',
label: '登录手机号'
}, {
name: 'merchantNo',
label: '商户号'
}, {
name: 'merchantName',
label: '商户全称'
}, {
name: 'merchantAbbreviation',
label: '商户简称'
}, {
name: 'accountTypeNames',
label: '商户分类'
}, {
name: 'merchantAddress',
label: '商户地址'
}, {
name: 'merchantLegalPersonPhone',
label: '商户电话'
}, {
name: 'businessHours',
label: '营业时间'
}, {
name: 'merchantFileResponses',
label: '门店照片',
type: 'photo'
}, {
name: 'merchantBrandName',
label: '主营品牌'
// attrName: 'brandName'
}, {
name: 'mainBusiness',
label: '营业范围'
}
// , {
// parentName: 'role',
// name: 'name',
// label: '角色权限'
// }
],
userformList: [{
name: 'loginAccout',
label: '登录账户'
}, {
name: 'staffPhone',
label: '登录手机号'
}, {
name: 'userName',
label: '姓名/名称'
}, {
name: 'merchantName',
label: '所属商户'
}
// {
// parentName: 'role',
// name: 'name',
// label: '角色权限'
// }, {
// name: 'isOpenCard',
// label: '名片',
// formatter: (cellValue) => {
// return cellValue.isOpenCard ? '开通' : '未开通'
// }
// }, {
// name: 'duty',
// isDisabled: 'isOpenCard',
// label: '职务'
// }, {
// name: 'photoHead',
// label: '头像',
// isDisabled: 'isOpenCard',
// type: 'photo'
// }, {
// name: 'staffPhone',
// label: '电话',
// isDisabled: 'isOpenCard'
// }, {
// name: 'wechatNum',
// label: '微信',
// isDisabled: 'isOpenCard'
// }, {
// name: 'userLabelListArr',
// label: '标签',
// isDisabled: 'isOpenCard'
// }
]
}
},
mounted() {
getUserInfo({}).then(res => {
res.beSuper = res.loginAccount.isAdmin == 1
res.detail = res.merchant
Object.keys(res.loginAccount).forEach(item => {
if (res.loginAccount[item] && !res.detail[item]) {
res.detail[item] = res.loginAccount[item]
}
})
this.formData = res.detail
if (this.formData.userType != 2) {
this.formData.businessHours = this.formData.bussinessBegintime + '-' + this.formData.bussinessEndtime
this.formData.mainBusiness = this.formData.businessScopeCustomize ? (this.formData.businessScopName ? (this.formData.businessScopName + ',' + this.formData.businessScopeCustomize) : this.formData.businessScopeCustomize) : this.formData.businessScopName
} else {
this.formData.staffPhone = res.staff.staffPhone
this.formData.photoHead = [{ mediaUrl: this.formData.photo }]
// this.formData.userLabelListArr = this.formData.userLabelList.map(item => item.labelName)
}
})
},
methods: {}
}
</script>
<style>
.personalInfo .d2-container-content {
margin-top: 0 !important;
}
.personalInfo .title {
font-size: 22px;
color: #666666;
letter-spacing: 1.38px;
}
.personalInfo .info-img {
width: 120px;
height: 120px;
margin-right: 5px;
}
.personalInfo .tag {
margin-right: 10px;
color: #333333;
/* width: 20px;
height: 20px;
font-size: 14px;
color: #333333;
background: #fff8ef;
border: 1px solid #ffdfb8;
border-radius: 6px; */
}
.personalInfo .info-link {
color: #003a00;
cursor: pointer;
}
</style>