@lambo-design/workflow-approve 1.0.0-beta.14 → 1.0.0-beta.141

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.
@@ -1,30 +1,48 @@
1
1
  <template>
2
2
  <div>
3
- <Modal v-model="modalBoxShow" width="1217" title="选择办理人" @on-ok="onOk" @on-cancel="onCancel" loading>
3
+ <Modal v-model="modalBoxShow" :width="ucAdapterType === 'sc' && useTransferRangeUsers ? 600 : 1217" :title="title" @on-ok="onOk" @on-cancel="onCancel" loading>
4
4
  <div class="org-info">
5
- <div class="org-tree">
6
- <Tree :data="treeData" :load-data="loadData" @on-select-change="selectChange" > </Tree>
5
+ <div class="org-tree" v-if="!useTransferRangeUsers">
6
+ <div class="tree-content">
7
+ <div v-if="treeData.length === 0">暂无数据</div>
8
+ <Tree v-else v-for="(item,index) in treeData" :key="index" :data="item" ref="treeBM"
9
+ :load-data="loadData" @on-select-change="selectChange"></Tree>
10
+ <!-- <Tree :data="treeData" :load-data="loadData" @on-select-change="selectChange"></Tree>-->
11
+ </div>
7
12
  </div>
8
13
  <div class="org-detil">
9
- <LamboPagingTable ref="selection" :dataUrl="dataUrl" :columns="tableColumn" :searchParams="tableSearchParams"
10
- @on-selection-change="onSelectionChange">
11
- <div slot="search">
12
- <Form :label-width="80">
13
- <FormItem label="账号">
14
- <Input v-model="form.userId" placeholder="按账号搜索" />
15
- </FormItem>
16
- <FormItem label="姓名">
17
- <Input v-model="form.userName" placeholder="按姓名搜索" />
18
- </FormItem>
19
- <FormItem label="是否管理员" prop="isAdmin" :labelWidth="100">
20
- <RadioGroup v-model="form.isAdmin">
21
- <Radio label="">全部</Radio>
22
- <Radio label="1">是</Radio>
23
- <Radio label="0">否</Radio>
24
- </RadioGroup>
25
- </FormItem>
14
+ <LamboPagingTable :key="useTransferRangeUsers" ref="selection" highlight-row :data="tableData" :dataUrl="dataUrl" :columns="tableColumn" :searchParams="tableSearchParams" :height="tableHeight" :width="tableWidth"
15
+ @on-selection-change="onSelectionChange" @on-current-change="onCurrentChange" :page-disable="useTransferRangeUsers" :showTableOption="!useTransferRangeUsers" :stripe="false">
16
+ <div slot="search" v-if="!useTransferRangeUsers">
17
+ <Form :label-width="60" label-colon>
18
+ <Row>
19
+ <Col span="6">
20
+ <FormItem label="账号">
21
+ <Input v-model="form.userId" placeholder="按账号搜索" />
22
+ </FormItem>
23
+ </Col>
24
+ <Col span="6">
25
+ <FormItem label="姓名">
26
+ <Input v-model="form.userName" placeholder="按姓名搜索" />
27
+ </FormItem>
28
+ </Col>
29
+ <Col span="8">
30
+ <FormItem label="是否管理员" prop="isAdmin" :labelWidth="100">
31
+ <RadioGroup v-model="form.isAdmin">
32
+ <Radio label="">全部</Radio>
33
+ <Radio label="1">是</Radio>
34
+ <Radio label="0">否</Radio>
35
+ </RadioGroup>
36
+ </FormItem>
37
+ </Col>
38
+ <Col span="4">
39
+ <FormItem >
40
+ <Button type="primary" icon="ios-search" @click="doSearch">查询</Button>
41
+ </FormItem>
42
+ </Col>
43
+ </Row>
44
+
26
45
  <FormItem>
27
- <Button type="primary" icon="ios-search" @click="doSearch">查询</Button>
28
46
  </FormItem>
