sasp-flow-render 1.1.33 → 1.1.35-decoupling
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/index.js +16 -0
- package/package.json +1 -1
- package/src/assets/js/api/apiFlow.js +2 -0
- package/src/components/flowInst/flowInstTab.vue +258 -2468
- package/src/components/flowInst/js/workflow.js +2397 -0
- package/src/components/flowInst/popup/flowDialog.vue +1089 -0
- package/src/components/flowInst/popup/renderForm.vue +19 -0
- package/src/views/popup/event/compoment/system/flowEditContentConfig.vue +2 -1
|
@@ -0,0 +1,1089 @@
|
|
|
1
|
+
<!-- components/WorkflowDialog.vue -->
|
|
2
|
+
<template>
|
|
3
|
+
<div>
|
|
4
|
+
<!--处理、修改、查看流程信息弹窗-->
|
|
5
|
+
<el-dialog :close-on-click-modal=false top="5vh" width="90%" height="90%" :visible.sync="flowInstDataDialog" append-to-body
|
|
6
|
+
custom-class="flowInstTabDialog">
|
|
7
|
+
<span slot="title" class="dialog-title">
|
|
8
|
+
<span>{{flowFormTitle}}</span>
|
|
9
|
+
</span>
|
|
10
|
+
<template v-if="flowInstDataDialog">
|
|
11
|
+
<!-- <slot name="formInfo"></slot>-->
|
|
12
|
+
<render-form :flowComponent="workFlowUtil.$this"
|
|
13
|
+
v-if="workFlowUtil.$this.$slots.formInfo && flowInstDataDialog">
|
|
14
|
+
|
|
15
|
+
</render-form>
|
|
16
|
+
<template v-else>
|
|
17
|
+
<table-form-render ref="tableRef"
|
|
18
|
+
v-if="flowInstDataDialog"
|
|
19
|
+
is-sign-form
|
|
20
|
+
is-edit-data
|
|
21
|
+
useLoadSelf
|
|
22
|
+
:tableview-id="tableviewId"
|
|
23
|
+
:data-id="formInfo.dataId"
|
|
24
|
+
isFlow
|
|
25
|
+
:flowFieldStatus="flowFieldStatus"
|
|
26
|
+
:flowFieldDefault="fieldDefaultVal"
|
|
27
|
+
:flowFieldDefaultChangeNum="fieldDefaultValChangeNum"
|
|
28
|
+
:flowFieldDefaultFromForm="flowFieldDefaultFromForm"
|
|
29
|
+
:form-operate="formOperate"
|
|
30
|
+
:form-id="formId">
|
|
31
|
+
</table-form-render>
|
|
32
|
+
</template>
|
|
33
|
+
</template>
|
|
34
|
+
<div slot="footer" style="height:31px;" class="dialog-footer">
|
|
35
|
+
<div v-if="!formSearchObj.isNewSelectBatchDeal">
|
|
36
|
+
<el-button
|
|
37
|
+
v-for="button in Object.values(diyButtonsObj)"
|
|
38
|
+
:key="button.id" size="small" :type="button.buttonColor" :icon="button.buttonIcon"
|
|
39
|
+
v-if="judeDiyButton(tabActive,button)"
|
|
40
|
+
@click="openDiyButtonEvent('table','', button)">{{button.showButtonName}}
|
|
41
|
+
</el-button>
|
|
42
|
+
<el-button v-for="btn in formBtnArr" @click="btn.method" :disabled="isDisabled[btn.btnType]?false:true"
|
|
43
|
+
v-show="btn.show && ((formInfo.opt != 'view') || (formInfo.opt=='view' && btn.isView))"
|
|
44
|
+
:key="btn.btnType"
|
|
45
|
+
:type="btn.type"
|
|
46
|
+
:icon="btn.icon"
|
|
47
|
+
size="small">
|
|
48
|
+
{{btn.text}}
|
|
49
|
+
</el-button>
|
|
50
|
+
</div>
|
|
51
|
+
<div v-else>
|
|
52
|
+
<el-button v-for="btn in formNewBtnArr" @click="btn.method"
|
|
53
|
+
:key="btn.btnType"
|
|
54
|
+
:type="btn.type"
|
|
55
|
+
:icon="btn.icon"
|
|
56
|
+
size="small">{{btn.text}}
|
|
57
|
+
</el-button>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</el-dialog>
|
|
61
|
+
|
|
62
|
+
<!--流程下一步处理人选择弹窗-->
|
|
63
|
+
<el-dialog :close-on-click-modal=false style="font-family: '微软雅黑'" :title="'下一步' + (nextNodeName ? (isProceedNext?' -> ' + nextNodeName:'->等待他人处理') : '')"
|
|
64
|
+
:top="nextNode.nextType != 'inclusiveGateway' ? '20vh': '10vh'" append-to-body
|
|
65
|
+
width="500px" :visible.sync="nextSteptUserDialog" @closed="closeNextSteptUserDialog">
|
|
66
|
+
<el-form label-width="100px" size="small" v-if="nextNode.nodeType != 'EndEvent'">
|
|
67
|
+
<fieldset v-if="nextNode.nextType == 'inclusiveGateway'"
|
|
68
|
+
v-for="(itemAll,index) in (nextNode.result || [])" :key="index">
|
|
69
|
+
<legend>
|
|
70
|
+
{{itemAll.nodeName}}
|
|
71
|
+
</legend>
|
|
72
|
+
<el-form-item label="" label-width="0">
|
|
73
|
+
<el-select v-model="chooseNextUserIdObj[itemAll.nodeKey]" v-if="itemAll.type != 'all'"
|
|
74
|
+
:multiple="itemAll.mulitiChooseUser" style="width:100%">
|
|
75
|
+
<el-option v-for="item in itemAll.userArr" :key="item.id" :value="item.id"
|
|
76
|
+
:label="item.userName"></el-option>
|
|
77
|
+
</el-select>
|
|
78
|
+
<div @click="chooseUser(itemAll.nodeKey)">
|
|
79
|
+
<el-input v-model="chooseNextUserNameObj[itemAll.nodeKey]" v-if="itemAll.type == 'all'"
|
|
80
|
+
readonly>
|
|
81
|
+
<el-button slot="append" icon="el-icon-search"></el-button>
|
|
82
|
+
</el-input>
|
|
83
|
+
</div>
|
|
84
|
+
</el-form-item>
|
|
85
|
+
</fieldset>
|
|
86
|
+
<el-form-item label="下一步执行人" v-if="nextNode.nextType != 'inclusiveGateway' && isProceedNext">
|
|
87
|
+
<el-select v-model="chooseNextUserId" v-if="nextSteptUserType != 'all' && nextSteptUserDialog"
|
|
88
|
+
:multiple="mulitiChooseUser" filterable style="width:100%">
|
|
89
|
+
<el-option v-for="item in nextSteptUserArr" :key="item.id" :value="item.id"
|
|
90
|
+
:label="item.userName"></el-option>
|
|
91
|
+
</el-select>
|
|
92
|
+
<div @click="chooseUser()">
|
|
93
|
+
<el-input v-model="chooseNextUserName" v-if="nextSteptUserType == 'all'" readonly>
|
|
94
|
+
<el-button slot="append" icon="el-icon-search"></el-button>
|
|
95
|
+
</el-input>
|
|
96
|
+
</div>
|
|
97
|
+
</el-form-item>
|
|
98
|
+
<fieldset v-if="nextNode.nextType == 'inclusiveGateway'">
|
|
99
|
+
<legend>
|
|
100
|
+
{{'附加说明'}}
|
|
101
|
+
</legend>
|
|
102
|
+
<el-form-item label="" label-width="0">
|
|
103
|
+
<el-input type="textarea" :rows="5" v-model="description"></el-input>
|
|
104
|
+
</el-form-item>
|
|
105
|
+
</fieldset>
|
|
106
|
+
<el-form-item label="附加说明" v-if="nextNode.nextType != 'inclusiveGateway' && isProceedNext">
|
|
107
|
+
<el-input type="textarea" :rows="5" v-model="description"></el-input>
|
|
108
|
+
</el-form-item>
|
|
109
|
+
<el-form-item v-if="nextNode.nextType != 'inclusiveGateway' && !isProceedNext" label-width="0">
|
|
110
|
+
<div>请等待其他人员处理完成。</div>
|
|
111
|
+
</el-form-item>
|
|
112
|
+
</el-form>
|
|
113
|
+
<div v-if="nextNode.nodeType == 'EndEvent'">流程即将结束,是否继续?</div>
|
|
114
|
+
<div slot="footer" class="dialog-footer">
|
|
115
|
+
<el-button type="primary" size="small" @click="saveNextStept()" :disabled="isDisabled1?false:true">确定
|
|
116
|
+
</el-button>
|
|
117
|
+
<el-button size="small" @click="closeNextSteptUserDialog">取消</el-button>
|
|
118
|
+
</div>
|
|
119
|
+
</el-dialog>
|
|
120
|
+
|
|
121
|
+
<el-dialog :close-on-click-modal=false title="组织岗位用户" top="5vh" width="80%" height="80%"
|
|
122
|
+
:visible.sync="sysOrgPosUserDialog" append-to-body>
|
|
123
|
+
<!-- <sys-org-pos-user-select ref="orgPosUserRef" v-if="sysOrgPosUserDialog"-->
|
|
124
|
+
<!-- :filterUserParam="{'commonUserType':'common' }" :ognEnable="false"-->
|
|
125
|
+
<!-- :default-user-ids="inclusiveChooseKey ? choosePosUserIdsObj[inclusiveChooseKey]:choosePosUserIds"-->
|
|
126
|
+
<!-- defaultChooseIds="$"-->
|
|
127
|
+
<!-- :posEnable="false" :checkbox="mulitiChooseUser">-->
|
|
128
|
+
<!-- </sys-org-pos-user-select>-->
|
|
129
|
+
<user-select ref="orgPosUserRef"
|
|
130
|
+
:choose-user-ids="inclusiveChooseKey ? choosePosUserIdsObj[inclusiveChooseKey]:choosePosUserIds"
|
|
131
|
+
:checkbox="mulitiChooseUser" v-if="sysOrgPosUserDialog">
|
|
132
|
+
</user-select>
|
|
133
|
+
<div slot="footer" class="dialog-footer">
|
|
134
|
+
<el-button type="primary" size="small" @click="sureNextUser()">确定</el-button>
|
|
135
|
+
<el-button size="small" @click="sysOrgPosUserDialog = false">取消</el-button>
|
|
136
|
+
</div>
|
|
137
|
+
</el-dialog>
|
|
138
|
+
|
|
139
|
+
<el-dialog :close-on-click-modal=false title="选择加签人" top="5vh" width="80%" height="80%"
|
|
140
|
+
:visible.sync="completeSignDialog" append-to-body @closed="disableSign = false">
|
|
141
|
+
<!-- <sys-org-pos-user-select ref="completeSignRef"-->
|
|
142
|
+
<!-- :filterUserParam="{'commonUserType':'common','filterLoginUser':'Y'}"-->
|
|
143
|
+
<!-- :ognEnable="false"-->
|
|
144
|
+
<!-- :posEnable="false"-->
|
|
145
|
+
<!-- :checkbox="true"-->
|
|
146
|
+
<!-- v-if="completeSignDialog"-->
|
|
147
|
+
<!-- >-->
|
|
148
|
+
<!-- </sys-org-pos-user-select>-->
|
|
149
|
+
<user-select ref="completeSignRef"
|
|
150
|
+
v-if="completeSignDialog">
|
|
151
|
+
</user-select>
|
|
152
|
+
<div slot="footer" class="dialog-footer">
|
|
153
|
+
<el-button type="primary" size="small" @click="sureCompleteSign()" :disabled="disableSign">确定</el-button>
|
|
154
|
+
<el-button size="small" @click="completeSignDialog = false">取消</el-button>
|
|
155
|
+
</div>
|
|
156
|
+
</el-dialog>
|
|
157
|
+
|
|
158
|
+
<el-dialog :close-on-click-modal=false title="选择转签人" top="5vh" width="80%" height="80%"
|
|
159
|
+
:visible.sync="turnSignDialog" append-to-body @closed="disableSign = false">
|
|
160
|
+
<!-- <sys-org-pos-user-select ref="turnSignRef"-->
|
|
161
|
+
<!-- :filterUserParam="{'commonUserType':'common' }"-->
|
|
162
|
+
<!-- :ognEnable="false"-->
|
|
163
|
+
<!-- :posEnable="false"-->
|
|
164
|
+
<!-- :checkbox="false"-->
|
|
165
|
+
<!-- v-if="turnSignDialog"-->
|
|
166
|
+
<!-- >-->
|
|
167
|
+
<!-- </sys-org-pos-user-select>-->
|
|
168
|
+
<user-select ref="turnSignRef"
|
|
169
|
+
:checkbox="false"
|
|
170
|
+
v-if="turnSignDialog">
|
|
171
|
+
</user-select>
|
|
172
|
+
<div slot="footer" class="dialog-footer">
|
|
173
|
+
<el-button type="primary" size="small" @click="sureTurnSign()" :disabled="disableSign">确定</el-button>
|
|
174
|
+
<el-button size="small" @click="turnSignDialog = false">取消</el-button>
|
|
175
|
+
</div>
|
|
176
|
+
</el-dialog>
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
<el-dialog :close-on-click-modal="false" append-to-body title="查看流程图"
|
|
180
|
+
:visible.sync="flowChartObj.dialogVisible"
|
|
181
|
+
width="90%" height="90%"
|
|
182
|
+
top="5vh">
|
|
183
|
+
<flow-chart :flow-id="(flowChartObj.flowId || workFlowUtil.flowId) + ''" :inst-id="flowChartObj.instId + ''"
|
|
184
|
+
:link-proc-id="flowChartObj.linkProcId + ''"
|
|
185
|
+
:is-release="flowChartObj.isRelease"
|
|
186
|
+
v-if="flowChartObj.dialogVisible"></flow-chart>
|
|
187
|
+
<div slot="footer" class="dialog-footer">
|
|
188
|
+
<el-button @click="flowChartObj.dialogVisible = false" size="small" icon="el-icon-error">关闭</el-button>
|
|
189
|
+
</div>
|
|
190
|
+
</el-dialog>
|
|
191
|
+
|
|
192
|
+
<el-dialog :close-on-click-modal="false" append-to-body title="流转记录"
|
|
193
|
+
:visible.sync="flowRecordObj.dialogVisible"
|
|
194
|
+
width="90%" height="90%"
|
|
195
|
+
top="5vh">
|
|
196
|
+
<flow-roam-record :instId="flowRecordObj.instId + ''" v-if="flowRecordObj.dialogVisible"></flow-roam-record>
|
|
197
|
+
<div slot="footer" class="dialog-footer">
|
|
198
|
+
<el-button @click="flowRecordObj.dialogVisible = false" size="small" icon="el-icon-error">关闭</el-button>
|
|
199
|
+
</div>
|
|
200
|
+
</el-dialog>
|
|
201
|
+
|
|
202
|
+
<el-dialog :close-on-click-modal="false" append-to-body title="流转记录"
|
|
203
|
+
:visible.sync="flowRecordObj.oldDialogVisible"
|
|
204
|
+
width="90%" height="90%"
|
|
205
|
+
top="5vh">
|
|
206
|
+
<roam-record :flow-inst-id="flowRecordObj.instId + ''" v-if="flowRecordObj.oldDialogVisible"></roam-record>
|
|
207
|
+
<div slot="footer" class="dialog-footer">
|
|
208
|
+
<el-button @click="flowRecordObj.oldDialogVisible = false" size="small" icon="el-icon-error">关闭</el-button>
|
|
209
|
+
</div>
|
|
210
|
+
</el-dialog>
|
|
211
|
+
|
|
212
|
+
<el-dialog :close-on-click-modal="false" append-to-body title="选择退回节点"
|
|
213
|
+
:visible.sync="backDialogVisible"
|
|
214
|
+
width="450px" height="320px"
|
|
215
|
+
top="30vh">
|
|
216
|
+
<el-form label-width="80px">
|
|
217
|
+
<el-form-item label="退回节点">
|
|
218
|
+
<el-select v-model="backNodeId" clearable style="width: 100%">
|
|
219
|
+
<el-option v-for="item in backNodeArr" :key="item.nodeId" :label="item.nodeName" :value="item.nodeId">
|
|
220
|
+
</el-option>
|
|
221
|
+
</el-select>
|
|
222
|
+
</el-form-item>
|
|
223
|
+
<el-form-item label="退回备注">
|
|
224
|
+
<el-input v-model="backMsg" type="textarea" :autosize="{minRows:4,maxRows:4}"></el-input>
|
|
225
|
+
</el-form-item>
|
|
226
|
+
</el-form>
|
|
227
|
+
<div slot="footer" class="dialog-footer">
|
|
228
|
+
<el-button @click="beginBack" size="small" type="primary" icon="el-icon-success" :disabled="isDisabled2?false:true">确定</el-button>
|
|
229
|
+
<el-button @click="backDialogVisible = false" size="small" icon="el-icon-error">关闭</el-button>
|
|
230
|
+
</div>
|
|
231
|
+
</el-dialog>
|
|
232
|
+
|
|
233
|
+
<el-dialog :close-on-click-modal="false" append-to-body :title="diyDialogProps.title || '打开页面'"
|
|
234
|
+
:visible.sync="diyDialogProps.visible" :show-close="false"
|
|
235
|
+
:width="diyDialogProps.width || '80%'" :height="diyDialogProps.height || '80%'"
|
|
236
|
+
:top="diyDialogProps.top || '10vh'">
|
|
237
|
+
<table-form-render v-bind="diyDialogProps.props" ref="dialogFormRef" v-if="diyDialogProps.visible && diyDialogProps.type === 'form'"></table-form-render>
|
|
238
|
+
<list-view-preview v-bind="diyDialogProps.props" ref="dialogListRef" v-if="diyDialogProps.visible && diyDialogProps.type === 'list'"></list-view-preview>
|
|
239
|
+
<component v-bind="diyDialogProps.props" :is="diyDialogProps.component" ref="dialogComponentRef" v-if="diyDialogProps.visible && diyDialogProps.type === 'component'">
|
|
240
|
+
|
|
241
|
+
</component>
|
|
242
|
+
<div slot="footer" class="dialog-footer">
|
|
243
|
+
<template v-for="item in diyDialogProps.buttonList">
|
|
244
|
+
<el-button @click="dialogEvent(item)" size="small" :type="item.type" :icon="item.icon || 'el-icon-success'">{{item.name}}</el-button>
|
|
245
|
+
</template>
|
|
246
|
+
<el-button @click="diyDialogProps.visible = false" size="small" icon="el-icon-error" v-if="diyDialogProps.showClose">关闭</el-button>
|
|
247
|
+
</div>
|
|
248
|
+
</el-dialog>
|
|
249
|
+
</div>
|
|
250
|
+
</template>
|
|
251
|
+
|
|
252
|
+
<script>
|
|
253
|
+
import UserSelect from "../../userSelect.vue";
|
|
254
|
+
import RenderForm from "./renderForm.vue";
|
|
255
|
+
import FlowChart from "../../flowChart";
|
|
256
|
+
import FlowRoamRecord from "../../flowRoamRecords";
|
|
257
|
+
import RoamRecord from "../../roamRecord";
|
|
258
|
+
|
|
259
|
+
export default {
|
|
260
|
+
name: 'flowDialog',
|
|
261
|
+
components: {RenderForm, UserSelect,RoamRecord,
|
|
262
|
+
FlowRoamRecord,
|
|
263
|
+
FlowChart,},
|
|
264
|
+
data() {
|
|
265
|
+
let vm = this;
|
|
266
|
+
return {
|
|
267
|
+
flowData:{
|
|
268
|
+
flowId: '',
|
|
269
|
+
operateRootArr: [],
|
|
270
|
+
flowobj: {},
|
|
271
|
+
defaultTab: '',
|
|
272
|
+
dataPermisArr:[],
|
|
273
|
+
},
|
|
274
|
+
tabActive: "pending",
|
|
275
|
+
loginUser: {},//当前登录用户
|
|
276
|
+
userDept: {},//当前登录用户所在部门信息
|
|
277
|
+
flowDefine: {},
|
|
278
|
+
flowDefineByFlowId: {},
|
|
279
|
+
flowNodeIdToInfo: {},//key为id
|
|
280
|
+
flowNodeNameObj:{}, //节点名称对应节点id分组
|
|
281
|
+
draftNodeId:"", // 草稿节点id
|
|
282
|
+
allNodeInfo: {},//key为id
|
|
283
|
+
startNodeKey: "",//开始节点key
|
|
284
|
+
formFieldObj: {},//表单字段
|
|
285
|
+
|
|
286
|
+
isShow: false,
|
|
287
|
+
currentStartUser: "",
|
|
288
|
+
currentStartTime: "",
|
|
289
|
+
|
|
290
|
+
currentInst: {},//当前流程实例
|
|
291
|
+
|
|
292
|
+
// 列表按钮
|
|
293
|
+
listButtonObj: {
|
|
294
|
+
add: "新增",
|
|
295
|
+
delete: "删除",
|
|
296
|
+
update: "修改",
|
|
297
|
+
view: "查看",
|
|
298
|
+
deal: "处理",
|
|
299
|
+
flowRecord: "流转记录",
|
|
300
|
+
flowChart: "流程图",
|
|
301
|
+
},
|
|
302
|
+
|
|
303
|
+
// 批量处理
|
|
304
|
+
flowBatchPendingDialog: false,
|
|
305
|
+
// 选择性的批量多条一次性处理
|
|
306
|
+
flowBatchSelectPendingDialog: false,
|
|
307
|
+
batchUpdateFormInfo: {
|
|
308
|
+
formShow: false,
|
|
309
|
+
dataRows: [],
|
|
310
|
+
pendingNums: 0,
|
|
311
|
+
activeName: "",
|
|
312
|
+
batchDataId: ""
|
|
313
|
+
},
|
|
314
|
+
|
|
315
|
+
nodeFormBtnObj: {},
|
|
316
|
+
|
|
317
|
+
formBtnArr: [],
|
|
318
|
+
//表单按钮
|
|
319
|
+
formButtonObj: {
|
|
320
|
+
saveDraft: "存草稿",
|
|
321
|
+
completeSign: "加签",
|
|
322
|
+
turnSign: "转签",
|
|
323
|
+
nextStep: "下一步",
|
|
324
|
+
back: "退回",
|
|
325
|
+
getBack: "取回",
|
|
326
|
+
cancel: "撤销",
|
|
327
|
+
stopped: "中止",
|
|
328
|
+
close: "关闭",
|
|
329
|
+
export: "导出",
|
|
330
|
+
retSpecified: "退回指定节点"
|
|
331
|
+
},
|
|
332
|
+
|
|
333
|
+
nodeListButtonObj: {},
|
|
334
|
+
nodeFormButtonObj: {},
|
|
335
|
+
optColumnWidth: 336,
|
|
336
|
+
showModel: "list",//默认风格 list:列表card:卡片
|
|
337
|
+
showInfo: "flow",//展示信息 flow:流程信息 form:表单信息
|
|
338
|
+
operateType: {},
|
|
339
|
+
resourceTabOpts: ['draft','pending','processed','rescinded','finished','discontinue','flowQuery'],
|
|
340
|
+
tabTypeObj: {},//标签页对象
|
|
341
|
+
numberObj: {draft: 0, pending: 0, processed: 0, rescinded: 0, finished: 0, discontinue: 0},//标签内容数量对象
|
|
342
|
+
flowChartDialogVisible: false,
|
|
343
|
+
agentTitle: "", //代理标题
|
|
344
|
+
agentFormObj: {
|
|
345
|
+
openAgent: '0',
|
|
346
|
+
agentUserId: '', //代理人
|
|
347
|
+
flowId: "",
|
|
348
|
+
userId: '',
|
|
349
|
+
agentNodeUser: '',
|
|
350
|
+
agentUser: {}, //代理人
|
|
351
|
+
agentUserName: '',//代理人名称
|
|
352
|
+
agentUserKey: '', //代理人id
|
|
353
|
+
}, //代理对象
|
|
354
|
+
agentNodeUserArr: [], //代理人arr
|
|
355
|
+
agentVisible: false,
|
|
356
|
+
|
|
357
|
+
flowFormTitle: "" || "流程信息",//工作流表单信息弹出框标题
|
|
358
|
+
|
|
359
|
+
// 流转记录
|
|
360
|
+
flowRecordObj: {
|
|
361
|
+
instId: "",
|
|
362
|
+
dialogVisible: false,
|
|
363
|
+
oldDialogVisible: false,
|
|
364
|
+
},
|
|
365
|
+
|
|
366
|
+
// 流程图
|
|
367
|
+
flowChartObj: {
|
|
368
|
+
dialogVisible: false,
|
|
369
|
+
flowId: "",
|
|
370
|
+
instId: "",
|
|
371
|
+
linkProcId:"",
|
|
372
|
+
isRelease:"",
|
|
373
|
+
},
|
|
374
|
+
|
|
375
|
+
completeSignDialog: false,//加签人窗口
|
|
376
|
+
turnSignDialog: false,//转签人窗口
|
|
377
|
+
pendingNums: "",//批量处理条数
|
|
378
|
+
sysOrgPosUserDialog: false,
|
|
379
|
+
mulitiChooseUser: false,//处理人是否多选
|
|
380
|
+
|
|
381
|
+
nextSteptUserDialog: false,//下一步执行人窗口
|
|
382
|
+
nextSteptUserType: "all",
|
|
383
|
+
nextSteptUserArr: [],//下一步处理人
|
|
384
|
+
chooseNextUserId: "",//选择的处理人
|
|
385
|
+
chooseNextUserName: "",//选择的处理人名称
|
|
386
|
+
choosePosUserIds: "",//选择的处理人组织岗位id
|
|
387
|
+
chooseNextUserIdObj: {},//选择的处理人集合
|
|
388
|
+
choosePosUserIdsObj: {},//选择的处理人组织岗位id集合
|
|
389
|
+
chooseNextUserNameObj: {},//选择的处理人名称集合
|
|
390
|
+
inclusiveChooseKey:"", // 并行网关下一步选择多个节点时是全部人员选择时
|
|
391
|
+
|
|
392
|
+
nextNodeName:"", // 下一个节点名称
|
|
393
|
+
nextNode: {},//下一个节点信息
|
|
394
|
+
nowNode: {},//本节点信息
|
|
395
|
+
isProceedNext:true,
|
|
396
|
+
description: "",//附加说明
|
|
397
|
+
|
|
398
|
+
// 处理、修改、查看流程信息弹窗
|
|
399
|
+
flowInstDataDialog: false,
|
|
400
|
+
currentRowData: {}, // 修改时行数据
|
|
401
|
+
|
|
402
|
+
// 表单信息
|
|
403
|
+
formInfo: {
|
|
404
|
+
dataId: "",
|
|
405
|
+
opt: "view",
|
|
406
|
+
},
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
isDisabled: {
|
|
410
|
+
update: true,
|
|
411
|
+
deal: true,
|
|
412
|
+
flowRecord: true,
|
|
413
|
+
flowChart: true,
|
|
414
|
+
view: true,
|
|
415
|
+
saveDraft: true,
|
|
416
|
+
completeSign: true,
|
|
417
|
+
turnSign: true,
|
|
418
|
+
nextStep: true,
|
|
419
|
+
back: true,
|
|
420
|
+
cancel: true,
|
|
421
|
+
stopped: true,
|
|
422
|
+
close: true,
|
|
423
|
+
export: true,
|
|
424
|
+
retSpecified: true,
|
|
425
|
+
getBack: true,
|
|
426
|
+
record: true,
|
|
427
|
+
restore: true,
|
|
428
|
+
},
|
|
429
|
+
flowParams:{}, // 流程流转变量
|
|
430
|
+
isDisabled1: true,
|
|
431
|
+
|
|
432
|
+
initSuccess: false,
|
|
433
|
+
|
|
434
|
+
backDialogVisible:false, //退回指定节点窗口
|
|
435
|
+
backNodeArr:[], //退回节点arr
|
|
436
|
+
backMsg:'',//退回信息
|
|
437
|
+
backNodeId:'',//退回节点id
|
|
438
|
+
isDisabled2:true,
|
|
439
|
+
isShowAgentSet:false,//是否显示流程设置
|
|
440
|
+
loadAgentSuccess:false,//是否显示流程设置
|
|
441
|
+
|
|
442
|
+
startNodeKeyObj: {}, //当前开始节点 key 和对应版本号
|
|
443
|
+
startNodeKeyObjByFlowId: {},
|
|
444
|
+
flowVersionNodeObj: {}, //版本号对应的节点对象
|
|
445
|
+
flowVersionNodeObjByFlowId: {},
|
|
446
|
+
parentListViewId:"",
|
|
447
|
+
parentTableViewId:"",
|
|
448
|
+
scriptObj:{},
|
|
449
|
+
newScriptObj:{}, //新事件规则-脚本
|
|
450
|
+
newEventObj:{}, //新事件规则-规则
|
|
451
|
+
installListObj:this.EVENT_PLUGIN['installEventObj']||{}, //已经安装的流程事件
|
|
452
|
+
formSettingVisible:false,
|
|
453
|
+
workListViews:{},
|
|
454
|
+
workTableViews:{},
|
|
455
|
+
currNodeName: "", //当前节点名称
|
|
456
|
+
nextUserInfo: {}, // 下一步处理人的信息
|
|
457
|
+
dataId: "", // 表单数据id
|
|
458
|
+
disableSign: false, // 禁用加签转签按钮
|
|
459
|
+
formSearchObj: {
|
|
460
|
+
taskNode: "",
|
|
461
|
+
flowNewBatchDealArr: [],
|
|
462
|
+
isNewSelectBatchDeal: false,
|
|
463
|
+
loading: true,
|
|
464
|
+
isInit: false
|
|
465
|
+
},
|
|
466
|
+
formDataObj: {},
|
|
467
|
+
formNewBtnArr: [],
|
|
468
|
+
isRefreshGetNextUsers: [], // 是否要刷新下一步处理人的字段,网关字段,表单,变量
|
|
469
|
+
fieldSysDataObj: {},
|
|
470
|
+
flowNewBatchDealDataIds: "",
|
|
471
|
+
currentPage: 1, //当前页
|
|
472
|
+
pages: 1, //总页数
|
|
473
|
+
total: 0, //总条数
|
|
474
|
+
pageSize: 50, //每页多少条
|
|
475
|
+
flowEventScriptByFlowId: {},
|
|
476
|
+
diyButtonsObj: {}, // 自定义按钮对象
|
|
477
|
+
|
|
478
|
+
// 原props对象
|
|
479
|
+
flowNextOperation: null, // 以下内容是原props
|
|
480
|
+
workFlowUtil: null,
|
|
481
|
+
|
|
482
|
+
flowFieldStatus:{},
|
|
483
|
+
fieldDefaultVal:{},
|
|
484
|
+
fieldDefaultValChangeNum:{},
|
|
485
|
+
flowFieldDefaultFromForm:{},
|
|
486
|
+
formOperate: "add",
|
|
487
|
+
formId: "",
|
|
488
|
+
tableviewId: "",
|
|
489
|
+
diyDialogProps:{
|
|
490
|
+
visible: false,
|
|
491
|
+
showClose:true,
|
|
492
|
+
title: "",
|
|
493
|
+
width: "90%",
|
|
494
|
+
height: "90%",
|
|
495
|
+
top: "5vh",
|
|
496
|
+
props: {},
|
|
497
|
+
buttonList:[]
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
},
|
|
501
|
+
watch:{
|
|
502
|
+
flowInstDataDialog(){
|
|
503
|
+
if(this.flowInstDataDialog){
|
|
504
|
+
this.isDisabled1 = true;
|
|
505
|
+
this.isDisabled['nextStep'] = true;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
},
|
|
509
|
+
methods: {
|
|
510
|
+
initDialogProps(dialogProps) {
|
|
511
|
+
this.flowNextOperation = dialogProps.flowNextOperation;
|
|
512
|
+
this.workFlowUtil = dialogProps.workFlowUtil;
|
|
513
|
+
this.getFieldInfo();
|
|
514
|
+
},
|
|
515
|
+
|
|
516
|
+
openFlowDialog(args){
|
|
517
|
+
if(args.visible){
|
|
518
|
+
console.log("visible为系统参数,不允许设置此参数");
|
|
519
|
+
delete args.visible;
|
|
520
|
+
}
|
|
521
|
+
args.props = args.props || {};
|
|
522
|
+
if(args.type === "form"){
|
|
523
|
+
let props = args.props;
|
|
524
|
+
args.props = Object.assign({isSignForm:true, isEditData: true},props);
|
|
525
|
+
}
|
|
526
|
+
Object.assign(this.diyDialogProps, args);
|
|
527
|
+
this.diyDialogProps.visible = true;
|
|
528
|
+
},
|
|
529
|
+
|
|
530
|
+
closeFlowDialog(){
|
|
531
|
+
this.diyDialogProps.visible = false;
|
|
532
|
+
},
|
|
533
|
+
|
|
534
|
+
dialogEvent(item){
|
|
535
|
+
let ref = "dialogFormRef";
|
|
536
|
+
if(this.diyDialogProps.type === "list"){
|
|
537
|
+
ref = "dialogListRef";
|
|
538
|
+
}
|
|
539
|
+
if(this.diyDialogProps.type === "component"){
|
|
540
|
+
ref = "dialogComponentRef";
|
|
541
|
+
}
|
|
542
|
+
item.event && item.event(this,ref);
|
|
543
|
+
},
|
|
544
|
+
|
|
545
|
+
operateDialog(key,value) {
|
|
546
|
+
this[key] = value;
|
|
547
|
+
},
|
|
548
|
+
/**
|
|
549
|
+
* 选择下一步执行人
|
|
550
|
+
*/
|
|
551
|
+
chooseUser(nodekey) {
|
|
552
|
+
this.inclusiveChooseKey = nodekey || "";
|
|
553
|
+
this.sysOrgPosUserDialog = true;
|
|
554
|
+
},
|
|
555
|
+
fillFlowDialogParams(params){
|
|
556
|
+
Object.keys(params).forEach(key => {
|
|
557
|
+
this[key] = params[key];
|
|
558
|
+
});
|
|
559
|
+
},
|
|
560
|
+
/**
|
|
561
|
+
* 下一步确定
|
|
562
|
+
*/
|
|
563
|
+
saveNextStept() {
|
|
564
|
+
this.isDisabled1 = false;
|
|
565
|
+
let dealers = this.chooseNextUserId;
|
|
566
|
+
let dealerNames = this.chooseNextUserName;
|
|
567
|
+
let dealersObj = {};
|
|
568
|
+
if (this.nextNode.nextType == "inclusiveGateway") {
|
|
569
|
+
// 校验是否选人了
|
|
570
|
+
let tempResult = true;
|
|
571
|
+
Object.keys(this.chooseNextUserIdObj).forEach(key => {
|
|
572
|
+
let dealers = this.chooseNextUserIdObj[key];
|
|
573
|
+
if(Array.isArray(dealers)){
|
|
574
|
+
dealersObj[key] = dealers.join(",");
|
|
575
|
+
}else{
|
|
576
|
+
dealersObj[key] = dealers;
|
|
577
|
+
}
|
|
578
|
+
if ((this.chooseNextUserIdObj[key] || []).length == 0) {
|
|
579
|
+
tempResult = false;
|
|
580
|
+
}
|
|
581
|
+
});
|
|
582
|
+
if (!tempResult) {
|
|
583
|
+
this.$message.error("所有任务都需要设置执行人!");
|
|
584
|
+
this.isDisabled1 = true;
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
587
|
+
} else {
|
|
588
|
+
if (dealers && !dealerNames) {
|
|
589
|
+
let userName = "";
|
|
590
|
+
this.nextSteptUserArr.forEach(item => {
|
|
591
|
+
if (("," + dealers + ",").indexOf("," + item.id + ",") > -1) {
|
|
592
|
+
userName += "," + item.userName;
|
|
593
|
+
}
|
|
594
|
+
});
|
|
595
|
+
if (userName) {
|
|
596
|
+
userName = userName.substring(1);
|
|
597
|
+
}
|
|
598
|
+
this.chooseNextUserName = userName;
|
|
599
|
+
dealerNames = this.chooseNextUserName;
|
|
600
|
+
}
|
|
601
|
+
if (this.nextNode.nodeType != 'EndEvent') {
|
|
602
|
+
if ((!this.chooseNextUserId || this.chooseNextUserId.length == 0) && this.isProceedNext) {
|
|
603
|
+
this.$message({type: "error", message: "请选择处理人!"});
|
|
604
|
+
this.isDisabled1 = true;
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
if (this.nextNode.dealType != "single") {
|
|
608
|
+
if (typeof this.chooseNextUserId == 'string') {
|
|
609
|
+
dealers = this.chooseNextUserId;
|
|
610
|
+
} else {
|
|
611
|
+
dealers = this.chooseNextUserId.join(",");
|
|
612
|
+
}
|
|
613
|
+
if (typeof this.chooseNextUserName == 'string') {
|
|
614
|
+
dealerNames = this.chooseNextUserName;
|
|
615
|
+
} else {
|
|
616
|
+
dealerNames = this.chooseNextUserName.join(",");
|
|
617
|
+
}
|
|
618
|
+
}else if(this.nextNode.dealType == "single"){
|
|
619
|
+
dealers=dealers.split(",")[0];
|
|
620
|
+
dealerNames=dealerNames.split(",")[0];
|
|
621
|
+
}
|
|
622
|
+
} else {
|
|
623
|
+
dealers = "";
|
|
624
|
+
}
|
|
625
|
+
dealersObj[this.nextNode["nodeLinkId"]] = dealers;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
this.nextUserInfo['dealers'] = dealers;
|
|
629
|
+
this.nextUserInfo['dealerNames'] = dealerNames;
|
|
630
|
+
this.nextUserInfo['dealersObj'] = dealersObj;
|
|
631
|
+
|
|
632
|
+
let obj = {
|
|
633
|
+
instId: this.saveInstId,
|
|
634
|
+
dealers: dealers,
|
|
635
|
+
dealerNames: dealerNames,
|
|
636
|
+
nextNodeType: this.nextNode.nodeType,
|
|
637
|
+
dealersObj: JSON.stringify(dealersObj),
|
|
638
|
+
taskId: this.currentInst.taskId,
|
|
639
|
+
nextNodeId: this.nextNode.id,
|
|
640
|
+
nextNodeKey: this.nextNode.nodeLinkId,
|
|
641
|
+
}
|
|
642
|
+
if(this.nowNode && this.nowNode.dealType && this.nowNode.dealType == 'multi'){
|
|
643
|
+
this.$set(obj,'passCondition',this.nowNode.passCondition)
|
|
644
|
+
}
|
|
645
|
+
if(this.flowNextOperation) {
|
|
646
|
+
this.flowNextOperation(obj.instId, obj.dealers, obj.dealerNames, obj.taskId);
|
|
647
|
+
}
|
|
648
|
+
this.workFlowUtil.syncFlowDialogPrams({
|
|
649
|
+
chooseNextUserId: this.chooseNextUserId,
|
|
650
|
+
chooseNextUserName: this.chooseNextUserName,
|
|
651
|
+
chooseNextUserIdObj: this.chooseNextUserIdObj
|
|
652
|
+
});
|
|
653
|
+
let params = {"SASP_FLOW_USE_VARIABLES":"yes"};
|
|
654
|
+
Object.assign(params,this.flowParams || {},obj);
|
|
655
|
+
this.saspFlowAxios.post(this.api.plFlowInst.executeNextStep,params).then(res => {
|
|
656
|
+
if (res && res.data && res.data.operateSuccess) {
|
|
657
|
+
this.workFlowUtil.initTabNum && this.workFlowUtil.initTabNum();
|
|
658
|
+
this.$message({type: "success", message: "提交成功!"});
|
|
659
|
+
if (this.flowBatchPendingDialog) {
|
|
660
|
+
this.workFlowUtil.batchTabRemove && this.workFlowUtil.batchTabRemove(this.currentInst.dataId);
|
|
661
|
+
} else {
|
|
662
|
+
this.workFlowUtil.tabCrudSearch && this.workFlowUtil.tabCrudSearch();
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
this.nextSteptUserDialog = false;
|
|
666
|
+
this.flowInstDataDialog = false;
|
|
667
|
+
|
|
668
|
+
let type = this.flowBatchPendingDialog ? "batch" : "";
|
|
669
|
+
let currentNodeObj = this.flowNodeIdToInfo[this.currentInst.currentNode || this.draftNodeId] ||{};
|
|
670
|
+
let submitSuccessRusult;
|
|
671
|
+
submitSuccessRusult=this.workFlowUtil.exeFlowEvent("nextStep","submitSuccess", this.currentInst.currentNode || this.draftNodeId);
|
|
672
|
+
if(currentNodeObj.openEvent == '1'){
|
|
673
|
+
submitSuccessRusult =this.workFlowUtil.exeNewFlowEvent("nextSubmit",currentNodeObj.nodeLinkId||'')
|
|
674
|
+
}
|
|
675
|
+
this.workFlowUtil.afterNextStepSuccess && this.workFlowUtil.afterNextStepSuccess(this.workFlowUtil.$this,this.workFlowUtil);
|
|
676
|
+
if(submitSuccessRusult){
|
|
677
|
+
//办结提醒
|
|
678
|
+
if(this.nextNode.nodeType == "EndEvent"){
|
|
679
|
+
let remindParam = {
|
|
680
|
+
instId:this.saveInstId,
|
|
681
|
+
flowId:this.flowDefine.id,
|
|
682
|
+
flowName:this.flowDefine.flowName,
|
|
683
|
+
formId:this.formId,
|
|
684
|
+
dataId:this.formInfo.dataId,
|
|
685
|
+
instType:"end"
|
|
686
|
+
};
|
|
687
|
+
this.saspFlowAxios.post(this.api.plFlowInst.saveRemind,remindParam);
|
|
688
|
+
}
|
|
689
|
+
}else{
|
|
690
|
+
console.log("脚本异常")
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
} else {
|
|
695
|
+
this.$message({type: "error", message: "保存失败!"});
|
|
696
|
+
this.isDisabled1 = true;
|
|
697
|
+
this.isDisabled['nextStep'] = true;
|
|
698
|
+
}
|
|
699
|
+
});
|
|
700
|
+
},
|
|
701
|
+
/**
|
|
702
|
+
* 确认执行人
|
|
703
|
+
*/
|
|
704
|
+
sureNextUser() {
|
|
705
|
+
let checkedUserArr = this.$refs.orgPosUserRef.chooseUsers || [];
|
|
706
|
+
let userName = "";
|
|
707
|
+
let userId = "";
|
|
708
|
+
let arr = [];
|
|
709
|
+
let posUserIdArr = [];
|
|
710
|
+
checkedUserArr.forEach(item => {
|
|
711
|
+
userName += "," + item.dataLabel;
|
|
712
|
+
userId += "," + (item.dataKey.startsWith("user_") ? item.dataKey.replace("user_", "") : item.dataKey);
|
|
713
|
+
arr.push(item.dataKey.startsWith("user_") ? item.dataKey.replace("user_", "") : item.dataKey);
|
|
714
|
+
posUserIdArr.push(item.dataKey.startsWith("user_") ? item.dataKey.replace("user_", "") : item.dataKey);
|
|
715
|
+
});
|
|
716
|
+
if (userName) {
|
|
717
|
+
userName = userName.substring(1);
|
|
718
|
+
userId = userId.substring(1);
|
|
719
|
+
}
|
|
720
|
+
this.chooseNextUserName = userName;
|
|
721
|
+
this.chooseNextUserId = userId;
|
|
722
|
+
this.choosePosUserIds = posUserIdArr.join(",");
|
|
723
|
+
if(this.inclusiveChooseKey){
|
|
724
|
+
this.chooseNextUserNameObj[this.inclusiveChooseKey] = userName;
|
|
725
|
+
this.chooseNextUserIdObj[this.inclusiveChooseKey] = arr;
|
|
726
|
+
this.choosePosUserIdsObj[this.inclusiveChooseKey] = posUserIdArr.join(",");
|
|
727
|
+
}
|
|
728
|
+
this.sysOrgPosUserDialog = false;
|
|
729
|
+
},
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* 确认加签
|
|
733
|
+
*/
|
|
734
|
+
sureCompleteSign() {
|
|
735
|
+
let checkedUserArr = this.$refs.completeSignRef.chooseUsers || [];
|
|
736
|
+
if (checkedUserArr.length === 0) {
|
|
737
|
+
this.$message({type: "error", message: "请选择加签人!"});
|
|
738
|
+
return;
|
|
739
|
+
}
|
|
740
|
+
let userIds = "";
|
|
741
|
+
checkedUserArr.forEach(item => {
|
|
742
|
+
userIds += "," + (item.dataKey.startsWith("user_") ? item.dataKey.replace("user_", "") : item.dataKey);
|
|
743
|
+
});
|
|
744
|
+
this.disableSign = true;
|
|
745
|
+
this.saspFlowAxios.post(this.api.plFlowInst.completeSign, {
|
|
746
|
+
taskId: this.currentInst.taskId,
|
|
747
|
+
dealers: userIds.substring(1)
|
|
748
|
+
}).then(res => {
|
|
749
|
+
if (res && res.data && res.data.operateSuccess) {
|
|
750
|
+
this.completeSignDialog = false;
|
|
751
|
+
this.flowInstDataDialog = false;
|
|
752
|
+
this.workFlowUtil.initTabNum && this.workFlowUtil.initTabNum();
|
|
753
|
+
this.$message({type: "success", message: "加签成功!"});
|
|
754
|
+
this.workFlowUtil.tabCrudSearch && this.workFlowUtil.tabCrudSearch();
|
|
755
|
+
} else {
|
|
756
|
+
this.$message({type: "error", message: "加签失败!"});
|
|
757
|
+
}
|
|
758
|
+
this.disableSign = false;
|
|
759
|
+
});
|
|
760
|
+
},
|
|
761
|
+
|
|
762
|
+
/**
|
|
763
|
+
* 确认转签
|
|
764
|
+
*/
|
|
765
|
+
sureTurnSign() {
|
|
766
|
+
let checkedUserArr = this.$refs.turnSignRef.chooseUsers || [];
|
|
767
|
+
if (checkedUserArr.length === 0) {
|
|
768
|
+
this.$message({type: "error", message: "请选择转签人!"});
|
|
769
|
+
return;
|
|
770
|
+
}
|
|
771
|
+
let userId = checkedUserArr[0].dataKey.startsWith("user_") ? checkedUserArr[0].dataKey.replace("user_", "") : checkedUserArr[0].dataKey;
|
|
772
|
+
this.disableSign = true;
|
|
773
|
+
this.saspFlowAxios.post(this.api.plFlowInst.turnSign, {
|
|
774
|
+
taskId: this.currentInst.taskId,
|
|
775
|
+
dealers: userId
|
|
776
|
+
}).then(res => {
|
|
777
|
+
if (res && res.data && res.data.operateSuccess) {
|
|
778
|
+
this.turnSignDialog = false;
|
|
779
|
+
this.flowInstDataDialog = false;
|
|
780
|
+
this.workFlowUtil.initTabNum && this.workFlowUtil.initTabNum();
|
|
781
|
+
this.$message({type: "success", message: "转签成功!"});
|
|
782
|
+
this.workFlowUtil.tabCrudSearch && this.workFlowUtil.tabCrudSearch();
|
|
783
|
+
} else {
|
|
784
|
+
this.$message({type: "error", message: "转签失败!"});
|
|
785
|
+
}
|
|
786
|
+
this.disableSign = false;
|
|
787
|
+
});
|
|
788
|
+
|
|
789
|
+
},
|
|
790
|
+
|
|
791
|
+
/**
|
|
792
|
+
* 执行退回
|
|
793
|
+
*/
|
|
794
|
+
beginBack(){
|
|
795
|
+
if(!this.backNodeId){
|
|
796
|
+
this.$message.error("没有选择要退回的节点!");
|
|
797
|
+
return;
|
|
798
|
+
}
|
|
799
|
+
this.isDisabled2 = false;
|
|
800
|
+
this.saspFlowAxios.post(this.api.plFlowInst.skipToNode,
|
|
801
|
+
{"instId":this.currentInst.flowInstId,"skipNode":this.backNodeId,
|
|
802
|
+
"backMsg":this.backMsg,"skipStatus":"skip"}).then(res => {
|
|
803
|
+
if(res.data.operateSuccess){
|
|
804
|
+
this.workFlowUtil.initTabNum && this.workFlowUtil.initTabNum();
|
|
805
|
+
this.$message.success("退回成功!");
|
|
806
|
+
this.backDialogVisible = false;
|
|
807
|
+
this.isDisabled2 = true;
|
|
808
|
+
this.isDisabled['retSpecified'] = true;
|
|
809
|
+
this.flowInstDataDialog = false;
|
|
810
|
+
if (this.flowBatchPendingDialog) {
|
|
811
|
+
this.workFlowUtil.batchTabRemove && this.workFlowUtil.batchTabRemove(this.currentInst.dataId);
|
|
812
|
+
} else {
|
|
813
|
+
this.workFlowUtil.tabCrudSearch && this.workFlowUtil.tabCrudSearch();
|
|
814
|
+
}
|
|
815
|
+
this.workFlowUtil.initTabNum && this.workFlowUtil.initTabNum();
|
|
816
|
+
}else{
|
|
817
|
+
this.$message.error("退回失败!");
|
|
818
|
+
this.isDisabled['retSpecified'] = true;
|
|
819
|
+
}
|
|
820
|
+
})
|
|
821
|
+
},
|
|
822
|
+
|
|
823
|
+
/**
|
|
824
|
+
* 获取表单信息 start
|
|
825
|
+
* @returns {{}}
|
|
826
|
+
*/
|
|
827
|
+
getFormInfo(){
|
|
828
|
+
let optFormData = {};
|
|
829
|
+
if(this.$refs.tableRef){
|
|
830
|
+
optFormData = this.$refs.tableRef.optFormData;
|
|
831
|
+
}
|
|
832
|
+
return optFormData;
|
|
833
|
+
},
|
|
834
|
+
|
|
835
|
+
closeInstDialog(){
|
|
836
|
+
this.flowInstDataDialog = false;
|
|
837
|
+
},
|
|
838
|
+
|
|
839
|
+
/**
|
|
840
|
+
* 保存表单信息
|
|
841
|
+
*/
|
|
842
|
+
saveFormInfo(type){
|
|
843
|
+
return new Promise(resolve => {
|
|
844
|
+
if(type === 'draft'){
|
|
845
|
+
let validate = this.$refs.tableRef.validateDraft();
|
|
846
|
+
if(!validate){
|
|
847
|
+
return;
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
this.$refs.tableRef.saveData().then(res => {
|
|
851
|
+
if(!res){
|
|
852
|
+
resolve(false);
|
|
853
|
+
return;
|
|
854
|
+
}
|
|
855
|
+
if(!res.formDataObj.flowSaveSuccess){
|
|
856
|
+
this.$message({
|
|
857
|
+
type:"warning",
|
|
858
|
+
message:"保存失败!"
|
|
859
|
+
});
|
|
860
|
+
resolve(false);
|
|
861
|
+
return;
|
|
862
|
+
}
|
|
863
|
+
let flowParams = res.formDataObj;
|
|
864
|
+
let fieldSysDataObj = this.$refs.tableRef.fieldSysDataObj;
|
|
865
|
+
this.getFieldInfo().then(() => {
|
|
866
|
+
let obj = {};
|
|
867
|
+
Object.keys(flowParams).forEach(key => {
|
|
868
|
+
let paramKey = this.formFieldObj[key] || key;
|
|
869
|
+
if(fieldSysDataObj[key]){ // 替换元数据
|
|
870
|
+
let value = flowParams[key];
|
|
871
|
+
obj[paramKey] = flowParams[key] || "";
|
|
872
|
+
if(value){
|
|
873
|
+
let valueKeyArr = [value];
|
|
874
|
+
if(value.indexOf(",") > -1){
|
|
875
|
+
valueKeyArr = value.split(",");
|
|
876
|
+
}
|
|
877
|
+
let valueArr = [];
|
|
878
|
+
valueKeyArr.forEach(item => {
|
|
879
|
+
valueArr.push(fieldSysDataObj[key][item]);
|
|
880
|
+
})
|
|
881
|
+
obj[paramKey + "_SASP_SYS_DATA"] = valueArr.join(",");
|
|
882
|
+
obj[key + "_SASP_SYS_DATA"] = valueArr.join(",");
|
|
883
|
+
obj[paramKey + "_SASP_SYS_DATA_ID"] = valueKeyArr.join(",");
|
|
884
|
+
obj[key + "_SASP_SYS_DATA_ID"] = valueKeyArr.join(",");
|
|
885
|
+
obj[paramKey] = valueArr.join(",");
|
|
886
|
+
obj[key] = valueArr.join(",");
|
|
887
|
+
}
|
|
888
|
+
}else{
|
|
889
|
+
obj[paramKey] = flowParams[key];
|
|
890
|
+
obj[key] = flowParams[key];
|
|
891
|
+
}
|
|
892
|
+
});
|
|
893
|
+
resolve(obj);
|
|
894
|
+
});
|
|
895
|
+
})
|
|
896
|
+
})
|
|
897
|
+
},
|
|
898
|
+
|
|
899
|
+
/**
|
|
900
|
+
* 获取字段信息
|
|
901
|
+
*/
|
|
902
|
+
getFieldInfo(){
|
|
903
|
+
return new Promise(resolve => {
|
|
904
|
+
if(Object.keys(this.formFieldObj).length > 0 && !this.flowDefine.id.includes(",")){
|
|
905
|
+
resolve();
|
|
906
|
+
return;
|
|
907
|
+
}
|
|
908
|
+
if(!this.FORM_GLOBAL){
|
|
909
|
+
this.$message.error("请先安装表单组件或使用自定义表单!");
|
|
910
|
+
resolve();
|
|
911
|
+
return;
|
|
912
|
+
}
|
|
913
|
+
this.FORM_GLOBAL.getFormFields(this.formId).then(res => {
|
|
914
|
+
this.formFieldObj = {};
|
|
915
|
+
(res || []).forEach(item => {
|
|
916
|
+
this.formFieldObj[item.id] = item.phyfieldName;
|
|
917
|
+
});
|
|
918
|
+
// this.formAboutInfoObj["formFieldObj"] = this.formFieldObj;
|
|
919
|
+
resolve();
|
|
920
|
+
});
|
|
921
|
+
});
|
|
922
|
+
},
|
|
923
|
+
|
|
924
|
+
/**
|
|
925
|
+
* 初始化表单信息
|
|
926
|
+
*/
|
|
927
|
+
initFormInfo(type,dataId,fieldOperate,flowInstData){
|
|
928
|
+
flowInstData = flowInstData || {};
|
|
929
|
+
return new Promise(resolve => {
|
|
930
|
+
this.formOperate = type;
|
|
931
|
+
this.dataId = dataId;
|
|
932
|
+
this.getFieldDefaultVal(fieldOperate,flowInstData.flowStatus).then(() => {
|
|
933
|
+
this.$nextTick(() => {
|
|
934
|
+
this.$refs.tableRef.loadData().then(() => {
|
|
935
|
+
resolve();
|
|
936
|
+
})
|
|
937
|
+
})
|
|
938
|
+
})
|
|
939
|
+
})
|
|
940
|
+
},
|
|
941
|
+
|
|
942
|
+
getFieldDefaultVal(fieldOperate,flowStatus){
|
|
943
|
+
return new Promise(resolve => {
|
|
944
|
+
this.flowFieldStatus = {};
|
|
945
|
+
this.fieldDefaultVal = {}; //初始化可编辑状态和默认值
|
|
946
|
+
let orgChargeField = [];
|
|
947
|
+
let supervisorField = [];
|
|
948
|
+
// let levels = "";
|
|
949
|
+
Object.keys(fieldOperate).forEach(field => {
|
|
950
|
+
let fieldObj = fieldOperate[field];
|
|
951
|
+
if(flowStatus!='4'){
|
|
952
|
+
if (fieldObj.edit == "1") {//可编辑
|
|
953
|
+
this.flowFieldStatus[field] = "edit";
|
|
954
|
+
} else if (fieldObj.hide == "1") {//不可见
|
|
955
|
+
this.flowFieldStatus[field] = "hide";
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
let defaultValType = fieldObj.defaultValType;
|
|
959
|
+
let defaultVal = fieldObj.defaultVal;
|
|
960
|
+
let dateTimeType = fieldObj.dateTimeType;
|
|
961
|
+
if (defaultVal) {
|
|
962
|
+
if (defaultValType == "sysData") {
|
|
963
|
+
this.fieldDefaultVal[field] = defaultVal[defaultVal.length - 1];
|
|
964
|
+
} else if (defaultValType == "formInfo"){
|
|
965
|
+
this.fieldDefaultVal[field] = "&&," + defaultVal + ",&&";
|
|
966
|
+
} else if (defaultValType == "diyVal" || (defaultValType == "dateTime" && dateTimeType == "diyTime")) {
|
|
967
|
+
this.fieldDefaultVal[field] = defaultVal;
|
|
968
|
+
} else {
|
|
969
|
+
if (defaultVal.indexOf("LOGINUSER") > -1) {
|
|
970
|
+
this.fieldDefaultVal[field] = Replace.def(this.loginUser, defaultVal);
|
|
971
|
+
} else {
|
|
972
|
+
this.fieldDefaultVal[field] = Replace.def(this.userDept, defaultVal);
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
//时间
|
|
977
|
+
if(defaultValType == "dateTime" && dateTimeType == "sysTime"){
|
|
978
|
+
let time = "";
|
|
979
|
+
let dateTimeFormat = fieldObj.dateTimeFormat || "yyyy-MM-dd";
|
|
980
|
+
let specialDate = fieldObj.specialDate;
|
|
981
|
+
let specialOpt = fieldObj.specialOpt;
|
|
982
|
+
let specialVal = fieldObj.specialVal;
|
|
983
|
+
if(specialDate && specialOpt && specialVal){
|
|
984
|
+
time = this.DATE_UTIL.timeConversion(new Date(),dateTimeFormat,specialDate,specialOpt,specialVal);
|
|
985
|
+
}else{
|
|
986
|
+
time = this.DATE_UTIL.formaterDateOrTime(new Date(),dateTimeFormat);
|
|
987
|
+
}
|
|
988
|
+
this.fieldDefaultVal[field] = time;
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
if(defaultValType == "dateTime" && dateTimeType == "formField"){
|
|
992
|
+
this.flowFieldDefaultFromForm[field] = fieldObj;
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
|
|
996
|
+
//处理人上级
|
|
997
|
+
let dealerLeaderType = fieldObj.dealerLeaderType;
|
|
998
|
+
if(dealerLeaderType){
|
|
999
|
+
if(dealerLeaderType == "1"){
|
|
1000
|
+
orgChargeField.push(field);
|
|
1001
|
+
}else{
|
|
1002
|
+
supervisorField.push({field:field,level:fieldObj.leaderLevel})
|
|
1003
|
+
// levels += "," + fieldObj.leaderLevel;
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
this.fieldDefaultValChangeNum[field] = fieldObj.changeNum;
|
|
1007
|
+
});
|
|
1008
|
+
this.getDefaultUser(orgChargeField,supervisorField,resolve);
|
|
1009
|
+
})
|
|
1010
|
+
},
|
|
1011
|
+
|
|
1012
|
+
getDefaultUser(orgChargeField,supervisorField,resolve){
|
|
1013
|
+
if(orgChargeField.length > 0 && supervisorField.length > 0){
|
|
1014
|
+
this.saspFlowAxios.post(window.FLOW_RENDER_URL + "/plFlowInterfaceController/getDeptSupervisor",
|
|
1015
|
+
{loginUserId:this.loginUser.id}).then(res => {
|
|
1016
|
+
if(res && res.data){
|
|
1017
|
+
let userId = (res.data[0] || {}).id;
|
|
1018
|
+
orgChargeField.forEach(fieldId => {
|
|
1019
|
+
this.fieldDefaultVal[fieldId] = userId || "";
|
|
1020
|
+
});
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
this.saspFlowAxios.post(window.FLOW_RENDER_URL + "/plFlowInterfaceController/getSupervisor",
|
|
1024
|
+
{loginUserId:this.loginUser.id}).then(res => {
|
|
1025
|
+
if(res && res.data){
|
|
1026
|
+
let userIdMap = res.data || {};
|
|
1027
|
+
supervisorField.forEach(item => {
|
|
1028
|
+
this.fieldDefaultVal[item.field] = userIdMap[item.level] || "";
|
|
1029
|
+
});
|
|
1030
|
+
resolve(true);
|
|
1031
|
+
}
|
|
1032
|
+
});
|
|
1033
|
+
});
|
|
1034
|
+
}else if(orgChargeField.length > 0){
|
|
1035
|
+
this.saspFlowAxios.post(window.FLOW_RENDER_URL + "/plFlowInterfaceController/getSupervisor",
|
|
1036
|
+
{loginUserId:this.loginUser.id}).then(res => {
|
|
1037
|
+
if (res && res.data) {
|
|
1038
|
+
let userId = (res.data[0] || {}).id;
|
|
1039
|
+
orgChargeField.forEach(fieldId => {
|
|
1040
|
+
this.fieldDefaultVal[fieldId] = userId || "";
|
|
1041
|
+
});
|
|
1042
|
+
resolve(true);
|
|
1043
|
+
}
|
|
1044
|
+
});
|
|
1045
|
+
}else if(supervisorField.length > 0){
|
|
1046
|
+
this.saspFlowAxios.post(window.FLOW_RENDER_URL + "/plFlowInterfaceController/getSupervisor",
|
|
1047
|
+
{loginUserId:this.loginUser.id}).then(res => {
|
|
1048
|
+
if(res && res.data){
|
|
1049
|
+
let userIdMap = res.data || {};
|
|
1050
|
+
supervisorField.forEach(item => {
|
|
1051
|
+
this.fieldDefaultVal[item.field] = userIdMap[item.level] || "";
|
|
1052
|
+
});
|
|
1053
|
+
resolve(true);
|
|
1054
|
+
}
|
|
1055
|
+
});
|
|
1056
|
+
}else{
|
|
1057
|
+
resolve(true);
|
|
1058
|
+
}
|
|
1059
|
+
},
|
|
1060
|
+
|
|
1061
|
+
// 表单操作end
|
|
1062
|
+
|
|
1063
|
+
/**
|
|
1064
|
+
* 关闭下一步执行人弹窗
|
|
1065
|
+
*/
|
|
1066
|
+
closeNextSteptUserDialog() {
|
|
1067
|
+
this.nextSteptUserDialog = false;
|
|
1068
|
+
this.isDisabled['nextStep'] = true;
|
|
1069
|
+
},
|
|
1070
|
+
|
|
1071
|
+
// 自定义按钮窗口回调函数
|
|
1072
|
+
openDiyButtonEvent(type,row, button) {
|
|
1073
|
+
this.workFlowUtil.openDiyButtonEvent(type,row,button);
|
|
1074
|
+
},
|
|
1075
|
+
|
|
1076
|
+
judeDiyButton(tabActive,button) {
|
|
1077
|
+
return this.workFlowUtil.judeDiyButton(tabActive,button);
|
|
1078
|
+
},
|
|
1079
|
+
|
|
1080
|
+
open(){
|
|
1081
|
+
this.nextSteptUserDialog = true;
|
|
1082
|
+
},
|
|
1083
|
+
}
|
|
1084
|
+
};
|
|
1085
|
+
</script>
|
|
1086
|
+
|
|
1087
|
+
<style scoped>
|
|
1088
|
+
|
|
1089
|
+
</style>
|