vue2-client 1.8.430 → 1.8.432
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/.env.gaslink +19 -0
- package/package.json +2 -1
- package/src/base-client/components/common/XFormGroup/demo.vue +40 -40
- package/src/base-client/components/common/XReport/index.js +3 -3
- package/src/base-client/components/common/XReportGrid/XReport.vue +9 -3
- package/src/base-client/components/common/XReportGrid/XReportDesign.vue +14 -1
- package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +6 -1
- package/src/pages/DynamicStatistics/FavoriteList.vue +51 -51
- package/src/pages/WorkflowDetail/WorkFlowDemo.vue +21 -0
- package/src/pages/WorkflowDetail/WorkflowDetail.vue +44 -119
- package/src/pages/WorkflowDetail/WorkflowPageDetail/LeaveMessage.vue +28 -104
- package/src/pages/WorkflowDetail/WorkflowPageDetail/{ApplyBaseInformation.vue → WorkFlowBaseInformation.vue} +11 -11
- package/src/pages/WorkflowDetail/WorkflowPageDetail/{ApplyBaseInformationDetails.vue → WorkFlowBaseInformationDetails.vue} +8 -17
- package/src/pages/WorkflowDetail/WorkflowPageDetail/{ApplyHandle.vue → WorkFlowHandle.vue} +62 -416
- package/src/pages/WorkflowDetail/WorkflowPageDetail/{ApplyHandleReso.vue → WorkFlowHandleReso.vue} +37 -232
- package/src/pages/WorkflowDetail/WorkflowPageDetail/{ApplyTimeline.vue → WorkFlowTimeline.vue} +2 -2
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkOrderParentDetails.vue +43 -70
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkflowDetailResso.vue +42 -72
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkflowListResolution.vue +37 -113
- package/src/pages/WorkflowDetail/WorkflowPageDetail/{ApplyWorkflowLog.vue → WorkflowLog.vue} +6 -6
- package/src/router/async/router.map.js +2 -1
- package/src/services/api/common.js +3 -1
- package/src/services/api/entity.js +18 -18
- package/src/services/api/index.js +2 -2
- package/src/services/api/restTools.js +22 -1
- package/src/services/api/workFlow.js +63 -0
- package/src/utils/waterMark.js +31 -31
- package/vue.config.js +5 -0
- package/src/services/api/applyService/apiApply.js +0 -187
|
@@ -1,27 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<x-add-form
|
|
4
|
-
:json-data="xAddFormDefine"
|
|
5
|
-
:modify-model-data="xAddFormData"
|
|
6
|
-
:visible.sync="xAddFormVisible"
|
|
7
|
-
@onSubmit="xAddFormSubmit"/>
|
|
8
3
|
<!-- 上方流程显示 -->
|
|
9
4
|
<a-card :bordered="false" :loading="loading" title="项目进度">
|
|
10
5
|
<!-- 项目进度流程 -->
|
|
11
|
-
<
|
|
6
|
+
<work-flow-timeline
|
|
12
7
|
:current-step-id="currentStepId"
|
|
13
8
|
:active-step-id="activeStepId"
|
|
14
|
-
:
|
|
9
|
+
:workflow-id="workflowId"
|
|
15
10
|
:steps="stepsForChild"
|
|
16
|
-
:state="
|
|
11
|
+
:state="workflowState"
|
|
17
12
|
change-able
|
|
18
13
|
@activeStep="activeStep"/>
|
|
19
14
|
</a-card>
|
|
20
15
|
<!-- 如果不是当前步骤,显示历史记录 -->
|
|
21
16
|
<a-tabs default-active-key="1" @change="note = ''">
|
|
22
|
-
<a-tab-pane key="1" :tab="!beforeStepActive && !
|
|
17
|
+
<a-tab-pane key="1" :tab="!beforeStepActive && !workflowState ? '表单' : '进度详情'">
|
|
23
18
|
<a-card :bordered="false" :loading="loadingHistory">
|
|
24
|
-
<div v-if="beforeStepActive ||
|
|
19
|
+
<div v-if="beforeStepActive || workflowState">
|
|
25
20
|
<!-- 当前步骤无记录 -->
|
|
26
21
|
<div v-show="!formCompletedDataPreview" style="text-align: center">
|
|
27
22
|
<h1>该步骤暂无记录</h1>
|
|
@@ -57,15 +52,15 @@
|
|
|
57
52
|
</div>
|
|
58
53
|
</div>
|
|
59
54
|
<!-- 如果是当前步骤,填写表单,控制流程等 -->
|
|
60
|
-
<div v-if="!beforeStepActive && !
|
|
55
|
+
<div v-if="!beforeStepActive && !workflowState">
|
|
61
56
|
<div v-if="canSubmit">
|
|
62
57
|
<!-- 退回提示 -->
|
|
63
58
|
<a-alert v-if="currentStep && currentStep.back" type="info" show-icon style="margin-bottom: 14px">
|
|
64
59
|
<div slot="message">
|
|
65
60
|
<span style="color: #000">被退回</span>
|
|
66
61
|
<span style="margin-left: 14px; font-size: 14px; color: rgba(0, 0, 0, 0.65)">{{
|
|
67
|
-
|
|
68
|
-
|
|
62
|
+
currentStep.back.f_desc
|
|
63
|
+
}}</span>
|
|
69
64
|
</div>
|
|
70
65
|
<div slot="description">
|
|
71
66
|
<div>操作人:{{ currentStep.back.f_operator }}</div>
|
|
@@ -85,7 +80,6 @@
|
|
|
85
80
|
v-if="stepDefine.length > 0"
|
|
86
81
|
ref="xAddForm"
|
|
87
82
|
@onSubmit="submitForm">
|
|
88
|
-
>
|
|
89
83
|
</x-add-native-form>
|
|
90
84
|
<a-form v-if="!lastStep" label-align="left" :label-col="{ span: 3 }" :wrapper-col="{ span: 13 }">
|
|
91
85
|
<a-form-item v-if="showStepNextBtn" label="操作类型" required>
|
|
@@ -175,7 +169,7 @@
|
|
|
175
169
|
</a-card>
|
|
176
170
|
</a-tab-pane>
|
|
177
171
|
<!-- 退回 -->
|
|
178
|
-
<a-tab-pane v-if="canSubmit && !beforeStepActive && showPrevBtn && !
|
|
172
|
+
<a-tab-pane v-if="canSubmit && !beforeStepActive && showPrevBtn && !workflowState" key="2" tab="退回">
|
|
179
173
|
<a-form layout="vertical">
|
|
180
174
|
<a-form-item label="退回原因" :wrapper-col="{ span: 10 }" required>
|
|
181
175
|
<a-textarea
|
|
@@ -200,23 +194,9 @@
|
|
|
200
194
|
</a-form-item>
|
|
201
195
|
</a-form>
|
|
202
196
|
</a-tab-pane>
|
|
203
|
-
<a-tab-pane v-if="
|
|
204
|
-
<!-- 子表内容 -->
|
|
205
|
-
<a-card :bordered="false">
|
|
206
|
-
<x-form-table
|
|
207
|
-
ref="xFormTable"
|
|
208
|
-
:queryParamsJson="currentStepSubTableDefine"
|
|
209
|
-
title="业务名称"
|
|
210
|
-
@removeItem="removeSubTable"
|
|
211
|
-
@tempTableEdit="editSubTable"
|
|
212
|
-
@tempTableModify="modifySubTable"
|
|
213
|
-
>
|
|
214
|
-
</x-form-table>
|
|
215
|
-
</a-card>
|
|
216
|
-
</a-tab-pane>
|
|
217
|
-
<a-tab-pane v-if="canSubmit && !beforeStepActive && showPrevBtn && !applyState" key="3" tab="工单拆分">
|
|
197
|
+
<a-tab-pane v-if="canSubmit && !beforeStepActive && showPrevBtn && !workflowState" key="3" tab="工单拆分">
|
|
218
198
|
<!-- 分配工单 -->
|
|
219
|
-
<workflow-list-resolution :
|
|
199
|
+
<workflow-list-resolution :workflow-project-id="workflowId" :details="details"></workflow-list-resolution>
|
|
220
200
|
</a-tab-pane>
|
|
221
201
|
</a-tabs>
|
|
222
202
|
<!-- 文件预览 -->
|
|
@@ -230,23 +210,24 @@
|
|
|
230
210
|
import XAddNativeForm from '@vue2-client/base-client/components/common/XAddNativeForm'
|
|
231
211
|
import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
|
|
232
212
|
import XAddForm from '@vue2-client/base-client/components/common/XAddForm/XAddForm'
|
|
233
|
-
import { post } from 'vue2-client/
|
|
234
|
-
import {
|
|
213
|
+
import { post, postByServiceName } from '@vue2-client/services/api/restTools'
|
|
214
|
+
import { workFlowViewApi } from '@/services/api/workFlow'
|
|
235
215
|
import { formatDate } from '@vue2-client/utils/util'
|
|
236
|
-
// import { commonApi } from 'vue2-client/
|
|
216
|
+
// import { commonApi } from '@vue2-client/services/api/common'
|
|
237
217
|
import { mapState } from 'vuex'
|
|
238
218
|
import moment from 'moment'
|
|
239
219
|
import FilePreview from '@vue2-client/components/FilePreview'
|
|
240
|
-
import
|
|
241
|
-
import { FileItem, ImageItem } from 'vue2-client/
|
|
220
|
+
import WorkFlowTimeline from './WorkFlowTimeline.vue'
|
|
221
|
+
import { FileItem, ImageItem } from '@vue2-client/components/FileImageItem'
|
|
242
222
|
import WorkflowListResolution from './WorkflowListResolution'
|
|
223
|
+
import { commonApi } from '@/services/api'
|
|
243
224
|
|
|
244
225
|
export default {
|
|
245
226
|
name: 'ApplyHandle',
|
|
246
227
|
components: {
|
|
247
228
|
WorkflowListResolution,
|
|
248
229
|
XAddNativeForm,
|
|
249
|
-
|
|
230
|
+
WorkFlowTimeline,
|
|
250
231
|
XFormTable,
|
|
251
232
|
XAddForm,
|
|
252
233
|
FilePreview,
|
|
@@ -256,9 +237,6 @@ export default {
|
|
|
256
237
|
computed: {
|
|
257
238
|
...mapState('account', { currUser: 'user' }),
|
|
258
239
|
canSubmit () {
|
|
259
|
-
if (isDevelopment) {
|
|
260
|
-
return true
|
|
261
|
-
}
|
|
262
240
|
const step = this.stepsForChild[this.currentStepId - 1]
|
|
263
241
|
if (step && step.handler) {
|
|
264
242
|
return step.handler.includes(this.currUser.name)
|
|
@@ -268,8 +246,6 @@ export default {
|
|
|
268
246
|
},
|
|
269
247
|
data () {
|
|
270
248
|
return {
|
|
271
|
-
// 子表查询配置
|
|
272
|
-
queryParamsJson: {},
|
|
273
249
|
// 显示供用户填写的当前步骤表单
|
|
274
250
|
showForm: false,
|
|
275
251
|
// 当前步骤表单标题
|
|
@@ -330,18 +306,7 @@ export default {
|
|
|
330
306
|
stepsExtraInfo: [],
|
|
331
307
|
// 控制基础信息页流程展示加载
|
|
332
308
|
loading: true,
|
|
333
|
-
// 当前步骤子表定义
|
|
334
|
-
currentStepSubTableDefine: null,
|
|
335
309
|
createQueryVisible: false,
|
|
336
|
-
// 子表定义
|
|
337
|
-
subTableDefine: {},
|
|
338
|
-
subTableName: '',
|
|
339
|
-
xAddFormVisible: false,
|
|
340
|
-
xAddFormData: {},
|
|
341
|
-
xAddFormDefine: [],
|
|
342
|
-
subTableData: {},
|
|
343
|
-
// 修改子表数据,对应的id
|
|
344
|
-
editSubTableId: undefined,
|
|
345
310
|
// 激活的步骤名
|
|
346
311
|
activeStepName: '',
|
|
347
312
|
stepsParse: undefined,
|
|
@@ -355,8 +320,6 @@ export default {
|
|
|
355
320
|
deadlineHelp: '',
|
|
356
321
|
// 当前任务是否延期
|
|
357
322
|
taskIsOverdue: moment().isAfter(this.completeTime, 'day'),
|
|
358
|
-
// 人员信息
|
|
359
|
-
empTree: [],
|
|
360
323
|
// 预览图片弹框
|
|
361
324
|
previewFileVisible: false,
|
|
362
325
|
filePath: '',
|
|
@@ -369,16 +332,9 @@ export default {
|
|
|
369
332
|
async mounted () {
|
|
370
333
|
this.init()
|
|
371
334
|
this.checkDeadline()
|
|
372
|
-
post(applyDetailViewApi.getEmpTree, {}).then(res => {
|
|
373
|
-
this.empTree = res
|
|
374
|
-
})
|
|
375
|
-
console.log('formCompletedData', this.formCompletedData)
|
|
376
|
-
console.log('stepDefine', this.stepDefine)
|
|
377
|
-
console.log(this.workflowId)
|
|
378
|
-
console.log(this.applyId)
|
|
379
335
|
},
|
|
380
336
|
props: {
|
|
381
|
-
|
|
337
|
+
workflowId: {
|
|
382
338
|
type: String,
|
|
383
339
|
required: true
|
|
384
340
|
},
|
|
@@ -390,14 +346,10 @@ export default {
|
|
|
390
346
|
type: Array,
|
|
391
347
|
required: true
|
|
392
348
|
},
|
|
393
|
-
|
|
349
|
+
workflowState: {
|
|
394
350
|
type: [Boolean, Number],
|
|
395
351
|
required: true
|
|
396
352
|
},
|
|
397
|
-
workflowId: {
|
|
398
|
-
type: Number,
|
|
399
|
-
required: true
|
|
400
|
-
},
|
|
401
353
|
completeTime: {
|
|
402
354
|
type: String,
|
|
403
355
|
required: true
|
|
@@ -416,12 +368,6 @@ export default {
|
|
|
416
368
|
this.getCurrentStep()
|
|
417
369
|
},
|
|
418
370
|
onClose () {
|
|
419
|
-
if (this.subTableName.length > 0) {
|
|
420
|
-
post(applyDetailViewApi.deleteApplySubTempTable, { tableName: this.subTableName })
|
|
421
|
-
.then(res => {
|
|
422
|
-
console.log('临时表已手动删除')
|
|
423
|
-
})
|
|
424
|
-
}
|
|
425
371
|
this.activeStepId = this.currentStepId
|
|
426
372
|
this.checkedChargePerson = undefined
|
|
427
373
|
this.loadingHistory = true
|
|
@@ -431,177 +377,15 @@ export default {
|
|
|
431
377
|
this.preBtnText = []
|
|
432
378
|
this.stepNextBtnText = []
|
|
433
379
|
this.stepsExtraInfo = []
|
|
434
|
-
this.editSubTableId = undefined
|
|
435
|
-
this.currentStepSubTableDefine = null
|
|
436
380
|
this.loading = true
|
|
437
381
|
this.showNextBtn = false
|
|
438
382
|
this.showStepNextBtn = false
|
|
439
383
|
this.showPrevBtn = false
|
|
440
384
|
this.stepDone = false
|
|
441
|
-
this.subTableName = ''
|
|
442
385
|
this.formCompletedData = {}
|
|
443
386
|
this.formCompletedDataPreview = null
|
|
444
387
|
this.operationType = 'submit'
|
|
445
388
|
},
|
|
446
|
-
// 子表增加回调
|
|
447
|
-
modifySubTable (res) {
|
|
448
|
-
if (!res.valid) {
|
|
449
|
-
return
|
|
450
|
-
}
|
|
451
|
-
const currentStepName = this.getStepNameByStepId(this.currentStepId)
|
|
452
|
-
const applyId = this.applyId
|
|
453
|
-
const form = res.form
|
|
454
|
-
const formData = []
|
|
455
|
-
for (const key in form) {
|
|
456
|
-
const arr = key.split('_')
|
|
457
|
-
let newKey = ''
|
|
458
|
-
for (let i = 1; i < arr.length; i++) {
|
|
459
|
-
newKey += arr[i]
|
|
460
|
-
if (i !== arr.length - 1) {
|
|
461
|
-
newKey += '_'
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
form[newKey] = form[key]
|
|
465
|
-
delete form[key]
|
|
466
|
-
const item = {}
|
|
467
|
-
item.label = newKey
|
|
468
|
-
item.value = form[newKey]
|
|
469
|
-
formData.push(item)
|
|
470
|
-
}
|
|
471
|
-
post(applyDetailViewApi.applySubTableInsert, {
|
|
472
|
-
stepName: currentStepName,
|
|
473
|
-
applyId: applyId,
|
|
474
|
-
information: formData
|
|
475
|
-
})
|
|
476
|
-
.then(
|
|
477
|
-
res => {
|
|
478
|
-
this.$message.success('添加成功!')
|
|
479
|
-
this.$refs.xFormTable.modelVisible = false
|
|
480
|
-
this.$refs.xFormTable.$refs.xTable.refresh(true)
|
|
481
|
-
}
|
|
482
|
-
)
|
|
483
|
-
},
|
|
484
|
-
// 删除子表数据
|
|
485
|
-
removeSubTable (list) {
|
|
486
|
-
const tempTableData = {}
|
|
487
|
-
tempTableData.applyId = this.applyId
|
|
488
|
-
tempTableData.stepName = this.activeStepName
|
|
489
|
-
post(applyDetailViewApi.getApplySubTableData, {
|
|
490
|
-
tempTableData: tempTableData
|
|
491
|
-
})
|
|
492
|
-
.then(
|
|
493
|
-
res => {
|
|
494
|
-
const data = res
|
|
495
|
-
const targetIds = []
|
|
496
|
-
for (const key in data) {
|
|
497
|
-
const item = JSON.parse(data[key].itemsjson)
|
|
498
|
-
if (item[0].label === 'id') {
|
|
499
|
-
for (let i = 0; i < list.length; i++) {
|
|
500
|
-
if (list[i] === item[0].value) {
|
|
501
|
-
targetIds.push(data[key].id)
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
post(applyDetailViewApi.deleteSubTableData, {
|
|
507
|
-
ids: targetIds
|
|
508
|
-
})
|
|
509
|
-
.then(
|
|
510
|
-
res => {
|
|
511
|
-
this.$message.success('删除成功!')
|
|
512
|
-
this.$refs.xFormTable.$refs.xTable.refresh(true)
|
|
513
|
-
}
|
|
514
|
-
)
|
|
515
|
-
}
|
|
516
|
-
)
|
|
517
|
-
},
|
|
518
|
-
getSubTableDefineLocal (stepName) {
|
|
519
|
-
for (const step of this.stepsDefine) {
|
|
520
|
-
if (stepName === step.name) {
|
|
521
|
-
return step.properties.subTableDefine
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
},
|
|
525
|
-
// 已完成信息动态规定宽度
|
|
526
|
-
getFinishedInfoWidth (value) {
|
|
527
|
-
if (value.length > 20) {
|
|
528
|
-
return 3
|
|
529
|
-
} else if (value.length > 6) {
|
|
530
|
-
return 2
|
|
531
|
-
} else {
|
|
532
|
-
return 1
|
|
533
|
-
}
|
|
534
|
-
},
|
|
535
|
-
// 子表修改
|
|
536
|
-
editSubTable (params) {
|
|
537
|
-
const subTableDefine = this.getSubTableDefineLocal(this.currentStep.state).column
|
|
538
|
-
for (let i = 0; i < subTableDefine.length; i++) {
|
|
539
|
-
subTableDefine[i].name = subTableDefine[i].title
|
|
540
|
-
delete subTableDefine[i].title
|
|
541
|
-
subTableDefine[i].isOnlyAddOrEdit = true
|
|
542
|
-
subTableDefine[i].model = subTableDefine[i].key.split('.')[1]
|
|
543
|
-
delete subTableDefine[i].key
|
|
544
|
-
subTableDefine[i].addOrEdit = 'all'
|
|
545
|
-
subTableDefine[i].type = 'input'
|
|
546
|
-
}
|
|
547
|
-
this.xAddFormDefine = subTableDefine
|
|
548
|
-
// 将修改的数据回显至XAddForm
|
|
549
|
-
const tempTableData = {}
|
|
550
|
-
tempTableData.applyId = this.applyId
|
|
551
|
-
tempTableData.stepName = this.activeStepName
|
|
552
|
-
post(applyDetailViewApi.getApplySubTableData, {
|
|
553
|
-
tempTableData: tempTableData
|
|
554
|
-
})
|
|
555
|
-
.then(
|
|
556
|
-
res => {
|
|
557
|
-
const subTableData = res
|
|
558
|
-
const condition = params.conditionParams
|
|
559
|
-
const targetKey = Object.keys(condition)[0].split('_')[1]
|
|
560
|
-
const targeValue = Object.values(condition)[0]
|
|
561
|
-
const editData = {}
|
|
562
|
-
for (const key in subTableData) {
|
|
563
|
-
const item = JSON.parse(subTableData[key].itemsjson)
|
|
564
|
-
const editId = subTableData[key].id
|
|
565
|
-
for (let i = 0; i < item.length; i++) {
|
|
566
|
-
if (item[i].label === targetKey && item[i].value === targeValue) {
|
|
567
|
-
this.editSubTableId = editId
|
|
568
|
-
for (let j = 0; j < item.length; j++) {
|
|
569
|
-
editData[item[j].label] = item[j].value
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
this.xAddFormData = editData
|
|
575
|
-
this.xAddFormVisible = true
|
|
576
|
-
}
|
|
577
|
-
)
|
|
578
|
-
},
|
|
579
|
-
// 修改模态框,提交
|
|
580
|
-
xAddFormSubmit (source) {
|
|
581
|
-
if (source.valid) {
|
|
582
|
-
const form = source.form
|
|
583
|
-
const formatForm = []
|
|
584
|
-
const keys = Object.keys(form)
|
|
585
|
-
const values = Object.values(form)
|
|
586
|
-
for (let i = 0; i < keys.length; i++) {
|
|
587
|
-
const temp = {}
|
|
588
|
-
temp.label = keys[i]
|
|
589
|
-
temp.value = values[i]
|
|
590
|
-
formatForm.push(temp)
|
|
591
|
-
}
|
|
592
|
-
return post(applyDetailViewApi.updateSubTableData, {
|
|
593
|
-
id: this.editSubTableId,
|
|
594
|
-
form: formatForm
|
|
595
|
-
})
|
|
596
|
-
.then(
|
|
597
|
-
res => {
|
|
598
|
-
this.xAddFormVisible = false
|
|
599
|
-
this.$message.success('数据已成功修改')
|
|
600
|
-
this.$refs.xFormTable.$refs.xTable.refresh(true)
|
|
601
|
-
}
|
|
602
|
-
)
|
|
603
|
-
}
|
|
604
|
-
},
|
|
605
389
|
// 获取单个步骤的定义
|
|
606
390
|
getSingleStepDefine (name) {
|
|
607
391
|
for (const step of this.stepsDefine) {
|
|
@@ -616,8 +400,8 @@ export default {
|
|
|
616
400
|
},
|
|
617
401
|
// 获取当前步骤
|
|
618
402
|
getCurrentStep () {
|
|
619
|
-
return
|
|
620
|
-
|
|
403
|
+
return postByServiceName(workFlowViewApi.getWorkFlowCurrentSubState, {
|
|
404
|
+
workflowId: this.workflowId
|
|
621
405
|
})
|
|
622
406
|
.then(res => {
|
|
623
407
|
res.state = this.stepsForChild[res.id - 1].name
|
|
@@ -638,8 +422,8 @@ export default {
|
|
|
638
422
|
if (!this.formValid) {
|
|
639
423
|
console.log('nothing')
|
|
640
424
|
} else {
|
|
641
|
-
return
|
|
642
|
-
|
|
425
|
+
return postByServiceName(workFlowViewApi.afterWorkFlowFinalStepSubmit, {
|
|
426
|
+
workflowId: this.workflowId
|
|
643
427
|
})
|
|
644
428
|
.then(
|
|
645
429
|
res => {
|
|
@@ -652,9 +436,8 @@ export default {
|
|
|
652
436
|
this.$emit('refresh')
|
|
653
437
|
this.$emit('success')
|
|
654
438
|
},
|
|
655
|
-
|
|
439
|
+
() => {
|
|
656
440
|
this.$message.error('提交失败!')
|
|
657
|
-
console.log(err)
|
|
658
441
|
}
|
|
659
442
|
)
|
|
660
443
|
}
|
|
@@ -679,11 +462,7 @@ export default {
|
|
|
679
462
|
if (!this.formValid) {
|
|
680
463
|
console.log('nothing')
|
|
681
464
|
} else {
|
|
682
|
-
|
|
683
|
-
return post(applyDetailViewApi.updateApplySubState, {
|
|
684
|
-
stepId: this.nextBtnTo,
|
|
685
|
-
applyId: this.applyId
|
|
686
|
-
})
|
|
465
|
+
return postByServiceName(workFlowViewApi.submitToNextStep, extraData)
|
|
687
466
|
.then(
|
|
688
467
|
res => {
|
|
689
468
|
const extra = {
|
|
@@ -691,42 +470,13 @@ export default {
|
|
|
691
470
|
setDeadline: this.deadline,
|
|
692
471
|
notes: this.note.trim()
|
|
693
472
|
}
|
|
694
|
-
console.log('备注')
|
|
695
|
-
console.log(this.note.trim())
|
|
696
|
-
console.log(this.nextBtnTo)
|
|
697
473
|
this.saveWorkflowLog('提交', this.generateStepChangeText(this.currentStepId, this.nextBtnTo), extra)
|
|
698
474
|
this.$message.success('提交成功')
|
|
699
|
-
// 微信推送
|
|
700
|
-
/* post(applyDetailViewApi.saveWatchData, {
|
|
701
|
-
first: this.taskName,
|
|
702
|
-
workflowId: this.workflowId,
|
|
703
|
-
f_entry_name: this.details.f_entry_name,
|
|
704
|
-
f_workflow_define_name: this.details.f_workflow_define_name,
|
|
705
|
-
f_sub_state: this.details.f_sub_state,
|
|
706
|
-
f_complete_time: this.details.f_complete_time,
|
|
707
|
-
currUser: this.currUser.name,
|
|
708
|
-
taskName: this.taskName,
|
|
709
|
-
keyword1: this.workflowId + '(' + this.details.f_entry_name + ')',
|
|
710
|
-
keyword2: this.details.f_workflow_define_name + '-' + this.details.f_sub_state,
|
|
711
|
-
keyword3: '截至时间:' + this.details.f_complete_time + ',请尽快处理。',
|
|
712
|
-
keyword4: this.currUser.name + '推送,' + this.taskName,
|
|
713
|
-
remark: this.note.trim(),
|
|
714
|
-
name: this.checkedChargePerson.split('_')[0],
|
|
715
|
-
operator: this.currUser.name
|
|
716
|
-
}).then(res => {
|
|
717
|
-
this.information = res
|
|
718
|
-
if (this.information.code === 200) {
|
|
719
|
-
this.$message.success(this.information.msg)
|
|
720
|
-
} else {
|
|
721
|
-
this.$message.info(this.information.msg)
|
|
722
|
-
}
|
|
723
|
-
}) */
|
|
724
475
|
this.loading = true
|
|
725
476
|
this.loadingHistory = true
|
|
726
477
|
this.$emit('refresh')
|
|
727
478
|
this.onClose()
|
|
728
479
|
this.init()
|
|
729
|
-
console.log('提交人' + this.checkedChargePerson)
|
|
730
480
|
},
|
|
731
481
|
err => {
|
|
732
482
|
this.$message.error('提交失败!')
|
|
@@ -741,13 +491,12 @@ export default {
|
|
|
741
491
|
this.$message.error('退回请在备注中填写理由')
|
|
742
492
|
return
|
|
743
493
|
}
|
|
744
|
-
return
|
|
494
|
+
return postByServiceName(workFlowViewApi.updateWorkFlowState, {
|
|
745
495
|
stepId: this.preBtnTo,
|
|
746
|
-
|
|
496
|
+
workflowId: this.workflowId
|
|
747
497
|
})
|
|
748
498
|
.then(
|
|
749
499
|
res => {
|
|
750
|
-
// this.sendBackPush()
|
|
751
500
|
this.saveWorkflowLog('退回', this.generateStepChangeText(this.currentStepId, this.preBtnTo), { notes })
|
|
752
501
|
this.$message.success('退回成功')
|
|
753
502
|
this.loading = true
|
|
@@ -762,36 +511,6 @@ export default {
|
|
|
762
511
|
}
|
|
763
512
|
)
|
|
764
513
|
},
|
|
765
|
-
// 退回推送
|
|
766
|
-
sendBackPush () {
|
|
767
|
-
const dataPush = this.stepsForChild
|
|
768
|
-
let backName = null
|
|
769
|
-
let backNameId = null
|
|
770
|
-
this.currentDirections.forEach(res => {
|
|
771
|
-
if (res.type === 'back') {
|
|
772
|
-
backNameId = (parseInt(res.to) - 1)
|
|
773
|
-
}
|
|
774
|
-
})
|
|
775
|
-
backName = dataPush[backNameId].handler
|
|
776
|
-
// 微信推送
|
|
777
|
-
post(applyDetailViewApi.saveWatchData, {
|
|
778
|
-
first: '工单退回',
|
|
779
|
-
keyword1: this.applyId + '(' + this.details.f_entry_name + ')',
|
|
780
|
-
keyword2: this.details.f_workflow_define_name + '-' + this.details.f_sub_state,
|
|
781
|
-
keyword3: '',
|
|
782
|
-
keyword4: this.currUser.name + '工单退回给' + backName,
|
|
783
|
-
remark: this.note.trim(),
|
|
784
|
-
name: backName,
|
|
785
|
-
operator: this.currUser.name
|
|
786
|
-
}).then(res => {
|
|
787
|
-
this.information = res
|
|
788
|
-
if (this.information.code === 200) {
|
|
789
|
-
this.$message.success(this.information.msg)
|
|
790
|
-
} else {
|
|
791
|
-
this.$message.info(this.information.msg)
|
|
792
|
-
}
|
|
793
|
-
})
|
|
794
|
-
},
|
|
795
514
|
async stepNextClick () {
|
|
796
515
|
const extraData = this.getApplyStepExtraData(this.stepNextBtnTo)
|
|
797
516
|
if (!extraData) {
|
|
@@ -801,11 +520,7 @@ export default {
|
|
|
801
520
|
if (!this.formValid) {
|
|
802
521
|
console.log('nothing')
|
|
803
522
|
} else {
|
|
804
|
-
|
|
805
|
-
return post(applyDetailViewApi.updateApplySubState, {
|
|
806
|
-
stepId: this.stepNextBtnTo,
|
|
807
|
-
applyId: this.applyId
|
|
808
|
-
})
|
|
523
|
+
return postByServiceName(workFlowViewApi.submitToNextStep, extraData)
|
|
809
524
|
.then(
|
|
810
525
|
res => {
|
|
811
526
|
const extra = {
|
|
@@ -831,14 +546,11 @@ export default {
|
|
|
831
546
|
// 获取当前步骤节点,连通的节点
|
|
832
547
|
getDirection () {
|
|
833
548
|
// 获取流程定义
|
|
834
|
-
return
|
|
835
|
-
id: this.
|
|
549
|
+
return postByServiceName(workFlowViewApi.getWorkFlowDefine, {
|
|
550
|
+
id: this.workflowId
|
|
836
551
|
})
|
|
837
552
|
.then(res => {
|
|
838
|
-
console.log('res====', res)
|
|
839
|
-
console.log('res====', res.value.steps)
|
|
840
553
|
res = JSON.parse(res.value)
|
|
841
|
-
console.log('res.steps====', res.steps)
|
|
842
554
|
this.directions = []
|
|
843
555
|
this.stepsDefine = res.steps
|
|
844
556
|
this.resolveDirections()
|
|
@@ -854,15 +566,15 @@ export default {
|
|
|
854
566
|
this.currentStepId = this.stepsDefine[i].id
|
|
855
567
|
}
|
|
856
568
|
}
|
|
857
|
-
this.getSubTableDefine(this.currentStepId)
|
|
858
569
|
let hasBack = false
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
570
|
+
if (this.stepsDefine[this.currentStepId - 1]?.properties?.actions) {
|
|
571
|
+
this.currentDirections = this.stepsDefine[this.currentStepId - 1].properties.actions.filter((item) => {
|
|
572
|
+
if (item.type === 'back') {
|
|
573
|
+
hasBack = true
|
|
574
|
+
}
|
|
575
|
+
return true
|
|
576
|
+
})
|
|
577
|
+
}
|
|
866
578
|
// 默认可退回到上一步
|
|
867
579
|
if (!hasBack && this.currentStepId !== 1) {
|
|
868
580
|
this.currentDirections.push({ head: this.currentStepId, tail: this.currentStepId - 1, type: 'back' })
|
|
@@ -884,8 +596,8 @@ export default {
|
|
|
884
596
|
this.formValid = true
|
|
885
597
|
const formData = obj.realForm
|
|
886
598
|
const time = this.format(new Date(), 'yyyy-MM-dd hh:mm:ss')
|
|
887
|
-
return
|
|
888
|
-
|
|
599
|
+
return postByServiceName(workFlowViewApi.saveWorkFlowStepFormData, {
|
|
600
|
+
workflowId: this.workflowId,
|
|
889
601
|
stepId: this.currentStepId,
|
|
890
602
|
form: formData,
|
|
891
603
|
data: time,
|
|
@@ -907,9 +619,7 @@ export default {
|
|
|
907
619
|
},
|
|
908
620
|
// 打开填写表单,获取当前步骤定义内容,生成表单
|
|
909
621
|
openForm () {
|
|
910
|
-
// window.setTimeout(() => {
|
|
911
622
|
this.stepDefine = this.stepsDefine[this.currentStep.id - 1].properties.form.formJson
|
|
912
|
-
console.log('this.stepDefine', this.stepDefine)
|
|
913
623
|
this.showForm = true
|
|
914
624
|
this.$nextTick(() => {
|
|
915
625
|
this.$refs.xAddForm.init({
|
|
@@ -918,36 +628,6 @@ export default {
|
|
|
918
628
|
showSubmitBtn: false
|
|
919
629
|
})
|
|
920
630
|
})
|
|
921
|
-
console.log('this===', this)
|
|
922
|
-
// }, 1)
|
|
923
|
-
// this.stepDefine = this.stepsDefine[this.currentStep.id - 1].properties.form.formJson
|
|
924
|
-
// this.showForm = true
|
|
925
|
-
// console.log('this.stepDefine', this.stepDefine)
|
|
926
|
-
// console.log('this', this)
|
|
927
|
-
// this.$nextTick(() => {
|
|
928
|
-
// console.log('$nextTick==this', this)
|
|
929
|
-
// console.log('$nextTick==this', this.$refs)
|
|
930
|
-
// console.log('$nextTick==this', this.$refs.xAddForm)
|
|
931
|
-
// this.$refs.xAddForm.init({
|
|
932
|
-
// businessType: '修改',
|
|
933
|
-
// formItems: this.stepDefine,
|
|
934
|
-
// showSubmitBtn: false
|
|
935
|
-
// })
|
|
936
|
-
// })
|
|
937
|
-
},
|
|
938
|
-
// 获取子表定义
|
|
939
|
-
getSubTableDefine (stepId) {
|
|
940
|
-
const stepName = this.getStepNameByStepId(stepId)
|
|
941
|
-
const define = this.getSubTableDefineLocal(stepName)
|
|
942
|
-
if (define !== undefined) {
|
|
943
|
-
if (define.tableName !== undefined) {
|
|
944
|
-
this.subTableName = define.tableName.split(' ')[0]
|
|
945
|
-
this.currentStepSubTableDefine = define
|
|
946
|
-
// 为配置参数添加当前报建ID和步骤名称
|
|
947
|
-
this.currentStepSubTableDefine.applyId = this.applyId
|
|
948
|
-
this.currentStepSubTableDefine.stepName = this.activeStepName
|
|
949
|
-
}
|
|
950
|
-
}
|
|
951
631
|
},
|
|
952
632
|
// 根据当前节点,判断之后流程,以及按钮的显示
|
|
953
633
|
workflowControl () {
|
|
@@ -993,14 +673,10 @@ export default {
|
|
|
993
673
|
this.activeStepName = this.getStepNameByStepId(stepId)
|
|
994
674
|
// 清空回显数据
|
|
995
675
|
this.formCompletedData = {}
|
|
996
|
-
console.log('this==========', this)
|
|
997
676
|
let formCompletedDataPreview = null
|
|
998
677
|
this.getStepDefine(stepId)
|
|
999
|
-
// 获取当前激活节点子表
|
|
1000
|
-
this.currentStepSubTableDefine = undefined
|
|
1001
|
-
await this.getSubTableDefine(stepId)
|
|
1002
678
|
// 判断激活的节点,是不是待完成节点
|
|
1003
|
-
if (this.activeStepName !== this.currentStep.state || this.
|
|
679
|
+
if (this.activeStepName !== this.currentStep.state || this.workflowState) {
|
|
1004
680
|
// 获取激活节点历史数据,和字段定义
|
|
1005
681
|
await this.getCompletedFormData(stepId)
|
|
1006
682
|
// 将回显数据拷贝,避免引用传递
|
|
@@ -1051,8 +727,8 @@ export default {
|
|
|
1051
727
|
},
|
|
1052
728
|
// 获取已经完成步骤的数据
|
|
1053
729
|
getCompletedFormData (stepId) {
|
|
1054
|
-
return
|
|
1055
|
-
|
|
730
|
+
return postByServiceName(workFlowViewApi.getWorkFlowCompletedStepData, {
|
|
731
|
+
workflowId: this.workflowId,
|
|
1056
732
|
stepId: stepId
|
|
1057
733
|
})
|
|
1058
734
|
.then(
|
|
@@ -1080,7 +756,7 @@ export default {
|
|
|
1080
756
|
return false
|
|
1081
757
|
}
|
|
1082
758
|
return {
|
|
1083
|
-
|
|
759
|
+
workflowId: this.workflowId,
|
|
1084
760
|
stepId,
|
|
1085
761
|
name: this.getStepNameByStepId(stepId),
|
|
1086
762
|
handler: stepHandler,
|
|
@@ -1101,8 +777,8 @@ export default {
|
|
|
1101
777
|
},
|
|
1102
778
|
// 保存工作流日志
|
|
1103
779
|
saveWorkflowLog (operation, desc, extra) {
|
|
1104
|
-
|
|
1105
|
-
|
|
780
|
+
postByServiceName(workFlowViewApi.saveWorkFlowLog, {
|
|
781
|
+
workflowId: this.workflowId,
|
|
1106
782
|
operation,
|
|
1107
783
|
desc,
|
|
1108
784
|
operator: this.currUser.name,
|
|
@@ -1154,44 +830,22 @@ export default {
|
|
|
1154
830
|
}
|
|
1155
831
|
},
|
|
1156
832
|
// 从指定步骤设置负责人下拉选择框
|
|
1157
|
-
setChargePersonOptions (stepId) {
|
|
1158
|
-
const defineProperties = this.stepsDefine[stepId - 1].properties
|
|
1159
|
-
const chargeDepartment = defineProperties.chargeDepartment
|
|
833
|
+
async setChargePersonOptions (stepId) {
|
|
1160
834
|
this.checkedChargePerson = undefined
|
|
1161
|
-
const
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
}
|
|
1170
|
-
})
|
|
1171
|
-
}
|
|
1172
|
-
// 添加人员
|
|
1173
|
-
const chargePerson = defineProperties.inCharge
|
|
1174
|
-
if (chargePerson && chargePerson.length) {
|
|
1175
|
-
const keyOptions = chargePersonOptions.map(person => person.key)
|
|
1176
|
-
chargePerson.forEach(person => {
|
|
1177
|
-
if (person.includes('_')) {
|
|
1178
|
-
const name = person.split('_')[0]
|
|
1179
|
-
// 人员去重
|
|
1180
|
-
if (!keyOptions.includes(person)) {
|
|
1181
|
-
chargePersonOptions.push({ label: name, key: person })
|
|
1182
|
-
}
|
|
1183
|
-
}
|
|
835
|
+
const defineProperties = this.stepsDefine[stepId - 1].properties
|
|
836
|
+
const chargePerson = defineProperties.chargePerson
|
|
837
|
+
let chargePersonOptions = []
|
|
838
|
+
// 获取所有用户信息
|
|
839
|
+
const allUser = await post(commonApi.getAllUserOptionList, {})
|
|
840
|
+
if (chargePerson.role) {
|
|
841
|
+
// 根据角色获取人员
|
|
842
|
+
chargePersonOptions = allUser.filter(item => item.rolestr && item.rolestr.includes(chargePerson.role)).map(item => {
|
|
843
|
+
return { label: item.label, value: item.label }
|
|
1184
844
|
})
|
|
1185
|
-
}
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
if (department.children) {
|
|
1190
|
-
const children = department.children.map(person => {
|
|
1191
|
-
return { label: person.title, key: person.key }
|
|
1192
|
-
})
|
|
1193
|
-
chargePersonOptions.push(...children)
|
|
1194
|
-
}
|
|
845
|
+
} else if (chargePerson.department) {
|
|
846
|
+
// 根据部门获取人员
|
|
847
|
+
chargePersonOptions = allUser.filter(item => item.depname === chargePerson.department).map(item => {
|
|
848
|
+
return { label: item.label, value: item.label }
|
|
1195
849
|
})
|
|
1196
850
|
}
|
|
1197
851
|
this.chargePersonOptions = chargePersonOptions
|
|
@@ -1201,16 +855,8 @@ export default {
|
|
|
1201
855
|
}
|
|
1202
856
|
}
|
|
1203
857
|
},
|
|
1204
|
-
watch: {
|
|
1205
|
-
visible (newVal) {
|
|
1206
|
-
if (newVal) {
|
|
1207
|
-
this.init()
|
|
1208
|
-
}
|
|
1209
|
-
}
|
|
1210
|
-
}
|
|
858
|
+
watch: {}
|
|
1211
859
|
}
|
|
1212
|
-
// 是否开发环境
|
|
1213
|
-
const isDevelopment = process.env.NODE_ENV === 'development'
|
|
1214
860
|
</script>
|
|
1215
861
|
<style lang="less" scoped>
|
|
1216
862
|
.line {
|