028554ac7af696c25663b05b736315e123L110">110
],
mainWirelessCall: [
{ required: true, message: '手机不能为空', trigger: 'blur' }
{ required: true, message: '请输入11位手机号', trigger: 'blur' }
],
facePicture: [
{ required: true, message: '图片不能为空', trigger: 'blur' }
@ -118,33 +133,201 @@ export default {
}
},
computed: {
// 显示/隐藏对话框
visibled: {
set(val) {
this.$emit('visibled', val)
isVisibled: {
set (val) {
this.$emit('update:visible', val)
},
get() {
get () {
this.getJobPositionList()
return this.visible
}
}
},
watch: {
'addUserModal.apartments' (val) {
// 重置部门回显
this.addUserModal.organizeCode = ''
// 查询部门列表
this.queryCycleChildOrg(val)
}
},
mounted() {
this.getJobPositionList()
},
methods: {
// 确认新增用户
submitModalData() {
this.visible = false
console.log(this.visibled)
console.log(this.visible);
this.$refs['addUserModal'].validate((valid) => {
if (valid) {
this.isVisibled = false
let obj = {
name: this.addUserModal.name, // 员工姓名
code: this.addUserModal.code, // 员工编号
organizeCode: this.addUserModal.organizeCode, // 部门CODE
mainWirelessCall: this.addUserModal.mainWirelessCall, // 手机号码
mainJobPosition: this.addUserModal.mainJobPosition, // 职务
field1: this.addUserModal.facePicture, // 照片标识
field4: this.addUserModal.apartments, // 公司ID
birthday: Math.round(new Date() / 1000) // 生日(时间戳)
}
sysapi.creteEmployee({params: obj}).then(res => {
console.log(res)
if (res.data.success === true) {
this.$Message.success('新增成功')
} else {
console.log(res.data.fail.message)
this.$Message.success(res.data.fail.message)
}
})
}
})
},
// 重置表单数据
resetModalData () {
// this.$refs['activityForm'].resetFields()
this.$refs['addUserModal'].resetFields()
this.imgUrl = ''
this.visibled = false
this.isVisibled = false
},
// 查询职务列表
async getJobPositionList() {
const res = await sysapi.getJobPositionList()
if (res.status === 200) {
this.jobPoisitonList = res.data.data
} else {
this.$Message.danger('职务类型列表数据获取失败!')
}
},
// 查询部门列表
async queryCycleChildOrg (id) {
const res = await sysapi.queryCycleChildOrg(id)
if (res.status === 200) {
const data = []
// 递归 实现tree组件所需部门数据结构
this.nextDepartment(res.data, data)
// 深拷贝data
const data1 = JSON.parse(JSON.stringify(data))
// 用部门id映射关系代替code与parentCode父子映射关系
data.forEach(item => {
// 删除pid为"-1"的的pid属性,否则tree渲染的时候没有根节点渲染不出来
if (item.pid === '-1') {
delete item.pid
}
item.id = item.orgId
data1.some((item1) => {
if (item.pid === item1.id) {
item.pid = item1.orgId
} else {
return false
}
})
})
// eslint-disable-next-line no-return-assign
this.departmentTypesList = data.filter(item => item.data = item.id)
} else {
this.$Message.danger('部门类型列表数据获取失败!')
}
},
startPickerDateChange() {
},
// 如果部门还有下级 递归
nextDepartment (data, arr) {
if (data.length > 0) {
data.forEach(item => {
arr.push({
orgId: item.id + '',
id: item.code,
label: item.name,
pid: item.parentCode
})
this.nextDepartment(item.departments, arr)
})
}
},
$_onDeleteIconClick (file) {
this.$refs.uploader.removeFile(file)
},
$_onUploadRemoveFlie (file, fileList) {
this.uploadList = fileList
},
$_onUploadPreviewFlie (file) {
console.log(file)
},
$_onUploadProgress (e, file) {
console.log(e)
console.log(file)
},
$_onUploadSuccess (res, file) {
this.imgUrl = res.data.data.toolPictureUrl
this.addDeviceModalForm.pictureUrl = res.data.data.pictureUrl
// 因为演示用的上传服务器返回数据格式的原因,这里模拟添加 url
console.log(file)
this.uploadList.push(file)
},
$_onUploadRemoveFile () { },
$_onUploadExceededSize () { },
$_onUploadError (errMsg, response, file) {
console.log(file)
console.log(errMsg.message)
this.$Notice.warning({
title: `文件${file.name}上传失败`,
desc:
'原因:' + errMsg
})
},
$_onUploadFileExtError (file, files) {
this.$Notice.warning({
title: '文件格式不正确',
desc:
'文件 ' + file.name + ' 格式不正确,请上传 jpg 或 png 格式的图片。'
})
console.log(files)
},
$_onUploadFileExceededSize (file) {
this.$Notice.warning({
title: '超出文件大小限制',
desc: '文件 ' + file.name + ' 太大,不能超过 2M。'
})
},
$_onUploadFormatError () { },
$_onUploadBeforeUpload () {
const check = this.uploadList.length < 5
if (!check) {
this.$Notice.warning({
title: '最多只能上传 5 张图片。'
})
}
return check
}
}
}
</script>
<style>
<style lang="scss" scoped>
.demo-upload-list{
.upload--drag{
background-color:#FFFFFF
}
}
.picture-upload{
display:flex;
flex-direction:column;
width:100%;
height: 100%;
justify-content: center;
.upload-icon{
align-items:center;
justify-content:center;
color:white;
display: flex;
}
.aidicon.aidicon-plus-outline:before{
width: 32px;
height: 32px;
display: flex;
justify-content: center;
align-items: center;
background-color: #D0D0D0;
border-radius:45px;
}
}
</style>
|
||
64 | 64 |
|
65 | 65 |
|
66 | 66 |
|
67 |
|
|
67 |
|
|
68 | 68 |
|
69 | 69 |
|
70 | 70 |
|
|
||
306 | 306 |
|
307 | 307 |
|
308 | 308 |
|
309 |
|
|
310 | 309 |
|
311 | 310 |
|
312 | 311 |
|
|
||
11 | 11 |
|
12 | 12 |
|
13 | 13 |
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
24 | 27 |
|
25 |
|
|
28 |
|
|
26 | 29 |
|
27 | 30 |
|
28 | 31 |
|
|
||
30 | 33 |
|
31 | 34 |
|
32 | 35 |
|
33 |
|
|
34 | 36 |
|
35 | 37 |
|
36 | 38 |
|
37 | 39 |
|
38 |
|
|
39 |
|
|
40 | 40 |
|
41 | 41 |
|
42 | 42 |
|
43 | 43 |
|
44 |
|
|
44 |
|
|
45 | 45 |
|
46 | 46 |
|
47 | 47 |
|
|
||
53 | 53 |
|
54 | 54 |
|
55 | 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 |
|
|
56 |
|
|
57 |
|
|
58 |
|
|
86 | 59 |
|
87 | 60 |
|
88 | 61 |
|
|
||
105 | 78 |
|
106 | 79 |
|
107 | 80 |
|
81 |
|
|
82 |
|
|
83 |
|
|
84 |
|
|
85 |
|
|
108 | 86 |
|
109 | 87 |
|
110 | 88 |
|
111 | 89 |
|
112 |
|
|
113 |
|
|
114 |
|
|
115 |
|
|
116 |
|
|
117 |
|
|
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 |
|
|
118 | 136 |
|
119 | 137 |
|
120 | 138 |
|
|
||
124 | 142 |
|
125 | 143 |
|
126 | 144 |
|
145 |
|
|
146 |
|
|
147 |
|
|
148 |
|
|
149 |
|
|
150 |
|
|
151 |
|
|
152 |
|
|
153 |
|
|
154 |
|
|
155 |
|
|
156 |
|
|
157 |
|
|
127 | 158 |
|
128 | 159 |
|
129 | 160 |
|
|
||
170 | 201 |
|
171 | 202 |
|
172 | 203 |
|
204 |
|
|
205 |
|
|
206 |
|
|
207 |
|
|
208 |
|
|
173 | 209 |
|
174 | 210 |
|
175 | 211 |
|
176 | 212 |
|
177 |
|
|
178 |
|
|
179 |
|
|
180 |
|
|
181 |
|
|
213 |
|
|
214 |
|
|
215 |
|
|
216 |
|
|
217 |
|
|
218 |
|
|
219 |
|
|
220 |
|
|
221 |
|
|
222 |
|
|
223 |
|
|
224 |
|
|
225 |
|
|
226 |
|
|
227 |
|
|
228 |
|
|
229 |
|
|
230 |
|
|
231 |
|
|
232 |
|
|
233 |
|
|
234 |
|
|
235 |
|
|
236 |
|
|
237 |
|
|
238 |
|
|
239 |
|
|
240 |
|
|
241 |
|
|
242 |
|
|
243 |
|
|
244 |
|
|
245 |
|
|
246 |
|
|
247 |
|
|
248 |
|
|
182 | 249 |
|
183 | 250 |
|
184 | 251 |
|
|
||
247 | 314 |
|
248 | 315 |
|
249 | 316 |
|
250 |
|
|
317 |
|
|
251 | 318 |
|
252 | 319 |
|
253 | 320 |
|
254 | 321 |
|
255 |
|
|
256 |
|
|
257 |
|
|
258 |
|
|
259 |
|
|
260 |
|
|
261 |
|
|
262 |
|
|
263 |
|
|
264 |
|
|
265 |
|
|
266 |
|
|
267 |
|
|
268 |
|
|
269 |
|
|
270 |
|
|
271 |
|
|
272 |
|
|
273 |
|
|
274 |
|
|
275 |
|
|
276 |
|
|
322 |
|
|
323 |
|
|
324 |
|
|
325 |
|
|
277 | 326 |
|
327 |
|
|
328 |
|
|
278 | 329 |
|
279 |
|
|
280 |
|
|
330 |
|
|
331 |
|
|
332 |
|
|
333 |
|
|
334 |
|
|
335 |
|
|
336 |
|
|
337 |
|
|
338 |
|
|
339 |
|
|
340 |
|
|
341 |
|
|
342 |
|
|
343 |
|
|
344 |
|
|
345 |
|
|
346 |
|
|
347 |
|
|
348 |
|
|
349 |
|
|
350 |
|
|
351 |
|
|
352 |
|
|
353 |
|
|
281 | 354 |
|
282 | 355 |
|
283 | 356 |
|
|
||
133 | 133 |
|
134 | 134 |
|
135 | 135 |
|
136 |
|
|
136 |
|
|
137 | 137 |
|
138 | 138 |
|
139 | 139 |
|
|
||
19 | 19 |
|
20 | 20 |
|
21 | 21 |
|
22 |
|
|
22 | 23 |
|
23 | 24 |
|
24 | 25 |
|
|
||
72 | 73 |
|
73 | 74 |
|
74 | 75 |
|
75 |
|
|
76 |
|
|
77 |
|
|
78 |
|
|
79 |
|
|
80 |
|
|
81 |
|
|
82 |
|
|
83 |
|
|
84 |
|
|
85 |
|
|
86 |
|
|
87 |
|
|
88 |
|
|
89 |
|
|
90 |
|
|
76 | 91 |
|
|
||
154 | 154 |
|
155 | 155 |
|
156 | 156 |
|
157 |
|
|
157 |
|
|
158 | 158 |
|
159 | 159 |
|
160 | 160 |
|
|
||
166 | 166 |
|
167 | 167 |
|
168 | 168 |
|
169 |
|
|
169 |
|
|
170 | 170 |
|
171 | 171 |
|
172 | 172 |
|
|
||
1 | 1 |
|
2 | 2 |
|
3 |
|
|
3 | 4 |
|
4 | 5 |
|
5 | 6 |
|
|
||
13 | 14 |
|
14 | 15 |
|
15 | 16 |
|
17 |
|
|
16 | 18 |
|
17 | 19 |
|
18 | 20 |
|
|
||
27 | 29 |
|
28 | 30 |
|
29 | 31 |
|
32 |
|
|
30 | 33 |
|
31 | 34 |
|
32 | 35 |
|
|
||
50 | 53 |
|
51 | 54 |
|
52 | 55 |
|
56 |
|
|
57 |
|
|
58 |
|
|
53 | 59 |
|
54 | 60 |
|
55 | 61 |
|
|
||
68 | 74 |
|
69 | 75 |
|
70 | 76 |
|
71 |
|
|
77 |
|
|
72 | 78 |
|
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 |
|
|
79 | 100 |
|
80 | 101 |
|
81 | 102 |
|
|
||
92 | 113 |
|
93 | 114 |
|
94 | 115 |
|
95 |
|
|
116 |
|
|
96 | 117 |
|
97 | 118 |
|
98 | 119 |
|
|
||
133 | 154 |
|
134 | 155 |
|
135 | 156 |
|
136 |
|
|
157 |
|
|
137 | 158 |
|
138 | 159 |
|
139 | 160 |
|
|
||
165 | 186 |
|
166 | 187 |
|
167 | 188 |
|
189 |
|
|
190 |
|
|
191 |
|
|
168 | 192 |
|
169 | 193 |
|
170 |
|
|
171 |
|
|
172 |
|
|
194 |
|
|
195 |
|
|
196 |
|
|
197 |
|
|
198 |
|
|
199 |
|
|
200 |
|
|
201 |
|
|
202 |
|
|
203 |
|
|
204 |
|
|
205 |
|
|
206 |
|
|
207 |
|
|
208 |
|
|
209 |
|
|
210 |
|
|
211 |
|
|
173 | 212 |
|
174 | 213 |
|
175 | 214 |
|
|
||
186 | 225 |
|
187 | 226 |
|
188 | 227 |
|
228 |
|
|
229 |
|
|
230 |
|
|
231 |
|
|
189 | 232 |
|
190 | 233 |
|
191 | 234 |
|
|
||
226 | 269 |
|
227 | 270 |
|
228 | 271 |
|
272 |
|
|
273 |
|
|
274 |
|
|
275 |
|
|
276 |
|
|
277 |
|
|
278 |
|
|
279 |
|
|
280 |
|
|
281 |
|
|
282 |
|
|
283 |
|
|
284 |
|
|
285 |
|
|
286 |
|
|
287 |
|
|
288 |
|
|
289 |
|
|
290 |
|
|
291 |
|
|
292 |
|
|
293 |
|
|
294 |
|
|
295 |
|
|
296 |
|
|
297 |
|
|
298 |
|
|
299 |
|
|
300 |
|
|
301 |
|
|
302 |
|
|
303 |
|
|
304 |
|
|
305 |
|
|
306 |
|
|
307 |
|
|
308 |
|
|
309 |
|
|
310 |
|
|
311 |
|
|
312 |
|
|
313 |
|
|
314 |
|
|
315 |
|
|
316 |
|
|
317 |
|
|
318 |
|
|
319 |
|
|
320 |
|
|
321 |
|
|
322 |
|
|
323 |
|
|
324 |
|
|
325 |
|
|
326 |
|
|
327 |
|
|
328 |
|
|
329 |
|
|
330 |
|
|
331 |
|
|
332 |
|
|
333 |
|
|
334 |
|
|
335 |
|
|
336 |
|
|
337 |
|
|
338 |
|
|
229 | 339 |
|
230 | 340 |
|
231 | 341 |
|
|
||
45 | 45 |
|
46 | 46 |
|
47 | 47 |
|
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
|
55 |
|
|
48 | 56 |
|
49 | 57 |
|
50 | 58 |
|
|
||
84 | 84 |
|
85 | 85 |
|
86 | 86 |
|
87 |
|
|
87 |
|
|
88 | 88 |
|
89 | 89 |
|
90 | 90 |
|
|
||
14 | 14 |
|
15 | 15 |
|
16 | 16 |
|
17 |
|
|
18 | 17 |
|
18 |
|
|
19 |
|
|
19 | 20 |
|
20 | 21 |
|
21 | 22 |
|
|
||
38 | 39 |
|
39 | 40 |
|
40 | 41 |
|
41 |
|
|
42 |
|
|
43 |
|
|
44 | 42 |
|
45 | 43 |
|
46 | 44 |
|
47 | 45 |
|
48 | 46 |
|
47 |
|
|
48 |
|
|
49 |
|
|
49 | 50 |
|
50 | 51 |
|
51 | 52 |
|
|
||
54 | 55 |
|
55 | 56 |
|
56 | 57 |
|
58 |
|
|
59 |
|
|
60 |
|
|
57 | 61 |
|
58 | 62 |
|
59 | 63 |
|
64 |
|
|
60 | 65 |
|
61 |
|
|
66 |
|
|
62 | 67 |
|
63 | 68 |
|
64 | 69 |
|
|
||
68 | 73 |
|
69 | 74 |
|
70 | 75 |
|
71 |
|
|
72 |
|
|
73 |
|
|
74 | 76 |
|
75 | 77 |
|
76 | 78 |
|
|
||
82 | 84 |
|
83 | 85 |
|
84 | 86 |
|
85 |
|
|
86 |
|
|
87 |
|
|
87 |
|
|
88 |
|
|
89 |
|
|
90 |
|
|
91 |
|
|
92 |
|
|
93 |
|
|
94 |
|
|
95 |
|
|
96 |
|
|
97 |
|
|
98 |
|
|
99 |
|
|
100 |
|
|
101 |
|
|
102 |
|
|
103 |
|
|
104 |
|
|
105 |
|
|
106 |
|
|
88 | 107 |
|
89 | 108 |
|
90 | 109 |
|