sasp-flow-render 1.1.5 → 1.1.7

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": "sasp-flow-render",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "description": "业务应用支撑平台-智慧流程渲染组件",
5
5
  "scripts": {
6
6
  "build": "vue-cli-service build"
@@ -238,6 +238,8 @@ let objResult = {
238
238
  },
239
239
  flowEngine: {
240
240
  saveDataFlowDrafts: "/flowEngine/saveDataFlowDrafts",
241
+ startFlow: "/flowEngine/startFlow",
242
+ completeTask: "/flowEngine/completeTask",
241
243
  }
242
244
  };
243
245
 
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <el-container style="height: 100%;">
3
- <el-header style="height: auto;">
3
+ <el-header style="height: auto;" :class="[{'multiInstListHeader': flowIds.includes(',')}]">
4
4
  <div class="search-form-parent el-card">
5
5
  <el-form :inline="true" :model="crud.searchForm" size="small" class="demo-form-inline"
6
6
  @keyup.enter.native="doSearch()" onSubmit="return false;">
@@ -82,7 +82,7 @@
82
82
  <el-button type="primary" icon="el-icon-document-copy" size="small" round v-if="isShow('pending')"
83
83
  @click="openFlowBatchPendingDialog">批量处理
84
84
  </el-button>
85
- <el-button type="warning" icon="el-icon-document-copy" size="small" round v-if="isShow('pending')"
85
+ <el-button type="warning" icon="el-icon-document-copy" size="small" round v-if="isShow('pending') && getFormDataByDataIds"
86
86
  @click="openFlowBatchPendingDialogNew">快捷处理
87
87
  </el-button>
88
88
  </el-header>
@@ -296,6 +296,7 @@
296
296
  }
297
297
  },//工作流配置信息
298
298
  formId: {type: String, default: ""},
299
+ flowIds: {type: String, default: ""},
299
300
  startNodeKey: {type: String, default: ""},//开始节点key
