eoss-mobiles 0.2.98 → 0.3.0

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.
@@ -0,0 +1,319 @@
1
+ <template>
2
+ <div class="em-flow-setting">
3
+ <van-collapse v-model="active">
4
+ <van-collapse-item title="预设自定义节点信息(折叠不作处理)" name="1">
5
+ <div
6
+ class="em-flow-setting-item"
7
+ v-for="(item, index) in flowList"
8
+ :key="index"
9
+ >
10
+ <!-- <em-input v-model="name" :label="`节点${index + 1}`" /> -->
11
+ <em-picker
12
+ :title="`节点${index + 1}`"
13
+ :label="`节点${index + 1}`"
14
+ show-toolbar
15
+ v-model="item.nodeId"
16
+ :columns="item.nodeList"
17
+ value-key="nodeId"
18
+ label-key="nodeName"
19
+ @confirm="onConfirmNextNode($event, index)"
20
+ />
21
+ <em-selector
22
+ :multiple="!item.isRadio"
23
+ v-show="item.showSelectUser"
24
+ :nextUserList="item.nextUserList"
25
+ v-model="item.nextUserSelectList"
26
+ label="办理人"
27
+ :objType="item.objType"
28
+ :param="{
29
+ pid: item.pid
30
+ }"
31
+ :required="item.nodeId != ''"
32
+ tabs="employee,persongroup"
33
+ :baseUrl="apiBaseUrl"
34
+ :paddingTop="paddingTop"
35
+ />
36
+ <van-icon
37
+ name="down"
38
+ v-show="index + 1 != flowList.length"
39
+ style="margin-top: 10px"
40
+ /></div></van-collapse-item
41
+ ></van-collapse>
42
+ </div>
43
+ </template>
44
+
45
+ <script>
46
+ import {
47
+ getPresetCustomInfo,
48
+ getNodeInfoHtml
49
+ } from '../../../../src/config/api.js';
50
+ import request from '../../../../src/utils/http.js';
51
+ export default {
52
+ props: {
53
+ processDefinitionId: {
54
+ type: String,
55
+ default: ''
56
+ },
57
+ nodeId: {
58
+ type: String,
59
+ default: ''
60
+ },
61
+ businessId: {
62
+ type: String,
63
+ default: ''
64
+ },
65
+ taskId: {
66
+ type: String,
67
+ default: ''
68
+ },
69
+ pendingId: {
70
+ type: String,
71
+ default: ''
72
+ },
73
+ apiBaseUrl: {
74
+ type: String,
75
+ default: ''
76
+ },
77
+ paddingTop: {
78
+ type: Number,
79
+ default: 0
80
+ },
81
+ choiceOrgId: {
82
+ type: String,
83
+ default: ''
84
+ },
85
+ pOrgId: {
86
+ type: String,
87
+ default: ''
88
+ },
89
+ choiceDeptId: {
90
+ type: String,
91
+ default: ''
92
+ }
93
+ },
94
+ data() {
95
+ return {
96
+ name: '',
97
+ pid: 'root',
98
+ objType: 'enterprise',
99
+ selectType: 'employee',
100
+ active: ['1'],
101
+ flowList: [],
102
+ selectList: [],
103
+ isRadio: true,
104
+ nodeList: []
105
+ };
106
+ },
107
+ watch: {
108
+ nodeId: {
109
+ handler(val) {
110
+ if (val) {
111
+ // this.getProList(val);
112
+ this.getNodeInfo(val);
113
+ }
114
+ },
115
+ immediate: true,
116
+ deep: true
117
+ }
118
+ },
119
+ methods: {
120
+ getValue() {
121
+ let pass = true;
122
+ let PresetData = [];
123
+ let newFlowList = this.flowList.filter((x) => x.nodeId);
124
+ for (let i = 0; i < newFlowList.length; i++) {
125
+ if (newFlowList[i].nextUserSelectList.length == 0 && newFlowList[i].showSelectUser) {
126
+ pass = false;
127
+ this.$toast(`请选择节点${i + 1}的办理人`);
128
+ return false;
129
+ }
130
+ }
131
+ if (pass) {
132
+ newFlowList.map((x, i) => {
133
+ PresetData.push({
134
+ name: typeof x.nodeId == 'object'? x.nodeId.nodeId : x.nodeId,
135
+ value: x.nextUserSelectList
136
+ .map((y) => {
137
+ return y.showid;
138
+ })
139
+ .join(','),
140
+ lastName: i == 0 ? this.nodeId : PresetData[i - 1].name,
141
+ sequence: i + 1 +''
142
+ });
143
+ });
144
+ }
145
+ return JSON.stringify(PresetData);
146
+ },
147
+ // 根据返回的办理人类型来判断 选择人员树的范围
148
+ changePidObjtype(val, choiceOrgId, choiceDeptId, pOrgId, obj) {
149
+ if (val === 1 || val === 2) {
150
+ obj.pid = choiceOrgId || this.orgId;
151
+ obj.objType = 'enterprise';
152
+ obj.selectType = 'employee';
153
+ } else if (val === 3 || val === 4) {
154
+ obj.pid = 'root';
155
+ obj.objType = 'employee';
156
+ } else if (val === 5 || val === 6) {
157
+ obj.pid = choiceDeptId || this.depId;
158
+ obj.objType = 'department';
159
+ } else if (val === 11 || val === 12) {
160
+ obj.selectType = 'employee';
161
+ obj.objType = 'enterprise';
162
+ } else if (val === 13) {
163
+ obj.pid = choiceDeptId || this.depId;
164
+ obj.selectType = 'employee';
165
+ obj.objType = 'department';
166
+ } else if (val === 14) {
167
+ obj.pid = pOrgId || this.orgId;
168
+ obj.selectType = 'employee';
169
+ } else if (val === 15 || val === 16) {
170
+ obj.pid = pOrgId || this.orgId;
171
+ obj.selectType = 'employee';
172
+ }
173
+ // userSelectionType 机构内单选人1,机构内多选人2,所有机构单选人3,所有部门多选人4,本部门单选人5,本部门多选人6,本单位单选部门7,本单位多选部门8,单选单位9,多选单位10,单选机构11,多选机构12,本部门角色13,本单位角色14
174
+ val == 2 ||
175
+ val == 4 ||
176
+ val == 6 ||
177
+ val == 8 ||
178
+ val == 10 ||
179
+ val == 11 ||
180
+ val == 12
181
+ ? (obj.isRadio = false)
182
+ : (obj.isRadio = true); //判断办理人单选多选
183
+ },
184
+ // 修改默认办理人
185
+ changeDefPeople(def, all, data) {
186
+ data.nextUserSelectList = [];
187
+ if ((def == 1 && all == 1) || (def == 0 && all == 1)) {
188
+ let ids = '';
189
+ data.nextUserList.map((r, i) => {
190
+ r.showid = r.userId;
191
+ r.showname = r.username;
192
+ this.$set(r, 'checked', true);
193
+ data.nextUserSelectList.push(r);
194
+ ids += r.userId + (i === data.nextUserList.length - 1 ? '' : ',');
195
+ });
196
+ // this.form.nextUserId = ids;
197
+ } else if (
198
+ def == 1 &&
199
+ (!all || all == 0) &&
200
+ data.nextUserList.length > 0
201
+ ) {
202
+ data.nextUserList[0].showid = data.nextUserList[0].userId;
203
+ data.nextUserList[0].showname = data.nextUserList[0].username;
204
+ this.$set(data.nextUserList[0], 'checked', true);
205
+ data.nextUserSelectList.push(data.nextUserList[0]);
206
+ // this.form.nextUserId = this.nextUserSelectList[0].userId;
207
+ }
208
+ },
209
+ onConfirmNextNode(val, i) {
210
+ this.flowList = this.flowList.splice(0, i + 1);
211
+ if (val.nodeId == '-2') {
212
+ this.flowList[i].nextUserList = [];
213
+ this.flowList[i].nextUserSelectList = [];
214
+ } else {
215
+ this.getNodeInfo(val.nodeId, i);
216
+ }
217
+ },
218
+ getNodeInfo(nodeId, i) {
219
+ this.$toast.loading({
220
+ message: '加载中...',
221
+ forbidClick: true,
222
+ loadingType: 'spinner',
223
+ overlay: true,
224
+ duration: 0
225
+ });
226
+ request({
227
+ url: getNodeInfoHtml,
228
+ params: {
229
+ processDefinitionId: this.processDefinitionId,
230
+ nextNodeId: nodeId,
231
+ businessId: this.businessId,
232
+ taskId: this.taskId,
233
+ pendingId: this.pendingId
234
+ }
235
+ }).then((res) => {
236
+ if (res.status == 'success') {
237
+ // this.nodeList = res.data.taskNodeMap;
238
+ let obj = {};
239
+ if (i != undefined) {
240
+ res.data.nextUserList.map((res) => {
241
+ res.checked = false;
242
+ });
243
+
244
+ this.flowList[i].nextUserList = res.data.nextUserList || [];
245
+ this.flowList[i].nextUserSelectList = res.data.nextUserList || [];
246
+ this.changeDefPeople(
247
+ res.data.nodeExtAttr.isDefSelectedObj,
248
+ res.data.nodeExtAttr.isSelectedAllObj,
249
+ this.flowList[i]
250
+ );
251
+ this.changePidObjtype(
252
+ res.data.nodeExtAttr.userSelectionType,
253
+ this.choiceOrgId,
254
+ this.choiceDeptId,
255
+ this.pOrgId,
256
+ this.flowList[i]
257
+ );
258
+ } else {
259
+ obj.nextUserList = [];
260
+ obj.nextUserSelectList = [];
261
+ this.changeDefPeople(
262
+ res.data.nodeExtAttr.isDefSelectedObj,
263
+ res.data.nodeExtAttr.isSelectedAllObj,
264
+ obj
265
+ );
266
+ this.changePidObjtype(
267
+ res.data.nodeExtAttr.userSelectionType,
268
+ this.choiceOrgId,
269
+ this.choiceDeptId,
270
+ this.pOrgId,
271
+ obj
272
+ );
273
+ }
274
+ this.getProList(nodeId, obj);
275
+ }
276
+ });
277
+ },
278
+ getProList(nodeId, obj) {
279
+ request({
280
+ url: getPresetCustomInfo,
281
+ params: {
282
+ processDefinitionId: this.processDefinitionId,
283
+ nodeId: nodeId,
284
+ taskAction: 'withExtendData'
285
+ }
286
+ }).then((res) => {
287
+ this.$toast.clear();
288
+ if (res.status == 'success') {
289
+ let arr = [{ nodeId: '-2', nodeName: '请选择' }];
290
+ let isEnd = false;
291
+ if (res.data.taskNodeMap) {
292
+ for (let i in res.data.taskNodeMap || res.data || {}) {
293
+ let obj = {
294
+ nodeId: i,
295
+ nodeName: res.data.taskNodeMap[i]
296
+ };
297
+ isEnd = i == 'endEvent';
298
+ arr.push(obj);
299
+ }
300
+ }
301
+ if (isEnd) {
302
+ arr = arr.slice(1);
303
+ }
304
+ obj = {
305
+ ...obj,
306
+ nodeList: arr,
307
+ nodeId: '',
308
+ nodeId: isEnd ? arr[0].nodeId : '',
309
+ showSelectUser: !isEnd
310
+ };
311
+ this.flowList.push(obj);
312
+ }
313
+ });
314
+ }
315
+ }
316
+ };
317
+ </script>
318
+
319
+ <style></style>
@@ -80,6 +80,20 @@
80
80
  label="办理人"
