fmui-base 2.2.11 → 2.2.12

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,1299 +0,0 @@
1
- import React from 'react';
2
-
3
- import Tab from 'saltui/lib/Tab';
4
- import SearchBar from 'saltui/lib/SearchBar';
5
- import ScrollList from '../ScrollList/ScrollList';
6
- import Boxs from 'saltui/lib/Boxs';
7
- import Toast from 'saltui/lib/Toast';
8
- import Button from 'saltui/lib/Button';
9
- import Popup from 'saltui/lib/Popup';
10
- import Filter from 'saltui/lib/Filter'
11
-
12
- import AngleRight from 'salt-icon/lib/AngleRight';
13
- const { HBox, Box } = Boxs;
14
-
15
- import Variables from '../db/variables';
16
- import DB from '../db/db';
17
-
18
- import './processList.less';
19
- let searchVal = '';
20
- var isPageHide = false;
21
- window.addEventListener('pageshow', function () {
22
- console.log("isPageHide==="+isPageHide);
23
- if (isPageHide) {
24
- window.location.reload();
25
- }
26
- });
27
- class ListItem extends React.Component {
28
-
29
- constructor(props) {
30
- super(props);
31
- setPageTitle('办理');
32
- }
33
-
34
- clickDetail(event) {
35
- if (this.props.isBatch) {//批量状态
36
- let checkDiv = $(event.currentTarget).find(".t-checkbox-field-icon-list")
37
- if (checkDiv.hasClass("un-checked")) {//判断是否未选中
38
- checkDiv.removeClass("un-checked");
39
- checkDiv.addClass("checked");
40
- } else {
41
- checkDiv.removeClass("checked");
42
- checkDiv.addClass("un-checked");
43
- }
44
- } else {
45
- if (this.props.ableClick) {
46
- let itemInfo = this.props.data;
47
- console.log(itemInfo);
48
- let param_processKey = itemInfo.processKey; // 流程类型code
49
- let param_formKey = itemInfo.formKey; // 表单id
50
- let param_businessKey = itemInfo.businessKey; // 表单数据id;
51
- let param_startUserId = itemInfo.startUserId; // 流程发起人id
52
- let param_list_type = this.props.type; // 列表类型 待办-0,待阅-1,
53
- let processName = itemInfo.processName; // 流程名称
54
- let module = itemInfo.module; // 流程名称
55
- let type = this.props.fromType; //self:本应用,all:全模块
56
- let projectPath = this.props.projectPath; //项目路径
57
-
58
- let taskId = '';
59
- let processInstanceId = itemInfo.processInstanceId;
60
- if (param_list_type == '2') {
61
- taskId = itemInfo.taskId;
62
- } else {
63
- taskId = itemInfo.id;
64
- }
65
- let loginUserId = getLoginUserInfo().userId;
66
- // location.hash = 'approval/approval-details/detail-servlet/' + param_list_type + '/1/' + param_processKey + '/' + param_formKey + '/' +param_businessKey +
67
- // '/' + param_startUserId;
68
- // alert(searchVal);
69
- if (type == "self") {
70
- let url = "process/processDetails/" + taskId + "/" + param_formKey + "/" + param_businessKey + "/" + param_list_type + "/0/" + processInstanceId + "/" + module + "/" + loginUserId;
71
- if (searchVal != '') {
72
- url += "/" + searchVal;
73
- }
74
- decodeURI(url);
75
- location.hash = url;
76
- } else {
77
- isPageHide = true;
78
- let fullUrl = window.location.href;
79
- fullUrl = fullUrl.replace(/clientType/g,"") ;
80
- fullUrl = fullUrl.replace(/thirdMenuType/g,"") ;
81
- fullUrl = fullUrl.replace(/clientAppType/g,"") ;
82
- var mobilePath = module;
83
- //projectPath = modules/mobileoffice
84
- // 预算模块跳转特殊处理
85
- if(module=='bud_cost'){
86
- fullUrl = fullUrl.replace("/" + projectPath + "/", "/budget/budgetcost/").split('?_')[0].split('/approval/all')[0];
87
- }else if(module=='bud_project'){
88
- fullUrl = fullUrl.replace("/" + projectPath + "/", "/budget/budgetproject/").split('?_')[0].split('/approval/all')[0];
89
- }else if(module=='hoa_topic' || module=='hoa_funds' || module=='hoa_achievements'){
90
- fullUrl = fullUrl.replace("/" + projectPath + "/", "/ky/ky/").split('?_')[0].split('/approval/all')[0];
91
- }else if( module.indexOf("dj_") != '-1' || module.indexOf("jj_") != '-1' || module.indexOf("zdh_") != '-1' || module.indexOf("gh_") != '-1'){
92
- fullUrl = fullUrl.split('?_')[0].split('/approval/all')[0];
93
- }else if (module.indexOf("hoa_") != '-1') {
94
- var category = module.split("_")[0];
95
- mobilePath = module.substring(module.indexOf("_") + 1);
96
- fullUrl = fullUrl.replace("/" + projectPath + "/", "/" + category + "/" + mobilePath + "/").split('?_')[0].split('/approval/all')[0];
97
- } else {
98
- fullUrl = fullUrl.replace("/" + projectPath + "/", "/modules/" + mobilePath + "/").split('?_')[0].split('/approval/all')[0];
99
- }
100
- //alert(fullUrl);
101
- let url = "process/processDetails/" + taskId + "/" + param_formKey + "/" + param_businessKey + "/" + param_list_type + "/0/" + processInstanceId + "/" + module + "/" + loginUserId;
102
- url = fullUrl + '/' + url;
103
- decodeURI(url);
104
- location.href = url;
105
- }
106
-
107
- // window.salt.router.push({
108
- // id: 'detailPage',
109
- // url: url,
110
- // anim: 1,
111
- // needPost: true,
112
- // param: {
113
- // title: processName,
114
- // }
115
- // }).then().catch((e) => {
116
- // // alert(e);
117
- // });
118
- } else {
119
- this.props.updateAbleClick(true);
120
- }
121
- }
122
- }
123
-
124
-
125
- render() {
126
- let data = this.props;
127
- let checkIsNotComplete = true;
128
- if (data.type == 0) { //待办
129
- checkIsNotComplete = true;
130
- } else if (data.type == 1) { //待阅
131
- if (data.status == 2) {
132
- checkIsNotComplete = false;
133
- } else {
134
- checkIsNotComplete = true;
135
- }
136
- } else if (data.type == 2) { //已办
137
- if (data.status == 2) {
138
- checkIsNotComplete = false;
139
- } else {
140
- checkIsNotComplete = true;
141
- }
142
- } else if (data.type == 3) { //已阅
143
- if (data.status == 2) {
144
- checkIsNotComplete = false;
145
- } else {
146
- checkIsNotComplete = true;
147
- }
148
- } else { //我的
149
- if (typeof (data.finishedTime) == 'undefined' || data.finishedTime == null) {
150
- checkIsNotComplete = true;
151
- } else {
152
- checkIsNotComplete = false;
153
- }
154
- }
155
- let comleteName = data.name;
156
- if (data.type == 0) { //待办
157
- // comleteName= data.curStepName;
158
- } else if (data.type == 1) { //待阅
159
- comleteName = data.nodeName;
160
- } else if (data.type == 2) { //已办
161
- if (data.status == '2') {
162
- comleteName = "结束";
163
- checkIsNotComplete = false;
164
- } else if (data.status == '3') {
165
- comleteName = "作废";
166
- checkIsNotComplete = false;
167
- } else if (data.status == '4') {
168
- comleteName = "取消";
169
- checkIsNotComplete = false;
170
- } else {
171
- comleteName = data.nodeName;
172
- }
173
- } else if (data.type == 3) { //已阅
174
- comleteName = data.nodeName;
175
- } else { //我的
176
- if (data.status == '2') {
177
- comleteName = "结束";
178
- checkIsNotComplete = false;
179
- } else if (data.status == '3') {
180
- comleteName = "作废";
181
- checkIsNotComplete = false;
182
- } else if (data.status == '4') {
183
- comleteName = "取消";
184
- checkIsNotComplete = false;
185
- } else {
186
- comleteName = data.nodeName;
187
- }
188
- }
189
- if (typeof (comleteName) == 'undefined' || comleteName == null) {
190
- checkIsNotComplete = false;
191
- }
192
-
193
- let assigneeName = '申请人:' + data.startUserName;
194
-
195
- if (data.type == 0) { //待办
196
- assigneeName = '申请人:' + data.startUserName;
197
- } else if (data.type == 1) { //待阅
198
- assigneeName = '申请人:' + data.startUserName;
199
- } else if (data.type == 2) { //已办
200
- if (data.curUserName) {
201
- assigneeName = '办理人:' + data.curUserName;
202
- }
203
- } else if (data.type == 3) { //已阅
204
- if (data.startUserName) {
205
- assigneeName = '申请人:' + data.startUserName;
206
- }
207
- } else if (data.type == 4) { //我的
208
- if (data.curUserName) {
209
- assigneeName = '办理人:' + data.curUserName;
210
- }
211
- }
212
- if (typeof (assigneeName) == 'undefined' || assigneeName == null) {
213
- checkIsNotComplete = false;
214
- }
215
- let formatTime = data.createTime;
216
-
217
- if (data.type == 0) { //待办
218
- formatTime = data.createTime;
219
- } else if (data.type == 1) { //待阅
220
- formatTime = data.createTime;
221
- } else if (data.type == 2) { //已办
222
- formatTime = data.dealTime;
223
- } else if (data.type == 3) { //已阅
224
- formatTime = data.endTime;
225
- } else { //我的
226
- formatTime = data.createTime;
227
- }
228
-
229
- var now = new Date();
230
- var year = now.getFullYear(); //年
231
- var month = now.getMonth() + 1; //月
232
- var day = now.getDate(); //日
233
- var hh = now.getHours(); //时
234
- var mm = now.getMinutes(); //分
235
- var ss = now.getSeconds(); //秒
236
- let clock = year + "-";
237
- if (month < 10)
238
- clock += "0";
239
- clock += month + "-";
240
- if (day < 10)
241
- clock += "0";
242
- clock += day + " ";
243
-
244
- if (hh < 10)
245
- clock += "0";
246
-
247
- clock += hh + ":";
248
- if (mm < 10) clock += '0';
249
- clock += mm + ":";
250
-
251
- if (ss < 10) clock += '0';
252
- clock += ss;
253
- return (
254
-
255
- // <HBox className='approve-item'>
256
- // <Box className="approve-check">
257
- // <Box className={'t-checkbox-field-icon-list un-checked t-MR10'} >
258
- // <i className="iconfont icon-checked t-FCf t-FS14"></i>
259
- // </Box>
260
- // </Box>
261
- // <Box className="approve-right-text">
262
- // <HBox className='approveItem-title'>
263
- // <Box className="label label-danger">加急</Box>
264
- // <Box className="label label-info">暂不办理</Box>
265
- // <Box className="label label-warn">超时</Box>
266
- // <Box className="label label-primary">正常</Box>
267
- // <Box className="title">五月行政总值班值班表</Box>
268
- // </HBox>
269
- // <HBox className='approveItem-tag'>
270
- // <span className='label label-primary'>审核意见审核意见</span>
271
- // <i className='iconfont icon-right-arrow'></i>
272
- // </HBox>
273
- // <HBox className="bottom-text">
274
- // <Box className="text-item">申请人:王小红</Box>
275
- // <Box className="text-item">2022-08-28 10:58:58</Box>
276
- // </HBox>
277
- // </Box>
278
- // </HBox>
279
- <HBox className='approve-item' onClick={this.clickDetail.bind(this)}>
280
- <Box className="approve-check">
281
- <Box className={this.props.isBatch == false ? 't-DN' : 't-checkbox-field-icon-list un-checked t-MR10'} data-taskId={this.props.id} data-module={this.props.module} data-processInstanceId={this.props.processInstanceId} >
282
- <i className="iconfont icon-checked t-FCf t-FS14"></i>
283
- </Box>
284
- </Box>
285
- <Box className="approve-right-text">
286
- <HBox className='approveItem-title'>
287
- <Box className={this.props.urgency == '1' && this.props.type == 0 ? 'label label-danger' : 't-DN'}>加急</Box>
288
- <Box className={this.props.dueDate != null && this.props.dueDate < clock && this.props.type == 0 ? 'label label-warn' : 't-DN'}>超时</Box>
289
- <Box className={this.props.deleted != null && this.props.deleted == '1' && this.props.type == 0 ? 'label label-info' : 't-DN'}>暂不办理</Box>
290
- <Box className="title">{this.props.title}</Box>
291
- </HBox>
292
- <HBox className='approveItem-tag'>
293
- <span className='label label-primary'>{comleteName}</span>
294
- </HBox>
295
- <HBox className="bottom-text">
296
- <Box className={checkIsNotComplete ? "text-item" : "t-DN"}>{assigneeName}</Box>
297
- <Box className="text-item">{formatTime}</Box>
298
- </HBox>
299
- </Box>
300
- <i className='iconfont icon-right-arrow'></i>
301
- </HBox>
302
-
303
- );
304
- }
305
- };
306
-
307
-
308
-
309
- const transactionIndex = {
310
- activeTabIndex: '',
311
- }
312
-
313
-
314
- export default class PageHome extends React.Component {
315
-
316
- constructor(props) {
317
-
318
- document.addEventListener('resume', function (e) { });
319
- super(props);
320
- setPageTitle('办理');
321
- // 禁用iOS弹性事件
322
- if (navigator.userAgent.indexOf('DingTalk') > -1) {
323
- dd.ui.webViewBounce.disable();
324
- }
325
- //获取内容显示区域高度
326
- var hasBottomTabHidden = document.getElementById("hasBottomTab") ? document.getElementById("hasBottomTab").value : "0";
327
- var hasBottomTab = props.hasBottomTab ? props.hasBottomTab : hasBottomTabHidden;
328
- var winHeight = getScrollHigh(1, 1, hasBottomTab);
329
-
330
-
331
- var constIndex = document.getElementById("activeTabIndex").value;//常量
332
- var activeIndex = props.activeIndex ? props.activeIndex : 0;
333
- var type = props.type ? props.type : "self";//self:本应用,all:全模块
334
- var module = props.module ? props.module : type == "self" ? "approve" : "";
335
- var hasBatch = eval(props.hasBatch ? props.hasBatch : "true");//是否有批量办理
336
- var tabCodes = props.tabCodes ? props.tabCodes : "undo,unread,done,read,myself";//标签页
337
- var searchVal = props.search;
338
-
339
- var projectPath = props.projectPath ? props.projectPath : "modules/mobileoffice";
340
- if (constIndex == '') {
341
- if (!activeIndex) {
342
- activeIndex = '0';
343
- }
344
- constIndex = activeIndex;
345
- } else {
346
- activeIndex = constIndex;
347
- }
348
- var undoListUrl;
349
- var unreadListUrl;
350
- var doneListUrl;
351
- var readListUrl;
352
- var myselfListUrl;
353
- if (type == "self") {
354
- undoListUrl = Variables.URLS.transaction.undo + "&module=" + module;
355
- unreadListUrl = Variables.URLS.transaction.unread + "&module=" + module;
356
- doneListUrl = Variables.URLS.transaction.done + "&module=" + module;
357
- readListUrl = Variables.URLS.transaction.read + "&module=" + module;
358
- myselfListUrl = Variables.URLS.transaction.myself + "&module=" + module;
359
- } else {
360
- undoListUrl = Variables.URLS.transaction.undo + "&unified=1&sourceType=unitedapprove&module=" + module;
361
- unreadListUrl = Variables.URLS.transaction.unread + "&unified=1&sourceType=unitedapprove&module=" + module;
362
- doneListUrl = Variables.URLS.transaction.done + "&unified=1&sourceType=unitedapprove&module=" + module;
363
- readListUrl = Variables.URLS.transaction.read + "&unified=1&sourceType=unitedapprove&module=" + module;
364
- myselfListUrl = Variables.URLS.transaction.myself + "&unified=1&sourceType=unitedapprove&module=" + module;
365
- }
366
- this.state = {
367
- tabCodes: tabCodes,
368
- type: type,
369
- activeTabIndex: activeIndex, // 待办-0;待阅-1;已办-2;已阅-3;我的-4
370
- winHeight: winHeight,
371
- projectPath: projectPath,
372
- page: 0,
373
- search0: searchVal,
374
- search1: searchVal,
375
- search2: searchVal,
376
- search3: searchVal,
377
- search4: searchVal,
378
- titleCount: {
379
- undo: 0, // 待办
380
- unread: 0, // 待阅
381
- done: 0, // 已办
382
- read: 0, // 已阅
383
- myself: 0, // 我的
384
- },
385
- ableClick: true,//列表是否可点击,
386
- isBatch: false,
387
- noDataTip0: '暂无数据',
388
- noDataTip1: '暂无数据',
389
- noDataTip2: '暂无数据',
390
- noDataTip3: '暂无数据',
391
- noDataTip4: '暂无数据',
392
- module: module,
393
- undoListUrl: undoListUrl,
394
- unreadListUrl: unreadListUrl,
395
- doneListUrl: doneListUrl,
396
- readListUrl: readListUrl,
397
- myselfListUrl: myselfListUrl,
398
- hasBatch: hasBatch,
399
- categoryList: [],
400
- categoryListTitle: '全部分类',
401
- category0: [],
402
- category1: [],
403
- category2: [],
404
- category3: [],
405
- category4: [],
406
- };
407
- this.getTransactionTitleCount(module, "undo,unread");
408
- this.getCategoryListByModule(module);
409
- /**
410
- * 办理页面搜索框设置项
411
- * @type {{locale: string, instantSearch: boolean, hasHistory: boolean, searchDelay: number, onEnter: (()), onExit: (()), onChange: ((p1:*)), onSearch: ((p1?:*))}}
412
- */
413
- this.searchBarProps = {
414
- placeholder: "请输入流程标题查询",
415
- instantSearch: false,
416
- hasHistory: false,
417
- searchDelay: 450,
418
- value: searchVal,
419
- exitAfterEnter: false,
420
- onEnter: () => { console.log('enter'); },
421
- onExit: this.onExit.bind(this),
422
- onChange: (value) => {
423
- console.log(`Typing>>${value}`);
424
- },
425
- onSearch: this.onSearch.bind(this)
426
- };
427
-
428
-
429
-
430
- }
431
-
432
- componentDidMount() {
433
- var obj = $("title");
434
- obj.text("办理");
435
- var thirdMenuType = getLoginUserInfo().thirdMenuType;
436
- if (thirdMenuType == 'DING') {
437
- dd.biz.navigation.setTitle({
438
- title: "办理",//控制标题文本,空字符串表示显示默认文本
439
- onSuccess: function (result) { },
440
- onFail: function (err) { }
441
- });
442
- } else if (thirdMenuType == 'MH' && typeof (emp) != "undefined") {
443
- emp.window.setTitle({
444
- title: {
445
- text: "办理",
446
- icon: '',
447
- actionmenu: {}
448
- },
449
- });
450
- }
451
- $("#App").removeAttr("style");
452
- Popup.hide();
453
- // dd.ready(function(){
454
- // document.addEventListener('resume', function(e) {
455
- // this.refs.transaction_undo_ref.fetchData(param);
456
- // this.refs.transaction_done_ref.fetchData(param);
457
- // this.refs.transaction_myself_ref.fetchData(param);
458
- // });
459
- // });
460
-
461
- }
462
-
463
- /**
464
- * tab页切换方法
465
- * @param obj
466
- */
467
- handleTabChange(obj) {
468
- var t = this;
469
- // this.setState({ activeTabIndex:obj.active });
470
- var active = obj.active;
471
- console.log(active);
472
- document.getElementById("activeTabIndex").value = active;
473
- this.setState({
474
- activeTabIndex: active,
475
- page: 0,
476
- selectAll: true,
477
- isBatch: false
478
- });
479
- var preActive = obj.preActive;
480
-
481
- // 点击tab页签,关闭遮罩
482
- $('.title-wrapper.active').click()
483
- }
484
-
485
- /**
486
- * 获取页面 标题数量 方法
487
- */
488
- getTransactionTitleCount(module, codes) {
489
- let t = this;
490
- DB.FlowApproval.getApproveCount({
491
- module: module,
492
- codes: codes,
493
- }).then((content) => {
494
- this.state.titleCount.undo = content.undo;
495
- this.state.titleCount.unread = content.unread;
496
-
497
- }).catch((error) => {
498
- console.log(error);
499
- });
500
- }
501
-
502
- /**
503
- * 获取分类
504
- */
505
- getCategoryListByModule(module) {
506
- let t = this;
507
- DB.FlowApproval.getCategoryListByModule({
508
- module: module,
509
- }).then((content) => {
510
- if (content) {
511
- this.state.categoryList = content;
512
- }
513
-
514
- }).catch((error) => {
515
- console.log(error);
516
- });
517
- }
518
-
519
- /**
520
- * ScrollList 请求数据之前的函数
521
- */
522
- beforeFetch0(data, from) {
523
- this.setState({
524
- ableClick: false
525
- });
526
- //alert("this.state.search: " + JSON.stringify(this.state.search) + ';;;param: ' + JSON.stringify(from));
527
- data.corpId = corpid;
528
- // data.code = ;
529
- let search = from.title;
530
- let cate = from.category;
531
- if (search == undefined) {
532
- data.title = this.state.search0;
533
- } else {
534
- data.title = from.title;
535
- }
536
- if (cate == undefined) {
537
- data.category = this.state.category0;
538
- } else {
539
- data.category = from.category;
540
- }
541
- return data;
542
-
543
- }
544
- beforeFetch1(data, from) {
545
- this.setState({
546
- ableClick: false
547
- });
548
- //alert("this.state.search: " + JSON.stringify(this.state.search) + ';;;param: ' + JSON.stringify(from));
549
- data.corpId = corpid;
550
- // data.code = ;
551
- let search = from.title;
552
- let cate = from.category;
553
- if (search == undefined) {
554
- data.title = this.state.search1;
555
- } else {
556
- data.title = from.title;
557
- }
558
- if (cate == undefined) {
559
- data.category = this.state.category1;
560
- } else {
561
- data.category = from.category;
562
- }
563
- return data;
564
-
565
- }
566
- beforeFetch2(data, from) {
567
- this.setState({
568
- ableClick: false
569
- });
570
- //alert("this.state.search: " + JSON.stringify(this.state.search) + ';;;param: ' + JSON.stringify(from));
571
- data.corpId = corpid;
572
- // data.code = ;
573
- let search = from.title;
574
- let cate = from.category;
575
- if (search == undefined) {
576
- data.title = this.state.search2;
577
- } else {
578
- data.title = from.title;
579
- }
580
- if (cate == undefined) {
581
- data.category = this.state.category2;
582
- } else {
583
- data.category = from.category;
584
- }
585
- return data;
586
-
587
- }
588
- beforeFetch3(data, from) {
589
- this.setState({
590
- ableClick: false
591
- });
592
- //alert("this.state.search: " + JSON.stringify(this.state.search) + ';;;param: ' + JSON.stringify(from));
593
- data.corpId = corpid;
594
- // data.code = ;
595
- let search = from.title;
596
- let cate = from.category;
597
- if (search == undefined) {
598
- data.title = this.state.search3;
599
- } else {
600
- data.title = from.title;
601
- }
602
- if (cate == undefined) {
603
- data.category = this.state.category4;
604
- } else {
605
- data.category = from.category;
606
- }
607
- return data;
608
-
609
- }
610
- beforeFetch4(data, from) {
611
- this.setState({
612
- ableClick: false
613
- });
614
- //alert("this.state.search: " + JSON.stringify(this.state.search) + ';;;param: ' + JSON.stringify(from));
615
- data.corpId = corpid;
616
- // data.code = ;
617
- let search = from.title;
618
- let cate = from.category;
619
- if (search == undefined) {
620
- data.title = this.state.search4;
621
- } else {
622
- data.title = from.title;
623
- }
624
- if (cate == undefined) {
625
- data.category = this.state.category4;
626
- } else {
627
- data.category = from.category;
628
- }
629
- return data;
630
-
631
- }
632
-
633
-
634
- /**
635
- * ScrollList 得到返回数据
636
- * @param data
637
- * @returns {*}
638
- */
639
- processData(data) {
640
- this.setState({
641
- ableClick: true
642
- });
643
- $('.empty-content').show();
644
- return data;
645
- }
646
-
647
- /**
648
- * 搜索栏,确认搜索
649
- */
650
- onSearch(searchValue) {
651
-
652
- searchVal = searchValue;
653
- var type = this.state.type;
654
-
655
- if (type == "self") {
656
- var url = 'approval/transaction/' + this.state.activeTabIndex + '/' + searchVal;
657
- location.hash = url;
658
- } else {
659
- var url = 'approval/all/' + this.state.activeTabIndex + '/' + searchVal;
660
- location.hash = url;
661
- }
662
-
663
- console.log(`onSearch>>${searchValue}`);
664
- let noDataTip = '无搜索结果';
665
- if (this.state.activeTabIndex == 0) {
666
- this.setState({
667
- search0: searchValue,
668
- noDataTip0: noDataTip
669
- });
670
- const param = {
671
- title: searchValue,
672
- category: this.state.category0
673
- }
674
- this.refs.transaction_undo_ref.fetchData(param);
675
- } else if (this.state.activeTabIndex == 1) {
676
- this.setState({
677
- search1: searchValue,
678
- noDataTip1: noDataTip
679
- });
680
- const param = {
681
- title: searchValue,
682
- category: this.state.category1
683
- }
684
- this.refs.transaction_unread_ref.fetchData(param);
685
- } else if (this.state.activeTabIndex == 2) {
686
- this.setState({
687
- search2: searchValue,
688
- noDataTip2: noDataTip
689
- });
690
- const param = {
691
- title: searchValue,
692
- category: this.state.category2
693
- }
694
- this.refs.transaction_done_ref.fetchData(param);
695
- } else if (this.state.activeTabIndex == 3) {
696
- this.setState({
697
- search3: searchValue,
698
- noDataTip3: noDataTip
699
- });
700
- const param = {
701
- title: searchValue,
702
- category: this.state.category3
703
- }
704
- this.refs.transaction_read_ref.fetchData(param);
705
- } else if (this.state.activeTabIndex == 4) {
706
- this.setState({
707
- search4: searchValue,
708
- noDataTip4: noDataTip
709
- });
710
- const param = {
711
- title: searchValue,
712
- category: this.state.category4
713
- }
714
- this.refs.transaction_myself_ref.fetchData(param);
715
- }
716
- }
717
-
718
- /**
719
- * 退出搜索栏工具
720
- */
721
- onExit() {
722
- // debugger;
723
- console.log(`onExit!`);
724
- let noDataTip = '暂无数据';
725
- let searchValue = '';
726
-
727
- var type = this.state.type;
728
- if (type == "self") {
729
- var url = 'approval/transaction/' + this.state.activeTabIndex;
730
- location.hash = url;
731
- } else {
732
- var url = 'approval/all/' + this.state.activeTabIndex;
733
- location.hash = url;
734
- }
735
- searchVal = '';
736
- $('.empty-content').hide();
737
- if (this.state.activeTabIndex == 0) {
738
- this.refs.transaction_undo_ref.fetchData({
739
- title: searchValue,
740
- category: this.state.category0
741
- });
742
- this.setState({
743
- search0: '',
744
- noDataTip0: noDataTip
745
- });
746
- } else if (this.state.activeTabIndex == 1) {
747
- this.refs.transaction_unread_ref.fetchData({
748
- title: searchValue,
749
- category: this.state.category1
750
- });
751
- this.setState({
752
- search1: '',
753
- noDataTip1: noDataTip
754
- });
755
- } else if (this.state.activeTabIndex == 2) {
756
- this.refs.transaction_done_ref.fetchData({
757
- title: searchValue,
758
- category: this.state.category2
759
- });
760
- this.setState({
761
- search2: '',
762
- noDataTip2: noDataTip
763
- });
764
- } else if (this.state.activeTabIndex == 3) {
765
- this.refs.transaction_read_ref.fetchData({
766
- title: searchValue,
767
- category: this.state.category3
768
- });
769
- this.setState({
770
- search3: '',
771
- noDataTip3: noDataTip
772
- });
773
- } else if (this.state.activeTabIndex == 4) {
774
- this.refs.transaction_myself_ref.fetchData({
775
- title: searchValue,
776
- category: this.state.category4
777
- });
778
- this.setState({
779
- search4: '',
780
- noDataTip4: noDataTip
781
- });
782
- }
783
- }
784
-
785
- onScrollRefresh() {
786
- }
787
- onLoad() {
788
-
789
- }
790
- //更新可点击状态
791
- updateAbleClick(boolean) {
792
- this.setState({
793
- ableClick: boolean
794
- });
795
- }
796
-
797
-
798
- //点击批量
799
- clickBatch(boolean) {
800
- this.setState({
801
- isBatch: !boolean,
802
- selectAll: true
803
- });
804
- }
805
-
806
- //全选
807
- selectAll() {
808
- let t = this;
809
- if (this.state.selectAll) {
810
- $(".t-checkbox-field-icon-list").map(function (index, item) {
811
- $(item).removeClass("un-checked");
812
- $(item).addClass("checked");
813
- });
814
- this.setState({
815
- selectAll: false
816
- });
817
- } else {
818
- $(".t-checkbox-field-icon-list").map(function (index, item) {
819
- $(item).removeClass("checked");
820
- $(item).addClass("un-checked");
821
- });
822
- this.setState({
823
- selectAll: true
824
- });
825
- }
826
- }
827
-
828
- clickBatchButton() {
829
- let t = this;
830
- if (this.state.activeTabIndex == 0) {
831
-
832
- //遍历循环选中
833
- var taskIds = "";
834
- var processInstanceIds = "";
835
- let taskId = '';
836
- let module = '';
837
- $(".checked").map(function (index, item) {
838
- taskIds += $(item).attr("data-taskid") + ",";
839
- processInstanceIds += $(item).attr("data-processInstanceId") + ",";
840
-
841
- if (index == 0) {
842
- taskId = $(item).attr("data-taskid");
843
- module = $(item).attr("data-module");
844
- }
845
- });
846
- //alert(taskIds);
847
- if (taskIds) {
848
- taskIds = taskIds.substring(0, taskIds.length - 1);
849
- processInstanceIds = processInstanceIds.substring(0, processInstanceIds.length - 1);
850
- } else {
851
- Toast.show({
852
- type: 'error',
853
- content: '请选择记录'
854
- });
855
- return;
856
- }
857
- console.log("taskIds===" + taskIds);
858
- DB.FlowModuleAPI.batchValidateForm({
859
- taskIds: taskIds
860
- }).then((validateContent) => {
861
-
862
- if (validateContent != null && validateContent.length > 0) {
863
- var titles = '';
864
- for (var s = 0; s < validateContent.length; s++) {
865
- titles += validateContent[s].title + '、';
866
- }
867
- if (titles.length > 0) {
868
- titles = titles.substring(0, titles.length - 1);
869
- Toast.show({
870
- type: 'success',
871
- content: '批量提交失败,' + titles + ',存在必填项没有填写!'
872
- });
873
- return;
874
- }
875
- }
876
- DB.FlowModuleAPI.getUndoTaskInfo({
877
- taskId: taskId,
878
- type: 0
879
- }).then((taskContent) => {
880
- let buttonCodes = taskContent.buttons;
881
- let tasktype = taskContent.tasktype;
882
- if (tasktype != 'radom') {
883
- //是否有批示意见
884
- let commentIsNotNull = taskContent.commentIsNotNull;//审批意见是否为空
885
- if (!commentIsNotNull) {
886
- commentIsNotNull = '0';
887
- }
888
- let hasCommentField = taskContent.hasCommentField;
889
- if (!hasCommentField) {
890
- hasCommentField = '0';
891
- }
892
- let commentType = taskContent.commentType;//审批意见类型
893
- if (!commentType) {
894
- commentType = '-1';
895
- }
896
-
897
- let signPicId = taskContent.signPicId;//签名图片id
898
- if (!signPicId) {
899
- signPicId = "-1";
900
- }
901
-
902
- //紧急
903
- let urgent = taskContent.urgency;
904
- if (!urgent) {
905
- urgent = '0';
906
- }
907
-
908
- //是否有锁
909
- let lock = taskContent.lock;
910
-
911
- //流程编码
912
- let code = taskContent.code;
913
-
914
- //是否是起点
915
- let isStart = taskContent.isStart == true ? "1" : "0";
916
-
917
- location.hash = 'approval/batch/' + taskIds + "/" + processInstanceIds + "/1/" + code + "/" + hasCommentField + "/" + commentIsNotNull + "/" + commentType + "/" + signPicId + "/" + urgent + "/" + isStart + "/" + module + "?project=mobileportal";
918
- } else {
919
- Toast.show({
920
- type: 'error',
921
- content: '当前勾选的任务中,含有不支持批量通过的任务!',
922
- });
923
- return;
924
- }
925
- }).catch((error) => {
926
- Toast.show({
927
- type: 'error',
928
- content: error.errorMsg,
929
- });
930
- });
931
- }).catch((error) => {
932
- Toast.show({
933
- type: 'error',
934
- content: error.errorMsg,
935
- });
936
- });
937
-
938
- } else if (this.state.activeTabIndex == 1) {//待阅
939
- var taskIds = "";
940
- var processInstanceIds = "";
941
- var module = "";
942
- var permissionCode = "unRead";
943
- $(".checked").map(function (index, item) {
944
- taskIds += $(item).attr("data-taskid") + ",";
945
- processInstanceIds += $(item).attr("data-processInstanceId") + ",";
946
-
947
- if (index == 0) {
948
- module = $(item).attr("data-module");
949
- }
950
- });
951
-
952
- if (taskIds) {
953
- taskIds = taskIds.substring(0, taskIds.length - 1);
954
- processInstanceIds = processInstanceIds.substring(0, processInstanceIds.length - 1);
955
- } else {
956
- Toast.show({
957
- type: 'error',
958
- content: '请选择记录'
959
- });
960
- return;
961
- }
962
- DB.FlowModuleAPI.readCompleteTaskBatch({
963
- taskIds: taskIds,
964
- processInstanceIds: processInstanceIds,
965
- module: module,
966
- permissionCode: permissionCode,
967
- }).then((content) => {
968
- Toast.show({
969
- type: 'success',
970
- content: '已阅成功'
971
- });
972
- t.setState({
973
- isBatch: false
974
- });
975
- t.refs.transaction_unread_ref.fetchData({
976
- value: t.state.search1
977
- });
978
- }).catch((error) => {
979
- Toast.show({
980
- type: 'error',
981
- content: error.errorMsg,
982
- });
983
- });
984
- }
985
-
986
- }
987
-
988
- filterConfirm(data) {
989
- let noDataTip = '暂无搜索结果';
990
- const category = [];
991
- if (data.sort) {
992
- data.sort.map((item) => {
993
- category.push(item.value)
994
- })
995
- }
996
-
997
- if (this.state.activeTabIndex == 0) {
998
- this.setState({
999
- category0: category.join(','),
1000
- noDataTip1: noDataTip,
1001
- // categoryListTitle: category.join(',') || '全部分类'
1002
- })
1003
-
1004
- const param = {
1005
- title: this.state.search0,
1006
- category: category.join(',')
1007
- }
1008
- this.refs.transaction_undo_ref.fetchData(param);
1009
-
1010
- } else if (this.state.activeTabIndex == 1) {
1011
- this.setState({
1012
- category1: category.join(','),
1013
- noDataTip1: noDataTip,
1014
- // categoryListTitle: category.join(',') || '全部分类'
1015
- })
1016
- const param = {
1017
- title: this.state.search1,
1018
- category: category.join(',')
1019
- }
1020
- this.refs.transaction_unread_ref.fetchData(param);
1021
-
1022
- } else if (this.state.activeTabIndex == 2) {
1023
- this.setState({
1024
- category2: category.join(','),
1025
- noDataTip1: noDataTip,
1026
- // categoryListTitle: category.join(',') || '全部分类'
1027
- })
1028
- const param = {
1029
- title: this.state.search2,
1030
- category: category.join(',')
1031
- }
1032
- this.refs.transaction_done_ref.fetchData(param);
1033
-
1034
- } else if (this.state.activeTabIndex == 3) {
1035
- this.setState({
1036
- category3: category.join(','),
1037
- noDataTip1: noDataTip,
1038
- // categoryListTitle: category.join(',') || '全部分类'
1039
- })
1040
- const param = {
1041
- title: this.state.search3,
1042
- category: category.join(',')
1043
- }
1044
- this.refs.transaction_read_ref.fetchData(param);
1045
-
1046
- } else if (this.state.activeTabIndex == 4) {
1047
- this.setState({
1048
- category4: category.join(','),
1049
- noDataTip1: noDataTip,
1050
- // categoryListTitle: category.join(',') || '全部分类'
1051
- })
1052
- const param = {
1053
- title: this.state.search4,
1054
- category: category.join(',')
1055
- }
1056
- this.refs.transaction_myself_ref.fetchData(param);
1057
- }
1058
- }
1059
-
1060
-
1061
- render() {
1062
- const tabBarStyle = {};
1063
- let winHeightStyle = { height: this.state.winHeight };
1064
-
1065
- const Item = (props) => <div className="demo-item">{`${props.id} ${props.name}`}</div>;
1066
- let undoDiv = <div> 待办{this.state.titleCount.undo == 0 ? '' : <span style={{ color: 'red' }}>({this.state.titleCount.undo})</span>}</div>;
1067
- let unreadDiv = <div> 待阅{this.state.titleCount.unread == 0 ? '' : <span style={{ color: 'red' }}>({this.state.titleCount.unread})</span>}</div>;
1068
- return (
1069
- <div className='approve-list'>
1070
- <Tab activeKey={this.state.activeTabIndex} onChange={this.handleTabChange.bind(this)} destroyInactiveTabPane={false}>
1071
- {this.state.tabCodes.indexOf('undo') >= 0 ?
1072
- <Tab.Item title={undoDiv}>
1073
- <HBox vAlign="center" className="t-BCf">
1074
- <Box flex={1}>
1075
- <SearchBar ref="search_undo_ref" className="searchActive" {...this.searchBarProps} />
1076
- </Box>
1077
- <Box className={this.state.hasBatch ? this.state.isBatch ? "t-FCc t-PR16 t-FS14" : "theme-color t-PR16 t-FS14" : "t-DN"} onClick={this.clickBatch.bind(this, this.state.isBatch)}>
1078
- 批量
1079
- </Box>
1080
- </HBox>
1081
-
1082
- {/* 过滤器 */}
1083
- <Filter
1084
- size={1}
1085
- activeIndex={1}
1086
- options={[
1087
- {
1088
- name: 'sort',
1089
- title: this.state.categoryListTitle,
1090
- type: 'select',
1091
- multiSelect: true,
1092
- items: this.state.categoryList
1093
- },
1094
- ]}
1095
- onConfirm={(data) => { this.filterConfirm(data) }}></Filter>
1096
-
1097
- <div className="scrollHeight" style={winHeightStyle}>
1098
- <ScrollList
1099
- url={this.state.undoListUrl}
1100
- dataType="json"
1101
- pageSize={10}
1102
- beforeFetch={this.beforeFetch0.bind(this)}
1103
- processData={this.processData.bind(this)}
1104
- ref='transaction_undo_ref'
1105
- noDataImage={Variables.nodataIcon}
1106
- currentPageKey="page"
1107
- noDataTip={this.state.noDataTip0}
1108
- >
1109
- <ListItem type="0" isBatch={this.state.isBatch} ableClick={this.state.ableClick} fromType={this.state.type} projectPath={this.state.projectPath} updateAbleClick={this.updateAbleClick.bind(this)} />
1110
- </ScrollList>
1111
- </div>
1112
-
1113
- </Tab.Item>
1114
- : ""}
1115
-
1116
- {this.state.tabCodes.indexOf('unread') >= 0 ?
1117
- <Tab.Item title={unreadDiv}>
1118
-
1119
- <HBox vAlign="center" className="t-BCf">
1120
- <Box flex={1}>
1121
- <SearchBar ref="search_unread_ref" className="searchActive" {...this.searchBarProps} />
1122
- </Box>
1123
- <Box className={this.state.hasBatch ? this.state.isBatch ? "t-FCc t-PR16" : "theme-color t-PR16" : "t-DN"} isBatch={this.state.isBatch} onClick={this.clickBatch.bind(this, this.state.isBatch)}>
1124
- 批量
1125
- </Box>
1126
- </HBox>
1127
-
1128
- {/* 过滤器 */}
1129
- <Filter
1130
- size={1}
1131
- activeIndex={1}
1132
- options={[
1133
- {
1134
- name: 'sort',
1135
- title: this.state.categoryListTitle,
1136
- type: 'select',
1137
- multiSelect: true,
1138
- items: this.state.categoryList
1139
- },
1140
- ]}
1141
- onConfirm={(data) => { this.filterConfirm(data) }}></Filter>
1142
-
1143
- <div className="scrollHeight" style={winHeightStyle}>
1144
- <ScrollList
1145
- url={this.state.unreadListUrl}
1146
- dataType="json"
1147
- pageSize={10}
1148
- beforeFetch={this.beforeFetch1.bind(this)}
1149
- processData={this.processData.bind(this)}
1150
- ref='transaction_unread_ref'
1151
- noDataImage={Variables.nodataIcon}
1152
- currentPageKey="page"
1153
- noDataTip={this.state.noDataTip1}
1154
- >
1155
- <ListItem type="1" ableClick={this.state.ableClick} isBatch={this.state.isBatch} fromType={this.state.type} projectPath={this.state.projectPath} updateAbleClick={this.updateAbleClick.bind(this)} />
1156
- </ScrollList>
1157
- </div>
1158
- </Tab.Item>
1159
- : ""}
1160
-
1161
- {this.state.tabCodes.indexOf('done') >= 0 ?
1162
- <Tab.Item title={"已办" + (this.state.titleCount.done == 0 ? '' : '(' + this.state.titleCount.done + ')')} >
1163
-
1164
- <HBox vAlign="center" className="t-BCf">
1165
- <Box flex={1}>
1166
- <SearchBar ref="search_done_ref" className="searchActive" {...this.searchBarProps} />
1167
- </Box>
1168
- </HBox>
1169
-
1170
- {/* 过滤器 */}
1171
- <Filter
1172
- size={1}
1173
- activeIndex={1}
1174
- options={[
1175
- {
1176
- name: 'sort',
1177
- title: this.state.categoryListTitle,
1178
- type: 'select',
1179
- multiSelect: true,
1180
- items: this.state.categoryList
1181
- },
1182
- ]}
1183
- onConfirm={(data) => { this.filterConfirm(data) }} ></Filter>
1184
-
1185
- <div className="scrollHeight" style={winHeightStyle}>
1186
- <ScrollList
1187
- url={this.state.doneListUrl}
1188
- dataType="json"
1189
- pageSize={10}
1190
- beforeFetch={this.beforeFetch2.bind(this)}
1191
- processData={this.processData.bind(this)}
1192
- ref='transaction_done_ref'
1193
- noDataImage={Variables.nodataIcon}
1194
- currentPageKey="page"
1195
- noDataTip={this.state.noDataTip2}
1196
- >
1197
- <ListItem type="2" ableClick={this.state.ableClick} isBatch={this.state.isBatch} fromType={this.state.type} projectPath={this.state.projectPath} updateAbleClick={this.updateAbleClick.bind(this)} />
1198
- </ScrollList>
1199
- </div>
1200
- </Tab.Item>
1201
- : ""}
1202
-
1203
- {this.state.tabCodes.indexOf('read') >= 0 ?
1204
- <Tab.Item title={"已阅" + (this.state.titleCount.read == 0 ? '' : '(' + this.state.titleCount.read + ')')} >
1205
-
1206
- <HBox vAlign="center" className="t-BCf">
1207
- <Box flex={1}>
1208
- <SearchBar ref="search_read_ref" className="searchActive" {...this.searchBarProps} />
1209
- </Box>
1210
- </HBox>
1211
-
1212
- {/* 过滤器 */}
1213
- <Filter
1214
- size={1}
1215
- activeIndex={1}
1216
- options={[
1217
- {
1218
- name: 'sort',
1219
- title: this.state.categoryListTitle,
1220
- type: 'select',
1221
- multiSelect: true,
1222
- items: this.state.categoryList
1223
- },
1224
- ]}
1225
- onConfirm={(data) => { this.filterConfirm(data) }}></Filter>
1226
-
1227
- <div className="scrollHeight" style={winHeightStyle}>
1228
- <ScrollList
1229
- url={this.state.readListUrl}
1230
- dataType="json"
1231
- pageSize={10}
1232
- beforeFetch={this.beforeFetch3.bind(this)}
1233
- processData={this.processData.bind(this)}
1234
- ref='transaction_read_ref'
1235
- noDataImage={Variables.nodataIcon}
1236
- currentPageKey="page"
1237
- noDataTip={this.state.noDataTip3}
1238
- >
1239
- <ListItem type="3" ableClick={this.state.ableClick} isBatch={this.state.isBatch} fromType={this.state.type} projectPath={this.state.projectPath} updateAbleClick={this.updateAbleClick.bind(this)} />
1240
- </ScrollList>
1241
- </div>
1242
- </Tab.Item>
1243
- : ""}
1244
-
1245
- {this.state.tabCodes.indexOf('myself') >= 0 ?
1246
- <Tab.Item title={"我的" + (this.state.titleCount.myself == 0 ? '' : '(' + this.state.titleCount.myself + ')')} >
1247
-
1248
- <HBox vAlign="center" className="t-BCf">
1249
- <Box flex={1}>
1250
- <SearchBar ref="search_myself_ref" className="searchActive" {...this.searchBarProps} />
1251
- </Box>
1252
- </HBox>
1253
-
1254
- {/* 过滤器 */}
1255
- <Filter
1256
- size={1}
1257
- activeIndex={1}
1258
- options={[
1259
- {
1260
- name: 'sort',
1261
- title: this.state.categoryListTitle,
1262
- type: 'select',
1263
- multiSelect: true,
1264
- items: this.state.categoryList
1265
- },
1266
- ]}
1267
- onConfirm={(data) => { this.filterConfirm(data) }}></Filter>
1268
-
1269
- <div className="scrollHeight" style={winHeightStyle}>
1270
- <ScrollList
1271
- url={this.state.myselfListUrl}
1272
- dataType="json"
1273
- pageSize={10}
1274
- beforeFetch={this.beforeFetch4.bind(this)}
1275
- processData={this.processData.bind(this)}
1276
- ref='transaction_myself_ref'
1277
- noDataImage={Variables.nodataIcon}
1278
- currentPageKey="page"
1279
- noDataTip={this.state.noDataTip4}
1280
- >
1281
- <ListItem type="4" ableClick={this.state.ableClick} isBatch={this.state.isBatch} fromType={this.state.type} projectPath={this.state.projectPath} updateAbleClick={this.updateAbleClick.bind(this)} />
1282
- </ScrollList>
1283
- </div>
1284
- </Tab.Item>
1285
- : ""}
1286
- </Tab>
1287
-
1288
- <div className={this.state.isBatch ? "t-bottom-fixed" : "t-DN"}>
1289
- <Button.Group>
1290
- <Button type="secondary" display="inline" onClick={this.selectAll.bind(this)}>{this.state.selectAll ? '全选' : '取消'}</Button>
1291
- <Button type="primary" display="inline"
1292
- onClick={this.clickBatchButton.bind(this)}>{this.state.activeTabIndex == 0 ? '通过' : '已阅'}</Button>
1293
- </Button.Group>
1294
- </div>
1295
- </div>
1296
- );
1297
- }
1298
- }
1299
-