@lambo-design/workflow-approve 1.0.0-beta.19 → 1.0.0-beta.20

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambo-design/workflow-approve",
3
- "version": "1.0.0-beta.19",
3
+ "version": "1.0.0-beta.20",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
@@ -70,7 +70,11 @@ export default {
70
70
  },
71
71
  data() {
72
72
  return {
73
+ id: '',
74
+ helpBoxType: 'transferCurTask',
73
75
  loading: false,
76
+ organTreeType: '00',
77
+ permScope: 'all',
74
78
  modalBoxShow: false,
75
79
  dataUrl:'',
76
80
  helpBoxColumns: [
@@ -104,9 +108,9 @@ export default {
104
108
  tableSearchParams: {},
105
109
  };
106
110
  },
107
- created () {
111
+ /* created () {
108
112
  this.init()
109
- },
113
+ },*/
110
114
  computed: {
111
115
 
112
116
  tableColumn () {
@@ -159,11 +163,24 @@ export default {
159
163
  },
160
164
  inject: ['toBeDoneListDoSearch'],
161
165
  methods: {
162
- init () {
166
+ init (organTreeType) {
163
167
  let self = this
164
- self.getRootData()
168
+ self.organTreeType = organTreeType
169
+ self.getRootData(organTreeType)
165
170
  },
166
- toggleShowHelpBox() {
171
+ toggleShowHelpBox(organTreeType, permScope, helpBoxType, id) {
172
+ this.id = id
173
+ this.helpBoxType = helpBoxType
174
+ this.organTreeType = organTreeType
175
+ if (permScope && permScope !== 'all'){
176
+ let userPermScope = permScope.substring(permScope.indexOf("U:"))
177
+ userPermScope = userPermScope.substring(2, userPermScope.indexOf(","))
178
+ if (userPermScope.length > 0) {
179
+ userPermScope = userPermScope.split(';')
180
+ this.permScope = userPermScope
181
+ }
182
+ }
183
+ this.getRootData(organTreeType)
167
184
  this.modalBoxShow = !this.modalBoxShow;
168
185
  },
169
186
 
@@ -176,35 +193,39 @@ export default {
176
193
  self.$Message.info('办理人只能选择一条记录!')
177
194
  this.$emit('update-selected', ''); // 触发事件并传递 userId
178
195
  } 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);
193
- }
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);
200
- }
196
+ let idSelectedArr = self.idSelectedArr[0].split(',')
197
+ if (self.helpBoxType === 'transferCurTask'){
198
+ let auditResult = {
199
+ code: self.data.auditResult,
200
+ name: self.data.auditResultName,
201
201
  }
202
- })
202
+ self.data.selectedUserId=idSelectedArr[0];
203
+ console.log("self.data:",self.data);
204
+ let url = this.smartFlowServerContext + '/manage/processTodo/audit'
205
+ ajax.post(url, self.data).then(function (resp) {
206
+ let result = resp.data
207
+ if (result.code == '200') {
208
+ self.loading = false
209
+ self.$Message.success(result.message);
210
+ if (self.executionCompleted) {
211
+ self.executionCompleted(true, self.data.instanceId, self.data.taskId, auditResult, self.data.taskId);
212
+ }
213
+ self.toBeDoneListDoSearch();
214
+ } else {
215
+ self.loading = false
216
+ self.$Message.error(result.message)
217
+ if (self.executionCompleted) {
218
+ self.executionCompleted(false, null, null, auditResult, self.data.taskId);
219
+ }
220
+ }
221
+ })
222
+ } else {
223
+ self.$emit('update-next-node-assignee', idSelectedArr[0], idSelectedArr[1], self.id);
224
+ }
203
225
  }
204
226
  this.modalBoxShow = false;
205
227
  },
206
228
 
207
-
208
229
  doSearch: function () {
209
230
  this.tableSearchParams = Object.assign({}, this.form)
210
231
  },
@@ -216,7 +237,7 @@ export default {
216
237
  this.$refs.selection.selectAll(false);
217
238
  }
218
239
  for (let item of selection) {
219
- self.idSelectedArr.push(item.userId)
240
+ self.idSelectedArr.push(item.userId + ',' + item.userName)
220
241
  }
221
242
  },
222
243
  loadData (node, callback) {
@@ -226,10 +247,13 @@ export default {
226
247
  }
227
248
  })
228
249
  },
229
- getRootData () {
250
+ getRootData (organTreeType) {
230
251
  let self = this
231
252
  let childs = []
232
- ajax.get(this.upmsServerContext + '/manage/ucOrgan/getOrgRootTree').then(function (resp) {
253
+ let params = {
254
+ treeTypeId: organTreeType
255
+ }
256
+ ajax.get(this.upmsServerContext + '/manage/ucOrgan/getOrgRootTree', {params: params}).then(function (resp) {
233
257
  if (resp.data.code === 1) {
234
258
  let data = resp.data.data
235
259
  if (data.length > 0) {
@@ -259,13 +283,14 @@ export default {
259
283
  let self = this
260
284
  ajax.get(this.upmsServerContext + '/manage/ucOrgan/getOrgSubNodes', {
261
285
  params: {
262
- organCode: node.code
286
+ organCode: node.code,
287
+ orgTreeType: self.organTreeType
263
288
  }
264
289
  }).then(function (resp) {
265
290
  const childs = []
266
291
  if (resp.data.code === 1) {
267
292
  let nodeDatas = resp.data.data
268
- if (nodeDatas.length > 0) {
293
+ if (nodeDatas && nodeDatas.length > 0) {
269
294
  nodeDatas.forEach(item => {
270
295
  let obj = {}
271
296
  obj.type = item.organType
@@ -299,14 +324,15 @@ export default {
299
324
  },
300
325
  selectChange (node) {
301
326
  let self = this
302
- if (node.length > 0) {
327
+ if (node && node.length > 0) {
303
328
  if (self.currentNode !== node[0]) {
304
329
  self.currentNode = node[0]
305
330
 
306
331
  self.form.organId = self.currentNode.id
307
332
  self.form.organTitle = self.currentNode.title
308
333
 
309
- self.dataUrl =this.upmsServerContext+ '/manage/user/list'
334
+ let permScope = self.permScope ? self.permScope : 'all'
335
+ self.dataUrl =self.smartFlowServerContext+ '/manage/processDesign/getAssigneeList?orgTreeType=' + self.organTreeType + "&permScopeList=" + permScope
310
336
  self.doSearch()
311
337
 
312
338
  if (node[0].children.length <= 0) {
@@ -323,7 +349,9 @@ export default {
323
349
  },
324
350
 
325
351
  onCancel () {
326
- this.$emit('update-selected', ''); // 触发事件并传递 userId
352
+ if (this.helpBoxType === 'transferCurTask'){
353
+ this.$emit('update-selected', ''); // 触发事件并传递 userId
354
+ }
327
355
  this.modalBoxShow = false;
328
356
 
329
357
  },