sasp-flow-render 1.1.3 → 1.1.5

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 CHANGED
@@ -45,6 +45,12 @@ let components = [
45
45
  ];
46
46
 
47
47
  let createAxiosIfNotExists = (Vue,props) => {
48
+ if((props || {}).axios){
49
+ Vue.prototype.saspFlowAxios = props.axios;
50
+ (props || {}).saspFlowAxios = props.axios;
51
+ return;
52
+ }
53
+
48
54
  let newAxios = axios.create({
49
55
  baseURL:window.FLOW_RENDER_URL,
50
56
  headers: {
@@ -70,13 +76,14 @@ let createAxiosIfNotExists = (Vue,props) => {
70
76
  */
71
77
  let initAxios = (Vue, props) => {
72
78
  let axios = (props || {}).saspFlowAxios;
79
+
73
80
  // 添加请求拦截器
74
81
  axios.interceptors.request.use(function (config) {
75
82
  // if ((config.headers["Content-Type"] != 'multipart/form-data') && isAxiosFormData((config.url))) {
76
83
  if (config.headers["Content-Type"] != 'multipart/form-data') {
77
84
  config = Object.assign({}, config);
78
85
  config.headers = Object.assign({}, config.headers || {}, {
79
- // "Is-Sasp-Qs": true,
86
+ "Is-Sasp-Qs": true,
80
87
  "Content-Type": "application/x-www-form-urlencoded"
81
88
  });
82
89
  }
@@ -94,15 +101,20 @@ let initAxios = (Vue, props) => {
94
101
  });
95
102
  axios.defaults.transformRequest = axios.defaults.transformRequest || [];
96
103
  axios.defaults.transformRequest.push(
97
- function (data) {
98
- if (data && typeof data === "string") { // 本项目的所有请求都通过qs转换实现
99
- try {
100
- data = JSON.parse(data);
101
- } catch (e) {
102
- console.error(e);
104
+ function (data,config) {
105
+ if (config["Is-Sasp-Qs"]) {
106
+ delete config["Is-Sasp-Qs"];
107
+ if (data && typeof data === "string") { // 本项目的所有请求都通过qs转换实现
108
+ try {
109
+ data = JSON.parse(data);
110
+ } catch (e) {
111
+ console.error(e);
112
+ }
103
113
  }
114
+ return qs.stringify(data);
115
+ }else{
116
+ return data;
104
117
  }
105
- return qs.stringify(data);
106
118
  }
107
119
  );
108
120
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sasp-flow-render",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "业务应用支撑平台-智慧流程渲染组件",
5
5
  "scripts": {
6
6
  "build": "vue-cli-service build"
@@ -93,6 +93,12 @@ let objResult = {
93
93
  listNoPageByResult:"/flowInstNodeResultController/listNoPageByResult",
94
94
  },
95
95
 
96
+ //流程节点批量处理配置
97
+ plFlowNodeExtend: {
98
+ find: "/plFlowNodeExtendController/find",
99
+ getById: "/plFlowNodeExtendController/getById",
100
+ },
101
+
96
102
  plFlowInst:{
97
103
  url:"/plFlowInstController",
98
104
  queryFormData:"/plFlowInstController/queryFormData",
@@ -146,7 +152,9 @@ let objResult = {
146
152
  changeDealer:"/plFlowInstController/changeDealer", // 切换当前任务处理人
147
153
  forceEnd:"/plFlowInstController/forceEnd", // 强制办结
148
154
  recoverExceptionFlow:"/plFlowInstController/recoverExceptionFlow", // 恢复异常流程
149
- reStartFlow:"/plFlowInstController/reStartFlow" //重启办结状态下的流程
155
+ reStartFlow:"/plFlowInstController/reStartFlow", //重启办结状态下的流程
156
+ batchUpdateFlowStatus:"/plFlowInstController/batchUpdateFlowStatus", //新版流程批量处理的批量修改流程状态
157
+ batchExecuteNextStep:"/plFlowInstController/batchExecuteNextStep", //新版流程批量处理的批量执行下一步
150
158
  },
151
159
 
152
160
  plFlowSetting:{
@@ -183,6 +191,10 @@ let objResult = {
183
191
  login: "/flowLoginController/login",
184
192
  logout: "/flowLoginController/logout",
185
193
  },
194
+ loginInnovateMethod:{
195
+ login: "/loginController/login",
196
+ logout: "/loginController/logout",
197
+ },
186
198
  plFlowDomain:{
187
199
  url:"/plFlowDomainController",
188
200
  find:"/plFlowDomainController/find",
@@ -82,6 +82,9 @@
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')"
86
+ @click="openFlowBatchPendingDialogNew">快捷处理
87
+ </el-button>
85
88
  </el-header>
86
89
  <el-main style="height: 100%;padding: 0;" class="main-box">
87
90
  <el-table :data="crud.dataStore.records" :ref="crud.tableRef" @sort-change="flowSortChange"
@@ -140,26 +143,22 @@
140
143
  :key="buttonObj.type" size="small" type="primary"
141
144
  v-if="judgeListButton(tabType,buttonObj.type)"
142
145
  @click="listButtonOpt(buttonObj.type,scope.row)"
143
- :icon="buttonIcon[buttonObj.type]" :type="buttonType[buttonObj.type]">
144
- {{buttonObj.showName}}
146
+ :icon="buttonIcon[buttonObj.type]" :type="buttonType[buttonObj.type]">{{buttonObj.showName}}
145
147
  </el-button>
146
148
  </template>
147
149
  <template v-else>
148
150
  <el-button size="small"
149
151
  @click="listButtonOpt('view',scope.row)"
150
- icon="el-icon-view" type="primary">
151
- 查看
152
+ icon="el-icon-view" type="primary">查看
152
153
  </el-button>
153
154
  <el-button size="small"
154
155
  @click="listButtonOpt('flowRecord',scope.row)"
155
- icon="saspiconfont pl-icon-liuchengtu" type="primary">
156
- 流转记录
156
+ icon="saspiconfont pl-icon-liuchengtu" type="primary">流转记录
157
157
  </el-button>
158
158
  </template>
159
159
  <el-button size="small" v-if="scope.row.linkProcId && scope.row.nodeKey == startNodeKeyObj[scope.row.version]"
160
160
  @click="deleteRowFlow(scope.row)"
161
- icon="el-icon-delete" type="danger">
162
- 删除
161
+ icon="el-icon-delete" type="danger">删除
163
162
  </el-button>
164
163
  </template>
165
164
  </el-table-column>
@@ -358,6 +357,13 @@
358
357
  }
359
358
  },
360
359
 
360
+ // 打开新的批量修改窗口回调函数
361
+ openNewBatchUpdateFlowForm: {
362
+ type: Function, default() {
363
+
364
+ }
365
+ },
366
+
361
367
  // 打开查看窗口回调函数
362
368
  openViewFlowForm: {
363
369
  type: Function, default() {
@@ -389,6 +395,7 @@
389
395
  formImpMethod: {type: Function, default(){}},
390
396
  flowImpParamObj: {type: Object, default: () => ({})},
391
397
  downloadTemplate: {type: Function, default: null},
398
+ getFormDataByDataIds: {type: Function, default: null},
392
399
  },
393
400
  data() {
394
401
 
@@ -500,13 +507,14 @@
500
507
  formSettingVisible: false,
501
508
  flowSortOrder: "",
502
509
  flowAboutFileList: [],
510
+ flowNewBatchDealDataIds: "",
503
511
  }
504
512
  },
505
513
  created() {
506
514
  this.init();
507
515
  this.getListButton();
508
516
  this.initWorkStageTurnOn();
509
- if (this.showModel == "card") {
517
+ if (this.showModel === "card") {
510
518
  this.checkScreenWidth();
511
519
  window.addEventListener('resize', () => { //监听浏览器窗口大小改变
512
520
  //浏览器变化执行动作
@@ -514,8 +522,7 @@
514
522
  });
515
523
  }
516
524
  },
517
- mounted() {
518
- },
525
+ mounted() {},
519
526
  methods: {
520
527
  initWorkStageTurnOn(){
521
528
  this.workTurnOn = WORK_GLOBAL.getTurnOn(this.switchOnline,this.listViewId);
@@ -579,9 +586,20 @@
579
586
  }
580
587
  this.$set(this.crud.searchForm, 'flowStatus', flowStatus);
581
588
  this.crud.search();
582
-
583
589
  },
584
590
 
591
+ // initNewBatchDealFunc() {
592
+ // this.initNewBatchDeal().then(() => {
593
+ // this.initFormDataByDataIds();
594
+ // });
595
+ // },
596
+
597
+ // initFormDataByDataIds() {
598
+ // this.getFormDataByDataIds(this.formId, this.flowNewBatchDealDataIds).then(res => {
599
+ // this.$emit('setDataValue', "formDataObj", res);
600
+ // });
601
+ // },
602
+
585
603
  /**
586
604
  * 列表操作按钮显示
587
605
  */
@@ -755,7 +773,7 @@
755
773
  this.crud.searchForm.flowSortOrder = "";
756
774
  }
757
775
  this.$emit("initTabNum");
758
- if (type == "noMessage") {
776
+ if (type === "noMessage") {
759
777
  this.crud.search();
760
778
  } else {
761
779
  this.crud.doSearch();
@@ -848,7 +866,7 @@
848
866
  * 打开批量处理页面方法
849
867
  */
850
868
  async openFlowBatchPendingDialog() {
851
- if (this.crud.dataStore.records.length == 0) {
869
+ if (this.crud.dataStore.records.length === 0) {
852
870
  this.$message({
853
871
  showClose: true,
854
872
  message: '当前没有可处理的流程'
@@ -856,7 +874,12 @@
856
874
  } else {
857
875
  this.openBatchUpdateFlowForm(this.crud.dataStore.records);
858
876
  }
859
-
877
+ },
878
+ /**
879
+ * 快捷处理
880
+ */
881
+ openFlowBatchPendingDialogNew(){
882
+ this.openNewBatchUpdateFlowForm();
860
883
  },
861
884
 
862
885
  /**
@@ -39,10 +39,10 @@
39
39
  </flow-inst-list>
40
40
  </el-tab-pane>
41
41
  <el-tab-pane name="pending" v-if="tabShow('pending')" style="height: 100%;">
42
- <span slot="label">
43
- <i v-if="tabTypeObj['showTabIcon']" :class="tabTypeObj['pending'].iconShow"></i>
44
- {{tabTypeObj['showtTabText']? tabTypeObj['pending'].tabName : ''}}
45
- <span style="color: red">({{numberObj['pending']}})</span>
42
+ <span slot="label">
43
+ <i v-if="tabTypeObj['showTabIcon']" :class="tabTypeObj['pending'].iconShow"></i>
44
+ {{ tabTypeObj['showtTabText'] ? tabTypeObj['pending'].tabName : '' }}
45
+ <span style="color: red">({{ numberObj['pending'] }})</span>
46
46
  </span>
47
47
  <flow-inst-list ref="pendingRef"
48
48
  tab-type="pending"
@@ -58,11 +58,13 @@
58
58
  :start-node-key-obj="startNodeKeyObj"
59
59
  :flow-version-node-obj="flowVersionNodeObj"
60
60
  @initTabNum="initTabNum"
61
-
61
+ :getFormDataByDataIds="getFormDataByDataIds"
62
62
  :open-flow-chart="openFlowChart"
63
63
  :open-flow-record="openFlowRecord"
64
64
  :open-update-flow-form="openUpdateFlowForm"
65
65
  :open-batch-update-flow-form="openBatchUpdateFlowForm"
66
+ :openNewBatchUpdateFlowForm="openNewBatchUpdateFlowForm"
67
+ @setDataValue="setDataValue"
66
68
  >
67
69
  </flow-inst-list>
68
70
  </el-tab-pane>
@@ -220,7 +222,7 @@
220
222
  <!-- </table-form-render>-->
221
223
 
222
224
  <div slot="footer" style="height:31px;" class="dialog-footer">
223
- <div>
225
+ <div v-if="!formSearchObj.isNewSelectBatchDeal">
224
226
  <el-button v-for="btn in formBtnArr" @click="btn.method" :disabled="isDisabled[btn.btnType]?false:true"
225
227
  v-show="btn.show && ((formInfo.opt != 'view') || (formInfo.opt=='view' && btn.isView))"
226
228
  :key="btn.btnType"
@@ -230,6 +232,14 @@
230
232
  {{btn.text}}
231
233
  </el-button>
232
234
  </div>
235
+ <div v-else>
236
+ <el-button v-for="btn in formNewBtnArr" @click="btn.method"
237
+ :key="btn.btnType"
238
+ :type="btn.type"
239
+ :icon="btn.icon"
240
+ size="small">{{btn.text}}
241
+ </el-button>
242
+ </div>
233
243
  </div>
234
244
  </el-dialog>
235
245
 
@@ -269,7 +279,22 @@
269
279
  </div>
270
280
  </el-dialog>
271
281
 
282
+ <!--新版批量处理信息弹窗-->
283
+ <el-dialog title="批量处理" :close-on-click-modal=false top="5vh" width="90%" height="90%" :visible.sync="flowBatchSelectPendingDialog"
284
+ @close="newBatchDealClose" class="batchSelectDialog" append-to-body>
285
+ <flow-new-batch-deal v-if="flowBatchSelectPendingDialog" :formSearchObj="formSearchObj" ref="flowNewBatchDealRef"
286
+ :formDataObj="formDataObj" :allNodeInfo="allNodeInfo" :newBatchDealSubmit="newBatchDealSubmit"
287
+ @openCurrUpdateFlowForm="openCurrUpdateFlowForm" :isRefreshGetNextUsers="isRefreshGetNextUsers"
288
+ :userMap="userMap" :fieldSysDataObj="fieldSysDataObj" :sysDataObj="sysDataObj" :formFieldObj="formFieldObj"
289
+ >
290
+ </flow-new-batch-deal>
291
+ <div slot="footer" class="dialog-footer">
292
+ <el-button type="primary" size="small" @click="newBatchDealAllSubmit">全部提交</el-button>
293
+ <el-button size="small" @click="flowBatchSelectPendingDialog = false">取消</el-button>
294
+ </div>
295
+ </el-dialog>
272
296
 
297
+ <!--流程下一步处理人选择弹窗-->
273
298
  <el-dialog :close-on-click-modal=false :title="'下一步' + (nextNodeName ? (isProceedNext?' -> ' + nextNodeName:'->等待他人处理') : '')"
274
299
  :top="nextNode.nextType != 'inclusiveGateway' ? '20vh': '10vh'" append-to-body
275
300
  width="500px" :visible.sync="nextSteptUserDialog" @closed="closeNextSteptUserDialog">
@@ -446,18 +471,17 @@
446
471
  import FlowInstList from "./flowInstList";
447
472
  import FlowChart from "../flowChart";
448
473
  import FlowRoamRecord from "../flowRoamRecords";
449
- import {AjaxUtil} from 'sasp-base';
450
-
451
- // import {Replace} from "sasp-base";
474
+ import {AjaxUtil, Replace} from 'sasp-base';
452
475
  import RoamRecord from "../roamRecord";
453
476
  import UserSelect from "../userSelect";
477
+ import flowNewBatchDeal from "../../components/flowNewBatchDeal.vue";
454
478
  export default {
455
479
  name: "flow-inst-tab",
456
480
  components: {
457
481
  UserSelect,
458
482
  RoamRecord,
459
483
  FlowRoamRecord,
460
- FlowChart, FlowInstList
484
+ FlowChart, FlowInstList, flowNewBatchDeal
461
485
  },
462
486
  props: {
463
487
  flowId: {type: String, default: ''},
@@ -476,6 +500,10 @@
476
500
  formImpMethod:{type: Function,default: null},
477
501
  flowImpParamObj: {type: Object,default: () => ({})},
478
502
  downloadTemplate: {type: Function, default: null},
503
+ getFormDataByDataIds: {type: Function, default: null},
504
+ saveBatchDealFormData: {type: Function, default: null},
505
+ formAboutInfoObj: {type: Object, default: () => ({})},
506
+ sysDataObj: {type: Object, default: () => ({})},
479
507
  },
480
508
  data() {
481
509
  let vm = this;
@@ -517,6 +545,8 @@
517
545
 
518
546
  // 批量处理
519
547
  flowBatchPendingDialog: false,
548
+ // 选择性的批量多条一次性处理
549
+ flowBatchSelectPendingDialog: false,
520
550
  batchUpdateFormInfo: {
521
551
  formShow: false,
522
552
  dataRows: [],
@@ -862,9 +892,44 @@
862
892
  workListViews:{},
863
893
  workTableViews:{},
864
894
  currNodeName: "", //当前节点名称
865
- nextUserInfo:{}, // 下一步处理人的信息
866
- dataId:"", // 表单数据id
867
- disableSign:false, // 禁用加签转签按钮
895
+ nextUserInfo: {}, // 下一步处理人的信息
896
+ dataId: "", // 表单数据id
897
+ disableSign: false, // 禁用加签转签按钮
898
+ formSearchObj: {
899
+ taskNode: "",
900
+ flowNewBatchDealArr: [],
901
+ isNewSelectBatchDeal: false,
902
+ loading: true
903
+ },
904
+ formDataObj: {},
905
+ formNewBtnArr: [],
906
+ newBatchDealBtnObj: {
907
+ close: {
908
+ text: "关闭",
909
+ type: "",
910
+ icon: "el-icon-close",
911
+ show: true,
912
+ isView: true,
913
+ method: () => {
914
+ this.flowInstDataDialog = false;
915
+ this.flowBatchPendingDialog = false;
916
+ }
917
+ },
918
+ newBatchDealSave: {
919
+ text: "保存",
920
+ type: "primary",
921
+ icon: "el-icon-check",
922
+ show: true,
923
+ isView: true,
924
+ method: () => {
925
+ this.saveNewBatchDealFormData();
926
+ }
927
+ }
928
+ },
929
+ newBatchDealCurrDataId: "", // 新批量处理当前点击行dataId
930
+ isRefreshGetNextUsers: [], // 是否要刷新下一步处理人的字段,网关字段,表单,变量
931
+ fieldSysDataObj: {},
932
+ flowNewBatchDealDataIds: "",
868
933
  }
869
934
  },
870
935
  watch:{
@@ -895,13 +960,45 @@
895
960
 
896
961
  this.getFlowInfo().then(res => {
897
962
  this.initSuccess = true;
898
- this.initflowObj();
963
+ this.initFlowObj();
899
964
  this.getFlowAgent(); //加载流程代理
965
+ // this.initFieldSysData();
900
966
  });
901
967
  this.initTabNum();
902
968
  // this.initWorkStageTurnOn();
903
969
  },
904
970
  methods: {
971
+ // 新批量处理关闭弹框时数据重做的回调
972
+ newBatchDealClose() {
973
+ Object.assign(this.formSearchObj, {isNewSelectBatchDeal: false});
974
+ // let flowInstListVm = this.$refs["pendingRef"];
975
+ // if (flowInstListVm) {
976
+ // flowInstListVm.initFormDataByDataIds();
977
+ // // flowInstListVm.initNewBatchDealFunc();
978
+ // }
979
+ },
980
+
981
+ setDataValue(key, value) {
982
+ if (key && typeof key === "string") {
983
+ this[key] = value;
984
+ }
985
+ },
986
+
987
+ initFieldSysData() {
988
+ this.formFieldObj = this.formAboutInfoObj["formFieldObj"] || {};
989
+ let configInfoArr = this.formAboutInfoObj["formControlConfigArr"] || [];
990
+ let controlTypeArr = ["radio", "checkbox", "select"];
991
+ configInfoArr.forEach(item => {
992
+ if (controlTypeArr.includes(item.controlType) && typeof item.specialSet === "string") {
993
+ let specialSet = JSON.parse(item.specialSet);
994
+ // console.log('specialSet', specialSet);
995
+ let paramsKey = item.controlType + "Type";
996
+ if (specialSet[paramsKey] === "sysData") {
997
+ this.fieldSysDataObj[item.fieldId] = true;
998
+ }
999
+ }
1000
+ });
1001
+ },
905
1002
 
906
1003
  /**
907
1004
  * 打开[添加]窗口
@@ -1076,6 +1173,270 @@
1076
1173
  });
1077
1174
  },
1078
1175
 
1176
+ // 新批量处理弹框回调事件
1177
+ openNewBatchUpdateFlowForm() {
1178
+ // console.log('this.sysDataObj', this.sysDataObj, this.loginUser);
1179
+ Object.assign(this.formSearchObj, {
1180
+ flowNewBatchDealArr: [],
1181
+ isNewSelectBatchDeal: false,
1182
+ loading:true
1183
+ });
1184
+ this.initFieldSysData();
1185
+ // 处理按钮渲染
1186
+ let btnTypeArr = ["newBatchDealSave", "close"];
1187
+ let btnArr = [];
1188
+ btnTypeArr.forEach(item => {
1189
+ btnArr.push(this.newBatchDealBtnObj[item]);
1190
+ });
1191
+ this.formNewBtnArr = btnArr;
1192
+ this.initNewBatchDeal().then(arr => {
1193
+ this.getFormDataByDataIds(this.formInfo.formId, this.flowNewBatchDealDataIds).then(res => {
1194
+ this.formDataObj = res || {};
1195
+ arr.forEach(flowInst => {
1196
+ let formData = this.formDataObj[flowInst.dataId] || {};
1197
+ // 解析自定义流程概要
1198
+ this.currentStartUser = this.userMap[flowInst.startUserId] || "";
1199
+ this.currentStartTime = flowInst.startTime;
1200
+ flowInst["outlineResult"] = this.getFlowSummary(formData, flowInst.outlineResult);
1201
+ if ((flowInst.settingInfo || []).length > 0) {
1202
+ flowInst.settingInfo.forEach(setInfo => {
1203
+ let defaultVal;
1204
+ let anyVariable = "";
1205
+ if (setInfo.fieldType === "checkbox") {
1206
+ anyVariable = [];
1207
+ if (formData[setInfo.field] && typeof formData[setInfo.field] === "string") {
1208
+ formData[setInfo.field] = JSON.parse(formData[setInfo.field]);
1209
+ }
1210
+ }
1211
+ if (setInfo.defaultValue) {
1212
+ if (setInfo.defaultValueType === "formInfo") {
1213
+ setInfo.defaultValue = formData[setInfo.defaultValue];
1214
+ }
1215
+ if (setInfo.defaultValueType === "loginInfo") {
1216
+ let userInfo = Object.assign({}, this.loginUser, {"userId": this.loginUser.id});
1217
+ setInfo.defaultValue = userInfo[setInfo.defaultValue];
1218
+ }
1219
+ }
1220
+ if (setInfo.defaultValueType === "sysDate") {
1221
+ anyVariable = this.DATE_UTIL.formaterDateOrTime(new Date(), setInfo.fieldFormat);
1222
+ }
1223
+ let defaultValue = formData[setInfo.field] || setInfo.defaultValue;
1224
+ defaultVal = defaultValue || anyVariable;
1225
+ // if (setInfo.defaultValueType === "sysDate") {
1226
+ // defaultVal = this.DATE_UTIL.formaterDateOrTime(new Date(), setInfo.fieldFormat);
1227
+ // }
1228
+ // 给列表审核信息赋默认值
1229
+ setInfo.defaultValue = defaultVal;
1230
+ formData[setInfo.field] = defaultVal;
1231
+ });
1232
+ }
1233
+ });
1234
+ Object.assign(this.formSearchObj, {
1235
+ flowNewBatchDealArr: arr,
1236
+ isNewSelectBatchDeal: true,
1237
+ loading:false
1238
+ });
1239
+ });
1240
+ });
1241
+ this.flowBatchSelectPendingDialog = true;
1242
+ },
1243
+
1244
+ // 获取批量流程数据
1245
+ initNewBatchDeal() {
1246
+ return new Promise(resolve => {
1247
+ this.saspFlowAxios.post(this.api.plFlowInst.findInstPending, {
1248
+ flowId: this.flowDefine.id,
1249
+ currentNode: "",
1250
+ nodeType: "pending",
1251
+ dealUserId: this.loginUser.id,
1252
+ flowStatus: "1",
1253
+ flowVar: "1"
1254
+ }).then(res => {
1255
+ let flowNewBatchDeal = [];
1256
+ this.flowNewBatchDealDataIds = "";
1257
+ if (res.data && res.data.records.length > 0) {
1258
+ res.data.records.forEach((item, index) => {
1259
+ if (item.openBatch === "1") {
1260
+ item.settingInfo = JSON.parse(item.settingInfo);
1261
+ }
1262
+ item['isEdited'] = false;
1263
+ // item['isLoading'] = true;
1264
+ item['nextDealUsers'] = {};
1265
+ if (!index) {
1266
+ this.flowNewBatchDealDataIds += item.dataId;
1267
+ }else {
1268
+ this.flowNewBatchDealDataIds += "," + item.dataId;
1269
+ }
1270
+ flowNewBatchDeal.push(item);
1271
+ });
1272
+ }
1273
+ resolve(flowNewBatchDeal);
1274
+ });
1275
+ });
1276
+ },
1277
+
1278
+ // 新批量处理当前行点击编辑按钮打开弹框回调事件
1279
+ openCurrUpdateFlowForm(row) {
1280
+ this.openUpdateFlowForm(row, "update");
1281
+ // this.openBatchUpdateFlowForm(arr);
1282
+ },
1283
+
1284
+ saveNewBatchDealFormData() {
1285
+ this.saveFormInfo().then(result => {
1286
+ // console.log('保存方法1', result);
1287
+ if (result) {
1288
+ let flowNewBatchDealVm = this.$refs.flowNewBatchDealRef;
1289
+ // 数据保存成功,更改行数据
1290
+ let formData = this.formDataObj[result.ID] || {};
1291
+ let flowObj = this.formSearchObj.flowNewBatchDealArr.filter(item => item.dataId === result.ID)[0];
1292
+ // 刷新行数据
1293
+ let keysArr = Object.keys(result);
1294
+ Object.keys(formData).forEach(key => {
1295
+ if(keysArr.indexOf(key) > -1){
1296
+ if(keysArr.indexOf(key + "_SASP_SYS_DATA_ID") > -1){
1297
+ formData[key] = result[key + "_SASP_SYS_DATA_ID"];
1298
+ }else{
1299
+ formData[key] = result[key];
1300
+ }
1301
+ }
1302
+ })
1303
+ // 刷新配置信息
1304
+ if (flowObj.settingInfo && flowObj.settingInfo.length > 0) {
1305
+ flowObj.settingInfo.forEach(settingObj => {
1306
+ let defaultValue = result[settingObj.field] || settingObj.defaultValue;
1307
+ let defaultVal = defaultValue || (settingObj.options[0] || {}).value;
1308
+ // 给列表审核信息赋默认值
1309
+ // this.$set(settingObj, "defaultValue", defaultVal || "");
1310
+ settingObj.defaultValue = defaultVal || "";
1311
+ formData[settingObj.field] = defaultVal || "";
1312
+ });
1313
+ }
1314
+ this.$set(flowObj, "isEdited", true);
1315
+ // console.log('flowObj', flowObj, flowNewBatchDealVm);
1316
+ this.flowInstDataDialog = false;
1317
+ // 刷新下一步处理人
1318
+ if (flowNewBatchDealVm) {
1319
+ flowNewBatchDealVm.initFlowBatchDeal([flowObj]);
1320
+ }
1321
+ }
1322
+ });
1323
+ },
1324
+
1325
+ newBatchDealSubmit(selectionArr, submitType) {
1326
+ // console.log('提交',selectionArr);
1327
+ if (selectionArr.length === 0) {
1328
+ return this.$message.warning('请先勾选要提交的数据!');
1329
+ }
1330
+ let str = "即将提交" + selectionArr.length + "条数据";
1331
+ if(submitType === "all"){
1332
+ str = "即将全部提交(不包括正在loading加载的数据)";
1333
+ }
1334
+ this.$confirm(`${str}, 确认是否继续?`, '提示', {
1335
+ confirmButtonText: '确定',
1336
+ cancelButtonText: '取消',
1337
+ type: 'warning'
1338
+ }).then(() => {
1339
+ let params = [];
1340
+ let instIds = "";
1341
+ selectionArr.forEach(selectionObj => {
1342
+ let paramsObj = {dataId: selectionObj.dataId};
1343
+ let updateParams = {};
1344
+ (selectionObj.settingInfo || []).forEach(item => {
1345
+ updateParams[item.field] = item.defaultValue;
1346
+ });
1347
+ paramsObj["updateParams"] = updateParams;
1348
+ params.push(paramsObj);
1349
+ if (selectionObj.flowInstId) {
1350
+ instIds += `,${selectionObj.flowInstId}`;
1351
+ }
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
+ });
1375
+ }
1376
+ });
1377
+ }).catch(() => {
1378
+ this.$message({
1379
+ type: 'info',
1380
+ message: '已取消提交'
1381
+ });
1382
+ });
1383
+ },
1384
+
1385
+ // 流程批量审批,全部提交
1386
+ newBatchDealAllSubmit() {
1387
+ let flowNewBatchDealVm = this.$refs.flowNewBatchDealRef;
1388
+ let selectArr = [];
1389
+ this.formSearchObj.flowNewBatchDealArr.forEach(item => {
1390
+ if (flowNewBatchDealVm.newBatchDealSelectable(item)) {
1391
+ selectArr.push(item);
1392
+ }
1393
+ });
1394
+ // console.log('全部提交', selectArr);
1395
+ this.newBatchDealSubmit(selectArr, "all");
1396
+ },
1397
+
1398
+ newBatchExecuteNextStep(arr) {
1399
+ let params = [];
1400
+ arr.forEach(items => {
1401
+ let nextNodeObj = this.allNodeInfo[items.nextDealUsers.nextNodeId];
1402
+ let dealers = items.chooseNextUserId;
1403
+ let dealersObj = {};
1404
+ dealersObj[nextNodeObj["nodeLinkId"]] = dealers;
1405
+
1406
+ let nextStepBaseObj = {
1407
+ instId: items.flowInstId,
1408
+ dealers: dealers,
1409
+ // dealerNames: dealerNames,
1410
+ dealersObj: JSON.stringify(dealersObj),
1411
+ nextNodeType: nextNodeObj.nodeType,
1412
+ nextNodeId: nextNodeObj.id,
1413
+ nextNodeKey: nextNodeObj.nodeLinkId,
1414
+ taskId: items.taskId,
1415
+ }
1416
+ // if(this.flowNextOperation) {
1417
+ // this.flowNextOperation(obj.instId, obj.dealers, obj.dealerNames, obj.taskId);
1418
+ // }
1419
+ let paramsSourceObj = {"SASP_FLOW_USE_VARIABLES": "yes"};
1420
+ Object.assign(paramsSourceObj, {}, nextStepBaseObj);
1421
+ params.push(paramsSourceObj);
1422
+ });
1423
+ // console.log('params',params);
1424
+ this.saspFlowAxios.post(this.api.plFlowInst.batchExecuteNextStep, {
1425
+ params: JSON.stringify(params)
1426
+ }).then(res => {
1427
+ if (res.data.operateSuccess) {
1428
+ let message = res.data.operateMessage;
1429
+ this.$notify({
1430
+ title: '提示',
1431
+ message: `${message}`,
1432
+ type: 'info',
1433
+ position: 'bottom-right',
1434
+ duration: 10000,
1435
+ });
1436
+ }
1437
+ });
1438
+ },
1439
+
1079
1440
  /**
1080
1441
  * 获取[添加、修改和处理]的操作按钮
1081
1442
  */
@@ -1970,10 +2331,10 @@
1970
2331
  /**
1971
2332
  * 获取流程概要
1972
2333
  */
1973
- getFlowSummary(dataObj) {
2334
+ getFlowSummary(dataObj, summaryTemplate) {
1974
2335
  let flowSummary = "";
1975
- let summarySet = this.flowDefine.flowSummary;
1976
- if (this.tabActive == "draft") {
2336
+ let summarySet = summaryTemplate || this.flowDefine.flowSummary;
2337
+ if (this.tabActive === "draft") {
1977
2338
  flowSummary = this.platStringUtil.replaceAll(summarySet, "${startUserName*}", this.loginUser.userName);
1978
2339
  flowSummary = this.platStringUtil.replaceAll(flowSummary, "${createTime*}", this.DATE_UTIL.getCurrentDateTime());
1979
2340
  } else {
@@ -2804,7 +3165,20 @@
2804
3165
  }
2805
3166
  },
2806
3167
 
2807
- initflowObj() {//处理流程定义对象
3168
+ initFlowObj() {//处理流程定义对象
3169
+ let gatewayFields = this.flowDefine.gatewayFields || "";
3170
+ this.isRefreshGetNextUsers = gatewayFields.split(",");
3171
+ Object.keys(this.allNodeInfo).forEach(key => {
3172
+ let obj = this.allNodeInfo[key];
3173
+ if (obj.nodeType === "UserTask" && (!obj.nodeLinkId || obj.nodeLinkId.indexOf('Activity_draft') === -1)) {
3174
+ if (obj.dealerType === "form" && obj.formField) {
3175
+ this.isRefreshGetNextUsers.push(obj.formField);
3176
+ }
3177
+ if (obj.dealerType === "variable" && obj.variable) {
3178
+ this.isRefreshGetNextUsers.push(obj.variable);
3179
+ }
3180
+ }
3181
+ });
2808
3182
  let tabSetting = JSON.parse(this.flowDefine.tabSetting);
2809
3183
  tabSetting.forEach(data => {
2810
3184
  this.$set(this.tabTypeObj, data.type, data);
@@ -0,0 +1,485 @@
1
+ <template>
2
+ <el-container style="height: 100%">
3
+ <el-header style="height: auto">
4
+ <el-form inline size="small" class="search-form-parent el-card" style="flex-shrink: 0">
5
+ <el-form-item label="任务节点筛选">
6
+ <el-select v-model="formSearchObj.taskNode" style="width: 97%;"
7
+ clearable filterable @change="taskNodeChange">
8
+ <el-option v-for="item in taskNodeArr" :key="item.currentNode"
9
+ :label="item.currentNodeName"
10
+ :value="item.currentNode">
11
+ </el-option>
12
+ </el-select>
13
+ </el-form-item>
14
+ </el-form>
15
+ </el-header>
16
+ <el-main style="padding-top: 10px;padding-bottom: 0">
17
+ <div style="margin-bottom: 10px;">
18
+ <el-button type="primary" size="small" @click="partSubmit">提交</el-button>
19
+ </div>
20
+ <el-form size="small" style="height: calc(100% - 42px)">
21
+ <el-table
22
+ v-loading="formSearchObj.loading"
23
+ element-loading-text="正在加载,请稍等..."
24
+ element-loading-spinner="el-icon-loading"
25
+ element-loading-background="rgba(0, 0, 0, 0.6)"
26
+ ref="multipleTable"
27
+ :data="formSearchObj.flowNewBatchDealArr"
28
+ tooltip-effect="dark" stripe
29
+ height="100%" style="width: 100%"
30
+ :cell-class-name="cellClassNameFunc"
31
+ @row-click="handleRowClick"
32
+ @selection-change="handleSelectionChange">
33
+ <el-table-column
34
+ prop="selection"
35
+ header-align="center"
36
+ align="center"
37
+ type="selection"
38
+ :selectable="newBatchDealSelectable"
39
+ width="60">
40
+ </el-table-column>
41
+ <el-table-column
42
+ prop="index"
43
+ header-align="center"
44
+ align="center"
45
+ label="序号"
46
+ type="index"
47
+ width="60">
48
+ </el-table-column>
49
+ <el-table-column
50
+ header-align="center"
51
+ label="概要"
52
+ prop="flowSummary"
53
+ show-overflow-tooltip>
54
+ <template slot-scope="scope">{{ scope.row.outlineType === "diy" ? scope.row.outlineResult : scope.row.flowSummary }}</template>
55
+ </el-table-column>
56
+ <el-table-column
57
+ header-align="center"
58
+ align="center"
59
+ prop="currentNodeName"
60
+ label="当前任务"
61
+ width="150"
62
+ show-overflow-tooltip>
63
+ </el-table-column>
64
+ <el-table-column
65
+ header-align="center"
66
+ align="center"
67
+ prop="checkInfo"
68
+ width="500"
69
+ label="审核信息">
70
+ <template slot-scope="scope">
71
+ <!--:rules="plValidate('required')"-->
72
+ <div class="sh-left-box">
73
+ <div v-if="(scope.row.settingInfo || []).length > 0">
74
+ <div v-for="(items, Index) in scope.row.settingInfo" :key="items.id" v-show="items.processStatus === '1'">
75
+ <el-form-item :prop="'flowNewBatchDealArr.' + scope.$index + '.settingInfo.' + Index + '.defaultValue'"
76
+ :label-width="shLabelWidth" v-if="items.fieldType === 'radio'">
77
+ <div slot="label" class="text-overflow" :title="items.showText">{{ items.showText || "" }}</div>
78
+ <el-radio-group v-model="items.defaultValue" :disabled="scope.row.isLoading && isRefreshGetNextUsers.includes(items.field)"
79
+ @input="val => checkInfoChange(scope.row, items, val)">
80
+ <el-radio :label="item.value" v-for="(item, index) in items.options" :key="index">{{ item.label }}</el-radio>
81
+ </el-radio-group>
82
+ </el-form-item>
83
+
84
+ <el-form-item :prop="'flowNewBatchDealArr.' + scope.$index + '.settingInfo.' + Index + '.defaultValue'"
85
+ :label-width="shLabelWidth" v-if="items.fieldType === 'checkbox'">
86
+ <div slot="label" class="text-overflow" :title="items.showText">{{ items.showText || "" }}</div>
87
+ <el-checkbox-group v-model="items.defaultValue" :disabled="scope.row.isLoading && isRefreshGetNextUsers.includes(items.field)"
88
+ @change="val => checkInfoChange(scope.row, items, val)">
89
+ <el-checkbox :label="item.value" v-for="(item, index) in items.options" :key="index">{{ item.label }}</el-checkbox>
90
+ </el-checkbox-group>
91
+ </el-form-item>
92
+
93
+ <el-form-item :prop="'flowNewBatchDealArr.' + scope.$index + '.settingInfo.' + Index + '.defaultValue'"
94
+ label="" :label-width="shLabelWidth" v-if="items.fieldType === 'text'">
95
+ <div slot="label" class="text-overflow" :title="items.showText">{{ items.showText || "" }}</div>
96
+ <el-input v-model="items.defaultValue" @change="val => checkInfoChange(scope.row, items, val)"></el-input>
97
+ </el-form-item>
98
+
99
+ <el-form-item :prop="'flowNewBatchDealArr.' + scope.$index + '.settingInfo.' + Index + '.defaultValue'"
100
+ label="" :label-width="shLabelWidth" v-if="items.fieldType === 'select'">
101
+ <div slot="label" class="text-overflow" :title="items.showText">{{ items.showText || "" }}</div>
102
+ <el-select v-model="items.defaultValue" :multiple="items.multi === '1'" style="width: 100%"
103
+ @change="val => checkInfoChange(scope.row, items, val)">
104
+ <el-option v-for="(item, index) in items.options"
105
+ :key="item.value"
106
+ :label="item.label"
107
+ :value="item.value">
108
+ </el-option>
109
+ </el-select>
110
+ </el-form-item>
111
+
112
+ <el-form-item :prop="'flowNewBatchDealArr.' + scope.$index + '.settingInfo.' + Index + '.defaultValue'"
113
+ label="" :label-width="shLabelWidth" v-if="items.fieldType === 'userSelect'">
114
+ <div slot="label" class="text-overflow" :title="items.showText">{{ items.showText || "" }}</div>
115
+ <el-select v-model="items.defaultValue" :multiple="items.multi === '1'" filterable clearable style="width: 100%"
116
+ @change="val => checkInfoChange(scope.row, items, val)">
117
+ <el-option v-for="key in Object.keys(userMap)"
118
+ :key="key"
119
+ :label="userMap[key]"
120
+ :value="key">
121
+ </el-option>
122
+ </el-select>
123
+ </el-form-item>
124
+
125
+ <el-form-item :prop="'flowNewBatchDealArr.' + scope.$index + '.settingInfo.' + Index + '.defaultValue'"
126
+ label="" :label-width="shLabelWidth" v-if="items.fieldType === 'date'">
127
+ <div slot="label" class="text-overflow" :title="items.showText">{{ items.showText || "" }}</div>
128
+ <el-date-picker v-if="items.fieldFormat.includes('yyyy')" style="width: 100%"
129
+ v-model="items.defaultValue"
130
+ :type="items.fieldFormatType"
131
+ :format="items.fieldFormat"
132
+ :value-format="items.fieldFormat"
133
+ placeholder="选择日期"
134
+ @change="val => checkInfoChange(scope.row, items, val)">
135
+ </el-date-picker>
136
+ <el-time-picker v-else style="width: 100%"
137
+ v-model="items.defaultValue"
138
+ :format="items.fieldFormat"
139
+ :value-format="items.fieldFormat"
140
+ placeholder="选择时间"
141
+ @change="val => checkInfoChange(scope.row, items, val)">
142
+ </el-time-picker>
143
+ </el-form-item>
144
+ </div>
145
+ </div>
146
+ <div style="color: red;" v-else>无快捷审批配置</div>
147
+ </div>
148
+ <div class="sh-right-box">
149
+ <i class="el-icon-edit-outline icon-edit" :class="[{'edit-disable': scope.row.isLoading},{'icon-edited': scope.row.isEdited}]" @click="openEditForm(scope.row)"></i>
150
+ </div>
151
+ </template>
152
+ </el-table-column>
153
+ <el-table-column
154
+ header-align="center"
155
+ align="center"
156
+ prop="nextTask"
157
+ width="300"
158
+ label="下一步任务">
159
+ <template slot-scope="scope">
160
+ <el-form-item>
161
+ <div class="nextDealUsers" v-loading="scope.row.isLoading"
162
+ element-loading-text="拼命加载中"
163
+ element-loading-spinner="el-icon-loading"
164
+ element-loading-background="rgba(0, 0, 0, 0.7)">
165
+ <!-- <el-input v-model="scope.row.nextDealUsers.nextNodeName" disabled style="width: 90%"></el-input>-->
166
+ <div class="nextTaskBox"
167
+ :class="[{'isEndNode': scope.row.isEndNode || scope.row.nextDealUsers.isPassCondition === 0}]">{{ scope.row.nextDealUsers.nextNodeName }}
168
+ </div>
169
+ </div>
170
+ </el-form-item>
171
+ </template>
172
+ </el-table-column>
173
+ <el-table-column
174
+ header-align="center"
175
+ align="center"
176
+ prop="nextUser"
177
+ width="300"
178
+ label="下一步处理人">
179
+ <template slot-scope="scope">
180
+ <el-form-item>
181
+ <div class="nextDealUsers" v-loading="scope.row.isLoading"
182
+ element-loading-text="拼命加载中"
183
+ element-loading-spinner="el-icon-loading"
184
+ element-loading-background="rgba(0, 0, 0, 0.7)">
185
+ <el-select v-model="scope.row.chooseNextUserId" v-if="!scope.row.isEndNode" :disabled="scope.row.nextDealUsers.isPassCondition === 0"
186
+ :multiple="scope.row.nextDealUsers.multiChooseUser" filterable style="width: 90%">
187
+ <el-option v-for="item in scope.row.nextDealUsers.userArr" :key="item.id" :value="item.id"
188
+ :label="item.userName">
189
+ </el-option>
190
+ </el-select>
191
+ <div class="nextTaskBox" style="color: red;width: 80%" v-else>无需处理人</div>
192
+ </div>
193
+ </el-form-item>
194
+ </template>
195
+ </el-table-column>
196
+ </el-table>
197
+ </el-form>
198
+ </el-main>
199
+ </el-container>
200
+ </template>
201
+
202
+ <script>
203
+ export default {
204
+ name: "flowNewBatchDeal",
205
+ props: {
206
+ formSearchObj: {type: Object, default: () => ({})},
207
+ formDataObj: {type: Object, default: () => ({})}, //流程关联的所有表单数据
208
+ allNodeInfo: {type: Object, default: () => ({})}, //所有节点配置信息
209
+ newBatchDealSubmit: {type: Function, default: null},
210
+ isRefreshGetNextUsers: {type: Array, default: () => []},
211
+ userMap: {type: Object, default: () => ({})},
212
+ fieldSysDataObj: {type: Object, default: () => ({})},
213
+ sysDataObj: {type: Object, default: () => ({})},
214
+ formFieldObj: {type: Object, default: () => ({})},
215
+ },
216
+ data() {
217
+ return {
218
+ backNewBatchDealArr: [],
219
+ multipleSelection: [],
220
+ shLabelWidth: "100px",
221
+ taskNodeArr: [],
222
+ taskNodeClickNum: 0,
223
+ // dateTypeObj: {
224
+ // "yyyy-MM-dd HH:mm:ss": {category: "date",type: "datetime", value: "yyyy-MM-dd HH:mm:ss", label: "年-月-日 时:分:秒"},
225
+ // "yyyy-MM-dd": {category: "date",type: "date", value: "yyyy-MM-dd", label: "年-月-日"},
226
+ // "yyyy-MM": {category: "date",type: "month", value: "yyyy-MM", label: "年-月"},
227
+ // "yyyy": {category: "date",type: "year", value: "yyyy", label: "年"},
228
+ // "HH:mm:ss":{category: "time",type: "time", value: "HH:mm:ss", label: "时:分:秒"},
229
+ // "HH:mm":{category: "time",type: "time", value: "HH:mm", label: "时:分"},
230
+ // "HH":{category: "time",type: "time", value: "HH", label: "时"}
231
+ // },
232
+ }
233
+ },
234
+ created() {
235
+ // console.log(flowNewBatchDealArr,'formSearchObj',this.formSearchObj,this.allNodeInfo);
236
+ // console.log('fieldSysDataObj', this.fieldSysDataObj);
237
+ },
238
+ watch:{
239
+ 'formSearchObj.loading'(){
240
+ if(!this.formSearchObj.loading){ // 等到列表数据加载完毕后,即loading消失后初始化数据
241
+ let flowNewBatchDealArr = JSON.parse(JSON.stringify(this.formSearchObj.flowNewBatchDealArr));
242
+ flowNewBatchDealArr.forEach(item => {
243
+ let obj = {currentNode: item.currentNode, currentNodeName: item.currentNodeName};
244
+ !this.taskNodeArr.some(taskNodeObj => taskNodeObj.currentNode === obj.currentNode) && this.taskNodeArr.push(obj);
245
+ });
246
+ this.initFlowBatchDeal(this.formSearchObj.flowNewBatchDealArr);
247
+ }
248
+ }
249
+ },
250
+ methods: {
251
+ initFlowBatchDeal(newBatchDealArr = []) {
252
+ newBatchDealArr.forEach((item, index) => {
253
+ this.$set(item, "isLoading", true);
254
+ //获取处理人的参数处理
255
+ let flowParams = this.formDataObj[item.dataId];
256
+ let flowParamsObj = {};
257
+ Object.keys(flowParams).forEach(key => {
258
+ let paramKey = (this.formFieldObj || {})[key] || key;
259
+ if (this.isRefreshGetNextUsers.includes(key)) {
260
+ if(this.fieldSysDataObj[key]){ // 替换元数据
261
+ let value = flowParams[key];
262
+ flowParamsObj[paramKey] = flowParams[key] || "";
263
+ if(value){
264
+ let valueKeyArr = [value];
265
+ if(value.indexOf(",") > -1){
266
+ valueKeyArr = value.split(",");
267
+ }
268
+ let valueArr = [];
269
+ valueKeyArr.forEach(item => {
270
+ // key是fliedId,item是字典值id,出來是字典的dataName
271
+ // valueArr.push(this.sysDataObj[item]["dataName"]);
272
+ if(this.sysDataObj[item]){ // 初始化获取的数据是元数据ID,编辑保存后回调的行数据就有可能被更新为中文了
273
+ valueArr.push(this.sysDataObj[item]["dataName"]);
274
+ }else{
275
+ valueArr.push(item);
276
+ }
277
+ });
278
+ flowParamsObj[paramKey + "_SASP_SYS_DATA"] = valueArr.join(",");
279
+ flowParamsObj[key + "_SASP_SYS_DATA"] = valueArr.join(",");
280
+ flowParamsObj[paramKey + "_SASP_SYS_DATA_ID"] = valueKeyArr.join(",");
281
+ flowParamsObj[paramKey] = valueArr.join(",");
282
+ flowParamsObj[key] = valueArr.join(",");
283
+ }
284
+ }else{
285
+ flowParamsObj[paramKey] = flowParams[key];
286
+ flowParamsObj[key] = flowParams[key];
287
+ }
288
+ }
289
+ });
290
+ let obj = {instId: item.flowInstId, taskId: item.taskId,};
291
+
292
+ let nowNodeObj = this.allNodeInfo[item.currentNode] || {};
293
+ if (nowNodeObj && nowNodeObj.dealType && nowNodeObj.dealType === 'multi') {
294
+ this.$set(obj, 'passCondition', nowNodeObj.passCondition);
295
+ }
296
+ let paramsMap = {"SASP_FLOW_USE_VARIABLES": "yes"};
297
+ Object.assign(paramsMap, flowParamsObj || {}, obj);
298
+
299
+ this.saspFlowAxios.post(this.api.plFlowInst.getNextUsers, paramsMap).then(res => {
300
+ // console.log('getNextUsers-request' + index, res);
301
+ if (res.data.operateSuccess) {
302
+ let operateMap = JSON.parse(JSON.stringify(res.data.operateMap));
303
+ if (operateMap && operateMap.isPassCondition === 0) {
304
+ Object.assign(operateMap, {nextNodeName: "会签中...等待其他人处理完毕"});
305
+ }
306
+ let operateObj = res.data.operateObj || {nextNodeName: "", userArr: []};
307
+ //获取下一个节点信息
308
+ let nextNodeObj = this.allNodeInfo[operateObj.nextNodeId] || {};
309
+ operateObj["multiChooseUser"] = nextNodeObj.dealType === "multi";
310
+ let autoChooseUser = false; let isEndNode = false;
311
+ let chooseNextUserId = "";
312
+
313
+ if (nextNodeObj.nodeType === "UserTask") {
314
+ autoChooseUser = nextNodeObj.autoChooseUser === "1";
315
+ if (operateObj.multiChooseUser) {
316
+ chooseNextUserId = [];
317
+ }
318
+ } else if (nextNodeObj.nodeType === "EndEvent") {
319
+ isEndNode = true;
320
+ }
321
+ let userArr = operateObj.userArr || [];
322
+ if (userArr.length > 0) {
323
+ if (autoChooseUser) {
324
+ let userId = "";
325
+ userArr.forEach(item => {
326
+ userId += "," + item.id;
327
+ });
328
+ chooseNextUserId = userArr[0].id;
329
+ if (operateObj.multiChooseUser) {
330
+ chooseNextUserId = userId.slice(1).split(",");
331
+ }
332
+ }
333
+ if (!operateObj.multiChooseUser) {
334
+ chooseNextUserId = userArr[0].id;
335
+ }
336
+ }
337
+ Object.assign(operateObj, operateMap || {});
338
+ this.$set(item, 'isLoading', false);
339
+ this.$set(item, 'isEndNode', isEndNode);
340
+ this.$set(item, 'chooseNextUserId', chooseNextUserId);
341
+ this.$set(item, 'nextDealUsers', operateObj);
342
+ }
343
+ });
344
+ });
345
+ },
346
+
347
+ // 选择提交
348
+ partSubmit() {
349
+ this.newBatchDealSubmit(this.multipleSelection);
350
+ },
351
+
352
+ // 打开编辑表单弹框
353
+ openEditForm(rowData) {
354
+ if (rowData.isLoading) {
355
+ return;
356
+ }
357
+ this.$emit("openCurrUpdateFlowForm", rowData);
358
+ },
359
+
360
+ checkInfoChange(rowData, rowDataSetInfo, val = "") {
361
+ // console.log('审核信息修改', val, rowData, this.isRefreshGetNextUsers);
362
+ let formData = this.formDataObj[rowData.dataId];
363
+ if (val) {
364
+ formData[rowDataSetInfo.field] = val;
365
+ }
366
+ // TODO 判断是否要刷新下一步处理人
367
+ if (this.isRefreshGetNextUsers.includes(rowDataSetInfo.field)) {
368
+ rowData.isLoading = true;
369
+ this.initFlowBatchDeal([rowData]);
370
+ }
371
+ },
372
+
373
+ cellClassNameFunc({row, column, rowIndex, columnIndex}) {
374
+ // console.log('112313',row, column, rowIndex, columnIndex);
375
+ let className = "";
376
+ if (column.property === "checkInfo") {
377
+ className = "checkInfo";
378
+ }
379
+ return className;
380
+ },
381
+
382
+ handleSelectionChange(val) {
383
+ this.multipleSelection = val;
384
+ },
385
+
386
+ handleRowClick(row, column, event) {
387
+ // console.log(row, column, event,'handleRowClick',this.multipleSelection);
388
+ column = column || {};
389
+ if (['selection', 'index'].includes(column.property) && this.newBatchDealSelectable(row)) {
390
+ this.$refs.multipleTable.toggleRowSelection(row); // 通过toggleRowSelection方法勾选checkbox
391
+ }
392
+ },
393
+
394
+ newBatchDealSelectable(row, index) {
395
+ // console.log('是否禁用勾选', row, index);
396
+ let flag = true;
397
+ flag = (row.nextDealUsers.userArr || []).length > 0;
398
+ return !row.isLoading && flag;
399
+ },
400
+
401
+ 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);
413
+ },
414
+ }
415
+ }
416
+ </script>
417
+
418
+ <style scoped>
419
+ .el-form .el-form-item {
420
+ margin-bottom: 0;
421
+ }
422
+
423
+ .el-table::v-deep {
424
+ tr > td.checkInfo .cell {
425
+ display: flex;
426
+
427
+ .sh-left-box {
428
+ //width: 255px;
429
+ flex-grow: 1;
430
+ }
431
+
432
+ .sh-right-box {
433
+ flex-shrink: 0;
434
+ width: 80px;
435
+ font-size: 26px;
436
+ text-align: right;
437
+ margin-left: 20px;
438
+
439
+ .icon-edit {
440
+ color: #cccccc;
441
+ cursor: pointer;
442
+ }
443
+
444
+ i.icon-edited {
445
+ color: #50E617;
446
+ }
447
+
448
+ .edit-disable {
449
+ color: #d4d8df;
450
+ cursor: not-allowed;
451
+ }
452
+ }
453
+ }
454
+ }
455
+
456
+ .text-overflow {
457
+ white-space: nowrap;
458
+ overflow: hidden;
459
+ text-overflow: ellipsis;
460
+ }
461
+
462
+ .nextDealUsers::v-deep {
463
+ .el-loading-text {
464
+ margin-left: 10px;
465
+ display: inline-block;
466
+ }
467
+
468
+ .nextTaskBox {
469
+ width: 90%;
470
+ height: 32px;
471
+ line-height: 30px;
472
+ margin: 0 auto;
473
+ border: 1px solid #e4e7ed;
474
+ //background-color: #f5f7fa;
475
+ //border-color: #e4e7ed;
476
+ color: #c0c4cc;
477
+ cursor: not-allowed;
478
+ user-select: none;
479
+
480
+ &.isEndNode {
481
+ color: #FABDBD;
482
+ }
483
+ }
484
+ }
485
+ </style>
@@ -3,7 +3,8 @@
3
3
  :operateRootArr="operateArr" :dataPermis="dataPermis"
4
4
  :initFormInfo="initFormInfo" :saveFormInfo="saveFormInfo" :class='flowViewMainClass'
5
5
  :flow-next-operation="flowNextOperation" :getFormInfo="getFormInfo" :formImpMethod="formImpMethod"
6
- :flowImpParamObj="flowImpParamObj" :downloadTemplate="downloadTemplate">
6
+ :flowImpParamObj="flowImpParamObj" :downloadTemplate="downloadTemplate" :getFormDataByDataIds="getFormDataByDataIds"
7
+ :saveBatchDealFormData="saveBatchDealFormData" :formAboutInfoObj="formAboutInfoObj" :sysDataObj="sysDataObj">
7
8
  <template slot="formInfo">
8
9
  <slot name="formInfo"></slot>
9
10
  </template>
@@ -27,6 +28,10 @@
27
28
  formImpMethod:{type: Function,default:null},
28
29
  flowImpParamObj: {type: Object,default: () => ({})},
29
30
  downloadTemplate: {type: Function, default: null},
31
+ getFormDataByDataIds: {type: Function, default: null},
32
+ saveBatchDealFormData: {type: Function, default: null},
33
+ formAboutInfoObj: {type: Object, default: () => ({})},
34
+ sysDataObj: {type: Object, default: () => ({})},
30
35
  },
31
36
  data(){
32
37
  return {
@@ -101,7 +106,7 @@
101
106
  this.userArr = userArr;
102
107
  }else{
103
108
  this.saspFlowAxios.post(this.api.plFlowInterface.find,{sysInterName:'userData',interType:'sys',interStatus:'1'}).then(res => {
104
- if((res.data || []).length == 0){
109
+ if((res.data || []).length === 0){
105
110
  return;
106
111
  }
107
112
  let dataInter = res.data[0];