304
|
425
|
})
|
305
|
426
|
},
|
|
427
|
initJobPostion: function () {
|
|
428
|
this.$test
|
|
429
|
.post(services.workEmployee.GET_JOB_POSTION, {})
|
|
430
|
.then((res) => {
|
|
431
|
// 请求成功处理...
|
|
432
|
this.JobPostions = res.data
|
|
433
|
})
|
|
434
|
.catch((res) => {
|
|
435
|
// 请求失败处理...
|
|
436
|
})
|
|
437
|
},
|
306
|
438
|
onChange(value) {
|
307
|
439
|
console.log('date change:' + value)
|
308
|
440
|
},
|
|
@ -330,68 +462,67 @@ export default {
|
330
|
462
|
this.getList()
|
331
|
463
|
},
|
332
|
464
|
handleClick(row) {
|
333
|
|
this.modal = true
|
334
|
|
// var params = new FormData()
|
335
|
|
// params.append('data', JSON.stringify({
|
336
|
|
// FACILITY_ID: row.FACILITY_ID
|
337
|
|
// }))
|
338
|
|
// this.$test.post(services.equipment.GET_ONE_EQUIPMENT, params
|
339
|
|
// ).then(res => {
|
340
|
|
// // 请求成功处理...
|
341
|
|
// this.updateModal = true
|
342
|
|
// this.updateRow = res.data.resultData
|
343
|
|
// this.typeChange(2)
|
344
|
|
// }).catch(res => {
|
345
|
|
// // 请求失败处理...
|
346
|
|
// })
|
|
465
|
this.updateModal = true
|
|
466
|
this.$test
|
|
467
|
.post(services.workEmployee.GET_WORK_EMPLOYEE, {
|
|
468
|
data: {
|
|
469
|
id: row.id
|
|
470
|
},
|
|
471
|
pageNumber: 1,
|
|
472
|
pageSize: 1
|
|
473
|
})
|
|
474
|
.then((res) => {
|
|
475
|
// 请求成功处理...
|
|
476
|
var user = res.data.data[0]
|
|
477
|
this.updateFormValidate = {
|
|
478
|
id: user.id,
|
|
479
|
name: user.name,
|
|
480
|
number: user.code,
|
|
481
|
department: user.orgCode,
|
|
482
|
job: user.mainJobPosition,
|
|
483
|
age: user.birthday,
|
|
484
|
phone: user.mainWirelessCall
|
|
485
|
}
|
|
486
|
})
|
|
487
|
.catch((res) => {
|
|
488
|
// 请求失败处理...
|
|
489
|
})
|
347
|
490
|
},
|
348
|
491
|
remove(row) {
|
349
|
|
this.$Confirm.confirm({
|
350
|
|
title: '确认要删除用户张三吗?',
|
351
|
|
content: '删除后不可恢复',
|
|
492
|
let confirm = {
|
|
493
|
title: '请确认',
|
|
494
|
content: '删除后不可恢复,确认删除吗?',
|
352
|
495
|
ok: () => {
|
353
|
|
console.log('点击了确定')
|
354
|
|
},
|
355
|
|
cancel: () => {
|
356
|
|
console.log('点击了取消')
|
|
496
|
this.fullLoading = true
|
|
497
|
this.$test.post(services.workEmployee.DEL_WORK_EMPLOYEE, {ids: row.id this.$test.post(services.workEmployee.DEL_WORK_EMPLOYEE, {ids: row.id}
|
|
498
|
).then(res => {
|
|
499
|
// 请求成功处理...
|
|
500
|
this.fullLoading = false
|
|
501
|
this.$Message.success('操作成功')
|
|
502
|
this.getList()
|
|
503
|
}).catch(res => {
|
|
504
|
// 请求失败处理...
|
|
505
|
this.fullLoading = false
|
|
506
|
})
|
357
|
507
|
}
|
358
|
|
})
|
359
|
|
// let that = this
|
360
|
|
// let confirm = {
|
361
|
|
// title: '请确认',
|
362
|
|
// content: '删除后不可恢复,确认删除吗?',
|
363
|
|
// ok: function () {
|
364
|
|
// var params = new FormData()
|
365
|
|
// params.append('data', JSON.stringify({
|
366
|
|
// params: {
|
367
|
|
// FACILITY_ID: row.FACILITY_ID
|
368
|
|
// }
|
369
|
|
// }))
|
370
|
|
// this.$test.post(services.equipment.DEL_EQUIPMENT, params
|
371
|
|
// ).then(res => {
|
372
|
|
// // 请求成功处理...
|
373
|
|
// that.$Message.success('操作成功')
|
374
|
|
// that.getList()
|
375
|
|
// }).catch(res => {
|
376
|
|
// // 请求失败处理...
|
377
|
|
// })
|
378
|
|
// }
|
379
|
|
// }
|
380
|
|
// this.$Confirm.confirm(confirm)
|
|
508
|
}
|
|
509
|
this.$Confirm.confirm(confirm)
|
381
|
510
|
},
|
382
|
511
|
cancel() {
|
383
|
512
|
this.modal = false
|
|
513
|
this.updateModal = false
|
384
|
514
|
this.$refs['formValidate'].resetFields()
|
385
|
515
|
},
|
386
|
516
|
submit() {
|
387
|
517
|
var that = this
|
388
|
518
|
this.$refs.formValidate.validate(valid => {
|
389
|
519
|
if (valid) {
|
|
520
|
that.fullLoading = true
|
390
|
521
|
that.$test.post(services.workEmployee.ADD_WORK_EMPLOYEE, {
|
391
|
522
|
name: that.formValidate.name,
|
392
|
523
|
code: that.formValidate.number,
|
393
|
524
|
organizeCode: that.formValidate.department,
|
394
|
|
mainJobPosition: that.formValidate.job.value,
|
|
525
|
mainJobPosition: that.formValidate.job,
|
395
|
526
|
birthday: that.formValidate.age,
|
396
|
527
|
// cardType: "居民身份证",
|
397
|
528
|
// cardNo: "43252345455412305567X",
|
|
@ -400,16 +531,47 @@ export default {
|
400
|
531
|
}
|
401
|
532
|
).then(res => {
|
402
|
533
|
// 请求成功处理...
|
403
|
|
if (res.data) {
|
404
|
|
that.$Message.success('提交成功!')
|
405
|
|
that.cancel()
|
406
|
|
that.getList()
|
407
|
|
} else {
|
408
|
|
this.$Message.danger('终端编号重复!')
|
409
|
|
}
|
|
534
|
that.fullLoading = false
|
|
535
|
that.$Message.success('提交成功!')
|
|
536
|
that.cancel()
|
|
537
|
that.getList()
|
410
|
538
|
// this.getList(this.table.pager.currentPage, this.table.pager.size, this.queryCondition.equipmentType, this.queryCondition.equipmentName, this.queryCondition.equipmentNumber)
|
411
|
539
|
}).catch(res => {
|
412
|
540
|
// 请求失败处理...
|
|
541
|
that.fullLoading = false
|
|
542
|
})
|
|
543
|
} else {
|
|
544
|
this.$Message.danger('表单验证失败!')
|
|
545
|
}
|
|
546
|
})
|
|
547
|
},
|
|
548
|
updateSubmit() {
|
|
549
|
var that = this
|
|
550
|
this.$refs.updateFormValidate.validate(valid => {
|
|
551
|
if (valid) {
|
|
552
|
that.fullLoading = true
|
|
553
|
var birthday = that.updateFormValidate.age.replaceAll(' 00:00:00', '')
|
|
554
|
that.$test.post(services.workEmployee.UPD_WORK_EMPLOYEE, {
|
|
555
|
id: that.updateFormValidate.id,
|
|
556
|
name: that.updateFormValidate.name,
|
|
557
|
code: that.updateFormValidate.number,
|
|
558
|
organizeCode: that.updateFormValidate.department,
|
|
559
|
mainJobPosition: that.updateFormValidate.job,
|
|
560
|
birthday: birthday,
|
|
561
|
// cardType: "居民身份证",
|
|
562
|
// cardNo: "43252345455412305567X",
|
|
563
|
// gender: "男",
|
|
564
|
mainWirelessCall: that.updateFormValidate.phone
|
|
565
|
}
|
|
566
|
).then(res => {
|
|
567
|
// 请求成功处理...
|
|
568
|
this.fullLoading = false
|
|
569
|
that.$Message.success('提交成功!')
|
|
570
|
that.cancel()
|
|
571
|
that.getList()
|
|
572
|
}).catch(res => {
|
|
573
|
// 请求失败处理...
|
|
574
|
this.fullLoading = false
|
413
|
575
|
})
|
414
|
576
|
} else {
|
415
|
577
|
this.$Message.danger('表单验证失败!')
|
|
@ -422,6 +584,38 @@ export default {
|
422
|
584
|
addUser() {
|
423
|
585
|
this.modal = true
|
424
|
586
|
this.getDepartmentsList()
|
|
587
|
},
|
|
588
|
toBatchRemove(row) { // 批量删除
|
|
589
|
if (this.selections.length === 0) {
|
|
590
|
this.$Confirm.info({
|
|
591
|
title: '提示',
|
|
592
|
content: '请选中需要删除的人员。'
|
|
593
|
})
|
|
594
|
} else {
|
|
595
|
var ids = ''
|
|
596
|
for (let i = 0; i < this.selections.length; i++) {
|
|
597
|
ids += this.selections[i].id + ','
|
|
598
|
}
|
|
599
|
ids = ids.substring(0, ids.length - 1)
|
|
600
|
let confirm = {
|
|
601
|
title: '请确认',
|
|
602
|
content: '删除后不可恢复,确认删除吗?',
|
|
603
|
ok: () => {
|
|
604
|
this.fullLoading = true
|
|
605
|
this.$test.post(services.workEmployee.DEL_WORK_EMPLOYEE, {ids: ids}
|
|
606
|
).then(res => {
|
|
607
|
// 请求成功处理...
|
|
608
|
this.fullLoading = false
|
|
609
|
this.$Message.success('操作成功')
|
|
610
|
this.getList()
|
|
611
|
}).catch(res => {
|
|
612
|
// 请求失败处理...
|
|
613
|
this.fullLoading = false
|
|
614
|
})
|
|
615
|
}
|
|
616
|
}
|
|
617
|
this.$Confirm.confirm(confirm)
|
|
618
|
}
|
425
|
619
|
}
|
426
|
620
|
}
|
427
|
621
|
}
|