81
81
  />
82
82
  </div>
83
+ <!-- <ProcessSetting
84
+ v-if="processObj.isCustomPreset"
85
+ ref="processSetting"
86
+ :processDefinitionId="processObj.processDefinitionId"
87
+ :nodeId="form.nextNodeId"
88
+ :taskId="processObj.taskId"
89
+ :pendingId="processObj.pendingId"
90
+ :businessId="processObj.businessId"
91
+ :apiBaseUrl="apiBaseUrl"
92
+ :paddingTop="paddingTop"
93
+ :choiceOrgId="orgId"
94
+ :pOrgId="orgId"
95
+ :choiceDeptId="depId"
96
+ /> -->
83
97
  <!-- 通知方式 -->
84
98
  <Message
85
99
  ref="message"
@@ -120,6 +134,7 @@ import request from '../../../../src/utils/http.js';
120
134
  import Opinion from './Opinion.vue';
121
135
  import Message from './Message.vue';
122
136
  import { Dialog } from 'eoss-mobile-vant';
137
+ import ProcessSetting from './ProcessSettings.vue';
123
138
  import $ from '../../../../src/utils/util';
124
139
  export default {
125
140
  name: 'StartFlow',
@@ -195,7 +210,8 @@ export default {
195
210
  },
196
211
  components: {
197
212
  Opinion,
198
- Message
213
+ Message,
214
+ ProcessSetting
199
215
  },
200
216
  mounted() {
201
217
  let obj = {
@@ -296,6 +312,16 @@ export default {
296
312
  userId: this.userId || $.getStorage('userId'),
297
313
  mobileKey: $.getStorage('deviceId') || '123'
298
314
  };
315
+ // if (this.processObj.isCustomPreset ) {
316
+ // if (this.$refs.processSetting.active.length != 0) {
317
+ // if(!this.$refs.processSetting.getValue())return
318
+ // info.customPresetUserJson = this.$refs.processSetting.getValue();
319
+ // info.isCustomPreset = true;
320
+ // } else {
321
+ // delete info.customPresetUserJson;
322
+ // delete info.isCustomPreset;
323
+ // }
324
+ // }
299
325
  if (this.beforeSubmit) {
300
326
  this.beforeSubmit(info);
301
327
  return;
@@ -322,7 +348,7 @@ export default {
322
348
  type: 'get',
323
349
  params: { params: info }
324
350
  // format: false
325
- }).then(res => {
351
+ }).then((res) => {
326
352
  this.$toast.clear();
327
353
  if (res.rCode == 0) {
328
354
  this.$toast('操作成功');
@@ -339,7 +365,7 @@ export default {
339
365
  },
340
366
  // 选择办理人
341
367
  onClickPeople(label) {
342
- this.$nextTick(function() {
368
+ this.$nextTick(function () {
343
369
  this.$refs.selectTree.getContent(label);
344
370
  });
345
371
  let obj = {
@@ -418,7 +444,7 @@ export default {
418
444
  // 获取发起流程信息
419
445
  getProcessObj(res) {
420
446
  let that = this;
421
- return new Promise(function(resolve, reiect) {
447
+ return new Promise(function (resolve, reiect) {
422
448
  request({
423
449
  url: that.apiBaseUrl ? that.apiBaseUrl + toStartFlow : toStartFlow,
424
450
  params: {
@@ -427,7 +453,7 @@ export default {
427
453
  userId: that.userId || $.getStorage('userId')
428
454
  }
429
455
  }
430
- }).then(res => {
456
+ }).then((res) => {
431
457
  if (res.rCode == 0) {
432
458
  res.results.nodeExtr.submitTipsMsg &&
433
459
  Dialog.confirm({
@@ -443,8 +469,9 @@ export default {
443
469
  });
444
470
  if (res.results.extendData) {
445
471
  that.notificationMessageReadOnly =
446
- res.results.extendData.notificationMessageReadOnly == 'true';
447
- that.readOnlyNotificationType = res.results.extendData.readOnlyNotificationType;
472
+ res.results.extendData.notificationMessageReadOnly == 'true';
473
+ that.readOnlyNotificationType =
474
+ res.results.extendData.readOnlyNotificationType;
448
475
  }
449
476
  that.processObj = res.results;
450
477
  that.nextList = res.results.nodeList;
@@ -464,7 +491,7 @@ export default {
464
491
  that.nextList[0].list[0].transactorInfos &&
465
492
  (that.nextUserList = that.nextList[0].list[0].transactorInfos);
466
493
  if (that.nextUserList) {
467
- that.nextUserList.map(x => {
494
+ that.nextUserList.map((x) => {
468
495
  x.checked = false;
469
496
  });
470
497
  }
@@ -476,10 +503,10 @@ export default {
476
503
  that.defaultNotificationType.length == 0
477
504
  ) {
478
505
  defaultNotificationTypes = res.results.notificationTypes.filter(
479
- x => x.defaultSelected == 'true'
506
+ (x) => x.defaultSelected == 'true'
480
507
  );
481
508
  }
482
- defaultNotificationTypes.map(x => {
509
+ defaultNotificationTypes.map((x) => {
483
510
  that.defaultNotificationType.push(x.notificationCode);
484
511
  });
485
512
  resolve();
@@ -503,7 +530,7 @@ export default {
503
530
  userId: _that.userId
504
531
  }
505
532
  }
506
- }).then(res => {
533
+ }).then((res) => {
507
534
  this.$toast.clear();
508
535
  if (res.rCode == 0) {
509
536
  this.peopleObj = res.results.nodeExtr;
@@ -525,7 +552,7 @@ export default {
525
552
  ) {
526
553
  this.nextUserSelectList = [];
527
554
  idStr = '';
528
- this.nextUserList.map(x => {
555
+ this.nextUserList.map((x) => {
529
556
  x.checked = true;
530
557
  this.nextUserSelectList.push(x);
531
558
  idStr = idStr ? idStr + ',' + x.showid : idStr;