300
301
  flowNodeIdToInfo: {
301
302
  type: Object, default: () => {
@@ -564,22 +565,22 @@
564
565
  },
565
566
 
566
567
  init() {
567
- this.crud.searchForm["flowId"] = this.flowDefine.id;
568
+ this.crud.searchForm["flowId"] = this.flowIds || this.flowDefine.id;
568
569
  this.$set(this.crud.searchForm,"currentNode","");
569
570
  let flowStatus = this.flowStatusObj[this.tabType];
570
- if(!flowStatus && flowStatus != 0){
571
+ if(!flowStatus && flowStatus !== 0){
571
572
  flowStatus = "";
572
573
  }
573
574
  this.crud.searchForm["nodeType"] = this.tabType;
574
- if (this.tabType == "draft") {
575
+ if (this.tabType === "draft") {
575
576
  this.crud.searchForm["created"] = this.loginUser.id;
576
577
  }
577
- if (this.tabType == "pending" || this.tabType == "processed" || this.tabType == "finished"
578
- || this.tabType == "rescinded" || this.tabType == "discontinue") {
578
+ if (this.tabType === "pending" || this.tabType === "processed" || this.tabType === "finished"
579
+ || this.tabType === "rescinded" || this.tabType === "discontinue") {
579
580
  this.crud.searchForm["dealUserId"] = this.loginUser.id;
580
581
  flowStatus = this.flowStatusObj[this.tabType] || "1";
581
582
  }
582
- if(this.tabType == "flowQuery"){
583
+ if(this.tabType === "flowQuery"){
583
584
  this.crud.searchForm["instQueryPower"] = this.instQueryPower;
584
585
  this.crud.searchForm["created"] = this.loginUser.id;
585
586
  this.crud.searchForm["queryOrderSetting"] = this.flowDefine.queryOrderSetting;
@@ -849,15 +850,20 @@
849
850
  * 按钮操作事件
850
851
  */
851
852
  listButtonOpt(buttonType, row, type) {
852
- if (buttonType == "update") {//修改
853
- this.openUpdateFlowForm(row,'update');
854
- } else if (buttonType == "deal") {//处理
855
- this.openUpdateFlowForm(row,'handle');
856
- } else if (buttonType == "view") {//查看
853
+ if (buttonType === "update") {
854
+ //修改
855
+ this.openUpdateFlowForm(row, 'update');
856
+ } else if (buttonType === "deal") {
857
+ //处理
858
+ this.openUpdateFlowForm(row, 'handle');
859
+ } else if (buttonType === "view") {
860
+ //查看
857
861
  this.openViewFlowForm(row);
858
- } else if (buttonType == "flowChart") {
862
+ } else if (buttonType === "flowChart") {
863
+ //流程图
859
864
  this.openFlowChart(row);
860
- } else if (buttonType == "flowRecord") {
865
+ } else if (buttonType === "flowRecord") {
866
+ // 流转记录
861
867
  this.openFlowRecord(row);
862
868
  }
863
869
  },
@@ -1034,6 +1040,9 @@
1034
1040
 
1035
1041
  <style scoped lang="scss">
1036
1042
  @import "css/flowInstList";
1043
+ .multiInstListHeader {
1044
+ margin-top: 10px;
1045
+ }
1037
1046
  </style>
1038
1047
  <style lang="scss">
1039
1048
  .el-tooltip__popper{
@@ -1,12 +1,39 @@
1
1
  <template>
2
2
  <div class="flow-inst" style="height: 100%;background-color: white;">
3
- <div class="flow-chart" style="z-index:100;position:absolute;top:9px;right:0;text-align: right;">
3
+ <div class="flow-chart" style="z-index:100;position:absolute;top:9px;right:0;text-align: right;" v-if="!flowId.includes(',')">
4
4
  <el-button size="mini" style="margin-right: 12px;"
5
5
  type="warning" round icon="saspiconfont pl-icon-gongzuoliuchengtu"
6
6
  @click="openFlowChart()">流程图
7
7
  </el-button>
8
8
  </div>
9
9
 
10
+ <div style="height: 100%" v-if="flowId.includes(',')">
11
+ <flow-inst-list ref="pendingRef"
12
+ v-if="initSuccess"
13
+ tab-type="pending"
14
+ :flow-define="flowDefine"
15
+ :flow-ids="flowId"
16
+ :userArr="userArr"
17
+ :userMap="userMap"
18
+ :form-id="formInfo.formId"
19
+ :flow-node-id-to-info="flowNodeIdToInfo"
20
+ :flow-node-name-obj="flowNodeNameObj"
21
+ :node-list-button-obj="nodeListButtonObj"
22
+ :opt-column-width="optColumnWidth"
23
+ :show-model="showModel"
24
+ :start-node-key-obj="startNodeKeyObj"
25
+ :flow-version-node-obj="flowVersionNodeObj"
26
+ @initTabNum="initTabNum"
27
+ :open-flow-chart="openFlowChart"
28
+ :open-flow-record="openFlowRecord"
29
+ :open-update-flow-form="openUpdateFlowForm"
30
+ :open-batch-update-flow-form="openBatchUpdateFlowForm"
31
+ :openNewBatchUpdateFlowForm="openNewBatchUpdateFlowForm"
32
+ @setDataValue="setDataValue"
33
+ >
34
+ </flow-inst-list>
35
+ </div>
36
+ <div style="height: 100%" v-else>
10
37
  <el-tabs v-model="tabActive" v-if="initSuccess" type="border-card" @tab-click="tabClick"
11
38
  style="width: 100%;height: 100%;">
12
39
  <el-tab-pane name="draft" v-if="tabShow('draft')" style="height: 100%;" :lazy="true">
@@ -120,7 +147,7 @@
120
147
  </flow-inst-list>
121
148
  </el-tab-pane>
122
149
  <el-tab-pane name="rescinded" v-if="tabShow('rescinded')" :lazy="true">
123
- <span slot="label">
150
+ <span slot="label">
124
151
  <i v-if="tabTypeObj['showTabIcon']" :class="tabTypeObj['rescinded'].iconShow"></i>
125
152
  {{tabTypeObj['showtTabText']? tabTypeObj['rescinded'].tabName : ''}}
126
153
  <span style="color: red">({{numberObj['rescinded']}})</span>
@@ -145,7 +172,7 @@
145
172
  </flow-inst-list>
146
173
  </el-tab-pane>
147
174
  <el-tab-pane name="discontinue" v-if="tabShow('discontinue')" :lazy="true">
148
- <span slot="label">
175
+ <span slot="label">
149
176
  <i v-if="tabTypeObj['showTabIcon']" :class="tabTypeObj['discontinue'].iconShow"></i>
150
177
  {{tabTypeObj['showtTabText']? tabTypeObj['discontinue'].tabName : ''}}
151
178
  <span style="color: red">({{numberObj['discontinue']}})</span>
@@ -170,7 +197,7 @@
170
197
  </flow-inst-list>
171
198
  </el-tab-pane>
172
199
  <el-tab-pane name="flowQuery" v-if="tabShow('flowQuery')" :lazy="true">
173
- <span slot="label">
200
+ <span slot="label">
174
201
  <i v-if="tabTypeObj['showTabIcon']" :class="tabTypeObj['flowQuery'].iconShow"></i>
175
202
  {{tabTypeObj['showtTabText']? tabTypeObj['flowQuery'].tabName : ''}}
176
203
  </span>
@@ -195,6 +222,7 @@
195
222
  </flow-inst-list>
196
223
  </el-tab-pane>
197
224
  </el-tabs>
225
+ </div>
198
226
 
199
227
  <!--处理、修改、查看流程信息弹窗-->
200
228
  <el-dialog :close-on-click-modal=false top="5vh" width="90%" height="90%" :visible.sync="flowInstDataDialog" append-to-body
@@ -280,16 +308,17 @@
280
308
  </el-dialog>
281
309
 
282
310
  <!--新版批量处理信息弹窗-->
283
- <el-dialog title="批量处理" :close-on-click-modal=false top="5vh" width="90%" height="90%" :visible.sync="flowBatchSelectPendingDialog"
311
+ <el-dialog title="快捷处理" :close-on-click-modal=false top="5vh" width="90%" height="90%" :visible.sync="flowBatchSelectPendingDialog"
284
312
  @close="newBatchDealClose" class="batchSelectDialog" append-to-body>
285
313
  <flow-new-batch-deal v-if="flowBatchSelectPendingDialog" :formSearchObj="formSearchObj" ref="flowNewBatchDealRef"
286
314
  :formDataObj="formDataObj" :allNodeInfo="allNodeInfo" :newBatchDealSubmit="newBatchDealSubmit"
287
315
  @openCurrUpdateFlowForm="openCurrUpdateFlowForm" :isRefreshGetNextUsers="isRefreshGetNextUsers"
288
316
  :userMap="userMap" :fieldSysDataObj="fieldSysDataObj" :sysDataObj="sysDataObj" :formFieldObj="formFieldObj"
317
+ :currentPage="currentPage" :total="total" :pages="pages" @changePage="changePage"
289
318
  >
290
319
  </flow-new-batch-deal>
291
320
  <div slot="footer" class="dialog-footer">
292
- <el-button type="primary" size="small" @click="newBatchDealAllSubmit">全部提交</el-button>
321
+ <el-button type="primary" size="small" @click="newBatchDealAllSubmit">快速提交</el-button>
293
322
  <el-button size="small" @click="flowBatchSelectPendingDialog = false">取消</el-button>
294
323
  </div>
295
324
  </el-dialog>
@@ -415,7 +444,7 @@
415
444
  :visible.sync="flowChartObj.dialogVisible"
416
445
  width="90%" height="90%"
417
446
  top="5vh">
418
- <flow-chart :flow-id="flowId + ''" :inst-id="flowChartObj.instId + ''"
447
+ <flow-chart :flow-id="flowChartObj.flowId + ''" :inst-id="flowChartObj.instId + ''"
419
448
  :link-proc-id="flowChartObj.linkProcId + ''"
420
449
  :is-release="flowChartObj.isRelease"
421
450
  v-if="flowChartObj.dialogVisible"></flow-chart>
@@ -519,6 +548,7 @@
519
548
  loginUser: {},//当前登录用户
520
549
  userDept: {},//当前登录用户所在部门信息
521
550
  flowDefine: {},
551
+ flowDefineByFlowId: {},
522
552
  flowNodeIdToInfo: {},//key为id
523
553
  flowNodeNameObj:{}, //节点名称对应节点id分组
524
554
  draftNodeId:"", // 草稿节点id
@@ -880,8 +910,10 @@
880
910
  isShowAgentSet:false,//是否显示流程设置
881
911
  loadAgentSuccess:false,//是否显示流程设置
882
912
 
883
- startNodeKeyObj:{}, //当前开始节点 key 和对应版本号
884
- flowVersionNodeObj:{}, //版本号对应的节点对象
913
+ startNodeKeyObj: {}, //当前开始节点 key 和对应版本号
914
+ startNodeKeyObjByFlowId: {},
915
+ flowVersionNodeObj: {}, //版本号对应的节点对象
916
+ flowVersionNodeObjByFlowId: {},
885
917
  parentListViewId:"",
886
918
  parentTableViewId:"",
887
919
  scriptObj:{},
@@ -899,7 +931,8 @@
899
931
  taskNode: "",
900
932
  flowNewBatchDealArr: [],
901
933
  isNewSelectBatchDeal: false,
902
- loading: true
934
+ loading: true,
935
+ isInit: false
903
936
  },
904
937
  formDataObj: {},
905
938
  formNewBtnArr: [],
@@ -930,6 +963,10 @@
930
963
  isRefreshGetNextUsers: [], // 是否要刷新下一步处理人的字段,网关字段,表单,变量
931
964
  fieldSysDataObj: {},
932
965
  flowNewBatchDealDataIds: "",
966
+ currentPage: 1, //当前页
967
+ pages: 1, //总页数
968
+ total: 0, //总条数
969
+ pageSize: 50, //每页多少条
933
970
  }
934
971
  },
935
972
  watch:{
@@ -956,21 +993,28 @@
956
993
  this.isShowAgentSet = false;
957
994
  this.loginUser = this.FLOW_CACHE_GLOBAL.getLoginUser();
958
995
  this.userDept = this.FLOW_CACHE_GLOBAL.getLoginDept();
959
- this.initTabOpts(); // 初始化外部选项卡权限
960
-
961
- this.getFlowInfo().then(res => {
962
- this.initSuccess = true;
963
- this.initFlowObj();
964
- this.getFlowAgent(); //加载流程代理
965
- // this.initFieldSysData();
966
- });
967
- this.initTabNum();
968
- // this.initWorkStageTurnOn();
996
+
997
+ if (this.flowId.includes(",")) {
998
+ this.getMultiFlowInfo().then(() => {
999
+ this.initSuccess = true;
1000
+ this.getFlowAgent();
1001
+ });
1002
+ }else {
1003
+ this.initTabOpts(); // 初始化外部选项卡权限
1004
+ this.getFlowInfo().then(res => {
1005
+ this.initSuccess = true;
1006
+ this.initFlowObj();
1007
+ this.getFlowAgent(); //加载流程代理
1008
+ // this.initFieldSysData();
1009
+ });
1010
+ this.initTabNum();
1011
+ }
969
1012
  },
970
1013
  methods: {
971
1014
  // 新批量处理关闭弹框时数据重做的回调
972
1015
  newBatchDealClose() {
973
- Object.assign(this.formSearchObj, {isNewSelectBatchDeal: false});
1016
+ Object.assign(this.formSearchObj, {isNewSelectBatchDeal: false, taskNode: ""});
1017
+ this.currentPage = 1;
974
1018
  // let flowInstListVm = this.$refs["pendingRef"];
975
1019
  // if (flowInstListVm) {
976
1020
  // flowInstListVm.initFormDataByDataIds();
@@ -1080,6 +1124,12 @@
1080
1124
  initUpdateFlowForm(row) {
1081
1125
  this.currentRowData = row;
1082
1126
  this.currNodeName = 'noEnd';
1127
+ if (this.flowId.includes(',')) {
1128
+ this.flowDefine = this.flowDefineByFlowId[row.flowId];
1129
+ this.startNodeKeyObj = this.startNodeKeyObjByFlowId[row.flowId];
1130
+ this.flowVersionNodeObj = this.flowVersionNodeObjByFlowId[row.flowId];
1131
+ // Object.assign(this.formInfo, this.formInfoByFlowId[row.flowId]);
1132
+ }
1083
1133
 
1084
1134
  return new Promise(resolve => {
1085
1135
  let startNodeKey = this.startNodeKeyObj[row.version];
@@ -1106,12 +1156,17 @@
1106
1156
  openUpdateFlowForm(row,executePosition) {
1107
1157
  this.currentRowData = row;
1108
1158
  this.currNodeName = 'noEnd';
1159
+ let currentNodeObj1 = this.flowNodeIdToInfo[row.currentNode] ||{};
1160
+ let result = this.exeNewFlowEvent("editBefore",currentNodeObj1.nodeLinkId ||'');//新事件规则
1161
+ if(result === false && typeof result == "boolean"){
1162
+ return;
1163
+ }
1109
1164
  this.flowInstDataDialog = true;
1110
1165
  this.initUpdateFlowForm(row).then(() =>{
1111
1166
  this.$nextTick(() => {
1112
1167
  this.exeFlowEvent(executePosition,"afterClick",row.currentNode);
1113
1168
  let currentNodeObj = this.flowNodeIdToInfo[row.currentNode] ||{};
1114
- if(currentNodeObj.openEvent== '1'){ //开启事件
1169
+ if(currentNodeObj.openEvent === '1'){ //开启事件
1115
1170
  this.exeNewFlowEvent("editAfter",currentNodeObj.nodeLinkId ||'');//新事件规则
1116
1171
  }
1117
1172
  })
@@ -1179,7 +1234,8 @@
1179
1234
  Object.assign(this.formSearchObj, {
1180
1235
  flowNewBatchDealArr: [],
1181
1236
  isNewSelectBatchDeal: false,
1182
- loading:true
1237
+ loading: true,
1238
+ isInit: false
1183
1239
  });
1184
1240
  this.initFieldSysData();
1185
1241
  // 处理按钮渲染
@@ -1190,6 +1246,9 @@
1190
1246
  });
1191
1247
  this.formNewBtnArr = btnArr;
1192
1248
  this.initNewBatchDeal().then(arr => {
1249
+ Object.assign(this.formSearchObj, {
1250
+ isInit: true,
1251
+ });
1193
1252
  this.getFormDataByDataIds(this.formInfo.formId, this.flowNewBatchDealDataIds).then(res => {
1194
1253
  this.formDataObj = res || {};
1195
1254
  arr.forEach(flowInst => {
@@ -1234,7 +1293,7 @@
1234
1293
  Object.assign(this.formSearchObj, {
1235
1294
  flowNewBatchDealArr: arr,
1236
1295
  isNewSelectBatchDeal: true,
1237
- loading:false
1296
+ loading: false
1238
1297
  });
1239
1298
  });
1240
1299
  });
@@ -1246,12 +1305,17 @@
1246
1305
  return new Promise(resolve => {
1247
1306
  this.saspFlowAxios.post(this.api.plFlowInst.findInstPending, {
1248
1307
  flowId: this.flowDefine.id,
1249
- currentNode: "",
1308
+ currentNode: this.formSearchObj.taskNode,
1250
1309
  nodeType: "pending",
1251
1310
  dealUserId: this.loginUser.id,
1252
1311
  flowStatus: "1",
1253
- flowVar: "1"
1312
+ flowVar: "1",
1313
+ rows: this.pageSize,
1314
+ page: this.currentPage
1254
1315
  }).then(res => {
1316
+ // console.log('initNewBatchDeal', res);
1317
+ this.total = res.data.total;
1318
+ this.pages = res.data.pages;
1255
1319
  let flowNewBatchDeal = [];
1256
1320
  this.flowNewBatchDealDataIds = "";
1257
1321
  if (res.data && res.data.records.length > 0) {
@@ -1275,6 +1339,11 @@
1275
1339
  });
1276
1340
  },
1277
1341
 
1342
+ changePage(currPage) {
1343
+ this.currentPage = currPage;
1344
+ this.openNewBatchUpdateFlowForm();
1345
+ },
1346
+
1278
1347
  // 新批量处理当前行点击编辑按钮打开弹框回调事件
1279
1348
  openCurrUpdateFlowForm(row) {
1280
1349
  this.openUpdateFlowForm(row, "update");
@@ -1327,9 +1396,10 @@
1327
1396
  if (selectionArr.length === 0) {
1328
1397
  return this.$message.warning('请先勾选要提交的数据!');
1329
1398
  }
1399
+ // 判断是否选择了下一步处理人
1330
1400
  let str = "即将提交" + selectionArr.length + "条数据";
1331
1401
  if(submitType === "all"){
1332
- str = "即将全部提交(不包括正在loading加载的数据)";
1402
+ str = "即将提交当前显示内容(不包括正在加载的数据)";
1333
1403
  }
1334
1404
  this.$confirm(`${str}, 确认是否继续?`, '提示', {
1335
1405
  confirmButtonText: '确定',
@@ -1338,42 +1408,33 @@
1338
1408
  }).then(() => {
1339
1409
  let params = [];
1340
1410
  let instIds = "";
1411
+ let nextStepSelectionArr = [];
1341
1412
  selectionArr.forEach(selectionObj => {
1342
1413
  let paramsObj = {dataId: selectionObj.dataId};
1343
1414
  let updateParams = {};
1344
1415
  (selectionObj.settingInfo || []).forEach(item => {
1345
1416
  updateParams[item.field] = item.defaultValue;
1346
1417
  });
1347
- paramsObj["updateParams"] = updateParams;
1348
- params.push(paramsObj);
1349
- if (selectionObj.flowInstId) {
1350
- instIds += `,${selectionObj.flowInstId}`;
1418
+ if (Object.keys(updateParams).length > 0) {
1419
+ paramsObj["updateParams"] = updateParams;
1420
+ params.push(paramsObj);
1351
1421
  }
1352
- });
1353
- // console.log(this.flowDefine, this.allNodeInfo, '提交', selectionArr);
1354
- this.saveBatchDealFormData(this.formInfo.formId, JSON.stringify(params)).then(resData => {
1355
- if (resData.operateSuccess) {
1356
- // 更新工作流状态
1357
- this.saspFlowAxios.post(this.api.plFlowInst.batchUpdateFlowStatus, {
1358
- instIds: instIds.slice(1)
1359
- }).then(updateFlowStatusRes => {
1360
- let type = "error";
1361
- let message = updateFlowStatusRes.data.operateMessage;
1362
- if (updateFlowStatusRes && updateFlowStatusRes.data.operateSuccess) {
1363
- type = "success";
1364
- // 执行工作流下一步
1365
- this.newBatchExecuteNextStep(selectionArr);
1366
- let pendingRefVm = this.$refs["pendingRef"];
1367
- pendingRefVm && pendingRefVm.init();
1368
- this.flowBatchSelectPendingDialog = false;
1369
- }
1370
- this.$message({
1371
- type,
1372
- message
1373
- });
1374
- });
1422
+ let flag = selectionObj.flowInstId;
1423
+ if (flag || selectionObj.isEndNode) {
1424
+ instIds += `,${selectionObj.flowInstId}`;
1425
+ nextStepSelectionArr.push(selectionObj);
1375
1426
  }
1376
1427
  });
1428
+ // console.log(this.flowDefine, this.allNodeInfo, '提交', selectionArr, nextStepSelectionArr);
1429
+ if (params.length > 0) {
1430
+ this.saveBatchDealFormData(this.formInfo.formId, JSON.stringify(params)).then(resData => {
1431
+ if (resData.operateSuccess) {
1432
+ this.batchUpdateFlow(instIds, nextStepSelectionArr);
1433
+ }
1434
+ });
1435
+ }else {
1436
+ this.batchUpdateFlow(instIds, nextStepSelectionArr);
1437
+ }
1377
1438
  }).catch(() => {
1378
1439
  this.$message({
1379
1440
  type: 'info',
@@ -1382,6 +1443,35 @@
1382
1443
  });
1383
1444
  },
1384
1445
 
1446
+ batchUpdateFlow(instIds, nextStepSelectionArr) {
1447
+ if (!instIds) {
1448
+ return this.$message.warning("instIds不能为空!");
1449
+ }
1450
+ // 更新工作流状态
1451
+ this.saspFlowAxios.post(this.api.plFlowInst.batchUpdateFlowStatus, {
1452
+ instIds: instIds.slice(1)
1453
+ }).then(updateFlowStatusRes => {
1454
+ let type = "error";
1455
+ let message = updateFlowStatusRes.data.operateMessage;
1456
+ if (updateFlowStatusRes && updateFlowStatusRes.data.operateSuccess) {
1457
+ type = "success";
1458
+ // 执行工作流下一步
1459
+ this.newBatchExecuteNextStep(nextStepSelectionArr);
1460
+ // 提交完之后刷新页面,不关闭弹窗
1461
+ this.currentPage = 1;
1462
+ this.openNewBatchUpdateFlowForm();
1463
+
1464
+ let pendingRefVm = this.$refs["pendingRef"];
1465
+ pendingRefVm && pendingRefVm.init();
1466
+ // this.flowBatchSelectPendingDialog = false;
1467
+ }
1468
+ this.$message({
1469
+ type,
1470
+ message
1471
+ });
1472
+ });
1473
+ },
1474
+
1385
1475
  // 流程批量审批,全部提交
1386
1476
  newBatchDealAllSubmit() {
1387
1477
  let flowNewBatchDealVm = this.$refs.flowNewBatchDealRef;
@@ -1392,6 +1482,9 @@
1392
1482
  }
1393
1483
  });
1394
1484
  // console.log('全部提交', selectArr);
1485
+ if (selectArr.length === 0) {
1486
+ return this.$message.warning("暂无提交内容!");
1487
+ }
1395
1488
  this.newBatchDealSubmit(selectArr, "all");
1396
1489
  },
1397
1490
 
@@ -1400,24 +1493,38 @@
1400
1493
  arr.forEach(items => {
1401
1494
  let nextNodeObj = this.allNodeInfo[items.nextDealUsers.nextNodeId];
1402
1495
  let dealers = items.chooseNextUserId;
1496
+ if (Array.isArray(items.chooseNextUserId)) {
1497
+ dealers = items.chooseNextUserId.join(",");
1498
+ }
1403
1499
  let dealersObj = {};
1404
- dealersObj[nextNodeObj["nodeLinkId"]] = dealers;
1405
-
1500
+ dealersObj[(nextNodeObj || {})["nodeLinkId"]] = dealers;
1406
1501
  let nextStepBaseObj = {
1502
+ flowSaveSuccess: true,
1503
+ flowDataId: items.dataId,
1504
+ flowInstId: items.flowInstId,
1407
1505
  instId: items.flowInstId,
1408
1506
  dealers: dealers,
1409
1507
  // dealerNames: dealerNames,
1410
1508
  dealersObj: JSON.stringify(dealersObj),
1411
- nextNodeType: nextNodeObj.nodeType,
1412
- nextNodeId: nextNodeObj.id,
1413
- nextNodeKey: nextNodeObj.nodeLinkId,
1414
1509
  taskId: items.taskId,
1415
1510
  }
1511
+ let nextNode = {};
1512
+ if (nextNodeObj) {
1513
+ nextNode = {
1514
+ nextNodeType: nextNodeObj.nodeType,
1515
+ nextNodeId: nextNodeObj.id,
1516
+ nextNodeKey: nextNodeObj.nodeLinkId,
1517
+ }
1518
+ }
1519
+ let nowNodeObj = this.allNodeInfo[items.currentNode];
1520
+ if (nowNodeObj && nowNodeObj.dealType === 'multi') {
1521
+ this.$set(nextStepBaseObj, 'passCondition', nowNodeObj.passCondition);
1522
+ }
1416
1523
  // if(this.flowNextOperation) {
1417
1524
  // this.flowNextOperation(obj.instId, obj.dealers, obj.dealerNames, obj.taskId);
1418
1525
  // }
1419
1526
  let paramsSourceObj = {"SASP_FLOW_USE_VARIABLES": "yes"};
1420
- Object.assign(paramsSourceObj, {}, nextStepBaseObj);
1527
+ Object.assign(paramsSourceObj, nextStepBaseObj, nextNode);
1421
1528
  params.push(paramsSourceObj);
1422
1529
  });
1423
1530
  // console.log('params',params);
@@ -1526,18 +1633,20 @@
1526
1633
 
1527
1634
  /**
1528
1635
  * 打开流程图窗口
1529
- * @param instId 流程实例ID
1636
+ * @param row 流程实例ID
1530
1637
  */
1531
1638
  openFlowChart(row) {
1639
+ let flowId = "";
1532
1640
  let instId = "";
1533
1641
  let linkProcId = "";
1534
1642
  let isRelease = "";
1535
- if(row){
1643
+ if (row) {
1644
+ flowId = row.flowId;
1536
1645
  instId = row.flowInstId;
1537
1646
  linkProcId = row.linkProcId;
1538
1647
  isRelease = row.isRelease;
1539
1648
  }
1540
- this.flowChartObj = {instId: instId,linkProcId:linkProcId,isRelease:isRelease, dialogVisible: true};
1649
+ this.flowChartObj = {flowId: flowId,instId: instId,linkProcId:linkProcId,isRelease:isRelease, dialogVisible: true};
1541
1650
  },
1542
1651
 
1543
1652
  /**
@@ -1545,10 +1654,11 @@
1545
1654
  * @param row 流程行数据
1546
1655
  */
1547
1656
  openFlowRecord(row) {
1548
- let arr = ["2","3","4"]; // 旧版本的已办结已撤销以及已中止数据通过旧版接口查询流转记录
1549
- if(arr.indexOf(row.flowStatus) > -1 && row.isOldData == "1"){
1657
+ console.log('流转记录',row);
1658
+ let arr = ["2", "3", "4"]; // 旧版本的已办结已撤销以及已中止数据通过旧版接口查询流转记录
1659
+ if (arr.indexOf(row.flowStatus) > -1 && row.isOldData === "1") {
1550
1660
  this.flowRecordObj = {instId: row.flowInstId || "", oldDialogVisible: true};
1551
- }else{
1661
+ } else {
1552
1662
  this.flowRecordObj = {instId: row.flowInstId || "", dialogVisible: true};
1553
1663
  }
1554
1664
  },
@@ -1804,7 +1914,20 @@
1804
1914
  this.$set(obj,'passCondition',this.nowNode.passCondition)
1805
1915
  }
1806
1916
  let params = {"SASP_FLOW_USE_VARIABLES":"yes"};
1807
- Object.assign(params,flowParams || {},obj);
1917
+ // Object.assign(params,flowParams || {},obj);
1918
+ Object.assign(params,obj);
1919
+ let allParamKeys = Object.keys(flowParams || {});
1920
+ allParamKeys.forEach(templateKey => {
1921
+ if(this.isRefreshGetNextUsers.indexOf(templateKey) > -1){
1922
+ params[templateKey] = flowParams[templateKey];
1923
+ if(allParamKeys.indexOf(templateKey + "_SASP_SYS_DATA") > -1){
1924
+ params[templateKey + "_SASP_SYS_DATA"] = flowParams[templateKey + "_SASP_SYS_DATA"];
1925
+ }
1926
+ if(allParamKeys.indexOf(templateKey + "_SASP_SYS_DATA_ID") > -1){
1927
+ params[templateKey + "_SASP_SYS_DATA_ID"] = flowParams[templateKey + "_SASP_SYS_DATA_ID"];
1928
+ }
1929
+ }
1930
+ })
1808
1931
  this.saspFlowAxios.post(this.api.plFlowInst.getNextUsers, params).then(res => {
1809
1932
  if(!res.data.operateSuccess){
1810
1933
  this.isDisabled['nextStep'] = true;
@@ -1923,6 +2046,9 @@
1923
2046
  this.chooseNextUserId = userInfo.id;
1924
2047
  this.chooseNextUserName = userInfo.userName;
1925
2048
  }
2049
+ if(this.nextNode.dealType === "multi" && this.nextSteptUserArr.length === 1){
2050
+ this.chooseNextUserId = [userInfo.id];
2051
+ }
1926
2052
  }
1927
2053
  });
1928
2054
  });
@@ -2725,7 +2851,7 @@
2725
2851
  this.$forceUpdate();
2726
2852
  }
2727
2853
  // 加载工作流脚本与工作流事件规则
2728
- this.initFlowScript().then(() => {
2854
+ this.initFlowScript(this.flowData.flowId).then(() => {
2729
2855
  resolve(true);
2730
2856
  })
2731
2857
  });
@@ -2738,14 +2864,84 @@
2738
2864
  });
2739
2865
  },
2740
2866
 
2867
+ getMultiFlowInfo() {
2868
+ return new Promise(resolve => {
2869
+ let flowIdArr = this.flowId.split(",").filter(item => item);
2870
+ flowIdArr.forEach(flowId => {
2871
+ this.FLOW_GLOBAL.getFlowDefineById(flowId).then(flowDefine => {
2872
+ this.flowDefineByFlowId[flowId] = flowDefine;
2873
+ });
2874
+ });
2875
+
2876
+ const initFlowNodeFunc = flowIdArr.map(flowId => (() => this.FLOW_GLOBAL.getFlowNodesByFlowId(flowId)));
2877
+ Promise.all(initFlowNodeFunc.map(func => func())).then(allFlowNodeArr => {
2878
+ //工作流节点
2879
+ this.startNodeKey = "Activity_draft";
2880
+ for (const allFlowNode of allFlowNodeArr) {
2881
+ this.startNodeKeyObj = {};
2882
+ this.flowVersionNodeObj = {};
2883
+ (allFlowNode || []).forEach(item => {
2884
+ if (item.nodeLinkId.indexOf("Activity_draft") > -1) {
2885
+ this.startNodeKey = item.nodeLinkId;
2886
+ this.startNodeKeyObj[item.version] = item.nodeLinkId; //开始节点对应版本号
2887
+ }
2888
+ if (!this.flowVersionNodeObj[item.version]) {
2889
+ this.$set(this.flowVersionNodeObj, item.version, {});
2890
+ }
2891
+ this.$set(this.flowVersionNodeObj[item.version], item.nodeLinkId, item); //版本节点对象
2892
+
2893
+ this.allNodeInfo[item.id] = item;
2894
+ this.flowNodeIdToInfo[item.id] = item;
2895
+ let nodeArr = ['StartEvent', 'ParallelGateway', 'SequenceFlow', 'ExclusiveGateway', 'InclusiveGateway'];
2896
+ if (item.nodeType && nodeArr.indexOf(item.nodeType) === -1) {
2897
+ if (!this.flowNodeNameObj[item.nodeLinkId]) {
2898
+ this.$set(this.flowNodeNameObj, item.nodeLinkId, item.nodeName);
2899
+ } else {
2900
+ if (this.flowNodeNameObj[item.nodeLinkId] !== item.nodeName) {
2901
+ this.flowNodeNameObj[item.nodeLinkId] = this.flowNodeNameObj[item.nodeLinkId] + "," + item.nodeName;
2902
+ }
2903
+ }
2904
+ }
2905
+ if (item.nodeType === "UserTask" && (item.nodeLinkId || "").indexOf("Activity_draft") > -1) {
2906
+ this.draftNodeId = item.id; // 草稿节点id
2907
+ }
2908
+ // 行按钮
2909
+ let listButton = JSON.parse(item.listButton || "[]") || [];
2910
+ listButton.forEach(button => {
2911
+ button.showName = button.showName ? button.showName : this.listButtonObj[button.type];
2912
+ });
2913
+ this.nodeListButtonObj[item.id] = listButton;
2914
+
2915
+ // 表单按钮
2916
+ let formButton = JSON.parse(item.formButton || "[]") || [];
2917
+ formButton.forEach(button => {
2918
+ button.showName = button.showName ? button.showName : this.formButtonObj[button.type];
2919
+ });
2920
+
2921
+ this.nodeFormButtonObj[item.id] = this.sortButtonArr(formButton);
2922
+ this.nodeFormBtnObj[item.id] = this.formatterFormButton(formButton);
2923
+ });
2924
+ let flowId = allFlowNode[0].flowId;
2925
+ this.$set(this.startNodeKeyObjByFlowId, flowId, this.startNodeKeyObj);
2926
+ this.$set(this.flowVersionNodeObjByFlowId, flowId, this.flowVersionNodeObj);
2927
+ // 加载工作流脚本与工作流事件规则
2928
+ this.flowDefine = this.flowDefineByFlowId[flowId];
2929
+ this.initFlowScript(flowId).then(() => {
2930
+ resolve(true);
2931
+ });
2932
+ }
2933
+ });
2934
+ });
2935
+ },
2936
+
2741
2937
  /**
2742
2938
  * 加载工作流脚本与工作流事件规则
2743
2939
  */
2744
- initFlowScript(){
2940
+ initFlowScript(flowId){
2745
2941
  return new Promise(resolve => {
2746
2942
  this.saspFlowAxios.all([
2747
- this.saspFlowAxios.post(this.api.plFlowScript.find,{"flowId":this.flowData.flowId}),
2748
- this.saspFlowAxios.post(this.api.plFlowEventDetail.findByFlowAndLeadFunc,{"flowId":this.flowData.flowId,"version":this.flowDefine.flowVersion||"1.0"})
2943
+ this.saspFlowAxios.post(this.api.plFlowScript.find,{"flowId": flowId}),
2944
+ this.saspFlowAxios.post(this.api.plFlowEventDetail.findByFlowAndLeadFunc,{"flowId": flowId,"version":this.flowDefine.flowVersion || "1.0"})
2749
2945
  ]).then(this.saspFlowAxios.spread((resScript, resEvent) => {
2750
2946
  // 流程脚本
2751
2947
  if(resScript){
@@ -3044,7 +3240,7 @@
3044
3240
  // let CTX = window.JAVA_URL;
3045
3241
  let CTX = "";
3046
3242
  let paramValues = [this,this.saspFlowAxios,CTX,formData,this.loginUser,AjaxUtil,this.nextNode]; // 入参
3047
- if(executeType == "addAfter" || executeType == "editAfter"){ //新增或者修改后
3243
+ if(executeType == "addAfter"){ //新增或后
3048
3244
  (this.newScriptObj[executeType] || []).forEach(event => {
3049
3245
  event && event(...paramValues); // 执行事件
3050
3246
  });
@@ -3084,7 +3280,7 @@
3084
3280
  }
3085
3281
  });
3086
3282
  }catch (e) {
3087
- console.log(e);
3283
+ // console.log(e);
3088
3284
  result=false;
3089
3285
  }
3090
3286
 
@@ -1,23 +1,27 @@
1
1
  <template>
2
2
  <el-container style="height: 100%">
3
3
  <el-header style="height: auto">
4
- <el-form inline size="small" class="search-form-parent el-card" style="flex-shrink: 0">
4
+ <el-form inline size="small" class="search-form-parent el-card">
5
5
  <el-form-item label="任务节点筛选">
6
6
  <el-select v-model="formSearchObj.taskNode" style="width: 97%;"
7
7
  clearable filterable @change="taskNodeChange">
8
8
  <el-option v-for="item in taskNodeArr" :key="item.currentNode"
9
9
  :label="item.currentNodeName"
10
- :value="item.currentNode">
10
+ :value="item.nodeKey">
11
11
  </el-option>
12
12
  </el-select>
13
13
  </el-form-item>
14
+ <el-form-item>
15
+ <el-button type="primary" icon="el-icon-search" @click="doSearch()">查询</el-button>
16
+ <el-button icon="el-icon-close" @click="clearSearch()">清空</el-button>
17
+ </el-form-item>
14
18
  </el-form>
15
19
  </el-header>
16
20
  <el-main style="padding-top: 10px;padding-bottom: 0">
17
21
  <div style="margin-bottom: 10px;">
18
22
  <el-button type="primary" size="small" @click="partSubmit">提交</el-button>
19
23
  </div>
20
- <el-form size="small" style="height: calc(100% - 42px)">
24
+ <el-form size="small" style="height: calc(100% - 42px);position: relative">
21
25
  <el-table
22
26
  v-loading="formSearchObj.loading"
23
27
  element-loading-text="正在加载,请稍等..."
@@ -196,6 +200,15 @@
196
200
  </el-table>
197
201
  </el-form>
198
202
  </el-main>
203
+ <el-footer style="height: auto;text-align: right;padding-top: 15px;margin-bottom: -7px" v-show="isShowPage">
204
+ <el-button-group>
205
+ <el-button size="small" icon="el-icon-arrow-left" :disabled="prevDisabled" @click="prevClick">上一页</el-button>
206
+ <el-button size="small" :disabled="nextDisabled" @click="nextClick">下一页<i class="el-icon-arrow-right el-icon--right"></i></el-button>
207
+ </el-button-group>
208
+ <div style="display: inline-block;vertical-align: middle">
209
+ <span style="padding-left: 10px">第{{ currentPage }}页,</span><span>共{{ total }}条</span>
210
+ </div>
211
+ </el-footer>
199
212
  </el-container>
200
213
  </template>
201
214
 
@@ -212,6 +225,9 @@ export default {
212
225
  fieldSysDataObj: {type: Object, default: () => ({})},
213
226
  sysDataObj: {type: Object, default: () => ({})},
214
227
  formFieldObj: {type: Object, default: () => ({})},
228
+ currentPage: {type: Number, default: 1},
229
+ pages: {type: Number, default: 1},
230
+ total: {type: Number, default: 0},
215
231
  },
216
232
  data() {
217
233
  return {
@@ -220,6 +236,9 @@ export default {
220
236
  shLabelWidth: "100px",
221
237
  taskNodeArr: [],
222
238
  taskNodeClickNum: 0,
239
+ prevDisabled: true,
240
+ nextDisabled: true,
241
+ isShowPage: false,
223
242
  // dateTypeObj: {
224
243
  // "yyyy-MM-dd HH:mm:ss": {category: "date",type: "datetime", value: "yyyy-MM-dd HH:mm:ss", label: "年-月-日 时:分:秒"},
225
244
  // "yyyy-MM-dd": {category: "date",type: "date", value: "yyyy-MM-dd", label: "年-月-日"},
@@ -240,11 +259,31 @@ export default {
240
259
  if(!this.formSearchObj.loading){ // 等到列表数据加载完毕后,即loading消失后初始化数据
241
260
  let flowNewBatchDealArr = JSON.parse(JSON.stringify(this.formSearchObj.flowNewBatchDealArr));
242
261
  flowNewBatchDealArr.forEach(item => {
243
- let obj = {currentNode: item.currentNode, currentNodeName: item.currentNodeName};
262
+ let obj = {currentNode: item.currentNode, currentNodeName: item.currentNodeName, nodeKey: item.nodeKey};
244
263
  !this.taskNodeArr.some(taskNodeObj => taskNodeObj.currentNode === obj.currentNode) && this.taskNodeArr.push(obj);
245
264
  });
246
265
  this.initFlowBatchDeal(this.formSearchObj.flowNewBatchDealArr);
247
266
  }
267
+ },
268
+ 'formSearchObj.isInit'() {
269
+ if (this.formSearchObj.isInit) {
270
+ // console.log(this.currentPage,this.pages);
271
+ // 判断是否要分页
272
+ if (this.pages <= 1) {
273
+ this.isShowPage = false;
274
+ return;
275
+ }
276
+ this.isShowPage = true;
277
+
278
+ this.prevDisabled = false;
279
+ this.nextDisabled = false;
280
+ if (this.currentPage === 1) {
281
+ this.prevDisabled = true;
282
+ }
283
+ if (this.currentPage >= this.pages) {
284
+ this.nextDisabled = true;
285
+ }
286
+ }
248
287
  }
249
288
  },
250
289
  methods: {
@@ -299,11 +338,16 @@ export default {
299
338
  this.saspFlowAxios.post(this.api.plFlowInst.getNextUsers, paramsMap).then(res => {
300
339
  // console.log('getNextUsers-request' + index, res);
301
340
  if (res.data.operateSuccess) {
341
+ let operateObj = res.data.operateObj || {nextNodeName: "", userArr: []};
342
+
302
343
  let operateMap = JSON.parse(JSON.stringify(res.data.operateMap));
303
- if (operateMap && operateMap.isPassCondition === 0) {
344
+ if (operateMap && operateMap.isPassCondition === 0 && !operateObj.nextNodeName) {
304
345
  Object.assign(operateMap, {nextNodeName: "会签中...等待其他人处理完毕"});
346
+ }else {
347
+ if (operateMap && operateMap.hasOwnProperty('isPassCondition')) {
348
+ delete operateMap.isPassCondition;
349
+ }
305
350
  }
306
- let operateObj = res.data.operateObj || {nextNodeName: "", userArr: []};
307
351
  //获取下一个节点信息
308
352
  let nextNodeObj = this.allNodeInfo[operateObj.nextNodeId] || {};
309
353
  operateObj["multiChooseUser"] = nextNodeObj.dealType === "multi";
@@ -317,6 +361,7 @@ export default {
317
361
  }
318
362
  } else if (nextNodeObj.nodeType === "EndEvent") {
319
363
  isEndNode = true;
364
+ operateObj.nextNodeName = nextNodeObj.nodeName || "结束";
320
365
  }
321
366
  let userArr = operateObj.userArr || [];
322
367
  if (userArr.length > 0) {
@@ -344,6 +389,15 @@ export default {
344
389
  });
345
390
  },
346
391
 
392
+ doSearch() {
393
+ this.$emit("changePage", 1);
394
+ },
395
+
396
+ clearSearch() {
397
+ this.$set(this.formSearchObj, "taskNode", "");
398
+ this.$emit("changePage", 1);
399
+ },
400
+
347
401
  // 选择提交
348
402
  partSubmit() {
349
403
  this.newBatchDealSubmit(this.multipleSelection);
@@ -395,46 +449,62 @@ export default {
395
449
  // console.log('是否禁用勾选', row, index);
396
450
  let flag = true;
397
451
  flag = (row.nextDealUsers.userArr || []).length > 0;
398
- return !row.isLoading && flag;
452
+ return !row.isLoading;
453
+ // return (!row.isLoading && flag) || row.isEndNode;
399
454
  },
400
455
 
401
456
  taskNodeChange(val) {
402
- if (!this.taskNodeClickNum) {
403
- this.backNewBatchDealArr = JSON.parse(JSON.stringify(this.formSearchObj.flowNewBatchDealArr));
404
- this.taskNodeClickNum++;
405
- }
406
- let arr = [];
407
- if (val) {
408
- arr = this.backNewBatchDealArr.filter(item => item.currentNode === val);
409
- }else {
410
- arr = this.backNewBatchDealArr;
411
- }
412
- this.$set(this.formSearchObj, "flowNewBatchDealArr", arr);
457
+ // if (!this.taskNodeClickNum) {
458
+ // this.backNewBatchDealArr = JSON.parse(JSON.stringify(this.formSearchObj.flowNewBatchDealArr));
459
+ // this.taskNodeClickNum++;
460
+ // }
461
+ // let arr = [];
462
+ // if (val) {
463
+ // arr = this.backNewBatchDealArr.filter(item => item.currentNode === val);
464
+ // }else {
465
+ // arr = this.backNewBatchDealArr;
466
+ // }
467
+ // this.$set(this.formSearchObj, "flowNewBatchDealArr", arr);
468
+ },
469
+
470
+ // 上一页事件
471
+ prevClick() {
472
+ this.$emit("changePage", this.currentPage - 1);
473
+ },
474
+
475
+ nextClick() {
476
+ this.$emit("changePage", this.currentPage + 1);
413
477
  },
414
478
  }
415
479
  }
416
480
  </script>
417
481
 
418
482
  <style scoped>
419
- .el-form .el-form-item {
483
+ .el-form > .el-table .el-form-item {
420
484
  margin-bottom: 0;
421
485
  }
422
486
 
423
487
  .el-table::v-deep {
424
488
  tr > td.checkInfo .cell {
425
- display: flex;
489
+ //display: flex;
490
+ position: relative;
426
491
 
427
492
  .sh-left-box {
428
493
  //width: 255px;
429
- flex-grow: 1;
494
+ //flex-grow: 1;
495
+ padding-left: 16px;
496
+ padding-right: 16px;
430
497
  }
431
498
 
432
499
  .sh-right-box {
433
- flex-shrink: 0;
434
- width: 80px;
500
+ position: absolute;
501
+ top: 0;
502
+ right: 0;
503
+ //flex-shrink: 0;
504
+ //width: 80px;
435
505
  font-size: 26px;
436
506
  text-align: right;
437
- margin-left: 20px;
507
+ //margin-left: 20px;
438
508
 
439
509
  .icon-edit {
440
510
  color: #cccccc;
@@ -478,7 +548,8 @@ export default {
478
548
  user-select: none;
479
549
 
480
550
  &.isEndNode {
481
- color: #FABDBD;
551
+ //color: #FABDBD;
552
+ color: #ffafaf;
482
553
  }
483
554
  }
484
555
  }