29
47
  </Form>
30
48
  </div>
@@ -67,12 +85,27 @@ export default {
67
85
  type: String,
68
86
  default: '/api/upms-server',
69
87
  },
88
+ //是否展示操作按钮二次弹框
89
+ showConfirmBox: {
90
+ type: Boolean,
91
+ required: false,
92
+ default: false
93
+ },
70
94
  },
71
95
  data() {
72
96
  return {
97
+ id: '',
98
+ title: '选择办理人',
99
+ helpBoxType: 'auditTo82',
100
+ ucAdapterType: 'x1',
101
+ useTransferRangeUsers: false,
102
+ useTransferRangeOrgan: false,
73
103
  loading: false,
104
+ organTreeType: '00',
105
+ permScope: 'all',
74
106
  modalBoxShow: false,
75
107
  dataUrl:'',
108
+ tableData:[],
76
109
  helpBoxColumns: [
77
110
  {
78
111
  title: "用户ID",
@@ -105,118 +138,267 @@ export default {
105
138
  };
106
139
  },
107
140
  created () {
108
- this.init()
141
+ this.getSystemConfig()
109
142
  },
110
143
  computed: {
111
-
144
+ tableHeight(){
145
+ return this.useTransferRangeUsers ? 500 : 0
146
+ },
147
+ tableWidth(){
148
+ return this.useTransferRangeUsers && this.ucAdapterType === 'sc' ? 550 : 0
149
+ },
112
150
  tableColumn () {
113
151
  let columns = []
114
152
  let self = this
115
- columns.push({
116
- title: '#',
117
- key: 'selectId',
118
- type: 'selection',
119
- align: 'center',
120
- width: 55
121
- })
122
- columns.push({
123
- title: '账号',
124
- key: 'userId',
125
- sortField: 'user_id',
126
- sortable: 'custom'
127
- })
153
+ // 加签/选择候选人可多选
154
+ if (this.helpBoxType === 'addMultitaskInstance' || this.helpBoxType === 'appointHandlerWithCandGroups'){
155
+ columns.push({
156
+ title: '#',
157
+ key: 'selectId',
158
+ type: 'selection',
159
+ align: 'center',
160
+ width: 55
161
+ })
162
+ } else {
163
+ columns.push({
164
+ title: '#',
165
+ key: 'selectId',
166
+ type: 'single-selection',
167
+ align: 'center',
168
+ width: 55
169
+ })
170
+ }
171
+ if (!(self.useTransferRangeUsers && self.ucAdapterType == 'sc')){
172
+ columns.push({
173
+ title: '账号',
174
+ key: 'userId',
175
+ sortField: 'user_id',
176
+ sortable: 'custom'
177
+ })
178
+ }
128
179
  columns.push({
129
180
  title: '姓名',
130
181
  key: 'userName',
131
182
  sortField: 'user_name',
132
183
  sortable: 'custom'
133
184
  })
185
+
186
+ if (self.useTransferRangeUsers && self.ucAdapterType == 'x1'){
187
+ columns.push({
188
+ title: '联系电话',
189
+ key: 'tel',
190
+ sortField: 'tel',
191
+ sortable: 'custom'
192
+ })
193
+ }
134
194
  columns.push({
135
195
  title: '部门名称',
136
196
  key: 'organName',
137
197
  sortField: 'organ_name',
138
198
  sortable: 'custom'
139
199
  })
140
- columns.push({
141
- title: '状态',
142
- key: 'status',
143
- sortable: 'custom',
144
- align: 'center',
145
- width: 100,
146
- render: function (h, param) {
147
- let state = param.row.status
148
- if (state === '00') {
149
- state = '正常'
150
- } else {
151
- state = '锁定'
152
- }
153
- return h('span', state)
200
+ if (self.useTransferRangeUsers && self.ucAdapterType == 'x1'){
201
+ columns.push({
202
+ title: '公司名称',
203
+ key: 'comName',
204
+ sortField: 'com_name',
205
+ sortable: 'custom'
206
+ })
207
+ }
208
+ if (!self.useTransferRangeUsers){
209
+ {
210
+ columns.push({
211
+ title: '状态',
212
+ key: 'status',
213
+ sortable: 'custom',
214
+ align: 'center',
215
+ width: 100,
216
+ render: function (h, param) {
217
+ let state = param.row.status
218
+ if (state === '00') {
219
+ state = '正常'
220
+ } else {
221
+ state = '锁定'
222
+ }
223
+ return h('span', state)
224
+ }
225
+ })
154
226
  }
155
- })
227
+ }
156
228
 
157
229
  return columns
158
230
  }
159
231
  },
160
232
  inject: ['toBeDoneListDoSearch'],
161
233
  methods: {
162
- init () {
234
+ init (organTreeType) {
163
235
  let self = this
164
- self.getRootData()
236
+ self.organTreeType = organTreeType
237
+ self.getRootData(organTreeType)
238
+ },
239
+ clearData(){
240
+ this.idSelectedArr = []
241
+ this.useTransferRangeUsers = false
242
+ //清除表格数据
243
+ this.doSearch()
165
244
  },
166
- toggleShowHelpBox() {
245
+ toggleShowHelpBox(organTreeType, permScope, helpBoxType, id, data, title) {
246
+ this.clearData()
247
+ this.id = id
248
+ this.title = title
249
+ this.helpBoxType = helpBoxType
250
+ this.organTreeType = organTreeType
251
+ if (helpBoxType === 'appointHandlerWithCandGroups'){
252
+ this.title = '选择候选人'
253
+ }
254
+ if (data && (data.orgList || data.userList)){
255
+ const {orgList, userList} = data
256
+ if (orgList && orgList.length > 0){
257
+ this.useTransferRangeOrgan = true
258
+ let childs = []
259
+ orgList.forEach(item => {
260
+ let obj = {}
261
+ obj.organId = item.orgId
262
+ obj.title = item.orgName
263
+ obj.name = item.orgName
264
+ obj.code = item.orgCode
265
+ obj.loading = false
266
+ obj.children = []
267
+ obj.hasChild = true
268
+ childs.push(obj)
269
+ })
270
+ this.treeData.push(childs)
271
+ const codesSeen = new Map();
272
+ this.treeData = this.treeData.reduce((acc, item, index) => {
273
+ if (!codesSeen.has(item.code)) {
274
+ codesSeen.set(item.code, index);
275
+ acc.push(item);
276
+ }
277
+ return acc;
278
+ }, []);
279
+ this.selectChange(this.treeData[0])
280
+ this.modalBoxShow = !this.modalBoxShow;
281
+ this.$forceUpdate()
282
+ return
283
+ }
284
+ if (userList && userList.length > 0){
285
+ this.treeData = []
286
+ this.useTransferRangeUsers = true
287
+ this.tableData = userList.map(item => {
288
+ return {
289
+ ...item,
290
+ organName: item.deptName,
291
+ status: '00'
292
+ }
293
+ })
294
+ this.modalBoxShow = !this.modalBoxShow;
295
+ this.$forceUpdate()
296
+ return
297
+ }
298
+ }
299
+ this.permScope = permScope
300
+ if (permScope && permScope !== 'all'){
301
+ this.getOrgTreeByProType(this.permScope, this.organTreeType)
302
+ } else {
303
+ this.permScopeList = 'all'
304
+ this.getRootData(organTreeType)
305
+ }
167
306
  this.modalBoxShow = !this.modalBoxShow;
307
+ this.$forceUpdate()
168
308
  },
169
309
 
170
310
  onOk(){
171
311
  let self = this
172
312
  let idSelectedArr = self.idSelectedArr
313
+ if (self.idSelectedArr.length === 0) {
314
+ self.onCancel()
315
+ return
316
+ }
173
317
  self.loading = true
174
- if (idSelectedArr.length > 1) {
175
- self.loading = false
176
- self.$Message.info('办理人只能选择一条记录!')
177
- this.$emit('update-selected', ''); // 触发事件并传递 userId
318
+ if (self.helpBoxType ==='addMultitaskInstance'){
319
+ idSelectedArr = [...new Set(idSelectedArr)]
320
+ const assingeeList = idSelectedArr.map(item => item.split(',')[0])
321
+ self.$emit('add-multitask-instance', assingeeList);
322
+ }else if (self.helpBoxType ==='appointHandlerWithCandGroups'){
323
+ idSelectedArr = [...new Set(idSelectedArr)]
324
+ self.$emit('appoint-handler-with-candGroups', idSelectedArr, self.id);
178
325
  } else {
179
- let auditResult = {
180
- code: self.data.auditResult,
181
- name: self.data.auditResultName,
182
- }
183
- self.data.selectedUserId=self.idSelectedArr[0];
184
- console.log("self.data:",self.data);
185
- let url = this.smartFlowServerContext + '/manage/processTodo/audit'
186
- ajax.post(url, self.data).then(function (resp) {
187
- let result = resp.data
188
- if (result.code == '200') {
189
- self.loading = false
190
- self.$Message.success(result.message);
191
- if (self.executionCompleted) {
192
- self.executionCompleted(true, self.data.instanceId, self.data.taskId, auditResult, self.data.taskId);
326
+ if (idSelectedArr.length > 1) {
327
+ self.loading = false
328
+ self.$Message.info('办理人只能选择一条记录!')
329
+ this.$emit('update-selected', ''); // 触发事件并传递 userId
330
+ } else {
331
+ let idSelectedArr = self.idSelectedArr[0].split(',')
332
+ if (self.helpBoxType === 'auditTo82'){
333
+ let auditResult = {
334
+ code: self.data.auditResult,
335
+ name: self.data.auditResultName,
193
336
  }
194
- self.toBeDoneListDoSearch();
195
- } else {
196
- self.loading = false
197
- self.$Message.error(result.message)
198
- if (self.executionCompleted) {
199
- self.executionCompleted(false, null, null, auditResult, self.data.taskId);
337
+ if (!self.showConfirmBox){
338
+ self.execute(auditResult, idSelectedArr[0])
339
+ this.modalBoxShow = false;
340
+ return;
200
341
  }
342
+ self.$Modal.confirm({
343
+ title: '提示',
344
+ content: '确定要' + auditResult.name + '吗?',
345
+ onOk: () => {
346
+ self.execute(auditResult, idSelectedArr[0])
347
+ },
348
+ onCancel: () => {
349
+ self.loading = false
350
+ self.disable = false
351
+ }
352
+ })
353
+ } else if (self.helpBoxType === 'delegateTask'){
354
+ self.$emit('delegate-task-assignee', idSelectedArr[0]);
355
+ } else {
356
+ self.$emit('update-next-node-assignee', idSelectedArr[0], idSelectedArr[1], self.id);
201
357
  }
202
- })
358
+ }
203
359
  }
204
360
  this.modalBoxShow = false;
205
361
  },
206
-
207
-
362
+ execute(auditResult, selectedUserId){
363
+ const self = this
364
+ self.data.selectedUserId = selectedUserId
365
+ let url = this.smartFlowServerContext + '/manage/processTodo/audit'
366
+ ajax.post(url, self.data).then(function (resp) {
367
+ let result = resp.data
368
+ if (result.code == '200') {
369
+ self.loading = false
370
+ self.$Message.success(result.message);
371
+ if (self.executionCompleted) {
372
+ self.executionCompleted(true, self.data.instanceId, self.data.taskId, auditResult, self.data.taskId);
373
+ }
374
+ self.toBeDoneListDoSearch();
375
+ } else {
376
+ self.loading = false
377
+ self.$Message.error(result.message)
378
+ if (self.executionCompleted) {
379
+ self.executionCompleted(false, null, null, auditResult, self.data.taskId);
380
+ }
381
+ }
382
+ })
383
+ },
208
384
  doSearch: function () {
209
385
  this.tableSearchParams = Object.assign({}, this.form)
210
386
  },
387
+ // 加签、选择下一环节候选人
211
388
  onSelectionChange: function (selection) {
212
389
  let self = this
213
- self.idSelectedArr = []
214
- if (selection.length > 1) {
215
- self.$Message.info('只能选择一条记录!')
216
- this.$refs.selection.selectAll(false);
390
+ if (self.helpBoxType === 'addMultitaskInstance' || self.helpBoxType === 'appointHandlerWithCandGroups') {
391
+ for (let item of selection) {
392
+ self.idSelectedArr.push(item.userId + ',' + item.userName)
393
+ }
217
394
  }
218
- for (let item of selection) {
219
- self.idSelectedArr.push(item.userId)
395
+ },
396
+ // 转办、委派、选择下一环节办理人
397
+ onCurrentChange(selection) {
398
+ let self = this
399
+ if (self.helpBoxType !== 'addMultitaskInstance' && self.helpBoxType !== 'appointHandlerWithCandGroups') {
400
+ self.idSelectedArr = []
401
+ self.idSelectedArr.push(selection.userId + ',' + selection.userName)
220
402
  }
221
403
  },
222
404
  loadData (node, callback) {
@@ -226,50 +408,289 @@ export default {
226
408
  }
227
409
  })
228
410
  },
229
- getRootData () {
411
+ getRootData (organTreeType) {
230
412
  let self = this
231
- let childs = []
232
- ajax.get(this.upmsServerContext + '/manage/ucOrgan/getOrgRootTree').then(function (resp) {
233
- if (resp.data.code === 1) {
413
+ let hostChilds = []
414
+ ajax.get(self.smartFlowServerContext + '/manage/bizorgan/getOrgRootTree?bizOrganTreeType=' + organTreeType).then(resp => {
415
+ if (resp.data.code === 200) {
234
416
  let data = resp.data.data
235
417
  if (data.length > 0) {
236
- data.forEach(item => {
237
- let obj = {}
238
- obj.type = item.organType
239
- obj.id = item.organId
240
- obj.orders = item.orders
241
- obj.title = item.organName
242
- obj.name = item.organName
243
- obj.com = item.com
244
- obj.code = item.organCode
245
- obj.loading = false
246
- obj.children = []
247
- obj.hasChild = true
248
- childs.push(obj)
418
+ for (let i = 0; i < data.length; i++) {
419
+ {
420
+ let obj = {}
421
+ obj.type = data[i].bizOrganType
422
+ obj.id = data[i].id
423
+ obj.organId = data[i].bizOrganId
424
+ obj.orders = data[i].orders
425
+ obj.title = data[i].bizOrganName
426
+ obj.name = data[i].bizOrganName
427
+ obj.com = data[i].bizOrganId
428
+ obj.code = data[i].bizOrganCode
429
+ obj.loading = false
430
+ obj.children = []
431
+ obj.hasChild = true
432
+ hostChilds.push(obj)
433
+ self.treeData.push(hostChilds);
434
+ const codesSeen = new Map();
435
+ self.treeData = self.treeData.reduce((acc, item, index) => {
436
+ if (!codesSeen.has(item.code)) {
437
+ codesSeen.set(item.code, index);
438
+ acc.push(item);
439
+ }
440
+ return acc;
441
+ }, []);
442
+ }
443
+ }
444
+ self.selectChange(self.treeData[0])
445
+ }
446
+ }
447
+ }).catch(err => {
448
+ console.log(err);
449
+ })
450
+ },
451
+ async getOrgTreeByProType(permScope, organTreeType){
452
+ let self = this
453
+ let userPermScope = permScope.substring(permScope.indexOf("U:"))
454
+ userPermScope = userPermScope.substring(2, userPermScope.indexOf(","))
455
+ let permScopeTwo = userPermScope.split(';')
456
+ if (permScopeTwo.length > 0 && permScopeTwo[0]){
457
+ self.permScopeList = 'U:' + userPermScope + ','
458
+ let promises = []
459
+ for (let i = 0; i < permScopeTwo.length; i++) {
460
+ let promise = ajax.get(self.smartFlowServerContext + "/manage/user/get/" + permScopeTwo[i] + '?treeType=' + organTreeType)
461
+ .then(resp => {
462
+ if (resp.data.code === 200) {
463
+ return resp.data.data.organCode
464
+ }
249
465
  })
466
+ promises.push(promise)
467
+ }
468
+ Promise.all(promises).then(async (result) => {
469
+ const uniqueResults = [...new Set(result.filter(Boolean))];
470
+ permScope = uniqueResults.join(';');
471
+ self.treeData = await this.getOrganTreeByProType(permScope, permScope, organTreeType);
472
+ self.selectChange(self.treeData[0])
473
+ })
474
+ } else {
475
+ //对于流程类型中没有规定人员范围但规定组织范围的情况
476
+ self.treeData = await this.getOrganTreeByProType(permScope, permScope.substring(2, permScope.indexOf(",")), organTreeType);
477
+ self.selectChange(self.treeData[0])
478
+ }
479
+ },
480
+ getOrganTreeByProType(row, permScope, organTreeType) {
481
+ const self = this
482
+ return new Promise((resolve, reject) => {
483
+ let organTree = [];
484
+ let childsTree = [];
485
+ if (permScope && permScope.length > 0) {
486
+ let params = {
487
+ orgTreeType: organTreeType,
488
+ };
489
+ permScope = permScope.split(';');
250
490
 
251
- childs[0].selected = true
252
- self.selectChange(childs)
491
+ const requests = permScope.map(perm => {
492
+ return ajax.get(self.smartFlowServerContext + '/manage/organ/get/' + perm, { params: params })
493
+ .then(resp => {
494
+ if (resp.data.code === 200) {
495
+ return resp.data.data;
496
+ } else {
497
+ return [];
498
+ }
499
+ })
500
+ .catch(err => {
501
+ console.error(err);
502
+ return [];
503
+ });
504
+ });
505
+
506
+ Promise.all(requests)
507
+ .then(results => {
508
+ let tree
509
+ if (self.ucAdapterType === 'x1'){
510
+ tree = self.x1OrganTree(results)
511
+ } else {
512
+ tree = self.scOrganTree(results)
513
+ }
514
+ for (let value of tree) {
515
+ self.formatOrganTree(value, childsTree, organTreeType)
516
+ }
517
+
518
+ organTree.push(childsTree);
519
+ const codesSeen = new Map();
520
+ organTree = organTree.reduce((acc, item, index) => {
521
+ if (!codesSeen.has(item.code)) {
522
+ codesSeen.set(item.code, index);
523
+ acc.push(item);
524
+ }
525
+ return acc;
526
+ }, []);
527
+ resolve(organTree);
528
+ })
529
+ .catch(err => {
530
+ reject(err);
531
+ });
532
+ } else {
533
+ resolve([]);
534
+ }
535
+ });
536
+ },
537
+ x1OrganTree(results){
538
+ const nodeMap = new Map();
539
+ results.forEach(item => {
540
+ const organCode = item.organCode
541
+ const organStruPath = item.organStruPath
542
+ const parts = organStruPath.split('#').filter(p => p);
543
+ let currentNode = nodeMap.get(organCode) || { organCode, organStruPath, item, children: []};
544
+ currentNode.parts = parts;
545
+ nodeMap.set(organCode, currentNode);
546
+ });
547
+ nodeMap.forEach(node => {
548
+ const { organCode, parts } = node;
549
+ let parentCode = null;
550
+ for (let i = 0; i < parts.length - 1; i++) {
551
+ parentCode = parts[i];
552
+ const parentNode = nodeMap.get(parentCode);
553
+
554
+ if (parentNode) {
555
+ if (parentNode.organId === node.item.parentId && !parentNode.children.some(child => child.organCode === organCode)) {
556
+ parentNode.children.push(node);
557
+ } else {
558
+ // 如果直接父节点不在流程类型范围内但祖宗节点在
559
+ let children = parentNode.children;
560
+ for (let j = i + 1; j < parts.length - 1; j++) {
561
+ const partCode = parts[j];
562
+ let existingChild = children.find(child => child.organCode === partCode);
563
+
564
+ if (!existingChild) {
565
+ existingChild = { organCode: partCode, children: [] };
566
+ children.push(existingChild);
567
+ }
568
+ children = existingChild.children;
569
+ }
570
+ // 将当前节点添加到最后一个子节点的 children 中
571
+ children.push(node);
572
+ }
573
+ nodeMap.delete(organCode);
574
+ break;
253
575
  }
254
- self.treeData = childs
255
576
  }
256
- })
577
+
578
+ });
579
+ return nodeMap.values()
580
+ },
581
+ scOrganTree(results){
582
+ const nodeMap = new Map();
583
+ results.forEach(item => {
584
+ const organId = item.organId
585
+ const parentId = item.parentId
586
+ let currentNode = nodeMap.get(organId) || { organId, parentId, item, children: []};
587
+ nodeMap.set(organId, currentNode);
588
+ });
589
+ const tree = [];
590
+ nodeMap.forEach((node, organId) => {
591
+ const parentId = node.parentId;
592
+
593
+ // 如果有父节点,则将当前节点添加到父节点的 children 数组中
594
+ if (parentId && nodeMap.has(parentId)) {
595
+ const parentNode = nodeMap.get(parentId);
596
+ parentNode.children.push(node);
597
+ } else {
598
+ tree.push(node);
599
+ }
600
+ });
601
+ return tree
602
+ },
603
+ formatOrganTree(nodeMap, childsTree, organTreeType){
604
+ const self = this
605
+ let obj = {}
606
+ if (nodeMap.item){
607
+ obj = {
608
+ type: nodeMap.item.organType,
609
+ id: nodeMap.item.id,
610
+ organId: nodeMap.item.organId,
611
+ orders: nodeMap.item.orders,
612
+ title: nodeMap.item.organName,
613
+ name: nodeMap.item.organName,
614
+ com: nodeMap.item.organId,
615
+ code: nodeMap.item.organCode,
616
+ loading: false,
617
+ checked: false,
618
+ hasChild: true,
619
+ children: [],
620
+ };
621
+ if (nodeMap.children && nodeMap.children.length > 0){
622
+ for (let child of nodeMap.children){
623
+ self.formatOrganTree(child, obj.children, organTreeType)
624
+ }
625
+ }
626
+ childsTree.push(obj);
627
+ } else {
628
+ let params = {
629
+ orgTreeType: organTreeType,
630
+ }
631
+ ajax.get(self.smartFlowServerContext + '/manage/organ/get/' + nodeMap.organCode, { params: params })
632
+ .then(resp => {
633
+ if (resp.data.code === 200) {
634
+ let data = resp.data.data
635
+ obj = {
636
+ type: data.organType,
637
+ id: data.id,
638
+ organId: data.organId,
639
+ orders: data.orders,
640
+ title: data.organName,
641
+ name: data.organName,
642
+ com: data.organId,
643
+ code: data.organCode,
644
+ loading: false,
645
+ disabled: true,
646
+ checked: false,
647
+ hasChild: true,
648
+ children: [],
649
+ render: (h, { root, node, data }) => {
650
+ return h('span', {
651
+ style: {
652
+ display: 'inline-block',
653
+ color: '#b9bbc0',
654
+ width: '100%'
655
+ }
656
+ }, [
657
+ h('span', [
658
+ h('span', data.title)
659
+ ])
660
+ ]);
661
+ },
662
+ }
663
+ if (nodeMap.children && nodeMap.children.length > 0){
664
+ for (let child of nodeMap.children){
665
+ self.formatOrganTree(child, obj.children, organTreeType)
666
+ }
667
+ }
668
+ childsTree.push(obj);
669
+ }
670
+ })
671
+ .catch(err => {
672
+ console.error(err);
673
+ return [];
674
+ })
675
+ }
257
676
  },
258
677
  getData (node, callback) {
259
678
  let self = this
260
679
  ajax.get(this.upmsServerContext + '/manage/ucOrgan/getOrgSubNodes', {
261
680
  params: {
262
- organCode: node.code
681
+ organCode: node.code,
682
+ orgTreeType: self.organTreeType
263
683
  }
264
684
  }).then(function (resp) {
265
685
  const childs = []
266
686
  if (resp.data.code === 1) {
267
687
  let nodeDatas = resp.data.data
268
- if (nodeDatas.length > 0) {
688
+ if (nodeDatas && nodeDatas.length > 0) {
269
689
  nodeDatas.forEach(item => {
270
690
  let obj = {}
271
691
  obj.type = item.organType
272
- obj.id = item.organId
692
+ obj.id = item.id
693
+ obj.organId = item.organId
273
694
  obj.orders = item.orders
274
695
  obj.title = item.organName
275
696
  obj.name = item.organName
@@ -299,14 +720,22 @@ export default {
299
720
  },
300
721
  selectChange (node) {
301
722
  let self = this
302
- if (node.length > 0) {
723
+ if (node && node.length > 0) {
303
724
  if (self.currentNode !== node[0]) {
304
725
  self.currentNode = node[0]
305
726
 
306
- self.form.organId = self.currentNode.id
727
+ self.form.organId = self.currentNode.organId
307
728
  self.form.organTitle = self.currentNode.title
308
729
 
309
- self.dataUrl =this.upmsServerContext+ '/manage/user/list'
730
+ let permScopeList = self.permScopeList
731
+ if (permScopeList !== 'all'){
732
+ permScopeList += 'O:' + self.currentNode.code
733
+ }
734
+ self.dataUrl =self.smartFlowServerContext+ '/manage/user/getAssigneeList?orgTreeType=' + self.organTreeType + "&permScopeList=" + permScopeList
735
+
736
+ if (this.useTransferRangeOrgan){
737
+ self.dataUrl = self.upmsServerContext+ '/manage/user/list?orgTreeType=' + self.organTreeType
738
+ }
310
739
  self.doSearch()
311
740
 
312
741
  if (node[0].children.length <= 0) {
@@ -323,11 +752,24 @@ export default {
323
752
  },
324
753
 
325
754
  onCancel () {
326
- this.$emit('update-selected', ''); // 触发事件并传递 userId
755
+ if (this.helpBoxType === 'auditTo82'){
756
+ this.$emit('update-selected', ''); // 触发事件并传递 userId
757
+ }
327
758
  this.modalBoxShow = false;
328
759
 
329
760
  },
330
761
 
762
+ getSystemConfig(){
763
+ const self = this
764
+ ajax.get(self.smartFlowServerContext + '/anon/systemConfig/getSystemConfig').then(function (resp) {
765
+ const result = resp.data;
766
+ if (result && result.code === '200') {
767
+ self.ucAdapterType = result.data.ucAdapterType
768
+ }
769
+ }).catch(err => {
770
+ console.log(err);
771
+ })
772
+ },
331
773
 
332
774
  },
333
775
  };
@@ -336,10 +778,15 @@ export default {
336
778
  <style lang="less" scope>
337
779
  .org-info{
338
780
  display: flex;
781
+ max-height: 700px;
339
782
  .org-tree {
340
783
  width: 265px;
341
784
  min-height: 450px;
342
785
  border-right: 1px solid #dcdee2;
786
+ .tree-content {
787
+ height: 100%;
788
+ overflow-y: auto;
789
+ }
343
790
  }
344
791
 
345
792
  .org-detil {