cloud-web-corejs 1.0.69 → 1.0.70
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 +2 -2
- package/src/components/VabUpload/mixins.js +1 -1
- package/src/components/excelExport/mixins.js +1 -2
- package/src/components/fileLibrary/index.vue +3 -3
- package/src/components/fileLibrary/mixins/fileObjAuthDialogMixin.js +0 -2
- package/src/components/fileLibrary/mixins/propertiesDialogMixins.js +2 -1
- package/src/components/jsonImport/index.js +17 -17
- package/src/components/jsonImport/mixins.js +1 -1
- package/src/components/table/index.js +1 -1
- package/src/components/xform/form-designer/form-widget/dialog/importDialog.vue +35 -5
- package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin.js +3 -1
- package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +4 -1
- package/src/components/xform/form-designer/form-widget/field-widget/table-export-button-widget.vue +2 -1
- package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +8 -6
- package/src/components/xform/form-designer/setting-panel/form-setting.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +6 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +13 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onAfterConfirmFile-editor.vue +5 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import-button-editor.vue +3 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/table-export-button-editor.vue +26 -7
- package/src/components/xform/form-designer/setting-panel/property-editor/wfFlag-editor.vue +103 -18
- package/src/components/xform/form-render/container-item/data-table-item.vue +5 -4
- package/src/components/xform/form-render/container-item/data-table-mixin.js +1 -1
- package/src/components/xform/form-render/indexMixin.js +1 -1
- package/src/mixins/selectDialog/index.js +1 -1
- package/src/store/config/index.js +1 -1
- package/src/store/modules/permission.js +1 -1
- package/src/utils/request.js +1 -1
- package/src/views/bd/setting/form_template/batchWfObjConfigDialog.vue +2 -2
- package/src/views/bd/setting/form_template/edit.vue +6 -2
- package/src/views/bd/setting/form_template/editWfObjConfigDialog.vue +2 -2
- package/src/views/bd/setting/form_template/list.vue +4 -2
- package/src/views/bd/setting/form_template/mixins/batchWfObjConfigDialog.js +1 -1
- package/src/views/bd/setting/form_template/mixins/edit.js +1 -1
- package/src/views/bd/setting/form_template/mixins/list.js +1 -1
- package/src/views/bd/setting/form_template/mixins/wf_list.js +1 -1
- package/src/views/bd/setting/form_template/wfObjConfigDialog.vue +4 -4
- package/src/views/bd/setting/form_template/wf_list.vue +1 -1
- package/src/views/bd/setting/table_model/edit.vue +1 -1
- package/src/views/bd/setting/table_model/list.vue +4 -2
- package/src/views/bd/setting/table_model/mixins/list.js +14 -14
- package/src/views/user/bill_setting/edit.vue +1 -1
- package/src/views/user/bill_setting/list.vue +1 -1
- package/src/views/user/common_attribute/itemEdit.vue +2 -2
- package/src/views/user/common_attribute/list.vue +1 -1
- package/src/views/user/common_script/edit.vue +1 -1
- package/src/views/user/common_script/list.vue +1 -1
- package/src/views/user/company_info/dialog.vue +19 -9
- package/src/views/user/company_info/edit.vue +1 -1
- package/src/views/user/extend_datasource/dialog.vue +1 -0
- package/src/views/user/extend_datasource/edit.vue +3 -0
- package/src/views/user/extend_datasource/list.vue +2 -1
- package/src/views/user/groups/edit.vue +2 -0
- package/src/views/user/groups/list.vue +1 -0
- package/src/views/user/home/dev.vue +29 -0
- package/src/views/user/home/index.vue +16 -6
- package/src/views/user/outLink/index.vue +17 -0
- package/src/views/user/push_setting/list.vue +2 -2
- package/src/views/user/user/edit.vue +2 -2
- package/src/views/user/user/form_edit.vue +117 -49
- package/src/views/user/user/form_list.vue +1 -0
- package/src/views/user/user/info.vue +21 -91
- package/src/views/user/user/list.vue +563 -563
@@ -1,563 +1,563 @@
|
|
1
|
-
<template>
|
2
|
-
<div id="containt">
|
3
|
-
<el-tabs v-model="activeName" class="tab-box">
|
4
|
-
<el-tab-pane :label="$t1('常规')" name="first">
|
5
|
-
<editView v-if="showEdit" visible-key="showEdit" :_dataId.sync="dataId" :parent-target="_self"
|
6
|
-
@reload="$reloadHandle" :userType="userType" :flag="flag"></editView>
|
7
|
-
</el-tab-pane>
|
8
|
-
<el-tab-pane :label="$t1('列表')" name="second">
|
9
|
-
<div class="tree-box fl">
|
10
|
-
<div class="tit" @click="clearNodeClick"><b>{{ $t1('机构分类') }}</b></div>
|
11
|
-
<el-tree
|
12
|
-
:props="defaultProps"
|
13
|
-
:load="loadNode"
|
14
|
-
node-key="id"
|
15
|
-
ref="tree"
|
16
|
-
highlight-current
|
17
|
-
lazy
|
18
|
-
:expand-on-click-node="false"
|
19
|
-
@node-click="handleNodeClick"
|
20
|
-
class="tree-list"
|
21
|
-
icon-class="el-icon-arrow-down"
|
22
|
-
></el-tree>
|
23
|
-
</div>
|
24
|
-
<label id="labBtn">
|
25
|
-
<div class="icon">
|
26
|
-
<i class="el-icon-more"></i>
|
27
|
-
<i class="el-icon-more"></i>
|
28
|
-
</div>
|
29
|
-
</label>
|
30
|
-
<div class="main-right fr" style="padding-left:6px;">
|
31
|
-
<div class="grid-height">
|
32
|
-
<vxe-grid
|
33
|
-
id="table-m1"
|
34
|
-
ref="table-m1"
|
35
|
-
:auto-resize="true"
|
36
|
-
v-bind="vxeOption"
|
37
|
-
@resizable-change="$vxeTableUtil.onColumnWitchChange"
|
38
|
-
@custom="$vxeTableUtil.customHandle"
|
39
|
-
>
|
40
|
-
<template #form>
|
41
|
-
<tableForm :formData.sync="formData" :advancedFormData.sync="advancedFormData"
|
42
|
-
@searchEvent="searchEvent" @resetEvent="resetEvent">
|
43
|
-
<template #buttonLeft>
|
44
|
-
<vxe-button status="primary" class="button-sty" icon="el-icon-plus" @click="openEditDialog">
|
45
|
-
{{ $t1('新增') }}
|
46
|
-
</vxe-button>
|
47
|
-
<base-table-export :option="{ title: $t1('账户导出'), targetRef: 'table-m1'}"
|
48
|
-
:parent-target="_self"/>
|
49
|
-
<vxe-button status="primary" class="button-sty" icon="el-icon-download" @click="importExcel">
|
50
|
-
{{ $t1('导入') }}
|
51
|
-
</vxe-button>
|
52
|
-
<base-input-export :option="exportOption" :parent-target="_self"/>
|
53
|
-
</template>
|
54
|
-
<template #buttonRight>
|
55
|
-
<vxe-button icon="el-icon-brush" class="button-sty" @click="resetEvent" type="text" status="primary"
|
56
|
-
plain>{{ $t1('重置') }}
|
57
|
-
</vxe-button>
|
58
|
-
<vxe-button status="warning" icon="el-icon-search" class="button-sty" @click="searchEvent">
|
59
|
-
{{ $t1('搜索') }}
|
60
|
-
</vxe-button>
|
61
|
-
</template>
|
62
|
-
</tableForm>
|
63
|
-
</template>
|
64
|
-
</vxe-grid>
|
65
|
-
</div>
|
66
|
-
</div>
|
67
|
-
</el-tab-pane>
|
68
|
-
</el-tabs>
|
69
|
-
</div>
|
70
|
-
</template>
|
71
|
-
|
72
|
-
<script>
|
73
|
-
import editView from './form_edit.vue';
|
74
|
-
import {treeScollx} from '@base/utils/global.js';
|
75
|
-
import tableForm from "@base/components/table/tableForm";
|
76
|
-
|
77
|
-
export default {
|
78
|
-
name: 'user:form_list',
|
79
|
-
props: {
|
80
|
-
userType: {
|
81
|
-
type: Number
|
82
|
-
},
|
83
|
-
flag: String
|
84
|
-
},
|
85
|
-
components: {
|
86
|
-
tableForm,
|
87
|
-
editView: () => import('./edit.vue')
|
88
|
-
},
|
89
|
-
created() {
|
90
|
-
|
91
|
-
},
|
92
|
-
activated() {
|
93
|
-
// this.initTableList();
|
94
|
-
},
|
95
|
-
async mounted() {
|
96
|
-
treeScollx({target: this, type: 'default'});
|
97
|
-
await this.initOutUserRoleCode();
|
98
|
-
this.getRoleList();
|
99
|
-
this.initTableList();
|
100
|
-
},
|
101
|
-
data() {
|
102
|
-
return {
|
103
|
-
exportOption: {
|
104
|
-
prefix: USER_PREFIX,
|
105
|
-
tableRef: 'table-m1',
|
106
|
-
title: this.$t1('用户'),
|
107
|
-
codes: ["USEREXCEL", "USERPDF", "USERPRINT", "USERHIPRINT", "USERJDPRINT", "USERPDDPRINT", "USERVIPPRINT"],
|
108
|
-
onBeforePrint: (done, {etCode, etType}) => {
|
109
|
-
/*etType: 2 菜鸟打印,3 网页打印,6 京东打印*/
|
110
|
-
done();
|
111
|
-
},
|
112
|
-
onAfterPrint: ({etCode, etType}, close) => {
|
113
|
-
/*etType: 2 菜鸟打印,3 网页打印,6 京东打印*/
|
114
|
-
/*close();//关闭弹框*/
|
115
|
-
}
|
116
|
-
},
|
117
|
-
printOption: {
|
118
|
-
prefix: USER_PREFIX,
|
119
|
-
tableRef: 'table-m1',
|
120
|
-
param: {
|
121
|
-
type: 'print',
|
122
|
-
code: 'USERPRINT',
|
123
|
-
param: 'tableDefault'
|
124
|
-
}
|
125
|
-
},
|
126
|
-
showEdit: false,
|
127
|
-
activeName: 'second',
|
128
|
-
showUpload: true,
|
129
|
-
uploadSize: 10,
|
130
|
-
value10: '',
|
131
|
-
dataId: '',
|
132
|
-
tp: false,
|
133
|
-
showUserDialog: false,
|
134
|
-
nickName: 'dd',
|
135
|
-
formData: {saleOrgName: null, roleCodes: []},
|
136
|
-
vxeOption: {
|
137
|
-
className: 'list-table'
|
138
|
-
},
|
139
|
-
defaultProps: {
|
140
|
-
label: 'name', //这里是树结构中需显示的数据(即接口返回的需展示在页面上的参数)
|
141
|
-
children: [],
|
142
|
-
isLeaf: 'leaf'
|
143
|
-
},
|
144
|
-
showAdvancedSearch: false,
|
145
|
-
advancedFormData: {},
|
146
|
-
roleList: [],
|
147
|
-
distributorCode: 'distributor',
|
148
|
-
outUserCodes: []
|
149
|
-
};
|
150
|
-
},
|
151
|
-
methods: {
|
152
|
-
searchEvent() {
|
153
|
-
this.$refs['table-m1'].commitProxy('reload');
|
154
|
-
},
|
155
|
-
resetEvent() {
|
156
|
-
this.formData = {};
|
157
|
-
this.advancedFormData = {};
|
158
|
-
this.$refs.tree.setCurrentKey();
|
159
|
-
this.$refs['table-m1'].commitProxy('reload');
|
160
|
-
},
|
161
|
-
openEditDialog(id) {
|
162
|
-
this.dataId = !id || typeof id == 'object' ? 0 : id;
|
163
|
-
this.activeName = 'first';
|
164
|
-
this.$openEditView('showEdit');
|
165
|
-
},
|
166
|
-
clearNodeClick() {
|
167
|
-
this.formData.saleOrgId = '';
|
168
|
-
this.formData.saleOrgName = '';
|
169
|
-
this.$refs.tree.setCurrentKey();
|
170
|
-
this.searchEvent();
|
171
|
-
},
|
172
|
-
handleNodeClick(data, node, v) {
|
173
|
-
this.$set(this.formData, 'saleOrgId', data.id);
|
174
|
-
this.$set(this.formData, 'saleOrgName', data.name);
|
175
|
-
this.$forceUpdate();
|
176
|
-
this.searchEvent();
|
177
|
-
},
|
178
|
-
// 异步树叶子节点懒加载逻辑
|
179
|
-
loadNode(node, resolve) {
|
180
|
-
let id = node && node.data && node.data.id ? node.data.id || '' : '';
|
181
|
-
let param = {enabled: true};
|
182
|
-
let url = !id ? USER_PREFIX + '/sale_org/getAllList' : USER_PREFIX + '/sale_org/getChildren';
|
183
|
-
this.$http({
|
184
|
-
url: url,
|
185
|
-
method: 'post',
|
186
|
-
data: {
|
187
|
-
parent: id,
|
188
|
-
enabled: true
|
189
|
-
},
|
190
|
-
success: res => {
|
191
|
-
res.objx.forEach(value => {
|
192
|
-
value.leaf = !value.hasChild;
|
193
|
-
});
|
194
|
-
if (node.level === 0) {
|
195
|
-
if (res.objx.length > 0 && res.objx[0].isParent) {
|
196
|
-
this.$nextTick(() => {
|
197
|
-
let nodedata = node.childNodes[0];
|
198
|
-
nodedata.expanded = true;
|
199
|
-
nodedata.loadData();
|
200
|
-
});
|
201
|
-
}
|
202
|
-
}
|
203
|
-
resolve(res.objx);
|
204
|
-
}
|
205
|
-
});
|
206
|
-
},
|
207
|
-
initTableList() {
|
208
|
-
let tableOption = {
|
209
|
-
vue: this,
|
210
|
-
tableRef: 'table-m1',
|
211
|
-
tableName: 'basic_user_list-m11',
|
212
|
-
path: USER_PREFIX + '/user/listAllPage',
|
213
|
-
param: () => {
|
214
|
-
let formData = {
|
215
|
-
...this.formData,
|
216
|
-
...this.advancedFormData
|
217
|
-
};
|
218
|
-
let outUserCodes = this.outUserCodes;
|
219
|
-
if (this.userType == 1) {
|
220
|
-
|
221
|
-
formData.neRoleCodes = [...outUserCodes];
|
222
|
-
} else if (this.userType == 2) {
|
223
|
-
//外部用户
|
224
|
-
if (!formData.roleCodes || !formData.roleCodes.length) {
|
225
|
-
formData.roleCodes = [...outUserCodes];
|
226
|
-
}
|
227
|
-
}
|
228
|
-
return formData;
|
229
|
-
},
|
230
|
-
columns: [
|
231
|
-
{
|
232
|
-
type: 'checkbox',
|
233
|
-
width: 48,
|
234
|
-
resizable: false,
|
235
|
-
fixed: 'left'
|
236
|
-
},
|
237
|
-
{
|
238
|
-
title: this.$t1('登录名'),
|
239
|
-
field: 'loginAccount',
|
240
|
-
width: 250,
|
241
|
-
fixed: 'left'
|
242
|
-
},
|
243
|
-
{
|
244
|
-
field: 'nickName',
|
245
|
-
title: this.$t1('姓名'),
|
246
|
-
width: 150
|
247
|
-
},
|
248
|
-
{
|
249
|
-
field: 'mobile',
|
250
|
-
title: this.$t1('手机号'),
|
251
|
-
width: 150
|
252
|
-
},
|
253
|
-
{
|
254
|
-
width: 150,
|
255
|
-
title: this.$t1('头像'),
|
256
|
-
field: 'headPhotoUrl',
|
257
|
-
sortable: false,
|
258
|
-
slots: {
|
259
|
-
default: ({row, rowIndex}) => {
|
260
|
-
let option = {
|
261
|
-
title: this.$t1('头像'),
|
262
|
-
rows: row.headPhotoUrl,
|
263
|
-
showViewButton: false
|
264
|
-
};
|
265
|
-
return [
|
266
|
-
<base-attachment option={option}/>
|
267
|
-
]
|
268
|
-
}
|
269
|
-
}
|
270
|
-
},
|
271
|
-
{
|
272
|
-
field: 'enabled',
|
273
|
-
title: this.$t1('是否启用'),
|
274
|
-
width: 150,
|
275
|
-
slots: {
|
276
|
-
default: ({row}) => {
|
277
|
-
if (row.enabled) {
|
278
|
-
return [<div class="txt-status">{this.$t1('启用')}</div>];
|
279
|
-
} else {
|
280
|
-
return [<div class="txt-status s-3">{this.$t1('禁用')}</div>];
|
281
|
-
}
|
282
|
-
}
|
283
|
-
}
|
284
|
-
},
|
285
|
-
{
|
286
|
-
field: 'roleNames',
|
287
|
-
title: this.$t1('角色'),
|
288
|
-
width: 150
|
289
|
-
},
|
290
|
-
{
|
291
|
-
field: 'saleOrgNames',
|
292
|
-
title: this.$t1('机构'),
|
293
|
-
width: 150
|
294
|
-
},
|
295
|
-
{
|
296
|
-
field: 'positionNames',
|
297
|
-
title: this.$t1('岗位'),
|
298
|
-
width: 150
|
299
|
-
},
|
300
|
-
{
|
301
|
-
field: 'birth',
|
302
|
-
title: this.$t1('出生日期'),
|
303
|
-
width: 150,
|
304
|
-
slots: {
|
305
|
-
default: ({row}) => {
|
306
|
-
var val = row.birth;
|
307
|
-
if (val) {
|
308
|
-
return val.substring(0, 10);
|
309
|
-
}
|
310
|
-
}
|
311
|
-
}
|
312
|
-
},
|
313
|
-
{
|
314
|
-
field: 'zipCode',
|
315
|
-
title: this.$t1('邮编'),
|
316
|
-
width: 150
|
317
|
-
},
|
318
|
-
{
|
319
|
-
field: 'address',
|
320
|
-
title: this.$t1('地址'),
|
321
|
-
width: 150
|
322
|
-
},
|
323
|
-
{
|
324
|
-
field: 'empNo',
|
325
|
-
title: this.$t1('员工编码'),
|
326
|
-
width: 150
|
327
|
-
},
|
328
|
-
{
|
329
|
-
field: 'gender',
|
330
|
-
title: this.$t1('性别'),
|
331
|
-
width: 150,
|
332
|
-
slots: {
|
333
|
-
default: ({row}) => {
|
334
|
-
var val = row.gender;
|
335
|
-
if (val == 1) {
|
336
|
-
return this.$t1('男');
|
337
|
-
} else if (val == 2) {
|
338
|
-
return this.$t1('女');
|
339
|
-
}
|
340
|
-
}
|
341
|
-
}
|
342
|
-
},
|
343
|
-
{
|
344
|
-
field: 'companyNames',
|
345
|
-
title: this.$t1('所属组织'),
|
346
|
-
width: 250
|
347
|
-
},
|
348
|
-
{
|
349
|
-
field: 'createBy',
|
350
|
-
title: this.$t1('创建人'),
|
351
|
-
width: 150
|
352
|
-
},
|
353
|
-
{
|
354
|
-
field: 'modifyBy',
|
355
|
-
title: this.$t1('更新人'),
|
356
|
-
width: 150
|
357
|
-
},
|
358
|
-
{
|
359
|
-
field: 'modifyDate',
|
360
|
-
title: this.$t1('更新时间'),
|
361
|
-
width: 150
|
362
|
-
},
|
363
|
-
{
|
364
|
-
field: 'createDate',
|
365
|
-
title: this.$t1('创建时间'),
|
366
|
-
width: 150
|
367
|
-
},
|
368
|
-
{
|
369
|
-
width: 47,
|
370
|
-
fixed: 'right',
|
371
|
-
title: '',
|
372
|
-
sortable: false,
|
373
|
-
slots: {
|
374
|
-
default: ({row}) => {
|
375
|
-
return [
|
376
|
-
<a
|
377
|
-
href="javascript:void(0);"
|
378
|
-
class="a-link"
|
379
|
-
onclick={() => {
|
380
|
-
this.openEditDialog(row.id);
|
381
|
-
}}
|
382
|
-
>
|
383
|
-
<el-tooltip enterable={false} enterable={false} effect="dark" content={this.$t1('查看')}
|
384
|
-
placement="top"
|
385
|
-
popper-class="tooltip-skin">
|
386
|
-
<i class="el-icon-edit"/>
|
387
|
-
</el-tooltip>
|
388
|
-
</a>
|
389
|
-
];
|
390
|
-
}
|
391
|
-
}
|
392
|
-
}
|
393
|
-
],
|
394
|
-
searchColumns: [
|
395
|
-
{
|
396
|
-
title: this.$t1('机构名称'),
|
397
|
-
field: "saleOrgName",
|
398
|
-
type: "input",
|
399
|
-
common: true,
|
400
|
-
disabled: true,
|
401
|
-
defaultValueEnabled: false
|
402
|
-
},
|
403
|
-
{title: this.$t1('登录名'), field: "loginAccount", type: "input", common: true},
|
404
|
-
{title: this.$t1('姓名'), field: "nickName", type: "input", common: true},
|
405
|
-
{title: this.$t1('手机号'), field: "mobile", type: "input", common: true},
|
406
|
-
{
|
407
|
-
title: this.$t1('角色'),
|
408
|
-
field: "roleCodes",
|
409
|
-
type: "select",
|
410
|
-
common: true,
|
411
|
-
itemOption: [],
|
412
|
-
multiple: true,
|
413
|
-
syncHandle: () => {
|
414
|
-
return this.getRoleList2()
|
415
|
-
}
|
416
|
-
},
|
417
|
-
/*{
|
418
|
-
title: "词汇", field: "dictSn", type: "select", common: true, itemOption: [], syncHandle: () => {
|
419
|
-
return this.getDict()
|
420
|
-
}
|
421
|
-
},*/
|
422
|
-
{title: this.$t1('登录名(批量)'), field: "loginAccounts", type: "inputBatch", common: false},
|
423
|
-
{
|
424
|
-
title: this.$t1('性别'), field: "gender", type: "select", common: false, itemOption: [
|
425
|
-
{label: this.$t1('男'), value: 1},
|
426
|
-
{label: this.$t1('女'), value: 2}
|
427
|
-
]
|
428
|
-
},
|
429
|
-
{title: this.$t1('邮编'), field: "zipCode", type: "input", common: false},
|
430
|
-
{
|
431
|
-
title: this.$t1('是否启用'), field: "enabled", type: "select", common: false, itemOption: [
|
432
|
-
{label: this.$t1('启用'), value: true},
|
433
|
-
{label: this.$t1('禁用'), value: false}
|
434
|
-
]
|
435
|
-
}/*,
|
436
|
-
{title: this.$t1('客户名称'), field: "customerName", type: "input", common: true, slot: "customerName"},
|
437
|
-
{
|
438
|
-
title: this.$t1('日期'),
|
439
|
-
field: "startDate",
|
440
|
-
field2: "endDate",
|
441
|
-
type: "dateRange",
|
442
|
-
common: true,
|
443
|
-
widgetType: "date",
|
444
|
-
valueFormat: "yyyy-MM-dd"
|
445
|
-
},
|
446
|
-
{title: this.$t1('年份'), field: "year", type: "date", common: true, widgetType: "year", valueFormat: "yyyy"},*/
|
447
|
-
],
|
448
|
-
config: {
|
449
|
-
pagerConfig: {
|
450
|
-
pageSize: 500
|
451
|
-
}
|
452
|
-
}
|
453
|
-
};
|
454
|
-
this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
|
455
|
-
this.vxeOption = opts;
|
456
|
-
});
|
457
|
-
/* this.$nextTick(() => {
|
458
|
-
this.$refs['baseBillExport'].initExportData({
|
459
|
-
target: this,
|
460
|
-
btn: [{ code: 'USEREXCEL', name: '导出Excel(按模版)', type: 0 }, { code: 'USERPDF', name: '导出Pdf(按模版)', type: 1 }, { code: 'USERPRINT', name: '菜鸟打印', type: 2 }],
|
461
|
-
param: item => {
|
462
|
-
let checkRows = this.$refs['table-m1'].getCheckboxRecords(true);
|
463
|
-
if (item.type != 2) {
|
464
|
-
return checkRows.map(row => {
|
465
|
-
return { id: row.id };
|
466
|
-
});
|
467
|
-
} else {
|
468
|
-
let rows = checkRows.map(row => row.id);
|
469
|
-
return rows.length ? { id: rows } : null;
|
470
|
-
}
|
471
|
-
}
|
472
|
-
});
|
473
|
-
}); */
|
474
|
-
},
|
475
|
-
importExcel() {
|
476
|
-
let that = this;
|
477
|
-
that.$excelImport({
|
478
|
-
prefix: USER_PREFIX,
|
479
|
-
excel: USER_PREFIX + '/excelTemplate/user/user.xlsx',
|
480
|
-
multi: true,
|
481
|
-
saveUrl: USER_PREFIX + '/user/batchImport',
|
482
|
-
callback: () => {
|
483
|
-
that.searchEvent();
|
484
|
-
}
|
485
|
-
});
|
486
|
-
},
|
487
|
-
getRoleList2() {
|
488
|
-
return new Promise((resolve, reject) => {
|
489
|
-
this.$http({
|
490
|
-
url: USER_PREFIX + '/role/list',
|
491
|
-
method: 'post',
|
492
|
-
success: res => {
|
493
|
-
let rows = res.objx || [];
|
494
|
-
let outUserCodes = this.outUserCodes;
|
495
|
-
if (this.userType == 1) {
|
496
|
-
|
497
|
-
rows = rows.filter(row => !outUserCodes.includes(row.code));
|
498
|
-
} else if (this.userType == 2) {
|
499
|
-
//外部用户
|
500
|
-
rows = rows.filter(row => outUserCodes.includes(row.code));
|
501
|
-
}
|
502
|
-
let result = rows.map(row => {
|
503
|
-
return {
|
504
|
-
value: row.code,
|
505
|
-
label: row.name
|
506
|
-
}
|
507
|
-
});
|
508
|
-
resolve(result);
|
509
|
-
}
|
510
|
-
});
|
511
|
-
});
|
512
|
-
},
|
513
|
-
getDict() {
|
514
|
-
return new Promise((resolve, reject) => {
|
515
|
-
this.$getBaseDicts({
|
516
|
-
code: "orderType",
|
517
|
-
success: ({dicts, dictMap}) => {
|
518
|
-
let result = dicts.map(row => {
|
519
|
-
return {
|
520
|
-
value: row.sn,
|
521
|
-
label: row.value
|
522
|
-
}
|
523
|
-
});
|
524
|
-
resolve(result);
|
525
|
-
}
|
526
|
-
});
|
527
|
-
});
|
528
|
-
|
529
|
-
},
|
530
|
-
getRoleList() {
|
531
|
-
return this.$http({
|
532
|
-
url: USER_PREFIX + '/role/list',
|
533
|
-
method: 'post',
|
534
|
-
success: res => {
|
535
|
-
let rows = res.objx || [];
|
536
|
-
let outUserCodes = this.outUserCodes;
|
537
|
-
if (this.userType == 1) {
|
538
|
-
|
539
|
-
rows = rows.filter(row => !outUserCodes.includes(row.code));
|
540
|
-
} else if (this.userType == 2) {
|
541
|
-
//外部用户
|
542
|
-
rows = rows.filter(row => outUserCodes.includes(row.code));
|
543
|
-
}
|
544
|
-
this.roleList = rows;
|
545
|
-
return rows;
|
546
|
-
}
|
547
|
-
});
|
548
|
-
},
|
549
|
-
async initOutUserRoleCode() {
|
550
|
-
return this.$http({
|
551
|
-
url: USER_PREFIX + '/system_parameter/getByCode',
|
552
|
-
method: 'post',
|
553
|
-
data: {"code": "outUserRoleCode"},
|
554
|
-
success: res => {
|
555
|
-
let value = (!res.objx || !res.objx.value) ? "distributor" : res.objx.value;
|
556
|
-
let codes = value.split(',');
|
557
|
-
this.outUserCodes = codes;
|
558
|
-
}
|
559
|
-
});
|
560
|
-
}
|
561
|
-
}
|
562
|
-
};
|
563
|
-
</script>
|
1
|
+
<template>
|
2
|
+
<div id="containt">
|
3
|
+
<el-tabs v-model="activeName" class="tab-box">
|
4
|
+
<el-tab-pane :label="$t1('常规')" name="first">
|
5
|
+
<editView v-if="showEdit" visible-key="showEdit" :_dataId.sync="dataId" :parent-target="_self"
|
6
|
+
@reload="$reloadHandle" :userType="userType" :flag="flag"></editView>
|
7
|
+
</el-tab-pane>
|
8
|
+
<el-tab-pane :label="$t1('列表')" name="second">
|
9
|
+
<div class="tree-box fl">
|
10
|
+
<div class="tit" @click="clearNodeClick"><b>{{ $t1('机构分类') }}</b></div>
|
11
|
+
<el-tree
|
12
|
+
:props="defaultProps"
|
13
|
+
:load="loadNode"
|
14
|
+
node-key="id"
|
15
|
+
ref="tree"
|
16
|
+
highlight-current
|
17
|
+
lazy
|
18
|
+
:expand-on-click-node="false"
|
19
|
+
@node-click="handleNodeClick"
|
20
|
+
class="tree-list"
|
21
|
+
icon-class="el-icon-arrow-down"
|
22
|
+
></el-tree>
|
23
|
+
</div>
|
24
|
+
<label id="labBtn">
|
25
|
+
<div class="icon">
|
26
|
+
<i class="el-icon-more"></i>
|
27
|
+
<i class="el-icon-more"></i>
|
28
|
+
</div>
|
29
|
+
</label>
|
30
|
+
<div class="main-right fr" style="padding-left:6px;">
|
31
|
+
<div class="grid-height">
|
32
|
+
<vxe-grid
|
33
|
+
id="table-m1"
|
34
|
+
ref="table-m1"
|
35
|
+
:auto-resize="true"
|
36
|
+
v-bind="vxeOption"
|
37
|
+
@resizable-change="$vxeTableUtil.onColumnWitchChange"
|
38
|
+
@custom="$vxeTableUtil.customHandle"
|
39
|
+
>
|
40
|
+
<template #form>
|
41
|
+
<tableForm :formData.sync="formData" :advancedFormData.sync="advancedFormData"
|
42
|
+
@searchEvent="searchEvent" @resetEvent="resetEvent">
|
43
|
+
<template #buttonLeft>
|
44
|
+
<vxe-button status="primary" class="button-sty" icon="el-icon-plus" @click="openEditDialog">
|
45
|
+
{{ $t1('新增') }}
|
46
|
+
</vxe-button>
|
47
|
+
<base-table-export :option="{ title: $t1('账户导出'), targetRef: 'table-m1'}"
|
48
|
+
:parent-target="_self"/>
|
49
|
+
<vxe-button status="primary" class="button-sty" icon="el-icon-download" @click="importExcel">
|
50
|
+
{{ $t1('导入') }}
|
51
|
+
</vxe-button>
|
52
|
+
<base-input-export :option="exportOption" :parent-target="_self"/>
|
53
|
+
</template>
|
54
|
+
<template #buttonRight>
|
55
|
+
<vxe-button icon="el-icon-brush" class="button-sty" @click="resetEvent" type="text" status="primary"
|
56
|
+
plain>{{ $t1('重置') }}
|
57
|
+
</vxe-button>
|
58
|
+
<vxe-button status="warning" icon="el-icon-search" class="button-sty" @click="searchEvent">
|
59
|
+
{{ $t1('搜索') }}
|
60
|
+
</vxe-button>
|
61
|
+
</template>
|
62
|
+
</tableForm>
|
63
|
+
</template>
|
64
|
+
</vxe-grid>
|
65
|
+
</div>
|
66
|
+
</div>
|
67
|
+
</el-tab-pane>
|
68
|
+
</el-tabs>
|
69
|
+
</div>
|
70
|
+
</template>
|
71
|
+
|
72
|
+
<script>
|
73
|
+
import editView from './form_edit.vue';
|
74
|
+
import {treeScollx} from '@base/utils/global.js';
|
75
|
+
import tableForm from "@base/components/table/tableForm";
|
76
|
+
|
77
|
+
export default {
|
78
|
+
name: 'user:form_list',
|
79
|
+
props: {
|
80
|
+
userType: {
|
81
|
+
type: Number
|
82
|
+
},
|
83
|
+
flag: String
|
84
|
+
},
|
85
|
+
components: {
|
86
|
+
tableForm,
|
87
|
+
editView: () => import('./edit.vue')
|
88
|
+
},
|
89
|
+
created() {
|
90
|
+
|
91
|
+
},
|
92
|
+
activated() {
|
93
|
+
// this.initTableList();
|
94
|
+
},
|
95
|
+
async mounted() {
|
96
|
+
treeScollx({target: this, type: 'default'});
|
97
|
+
await this.initOutUserRoleCode();
|
98
|
+
this.getRoleList();
|
99
|
+
this.initTableList();
|
100
|
+
},
|
101
|
+
data() {
|
102
|
+
return {
|
103
|
+
exportOption: {
|
104
|
+
prefix: USER_PREFIX,
|
105
|
+
tableRef: 'table-m1',
|
106
|
+
title: this.$t1('用户'),
|
107
|
+
codes: ["USEREXCEL", "USERPDF", "USERPRINT", "USERHIPRINT", "USERJDPRINT", "USERPDDPRINT", "USERVIPPRINT"],
|
108
|
+
onBeforePrint: (done, {etCode, etType}) => {
|
109
|
+
/*etType: 2 菜鸟打印,3 网页打印,6 京东打印*/
|
110
|
+
done();
|
111
|
+
},
|
112
|
+
onAfterPrint: ({etCode, etType}, close) => {
|
113
|
+
/*etType: 2 菜鸟打印,3 网页打印,6 京东打印*/
|
114
|
+
/*close();//关闭弹框*/
|
115
|
+
}
|
116
|
+
},
|
117
|
+
printOption: {
|
118
|
+
prefix: USER_PREFIX,
|
119
|
+
tableRef: 'table-m1',
|
120
|
+
param: {
|
121
|
+
type: 'print',
|
122
|
+
code: 'USERPRINT',
|
123
|
+
param: 'tableDefault'
|
124
|
+
}
|
125
|
+
},
|
126
|
+
showEdit: false,
|
127
|
+
activeName: 'second',
|
128
|
+
showUpload: true,
|
129
|
+
uploadSize: 10,
|
130
|
+
value10: '',
|
131
|
+
dataId: '',
|
132
|
+
tp: false,
|
133
|
+
showUserDialog: false,
|
134
|
+
nickName: 'dd',
|
135
|
+
formData: {saleOrgName: null, roleCodes: []},
|
136
|
+
vxeOption: {
|
137
|
+
className: 'list-table'
|
138
|
+
},
|
139
|
+
defaultProps: {
|
140
|
+
label: 'name', //这里是树结构中需显示的数据(即接口返回的需展示在页面上的参数)
|
141
|
+
children: [],
|
142
|
+
isLeaf: 'leaf'
|
143
|
+
},
|
144
|
+
showAdvancedSearch: false,
|
145
|
+
advancedFormData: {},
|
146
|
+
roleList: [],
|
147
|
+
distributorCode: 'distributor',
|
148
|
+
outUserCodes: []
|
149
|
+
};
|
150
|
+
},
|
151
|
+
methods: {
|
152
|
+
searchEvent() {
|
153
|
+
this.$refs['table-m1'].commitProxy('reload');
|
154
|
+
},
|
155
|
+
resetEvent() {
|
156
|
+
this.formData = {};
|
157
|
+
this.advancedFormData = {};
|
158
|
+
this.$refs.tree.setCurrentKey();
|
159
|
+
this.$refs['table-m1'].commitProxy('reload');
|
160
|
+
},
|
161
|
+
openEditDialog(id) {
|
162
|
+
this.dataId = !id || typeof id == 'object' ? 0 : id;
|
163
|
+
this.activeName = 'first';
|
164
|
+
this.$openEditView('showEdit');
|
165
|
+
},
|
166
|
+
clearNodeClick() {
|
167
|
+
this.formData.saleOrgId = '';
|
168
|
+
this.formData.saleOrgName = '';
|
169
|
+
this.$refs.tree.setCurrentKey();
|
170
|
+
this.searchEvent();
|
171
|
+
},
|
172
|
+
handleNodeClick(data, node, v) {
|
173
|
+
this.$set(this.formData, 'saleOrgId', data.id);
|
174
|
+
this.$set(this.formData, 'saleOrgName', data.name);
|
175
|
+
this.$forceUpdate();
|
176
|
+
this.searchEvent();
|
177
|
+
},
|
178
|
+
// 异步树叶子节点懒加载逻辑
|
179
|
+
loadNode(node, resolve) {
|
180
|
+
let id = node && node.data && node.data.id ? node.data.id || '' : '';
|
181
|
+
let param = {enabled: true};
|
182
|
+
let url = !id ? USER_PREFIX + '/sale_org/getAllList' : USER_PREFIX + '/sale_org/getChildren';
|
183
|
+
this.$http({
|
184
|
+
url: url,
|
185
|
+
method: 'post',
|
186
|
+
data: {
|
187
|
+
parent: id,
|
188
|
+
enabled: true
|
189
|
+
},
|
190
|
+
success: res => {
|
191
|
+
res.objx.forEach(value => {
|
192
|
+
value.leaf = !value.hasChild;
|
193
|
+
});
|
194
|
+
if (node.level === 0) {
|
195
|
+
if (res.objx.length > 0 && res.objx[0].isParent) {
|
196
|
+
this.$nextTick(() => {
|
197
|
+
let nodedata = node.childNodes[0];
|
198
|
+
nodedata.expanded = true;
|
199
|
+
nodedata.loadData();
|
200
|
+
});
|
201
|
+
}
|
202
|
+
}
|
203
|
+
resolve(res.objx);
|
204
|
+
}
|
205
|
+
});
|
206
|
+
},
|
207
|
+
initTableList() {
|
208
|
+
let tableOption = {
|
209
|
+
vue: this,
|
210
|
+
tableRef: 'table-m1',
|
211
|
+
tableName: 'basic_user_list-m11',
|
212
|
+
path: USER_PREFIX + '/user/listAllPage',
|
213
|
+
param: () => {
|
214
|
+
let formData = {
|
215
|
+
...this.formData,
|
216
|
+
...this.advancedFormData
|
217
|
+
};
|
218
|
+
let outUserCodes = this.outUserCodes;
|
219
|
+
if (this.userType == 1) {
|
220
|
+
//组织用户
|
221
|
+
formData.neRoleCodes = [...outUserCodes];
|
222
|
+
} else if (this.userType == 2) {
|
223
|
+
//外部用户
|
224
|
+
if (!formData.roleCodes || !formData.roleCodes.length) {
|
225
|
+
formData.roleCodes = [...outUserCodes];
|
226
|
+
}
|
227
|
+
}
|
228
|
+
return formData;
|
229
|
+
},
|
230
|
+
columns: [
|
231
|
+
{
|
232
|
+
type: 'checkbox',
|
233
|
+
width: 48,
|
234
|
+
resizable: false,
|
235
|
+
fixed: 'left'
|
236
|
+
},
|
237
|
+
{
|
238
|
+
title: this.$t1('登录名'),
|
239
|
+
field: 'loginAccount',
|
240
|
+
width: 250,
|
241
|
+
fixed: 'left'
|
242
|
+
},
|
243
|
+
{
|
244
|
+
field: 'nickName',
|
245
|
+
title: this.$t1('姓名'),
|
246
|
+
width: 150
|
247
|
+
},
|
248
|
+
{
|
249
|
+
field: 'mobile',
|
250
|
+
title: this.$t1('手机号'),
|
251
|
+
width: 150
|
252
|
+
},
|
253
|
+
{
|
254
|
+
width: 150,
|
255
|
+
title: this.$t1('头像'),
|
256
|
+
field: 'headPhotoUrl',
|
257
|
+
sortable: false,
|
258
|
+
slots: {
|
259
|
+
default: ({row, rowIndex}) => {
|
260
|
+
let option = {
|
261
|
+
title: this.$t1('头像'),
|
262
|
+
rows: row.headPhotoUrl,
|
263
|
+
showViewButton: false
|
264
|
+
};
|
265
|
+
return [
|
266
|
+
<base-attachment option={option}/>
|
267
|
+
]
|
268
|
+
}
|
269
|
+
}
|
270
|
+
},
|
271
|
+
{
|
272
|
+
field: 'enabled',
|
273
|
+
title: this.$t1('是否启用'),
|
274
|
+
width: 150,
|
275
|
+
slots: {
|
276
|
+
default: ({row}) => {
|
277
|
+
if (row.enabled) {
|
278
|
+
return [<div class="txt-status">{this.$t1('启用')}</div>];
|
279
|
+
} else {
|
280
|
+
return [<div class="txt-status s-3">{this.$t1('禁用')}</div>];
|
281
|
+
}
|
282
|
+
}
|
283
|
+
}
|
284
|
+
},
|
285
|
+
{
|
286
|
+
field: 'roleNames',
|
287
|
+
title: this.$t1('角色'),
|
288
|
+
width: 150
|
289
|
+
},
|
290
|
+
{
|
291
|
+
field: 'saleOrgNames',
|
292
|
+
title: this.$t1('机构'),
|
293
|
+
width: 150
|
294
|
+
},
|
295
|
+
{
|
296
|
+
field: 'positionNames',
|
297
|
+
title: this.$t1('岗位'),
|
298
|
+
width: 150
|
299
|
+
},
|
300
|
+
{
|
301
|
+
field: 'birth',
|
302
|
+
title: this.$t1('出生日期'),
|
303
|
+
width: 150,
|
304
|
+
slots: {
|
305
|
+
default: ({row}) => {
|
306
|
+
var val = row.birth;
|
307
|
+
if (val) {
|
308
|
+
return val.substring(0, 10);
|
309
|
+
}
|
310
|
+
}
|
311
|
+
}
|
312
|
+
},
|
313
|
+
{
|
314
|
+
field: 'zipCode',
|
315
|
+
title: this.$t1('邮编'),
|
316
|
+
width: 150
|
317
|
+
},
|
318
|
+
{
|
319
|
+
field: 'address',
|
320
|
+
title: this.$t1('地址'),
|
321
|
+
width: 150
|
322
|
+
},
|
323
|
+
{
|
324
|
+
field: 'empNo',
|
325
|
+
title: this.$t1('员工编码'),
|
326
|
+
width: 150
|
327
|
+
},
|
328
|
+
{
|
329
|
+
field: 'gender',
|
330
|
+
title: this.$t1('性别'),
|
331
|
+
width: 150,
|
332
|
+
slots: {
|
333
|
+
default: ({row}) => {
|
334
|
+
var val = row.gender;
|
335
|
+
if (val == 1) {
|
336
|
+
return this.$t1('男');
|
337
|
+
} else if (val == 2) {
|
338
|
+
return this.$t1('女');
|
339
|
+
}
|
340
|
+
}
|
341
|
+
}
|
342
|
+
},
|
343
|
+
{
|
344
|
+
field: 'companyNames',
|
345
|
+
title: this.$t1('所属组织'),
|
346
|
+
width: 250
|
347
|
+
},
|
348
|
+
{
|
349
|
+
field: 'createBy',
|
350
|
+
title: this.$t1('创建人'),
|
351
|
+
width: 150
|
352
|
+
},
|
353
|
+
{
|
354
|
+
field: 'modifyBy',
|
355
|
+
title: this.$t1('更新人'),
|
356
|
+
width: 150
|
357
|
+
},
|
358
|
+
{
|
359
|
+
field: 'modifyDate',
|
360
|
+
title: this.$t1('更新时间'),
|
361
|
+
width: 150
|
362
|
+
},
|
363
|
+
{
|
364
|
+
field: 'createDate',
|
365
|
+
title: this.$t1('创建时间'),
|
366
|
+
width: 150
|
367
|
+
},
|
368
|
+
{
|
369
|
+
width: 47,
|
370
|
+
fixed: 'right',
|
371
|
+
title: '',
|
372
|
+
sortable: false,
|
373
|
+
slots: {
|
374
|
+
default: ({row}) => {
|
375
|
+
return [
|
376
|
+
<a
|
377
|
+
href="javascript:void(0);"
|
378
|
+
class="a-link"
|
379
|
+
onclick={() => {
|
380
|
+
this.openEditDialog(row.id);
|
381
|
+
}}
|
382
|
+
>
|
383
|
+
<el-tooltip enterable={false} enterable={false} effect="dark" content={this.$t1('查看')}
|
384
|
+
placement="top"
|
385
|
+
popper-class="tooltip-skin">
|
386
|
+
<i class="el-icon-edit"/>
|
387
|
+
</el-tooltip>
|
388
|
+
</a>
|
389
|
+
];
|
390
|
+
}
|
391
|
+
}
|
392
|
+
}
|
393
|
+
],
|
394
|
+
searchColumns: [
|
395
|
+
{
|
396
|
+
title: this.$t1('机构名称'),
|
397
|
+
field: "saleOrgName",
|
398
|
+
type: "input",
|
399
|
+
common: true,
|
400
|
+
disabled: true,
|
401
|
+
defaultValueEnabled: false
|
402
|
+
},
|
403
|
+
{title: this.$t1('登录名'), field: "loginAccount", type: "input", common: true},
|
404
|
+
{title: this.$t1('姓名'), field: "nickName", type: "input", common: true},
|
405
|
+
{title: this.$t1('手机号'), field: "mobile", type: "input", common: true},
|
406
|
+
{
|
407
|
+
title: this.$t1('角色'),
|
408
|
+
field: "roleCodes",
|
409
|
+
type: "select",
|
410
|
+
common: true,
|
411
|
+
itemOption: [],
|
412
|
+
multiple: true,
|
413
|
+
syncHandle: () => {
|
414
|
+
return this.getRoleList2()
|
415
|
+
}
|
416
|
+
},
|
417
|
+
/*{
|
418
|
+
title: "词汇", field: "dictSn", type: "select", common: true, itemOption: [], syncHandle: () => {
|
419
|
+
return this.getDict()
|
420
|
+
}
|
421
|
+
},*/
|
422
|
+
{title: this.$t1('登录名(批量)'), field: "loginAccounts", type: "inputBatch", common: false},
|
423
|
+
{
|
424
|
+
title: this.$t1('性别'), field: "gender", type: "select", common: false, itemOption: [
|
425
|
+
{label: this.$t1('男'), value: 1},
|
426
|
+
{label: this.$t1('女'), value: 2}
|
427
|
+
]
|
428
|
+
},
|
429
|
+
{title: this.$t1('邮编'), field: "zipCode", type: "input", common: false},
|
430
|
+
{
|
431
|
+
title: this.$t1('是否启用'), field: "enabled", type: "select", common: false, itemOption: [
|
432
|
+
{label: this.$t1('启用'), value: true},
|
433
|
+
{label: this.$t1('禁用'), value: false}
|
434
|
+
]
|
435
|
+
}/*,
|
436
|
+
{title: this.$t1('客户名称'), field: "customerName", type: "input", common: true, slot: "customerName"},
|
437
|
+
{
|
438
|
+
title: this.$t1('日期'),
|
439
|
+
field: "startDate",
|
440
|
+
field2: "endDate",
|
441
|
+
type: "dateRange",
|
442
|
+
common: true,
|
443
|
+
widgetType: "date",
|
444
|
+
valueFormat: "yyyy-MM-dd"
|
445
|
+
},
|
446
|
+
{title: this.$t1('年份'), field: "year", type: "date", common: true, widgetType: "year", valueFormat: "yyyy"},*/
|
447
|
+
],
|
448
|
+
config: {
|
449
|
+
pagerConfig: {
|
450
|
+
pageSize: 500
|
451
|
+
}
|
452
|
+
}
|
453
|
+
};
|
454
|
+
this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
|
455
|
+
this.vxeOption = opts;
|
456
|
+
});
|
457
|
+
/* this.$nextTick(() => {
|
458
|
+
this.$refs['baseBillExport'].initExportData({
|
459
|
+
target: this,
|
460
|
+
btn: [{ code: 'USEREXCEL', name: '导出Excel(按模版)', type: 0 }, { code: 'USERPDF', name: '导出Pdf(按模版)', type: 1 }, { code: 'USERPRINT', name: '菜鸟打印', type: 2 }],
|
461
|
+
param: item => {
|
462
|
+
let checkRows = this.$refs['table-m1'].getCheckboxRecords(true);
|
463
|
+
if (item.type != 2) {
|
464
|
+
return checkRows.map(row => {
|
465
|
+
return { id: row.id };
|
466
|
+
});
|
467
|
+
} else {
|
468
|
+
let rows = checkRows.map(row => row.id);
|
469
|
+
return rows.length ? { id: rows } : null;
|
470
|
+
}
|
471
|
+
}
|
472
|
+
});
|
473
|
+
}); */
|
474
|
+
},
|
475
|
+
importExcel() {
|
476
|
+
let that = this;
|
477
|
+
that.$excelImport({
|
478
|
+
prefix: USER_PREFIX,
|
479
|
+
excel: USER_PREFIX + '/excelTemplate/user/user.xlsx',
|
480
|
+
multi: true,
|
481
|
+
saveUrl: USER_PREFIX + '/user/batchImport',
|
482
|
+
callback: () => {
|
483
|
+
that.searchEvent();
|
484
|
+
}
|
485
|
+
});
|
486
|
+
},
|
487
|
+
getRoleList2() {
|
488
|
+
return new Promise((resolve, reject) => {
|
489
|
+
this.$http({
|
490
|
+
url: USER_PREFIX + '/role/list',
|
491
|
+
method: 'post',
|
492
|
+
success: res => {
|
493
|
+
let rows = res.objx || [];
|
494
|
+
let outUserCodes = this.outUserCodes;
|
495
|
+
if (this.userType == 1) {
|
496
|
+
//组织用户
|
497
|
+
rows = rows.filter(row => !outUserCodes.includes(row.code));
|
498
|
+
} else if (this.userType == 2) {
|
499
|
+
//外部用户
|
500
|
+
rows = rows.filter(row => outUserCodes.includes(row.code));
|
501
|
+
}
|
502
|
+
let result = rows.map(row => {
|
503
|
+
return {
|
504
|
+
value: row.code,
|
505
|
+
label: row.name
|
506
|
+
}
|
507
|
+
});
|
508
|
+
resolve(result);
|
509
|
+
}
|
510
|
+
});
|
511
|
+
});
|
512
|
+
},
|
513
|
+
getDict() {
|
514
|
+
return new Promise((resolve, reject) => {
|
515
|
+
this.$getBaseDicts({
|
516
|
+
code: "orderType",
|
517
|
+
success: ({dicts, dictMap}) => {
|
518
|
+
let result = dicts.map(row => {
|
519
|
+
return {
|
520
|
+
value: row.sn,
|
521
|
+
label: row.value
|
522
|
+
}
|
523
|
+
});
|
524
|
+
resolve(result);
|
525
|
+
}
|
526
|
+
});
|
527
|
+
});
|
528
|
+
|
529
|
+
},
|
530
|
+
getRoleList() {
|
531
|
+
return this.$http({
|
532
|
+
url: USER_PREFIX + '/role/list',
|
533
|
+
method: 'post',
|
534
|
+
success: res => {
|
535
|
+
let rows = res.objx || [];
|
536
|
+
let outUserCodes = this.outUserCodes;
|
537
|
+
if (this.userType == 1) {
|
538
|
+
//组织用户
|
539
|
+
rows = rows.filter(row => !outUserCodes.includes(row.code));
|
540
|
+
} else if (this.userType == 2) {
|
541
|
+
//外部用户
|
542
|
+
rows = rows.filter(row => outUserCodes.includes(row.code));
|
543
|
+
}
|
544
|
+
this.roleList = rows;
|
545
|
+
return rows;
|
546
|
+
}
|
547
|
+
});
|
548
|
+
},
|
549
|
+
async initOutUserRoleCode() {
|
550
|
+
return this.$http({
|
551
|
+
url: USER_PREFIX + '/system_parameter/getByCode',
|
552
|
+
method: 'post',
|
553
|
+
data: {"code": "outUserRoleCode"},
|
554
|
+
success: res => {
|
555
|
+
let value = (!res.objx || !res.objx.value) ? "distributor" : res.objx.value;
|
556
|
+
let codes = value.split(',');
|
557
|
+
this.outUserCodes = codes;
|
558
|
+
}
|
559
|
+
});
|
560
|
+
}
|
561
|
+
}
|
562
|
+
};
|
563
|
+
</script>
|