|
|
@@ -1,127 +1,702 @@
|
|
1
|
1
|
<template>
|
|
2
|
2
|
<view class="container">
|
|
3
|
3
|
<view class="example">
|
|
4
|
|
- <uni-forms ref="form" :model="user" labelWidth="80px">
|
|
5
|
|
- <uni-forms-item label="用户昵称" name="nickName">
|
|
6
|
|
- <uni-easyinput v-model="user.nickName" placeholder="请输入昵称" />
|
|
7
|
|
- </uni-forms-item>
|
|
8
|
|
- <uni-forms-item label="手机号码" name="phonenumber">
|
|
9
|
|
- <uni-easyinput v-model="user.phonenumber" placeholder="请输入手机号码" />
|
|
10
|
|
- </uni-forms-item>
|
|
11
|
|
- <uni-forms-item label="邮箱" name="email">
|
|
12
|
|
- <uni-easyinput v-model="user.email" placeholder="请输入邮箱" />
|
|
13
|
|
- </uni-forms-item>
|
|
14
|
|
- <uni-forms-item label="性别" name="sex" required>
|
|
15
|
|
- <uni-data-checkbox v-model="user.sex" :localdata="sexs" />
|
|
16
|
|
- </uni-forms-item>
|
|
|
4
|
+ <uni-forms ref="form" :model="user" :labelWidth="'80px'" style="margin-bottom: 80px;">
|
|
|
5
|
+
|
|
|
6
|
+ <!-- 基本身份信息 -->
|
|
|
7
|
+ <uni-collapse class="collapse" :accordion="false" :value="['basicInfo']">
|
|
|
8
|
+ <uni-collapse-item class="collapse-item" title="基本身份信息" name="basicInfo" :show-animation="true">
|
|
|
9
|
+ <uni-forms-item label="用户昵称" name="nickName" required>
|
|
|
10
|
+ <uni-easyinput v-model="user.nickName" placeholder="请输入昵称" />
|
|
|
11
|
+ </uni-forms-item>
|
|
|
12
|
+ <uni-forms-item label="归属部门" name="deptId" required>
|
|
|
13
|
+ <uni-data-picker v-model="user.deptId" :localdata="deptOptions" popup-title="请选择归属部门" />
|
|
|
14
|
+ </uni-forms-item>
|
|
|
15
|
+ <uni-forms-item label="手机号码" name="phonenumber">
|
|
|
16
|
+ <uni-easyinput v-model="user.phonenumber" placeholder="请输入手机号码" />
|
|
|
17
|
+ </uni-forms-item>
|
|
|
18
|
+ <uni-forms-item label="邮箱" name="email">
|
|
|
19
|
+ <uni-easyinput v-model="user.email" placeholder="请输入邮箱" />
|
|
|
20
|
+ </uni-forms-item>
|
|
|
21
|
+ <uni-forms-item label="身份证号" name="cardNumber">
|
|
|
22
|
+ <uni-easyinput v-model="user.cardNumber" placeholder="请输入身份证号" />
|
|
|
23
|
+ </uni-forms-item>
|
|
|
24
|
+ <uni-forms-item label="用户性别" name="sex" required>
|
|
|
25
|
+ <uni-data-picker v-model="user.sex" :localdata="sys_user_sex" popup-title="请选择性别" />
|
|
|
26
|
+ </uni-forms-item>
|
|
|
27
|
+ <uni-forms-item label="生肖" name="zodiac">
|
|
|
28
|
+ <uni-data-picker v-model="user.zodiac" :localdata="sys_user_zodiac" popup-title="请选择生肖" />
|
|
|
29
|
+ </uni-forms-item>
|
|
|
30
|
+ <uni-forms-item label="星座" name="constellation">
|
|
|
31
|
+ <uni-data-picker v-model="user.constellation" :localdata="sys_user_constellation" popup-title="请选择星座" />
|
|
|
32
|
+ </uni-forms-item>
|
|
|
33
|
+ <uni-forms-item label="血型" name="blooGroup">
|
|
|
34
|
+ <uni-data-picker v-model="user.blooGroup" :localdata="sys_user_blood_group" popup-title="请选择血型" />
|
|
|
35
|
+ </uni-forms-item>
|
|
|
36
|
+ </uni-collapse-item>
|
|
|
37
|
+ </uni-collapse>
|
|
|
38
|
+
|
|
|
39
|
+ <!-- 状态管理信息 -->
|
|
|
40
|
+ <uni-collapse class="collapse" :accordion="false" :value="['status']">
|
|
|
41
|
+ <uni-collapse-item class="collapse-item" title="状态管理信息" name="status" :show-animation="true">
|
|
|
42
|
+
|
|
|
43
|
+ <uni-forms-item label="培训合规状态" name="trainingComplianceStatus">
|
|
|
44
|
+ <uni-data-checkbox v-model="user.trainingComplianceStatus" :localdata="yesNoOptions" />
|
|
|
45
|
+ </uni-forms-item>
|
|
|
46
|
+ </uni-collapse-item>
|
|
|
47
|
+ </uni-collapse>
|
|
|
48
|
+
|
|
|
49
|
+ <!-- 资质能力信息 -->
|
|
|
50
|
+ <uni-collapse class="collapse" :accordion="false" :value="['qualification']">
|
|
|
51
|
+ <uni-collapse-item class="collapse-item" title="资质能力信息" name="qualification" :show-animation="true">
|
|
|
52
|
+ <uni-forms-item label="资质等级" name="qualificationLevel" :required="isSecurityRole">
|
|
|
53
|
+ <uni-data-picker v-model="user.qualificationLevel" :localdata="sys_user_qualification_level"
|
|
|
54
|
+ popup-title="请选择资质等级" @change="handleQualificationLevelChange" />
|
|
|
55
|
+ </uni-forms-item>
|
|
|
56
|
+ <uni-forms-item label="岗位类型" name="postIds" :required="isSecurityRole">
|
|
|
57
|
+ <zxz-uni-data-select v-model="user.postIds" :localdata="postTreeData" multiple placeholder="请选择岗位类型" />
|
|
|
58
|
+ </uni-forms-item>
|
|
|
59
|
+ <uni-forms-item label="是否通过政审" name="politicalReviewSituation">
|
|
|
60
|
+ <uni-data-checkbox v-model="user.politicalReviewSituation" :localdata="yesNoOptions" />
|
|
|
61
|
+ </uni-forms-item>
|
|
|
62
|
+ <uni-forms-item label="政治面貌" name="politicalStatus">
|
|
|
63
|
+ <uni-data-picker v-model="user.politicalStatus" :localdata="sys_user_political_status"
|
|
|
64
|
+ popup-title="请选择政治面貌" />
|
|
|
65
|
+ </uni-forms-item>
|
|
|
66
|
+ <uni-forms-item label="学历" name="schooling">
|
|
|
67
|
+ <uni-data-picker v-model="user.schooling" :localdata="sys_user_schooling" popup-title="请选择学历" />
|
|
|
68
|
+ </uni-forms-item>
|
|
|
69
|
+ <uni-forms-item label="行政处罚情况" name="administrativeStatus">
|
|
|
70
|
+ <uni-easyinput v-model="user.administrativeStatus" type="textarea" placeholder="请输入行政处罚情况" />
|
|
|
71
|
+ </uni-forms-item>
|
|
|
72
|
+ <uni-forms-item label="健康异常情况" name="physicalHealthStatus">
|
|
|
73
|
+ <uni-easyinput v-model="user.physicalHealthStatus" type="textarea" placeholder="请输入健康异常情况" />
|
|
|
74
|
+ </uni-forms-item>
|
|
|
75
|
+ </uni-collapse-item>
|
|
|
76
|
+ </uni-collapse>
|
|
|
77
|
+
|
|
|
78
|
+ <!-- 工作履历/经验 -->
|
|
|
79
|
+ <uni-collapse class="collapse" :accordion="false" :value="['experience']">
|
|
|
80
|
+ <uni-collapse-item class="collapse-item" title="工作履历/经验" name="experience" :show-animation="true">
|
|
|
81
|
+ <uni-forms-item label="开始工作时间" name="startWorkingDate">
|
|
|
82
|
+ <uni-datetime-picker v-model="user.startWorkingDate" type="date" placeholder="请选择开始工作时间" />
|
|
|
83
|
+ </uni-forms-item>
|
|
|
84
|
+ <uni-forms-item label="开始安检工作时间" name="securityCheckStartDate">
|
|
|
85
|
+ <uni-datetime-picker v-model="user.securityCheckStartDate" type="date" placeholder="请选择开始安检工作时间" />
|
|
|
86
|
+ </uni-forms-item>
|
|
|
87
|
+ <uni-forms-item label="曾在安检工作中担任的最高职务" name="securityInspectionPosition">
|
|
|
88
|
+ <uni-data-picker v-model="user.securityInspectionPosition" :localdata="securityPositionOptions"
|
|
|
89
|
+ popup-title="请选择最高职务" />
|
|
|
90
|
+ </uni-forms-item>
|
|
|
91
|
+ <uni-forms-item label="接受奖励次数" name="workRewardsNumber">
|
|
|
92
|
+ <uni-easyinput v-model="user.workRewardsNumber" type="number" placeholder="请输入接受奖励次数" />
|
|
|
93
|
+ </uni-forms-item>
|
|
|
94
|
+ <uni-forms-item label="接受处罚次数" name="workPenaltiesNumber">
|
|
|
95
|
+ <uni-easyinput v-model="user.workPenaltiesNumber" type="number" placeholder="请输入接受处罚次数" />
|
|
|
96
|
+ </uni-forms-item>
|
|
|
97
|
+ </uni-collapse-item>
|
|
|
98
|
+ </uni-collapse>
|
|
|
99
|
+
|
|
|
100
|
+ <!-- 评价类指标 -->
|
|
|
101
|
+ <uni-collapse class="collapse" :accordion="false" :value="['evaluation']">
|
|
|
102
|
+ <uni-collapse-item class="collapse-item" title="评价类指标" name="evaluation" :show-animation="true">
|
|
|
103
|
+ <uni-forms-item label="性格特征" name="characterCharacteristics">
|
|
|
104
|
+ <uni-data-picker v-model="user.characterCharacteristics" :localdata="sys_user_character_characteristics"
|
|
|
105
|
+ popup-title="请选择性格特征" />
|
|
|
106
|
+ </uni-forms-item>
|
|
|
107
|
+ <uni-forms-item label="工作风格" name="workingStyle">
|
|
|
108
|
+ <uni-data-picker v-model="user.workingStyle" :localdata="sys_user_working_style" popup-title="请选择工作风格" />
|
|
|
109
|
+ </uni-forms-item>
|
|
|
110
|
+ <uni-forms-item label="团队配合人员" name="teamCooperation">
|
|
|
111
|
+ <zxz-uni-data-select v-model="user.teamCooperation" :localdata="teamCooperationOptions" multiple
|
|
|
112
|
+ placeholder="请选择团队配合人员" />
|
|
|
113
|
+ </uni-forms-item>
|
|
|
114
|
+ <uni-forms-item label="自我关键词评价" name="selfKeywords">
|
|
|
115
|
+ <view class="evaluation-column">
|
|
|
116
|
+ <uni-data-picker v-model="user.selfAssessmentPersonalityTrait" :localdata="sys_user_personality_trait"
|
|
|
117
|
+ popup-title="请选择性格特质" style="width: 100%; margin-bottom: 10px;" />
|
|
|
118
|
+ <uni-data-picker v-model="user.selfAssessmentCapabilityPerformance"
|
|
|
119
|
+ :localdata="sys_user_capability_performance" popup-title="请选择能力表现"
|
|
|
120
|
+ style="width: 100%; margin-bottom: 10px;" />
|
|
|
121
|
+ <uni-data-picker v-model="user.selfAssessmentInterpersonalInteraction"
|
|
|
122
|
+ :localdata="sys_user_interpersonal_interaction" popup-title="请选择人际互动"
|
|
|
123
|
+ style="width: 100%; margin-bottom: 10px;" />
|
|
|
124
|
+ <uni-data-picker v-model="user.selfAssessmentGrowthPotential" :localdata="sys_user_growth_potential"
|
|
|
125
|
+ popup-title="请选择成长潜力" style="width: 100%;" />
|
|
|
126
|
+ </view>
|
|
|
127
|
+ </uni-forms-item>
|
|
|
128
|
+ <uni-forms-item label="同事关键词评价" name="colleagueKeywords">
|
|
|
129
|
+ <view class="evaluation-column">
|
|
|
130
|
+ <uni-data-picker v-model="user.colleagueCommentsPersonalityTrait"
|
|
|
131
|
+ :localdata="sys_user_personality_trait" popup-title="请选择性格特质"
|
|
|
132
|
+ style="width: 100%; margin-bottom: 10px;" />
|
|
|
133
|
+ <uni-data-picker v-model="user.colleagueCommentsCapabilityPerformance"
|
|
|
134
|
+ :localdata="sys_user_capability_performance" popup-title="请选择能力表现"
|
|
|
135
|
+ style="width: 100%; margin-bottom: 10px;" />
|
|
|
136
|
+ <uni-data-picker v-model="user.colleagueCommentsInterpersonalInteraction"
|
|
|
137
|
+ :localdata="sys_user_interpersonal_interaction" popup-title="请选择人际互动"
|
|
|
138
|
+ style="width: 100%; margin-bottom: 10px;" />
|
|
|
139
|
+ <uni-data-picker v-model="user.colleagueCommentsGrowthPotential" :localdata="sys_user_growth_potential"
|
|
|
140
|
+ popup-title="请选择成长潜力" style="width: 100%;" />
|
|
|
141
|
+ </view>
|
|
|
142
|
+ </uni-forms-item>
|
|
|
143
|
+ <uni-forms-item label="上级关键词评价" name="superiorKeywords">
|
|
|
144
|
+ <view class="evaluation-column">
|
|
|
145
|
+ <uni-data-picker v-model="user.superiorEvaluationPersonalityTrait"
|
|
|
146
|
+ :localdata="sys_user_personality_trait" popup-title="请选择性格特质"
|
|
|
147
|
+ style="width: 100%; margin-bottom: 10px;" />
|
|
|
148
|
+ <uni-data-picker v-model="user.superiorEvaluationCapabilityPerformance"
|
|
|
149
|
+ :localdata="sys_user_capability_performance" popup-title="请选择能力表现"
|
|
|
150
|
+ style="width: 100%; margin-bottom: 10px;" />
|
|
|
151
|
+ <uni-data-picker v-model="user.superiorEvaluationInterpersonalInteraction"
|
|
|
152
|
+ :localdata="sys_user_interpersonal_interaction" popup-title="请选择人际互动"
|
|
|
153
|
+ style="width: 100%; margin-bottom: 10px;" />
|
|
|
154
|
+ <uni-data-picker v-model="user.superiorEvaluationGrowthPotential" :localdata="sys_user_growth_potential"
|
|
|
155
|
+ popup-title="请选择成长潜力" style="width: 100%;" />
|
|
|
156
|
+ </view>
|
|
|
157
|
+ </uni-forms-item>
|
|
|
158
|
+ <uni-forms-item label="下级关键词评价" name="subordinateKeywords">
|
|
|
159
|
+ <view class="evaluation-column">
|
|
|
160
|
+ <uni-data-picker v-model="user.subordinateEvaluationPersonalityTrait"
|
|
|
161
|
+ :localdata="sys_user_personality_trait" popup-title="请选择性格特质"
|
|
|
162
|
+ style="width: 100%; margin-bottom: 10px;" />
|
|
|
163
|
+ <uni-data-picker v-model="user.subordinateEvaluationCapabilityPerformance"
|
|
|
164
|
+ :localdata="sys_user_capability_performance" popup-title="请选择能力表现"
|
|
|
165
|
+ style="width: 100%; margin-bottom: 10px;" />
|
|
|
166
|
+ <uni-data-picker v-model="user.subordinateEvaluationInterpersonalInteraction"
|
|
|
167
|
+ :localdata="sys_user_interpersonal_interaction" popup-title="请选择人际互动"
|
|
|
168
|
+ style="width: 100%; margin-bottom: 10px;" />
|
|
|
169
|
+ <uni-data-picker v-model="user.subordinateEvaluationGrowthPotential"
|
|
|
170
|
+ :localdata="sys_user_growth_potential" popup-title="请选择成长潜力" style="width: 100%;" />
|
|
|
171
|
+ </view>
|
|
|
172
|
+ </uni-forms-item>
|
|
|
173
|
+ </uni-collapse-item>
|
|
|
174
|
+ </uni-collapse>
|
|
|
175
|
+
|
|
|
176
|
+ <!-- 应急联络信息 -->
|
|
|
177
|
+ <uni-collapse class="collapse" :accordion="false" :value="['emergency']">
|
|
|
178
|
+ <uni-collapse-item class="collapse-item" title="应急联络信息" name="emergency" :show-animation="true">
|
|
|
179
|
+ <uni-forms-item label="紧急联系人姓名" name="emergencyContactName">
|
|
|
180
|
+ <uni-easyinput v-model="user.emergencyContactName" placeholder="请输入紧急联系人姓名" />
|
|
|
181
|
+ </uni-forms-item>
|
|
|
182
|
+ <uni-forms-item label="紧急联系人电话" name="emergencyContactPhone">
|
|
|
183
|
+ <uni-easyinput v-model="user.emergencyContactPhone" placeholder="请输入紧急联系人电话" />
|
|
|
184
|
+ </uni-forms-item>
|
|
|
185
|
+ <uni-forms-item label="紧急联系人关系" name="emergencyContactRelationship">
|
|
|
186
|
+ <uni-data-picker v-model="user.emergencyContactRelationship"
|
|
|
187
|
+ :localdata="sys_user_emergency_contact_relationship" popup-title="请选择紧急联系人关系" />
|
|
|
188
|
+ </uni-forms-item>
|
|
|
189
|
+ </uni-collapse-item>
|
|
|
190
|
+ </uni-collapse>
|
|
|
191
|
+
|
|
|
192
|
+ <!-- 其他信息 -->
|
|
|
193
|
+ <uni-collapse class="collapse" :accordion="false" :value="['other']">
|
|
|
194
|
+ <uni-collapse-item class="collapse-item" title="其他信息" name="other" :show-animation="true">
|
|
|
195
|
+ <uni-forms-item label="备注" name="remark">
|
|
|
196
|
+ <uni-easyinput v-model="user.remark" type="textarea" placeholder="请输入备注" />
|
|
|
197
|
+ </uni-forms-item>
|
|
|
198
|
+ </uni-collapse-item>
|
|
|
199
|
+ </uni-collapse>
|
|
|
200
|
+
|
|
17
|
201
|
</uni-forms>
|
|
18
|
|
- <button type="primary" @click="submit">提交</button>
|
|
|
202
|
+ </view>
|
|
|
203
|
+
|
|
|
204
|
+ <!-- 固定在底部的提交按钮 -->
|
|
|
205
|
+ <view class="submit-button">
|
|
|
206
|
+ <button type="primary" @click="submit" style="margin-top: 0;width: 100%;">提交</button>
|
|
19
|
207
|
</view>
|
|
20
|
208
|
</view>
|
|
21
|
209
|
</template>
|
|
22
|
210
|
|
|
23
|
211
|
<script>
|
|
24
|
|
- import { getUserProfile } from "@/api/system/user"
|
|
25
|
|
- import { updateUserProfile } from "@/api/system/user"
|
|
26
|
212
|
|
|
27
|
|
- export default {
|
|
28
|
|
- data() {
|
|
|
213
|
+import { updateUser, listAllUser, getPostAllList, getUserInfoById } from "@/api/system/user"
|
|
|
214
|
+import { getDeptList } from "@/api/system/dept/dept"
|
|
|
215
|
+import storage from "@/utils/storage"
|
|
|
216
|
+import constant from "@/utils/constant"
|
|
|
217
|
+import useDictMixin from "@/utils/dict"
|
|
|
218
|
+
|
|
|
219
|
+export default {
|
|
|
220
|
+ mixins: [useDictMixin],
|
|
|
221
|
+ data() {
|
|
|
222
|
+ return {
|
|
|
223
|
+ user: {
|
|
|
224
|
+ // 基本身份信息
|
|
|
225
|
+ nickName: "",
|
|
|
226
|
+ deptId: "",
|
|
|
227
|
+ phonenumber: "",
|
|
|
228
|
+ email: "",
|
|
|
229
|
+ cardNumber: "",
|
|
|
230
|
+ sex: "",
|
|
|
231
|
+ zodiac: "",
|
|
|
232
|
+ constellation: "",
|
|
|
233
|
+ blooGroup: "",
|
|
|
234
|
+
|
|
|
235
|
+ // 状态管理信息
|
|
|
236
|
+ trainingComplianceStatus: "",
|
|
|
237
|
+
|
|
|
238
|
+ // 资质能力信息
|
|
|
239
|
+ qualificationLevel: "",
|
|
|
240
|
+ postIds: [],
|
|
|
241
|
+ politicalReviewSituation: "",
|
|
|
242
|
+ politicalStatus: "",
|
|
|
243
|
+ schooling: "",
|
|
|
244
|
+ administrativeStatus: "",
|
|
|
245
|
+ physicalHealthStatus: "",
|
|
|
246
|
+
|
|
|
247
|
+ // 工作履历/经验
|
|
|
248
|
+ startWorkingDate: "",
|
|
|
249
|
+ securityCheckStartDate: "",
|
|
|
250
|
+ securityInspectionPosition: "",
|
|
|
251
|
+ workRewardsNumber: "",
|
|
|
252
|
+ workPenaltiesNumber: "",
|
|
|
253
|
+
|
|
|
254
|
+ // 评价类指标
|
|
|
255
|
+ characterCharacteristics: "",
|
|
|
256
|
+ workingStyle: "",
|
|
|
257
|
+ teamCooperation: [],
|
|
|
258
|
+ selfAssessmentPersonalityTrait: "",
|
|
|
259
|
+ selfAssessmentCapabilityPerformance: "",
|
|
|
260
|
+ selfAssessmentInterpersonalInteraction: "",
|
|
|
261
|
+ selfAssessmentGrowthPotential: "",
|
|
|
262
|
+ colleagueCommentsPersonalityTrait: "",
|
|
|
263
|
+ colleagueCommentsCapabilityPerformance: "",
|
|
|
264
|
+ colleagueCommentsInterpersonalInteraction: "",
|
|
|
265
|
+ colleagueCommentsGrowthPotential: "",
|
|
|
266
|
+ superiorEvaluationPersonalityTrait: "",
|
|
|
267
|
+ superiorEvaluationCapabilityPerformance: "",
|
|
|
268
|
+ superiorEvaluationInterpersonalInteraction: "",
|
|
|
269
|
+ superiorEvaluationGrowthPotential: "",
|
|
|
270
|
+ subordinateEvaluationPersonalityTrait: "",
|
|
|
271
|
+ subordinateEvaluationCapabilityPerformance: "",
|
|
|
272
|
+ subordinateEvaluationInterpersonalInteraction: "",
|
|
|
273
|
+ subordinateEvaluationGrowthPotential: "",
|
|
|
274
|
+
|
|
|
275
|
+ // 应急联络信息
|
|
|
276
|
+ emergencyContactName: "",
|
|
|
277
|
+ emergencyContactPhone: "",
|
|
|
278
|
+ emergencyContactRelationship: "",
|
|
|
279
|
+
|
|
|
280
|
+ // 其他信息
|
|
|
281
|
+ remark: ""
|
|
|
282
|
+ },
|
|
|
283
|
+
|
|
|
284
|
+ // 性别选项
|
|
|
285
|
+ sys_user_sex: [],
|
|
|
286
|
+
|
|
|
287
|
+ // 生肖选项
|
|
|
288
|
+ sys_user_zodiac: [],
|
|
|
289
|
+
|
|
|
290
|
+ // 星座选项
|
|
|
291
|
+ sys_user_constellation: [],
|
|
|
292
|
+
|
|
|
293
|
+ // 血型选项
|
|
|
294
|
+ sys_user_blood_group: [],
|
|
|
295
|
+
|
|
|
296
|
+ // 资质等级选项
|
|
|
297
|
+ sys_user_qualification_level: [],
|
|
|
298
|
+
|
|
|
299
|
+ // 岗位类型选项
|
|
|
300
|
+ sys_user_post_type: [],
|
|
|
301
|
+
|
|
|
302
|
+ // 是否通过政审选项
|
|
|
303
|
+ yesNoOptions: [
|
|
|
304
|
+ { text: '是', value: '1' },
|
|
|
305
|
+ { text: '否', value: '0' }
|
|
|
306
|
+ ],
|
|
|
307
|
+
|
|
|
308
|
+ // 政治面貌选项
|
|
|
309
|
+ sys_user_political_status: [],
|
|
|
310
|
+
|
|
|
311
|
+ // 学历选项
|
|
|
312
|
+ sys_user_schooling: [],
|
|
|
313
|
+
|
|
|
314
|
+ // 安检最高职务选项
|
|
|
315
|
+ sys_user_security_position: [],
|
|
|
316
|
+
|
|
|
317
|
+ // 安检最高职务选项(写死)
|
|
|
318
|
+ securityPositionOptions: [
|
|
|
319
|
+ { text: '安检员', value: '安检员' },
|
|
|
320
|
+ { text: '班组长', value: '班组长' }
|
|
|
321
|
+ ],
|
|
|
322
|
+
|
|
|
323
|
+ // 性格特征选项
|
|
|
324
|
+ sys_user_character_characteristics: [],
|
|
|
325
|
+
|
|
|
326
|
+ // 工作风格选项
|
|
|
327
|
+ sys_user_working_style: [],
|
|
|
328
|
+
|
|
|
329
|
+ // 团队配合人员选项
|
|
|
330
|
+ sys_user_team_cooperation: [],
|
|
|
331
|
+
|
|
|
332
|
+ // 性格特质选项
|
|
|
333
|
+ sys_user_personality_trait: [],
|
|
|
334
|
+
|
|
|
335
|
+ // 能力表现选项
|
|
|
336
|
+ sys_user_capability_performance: [],
|
|
|
337
|
+
|
|
|
338
|
+ // 人际互动选项
|
|
|
339
|
+ sys_user_interpersonal_interaction: [],
|
|
|
340
|
+
|
|
|
341
|
+ // 成长潜力选项
|
|
|
342
|
+ sys_user_growth_potential: [],
|
|
|
343
|
+
|
|
|
344
|
+ // 紧急联系人关系选项
|
|
|
345
|
+ sys_user_emergency_contact_relationship: [],
|
|
|
346
|
+
|
|
|
347
|
+ // 团队配合人员选项
|
|
|
348
|
+ teamCooperationOptions: [],
|
|
|
349
|
+
|
|
|
350
|
+ // 岗位类型树状数据
|
|
|
351
|
+ postTreeData: [],
|
|
|
352
|
+
|
|
|
353
|
+ // 部门选项数据
|
|
|
354
|
+ deptOptions: [],
|
|
|
355
|
+
|
|
|
356
|
+ }
|
|
|
357
|
+ },
|
|
|
358
|
+ onLoad() {
|
|
|
359
|
+ this.loadDictData()
|
|
|
360
|
+ this.getUser()
|
|
|
361
|
+ this.loadTeamCooperationData()
|
|
|
362
|
+ this.loadPostTreeData()
|
|
|
363
|
+ this.loadDeptData()
|
|
|
364
|
+ },
|
|
|
365
|
+ onReady() {
|
|
|
366
|
+ this.$refs.form.setRules(this.rules)
|
|
|
367
|
+ },
|
|
|
368
|
+ computed: {
|
|
|
369
|
+ rules() {
|
|
29
|
370
|
return {
|
|
30
|
|
- user: {
|
|
31
|
|
- nickName: "",
|
|
32
|
|
- phonenumber: "",
|
|
33
|
|
- email: "",
|
|
34
|
|
- sex: ""
|
|
|
371
|
+ nickName: {
|
|
|
372
|
+ rules: [{
|
|
|
373
|
+ required: true,
|
|
|
374
|
+ errorMessage: '用户昵称不能为空'
|
|
|
375
|
+ }]
|
|
35
|
376
|
},
|
|
36
|
|
- sexs: [{
|
|
37
|
|
- text: '男',
|
|
38
|
|
- value: "0"
|
|
39
|
|
- }, {
|
|
40
|
|
- text: '女',
|
|
41
|
|
- value: "1"
|
|
42
|
|
- }],
|
|
43
|
|
- rules: {
|
|
44
|
|
- nickName: {
|
|
45
|
|
- rules: [{
|
|
46
|
|
- required: true,
|
|
47
|
|
- errorMessage: '用户昵称不能为空'
|
|
48
|
|
- }]
|
|
49
|
|
- },
|
|
50
|
|
- phonenumber: {
|
|
51
|
|
- rules: [{
|
|
52
|
|
- required: true,
|
|
53
|
|
- errorMessage: '手机号码不能为空'
|
|
54
|
|
- }, {
|
|
55
|
|
- pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
|
56
|
|
- errorMessage: '请输入正确的手机号码'
|
|
57
|
|
- }]
|
|
58
|
|
- },
|
|
59
|
|
- email: {
|
|
60
|
|
- rules: [{
|
|
61
|
|
- required: true,
|
|
62
|
|
- errorMessage: '邮箱地址不能为空'
|
|
63
|
|
- }, {
|
|
64
|
|
- format: 'email',
|
|
65
|
|
- errorMessage: '请输入正确的邮箱地址'
|
|
66
|
|
- }]
|
|
67
|
|
- }
|
|
|
377
|
+ deptId: {
|
|
|
378
|
+ rules: [{
|
|
|
379
|
+ required: true,
|
|
|
380
|
+ errorMessage: '归属部门不能为空'
|
|
|
381
|
+ }]
|
|
|
382
|
+ },
|
|
|
383
|
+ qualificationLevel: {
|
|
|
384
|
+ rules: [{
|
|
|
385
|
+ required: this.isSecurityRole,
|
|
|
386
|
+ errorMessage: '资质等级不能为空'
|
|
|
387
|
+ }]
|
|
|
388
|
+ },
|
|
|
389
|
+ postIds: {
|
|
|
390
|
+ rules: [{
|
|
|
391
|
+ required: this.isSecurityRole,
|
|
|
392
|
+ errorMessage: '岗位类型不能为空'
|
|
|
393
|
+ }]
|
|
|
394
|
+ },
|
|
|
395
|
+ phonenumber: {
|
|
|
396
|
+ rules: [{
|
|
|
397
|
+ required: true,
|
|
|
398
|
+ errorMessage: '手机号码不能为空'
|
|
|
399
|
+ }, {
|
|
|
400
|
+ pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
|
|
401
|
+ errorMessage: '请输入正确的手机号码'
|
|
|
402
|
+ }]
|
|
|
403
|
+ },
|
|
|
404
|
+ email: {
|
|
|
405
|
+ rules: [{
|
|
|
406
|
+ required: true,
|
|
|
407
|
+ errorMessage: '邮箱地址不能为空'
|
|
|
408
|
+ }, {
|
|
|
409
|
+ format: 'email',
|
|
|
410
|
+ errorMessage: '请输入正确的邮箱地址'
|
|
|
411
|
+ }]
|
|
68
|
412
|
}
|
|
69
|
413
|
}
|
|
70
|
414
|
},
|
|
71
|
|
- onLoad() {
|
|
72
|
|
- this.getUser()
|
|
|
415
|
+ // 判断当前用户是否是安检员或班组长角色
|
|
|
416
|
+ isSecurityRole() {
|
|
|
417
|
+ // 安检员和班组长的角色ID通常是固定的,这里假设安检员角色ID为101,班组长角色ID为102
|
|
|
418
|
+ // 您可以根据实际情况调整这些ID
|
|
|
419
|
+ const securityRoleIds = ['banzuzhang', 'SecurityCheck'] // 安检员和班组长的角色ID
|
|
|
420
|
+
|
|
|
421
|
+ // 检查当前用户的角色ID是否包含安检员或班组长的角色ID
|
|
|
422
|
+ console.log((this.user?.roles && this.user?.roles.length > 0) && this.user.roles.some(role => securityRoleIds.includes(role.roleKey)), "this.user.roleIds.some(role => securityRoleIds.includes(role.roleKey))")
|
|
|
423
|
+ return (this.user?.roles && this.user?.roles.length > 0) && this.user?.roles.some(role => securityRoleIds.includes(role.roleKey))
|
|
|
424
|
+
|
|
|
425
|
+ }
|
|
|
426
|
+ },
|
|
|
427
|
+ methods: {
|
|
|
428
|
+ async loadDictData() {
|
|
|
429
|
+ try {
|
|
|
430
|
+ const dicts = await this.useDict(
|
|
|
431
|
+ 'sys_user_sex',
|
|
|
432
|
+ 'sys_user_zodiac',
|
|
|
433
|
+ 'sys_user_constellation',
|
|
|
434
|
+ 'sys_user_blood_group',
|
|
|
435
|
+ 'sys_user_qualification_level',
|
|
|
436
|
+ 'sys_user_post_type',
|
|
|
437
|
+ 'sys_user_political_status',
|
|
|
438
|
+ 'sys_user_schooling',
|
|
|
439
|
+ 'sys_user_security_position',
|
|
|
440
|
+ 'sys_user_character_characteristics',
|
|
|
441
|
+ 'sys_user_working_style',
|
|
|
442
|
+ 'sys_user_team_cooperation',
|
|
|
443
|
+ 'sys_user_personality_trait',
|
|
|
444
|
+ 'sys_user_capability_performance',
|
|
|
445
|
+ 'sys_user_interpersonal_interaction',
|
|
|
446
|
+ 'sys_user_growth_potential',
|
|
|
447
|
+ 'sys_user_emergency_contact_relationship'
|
|
|
448
|
+ )
|
|
|
449
|
+
|
|
|
450
|
+ // 将获取到的字典数据转换为uni-data-picker需要的格式
|
|
|
451
|
+ Object.keys(dicts).forEach(key => {
|
|
|
452
|
+ // console.log(dicts[key])
|
|
|
453
|
+ // 将dictLabel/dictValue格式转换为label/value格式
|
|
|
454
|
+ this[key] = dicts[key].map(item => ({
|
|
|
455
|
+ text: item.label,
|
|
|
456
|
+ value: item.value
|
|
|
457
|
+ }))
|
|
|
458
|
+ })
|
|
|
459
|
+ } catch (error) {
|
|
|
460
|
+ console.error('加载字典数据失败:', error)
|
|
|
461
|
+ }
|
|
73
|
462
|
},
|
|
74
|
|
- onReady() {
|
|
75
|
|
- this.$refs.form.setRules(this.rules)
|
|
|
463
|
+
|
|
|
464
|
+ // 加载团队配合人员数据
|
|
|
465
|
+ async loadTeamCooperationData() {
|
|
|
466
|
+ try {
|
|
|
467
|
+ const res = await listAllUser()
|
|
|
468
|
+ if (res && res.data) {
|
|
|
469
|
+ this.teamCooperationOptions = res.data.map(item => ({
|
|
|
470
|
+ text: `${item.nickName}(${item.userName})`,
|
|
|
471
|
+ value: item.userId
|
|
|
472
|
+ }))
|
|
|
473
|
+ }
|
|
|
474
|
+ } catch (error) {
|
|
|
475
|
+ console.error('加载团队配合人员数据失败:', error)
|
|
|
476
|
+ }
|
|
|
477
|
+ },
|
|
|
478
|
+
|
|
|
479
|
+ // 加载岗位类型树状数据
|
|
|
480
|
+ async loadPostTreeData() {
|
|
|
481
|
+ try {
|
|
|
482
|
+ const res = await getPostAllList()
|
|
|
483
|
+
|
|
|
484
|
+ if (res && res.data) {
|
|
|
485
|
+ // 保存原始树状数据
|
|
|
486
|
+ this.postTreeDataAll = JSON.parse(JSON.stringify(res.data))
|
|
|
487
|
+
|
|
|
488
|
+ // 将树状数据扁平化,显示为"父级岗位名称 - 子级岗位名称"格式
|
|
|
489
|
+ const flattenTreeWithParent = (nodes, parentName = '') => {
|
|
|
490
|
+ let result = []
|
|
|
491
|
+ nodes.forEach(node => {
|
|
|
492
|
+ // 如果有子节点,只处理子节点
|
|
|
493
|
+ if (node.children && node.children.length > 0) {
|
|
|
494
|
+ result = result.concat(flattenTreeWithParent(node.children, node.postName))
|
|
|
495
|
+ } else {
|
|
|
496
|
+ // 如果没有子节点,显示当前节点(带父级名称)
|
|
|
497
|
+ const displayText = parentName ? `${parentName}/${node.postName}` : node.postName
|
|
|
498
|
+ result.push({
|
|
|
499
|
+ text: displayText,
|
|
|
500
|
+ value: node.postId
|
|
|
501
|
+ })
|
|
|
502
|
+ }
|
|
|
503
|
+ })
|
|
|
504
|
+ return result
|
|
|
505
|
+ }
|
|
|
506
|
+
|
|
|
507
|
+ this.postTreeData = flattenTreeWithParent(res.data)
|
|
|
508
|
+ }
|
|
|
509
|
+ } catch (error) {
|
|
|
510
|
+ console.error('加载岗位类型树状数据失败:', error)
|
|
|
511
|
+ }
|
|
76
|
512
|
},
|
|
77
|
|
- methods: {
|
|
78
|
|
- getUser() {
|
|
79
|
|
- getUserProfile().then(response => {
|
|
80
|
|
- this.user = response.data
|
|
|
513
|
+
|
|
|
514
|
+ // 资质等级变化处理
|
|
|
515
|
+ handleQualificationLevelChange(e) {
|
|
|
516
|
+ console.log('资质等级变化', e)
|
|
|
517
|
+ // 清空岗位类型选择
|
|
|
518
|
+ this.user.postIds = []
|
|
|
519
|
+
|
|
|
520
|
+ // 如果资质等级为五级,需要重新生成过滤后的扁平化数据
|
|
|
521
|
+ const flattenTreeWithParent = (nodes, parentName = '') => {
|
|
|
522
|
+ let result = []
|
|
|
523
|
+ nodes.forEach(node => {
|
|
|
524
|
+ if (node.children && node.children.length > 0) {
|
|
|
525
|
+ result = result.concat(flattenTreeWithParent(node.children, node.postName))
|
|
|
526
|
+ } else {
|
|
|
527
|
+ const displayText = parentName ? `${parentName}/${node.postName}` : node.postName
|
|
|
528
|
+ result.push({
|
|
|
529
|
+ text: displayText,
|
|
|
530
|
+ value: node.postId
|
|
|
531
|
+ })
|
|
|
532
|
+ }
|
|
81
|
533
|
})
|
|
82
|
|
- },
|
|
83
|
|
- submit(ref) {
|
|
84
|
|
- this.$refs.form.validate().then(res => {
|
|
85
|
|
- updateUserProfile(this.user).then(response => {
|
|
86
|
|
- this.$modal.msgSuccess("修改成功")
|
|
87
|
|
- })
|
|
|
534
|
+ return result
|
|
|
535
|
+ }
|
|
|
536
|
+
|
|
|
537
|
+ if (e?.detail?.value[0]?.value === 'LEVEL_FIVE') {
|
|
|
538
|
+ this.postTreeData = flattenTreeWithParent(this.postTreeDataAll).filter(item => item.value !== 9 && item.value !== 10)
|
|
|
539
|
+ } else {
|
|
|
540
|
+ this.postTreeData = flattenTreeWithParent(this.postTreeDataAll)
|
|
|
541
|
+ }
|
|
|
542
|
+
|
|
|
543
|
+
|
|
|
544
|
+ },
|
|
|
545
|
+
|
|
|
546
|
+ // 递归过滤树形数据
|
|
|
547
|
+ filterPostTree(data) {
|
|
|
548
|
+ return data.filter(item => {
|
|
|
549
|
+ // 过滤掉postId为9或10的选项
|
|
|
550
|
+ if (item.postId == 9 || item.postId == 10) {
|
|
|
551
|
+ return false
|
|
|
552
|
+ }
|
|
|
553
|
+
|
|
|
554
|
+ // 如果有子节点,递归过滤
|
|
|
555
|
+ if (item.children && item.children.length > 0) {
|
|
|
556
|
+ item.children = this.filterPostTree(item.children)
|
|
|
557
|
+ }
|
|
|
558
|
+
|
|
|
559
|
+ return true
|
|
|
560
|
+ })
|
|
|
561
|
+ },
|
|
|
562
|
+
|
|
|
563
|
+ // 加载部门数据
|
|
|
564
|
+ async loadDeptData() {
|
|
|
565
|
+ try {
|
|
|
566
|
+ const res = await getDeptList()
|
|
|
567
|
+ if (res && res.data) {
|
|
|
568
|
+ // 直接使用树状数据,转换为uni-data-picker需要的格式
|
|
|
569
|
+ const transformDeptTree = (nodes) => {
|
|
|
570
|
+ return nodes.map(node => ({
|
|
|
571
|
+ text: node.label,
|
|
|
572
|
+ value: node.id,
|
|
|
573
|
+ children: node.children ? transformDeptTree(node.children) : []
|
|
|
574
|
+ }))
|
|
|
575
|
+ }
|
|
|
576
|
+ this.deptOptions = transformDeptTree(res.data)
|
|
|
577
|
+ }
|
|
|
578
|
+ } catch (error) {
|
|
|
579
|
+ console.error('加载部门数据失败:', error)
|
|
|
580
|
+ }
|
|
|
581
|
+ },
|
|
|
582
|
+ getUser() {
|
|
|
583
|
+ // 获取当前登录用户的ID
|
|
|
584
|
+ const currentUserId = storage.get(constant.id)
|
|
|
585
|
+ if (currentUserId) {
|
|
|
586
|
+ getUserInfoById(currentUserId).then(response => {
|
|
|
587
|
+ let res = { ...response.data }
|
|
|
588
|
+ res.teamCooperation = res.teamCooperation ? res.teamCooperation.split(",") : []
|
|
|
589
|
+ res.postIds = response.postIds || []
|
|
|
590
|
+ res.roleIds = response.roleIds || []
|
|
|
591
|
+ this.user = res
|
|
88
|
592
|
})
|
|
|
593
|
+ } else {
|
|
|
594
|
+ console.error('未找到当前登录用户ID')
|
|
89
|
595
|
}
|
|
|
596
|
+ },
|
|
|
597
|
+ submit(ref) {
|
|
|
598
|
+ // 重新设置验证规则,确保角色变化后规则能更新
|
|
|
599
|
+ this.$refs.form.setRules(this.rules)
|
|
|
600
|
+
|
|
|
601
|
+ this.$refs.form.validate().then(res => {
|
|
|
602
|
+ // 准备提交数据,将数组字段转换为字符串
|
|
|
603
|
+ const submitData = {
|
|
|
604
|
+ ...this.user,
|
|
|
605
|
+ teamCooperation: this.user.teamCooperation ? this.user.teamCooperation.join(',') : ''
|
|
|
606
|
+ }
|
|
|
607
|
+
|
|
|
608
|
+ updateUser(submitData).then(response => {
|
|
|
609
|
+ this.$modal.msgSuccess("修改成功")
|
|
|
610
|
+ // 提交成功后返回上一个页面
|
|
|
611
|
+ setTimeout(() => {
|
|
|
612
|
+ uni.navigateBack()
|
|
|
613
|
+ }, 1500)
|
|
|
614
|
+ })
|
|
|
615
|
+ }).catch(err => {
|
|
|
616
|
+ // 验证失败时显示错误提示
|
|
|
617
|
+ console.error('表单验证失败:', err)
|
|
|
618
|
+ this.$modal.msgError('请检查表单填写是否正确')
|
|
|
619
|
+ })
|
|
90
|
620
|
}
|
|
91
|
621
|
}
|
|
|
622
|
+}
|
|
92
|
623
|
</script>
|
|
93
|
624
|
|
|
94
|
625
|
<style lang="scss" scoped>
|
|
95
|
|
- page {
|
|
96
|
|
- background-color: #ffffff;
|
|
97
|
|
- }
|
|
|
626
|
+page {
|
|
|
627
|
+ background-color: #ffffff;
|
|
|
628
|
+ padding-bottom: 80px;
|
|
|
629
|
+ /* 为底部按钮预留空间 */
|
|
|
630
|
+}
|
|
98
|
631
|
|
|
99
|
|
- .example {
|
|
100
|
|
- padding: 15px;
|
|
101
|
|
- background-color: #fff;
|
|
102
|
|
- }
|
|
|
632
|
+.example {
|
|
|
633
|
+ padding: 15px;
|
|
103
|
634
|
|
|
104
|
|
- .segmented-control {
|
|
105
|
|
- margin-bottom: 15px;
|
|
106
|
|
- }
|
|
|
635
|
+ background-color: #fff;
|
|
|
636
|
+}
|
|
107
|
637
|
|
|
108
|
|
- .button-group {
|
|
109
|
|
- margin-top: 15px;
|
|
110
|
|
- display: flex;
|
|
111
|
|
- justify-content: space-around;
|
|
112
|
|
- }
|
|
|
638
|
+.submit-button {
|
|
|
639
|
+ position: fixed;
|
|
|
640
|
+ bottom: 0;
|
|
|
641
|
+ left: 0;
|
|
|
642
|
+ right: 0;
|
|
|
643
|
+ z-index: 999;
|
|
|
644
|
+ background: #fff;
|
|
|
645
|
+ padding: 15px;
|
|
|
646
|
+ box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
|
|
|
647
|
+}
|
|
113
|
648
|
|
|
114
|
|
- .form-item {
|
|
115
|
|
- display: flex;
|
|
116
|
|
- align-items: center;
|
|
117
|
|
- flex: 1;
|
|
118
|
|
- }
|
|
|
649
|
+.collapse {
|
|
|
650
|
+ margin-bottom: 10px;
|
|
|
651
|
+ border-radius: 8px;
|
|
|
652
|
+ overflow: hidden;
|
|
|
653
|
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
|
654
|
+}
|
|
119
|
655
|
|
|
120
|
|
- .button {
|
|
121
|
|
- display: flex;
|
|
122
|
|
- align-items: center;
|
|
123
|
|
- height: 35px;
|
|
124
|
|
- line-height: 35px;
|
|
125
|
|
- margin-left: 10px;
|
|
126
|
|
- }
|
|
|
656
|
+.collapse-item {
|
|
|
657
|
+ background-color: #fff;
|
|
|
658
|
+ padding: 10px;
|
|
|
659
|
+}
|
|
|
660
|
+
|
|
|
661
|
+.segmented-control {
|
|
|
662
|
+ margin-bottom: 15px;
|
|
|
663
|
+}
|
|
|
664
|
+
|
|
|
665
|
+.button-group {
|
|
|
666
|
+ margin-top: 15px;
|
|
|
667
|
+ display: flex;
|
|
|
668
|
+ justify-content: space-around;
|
|
|
669
|
+}
|
|
|
670
|
+
|
|
|
671
|
+.form-item {
|
|
|
672
|
+ display: flex;
|
|
|
673
|
+ align-items: center;
|
|
|
674
|
+ flex: 1;
|
|
|
675
|
+}
|
|
|
676
|
+
|
|
|
677
|
+.button {
|
|
|
678
|
+ display: flex;
|
|
|
679
|
+ align-items: center;
|
|
|
680
|
+ height: 35px;
|
|
|
681
|
+ line-height: 35px;
|
|
|
682
|
+ margin-left: 10px;
|
|
|
683
|
+}
|
|
|
684
|
+
|
|
|
685
|
+button[type="primary"] {
|
|
|
686
|
+ margin-top: 20px;
|
|
|
687
|
+ background-color: #409EFF;
|
|
|
688
|
+}
|
|
|
689
|
+
|
|
|
690
|
+.evaluation-row {
|
|
|
691
|
+ display: flex;
|
|
|
692
|
+ flex-wrap: wrap;
|
|
|
693
|
+ justify-content: space-between;
|
|
|
694
|
+ width: 100%;
|
|
|
695
|
+}
|
|
|
696
|
+
|
|
|
697
|
+.evaluation-column {
|
|
|
698
|
+ display: flex;
|
|
|
699
|
+ flex-direction: column;
|
|
|
700
|
+ width: 100%;
|
|
|
701
|
+}
|
|
127
|
702
|
</style>
|