cloud-web-corejs 1.0.114 → 1.0.116
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/store/modules/tagsView.js +1 -14
- package/src/views/user/user/edit.vue +1059 -1041
- package/src/views/user/user/list.vue +19 -0
@@ -1,1041 +1,1059 @@
|
|
1
|
-
<template>
|
2
|
-
<div class="detail-wrap">
|
3
|
-
<el-form ref="editForm" :model="user">
|
4
|
-
<div class="d-header clearfix">
|
5
|
-
<div class="fl">
|
6
|
-
<i class="el-icon-info"/>
|
7
|
-
{{ dataId ? $t1('查看用户') : $t1('新增用户') }}
|
8
|
-
</div>
|
9
|
-
<div class="fr">
|
10
|
-
<temp-storage-button :option="tempStorageOption" v-if="!dataId"></temp-storage-button>
|
11
|
-
<base-input-export :option="exportOption" :parent-target="_self" v-if="dataId"/>
|
12
|
-
<el-button type="primary" plain class="button-sty" icon="el-icon-unlock" @click="unlock" v-if="user.locked"
|
13
|
-
v-hasPermi="'user:unlock'">{{ $t1('解锁') }}
|
14
|
-
</el-button>
|
15
|
-
<el-button type="primary" plain class="button-sty" @click="$baseReload()" icon="el-icon-refresh-right">
|
16
|
-
{{ $t1('重置') }}
|
17
|
-
</el-button>
|
18
|
-
<el-button type="primary" class="button-sty" icon="el-icon-check" @click="saveData">{{ $t1('保存') }}
|
19
|
-
</el-button>
|
20
|
-
</div>
|
21
|
-
</div>
|
22
|
-
<baseTabs>
|
23
|
-
<baseTabPane :label="$t1('基本信息')">
|
24
|
-
<template #default>
|
25
|
-
<table class="table-detail">
|
26
|
-
<tbody>
|
27
|
-
<tr>
|
28
|
-
<th>
|
29
|
-
<em class="f-red">*</em>
|
30
|
-
{{ $t1('登录名') }}
|
31
|
-
</th>
|
32
|
-
<td colspan="3">
|
33
|
-
<el-form-item prop="loginAccount" :rules="[{ required: true, trigger: 'blur' }]">
|
34
|
-
<template v-if="dataId">
|
35
|
-
<el-input size="small" v-model="user.loginAccount" maxlength="255" autocomplete="off"
|
36
|
-
lay-verify="required" required="" :readonly="true"/>
|
37
|
-
</template>
|
38
|
-
<template v-else>
|
39
|
-
<el-input size="small" v-model="user.loginAccount" maxlength="255" autocomplete="off"
|
40
|
-
lay-verify="required" required="" clearable/>
|
41
|
-
</template>
|
42
|
-
</el-form-item>
|
43
|
-
</td>
|
44
|
-
|
45
|
-
<th>
|
46
|
-
<em class="f-red">*</em>
|
47
|
-
{{ $t1('姓名') }}
|
48
|
-
</th>
|
49
|
-
<td colspan="3">
|
50
|
-
<el-form-item prop="nickName" :rules="[{ required: true, trigger: 'blur' }]">
|
51
|
-
<el-input size="small" v-model="user.nickName" maxlength="200" lay-verify="required" required=""
|
52
|
-
clearable/>
|
53
|
-
</el-form-item>
|
54
|
-
</td>
|
55
|
-
</tr>
|
56
|
-
<tr>
|
57
|
-
|
58
|
-
<th>
|
59
|
-
<em class="f-red" v-if="!dataId">*</em>
|
60
|
-
{{ $t1('密码') }}
|
61
|
-
</th>
|
62
|
-
<td>
|
63
|
-
<el-form-item prop="password" :rules="passRules">
|
64
|
-
<el-input size="small" type="password" v-model="user.password" show-password maxlength="255"
|
65
|
-
autocomplete="off" auto-complete="new-password" clearable/>
|
66
|
-
</el-form-item>
|
67
|
-
</td>
|
68
|
-
<th>
|
69
|
-
<em class="f-red" v-if="!dataId">*</em>
|
70
|
-
{{ $t1('确认密码') }}
|
71
|
-
</th>
|
72
|
-
<td>
|
73
|
-
<el-form-item prop="rePassword" :rules="pass2Rules">
|
74
|
-
<el-input
|
75
|
-
size="small"
|
76
|
-
type="password"
|
77
|
-
v-model="user.rePassword"
|
78
|
-
show-password
|
79
|
-
maxlength="255"
|
80
|
-
autocomplete="off"
|
81
|
-
auto-complete="new-password"
|
82
|
-
lay-verify="confirmPass"
|
83
|
-
clearable
|
84
|
-
/>
|
85
|
-
</el-form-item>
|
86
|
-
</td>
|
87
|
-
|
88
|
-
|
89
|
-
<th>{{ $t1('性别') }}</th>
|
90
|
-
<td>
|
91
|
-
<el-radio-group v-model="user.gender">
|
92
|
-
<el-radio :label="1">{{ $t1('男') }}</el-radio>
|
93
|
-
<el-radio :label="2">{{ $t1('女') }}</el-radio>
|
94
|
-
</el-radio-group>
|
95
|
-
</td>
|
96
|
-
<th>
|
97
|
-
{{ $t1('员工编码') }}
|
98
|
-
</th>
|
99
|
-
<td>
|
100
|
-
<el-form-item prop="empNo" :rules="[{ required: false, trigger: 'blur' }]">
|
101
|
-
<el-input size="small" v-model="user.empNo" maxlength="200" clearable/>
|
102
|
-
</el-form-item>
|
103
|
-
</td>
|
104
|
-
</tr>
|
105
|
-
|
106
|
-
<tr>
|
107
|
-
<th>{{ $t1('出生日期') }}</th>
|
108
|
-
<td>
|
109
|
-
<el-date-picker size="small" v-model="user.birth" type="date" :placeholder="$t1('选择日期')"
|
110
|
-
value-format="yyyy-MM-dd" clearable/>
|
111
|
-
</td>
|
112
|
-
<th>{{ $t1('邮编') }}</th>
|
113
|
-
<td>
|
114
|
-
<el-input size="small" v-model="user.zipCode" maxlength="255" clearable/>
|
115
|
-
</td>
|
116
|
-
<th>{{ $t1('手机') }}</th>
|
117
|
-
<td>
|
118
|
-
<el-form-item prop="mobile" :rules="[{ required: false, trigger: 'blur' }]">
|
119
|
-
<el-input size="small" v-model="user.mobile" type="text" maxlength="255" autocomplete="off"
|
120
|
-
lay-verify="required|phone" clearable/>
|
121
|
-
</el-form-item>
|
122
|
-
</td>
|
123
|
-
<th>{{ $t1('设置') }}</th>
|
124
|
-
<td>
|
125
|
-
<el-checkbox :label="$t1('是否启用')" v-model="user.enabled"></el-checkbox>
|
126
|
-
</td>
|
127
|
-
|
128
|
-
</tr>
|
129
|
-
|
130
|
-
<tr>
|
131
|
-
<th>
|
132
|
-
{{ $t1('邮箱') }}
|
133
|
-
</th>
|
134
|
-
<td>
|
135
|
-
<el-form-item prop="email" :rules="[{ required: false, trigger: 'blur' }]">
|
136
|
-
<el-input size="small" v-model="user.email" maxlength="200" clearable/>
|
137
|
-
</el-form-item>
|
138
|
-
</td>
|
139
|
-
<!-- <th v-if="flag!=='2'">
|
140
|
-
GUID
|
141
|
-
</th>
|
142
|
-
<td v-if="flag!=='2'">
|
143
|
-
<el-form-item prop="guid" :rules="[{ required: false, trigger: 'blur' }]">
|
144
|
-
<el-input size="small" v-model="user.guid" maxlength="200" clearable/>
|
145
|
-
</el-form-item>
|
146
|
-
</td>-->
|
147
|
-
<th>{{ $t1('地址') }}</th>
|
148
|
-
<td colspan="3">
|
149
|
-
<el-input size="small" v-model="user.address" class="b" maxlength="255" clearable/>
|
150
|
-
</td>
|
151
|
-
|
152
|
-
</tr>
|
153
|
-
<tr>
|
154
|
-
<th>
|
155
|
-
{{ $t1('国家') }}
|
156
|
-
</th>
|
157
|
-
<td colspan="3">
|
158
|
-
<el-form-item prop="countryName" :rules="[{ required: false, trigger: 'blur' }]">
|
159
|
-
<el-input
|
160
|
-
class="search-input"
|
161
|
-
v-model="user.countryName"
|
162
|
-
clearable
|
163
|
-
@clear="
|
164
|
-
user.countryName = null;
|
165
|
-
user.countryCode = null;
|
166
|
-
"
|
167
|
-
v-el-readonly
|
168
|
-
>
|
169
|
-
<i slot="suffix" class="el-input__icon el-icon-search"
|
170
|
-
@click="showCountryDialog=true"></i>
|
171
|
-
</el-input>
|
172
|
-
</el-form-item>
|
173
|
-
</td>
|
174
|
-
<th>
|
175
|
-
{{ $t1('是否锁定') }}
|
176
|
-
</th>
|
177
|
-
<td>
|
178
|
-
{{ user.locked ? $t1('是') : $t1('否') }}
|
179
|
-
</td>
|
180
|
-
</tr>
|
181
|
-
<tr>
|
182
|
-
<th>
|
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
|
-
|
209
|
-
|
210
|
-
|
211
|
-
<
|
212
|
-
|
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
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
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
|
-
positionDialog
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
},
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
this
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
},
|
856
|
-
|
857
|
-
|
858
|
-
const
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
}
|
939
|
-
}
|
940
|
-
}
|
941
|
-
}
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
}
|
1041
|
-
|
1
|
+
<template>
|
2
|
+
<div class="detail-wrap">
|
3
|
+
<el-form ref="editForm" :model="user">
|
4
|
+
<div class="d-header clearfix">
|
5
|
+
<div class="fl">
|
6
|
+
<i class="el-icon-info"/>
|
7
|
+
{{ dataId ? $t1('查看用户') : $t1('新增用户') }}
|
8
|
+
</div>
|
9
|
+
<div class="fr">
|
10
|
+
<temp-storage-button :option="tempStorageOption" v-if="!dataId"></temp-storage-button>
|
11
|
+
<base-input-export :option="exportOption" :parent-target="_self" v-if="dataId"/>
|
12
|
+
<el-button type="primary" plain class="button-sty" icon="el-icon-unlock" @click="unlock" v-if="user.locked"
|
13
|
+
v-hasPermi="'user:unlock'">{{ $t1('解锁') }}
|
14
|
+
</el-button>
|
15
|
+
<el-button type="primary" plain class="button-sty" @click="$baseReload()" icon="el-icon-refresh-right">
|
16
|
+
{{ $t1('重置') }}
|
17
|
+
</el-button>
|
18
|
+
<el-button type="primary" class="button-sty" icon="el-icon-check" @click="saveData">{{ $t1('保存') }}
|
19
|
+
</el-button>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
<baseTabs>
|
23
|
+
<baseTabPane :label="$t1('基本信息')">
|
24
|
+
<template #default>
|
25
|
+
<table class="table-detail">
|
26
|
+
<tbody>
|
27
|
+
<tr>
|
28
|
+
<th>
|
29
|
+
<em class="f-red">*</em>
|
30
|
+
{{ $t1('登录名') }}
|
31
|
+
</th>
|
32
|
+
<td colspan="3">
|
33
|
+
<el-form-item prop="loginAccount" :rules="[{ required: true, trigger: 'blur' }]">
|
34
|
+
<template v-if="dataId">
|
35
|
+
<el-input size="small" v-model="user.loginAccount" maxlength="255" autocomplete="off"
|
36
|
+
lay-verify="required" required="" :readonly="true"/>
|
37
|
+
</template>
|
38
|
+
<template v-else>
|
39
|
+
<el-input size="small" v-model="user.loginAccount" maxlength="255" autocomplete="off"
|
40
|
+
lay-verify="required" required="" clearable/>
|
41
|
+
</template>
|
42
|
+
</el-form-item>
|
43
|
+
</td>
|
44
|
+
|
45
|
+
<th>
|
46
|
+
<em class="f-red">*</em>
|
47
|
+
{{ $t1('姓名') }}
|
48
|
+
</th>
|
49
|
+
<td colspan="3">
|
50
|
+
<el-form-item prop="nickName" :rules="[{ required: true, trigger: 'blur' }]">
|
51
|
+
<el-input size="small" v-model="user.nickName" maxlength="200" lay-verify="required" required=""
|
52
|
+
clearable/>
|
53
|
+
</el-form-item>
|
54
|
+
</td>
|
55
|
+
</tr>
|
56
|
+
<tr>
|
57
|
+
|
58
|
+
<th>
|
59
|
+
<em class="f-red" v-if="!dataId">*</em>
|
60
|
+
{{ $t1('密码') }}
|
61
|
+
</th>
|
62
|
+
<td>
|
63
|
+
<el-form-item prop="password" :rules="passRules">
|
64
|
+
<el-input size="small" type="password" v-model="user.password" show-password maxlength="255"
|
65
|
+
autocomplete="off" auto-complete="new-password" clearable/>
|
66
|
+
</el-form-item>
|
67
|
+
</td>
|
68
|
+
<th>
|
69
|
+
<em class="f-red" v-if="!dataId">*</em>
|
70
|
+
{{ $t1('确认密码') }}
|
71
|
+
</th>
|
72
|
+
<td>
|
73
|
+
<el-form-item prop="rePassword" :rules="pass2Rules">
|
74
|
+
<el-input
|
75
|
+
size="small"
|
76
|
+
type="password"
|
77
|
+
v-model="user.rePassword"
|
78
|
+
show-password
|
79
|
+
maxlength="255"
|
80
|
+
autocomplete="off"
|
81
|
+
auto-complete="new-password"
|
82
|
+
lay-verify="confirmPass"
|
83
|
+
clearable
|
84
|
+
/>
|
85
|
+
</el-form-item>
|
86
|
+
</td>
|
87
|
+
|
88
|
+
|
89
|
+
<th>{{ $t1('性别') }}</th>
|
90
|
+
<td>
|
91
|
+
<el-radio-group v-model="user.gender">
|
92
|
+
<el-radio :label="1">{{ $t1('男') }}</el-radio>
|
93
|
+
<el-radio :label="2">{{ $t1('女') }}</el-radio>
|
94
|
+
</el-radio-group>
|
95
|
+
</td>
|
96
|
+
<th>
|
97
|
+
{{ $t1('员工编码') }}
|
98
|
+
</th>
|
99
|
+
<td>
|
100
|
+
<el-form-item prop="empNo" :rules="[{ required: false, trigger: 'blur' }]">
|
101
|
+
<el-input size="small" v-model="user.empNo" maxlength="200" clearable/>
|
102
|
+
</el-form-item>
|
103
|
+
</td>
|
104
|
+
</tr>
|
105
|
+
|
106
|
+
<tr>
|
107
|
+
<th>{{ $t1('出生日期') }}</th>
|
108
|
+
<td>
|
109
|
+
<el-date-picker size="small" v-model="user.birth" type="date" :placeholder="$t1('选择日期')"
|
110
|
+
value-format="yyyy-MM-dd" clearable/>
|
111
|
+
</td>
|
112
|
+
<th>{{ $t1('邮编') }}</th>
|
113
|
+
<td>
|
114
|
+
<el-input size="small" v-model="user.zipCode" maxlength="255" clearable/>
|
115
|
+
</td>
|
116
|
+
<th>{{ $t1('手机') }}</th>
|
117
|
+
<td>
|
118
|
+
<el-form-item prop="mobile" :rules="[{ required: false, trigger: 'blur' }]">
|
119
|
+
<el-input size="small" v-model="user.mobile" type="text" maxlength="255" autocomplete="off"
|
120
|
+
lay-verify="required|phone" clearable/>
|
121
|
+
</el-form-item>
|
122
|
+
</td>
|
123
|
+
<th>{{ $t1('设置') }}</th>
|
124
|
+
<td>
|
125
|
+
<el-checkbox :label="$t1('是否启用')" v-model="user.enabled"></el-checkbox>
|
126
|
+
</td>
|
127
|
+
|
128
|
+
</tr>
|
129
|
+
|
130
|
+
<tr>
|
131
|
+
<th>
|
132
|
+
{{ $t1('邮箱') }}
|
133
|
+
</th>
|
134
|
+
<td>
|
135
|
+
<el-form-item prop="email" :rules="[{ required: false, trigger: 'blur' }]">
|
136
|
+
<el-input size="small" v-model="user.email" maxlength="200" clearable/>
|
137
|
+
</el-form-item>
|
138
|
+
</td>
|
139
|
+
<!-- <th v-if="flag!=='2'">
|
140
|
+
GUID
|
141
|
+
</th>
|
142
|
+
<td v-if="flag!=='2'">
|
143
|
+
<el-form-item prop="guid" :rules="[{ required: false, trigger: 'blur' }]">
|
144
|
+
<el-input size="small" v-model="user.guid" maxlength="200" clearable/>
|
145
|
+
</el-form-item>
|
146
|
+
</td>-->
|
147
|
+
<th>{{ $t1('地址') }}</th>
|
148
|
+
<td colspan="3">
|
149
|
+
<el-input size="small" v-model="user.address" class="b" maxlength="255" clearable/>
|
150
|
+
</td>
|
151
|
+
|
152
|
+
</tr>
|
153
|
+
<tr>
|
154
|
+
<th>
|
155
|
+
{{ $t1('国家') }}
|
156
|
+
</th>
|
157
|
+
<td colspan="3">
|
158
|
+
<el-form-item prop="countryName" :rules="[{ required: false, trigger: 'blur' }]">
|
159
|
+
<el-input
|
160
|
+
class="search-input"
|
161
|
+
v-model="user.countryName"
|
162
|
+
clearable
|
163
|
+
@clear="
|
164
|
+
user.countryName = null;
|
165
|
+
user.countryCode = null;
|
166
|
+
"
|
167
|
+
v-el-readonly
|
168
|
+
>
|
169
|
+
<i slot="suffix" class="el-input__icon el-icon-search"
|
170
|
+
@click="showCountryDialog=true"></i>
|
171
|
+
</el-input>
|
172
|
+
</el-form-item>
|
173
|
+
</td>
|
174
|
+
<th>
|
175
|
+
{{ $t1('是否锁定') }}
|
176
|
+
</th>
|
177
|
+
<td>
|
178
|
+
{{ user.locked ? $t1('是') : $t1('否') }}
|
179
|
+
</td>
|
180
|
+
</tr>
|
181
|
+
<tr v-if="userType==2">
|
182
|
+
<th>
|
183
|
+
{{ $t1('签约人') }}
|
184
|
+
</th>
|
185
|
+
<td>
|
186
|
+
<el-form-item prop="signatoryName" :rules="[{ required: false, trigger: 'blur' }]">
|
187
|
+
<el-input size="small" v-model="user.signatoryName" maxlength="200" clearable/>
|
188
|
+
</el-form-item>
|
189
|
+
</td>
|
190
|
+
<th>
|
191
|
+
{{ $t1('签约人电话') }}
|
192
|
+
</th>
|
193
|
+
<td>
|
194
|
+
<el-form-item prop="signatoryMobile" :rules="[{ required: false, trigger: 'blur' }]">
|
195
|
+
<el-input size="small" v-model="user.signatoryMobile" maxlength="200" clearable/>
|
196
|
+
</el-form-item>
|
197
|
+
</td>
|
198
|
+
</tr>
|
199
|
+
<tr>
|
200
|
+
<th>{{ $t1('头像') }}</th>
|
201
|
+
<td colspan="7">
|
202
|
+
<baseUpload :limit="1" accept="image/png, image/jpeg" multi="false" :file.sync="user.headPhotoUrl"
|
203
|
+
dataType="medium"></baseUpload>
|
204
|
+
</td>
|
205
|
+
</tr>
|
206
|
+
<tr>
|
207
|
+
<th>{{ $t1('创建人') }}</th>
|
208
|
+
<td>{{ user.createBy }}</td>
|
209
|
+
<th>{{ $t1('创建时间') }}</th>
|
210
|
+
<td>{{ user.createDate }}</td>
|
211
|
+
<th>{{ $t1('更新人') }}</th>
|
212
|
+
<td>{{ user.modifyBy }}</td>
|
213
|
+
<th>{{ $t1('更新时间') }}</th>
|
214
|
+
<td>{{ user.modifyDate }}</td>
|
215
|
+
</tr>
|
216
|
+
</tbody>
|
217
|
+
</table>
|
218
|
+
</template>
|
219
|
+
</baseTabPane>
|
220
|
+
<baseTabPane :label="$t1('组织信息')">
|
221
|
+
<template #button>
|
222
|
+
<el-button class="button-sty" @click="addCurrentCompany()" icon="el-icon-search" v-if="!hasCurrentCompany">
|
223
|
+
{{ $t1('新增组织权限') }}
|
224
|
+
</el-button>
|
225
|
+
</template>
|
226
|
+
<template #default>
|
227
|
+
<div class="style1">
|
228
|
+
<div class="d-item" v-for="(item,index1) in user.userCompanyInfoDTOs" :key="index1">
|
229
|
+
<div class="title">
|
230
|
+
<b>{{ item.companyName }}</b>
|
231
|
+
<el-button class="button-sty" icon="el-icon-delete" v-if="isCurrentCompany(item.companyCode)"
|
232
|
+
@click="deleteCompany(item,index1)">{{ $t1('删除') }}
|
233
|
+
</el-button>
|
234
|
+
</div>
|
235
|
+
<div class="title-form">
|
236
|
+
<span>
|
237
|
+
<el-form-item label="GUID" :prop="'userCompanyInfoDTOs.'+index1+'.guid'"
|
238
|
+
:rules="[{ required: false, trigger: 'blur' }]">
|
239
|
+
<el-input size="small" v-model="item.guid" maxlength="200" clearable/>
|
240
|
+
</el-form-item>
|
241
|
+
</span>
|
242
|
+
<span>
|
243
|
+
<el-form-item label="是否默认组织" :prop="'userCompanyInfoDTOs.'+index1+'.defaults'"
|
244
|
+
:rules="[{ required: false, trigger: 'blur' }]">
|
245
|
+
<el-checkbox v-model="item.defaults"
|
246
|
+
@change="changeCompanyDefault(item)"></el-checkbox>
|
247
|
+
</el-form-item>
|
248
|
+
</span>
|
249
|
+
</div>
|
250
|
+
<div class="m-2">
|
251
|
+
<div class="d-item" style="width: 65%;">
|
252
|
+
<div class="title">
|
253
|
+
<b>{{ $t1('机构信息') }}</b>
|
254
|
+
<el-button class="button-sty" icon="el-icon-search" @click="showSaleOrgDialog = true"
|
255
|
+
v-if="isCurrentCompany(item.companyCode)">{{ $t1('选择机构') }}
|
256
|
+
</el-button>
|
257
|
+
</div>
|
258
|
+
<div class="grid-h">
|
259
|
+
<vxe-grid
|
260
|
+
:ref="'saleOrgGrid-'+item.companyCode"
|
261
|
+
:data="gridSaleOrgDataMap[item.companyCode]"
|
262
|
+
v-bind="vxeOptionMap['saleOrgGridOption-'+item.companyCode]"
|
263
|
+
@resizable-change="$vxeTableUtil.onColumnWitchChange"
|
264
|
+
@custom="$vxeTableUtil.customHandle">
|
265
|
+
<template #position="{row,rowIndex,$table}">
|
266
|
+
<el-input
|
267
|
+
class="search-input"
|
268
|
+
:value="getSelectPositionName(row)"
|
269
|
+
clearable
|
270
|
+
@clear="
|
271
|
+
row.userSaleOrgPositionDTOs = [];
|
272
|
+
$forceUpdate();
|
273
|
+
"
|
274
|
+
v-el-readonly
|
275
|
+
v-if="companyInfo.companyCode == row.companyCode"
|
276
|
+
>
|
277
|
+
<i slot="suffix" class="el-input__icon el-icon-search"
|
278
|
+
@click="openSelectPositionDialog(row, rowIndex, $table)"></i>
|
279
|
+
</el-input>
|
280
|
+
<template v-else>
|
281
|
+
{{ getSelectPositionName(row) }}
|
282
|
+
</template>
|
283
|
+
</template>
|
284
|
+
</vxe-grid>
|
285
|
+
</div>
|
286
|
+
</div>
|
287
|
+
<div class="d-item" style="width: 35%;">
|
288
|
+
<div class="title">
|
289
|
+
<b>{{ $t1('角色信息') }}</b>
|
290
|
+
<el-button class="button-sty" icon="el-icon-search" @click="showRoleDialog = true"
|
291
|
+
v-if="isCurrentCompany(item.companyCode)">{{ $t1('选择角色') }}
|
292
|
+
</el-button>
|
293
|
+
</div>
|
294
|
+
<div class="grid-h">
|
295
|
+
<vxe-grid
|
296
|
+
:ref="'userRoleGrid-'+item.companyCode"
|
297
|
+
:data="gridRoleDataMap[item.companyCode]"
|
298
|
+
v-bind="vxeOptionMap['userRoleGridOption-'+item.companyCode]"
|
299
|
+
@resizable-change="$vxeTableUtil.onColumnWitchChange"
|
300
|
+
@custom="$vxeTableUtil.customHandle"
|
301
|
+
></vxe-grid>
|
302
|
+
</div>
|
303
|
+
</div>
|
304
|
+
</div>
|
305
|
+
</div>
|
306
|
+
</div>
|
307
|
+
</template>
|
308
|
+
</baseTabPane>
|
309
|
+
</baseTabs>
|
310
|
+
</el-form>
|
311
|
+
<roleDialog v-if="showRoleDialog" :visiable.sync="showRoleDialog" @confirm="confirmRole"
|
312
|
+
:param="roleDialogParam"/>
|
313
|
+
<companyDialog v-if="showCompanyDialog" :visiable.sync="showCompanyDialog" @confirm="confirmInsertCompany"/>
|
314
|
+
<saleOrgDialog v-if="showSaleOrgDialog" :visiable.sync="showSaleOrgDialog" @confirm="confirmInsertSaleOrg"
|
315
|
+
:param="{ queryAll: true }"/>
|
316
|
+
<positionDialog v-if="showPositionDialog" :visiable.sync="showPositionDialog" :rows="positionDialogDatas"
|
317
|
+
@confirm="confirmInsertPosition" :param="{ queryAll: true }"/>
|
318
|
+
<countryDialog v-if="showCountryDialog" :visiable.sync="showCountryDialog"
|
319
|
+
@confirm="confirmCountry" multi="false"/>
|
320
|
+
</div>
|
321
|
+
</template>
|
322
|
+
|
323
|
+
<script>
|
324
|
+
import xeUtils from "xe-utils";
|
325
|
+
import tempStorageButton from "@base/components/tempStorage/index.vue";
|
326
|
+
|
327
|
+
|
328
|
+
export default {
|
329
|
+
name: 'UserEdit',
|
330
|
+
components: {
|
331
|
+
roleDialog: () => import('../../../views/user/role/dialog.vue'),
|
332
|
+
companyDialog: () => import('../../../views/user/company_info/dialog.vue'),
|
333
|
+
saleOrgDialog: () => import('../../../views/user/sale_org/dialog.vue'),
|
334
|
+
positionDialog: () => import('../../../views/user/position/dialog.vue'),
|
335
|
+
countryDialog: () => import('../../../views/user/country/dialog.vue'),
|
336
|
+
tempStorageButton
|
337
|
+
},
|
338
|
+
props: ['_dataId', 'userType', 'flag'],
|
339
|
+
data() {
|
340
|
+
var validatePass = (rule, value, callback) => {
|
341
|
+
const isPassRequired = !this.dataId;
|
342
|
+
if (isPassRequired && (value == '' || value == undefined)) {
|
343
|
+
callback(new Error(this.$t1('密码不能为空')));
|
344
|
+
} else {
|
345
|
+
callback();
|
346
|
+
}
|
347
|
+
this.$refs.editForm.validateField('rePassword');
|
348
|
+
};
|
349
|
+
var validatePass2 = (rule, value, callback) => {
|
350
|
+
const isPassRequired = !this.dataId;
|
351
|
+
const rePassword = value != undefined ? value : '';
|
352
|
+
const password = this.user.password != undefined ? this.user.password : '';
|
353
|
+
|
354
|
+
if (isPassRequired && rePassword == '') {
|
355
|
+
callback(new Error(this.$t1('确认密码不能为空')));
|
356
|
+
} else if (rePassword != password) {
|
357
|
+
callback(new Error(this.$t1('两次输入密码不一致!')));
|
358
|
+
} else {
|
359
|
+
callback();
|
360
|
+
}
|
361
|
+
};
|
362
|
+
|
363
|
+
return {
|
364
|
+
dataId: '',
|
365
|
+
hBtn: true,
|
366
|
+
user: {
|
367
|
+
userCompanyInfoDTOs: [],
|
368
|
+
userSaleOrgDTOs: [],
|
369
|
+
userRoleDTOs: [],
|
370
|
+
gender: null,
|
371
|
+
enabled: true,
|
372
|
+
userType: null,
|
373
|
+
countryName: null,
|
374
|
+
countryCode: null
|
375
|
+
},
|
376
|
+
vxeOption: {},
|
377
|
+
companyInfoOption: {},
|
378
|
+
userRoleOption: {},
|
379
|
+
showRoleDialog: false,
|
380
|
+
showCompanyDialog: false,
|
381
|
+
showSaleOrgDialog: false,
|
382
|
+
showPositionDialog: false,
|
383
|
+
saleOrgPositionIndex: 0,
|
384
|
+
passRules: [{validator: validatePass, trigger: 'blur', required: false}],
|
385
|
+
pass2Rules: [{validator: validatePass2, trigger: 'blur', required: false}],
|
386
|
+
activeName: 'first',
|
387
|
+
userCustomerListDTO: {
|
388
|
+
userCustomerDTOs: []
|
389
|
+
},
|
390
|
+
customerOption: {},
|
391
|
+
showCustomerDialog: false,
|
392
|
+
exportOption: {
|
393
|
+
prefix: USER_PREFIX,
|
394
|
+
title: this.$t1('用户'),
|
395
|
+
codes: ["USEREXCEL", "USERPDF", "USERPRINT", "USERHIPRINT"],
|
396
|
+
param: () => {
|
397
|
+
return [{id: this.dataId}];
|
398
|
+
}
|
399
|
+
},
|
400
|
+
showExtendedProperties: false,
|
401
|
+
radio1: '0',
|
402
|
+
companyInfo: {},
|
403
|
+
vxeOptionMap: {},
|
404
|
+
gridRoleDataMap: {},
|
405
|
+
gridSaleOrgDataMap: {},
|
406
|
+
distributorCode: 'distributor',
|
407
|
+
distributorRole: null,
|
408
|
+
outUserCodes: [],
|
409
|
+
roleDialogParam: {queryAll: true},
|
410
|
+
tempStorageOption: {
|
411
|
+
storageType: "user",
|
412
|
+
data: () => {
|
413
|
+
this.handleData();
|
414
|
+
return this.user;
|
415
|
+
},
|
416
|
+
chooseConfirm: (tempStorageData) => {
|
417
|
+
this.user = tempStorageData;
|
418
|
+
this.gridSaleOrgDataMap = xeUtils.groupBy(this.user.userSaleOrgDTOs, 'companyCode');
|
419
|
+
this.gridRoleDataMap = xeUtils.groupBy(this.user.userRoleDTOs, 'companyCode');
|
420
|
+
},
|
421
|
+
saveConfirm: () => {
|
422
|
+
}
|
423
|
+
},
|
424
|
+
showCountryDialog: false
|
425
|
+
};
|
426
|
+
},
|
427
|
+
computed: {
|
428
|
+
hasCurrentCompany() {
|
429
|
+
return this.user.userCompanyInfoDTOs.find(item => item.companyCode == this.companyInfo.companyCode) != null;
|
430
|
+
}
|
431
|
+
},
|
432
|
+
created() {
|
433
|
+
if (this._dataId && !isNaN(this._dataId)) this.dataId = this._dataId;
|
434
|
+
},
|
435
|
+
async mounted() {
|
436
|
+
|
437
|
+
// this.getEainsGroupDTO();
|
438
|
+
await this.initOutUserRoleCode();
|
439
|
+
await this.initDistributorRole();
|
440
|
+
this.getData();
|
441
|
+
this.getConpanyInfo()
|
442
|
+
},
|
443
|
+
methods: {
|
444
|
+
getData() {
|
445
|
+
if (this.dataId && !isNaN(this.dataId)) {
|
446
|
+
this.isEdit = true;
|
447
|
+
this.$commonHttp({
|
448
|
+
url: USER_PREFIX + `/user/get`,
|
449
|
+
method: `post`,
|
450
|
+
data: {
|
451
|
+
id: this.dataId
|
452
|
+
},
|
453
|
+
isLoading: true,
|
454
|
+
modalStrictly: true,
|
455
|
+
success: res => {
|
456
|
+
let user = res.objx || {};
|
457
|
+
user.userCompanyInfoDTOs = this.user.userCompanyInfoDTOs;
|
458
|
+
user.userSaleOrgDTOs = this.user.userSaleOrgDTOs;
|
459
|
+
user.userRoleDTOs = this.user.userRoleDTOs;
|
460
|
+
this.user = user;
|
461
|
+
this.user.password = '';
|
462
|
+
|
463
|
+
this.showExtendedProperties = true;
|
464
|
+
}
|
465
|
+
});
|
466
|
+
} else {
|
467
|
+
this.user.gender = 1;
|
468
|
+
this.isEdit = false;
|
469
|
+
this.showExtendedProperties = true;
|
470
|
+
}
|
471
|
+
},
|
472
|
+
saveData() {
|
473
|
+
let companyCode = this.companyInfo.companyCode;
|
474
|
+
this.handleData();
|
475
|
+
if (this.userType == 2) {
|
476
|
+
//外部用户
|
477
|
+
let currentUserCompanyInfo = this.user.userCompanyInfoDTOs.find(item => item.companyCode == companyCode)
|
478
|
+
if (currentUserCompanyInfo) {
|
479
|
+
let rows = this.user.userRoleDTOs.filter(item => item.companyCode == companyCode);
|
480
|
+
if (!rows.length) {
|
481
|
+
this.$baseAlert(this.$t1('请维护角色'));
|
482
|
+
return
|
483
|
+
}
|
484
|
+
}
|
485
|
+
|
486
|
+
}
|
487
|
+
this.$refs.editForm.$baseValidate(valid => {
|
488
|
+
if (valid) {
|
489
|
+
this.$baseConfirm(this.$t1('您确定要保存吗?')).then(() => {
|
490
|
+
var url = USER_PREFIX + (this.isEdit ? '/user/update' : '/user/save');
|
491
|
+
this.$http({
|
492
|
+
url: url,
|
493
|
+
method: `post`,
|
494
|
+
data: this.user,
|
495
|
+
isLoading: true,
|
496
|
+
success: res => {
|
497
|
+
this.$message({
|
498
|
+
message: res.content,
|
499
|
+
type: 'success',
|
500
|
+
duration: 500,
|
501
|
+
onClose: t => {
|
502
|
+
if (this.isEdit) {
|
503
|
+
this.$baseReload();
|
504
|
+
} else {
|
505
|
+
this.$baseReload({
|
506
|
+
updateParam: {
|
507
|
+
_dataId: res.objx
|
508
|
+
}
|
509
|
+
});
|
510
|
+
}
|
511
|
+
}
|
512
|
+
});
|
513
|
+
}
|
514
|
+
});
|
515
|
+
});
|
516
|
+
}
|
517
|
+
});
|
518
|
+
},
|
519
|
+
getSaleOrgData() {
|
520
|
+
if (this.dataId) {
|
521
|
+
this.$http({
|
522
|
+
url: USER_PREFIX + '/user/getUserSaleOrg',
|
523
|
+
method: `post`,
|
524
|
+
data: {id: this.dataId},
|
525
|
+
isLoading: true,
|
526
|
+
modalStrictly: true,
|
527
|
+
success: res => {
|
528
|
+
// this.$refs.saleOrgGrid.loadData(res.objx || []);
|
529
|
+
let rows = res.objx || [];
|
530
|
+
if (rows.length) {
|
531
|
+
// this.gridSaleOrgDataMap = xeUtils.groupBy(rows, 'companyCode');
|
532
|
+
Object.assign(this.gridSaleOrgDataMap, xeUtils.groupBy(rows, 'companyCode'));
|
533
|
+
}
|
534
|
+
this.user.userSaleOrgDTOs = rows;
|
535
|
+
}
|
536
|
+
});
|
537
|
+
}
|
538
|
+
},
|
539
|
+
getUserRoleData() {
|
540
|
+
if (this.dataId) {
|
541
|
+
this.$http({
|
542
|
+
url: USER_PREFIX + '/user/getUserRole',
|
543
|
+
method: `post`,
|
544
|
+
data: {id: this.dataId},
|
545
|
+
isLoading: true,
|
546
|
+
modalStrictly: true,
|
547
|
+
success: res => {
|
548
|
+
let rows = res.objx || [];
|
549
|
+
if (rows.length) {
|
550
|
+
// this.gridRoleDataMap = xeUtils.groupBy(rows, 'companyCode');
|
551
|
+
Object.assign(this.gridRoleDataMap, xeUtils.groupBy(rows, 'companyCode'));
|
552
|
+
}
|
553
|
+
this.user.userRoleDTOs = rows;
|
554
|
+
}
|
555
|
+
});
|
556
|
+
}
|
557
|
+
},
|
558
|
+
deleteSaleOrgItem(row, index, $table) {
|
559
|
+
$table.remove(row);
|
560
|
+
this.gridSaleOrgDataMap[row.companyCode].splice(index, 1);
|
561
|
+
},
|
562
|
+
getCompanyInfoData(callback) {
|
563
|
+
if (this.dataId) {
|
564
|
+
this.$http({
|
565
|
+
url: USER_PREFIX + '/user/getUserCompanyInfo',
|
566
|
+
method: `post`,
|
567
|
+
data: {id: this.dataId},
|
568
|
+
isLoading: true,
|
569
|
+
modalStrictly: true,
|
570
|
+
success: res => {
|
571
|
+
let rows = res.objx || [];
|
572
|
+
rows.forEach(row => {
|
573
|
+
this.gridRoleDataMap[row.companyCode] = [];
|
574
|
+
this.gridSaleOrgDataMap[row.companyCode] = [];
|
575
|
+
})
|
576
|
+
this.user.userCompanyInfoDTOs = rows;
|
577
|
+
callback && callback();
|
578
|
+
}
|
579
|
+
});
|
580
|
+
}
|
581
|
+
},
|
582
|
+
initSaleOrg(companyCode) {
|
583
|
+
if (this.vxeOptionMap['saleOrgGridOption-' + companyCode]) {
|
584
|
+
return;
|
585
|
+
}
|
586
|
+
let tableRef = 'saleOrgGrid-' + companyCode;
|
587
|
+
const tableOption = {
|
588
|
+
vue: this,
|
589
|
+
tableRef: tableRef,
|
590
|
+
tableName: 'editUser-saleOrgGrid-' + companyCode,
|
591
|
+
columns: [
|
592
|
+
{type: 'checkbox', fixed: 'left', width: 48, resizable: false},
|
593
|
+
{title: this.$t1('机构名称'), field: 'saleOrgName', width: 200},
|
594
|
+
{title: this.$t1('机构编码'), field: 'sn', width: 200},
|
595
|
+
{title: this.$t1('上级机构'), field: 'treePathName', width: 200},
|
596
|
+
{
|
597
|
+
title: this.$t1('岗位'),
|
598
|
+
field: 'position',
|
599
|
+
width: 150,
|
600
|
+
slots: {
|
601
|
+
default: 'position'
|
602
|
+
}
|
603
|
+
},
|
604
|
+
{
|
605
|
+
title: this.$t1('是否默认'),
|
606
|
+
field: 'defaults',
|
607
|
+
width: 120,
|
608
|
+
slots: {
|
609
|
+
default: ({row, $table, rowIndex}) => {
|
610
|
+
var isDefault = row.defaults || false;
|
611
|
+
let disabled = this.companyInfo.companyCode != row.companyCode;
|
612
|
+
return [
|
613
|
+
<el-checkbox
|
614
|
+
v-model={isDefault}
|
615
|
+
disabled={disabled}
|
616
|
+
onchange={() => {
|
617
|
+
this.gridSaleOrgDataMap[row.companyCode].forEach((item, index) => {
|
618
|
+
if (index !== rowIndex) {
|
619
|
+
item.defaults = false;
|
620
|
+
}
|
621
|
+
});
|
622
|
+
this.$nextTick(()=>{
|
623
|
+
row.defaults = true;
|
624
|
+
})
|
625
|
+
}}
|
626
|
+
/>
|
627
|
+
];
|
628
|
+
}
|
629
|
+
}
|
630
|
+
},
|
631
|
+
{
|
632
|
+
width: 47,
|
633
|
+
fixed: 'right',
|
634
|
+
title: '',
|
635
|
+
sortable: false,
|
636
|
+
slots: {
|
637
|
+
default: ({row, rowIndex, $table}) => {
|
638
|
+
if (this.companyInfo.companyCode == row.companyCode) {
|
639
|
+
return [
|
640
|
+
<a
|
641
|
+
href="javascript:void(0);"
|
642
|
+
class="a-link"
|
643
|
+
onclick={() => {
|
644
|
+
this.deleteSaleOrgItem(row, rowIndex, $table);
|
645
|
+
}}
|
646
|
+
>
|
647
|
+
<el-tooltip enterable={false} effect="dark" content={this.$t1('删除')} placement="top"
|
648
|
+
popper-class="tooltip-skin">
|
649
|
+
<i class="el-icon-delete"/>
|
650
|
+
</el-tooltip>
|
651
|
+
</a>
|
652
|
+
];
|
653
|
+
}
|
654
|
+
}
|
655
|
+
}
|
656
|
+
}
|
657
|
+
]
|
658
|
+
};
|
659
|
+
this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
|
660
|
+
// this.vxeOptionMap['saleOrgGridOption-'+companyCode] = opts;
|
661
|
+
this.$set(this.vxeOptionMap, 'saleOrgGridOption-' + companyCode, opts);
|
662
|
+
});
|
663
|
+
|
664
|
+
},
|
665
|
+
initUserRole(companyCode) {
|
666
|
+
if (this.vxeOptionMap['userRoleGridOption-' + companyCode]) {
|
667
|
+
return;
|
668
|
+
}
|
669
|
+
let userType = this.userType;
|
670
|
+
const tableOption = {
|
671
|
+
vue: this,
|
672
|
+
tableRef: 'userRoleGrid-' + companyCode,
|
673
|
+
tableName: 'editUser-userRoleGrid-' + companyCode,
|
674
|
+
columns: [
|
675
|
+
{type: 'checkbox', fixed: 'left', width: 48, resizable: false},
|
676
|
+
{
|
677
|
+
title: this.$t1('角色名称'),
|
678
|
+
field: 'name',
|
679
|
+
width: 200,
|
680
|
+
slots: {
|
681
|
+
default: ({row}) => {
|
682
|
+
if (!row.isAdd) {
|
683
|
+
return row.roleName;
|
684
|
+
} else {
|
685
|
+
return row.name;
|
686
|
+
}
|
687
|
+
}
|
688
|
+
}
|
689
|
+
},
|
690
|
+
{
|
691
|
+
width: 47,
|
692
|
+
fixed: 'right',
|
693
|
+
title: '',
|
694
|
+
sortable: false,
|
695
|
+
slots: {
|
696
|
+
default: ({row, rowIndex, $table}) => {
|
697
|
+
if (this.companyInfo.companyCode == row.companyCode) {
|
698
|
+
return [
|
699
|
+
<a
|
700
|
+
href="javascript:void(0);"
|
701
|
+
class="a-link"
|
702
|
+
onclick={() => {
|
703
|
+
this.deleteRoleItem(row, rowIndex, $table);
|
704
|
+
}}
|
705
|
+
>
|
706
|
+
<el-tooltip enterable={false} effect="dark" content={this.$t1('删除')} placement="top"
|
707
|
+
popper-class="tooltip-skin">
|
708
|
+
<i class="el-icon-delete"/>
|
709
|
+
</el-tooltip>
|
710
|
+
</a>
|
711
|
+
];
|
712
|
+
}
|
713
|
+
}
|
714
|
+
}
|
715
|
+
}
|
716
|
+
]
|
717
|
+
};
|
718
|
+
this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
|
719
|
+
// this.vxeOptionMap['userRoleGridOption-'+companyCode] = opts;
|
720
|
+
this.$set(this.vxeOptionMap, 'userRoleGridOption-' + companyCode, opts);
|
721
|
+
});
|
722
|
+
},
|
723
|
+
confirmRole(rows) {
|
724
|
+
if (rows.length > 0) {
|
725
|
+
let outUserCodes = this.outUserCodes;
|
726
|
+
if (this.userType === 1) {
|
727
|
+
//组织用户
|
728
|
+
rows = rows.filter(row => !outUserCodes.includes(row.code));
|
729
|
+
} else if (this.userType === 2) {
|
730
|
+
//外部用户
|
731
|
+
rows = rows.filter(row => outUserCodes.includes(row.code));
|
732
|
+
}
|
733
|
+
let companyCode = this.companyInfo.companyCode;
|
734
|
+
const $grid = this.$refs['userRoleGrid-' + companyCode][0];
|
735
|
+
const tableData = this.gridRoleDataMap[companyCode];
|
736
|
+
const map = {};
|
737
|
+
tableData.forEach(function (item) {
|
738
|
+
map[item.roleId] = 1;
|
739
|
+
});
|
740
|
+
var items = [];
|
741
|
+
rows.forEach(row => {
|
742
|
+
const item = {
|
743
|
+
roleId: row.id,
|
744
|
+
roleName: row.name,
|
745
|
+
companyCode: companyCode,
|
746
|
+
companyName: row.companyName
|
747
|
+
};
|
748
|
+
if (!map[item.roleId]) {
|
749
|
+
items.push(item);
|
750
|
+
}
|
751
|
+
});
|
752
|
+
// $grid.insertAt(items, -1);
|
753
|
+
// this.user.userRoleDTOs = this.user.userRoleDTOs.concat(items);
|
754
|
+
this.gridRoleDataMap[companyCode] = tableData.concat(items)
|
755
|
+
$grid.loadData(this.gridRoleDataMap[companyCode])
|
756
|
+
}
|
757
|
+
},
|
758
|
+
deleteRole(tableRef) {
|
759
|
+
this.$baseConfirm(this.$t1('您确定要删除吗?')).then(() => {
|
760
|
+
/*const $grid = this.$refs.userRoleGrid;
|
761
|
+
$grid.removeCheckboxRow();
|
762
|
+
this.user.userRoleDTOs = $grid.getTableData().fullData;*/
|
763
|
+
let companyCode = this.companyInfo.companyCode;
|
764
|
+
const $grid = this.$refs[tableRef][0];
|
765
|
+
$grid.removeCheckboxRow();
|
766
|
+
this.gridRoleDataMap[companyCode] = $grid.getTableData().fullData;
|
767
|
+
|
768
|
+
});
|
769
|
+
},
|
770
|
+
deleteRoleItem(row, index, $table) {
|
771
|
+
$table.remove(row);
|
772
|
+
this.gridRoleDataMap[row.companyCode].splice(index, 1);
|
773
|
+
},
|
774
|
+
confirmInsertCompany(rows, callback) {
|
775
|
+
if (rows.length > 0) {
|
776
|
+
const tableData = this.user.userCompanyInfoDTOs;
|
777
|
+
const map = {};
|
778
|
+
tableData.forEach(function (item) {
|
779
|
+
map[item.companyCode] = 1;
|
780
|
+
});
|
781
|
+
var items = [];
|
782
|
+
rows.forEach(row => {
|
783
|
+
const item = {companyCode: row.companyCode, companyName: row.companyName, guid: null, defaults: false};
|
784
|
+
if (!map[item.companyCode]) {
|
785
|
+
items.push(item);
|
786
|
+
}
|
787
|
+
this.gridRoleDataMap[item.companyCode] = []
|
788
|
+
this.gridSaleOrgDataMap[item.companyCode] = []
|
789
|
+
});
|
790
|
+
// $grid.insertAt(items, -1);
|
791
|
+
this.user.userCompanyInfoDTOs.splice(0, 0, ...items);
|
792
|
+
if (this.user.userCompanyInfoDTOs.length == 1) {
|
793
|
+
this.user.userCompanyInfoDTOs[0].defaults = true
|
794
|
+
}
|
795
|
+
// this.user.userCompanyInfoDTOs = this.user.userCompanyInfoDTOs.concat(items);
|
796
|
+
}
|
797
|
+
callback && callback();
|
798
|
+
},
|
799
|
+
deleteCompany(row, index) {
|
800
|
+
let companyCode = row.companyCode;
|
801
|
+
this.user.userCompanyInfoDTOs.splice(index, 1);
|
802
|
+
this.gridSaleOrgDataMap[row.companyCode] = [];
|
803
|
+
this.gridRoleDataMap[row.companyCode] = [];
|
804
|
+
this.user.userSaleOrgDTOs = this.user.userSaleOrgDTOs.filter(item => item.companyCode != companyCode);
|
805
|
+
this.user.userRoleDTOs = this.user.userRoleDTOs.filter(item => item.companyCode != companyCode);
|
806
|
+
},
|
807
|
+
confirmInsertSaleOrg(rows) {
|
808
|
+
if (rows.length > 0) {
|
809
|
+
let companyCode = this.companyInfo.companyCode;
|
810
|
+
const $grid = this.$refs['saleOrgGrid-' + companyCode][0];
|
811
|
+
const tableData = this.gridSaleOrgDataMap[companyCode] || [];
|
812
|
+
const map = {};
|
813
|
+
tableData.forEach(function (item) {
|
814
|
+
map[item.saleOrgId] = 1;
|
815
|
+
});
|
816
|
+
|
817
|
+
let roleMap = {};
|
818
|
+
let newUserRoleDTOs = [];
|
819
|
+
var items = [];
|
820
|
+
|
821
|
+
rows.forEach((row, index) => {
|
822
|
+
const item = {
|
823
|
+
companyCode: companyCode,
|
824
|
+
companyName: row.companyName,
|
825
|
+
defaults: false,
|
826
|
+
saleOrgName: row.name,
|
827
|
+
treePathName: row.treePathName,
|
828
|
+
userSaleOrgPositionDTOs: [],
|
829
|
+
saleOrgId: row.id,
|
830
|
+
sn: row.sn
|
831
|
+
};
|
832
|
+
|
833
|
+
if (!map[item.saleOrgId]) {
|
834
|
+
items.push(item);
|
835
|
+
if (row.roleId && !roleMap[row.roleId]) {
|
836
|
+
const roleItem = {
|
837
|
+
id: row.roleId,
|
838
|
+
name: row.roleName,
|
839
|
+
companyCode: companyCode,
|
840
|
+
companyName: row.companyName
|
841
|
+
};
|
842
|
+
roleMap[row.roleId] = true;
|
843
|
+
newUserRoleDTOs.push(roleItem);
|
844
|
+
}
|
845
|
+
}
|
846
|
+
});
|
847
|
+
if (items.length > 0 && tableData.length == 0) {
|
848
|
+
items[0].defaults = true;
|
849
|
+
}
|
850
|
+
// this.user.userSaleOrgDTOs.push(...items);
|
851
|
+
this.gridSaleOrgDataMap[companyCode] = tableData.concat(items)
|
852
|
+
$grid.loadData(this.gridSaleOrgDataMap[companyCode])
|
853
|
+
this.confirmRole(newUserRoleDTOs);
|
854
|
+
}
|
855
|
+
},
|
856
|
+
openSelectPositionDialog(row, rowIndex, $table) {
|
857
|
+
const userSaleOrgPositionDTOs = row.userSaleOrgPositionDTOs || [];
|
858
|
+
const items = [];
|
859
|
+
userSaleOrgPositionDTOs.forEach(userSaleOrgPositionDTO => {
|
860
|
+
const item = {
|
861
|
+
companyCode: userSaleOrgPositionDTO.companyCode,
|
862
|
+
companyName: userSaleOrgPositionDTO.companyName,
|
863
|
+
name: userSaleOrgPositionDTO.positionName,
|
864
|
+
code: userSaleOrgPositionDTO.code,
|
865
|
+
id: userSaleOrgPositionDTO.positionId
|
866
|
+
};
|
867
|
+
items.push(item);
|
868
|
+
});
|
869
|
+
|
870
|
+
this.positionDialogDatas = items;
|
871
|
+
this.saleOrgPositionIndex = rowIndex;
|
872
|
+
this.showPositionDialog = true;
|
873
|
+
},
|
874
|
+
confirmInsertPosition(rows) {
|
875
|
+
let companyCode = this.companyInfo.companyCode;
|
876
|
+
const saleOrgPositionIndex = this.saleOrgPositionIndex;
|
877
|
+
const tableData = this.gridSaleOrgDataMap[companyCode];
|
878
|
+
if (rows.length > 0) {
|
879
|
+
const oldPositions = tableData[saleOrgPositionIndex].userSaleOrgPositionDTOs || [];
|
880
|
+
const map = {};
|
881
|
+
oldPositions.forEach(function (item) {
|
882
|
+
map[item.positionId] = item;
|
883
|
+
});
|
884
|
+
var oItems = [];
|
885
|
+
var items = [];
|
886
|
+
rows.forEach(row => {
|
887
|
+
const item = {
|
888
|
+
companyCode: row.companyCode,
|
889
|
+
companyName: row.companyName,
|
890
|
+
positionName: row.name,
|
891
|
+
code: row.code,
|
892
|
+
positionId: row.id
|
893
|
+
};
|
894
|
+
|
895
|
+
if (!map[item.positionId]) {
|
896
|
+
items.push(item);
|
897
|
+
} else {
|
898
|
+
oItems.push(map[item.positionId]);
|
899
|
+
}
|
900
|
+
});
|
901
|
+
tableData[saleOrgPositionIndex].userSaleOrgPositionDTOs = oItems.concat(items);
|
902
|
+
} else {
|
903
|
+
tableData[saleOrgPositionIndex].userSaleOrgPositionDTOs = [];
|
904
|
+
}
|
905
|
+
this.$forceUpdate();
|
906
|
+
},
|
907
|
+
getSelectPositionName(row) {
|
908
|
+
var userSaleOrgPositions = row.userSaleOrgPositionDTOs || [];
|
909
|
+
var allName = '';
|
910
|
+
userSaleOrgPositions.forEach(function (pItem, pIndex) {
|
911
|
+
allName = allName + ',' + pItem.positionName;
|
912
|
+
});
|
913
|
+
if (allName) {
|
914
|
+
allName = allName.substr(1);
|
915
|
+
}
|
916
|
+
return allName;
|
917
|
+
},
|
918
|
+
getConpanyInfo() {
|
919
|
+
this.$http({
|
920
|
+
url: USER_PREFIX + '/company_info/getCurrent',
|
921
|
+
method: `post`,
|
922
|
+
isLoading: true,
|
923
|
+
success: res => {
|
924
|
+
this.companyInfo = res.objx || {};
|
925
|
+
let companyCode = this.companyInfo.companyCode;
|
926
|
+
if (!this.isEdit) {
|
927
|
+
this.addCurrentCompany();
|
928
|
+
} else {
|
929
|
+
this.getCompanyInfoData(() => {
|
930
|
+
this.getUserRoleData();
|
931
|
+
this.getSaleOrgData();
|
932
|
+
setTimeout(() => {
|
933
|
+
this.user.userCompanyInfoDTOs.forEach(userCompanyInfoDTO => {
|
934
|
+
this.initSaleOrg(userCompanyInfoDTO.companyCode);
|
935
|
+
this.initUserRole(userCompanyInfoDTO.companyCode);
|
936
|
+
})
|
937
|
+
}, 100)
|
938
|
+
});
|
939
|
+
}
|
940
|
+
}
|
941
|
+
});
|
942
|
+
},
|
943
|
+
isCurrentCompany(companyCode) {
|
944
|
+
return this.companyInfo.companyCode == companyCode;
|
945
|
+
},
|
946
|
+
addCurrentCompany(callback) {
|
947
|
+
this.confirmInsertCompany([this.companyInfo], callback);
|
948
|
+
setTimeout(() => {
|
949
|
+
this.initSaleOrg(this.companyInfo.companyCode);
|
950
|
+
this.initUserRole(this.companyInfo.companyCode);
|
951
|
+
setTimeout(() => {
|
952
|
+
if (this.userType === 2) {
|
953
|
+
//经销商
|
954
|
+
if (this.distributorRole) {
|
955
|
+
this.confirmRole([this.distributorRole]);
|
956
|
+
}
|
957
|
+
}
|
958
|
+
}, 100)
|
959
|
+
}, 100)
|
960
|
+
|
961
|
+
|
962
|
+
},
|
963
|
+
handleData() {
|
964
|
+
let saleOrgs = [];
|
965
|
+
Object.keys(this.gridSaleOrgDataMap).forEach(companyCode => {
|
966
|
+
saleOrgs.push(...this.gridSaleOrgDataMap[companyCode])
|
967
|
+
});
|
968
|
+
let roles = [];
|
969
|
+
Object.keys(this.gridRoleDataMap).forEach(companyCode => {
|
970
|
+
roles.push(...this.gridRoleDataMap[companyCode])
|
971
|
+
});
|
972
|
+
this.user.userRoleDTOs = roles;
|
973
|
+
this.user.userSaleOrgDTOs = saleOrgs
|
974
|
+
},
|
975
|
+
initDistributorRole() {
|
976
|
+
if (this.outUserCodes && this.outUserCodes.length == 1) {
|
977
|
+
return this.$http({
|
978
|
+
url: USER_PREFIX + '/role/list',
|
979
|
+
method: 'post',
|
980
|
+
success: res => {
|
981
|
+
let roleList = res.objx || [];
|
982
|
+
let distributorCode = this.outUserCodes[0];
|
983
|
+
this.distributorRole = roleList.find(item => item.code == distributorCode);
|
984
|
+
}
|
985
|
+
});
|
986
|
+
}
|
987
|
+
},
|
988
|
+
async initOutUserRoleCode() {
|
989
|
+
//初始化外部用户编码
|
990
|
+
return this.$http({
|
991
|
+
url: USER_PREFIX + '/system_parameter/getByCode',
|
992
|
+
method: 'post',
|
993
|
+
data: {"code": "outUserRoleCode"},
|
994
|
+
success: res => {
|
995
|
+
let value = (!res.objx || !res.objx.value) ? "distributor" : res.objx.value;
|
996
|
+
let codes = value.split(',');
|
997
|
+
this.outUserCodes = codes;//外部用户编码
|
998
|
+
this.initRoleDialogParam();//初始化角色弹框的查询参数
|
999
|
+
}
|
1000
|
+
});
|
1001
|
+
},
|
1002
|
+
initRoleDialogParam() {
|
1003
|
+
//初始化角色弹框的查询参数
|
1004
|
+
if (this.userType == 1) {
|
1005
|
+
//组织用户
|
1006
|
+
this.roleDialogParam = {
|
1007
|
+
queryAll: true,
|
1008
|
+
neCodes: [...this.outUserCodes]
|
1009
|
+
};
|
1010
|
+
} else if (this.userType == 2) {
|
1011
|
+
//外部用户
|
1012
|
+
this.roleDialogParam = {
|
1013
|
+
queryAll: true,
|
1014
|
+
eqCodes: [...this.outUserCodes]
|
1015
|
+
};
|
1016
|
+
}
|
1017
|
+
},
|
1018
|
+
unlock() {
|
1019
|
+
this.$baseConfirm(this.$t1('您确定要解锁吗?')).then(() => {
|
1020
|
+
var url = USER_PREFIX + '/user/unlockLoginAccount';
|
1021
|
+
this.$http({
|
1022
|
+
url: url,
|
1023
|
+
method: `post`,
|
1024
|
+
data: {
|
1025
|
+
id: this.user.id
|
1026
|
+
},
|
1027
|
+
isLoading: true,
|
1028
|
+
success: res => {
|
1029
|
+
this.$message({
|
1030
|
+
message: res.content,
|
1031
|
+
type: 'success',
|
1032
|
+
duration: 500,
|
1033
|
+
onClose: t => {
|
1034
|
+
this.$baseReload();
|
1035
|
+
}
|
1036
|
+
});
|
1037
|
+
}
|
1038
|
+
});
|
1039
|
+
});
|
1040
|
+
},
|
1041
|
+
confirmCountry(rows) {
|
1042
|
+
if (rows.length) {
|
1043
|
+
let row = rows[0];
|
1044
|
+
this.user.countryName = row.countryName;
|
1045
|
+
this.user.countryCode = row.countryCode;
|
1046
|
+
}
|
1047
|
+
},
|
1048
|
+
changeCompanyDefault(item) {
|
1049
|
+
let companyCode = item.companyCode
|
1050
|
+
if (item.defaults) {
|
1051
|
+
this.user.userCompanyInfoDTOs.forEach(row => {
|
1052
|
+
row.defaults = row.companyCode == companyCode;
|
1053
|
+
})
|
1054
|
+
}
|
1055
|
+
|
1056
|
+
}
|
1057
|
+
}
|
1058
|
+
};
|
1059
|
+
</script>
|