fmui-base 2.2.11 → 2.2.13

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.
@@ -1,1629 +0,0 @@
1
- import React from 'react';
2
-
3
- import Boxs from 'saltui/lib/Boxs';
4
- import Button from 'saltui/lib/Button';
5
- import Dialog from 'saltui/lib/Dialog';
6
- import Popup from 'saltui/lib/Popup';
7
- import Slot from 'saltui/lib/Slot';
8
- import TextareaField from 'saltui/lib/TextareaField';
9
- import Toast from 'saltui/lib/Toast';
10
- import CheckboxField from 'saltui/lib/CheckboxField';
11
- import DB from '../db/db';
12
-
13
- import SelectMember from '../selectMember/select';
14
- import './PageHome.less';
15
-
16
- const { HBox,Box } = Boxs;
17
- let iconIndex = 1;
18
- // let FlowCommon ;
19
- export default class PageHome extends React.Component {
20
- constructor(props) {
21
- super(props);
22
- //关闭加载页的遮罩效果
23
- $(".loading-containter").hide();
24
-
25
-
26
- //let processInstanceId = this.props.params.processInstanceId;
27
- //let handleUserId = this.props.params.assignee;
28
-
29
- let operate = props.operate;//操作类型(1:通过)
30
- let taskIds = props.taskIds;//任务ids
31
- let processInstanceIds = props.processInstanceIds;//多个流程实例id
32
- let code = props.code;//流程code
33
- let hasCommentField = props.hasCommentField;//是否有批示意见
34
- //let commentIsNull = this.props.params.commentIsNull;//批示意见是否为空,0是,1否
35
- let commentIsNotNull = props.commentIsNotNull;
36
-
37
- let commentType = props.commentType;//批示意见类型,2,3签名图片,0.1姓名,4,无
38
- let signPicId = props.signPicId;//签名图片
39
- let urgent = props.urgent;//是否紧急
40
- let isStart = props.isStart;//是否是流程起始节点
41
-
42
- let defaultComment='';
43
- let category = props.category;//分类
44
- let module = props.module && props.module != "undefined"? props.module:"approve";//模块
45
- if(!module){
46
- module = "approve";
47
- }
48
- let project = props.project;//项目,是首页,公文,还是
49
- if(project){
50
-
51
- }else{
52
- project = "";
53
- }
54
- /*if(hasCommentField&&hasCommentField=='1'){
55
- defaultComment='同意';
56
- }*/
57
- defaultComment='同意';
58
- let urgentList=[
59
- {
60
- value:"1",
61
- checked:urgent=="1"?true:false,
62
- content:'紧急',
63
- disable:false
64
- }
65
- ];
66
- //是否保存为常用语
67
- let savePhraseList=[
68
- {
69
- value:"1",
70
- checked:false,
71
- content:'是否保存为常用语',
72
- disable:false
73
- }
74
- ];
75
-
76
- var markValue = getSysMarkConfigValue('approve');
77
- var markValueJson = JSON.parse(markValue);
78
-
79
- var sysSMSsetting=markValueJson.sysSMSsetting;
80
- var evoRemind=markValueJson.evoRemind;
81
- var shortMessageList=[];
82
- var sendShortMessage='';
83
- if(sysSMSsetting&&(sysSMSsetting=='1'||sysSMSsetting=='2')){
84
- if(sysSMSsetting=='2'){
85
- shortMessageList.push({ value:"1",checked:true, content:'短信提醒',disable:false});
86
- }
87
- if(sysSMSsetting=='1'){
88
- shortMessageList.push({ value:"1",checked:false, content:'短信提醒',disable:false});
89
- }
90
- }
91
- if(evoRemind&&(evoRemind=='1'||evoRemind=='2')){
92
-
93
- if(evoRemind=='2'){
94
- shortMessageList.push({ value:"2",checked:true, content:'移动端提醒',disable:false});
95
- }
96
- if(evoRemind=='1'){
97
- shortMessageList.push({ value:"2",checked:false, content:'移动端提醒',disable:false});
98
- }
99
- }
100
- if(sysSMSsetting&&sysSMSsetting=='2'&&evoRemind&&evoRemind=='2'){
101
- sendShortMessage = '1,2';
102
- }else if(sysSMSsetting&&sysSMSsetting=='2'){
103
- sendShortMessage = '1';
104
- }else if(evoRemind&&evoRemind=='2'){
105
- sendShortMessage = '2';
106
- }else{
107
- sendShortMessage = '0';
108
- }
109
-
110
-
111
- this.state = {
112
- project:project,
113
- module:module,//模块
114
- category:category, //分类
115
- taskIds: taskIds,
116
- operate:operate,
117
- processInstanceIds: processInstanceIds, //数据id
118
- spyj:defaultComment,//审批意见
119
- hasCommentField:hasCommentField,//是否有审批意见
120
- commentIsNotNull:commentIsNotNull,//批示意见是否为空,0是,1否
121
- commentType:commentType,
122
- signPicId:signPicId=="-1"?"":signPicId,
123
- newSignPicId:"",//新签名图片id
124
- urgent:urgent,//紧急状态,0:不紧急
125
- code:code,//流程code
126
- urgentSelectList:[],//已选择的紧急选项
127
- urgentList:urgentList,//紧急选项
128
- urgentHidden:true,//紧急是否显示
129
- nextActivityList:[],//下一个后继活动节点列表
130
- nextRadomList:[],//下一个随机活动节点列表
131
- nextSelectType:'',//选择的活动类型,radom和next
132
- isStart:isStart=="1"?true:false,//是否是起点
133
- directlySubmit:'',//是否直接提交
134
- phraseList:[],//常用语列表
135
- choosePhrase:[],//常用语列表选择
136
- savePhraseList:savePhraseList,//是否保存为常用语的选项列表
137
- savePhrase:[],//是否保存为常用语,1是,0否
138
- level:'',
139
- sendShortMessage:sendShortMessage,
140
- shortMessageList:shortMessageList,
141
- };
142
-
143
- // FlowCommon = require('pages/flow_common/'+module).default?require('pages/flow_common/'+module).default:require('pages/flow_common/'+module);
144
- //引入扩展js
145
-
146
-
147
- let t = this;
148
- let userId = document.getElementById("userHiddenId").value;
149
-
150
- var key = "";
151
- if(project=='mobileportal'){//如果项目是首页
152
- key = 'mobileportal_helpNew_'+userId;
153
- }else{
154
- key = module+'_helpNew_'+userId;
155
- }
156
- // dd.util.domainStorage.getItem({ //点击帮助页面
157
- // name:key , // 存储信息的key值
158
- // onSuccess : function(info) {
159
- // let helpNew = info.value;
160
- // if( typeof(helpNew) != 'undefined' && helpNew != '' ){
161
- // iconIndex = 1;
162
- // }
163
- // t.initButton(iconIndex);
164
- // },
165
- // onFail : function(err) {
166
- // }
167
- // });
168
- }
169
-
170
-
171
- //初始化按钮
172
- initButton(iconIndex){
173
- let t = this;
174
- //设置帮助
175
- // dd.biz.navigation.setIcon({
176
- // showIcon : false,//是否显示icon
177
- // iconIndex : iconIndex,//显示的iconIndex,如上图
178
- // onSuccess : function(result) {
179
- // var key = "";
180
- // var project = t.state.project;
181
- // if(project=='mobileportal'){//如果项目是首页
182
- // key = 'hospitalmanage';
183
- // }else{
184
- // key = t.state.module;
185
- // }
186
- // location.hash=key+'/help_index';
187
- // },
188
- // onFail : function(err) {
189
- // }
190
- // });
191
- // dd.biz.navigation.setTitle({
192
- // title : '批量办理',//控制标题文本,空字符串表示显示默认文本
193
- // onSuccess : function(result) {
194
- // },
195
- // onFail : function(err) {}
196
- // });
197
- // dd.biz.navigation.setRight({
198
- // show: false,//控制按钮显示, true 显示, false 隐藏, 默认true
199
- // onSuccess : function(result) {
200
- // },
201
- // onFail : function(err) {}
202
- // });
203
- }
204
- componentDidMount() {
205
- let t = this;
206
- var operate = t.state.operate;
207
- if(operate == 1){//通过
208
- this.getNextActivity();
209
- }
210
- }
211
-
212
- componentWillUnmount(){
213
- //Popup.hide();
214
- //alert(1);
215
- //手机返回的时候关闭一些弹出框和调整一些样式
216
- $("#App").css({
217
- "overflow":"auto",
218
- "height":"",
219
- });
220
- Dialog.hide();
221
- Popup.hide();
222
- }
223
-
224
- //获取下一个办理的节点
225
- getNextActivity(){
226
- let t = this;
227
- let taskIds = t.state.taskIds;
228
- let processInstanceIds = t.state.processInstanceIds;
229
- let taskId = '';
230
- let processInstanceId = '';
231
- if(taskIds){
232
- let taskArray = taskIds.split(",");
233
- let processInstanceIdArray = processInstanceIds.split(",");
234
- taskId = taskArray[0];
235
- processInstanceId = processInstanceIdArray[0];
236
- }
237
-
238
- //是否有批示意见
239
- let hasCommentField = t.state.hasCommentField;
240
- if(!hasCommentField){
241
- hasCommentField='0';
242
- }
243
-
244
- //紧急
245
- let urgent = t.state.urgent;
246
- if(!urgent){
247
- urgent = '0';
248
- }
249
-
250
- //是否有锁
251
- //let lock = t.state.lock;
252
-
253
- //流程编码
254
- let code = t.state.code;
255
-
256
- //是否是起点
257
- let isStart = t.state.isStart;
258
- let nextActivityList = [];
259
- var nextRadomList = [];
260
- let nextSelectType = '';
261
- var succeedRange = "";//后继活动id
262
- let isEnd = false;
263
- let hasRadomList = false;//判断下次办理是否有随机活动节点
264
- DB.FlowModuleAPI.getNextActivity(
265
- {
266
- taskId:taskId,
267
- code:code
268
- }
269
- ).then((content) => {
270
- let nextList= content.activityList;//下一个后继节点列表
271
- let radomList = content.radomList;//下一个随机活动节点
272
- let maxOutgoing=content.maxOutgoing;
273
- succeedRange = content.succeedRange == null?"":content.succeedRange;
274
- if(!maxOutgoing){
275
- maxOutgoing = "0";
276
- }
277
- var isRadio = maxOutgoing == 1;//单选还是多选
278
- if(typeof(nextList) == 'undefined' || nextList == null || nextList==''){
279
- nextList = [];
280
- }
281
- if(typeof(radomList) == 'undefined' || radomList == null || radomList==''){
282
- radomList = [];
283
- }
284
-
285
- var param = {
286
- taskIds: t.state.taskIds,
287
- hasCommentField:hasCommentField,
288
- processInstanceIds:t.state.processInstanceIds,
289
- module:t.state.module,
290
- //lock:lock,
291
- dealActionName:"通过"
292
- }
293
-
294
-
295
- if(nextList.length==0 && radomList.length == 0){
296
- if(hasCommentField=="1"){
297
-
298
- t.setState({
299
- urgentHidden:true,
300
- urgentList:[],
301
- //lock:lock,
302
- isStart:isStart,
303
- directlySubmit:'0'
304
- });
305
- }else{
306
- t.setState({
307
- urgentHidden:true,
308
- urgentList:[],
309
- directlySubmit:'1'
310
- });
311
- t.sendFlowClick(param);
312
- }
313
- }else{
314
- //结束节点
315
- if(nextList.length==1 && nextList[0]['end']){
316
- isEnd = true;
317
- if(hasCommentField=="0" && radomList.length==0){
318
- t.setState({
319
- urgentHidden:true,
320
- urgentList:[],
321
- //lock:lock,
322
- isStart:isStart,
323
- directlySubmit:'1',
324
- isEnd:isEnd
325
- },function(){
326
- param.selectedActivity='[{"id":"end_node","name":"结束","level":""}]';
327
- //t.sendFlowClick(param);
328
- });
329
- //return false;
330
- }
331
-
332
- }
333
-
334
- nextList.sort(function compare(a,b){
335
- var val1 = parseInt(a['sortNo']?a['sortNo']:'99999999999999');
336
- var val2 = parseInt(b['sortNo']?b['sortNo']:'99999999999999');
337
- if (val1 <= val2) {
338
- return -1;
339
- } else if (val1 > val2) {
340
- return 1;
341
- } else {
342
- return 0;
343
- }
344
- });
345
- //let tasktype = t.state.tasktype;
346
- let urgentHidden = false;
347
- // var path = '#/approval/approve-choosenode/';
348
- let checkActi = "0";
349
- //随机节点
350
-
351
- //后继活动
352
- let urgentSelectList = [];
353
- let urgentList = [];
354
- if(nextList.length==1 && nextList[0]['end']){//结束
355
- //urgentHidden = true;
356
-
357
- var endItem = nextList[0];
358
- var checkedItem = {};
359
- checkedItem.value = endItem.id;
360
- checkedItem.name = endItem.name;
361
- checkedItem.arrow = true;
362
- checkedItem.show = false;
363
- checkedItem.type = endItem.type;
364
- checkedItem.end = endItem.end;
365
- checkedItem.disable = false;
366
- checkedItem.maxOutgoing = maxOutgoing;
367
-
368
- // if(hasRadomList){//当有随机节点时,不选中
369
- // checkedItem.checked = false;
370
- // }else{
371
- checkedItem.checked = true;
372
- checkedItem.must = true;
373
- //nextSelectType="next";
374
- //}
375
- checkedItem.personValue = [];
376
- checkedItem.commonUsedData = [];
377
- nextActivityList.push(checkedItem);
378
-
379
- //alert(JSON.stringify(nextActivityList));
380
- //紧急
381
- let urgent = t.state.urgent;
382
- urgentList = t.state.urgentList;
383
- //if(hasRadomList == false){//当没有随机节点时隐藏紧急
384
- urgentHidden = true;
385
- //}
386
- //if(urgentHidden == false){ //当紧急状态显示时把判断是否选中值
387
- if(urgent == '1'){
388
- urgentList[0].checked = true;
389
- urgentSelectList = urgentList;
390
- }
391
- //}
392
-
393
- }else{
394
- let show = true;
395
- var isRadio = maxOutgoing == 1;
396
- var no = 0;//随机节点数量
397
- nextList.map(function(item){
398
- var participants = item.participants;
399
- if(item.nodeType=='radom'){//随机
400
- var nextSucceedRange = "";
401
- var nowLevel = t.state.level;
402
-
403
- if(item.id == t.state.activityId){//当下个活动节点是当前节点在同一个随机活动时
404
- nextSucceedRange=succeedRange;
405
- }else{
406
- nextSucceedRange="";
407
- }
408
- var returnParam = t.dealwithRadomList(item,radomList,item.must,maxOutgoing,checkActi,nextSucceedRange,nowLevel,no);
409
- ++no;
410
- var randomItem = returnParam.randomItem;
411
- checkActi = returnParam.checkActi;
412
- if(randomItem !=null && randomItem.subRandomList !=null && randomItem.subRandomList.length>0){
413
- nextRadomList.push(randomItem);
414
- }
415
- return false;
416
- }
417
-
418
- if(item.end==true){
419
- isEnd = true;
420
- }
421
- var checkedItem = {};
422
- var selectUserReadOnly = false;
423
- var personValue = [];//选中的人
424
- var personValues = [];//备选的人
425
- var participantMode = item.participantMode;//判断选人是单选还是多选
426
- var commonUsedData = [];//自定义选人的范围,常用
427
- var commonTreeData = [];
428
- var commonUsedId = '';//常用选择范围
429
- var popCode = "";
430
- var chooseType = "";
431
- var commonType = "";//常用tab菜单
432
- var commonHasUser = false;//常用是否有用户
433
- var commonHasOrg = false;//常用是否有组织
434
- var commonHasGroup = false;//常用是否有群组
435
- var type3ParNum=0;
436
- if(item.type == 3 ){ //指定人选择
437
- selectUserReadOnly = true;
438
- popCode = 'org,group';//选人组件code
439
- chooseType = "userNotOrg,userNotGroup";
440
- var participantList = item.participantList;
441
- // if(participantList != null && participantList != "" && participantList.length>0){
442
- // for(var i=0; i<participantList.length; i++ ){
443
- // if(participantList[i].type != "user"){
444
- // var children = participantList[i];
445
- // for(var j=0; j<children.length; j++ ){
446
- // var personValueItem = {scopeType:"user",scopeValue:children[j].id,scopeName:children[j].name,imageId:""};
447
- // personValue.push(personValueItem);
448
- // }
449
- // }else{
450
- // var personValueItem = {scopeType:"user",scopeValue:participantList[i].id,scopeName:participantList[i].name,imageId:""};
451
- // personValue.push(personValueItem);
452
- // }
453
-
454
- // }
455
- // }
456
- if(participantList != null && participantList != "" && participantList.length>0){
457
- for(var i=0; i<participantList.length; i++ ){
458
- if(participantList[i].type != "user"){
459
- var children = participantList[i];
460
- for(var j=0; j<children.length; j++ ){
461
- var personValueItem = {scopeType:"user",scopeValue:children[j].id,scopeName:children[j].userName,imageId:"",orgNamePath:children[j].orgPath};
462
- personValues.push(personValueItem);
463
- type3ParNum++;
464
- }
465
- }else{
466
- var personValueItem = {scopeType:"user",scopeValue:participantList[i].id,scopeName:participantList[i].name,imageId:"",orgNamePath:participantList[i].orgPath};
467
- personValues.push(personValueItem);
468
- type3ParNum++;
469
- }
470
-
471
- }
472
- if(type3ParNum>1 && participantMode=='0'){
473
- item.type =2;
474
- }else{
475
- personValue=personValues;
476
- }
477
- if(type3ParNum==0){
478
- item.type =1;
479
- }
480
-
481
- }
482
- }else if(item.type == 1){//选择所有人
483
- selectUserReadOnly = false;
484
- chooseType = "userNotOrg,userNotGroup";
485
- if(item.nodeType=='readtask'){//如果是传阅节点
486
- chooseType="userNotOrg,userNotGroup";
487
- }
488
- var commonUsedId = '';//常用选择范围
489
- var participantList = item.participantList;
490
- var participantListNew = item.participantListNew;
491
- if(participantListNew != null && participantListNew != "" && participantListNew.length>0){
492
- commonTreeData = participantListNew;
493
- }
494
-
495
- participants='';
496
- if(participantList != null && participantList != "" && participantList.length>0){
497
- for(var i=0; i<participantList.length; i++ ){
498
- if(participantList[i].type != "user"){
499
- var children = participantList[i];
500
- for(var j=0; j<children.length; j++ ){
501
- if(commonUsedId.indexOf(children[j].id) == -1){
502
- commonUsedId += children[j].id+',';
503
- commonUsedData.push(personValueItem);
504
- if(item.partType=='1'){
505
- personValue.push(personValueItem);
506
- }
507
- }
508
- }
509
- }else{
510
- var personValueItem = {scopeType:participantList[i].type ,scopeValue:participantList[i].id,scopeName:participantList[i].name,imageId:"",orgNamePath:participantList[i].orgPath};
511
- if((","+commonUsedId+",").indexOf(","+participantList[i].id+',') == -1){
512
- commonUsedId += participantList[i].id+',';
513
- commonUsedData.push(personValueItem);
514
- if(item.partType=='1'){
515
- personValue.push(personValueItem);
516
- }
517
- }
518
- }
519
-
520
- }
521
- if(commonUsedData.length>0){
522
- popCode = "common,org,group";
523
- popCode = "common,org,group,duty,politicalOutlook";
524
- chooseType = "userNotOrg,userNotGroup,userNotDuty,userNotPoliticalOutlook";
525
- if(commonUsedData.length==1){
526
- personValue = commonUsedData;
527
- }
528
- }else{
529
- popCode = "org,group";
530
- popCode = "org,group,duty,politicalOutlook";
531
- chooseType = "userNotOrg,userNotGroup,userNotDuty,userNotPoliticalOutlook";
532
- }
533
-
534
- }else{
535
- chooseType = "userNotOrg";
536
- popCode = "org";
537
- popCode = "org,group,duty,politicalOutlook";
538
- chooseType = "userNotOrg,userNotGroup,userNotDuty,userNotPoliticalOutlook";
539
- }
540
- }
541
- if(item.type == 2){//指定候选人
542
- selectUserReadOnly = false;
543
- popCode = 'common';//选人组件code
544
- chooseType = "userNotOrg,userNotGroup";
545
- var commonUsedId = '';//常用选择范围
546
- var participantList = item.participantList;
547
- var participantListNew = item.participantListNew;
548
- if(participantListNew != null && participantListNew != "" && participantListNew.length>0){
549
- commonTreeData = participantListNew;
550
- }
551
- if(participantList != null && participantList != "" && participantList.length>0){
552
- for(var i=0; i<participantList.length; i++ ){
553
- if(participantList[i].type != "user"){
554
- /* var children = participantList[i];
555
- for(var j=0; j<children.length; j++ ){
556
- var personValueItem = {scopeType:"user",scopeValue:children[j].id,scopeName:children[j].userName,imageId:""};
557
- if(commonUsedId.indexOf(children[j].id) == -1){
558
- commonUsedId += children[j].id+',';
559
- commonUsedData.push(personValueItem);
560
- }
561
- }*/
562
- }else if(participantList[i].secretLevel==0 || participantList[i].secretLevel || !participantList[i].orgId){
563
- var personValueItem = {scopeType:"user",scopeValue:participantList[i].id,scopeName:participantList[i].name,imageId:"",orgNamePath:participantList[i].orgPath};
564
- if((","+commonUsedId+",").indexOf(","+participantList[i].id+',') == -1){
565
- commonUsedId += participantList[i].id+',';
566
- commonUsedData.push(personValueItem);
567
- if(item.partType=='1'){
568
- personValue.push(personValueItem);
569
- }
570
- }
571
- }
572
- }
573
- if(commonUsedData.length==1){
574
- personValue = commonUsedData;
575
- }
576
- }else{
577
- item.type =1;
578
- chooseType = "userNotOrg";
579
- popCode = "org";
580
- }
581
- }
582
- else if(item.type == 4){//办理完毕
583
- commonUsedData=[];
584
- personValue = [];
585
- show = false;
586
- item.end=true;
587
- popCode = '';
588
- chooseType = '';
589
- }
590
- if(commonUsedId){
591
- commonUsedId = commonUsedId.substring(0,commonUsedId.length-1);
592
- }
593
- checkedItem.commonType = commonType;//常用tab菜单传参
594
- checkedItem.code = popCode;
595
- checkedItem.chooseType = chooseType;
596
- checkedItem.commonUsedData = commonUsedData;
597
- checkedItem.commonTreeData = commonTreeData;
598
- checkedItem.participantMode = participantMode;//选人单选还是多选,1多选,0单选
599
- checkedItem.personValue = personValue;
600
- checkedItem.selectUserReadOnly = selectUserReadOnly;
601
- checkedItem.value = item.id;
602
- checkedItem.name = item.name;
603
- checkedItem.arrow = true;
604
- checkedItem.show = true;
605
- checkedItem.type = item.type;
606
- checkedItem.end = item.end;
607
-
608
- checkedItem.level = item.level;
609
- checkedItem.must = item.must;
610
- checkedItem.maxOutgoing = maxOutgoing;
611
- checkedItem.participants=participants;
612
- if(item.must==true && ((maxOutgoing==1 && checkActi == 0) ||maxOutgoing==0 )){//必须
613
- checkedItem.disable = false;
614
- checkedItem.checked = true;
615
- //nextSelectType = 'next';
616
- checkActi = "1";
617
- }else if(item.defaultFlow==true && ((maxOutgoing==1 && checkActi == 0) ||maxOutgoing==0 ) ){//默认节点
618
- checkedItem.disable = false;
619
- checkedItem.checked = true;
620
- //nextSelectType = 'next';
621
- checkActi = "1";
622
- }else{
623
- checkedItem.disable = false;
624
- checkedItem.checked = false;
625
- }
626
- if(item.type == 4 && radomList.length==0){//当类型是完成结束时且随机活动没有
627
- checkedItem.checked = true;
628
- }
629
- if(checkedItem.checked == true && checkedItem.end==true){ //当结束节点且选中时
630
- // t.setState({
631
- // urgentHidden:true,
632
- // urgentList:[]
633
- // });
634
- urgentHidden = true;
635
- }
636
- checkedItem.isRadio = isRadio;//判断是否是单选还是多选
637
- nextActivityList.push(checkedItem);
638
- });
639
- if(checkActi == "0" && isRadio == true){//如果没有默认选中的下一个节点且是单选,则第一个默认选中
640
- if(nextActivityList.length>0 && nextRadomList.length == 0){
641
- nextActivityList[0].checked = true;
642
- //nextSelectType = 'next';
643
- }else if(nextRadomList.length>0 && nextActivityList.length == 0){
644
- nextRadomList[0].subRandomList[0].checked = true;
645
- //nextSelectType = 'radom';
646
- }
647
- }
648
- //紧急
649
- let urgent = t.state.urgent;
650
- urgentList = t.state.urgentList;
651
- if(urgentHidden == false){ //当紧急状态显示时把判断是否选中值
652
- if(urgent == '1'){
653
- urgentList[0].checked = true;
654
- urgentSelectList = urgentList;
655
- }
656
- }
657
- }
658
- t.setState({
659
- nextSelectType:nextSelectType,
660
- nextRadomList:nextRadomList,
661
- nextActivityList:nextActivityList,
662
- urgentSelectList:urgentSelectList,
663
- urgentList:urgentList,
664
- urgentHidden:urgentHidden,
665
- //lock:lock,
666
- isStart:isStart,
667
- directlySubmit:'0',
668
- isEnd:isEnd
669
- },function(){
670
- for(var i=0;i<nextActivityList.length; i++){
671
- if(nextActivityList[i].personValue.length>0 || nextActivityList[i].commonUsedData.length>0){
672
- t.refs[nextActivityList[i].value+"_"+i].initSelectData();
673
- }
674
- }
675
- for(var i=0;i<nextRadomList.length; i++){
676
- var nextRadomListItem = nextRadomList[i].subRandomList;
677
- for(var j=0;j<nextRadomListItem.length; j++){
678
- if(nextRadomListItem[j].personValue.length>0 || nextRadomListItem[j].commonUsedData.length>0){
679
- t.refs[nextRadomListItem[j].value+"_"+j].initSelectData();
680
- }
681
- }
682
- }
683
- });
684
-
685
- }
686
-
687
- }).catch((error) => {
688
- if(typeof(error.errorMsg) == 'undefined'){
689
- Toast.show({
690
- type: 'error',
691
- content: '获取下个办理节点出错'
692
- });
693
- }else{
694
- Toast.show({
695
- type: 'error',
696
- content: error.errorMsg
697
- });
698
- }
699
- });
700
-
701
-
702
- }
703
-
704
-
705
- //处理后面的待办节点随机节点
706
- dealwithRadomList(randomMain,radomList,isMust,maxOutgoing,checkActi,succeedRange,nowLevel,no){
707
- if(nowLevel==null){
708
- nowLevel = "0";
709
- }
710
- var id = randomMain.id;
711
- var randomItem={};
712
- randomItem.id = id;
713
- randomItem.name = randomMain.name;
714
- var subRandomList = [];
715
- //随机节点
716
- if(typeof(radomList)!= 'undefined' && radomList != null){
717
- var radomIsRadio = true;
718
- if(radomList.length>0){
719
- //
720
- radomList.map(function(item,m){
721
- if(item.id == id){//当子随机活动id等于主随机id
722
- var checkedItem = {};
723
- var selectUserReadOnly = false;
724
- var personValue = [];//选中的人
725
- radomIsRadio = item.isCross == 2?false:true;//判断选人是单选还是多选,isCross 0,1单选,2包含随机多选
726
- var participantMode = item.participantMode;
727
- var commonUsedData = [];//自定义选人的范围,常用
728
- var commonUsedId = '';//常用选择的用户id
729
- var popCode = "";
730
- var chooseType = "";
731
- var commonType = "";//常用tab菜单
732
- var participantList=[];//参与人
733
- var commonHasUser = false;//常用是否有用户
734
- var commonHasOrg = false;//常用是否有组织
735
- var commonHasGroup = false;//常用是否有群组
736
- if(item.type == 3 ){ //指定人选择
737
- selectUserReadOnly = true;
738
- popCode = 'org,group';//选人组件code
739
- chooseType = "userNotOrg,userNotGroup";
740
- if(succeedRange == "" || item.level != parseInt(nowLevel)+1){//当后继为空时取下个活动的
741
- participantList = item.participantList;
742
- }else{
743
- participantList = getUsersByOrgGroupIds(succeedRange);
744
- }
745
- if(participantList != null && participantList != "" && participantList.length>0){
746
- for(var i=0; i<participantList.length; i++ ){
747
- if(participantList[i].type != "user"){
748
- var children = participantList[i].children;
749
- for(var j=0; j<children.length; j++ ){
750
- var personValueItem = {scopeType:"user",scopeValue:children[j].id,scopeName:children[j].name,imageId:""};
751
- personValue.push(personValueItem);
752
- }
753
- }else{
754
- var personValueItem = {scopeType:"user",scopeValue:participantList[i].id,scopeName:participantList[i].name,imageId:""};
755
- personValue.push(personValueItem);
756
- }
757
-
758
- }
759
- }
760
-
761
- } else if(item.type == 1){//选择所有人
762
- selectUserReadOnly = false;
763
- chooseType = "userNotOrg";
764
- if(item.nodeType=='readtask'){//如果是传阅节点
765
- chooseType="userNotOrg";
766
- }
767
- var commonUsedId = '';//常用选择范围
768
- var participantList = item.participantList;
769
- if(participantList != null && participantList != "" && participantList.length>0){
770
- for(var i=0; i<participantList.length; i++ ){
771
- if(participantList[i].type != "user"){
772
- var children = participantList[i];
773
- for(var j=0; j<children.length; j++ ){
774
- var personValueItem = {scopeType:participantList[i].type ,scopeValue:children[j].id,scopeName:children[j].userName,imageId:""};
775
- if(commonUsedId.indexOf(children[j].id) == -1){
776
- commonUsedId += children[j].id+',';
777
- commonUsedData.push(personValueItem);
778
- }
779
- }
780
- }else{
781
- var personValueItem = {scopeType:participantList[i].type ,scopeValue:participantList[i].id,scopeName:participantList[i].name,imageId:""};
782
- if(commonUsedId.indexOf(participantList[i].id) == -1){
783
- commonUsedId += participantList[i].id+',';
784
- commonUsedData.push(personValueItem);
785
- }
786
- }
787
-
788
- }
789
- if(commonUsedData.length>0){
790
- popCode = "common,org";
791
- }else{
792
- popCode = "org";
793
- }
794
- }else{
795
- popCode = "org";
796
- }
797
- }else{//指定候选人
798
- selectUserReadOnly = false;
799
- var popCode = 'common';//选人组件code
800
- if(succeedRange == "" || item.level != parseInt(nowLevel)+1){//当后继为空时取下个活动的
801
- participantList = item.participantList;
802
- }else{
803
- participantList = getUsersByOrgGroupIds(succeedRange);
804
- }
805
- if(participantList != null && participantList != "" && participantList.length>0){
806
- for(var i=0; i<participantList.length; i++ ){
807
- if(participantList[i].type == "user"){
808
- if(commonUsedId.indexOf(participantList[i]) == -1){
809
- commonUsedId += participantList[i].id+',';
810
- commonHasUser = true;
811
- }
812
- }if(participantList[i].type == "org"){
813
- if(commonUsedId.indexOf(participantList[i]) == -1){
814
- commonUsedId += participantList[i].id+',';
815
- commonHasOrg = true;
816
- }
817
-
818
- }else if(participantList[i].type == "group"){
819
- if(commonUsedId.indexOf(participantList[i].id) == -1){
820
- commonUsedId += participantList[i].id+',';
821
- commonHasGroup = true;
822
- }
823
- }
824
-
825
- }
826
- if(commonUsedId != ""){
827
- if(commonHasUser){
828
- commonType +=",user";
829
- }
830
- if(commonHasOrg){
831
- commonType +=",org";
832
- }
833
- if(commonHasGroup){
834
- commonType +=",group";
835
- }
836
- commonType = commonType.substring(1,commonType.length);
837
- }
838
- }
839
- }
840
- if(commonUsedId){
841
- commonUsedId = commonUsedId.substring(0,commonUsedId.length-1);
842
- }
843
- checkedItem.commonType = commonType;//常用tab菜单传参
844
- checkedItem.code = popCode;
845
- checkedItem.chooseType = chooseType;
846
- checkedItem.commonUsedData = commonUsedData;
847
- checkedItem.participantMode = participantMode;//选人单选还是多选,1多选,0单选
848
- checkedItem.personValue = personValue;
849
- checkedItem.selectUserReadOnly = selectUserReadOnly;
850
- checkedItem.value = item.id;
851
- checkedItem.name = item.name;
852
- checkedItem.arrow = true;
853
- checkedItem.show = true;
854
- checkedItem.type = item.type;
855
- checkedItem.end = item.end;
856
- checkedItem.level = item.level;
857
- checkedItem.maxOutgoing = maxOutgoing;
858
- if(no==0 && m==0 ){//随机节点第一个默认选中
859
- if(maxOutgoing != 1 || (maxOutgoing == 1 &&checkActi == '0')){
860
-
861
- checkedItem.disable = false;
862
- checkedItem.checked = true;
863
- //nextSelectType = 'radom';
864
- checkActi = "1";
865
- }else{
866
- checkedItem.disable = false;
867
- checkedItem.checked = false;
868
- }
869
- }else{
870
- checkedItem.disable = false;
871
- checkedItem.checked = false;
872
- }
873
-
874
- if(item.must == true){
875
- checkedItem.disable = false;
876
- checkedItem.checked = true;
877
- checkedItem.must = true;
878
- checkActi = "1";
879
- }
880
- checkedItem.isRadio = radomIsRadio;//判断是否是单选还是多选
881
-
882
- checkedItem.mustHas = isMust;//随机节点是不是必须
883
- subRandomList.push(checkedItem);
884
- }
885
- });
886
- }
887
- }
888
-
889
- randomItem.subRandomList=subRandomList;
890
- var returnParam ={};
891
- returnParam.checkActi = checkActi;
892
- returnParam.randomItem = randomItem;
893
- return returnParam;
894
- }
895
-
896
-
897
- //提交点击
898
- handleSubmitClick() {
899
- let t = this;
900
- let comment = t.state.spyj;
901
- let hasCommentField = t.state.hasCommentField;
902
- let commentIsNotNull = t.state.commentIsNotNull;
903
-
904
- if(comment != '' && comment != null){
905
- if(comment.trim() == '' && hasCommentField== '1'){
906
- Toast.show({
907
- type: 'error',
908
- content: '意见不能为空!',
909
- });
910
- return false;
911
- }
912
- if(comment.length>200){
913
- Toast.show({
914
- type: 'error',
915
- content: '意见不能多于200字!',
916
- });
917
- return false;
918
- }
919
- }else{
920
- if( hasCommentField== '1' && commentIsNotNull == '1'){
921
- Toast.show({
922
- type: 'error',
923
- content: '意见不能为空!',
924
- });
925
- return false;
926
- }
927
-
928
- }
929
-
930
- //判断是否保存常用语
931
- let savePhrase = this.state.savePhrase;
932
- if(savePhrase.length>0 && comment.trim() != ''){
933
- DB.FlowModuleAPI.savePersonalPhrase({
934
- content:comment
935
- }).then((content) => {
936
- }).catch((error) => {
937
- console.error(error);
938
- });
939
- }
940
-
941
- var operate = this.state.operate;
942
- if(operate == 1){ //提交审批
943
- var nextRadomListSelect = this.state.nextRadomList;
944
- var nextActivityListSelect = this.state.nextActivityList;
945
- var nextSelectType = this.state.nextSelectType;//选择随机还是普通
946
- var selectedActivity = '';
947
- if(nextRadomListSelect.length>0 || nextActivityListSelect.length>0){ //下一个节点不为空时
948
-
949
- selectedActivity = '';
950
- var nextActivityList = [];
951
- if(nextSelectType == 'radom'){
952
- nextActivityList = nextRadomListSelect;
953
- }else{
954
- nextActivityList = nextActivityListSelect;
955
- }
956
- for(let i=0;i<nextActivityList.length;i++){
957
- var auditorUserIds = '';
958
- var auditorUserNames = '';
959
- var checked = nextActivityList[i].checked;
960
- if(checked){
961
- var personValue = nextActivityList[i].personValue;
962
- var isEnd=nextActivityList[i].end;
963
-
964
- if(personValue.length<=0 && !isEnd){
965
- Toast.show({
966
- type: 'error',
967
- content: '请选择审批人'
968
- });
969
- return false;
970
- }
971
- var participantMode = nextActivityList[i].participantMode;
972
- if(participantMode == 0){
973
- if(personValue.length>1){
974
- Toast.show({
975
- type: 'error',
976
- content: nextActivityList[i].name+'节点的参与人只能是单人,请重新设置流程!'
977
- });
978
- return false;
979
- }
980
- }
981
- if(!isEnd){
982
- let selectUserIds = '';
983
- personValue.map((item, index) => {
984
- if(selectUserIds.indexOf(item.scopeValue) == -1){
985
- selectUserIds +=item.scopeValue+",";
986
- auditorUserIds += (item.scopeValue + ',');
987
- auditorUserNames +=(item.scopeName+',');
988
- }
989
- });
990
- if(auditorUserIds != ''){
991
- auditorUserIds = auditorUserIds.substring(0,auditorUserIds.length-1);
992
- auditorUserNames = auditorUserNames.substring(0,auditorUserNames.length-1);
993
- }
994
- var level = nextActivityList[i].level;
995
- if(level == null){
996
- level = "";
997
- }
998
- selectedActivity += '{"id":"'+nextActivityList[i].value+'","name":"'+nextActivityList[i].name+'","participants":"'+auditorUserIds+'","participantNames":"'+auditorUserNames+'","level":"'+level+'"},';
999
- }else{
1000
- var level = nextActivityList[i].level;
1001
- if(level == null){
1002
- level = "";
1003
- }
1004
- selectedActivity += '{"id":"'+nextActivityList[i].value+'","name":"'+nextActivityList[i].name+'","level":"'+level+'"},';
1005
- }
1006
- }
1007
- }
1008
- if(selectedActivity != ''){
1009
- selectedActivity = selectedActivity.substring(0,selectedActivity.length-1);
1010
- selectedActivity = '['+selectedActivity+']';
1011
- }else{
1012
- Toast.show({
1013
- type: 'error',
1014
- content: '请选择节点'
1015
- });
1016
- return false;
1017
- }
1018
- }
1019
- let urgentListSelect = t.state.urgentSelectList;
1020
- let urgent = '';
1021
- for(let i=0;i<urgentListSelect.length;i++){
1022
- urgent += urgentListSelect[i].value+",";
1023
- }
1024
- if(urgent != ''){
1025
- urgent = urgent.substring(0,urgent.length-1);
1026
- }
1027
- if(urgent == '' && t.state.urgentHidden==false){
1028
- urgent='0';
1029
- }
1030
- var param = {
1031
- taskIds: t.state.taskIds,
1032
- processInstanceIds:t.state.processInstanceIds,
1033
- selectedActivity: selectedActivity,
1034
- module:t.state.module,
1035
- comment:t.state.spyj,
1036
- hasCommentField:t.state.hasCommentField,
1037
- newSignPicId:t.state.newSignPicId,
1038
- urgency:urgent,
1039
- lock:t.state.lock,
1040
- shortMessage:t.state.sendShortMessage,
1041
- }
1042
- var dealActionName = "";
1043
- if(this.state.isStart == true){
1044
- dealActionName = "提交";
1045
- }else{
1046
- dealActionName = "通过";
1047
- }
1048
- param.dealActionName = dealActionName;
1049
- this.sendFlowClick(param);
1050
- }else if(operate == 2){//驳回
1051
- this.backClick();
1052
- }else if(operate == 3){//转交
1053
- this.transferClick();
1054
- }
1055
-
1056
- }
1057
-
1058
- //取消
1059
- handleCancelClick(){
1060
- backPage();
1061
- }
1062
-
1063
- //批量提交发送
1064
- sendFlowClick(param){
1065
- let t = this;
1066
- var editType = '';
1067
- // if(this.props.params.dataId == ''){
1068
- // editType = "add";
1069
- // }else{
1070
- // editType = 'edit';
1071
- // }
1072
- param.editType = "edit";
1073
-
1074
- //var tasktype = this.state.tasktype;
1075
- var content = '是否要通过审批?';
1076
- if(param.dealActionName=='完成'){//随机流程
1077
- content = '是否要完成审批?';
1078
- }
1079
- let db = DB;
1080
- Dialog.confirm({
1081
- locale: 'zh_CN',
1082
- title: '提示',
1083
- content: content,
1084
- onConfirm() {
1085
- db.FlowModuleAPI.completeTaskBatch(param).then((content) => {
1086
- if(content.skipCount=="0" || content.skipCount==0){
1087
- Toast.show({
1088
- type: 'success',
1089
- content: '批量办理'+content.successCount+'条成功,'+content.skipCount+'条失败'
1090
- });
1091
- }else{
1092
- Toast.show({
1093
- type: 'success',
1094
- content: '批量办理'+content.successCount+'条成功,'+content.skipCount+'条失败,失败原因:审批设置不支持,后继活动或者审批人需要手动选择'
1095
- });
1096
- }
1097
-
1098
- let returnData = content.successList;
1099
- if(typeof(returnData) != 'undefined' && returnData != null){
1100
- for(var i=0;i<returnData.length;i++){
1101
-
1102
- var returnDataItem = returnData[i];
1103
- var barStatus = returnDataItem.status;
1104
- if(barStatus=='1'){
1105
- barStatus='6';
1106
- }else if(barStatus=='2'){
1107
- barStatus='1';
1108
- }
1109
- var barDataId = returnDataItem.dataId;
1110
- var barModules = returnDataItem.modules;
1111
- var formCode = returnDataItem.formCode;
1112
- var FlowCommon;
1113
-
1114
- try{
1115
- FlowCommon = require('pages/flow_common/'+barModules).default?require('pages/flow_common/'+barModules).default:require('pages/flow_common/'+barModules);
1116
- if(typeof FlowCommon !== 'undefined' && typeof FlowCommon.operateCallBack === "function"){
1117
- FlowCommon.operateCallBack({type:barStatus,dataId:barDataId,isBatch:1},t.state);
1118
- }
1119
- }catch(e){
1120
- // alert("exception: "+e.message);
1121
- }
1122
-
1123
-
1124
- var mobileExt;
1125
- try{
1126
- if (barModules) {
1127
- mobileExt = typeof eval(barModules + "_" + formCode + "_mobileExt") !== 'undefined'?eval(barModules + "_" + formCode + "_mobileExt"):null;
1128
- }
1129
- if(typeof mobileExt !== 'undefined' && typeof mobileExt["operateCallBack"] === "function"){
1130
- mobileExt["operateCallBack"]({type:barStatus,dataId:barDataId,isBatch:1},t.state);
1131
- }
1132
- }catch(e){
1133
- // alert("exception: "+e.message);
1134
- }
1135
-
1136
- }
1137
- }
1138
-
1139
- /*let returnData = content.successList;
1140
- if(typeof(returnData) != 'undefined' && returnData != null){
1141
- var dataIds = '';
1142
- var pIds = '';
1143
- var status = '';// 1 正常通过 2 正常结束
1144
- returnData.map(function(item){
1145
- dataIds += item.dataId+',';
1146
- pIds += item.processInstanceId + ',';
1147
- status = item.status;
1148
- });
1149
- if(dataIds){
1150
- dataIds = dataIds.substring(0,dataIds.length-1);
1151
- }
1152
- let type = 6;
1153
- if(status == 1){
1154
- }else if(status == 2){
1155
- type = 1;
1156
- //结束后推送消息
1157
- db.FlowModuleAPI.sendMessage({
1158
- type:'1',
1159
- module:t.state.module,
1160
- processInstanceId:pIds,
1161
- }).then((content) => {});
1162
- }
1163
- //处理特有参数
1164
- if(typeof FlowCommon.operateCallBack === "function"){
1165
- FlowCommon.operateCallBack({type:type,dataId:dataIds,isBatch:1},t.state);
1166
- }
1167
-
1168
- } */
1169
-
1170
- setTimeout(
1171
- function () {
1172
- backPage();
1173
- }, 1500);
1174
- }).catch((error) => {
1175
- if(typeof(error.errorMsg) == 'undefined'){
1176
- Toast.show({
1177
- type: 'error',
1178
- content: '流程设置有误,请联系管理员'
1179
- });
1180
- }else{
1181
- var message = error.errorMsg;
1182
- if(message.indexOf('exclusive gateway')!=-1){
1183
- message="请检查判断条件字段是否正确填写!";
1184
- }
1185
- Toast.show({
1186
- type: 'error',
1187
- content: message
1188
- });
1189
- }
1190
- });
1191
- },
1192
- onCancel() {
1193
- if(t.state.directlySubmit == '1'){
1194
- backPage();
1195
- }
1196
- },
1197
- });
1198
- }
1199
-
1200
- //选择紧急状态
1201
- selectUrgent(data){
1202
- this.setState({
1203
- urgentSelectList:data
1204
- });
1205
- }
1206
-
1207
- //选择提交审批用户
1208
- getPersion(i,newValue){
1209
- var nextActivityList = this.state.nextActivityList;
1210
- // for(var i=0; i<newValue.length; i++){
1211
- // form.personValue.push(newValue[i]);
1212
- // }
1213
- nextActivityList[i].personValue = newValue;
1214
- this.setState({
1215
- nextActivityList
1216
- });
1217
- }
1218
-
1219
- changeSendShortMessage(data){
1220
- let newremindStyle = "";
1221
- for(let i = 0; i < data.length; i++){
1222
- if(i == data.length-1) newremindStyle += data[i].value;
1223
- else newremindStyle += data[i].value + ',';
1224
- }
1225
- this.setState({
1226
- sendShortMessage:newremindStyle
1227
- });
1228
- }
1229
-
1230
- changeCirculateShortMessage(data){
1231
- let newremindStyle = "";
1232
- for(let i = 0; i < data.length; i++){
1233
- if(i == data.length-1) newremindStyle += data[i].value;
1234
- else newremindStyle += data[i].value + ',';
1235
- }
1236
- this.setState({
1237
- circulateShortMessage:newremindStyle
1238
- });
1239
- }
1240
-
1241
- //选择用户时
1242
- getChoosePerson(i,personValue,allPerson){
1243
- var nextActivityList = this.state.nextActivityList;
1244
- nextActivityList[i].personValue = personValue;
1245
- nextActivityList[i].allPerson = allPerson;
1246
- this.setState({
1247
- nextActivityList
1248
- });
1249
- }
1250
-
1251
- getRadomChoosePerson(j,i,personValue,allPerson){
1252
- var nextRadomList = this.state.nextRadomList;
1253
- var subRandomList = nextRadomList[j].subRandomList;
1254
- subRandomList[i].personValue = personValue;
1255
- nextRadomList[j].subRandomList = subRandomList;
1256
- //nextActivityList[i].allPerson = allPerson;
1257
- this.setState({
1258
- nextRadomList
1259
- });
1260
- }
1261
-
1262
- //选择节点
1263
- handleChecked(n,i,item,type,e){
1264
- var checked = item.checked;
1265
- var disable = item.disable;
1266
- var isRadio = item.isRadio;
1267
- var maxOutgoing = item.maxOutgoing;//1代表是排他单选,0代表多选
1268
- var value = item.value;
1269
- var mustHas = item.mustHas?item.mustHas:false;//某个活动节点至少选一个
1270
- if(!disable){//只有可选时才改变状态
1271
- let nextActivityList = [];
1272
- if(type == 'next'){
1273
- nextActivityList = this.state.nextActivityList;
1274
- }else{
1275
- nextActivityList = this.state.nextRadomList[n].subRandomList;
1276
- }
1277
- if(isRadio){//单选
1278
- if(!checked){//选中的时候
1279
- for (var j=0; j<nextActivityList.length; j++) {
1280
- if(nextActivityList[j].disable == true){
1281
- return false;
1282
- }
1283
- if(nextActivityList[j].isRadio){
1284
- if(type == 'radom'){
1285
- if( maxOutgoing == 1 || value == nextActivityList[j].value ){
1286
- nextActivityList[j].checked=false;
1287
- }
1288
- }else{
1289
- nextActivityList[j].checked=false;
1290
- }
1291
- }
1292
- }
1293
- nextActivityList[i].checked = !checked;
1294
- if(checked==false && item.end == false){//当选中时
1295
- this.refs[item.value+"_"+i].clickAdd();
1296
- }
1297
- }else{//取消选中的时候
1298
- if(item.must == true || mustHas == true){
1299
- return false;
1300
- }else{
1301
- nextActivityList[i].checked = !checked;
1302
- }
1303
- }
1304
- }else{
1305
- if(!checked){//选中的时候
1306
- // if(item.must == true){
1307
- // return false;
1308
- // }else{
1309
- nextActivityList[i].checked = !checked;
1310
- if(checked==false && item.end == false){//当选中时
1311
- this.refs[item.value+"_"+i].clickAdd();
1312
- }
1313
- // }
1314
- }else{
1315
- if(mustHas == true){//当必须有的时候
1316
- var no = 0;
1317
- for(var m=0;m<nextActivityList.length;m++){
1318
- if(m != i && nextActivityList[m].value==value && nextActivityList[m].checked==true){
1319
- no++;
1320
- }
1321
- }
1322
- if(no>0){//有其他的选中值时就会取消
1323
- nextActivityList[i].checked = !checked;
1324
- }
1325
- }else{
1326
- if(item.must == true){
1327
- return false;
1328
- }
1329
- nextActivityList[i].checked = !checked;
1330
- }
1331
- }
1332
- }
1333
-
1334
-
1335
- if(maxOutgoing == '1'){//只有是随机和后继是单选的时候才可以取消另外一个选择
1336
- if(type == 'next'){//选的是后继节点
1337
- var nextRadomListMain = this.state.nextRadomList;
1338
- nextRadomListMain.map(function(item1){
1339
- var nextRadomListItem = item1.subRandomList;
1340
- nextRadomListItem.map(function(item2){
1341
- item2.checked = false;
1342
- });
1343
- });
1344
-
1345
- this.setState({
1346
- nextActivityList:nextActivityList,
1347
- nextRadomList:nextRadomListMain,
1348
- //nextSelectType:type
1349
- })
1350
- }else{//选的是随机节点
1351
- var nextActivity = this.state.nextActivityList;
1352
- var nextRadomListMain = this.state.nextRadomList;
1353
- if(!checked){
1354
- nextActivity.map(function(item){
1355
- item.checked = false;
1356
- });
1357
-
1358
- nextRadomListMain.map(function(item1,f){
1359
- if(f != n){
1360
- var nextRadomListItem = item1.subRandomList;
1361
- nextRadomListItem.map(function(item2){
1362
- item2.checked = false;
1363
- });
1364
- }else{
1365
- item1.subRandomList = nextActivityList;
1366
- }
1367
- });
1368
- }
1369
- this.setState({
1370
- nextActivityList:nextActivity,
1371
- nextRadomList:nextRadomListMain,
1372
- //nextSelectType:type
1373
- });
1374
- }
1375
-
1376
- }else{
1377
- if(type == 'next'){//选的是后继节点
1378
- this.setState({
1379
- nextActivityList:nextActivityList,
1380
- //nextSelectType:type
1381
- });
1382
- }else{//选的是随机节点
1383
- var nextRadomListMain = this.state.nextRadomList;
1384
- nextRadomListMain[n].subRandomList = nextActivityList;
1385
- this.setState({
1386
- nextRadomList:nextRadomListMain,
1387
- //nextSelectType:type
1388
- });
1389
- }
1390
- }
1391
-
1392
-
1393
- }
1394
- }
1395
-
1396
- //切换节点内容显示
1397
- handleShow(j,i,arrow,show,type,e){
1398
- let t = this;
1399
- if(type == 'next'){//下一个后继活动
1400
- var nextActivityList = this.state.nextActivityList;
1401
- nextActivityList[i].arrow = !arrow;
1402
- nextActivityList[i].show = !show;
1403
- t.setState({
1404
- nextActivityList:nextActivityList,
1405
- });
1406
- }else if(type == 'radom'){//下一个随机活动
1407
- var nextRadomList = this.state.nextRadomList;
1408
- var subRandomList = nextRadomList[j].subRandomList;
1409
- subRandomList[i].arrow = !arrow;
1410
- subRandomList[i].show = !show;
1411
- nextRadomList[j].subRandomList = subRandomList;
1412
- t.setState({
1413
- nextRadomList:nextRadomList,
1414
- });
1415
- }
1416
-
1417
-
1418
- }
1419
-
1420
-
1421
- //修改审批意见
1422
- changeSpyj(newValue) {
1423
- this.setState({
1424
- spyj: newValue,
1425
- });
1426
- }
1427
-
1428
-
1429
- //选择常用语
1430
- selectCommonwords(){
1431
- let t = this;
1432
- let phraseListNow = t.state.phraseList;
1433
- if(phraseListNow.length>0){
1434
- t.refs.slotCommonwords.show();
1435
- }else{
1436
- //获取常用语列表
1437
- DB.FlowModuleAPI.getPersonalPhrase({
1438
- }).then((content) => {
1439
- if(content.length>0){
1440
- var phraseList1 = []
1441
- content.map(function(item){
1442
- phraseList1.push({text:item.content,value:item.content});
1443
- });
1444
- var phraseList2 = [];
1445
- phraseList2.push(phraseList1);
1446
- t.setState({
1447
- phraseList:phraseList2,
1448
- },function(){
1449
- t.refs.slotCommonwords.show();
1450
- })
1451
- }else{
1452
- Toast.show({
1453
- content: '暂无常用语',
1454
- });
1455
- }
1456
- }).catch((error) => {
1457
- Toast.show({
1458
- type: 'error',
1459
- content: '网络异常'
1460
- });
1461
- });
1462
- }
1463
- }
1464
-
1465
- //选择是否保存常用语
1466
- selectSavePhrase(data){
1467
- this.setState({
1468
- savePhrase:data
1469
- });
1470
- }
1471
-
1472
- //切换修改常用语
1473
- handleChangeCommonwords(value) {
1474
- // 改变了选中项
1475
- this.setState({
1476
- choosePhrase:value,
1477
- });
1478
- }
1479
-
1480
- //确认选择语
1481
- handleConfirmCommonwords(commonwords){
1482
- let spyj = this.state.spyj;
1483
- this.setState({
1484
- spyj:spyj+commonwords[0].text
1485
- });
1486
- }
1487
-
1488
- //上传更新签名图片
1489
- updateSign(fileId){
1490
- this.setState({
1491
- newSignPicId:fileId
1492
- });
1493
- }
1494
-
1495
-
1496
- render() {
1497
- const t = this;
1498
- return (
1499
- <div className="document-details t-PB68" >
1500
- <Box className={(this.state.hasCommentField == '1' || true)&& (this.state.operate == 1 || this.state.operate == 2 ||this.state.operate == 3||this.state.operate == 5||this.state.operate == 10||this.state.operate == 11) ? 't-BCf dd-bottom-border': 't-DN'}>
1501
- <div style={{background:'#f2f3f5',height:'35px',padding:'10px 5px'}}><span className="t-FCblue">{this.state.operate==1?"审批意见":this.state.operate==2?'驳回意见':this.state.operate==3?'转交意见':this.state.operate==5?'跳转意见':this.state.operate==10?'完成意见':'签阅意见'}</span><span className="t-FCblue t-FR" onClick={this.selectCommonwords.bind(this)}>常用语</span></div>
1502
- <TextareaField
1503
- readOnly={false}
1504
- minRows={10} maxRows={13}
1505
- placeholder={this.state.operate==1?"请输入审批意见":this.state.operate==2?'请输入驳回意见':this.state.operate==3?'请输入转交意见':this.state.operate==5?'请输入跳转意见':this.state.operate==10?'请输入完成意见':'请输入签阅意见'}
1506
- value={this.state.spyj}
1507
- onChange={this.changeSpyj.bind(this)}/>
1508
- <Slot
1509
- ref="slotCommonwords"
1510
- data={this.state.phraseList}
1511
- value={this.state.choosePhrase}
1512
- title="选择常用语"
1513
- onConfirm={this.handleConfirmCommonwords.bind(this)}
1514
- onChange={this.handleChangeCommonwords.bind(this)}
1515
- />
1516
- </Box>
1517
-
1518
- <Box className={this.state.operate == 1?'t-BCf dd-bottom-border':'t-DN'}>
1519
- <div className={this.state.nextActivityList.length==0 && this.state.nextRadomList.length == 0?'t-DN':''} style={{background:'#f2f3f5',height:'35px',padding:'10px 5px'}}><span className="t-FCblue"><i className="iconfont icon-back t-rotate-180 t-FS14 t-FR"></i>审批环节</span></div>
1520
-
1521
- {/* 随机活动 */}
1522
- <HBox vAlign="center" className={this.state.nextRadomList.length==0?'t-DN':'t-BB1 t-PT8 t-PB8'}>
1523
- <Box className="t-LH24 t-FS14 t-PL18 t-FCa" flex={1}>随机活动</Box>
1524
- </HBox>
1525
- {
1526
- this.state.nextRadomList.map(function(item1,j){
1527
- return (
1528
- <div >
1529
- <div className={'t-BCf7 t-H10'}></div>
1530
- <HBox vAlign="center" className={'t-BB1 t-PT8 t-PB8'}>
1531
- <Box className="t-LH24 t-FS13 t-PL22 t-FCb" flex={1}>{item1.name}</Box>
1532
- </HBox>
1533
- {
1534
- item1.subRandomList.map(function(item,i){
1535
- return (
1536
- <div className={i>0?'t-BT1':''}>
1537
- <HBox vAlign="center" className="t-BB1">
1538
- <HBox flex={1} className="t-PL16 t-PT10 t-PB10" onClick={this.handleChecked.bind(this,j,i,item,"radom")}>
1539
- <Box id={i} className={item.checked == false?"t-checkbox-field-icon-list un-checked":item.disable?"t-checkbox-field-icon checked disable t-checkbox-field-icon-list":"t-checkbox-field-icon-list"} >
1540
- <i className="iconfont icon-checked t-FCf t-FS14"></i>
1541
- </Box>
1542
- <Box className="t-LH24 t-FS16 t-PL18 t-omit" flex={1}>{item.name}</Box>
1543
- </HBox>
1544
- <Box className={item.end?'t-DN':'t-PL16 t-PR16'} onClick={this.handleShow.bind(this,j,i,item.arrow,item.show,"radom")}>
1545
- <i className={item.arrow?"iconfont icon-arrow-up t-FCc":"iconfont icon-arrow-down t-FCc"}></i>
1546
- </Box>
1547
- </HBox>
1548
- <Box className={item.show?"":"t-DN"} >
1549
- <SelectMember
1550
- required={false}
1551
- isShowInMyOrg={true}
1552
- readOnly={item.selectUserReadOnly}
1553
- label={'审批人'}
1554
- placeholder="请选择"
1555
- code={item.code}
1556
- chooseType={item.chooseType}
1557
- checkType={item.participantMode=='0'?'radio':'checkbox'}
1558
- ref={item.value+"_"+i}
1559
- isDelete={true}
1560
- defaultValue={item.personValue}
1561
- commonUsedData={item.commonUsedData}
1562
- onChange={this.getRadomChoosePerson.bind(this,j,i)}
1563
- />
1564
- </Box>
1565
- </div>
1566
- )}.bind(this))}
1567
- </div>
1568
- )}.bind(this))}
1569
-
1570
- {/* 后继活动 */}
1571
- <HBox vAlign="center" className={this.state.nextActivityList.length==0?'t-DN':'t-BB1 t-PT8 t-PB8'}>
1572
- <Box className="t-LH24 t-FS14 t-PL16 t-FCa" flex={1}>后继活动</Box>
1573
- </HBox>
1574
- {
1575
- this.state.nextActivityList.map(function(item,i){
1576
- return (
1577
- <div className={i>0?'t-BT1':''}>
1578
- <HBox vAlign="center" className="t-BB1">
1579
- <HBox flex={1} className="t-PL16 t-PT10 t-PB10" onClick={this.handleChecked.bind(this,i,i,item,"next")}>
1580
- <Box id={i} className={item.checked == false?"t-checkbox-field-icon-list un-checked":item.disable?"t-checkbox-field-icon checked disable t-checkbox-field-icon-list":"t-checkbox-field-icon-list"} >
1581
- <i className="iconfont icon-checked t-FCf t-FS14"></i>
1582
- </Box>
1583
- <Box className="t-LH24 t-FS16 t-PL18 t-omit" flex={1}>{item.name}</Box>
1584
- </HBox>
1585
- <Box className={item.end?'t-DN':'t-PL16 t-PR16'} onClick={this.handleShow.bind(this,i,i,item.arrow,item.show,"next")}>
1586
- <i className={item.arrow?"iconfont icon-arrow-up t-FCc":"iconfont icon-arrow-down t-FCc"}></i>
1587
- </Box>
1588
- </HBox>
1589
- <Box className={item.end==true||item.show==false?"t-DN":""} >
1590
- <SelectMember
1591
- readOnly={item.selectUserReadOnly}
1592
- label={'审批人'}
1593
- placeholder="请选择"
1594
- code={item.code}
1595
- chooseType={item.chooseType}
1596
- checkType={item.participantMode=='0'?'radio':'checkbox'}
1597
- ref={item.value+"_"+i}
1598
- isDelete={true}
1599
- defaultValue={item.personValue}
1600
- commonUsedData={item.commonUsedData}
1601
- commonTreeData={item.commonTreeData}
1602
- onChange={this.getChoosePerson.bind(this,i)}
1603
- queryLimit={item.participants==''?'':'5'}
1604
- limitData={item.participants==''?'':item.participants}
1605
- />
1606
- </Box>
1607
- </div>
1608
- )}.bind(this))}
1609
- <CheckboxField
1610
- data={this.state.shortMessageList}
1611
- className=''
1612
- mode="list"
1613
- onChange={this.changeSendShortMessage.bind(this)}
1614
- required={false}/>
1615
-
1616
- </Box>
1617
-
1618
- <div className={this.state.directlySubmit=='0'?"t-P0 t-bottom-fixed":'t-DN'}>
1619
- <Button.Group>
1620
- <Button type="secondary" display="banner" onClick={this.handleCancelClick.bind(this)}>取消</Button>
1621
- <Button type="primary" display="banner"
1622
- onClick={this.handleSubmitClick.bind(this)}>确认</Button>
1623
-
1624
- </Button.Group>
1625
- </div>
1626
- </div>
1627
- )
1628
- }
1629
- }