fmui-base 2.3.58 → 2.3.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/lib/db/db.js +48 -0
- package/lib/db/variables.js +4 -0
- package/lib/form/filterEmptySubTblRows.js +129 -7
- package/lib/form/form.js +51 -10
- package/lib/form_info/formInfo.js +7 -2
- package/lib/process_batch/processBatch.js +4 -1
- package/lib/process_info/RelationProcess.js +112 -14
- package/lib/process_info/RelationProcessPicker.js +509 -0
- package/lib/process_info/processInfo.js +501 -10
- package/lib/process_info/processInfo.less +32 -0
- package/lib/tblform/formSaveUtils.js +1 -1
- package/package.json +1 -1
|
@@ -100,6 +100,10 @@ var _RelationProcess = require('./RelationProcess');
|
|
|
100
100
|
|
|
101
101
|
var _RelationProcess2 = _interopRequireDefault(_RelationProcess);
|
|
102
102
|
|
|
103
|
+
var _RelationProcessPicker = require('./RelationProcessPicker');
|
|
104
|
+
|
|
105
|
+
var _RelationProcessPicker2 = _interopRequireDefault(_RelationProcessPicker);
|
|
106
|
+
|
|
103
107
|
var _MessageBoard = require('./MessageBoard');
|
|
104
108
|
|
|
105
109
|
var _MessageBoard2 = _interopRequireDefault(_MessageBoard);
|
|
@@ -470,6 +474,10 @@ var PageHome = function (_React$Component) {
|
|
|
470
474
|
nextJumpActivity: [], //下一个跳转节点
|
|
471
475
|
jumpPersonValue: [], //转交选择的用户
|
|
472
476
|
addlotsPersonValue: [], //加签选择的用户
|
|
477
|
+
reduceSignUserList: [], //减签候选原始列表
|
|
478
|
+
reduceSignAddPool: [], //加签用户池(可移到减签)
|
|
479
|
+
reduceSignReducePool: [], //减签用户池(真正提交)
|
|
480
|
+
reduceShortMessage: '0', //减签提醒方式
|
|
473
481
|
circulateNodePersonValue: [], //传阅节点选择的用户
|
|
474
482
|
forwardNodePersonValue: [], //转发节点选择的用户
|
|
475
483
|
circulatePersonValue: [], //通过传阅的用户
|
|
@@ -534,6 +542,8 @@ var PageHome = function (_React$Component) {
|
|
|
534
542
|
mobileSubTblDefault: '1', //移动端子表默认 1展开 0收起;未设置按展开
|
|
535
543
|
enableMessageBoard: '0', //流程启用留言板
|
|
536
544
|
enableAttachmentArea: '0', //流程启用附件区
|
|
545
|
+
relationCount: 0, //关联流程数量
|
|
546
|
+
hasRelationBtn: false, //当前是否具备关联流程按钮权限
|
|
537
547
|
readScopeId: '',
|
|
538
548
|
readScopeList: [],
|
|
539
549
|
readRangeType: '', //传阅范围 0全部 2本组织及下属组织 4自定义
|
|
@@ -1351,6 +1361,10 @@ var PageHome = function (_React$Component) {
|
|
|
1351
1361
|
}
|
|
1352
1362
|
formData.linkFields = form.linkFields;
|
|
1353
1363
|
formData.formItem = formItem;
|
|
1364
|
+
// 后端偶发带回字符串 "null",会导致提交带无效 dataId+optlock 被乐观锁拦截
|
|
1365
|
+
if (!(0, _filterEmptySubTblRows.isValidFormDataId)(formData.dataId)) {
|
|
1366
|
+
formData.dataId = '';
|
|
1367
|
+
}
|
|
1354
1368
|
|
|
1355
1369
|
//关联字段
|
|
1356
1370
|
var formRelaField = content.formRelaField;
|
|
@@ -1595,9 +1609,18 @@ var PageHome = function (_React$Component) {
|
|
|
1595
1609
|
// }
|
|
1596
1610
|
// }
|
|
1597
1611
|
var resolvedOptlock = formData && formData.optlock !== undefined && formData.optlock !== null && formData.optlock !== '' ? String(formData.optlock) : content.optlock !== undefined && content.optlock !== null && content.optlock !== '' ? String(content.optlock) : '';
|
|
1612
|
+
var forceOptlock = false;
|
|
1598
1613
|
if (t._pendingForceOptlock) {
|
|
1599
1614
|
resolvedOptlock = String(t._pendingForceOptlock);
|
|
1600
1615
|
t._pendingForceOptlock = null;
|
|
1616
|
+
forceOptlock = true;
|
|
1617
|
+
}
|
|
1618
|
+
// 无有效主表主键时不缓存 optlock,避免发起/新建误传版本号
|
|
1619
|
+
if (!forceOptlock && !(0, _filterEmptySubTblRows.isValidFormDataId)(formData && formData.dataId) && !(0, _filterEmptySubTblRows.isValidFormDataId)(t.state.dataId)) {
|
|
1620
|
+
var contentDataId = content && (content.dataId || content.businessKey);
|
|
1621
|
+
if (!(0, _filterEmptySubTblRows.isValidFormDataId)(contentDataId)) {
|
|
1622
|
+
resolvedOptlock = '';
|
|
1623
|
+
}
|
|
1601
1624
|
}
|
|
1602
1625
|
t.setState({
|
|
1603
1626
|
editFormData: formData,
|
|
@@ -1616,6 +1639,7 @@ var PageHome = function (_React$Component) {
|
|
|
1616
1639
|
defaultValue: defaultValue,
|
|
1617
1640
|
commentId: commentId,
|
|
1618
1641
|
buttons: buttons,
|
|
1642
|
+
hasRelationBtn: (',' + (buttons || '') + ',').indexOf(',OTHER_RELATION,') !== -1,
|
|
1619
1643
|
startButtons: startButtons,
|
|
1620
1644
|
code: content.code,
|
|
1621
1645
|
formItem: formItem,
|
|
@@ -1685,6 +1709,11 @@ var PageHome = function (_React$Component) {
|
|
|
1685
1709
|
startUserOrgId: content.startUserOrgId || content.startUserGroupId || '',
|
|
1686
1710
|
taskAssignOrgId: content.taskAssignOrgId || ''
|
|
1687
1711
|
}, function () {
|
|
1712
|
+
// 进页即拉取关联数量(显式传当前实例 id,避免 state 未齐)
|
|
1713
|
+
try {
|
|
1714
|
+
var pidForRelation = t.state.processInstanceId || t.props.processInstanceId;
|
|
1715
|
+
t.loadRelationCount(pidForRelation);
|
|
1716
|
+
} catch (eCount) {}
|
|
1688
1717
|
if (t._pendingCommentRestore != null && t._pendingCommentRestore !== '') {
|
|
1689
1718
|
var restoredComment = t._pendingCommentRestore;
|
|
1690
1719
|
t._pendingCommentRestore = null;
|
|
@@ -1857,11 +1886,12 @@ var PageHome = function (_React$Component) {
|
|
|
1857
1886
|
continue;
|
|
1858
1887
|
}
|
|
1859
1888
|
//PAGE_SAVE保存按钮只有当新建时才有,HELP_ADDLOTS加签只有在会签和串签才有,RADOM_FINISH随机流程完成按钮去掉
|
|
1860
|
-
|
|
1889
|
+
// OTHER_RELATION 移动端已支持,不再跳过
|
|
1890
|
+
if (buttonCode == 'FLOW_REVOKE' || buttonCode == 'RADOM_FINISH' || buttonCode == 'FLOW_CANCEL' || buttonCode == 'FLOW_RECOVER' || buttonCode == 'PAGE_PRINT' || buttonCode == 'PAGE_URGE' || buttonCode == 'PAGE_REDSET' || buttonCode == 'PAGE_FEEDBACK' || buttonCode == 'RECORD' || buttonCode == 'HELP_ADDLOTS' && participantMode == '0') {
|
|
1861
1891
|
continue;
|
|
1862
1892
|
} else {
|
|
1863
1893
|
if (isStart == true && permissionCode == 'start' || isDraft == '1') {
|
|
1864
|
-
if (buttonCode == 'PAGE_SAVE' || buttonCode == 'BASE_SUMBIT') {
|
|
1894
|
+
if (buttonCode == 'PAGE_SAVE' || buttonCode == 'BASE_SUMBIT' || buttonCode == 'OTHER_RELATION') {
|
|
1865
1895
|
buttonArrayNew.push(buttonCode);
|
|
1866
1896
|
}
|
|
1867
1897
|
// 发起人已配置作废,且流程已有数据(退回/撤回到发起人)时显示作废
|
|
@@ -1907,6 +1937,7 @@ var PageHome = function (_React$Component) {
|
|
|
1907
1937
|
buttonList.push({ name: t.state.finalButtons.get("HELP_FORWARD"), type: 'secondary', display: 'inline', no: 20 });
|
|
1908
1938
|
} else if (listType == "4") {
|
|
1909
1939
|
//我的
|
|
1940
|
+
var processStatusNow = String(content.processStatus != null ? content.processStatus : content.status != null ? content.status : '');
|
|
1910
1941
|
if (this.state.processIsComplete == "0") {
|
|
1911
1942
|
//当流程未结束时,
|
|
1912
1943
|
if (buttons.indexOf('FLOW_CANCEL') >= 0) {
|
|
@@ -1919,7 +1950,6 @@ var PageHome = function (_React$Component) {
|
|
|
1919
1950
|
buttonList.push({ name: t.state.finalButtons.get("FLOW_REVOKE"), type: 'secondary', display: 'inline', no: 7 });
|
|
1920
1951
|
}
|
|
1921
1952
|
// 与 PC 一致:发起人配置作废 + 进行中 + 当前待办在发起节点
|
|
1922
|
-
var processStatusNow = String(content.processStatus != null ? content.processStatus : content.status != null ? content.status : '');
|
|
1923
1953
|
var backToInitiator = isStart == true || isStart == 'true';
|
|
1924
1954
|
if (!backToInitiator && content.processLogList && content.processLogList.length > 0 && content.doingUserList && content.doingUserList.length > 0) {
|
|
1925
1955
|
var startActId = content.processLogList[0].curactivityid;
|
|
@@ -1940,6 +1970,18 @@ var PageHome = function (_React$Component) {
|
|
|
1940
1970
|
buttonList.push({ name: t.state.finalButtons.get("PAGE_URGE"), type: 'secondary', display: 'inline', no: 12 });
|
|
1941
1971
|
}
|
|
1942
1972
|
}
|
|
1973
|
+
// 不通过(status=6):与 PC 一致,点开详情允许作废(发起人节点配置了 BASE_INVALID)
|
|
1974
|
+
if (processStatusNow == '6' && startButtons && startButtons.indexOf('BASE_INVALID') >= 0) {
|
|
1975
|
+
var hasInvalidBtn = false;
|
|
1976
|
+
for (var bi = 0; bi < buttonList.length; bi++) {
|
|
1977
|
+
if (buttonList[bi] && buttonList[bi].no == 9) {
|
|
1978
|
+
hasInvalidBtn = true;break;
|
|
1979
|
+
}
|
|
1980
|
+
}
|
|
1981
|
+
if (!hasInvalidBtn) {
|
|
1982
|
+
buttonList.push({ name: t.state.finalButtons.get("BASE_INVALID"), type: 'danger', display: 'inline', no: 9 });
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1943
1985
|
if (startButtons) {
|
|
1944
1986
|
if (startButtons.indexOf('HELP_CIRCULATE') >= 0) {
|
|
1945
1987
|
//传阅
|
|
@@ -2606,6 +2648,9 @@ var PageHome = function (_React$Component) {
|
|
|
2606
2648
|
case 'HELP_ADDLOTS':
|
|
2607
2649
|
t.handleSubmit(6);
|
|
2608
2650
|
break;
|
|
2651
|
+
case 'HELP_REDUCELOTS':
|
|
2652
|
+
t.handleSubmit(22);
|
|
2653
|
+
break;
|
|
2609
2654
|
case 'FLOW_REVOKE':
|
|
2610
2655
|
t.handleSubmit(7);
|
|
2611
2656
|
break;
|
|
@@ -2630,6 +2675,9 @@ var PageHome = function (_React$Component) {
|
|
|
2630
2675
|
case 'MAILSEND':
|
|
2631
2676
|
t.handleSubmit(18);
|
|
2632
2677
|
break;
|
|
2678
|
+
case 'OTHER_RELATION':
|
|
2679
|
+
t.handleSubmit('OTHER_RELATION');
|
|
2680
|
+
break;
|
|
2633
2681
|
default:
|
|
2634
2682
|
t.handleSubmit(actionSheetButtonOpt[index]);
|
|
2635
2683
|
break;
|
|
@@ -2674,7 +2722,11 @@ var PageHome = function (_React$Component) {
|
|
|
2674
2722
|
permissionCode: _this2.state.permissionCode
|
|
2675
2723
|
};
|
|
2676
2724
|
if (t.state.module === 'approve' && t.state.formDataOptlock !== '' && t.state.formDataOptlock !== null && typeof t.state.formDataOptlock !== 'undefined') {
|
|
2677
|
-
|
|
2725
|
+
// 无有效主表 dataId 时不传 optlock,避免后端「已传版本却无主键」直接报冲突
|
|
2726
|
+
var optlockDataId = dataId || sendData && sendData.dataId || t.state.dataId;
|
|
2727
|
+
if ((0, _filterEmptySubTblRows.isValidFormDataId)(optlockDataId)) {
|
|
2728
|
+
param.optlock = t.state.formDataOptlock;
|
|
2729
|
+
}
|
|
2678
2730
|
}
|
|
2679
2731
|
var dealActionName = "";
|
|
2680
2732
|
if (_this2.state.isStart == true) {
|
|
@@ -2683,6 +2735,12 @@ var PageHome = function (_React$Component) {
|
|
|
2683
2735
|
dealActionName = _this2.state.finalButtons.get("BASE_SUMBIT");
|
|
2684
2736
|
}
|
|
2685
2737
|
param.dealActionName = dealActionName;
|
|
2738
|
+
// 网关条件「上一环节办理人批示内容」依赖当前批示意见,getNextActivity 必须透传
|
|
2739
|
+
param.comment = typeof newComment === 'undefined' || newComment == null ? '' : newComment;
|
|
2740
|
+
param.commentType = 'text';
|
|
2741
|
+
if (t.state.commentId) {
|
|
2742
|
+
param.commentId = t.state.commentId;
|
|
2743
|
+
}
|
|
2686
2744
|
var nextList = null; //下一个后继节点列表
|
|
2687
2745
|
var radomList = null; //下一个随机活动节点
|
|
2688
2746
|
var succeedRange = ""; //后继活动id
|
|
@@ -3362,6 +3420,9 @@ var PageHome = function (_React$Component) {
|
|
|
3362
3420
|
}, function () {
|
|
3363
3421
|
$(window).scrollTop(0);
|
|
3364
3422
|
});
|
|
3423
|
+
} else if (operate == 22) {
|
|
3424
|
+
//减签
|
|
3425
|
+
t.openReduceSign();
|
|
3365
3426
|
} else if (operate == 7) {
|
|
3366
3427
|
//撤销
|
|
3367
3428
|
this.recallClick();
|
|
@@ -3599,6 +3660,9 @@ var PageHome = function (_React$Component) {
|
|
|
3599
3660
|
$(window).scrollTop(0);
|
|
3600
3661
|
});
|
|
3601
3662
|
}
|
|
3663
|
+
} else if (operate == 'OTHER_RELATION') {
|
|
3664
|
+
//关联流程
|
|
3665
|
+
this.openRelationPicker();
|
|
3602
3666
|
} else {
|
|
3603
3667
|
//其他按钮
|
|
3604
3668
|
if (typeof FlowCommon[operate] === "function") {
|
|
@@ -3991,7 +4055,7 @@ var PageHome = function (_React$Component) {
|
|
|
3991
4055
|
var allEditIdsArray = [];
|
|
3992
4056
|
|
|
3993
4057
|
//主表id
|
|
3994
|
-
if (data.dataId) {
|
|
4058
|
+
if ((0, _filterEmptySubTblRows.isValidFormDataId)(data && data.dataId)) {
|
|
3995
4059
|
var mainTableId = data.dataId;
|
|
3996
4060
|
allEditIdsArray.push(mainTableId);
|
|
3997
4061
|
}
|
|
@@ -4607,6 +4671,9 @@ var PageHome = function (_React$Component) {
|
|
|
4607
4671
|
} else if (operate == 6) {
|
|
4608
4672
|
//加签
|
|
4609
4673
|
this.addlots();
|
|
4674
|
+
} else if (operate == 22) {
|
|
4675
|
+
//减签
|
|
4676
|
+
this.reduceSign();
|
|
4610
4677
|
} else if (operate == 4) {
|
|
4611
4678
|
//传阅
|
|
4612
4679
|
this.circulateNode();
|
|
@@ -4652,6 +4719,162 @@ var PageHome = function (_React$Component) {
|
|
|
4652
4719
|
this.startSubProcess();
|
|
4653
4720
|
}
|
|
4654
4721
|
}
|
|
4722
|
+
|
|
4723
|
+
// 打开关联流程选择(标题搜索多选)
|
|
4724
|
+
|
|
4725
|
+
}, {
|
|
4726
|
+
key: 'openRelationPicker',
|
|
4727
|
+
value: function openRelationPicker() {
|
|
4728
|
+
var t = this;
|
|
4729
|
+
var processInstanceId = t.state.processInstanceId;
|
|
4730
|
+
if (!processInstanceId || processInstanceId === '-99' || processInstanceId === 'undefined' || processInstanceId === 'null') {
|
|
4731
|
+
_Toast2.default.show({
|
|
4732
|
+
type: 'error',
|
|
4733
|
+
content: '请先保存/提交生成流程后再关联'
|
|
4734
|
+
});
|
|
4735
|
+
return;
|
|
4736
|
+
}
|
|
4737
|
+
// 先拉已关联列表再打开,保证已关联流程不可选;关闭必须用本层 Popup 实例 close
|
|
4738
|
+
_db2.default.FlowModuleAPI.getRelationProcess({
|
|
4739
|
+
processInstanceId: processInstanceId
|
|
4740
|
+
}).then(function (content) {
|
|
4741
|
+
var excludeIds = [processInstanceId];
|
|
4742
|
+
var list = [];
|
|
4743
|
+
if (Array.isArray(content)) {
|
|
4744
|
+
list = content;
|
|
4745
|
+
} else if (content && Array.isArray(content.data)) {
|
|
4746
|
+
list = content.data;
|
|
4747
|
+
}
|
|
4748
|
+
for (var i = 0; i < list.length; i++) {
|
|
4749
|
+
var rid = list[i].processInstanceId || list[i].id;
|
|
4750
|
+
if (rid) {
|
|
4751
|
+
excludeIds.push(String(rid));
|
|
4752
|
+
}
|
|
4753
|
+
}
|
|
4754
|
+
var relationRef = t.refs.relationProcess_list;
|
|
4755
|
+
if (relationRef && relationRef.state && relationRef.state.relationList) {
|
|
4756
|
+
for (var j = 0; j < relationRef.state.relationList.length; j++) {
|
|
4757
|
+
var rid2 = relationRef.state.relationList[j].processInstanceId;
|
|
4758
|
+
if (rid2) {
|
|
4759
|
+
excludeIds.push(String(rid2));
|
|
4760
|
+
}
|
|
4761
|
+
}
|
|
4762
|
+
}
|
|
4763
|
+
var popupInst = null;
|
|
4764
|
+
var closePicker = function closePicker() {
|
|
4765
|
+
try {
|
|
4766
|
+
if (popupInst && typeof popupInst.close === 'function') {
|
|
4767
|
+
popupInst.close();
|
|
4768
|
+
} else {
|
|
4769
|
+
_Popup2.default.hide();
|
|
4770
|
+
}
|
|
4771
|
+
} catch (e) {
|
|
4772
|
+
try {
|
|
4773
|
+
_Popup2.default.hide();
|
|
4774
|
+
} catch (e2) {}
|
|
4775
|
+
}
|
|
4776
|
+
};
|
|
4777
|
+
popupInst = _Popup2.default.show(_react2.default.createElement(_RelationProcessPicker2.default, {
|
|
4778
|
+
processInstanceId: processInstanceId,
|
|
4779
|
+
activityId: t.state.activityId,
|
|
4780
|
+
excludeIds: excludeIds,
|
|
4781
|
+
onClose: closePicker,
|
|
4782
|
+
onSuccess: function onSuccess() {
|
|
4783
|
+
t.refreshRelationTab();
|
|
4784
|
+
}
|
|
4785
|
+
}), {
|
|
4786
|
+
animationType: 'slide-left',
|
|
4787
|
+
className: 'relation-process-picker-popup',
|
|
4788
|
+
maskClosable: true
|
|
4789
|
+
});
|
|
4790
|
+
}).catch(function () {
|
|
4791
|
+
_Toast2.default.show({
|
|
4792
|
+
type: 'error',
|
|
4793
|
+
content: '获取已关联流程失败'
|
|
4794
|
+
});
|
|
4795
|
+
});
|
|
4796
|
+
}
|
|
4797
|
+
|
|
4798
|
+
// 刷新关联流程页签数量与列表
|
|
4799
|
+
|
|
4800
|
+
}, {
|
|
4801
|
+
key: 'refreshRelationTab',
|
|
4802
|
+
value: function refreshRelationTab() {
|
|
4803
|
+
var t = this;
|
|
4804
|
+
var relationRef = t.refs.relationProcess_list;
|
|
4805
|
+
if (relationRef && typeof relationRef.reload === 'function') {
|
|
4806
|
+
relationRef.reload();
|
|
4807
|
+
}
|
|
4808
|
+
t.loadRelationCount();
|
|
4809
|
+
}
|
|
4810
|
+
|
|
4811
|
+
// 仅刷新页签数量(不依赖 RelationProcess 是否已挂载);可显式传入 processInstanceId
|
|
4812
|
+
|
|
4813
|
+
}, {
|
|
4814
|
+
key: 'loadRelationCount',
|
|
4815
|
+
value: function loadRelationCount(forceProcessInstanceId) {
|
|
4816
|
+
var t = this;
|
|
4817
|
+
var processInstanceId = forceProcessInstanceId || t.state.processInstanceId || t.props.processInstanceId;
|
|
4818
|
+
if (!processInstanceId || processInstanceId === '-99' || processInstanceId === 'undefined' || processInstanceId === 'null') {
|
|
4819
|
+
t.setState({ relationCount: 0 });
|
|
4820
|
+
return;
|
|
4821
|
+
}
|
|
4822
|
+
_db2.default.FlowModuleAPI.getRelationProcess({
|
|
4823
|
+
processInstanceId: processInstanceId
|
|
4824
|
+
}).then(function (content) {
|
|
4825
|
+
var list = t.normalizeRelationList(content);
|
|
4826
|
+
t.setState({ relationCount: list.length });
|
|
4827
|
+
}).catch(function () {
|
|
4828
|
+
t.setState({ relationCount: 0 });
|
|
4829
|
+
});
|
|
4830
|
+
}
|
|
4831
|
+
|
|
4832
|
+
// 配合详情页 flex:0.25,完整展示「关联流程(N)」
|
|
4833
|
+
|
|
4834
|
+
}, {
|
|
4835
|
+
key: 'getRelationTabTitle',
|
|
4836
|
+
value: function getRelationTabTitle() {
|
|
4837
|
+
var n = parseInt(this.state.relationCount, 10);
|
|
4838
|
+
if (isNaN(n) || n < 0) {
|
|
4839
|
+
n = 0;
|
|
4840
|
+
}
|
|
4841
|
+
return n > 0 ? '关联流程(' + n + ')' : '关联流程';
|
|
4842
|
+
}
|
|
4843
|
+
}, {
|
|
4844
|
+
key: 'normalizeRelationList',
|
|
4845
|
+
value: function normalizeRelationList(content) {
|
|
4846
|
+
if (Array.isArray(content)) {
|
|
4847
|
+
return content;
|
|
4848
|
+
}
|
|
4849
|
+
if (content && Array.isArray(content.data)) {
|
|
4850
|
+
return content.data;
|
|
4851
|
+
}
|
|
4852
|
+
if (content && Array.isArray(content.content)) {
|
|
4853
|
+
return content.content;
|
|
4854
|
+
}
|
|
4855
|
+
if (content && content.list && Array.isArray(content.list)) {
|
|
4856
|
+
return content.list;
|
|
4857
|
+
}
|
|
4858
|
+
return [];
|
|
4859
|
+
}
|
|
4860
|
+
}, {
|
|
4861
|
+
key: 'onRelationCountChange',
|
|
4862
|
+
value: function onRelationCountChange(count) {
|
|
4863
|
+
var n = parseInt(count, 10);
|
|
4864
|
+
if (isNaN(n) || n < 0) {
|
|
4865
|
+
n = 0;
|
|
4866
|
+
}
|
|
4867
|
+
// 与列表回写对齐,始终刷新页签数字
|
|
4868
|
+
if (n !== this.state.relationCount) {
|
|
4869
|
+
this.setState({
|
|
4870
|
+
relationCount: n
|
|
4871
|
+
});
|
|
4872
|
+
} else if (n > 0) {
|
|
4873
|
+
// 同值也强制一次,避免 Tab 标题未重绘
|
|
4874
|
+
this.forceUpdate();
|
|
4875
|
+
}
|
|
4876
|
+
}
|
|
4877
|
+
|
|
4655
4878
|
//子流程自动关联
|
|
4656
4879
|
|
|
4657
4880
|
}, {
|
|
@@ -5606,7 +5829,21 @@ var PageHome = function (_React$Component) {
|
|
|
5606
5829
|
// }
|
|
5607
5830
|
param.commentbizSn = commentbizSn;
|
|
5608
5831
|
if (t.state.module === 'approve' && t.state.formDataOptlock !== '' && t.state.formDataOptlock !== null && typeof t.state.formDataOptlock !== 'undefined') {
|
|
5609
|
-
|
|
5832
|
+
// 无有效主表 dataId 时不传 optlock,避免后端「已传版本却无主键」直接报冲突
|
|
5833
|
+
var sendOptlockDataId = param.dataId || t.state.dataId;
|
|
5834
|
+
try {
|
|
5835
|
+
if ((!sendOptlockDataId || !(0, _filterEmptySubTblRows.isValidFormDataId)(sendOptlockDataId)) && param.formData) {
|
|
5836
|
+
var parsedFd = typeof param.formData === 'string' ? JSON.parse(param.formData) : param.formData;
|
|
5837
|
+
if (parsedFd && (0, _filterEmptySubTblRows.isValidFormDataId)(parsedFd.dataId)) {
|
|
5838
|
+
sendOptlockDataId = parsedFd.dataId;
|
|
5839
|
+
}
|
|
5840
|
+
}
|
|
5841
|
+
} catch (eOpt) {}
|
|
5842
|
+
if ((0, _filterEmptySubTblRows.isValidFormDataId)(sendOptlockDataId)) {
|
|
5843
|
+
param.optlock = t.state.formDataOptlock;
|
|
5844
|
+
} else if (param.optlock !== undefined) {
|
|
5845
|
+
delete param.optlock;
|
|
5846
|
+
}
|
|
5610
5847
|
}
|
|
5611
5848
|
|
|
5612
5849
|
var db = _db2.default;
|
|
@@ -6538,6 +6775,152 @@ var PageHome = function (_React$Component) {
|
|
|
6538
6775
|
}
|
|
6539
6776
|
});
|
|
6540
6777
|
}
|
|
6778
|
+
|
|
6779
|
+
// 打开减签页:拉取本节点被加签人列表
|
|
6780
|
+
|
|
6781
|
+
}, {
|
|
6782
|
+
key: 'openReduceSign',
|
|
6783
|
+
value: function openReduceSign() {
|
|
6784
|
+
var t = this;
|
|
6785
|
+
_db2.default.FlowModuleAPI.getSignUserList({
|
|
6786
|
+
taskId: t.state.taskId
|
|
6787
|
+
}).then(function (content) {
|
|
6788
|
+
var list = content || [];
|
|
6789
|
+
var addPool = [];
|
|
6790
|
+
for (var i = 0; i < list.length; i++) {
|
|
6791
|
+
var item = list[i];
|
|
6792
|
+
addPool.push({
|
|
6793
|
+
userid: item.userid,
|
|
6794
|
+
username: item.username,
|
|
6795
|
+
status: item.status
|
|
6796
|
+
});
|
|
6797
|
+
}
|
|
6798
|
+
t.setState({
|
|
6799
|
+
pageStatus: '1',
|
|
6800
|
+
operate: 22,
|
|
6801
|
+
reduceSignUserList: list,
|
|
6802
|
+
reduceSignAddPool: addPool,
|
|
6803
|
+
reduceSignReducePool: [],
|
|
6804
|
+
reduceShortMessage: t.state.addlotsShortMessage || '0'
|
|
6805
|
+
}, function () {
|
|
6806
|
+
$(window).scrollTop(0);
|
|
6807
|
+
});
|
|
6808
|
+
}).catch(function (error) {
|
|
6809
|
+
_Toast2.default.show({
|
|
6810
|
+
type: 'error',
|
|
6811
|
+
content: error && error.errorMsg ? error.errorMsg : '获取减签用户失败'
|
|
6812
|
+
});
|
|
6813
|
+
});
|
|
6814
|
+
}
|
|
6815
|
+
}, {
|
|
6816
|
+
key: 'moveToReducePool',
|
|
6817
|
+
value: function moveToReducePool(userId) {
|
|
6818
|
+
var addPool = (this.state.reduceSignAddPool || []).slice();
|
|
6819
|
+
var reducePool = (this.state.reduceSignReducePool || []).slice();
|
|
6820
|
+
for (var i = 0; i < addPool.length; i++) {
|
|
6821
|
+
if (addPool[i].userid == userId && addPool[i].status != '1') {
|
|
6822
|
+
reducePool.push(addPool[i]);
|
|
6823
|
+
addPool.splice(i, 1);
|
|
6824
|
+
break;
|
|
6825
|
+
}
|
|
6826
|
+
}
|
|
6827
|
+
this.setState({
|
|
6828
|
+
reduceSignAddPool: addPool,
|
|
6829
|
+
reduceSignReducePool: reducePool
|
|
6830
|
+
});
|
|
6831
|
+
}
|
|
6832
|
+
}, {
|
|
6833
|
+
key: 'moveToAddPool',
|
|
6834
|
+
value: function moveToAddPool(userId) {
|
|
6835
|
+
var addPool = (this.state.reduceSignAddPool || []).slice();
|
|
6836
|
+
var reducePool = (this.state.reduceSignReducePool || []).slice();
|
|
6837
|
+
for (var i = 0; i < reducePool.length; i++) {
|
|
6838
|
+
if (reducePool[i].userid == userId) {
|
|
6839
|
+
addPool.push(reducePool[i]);
|
|
6840
|
+
reducePool.splice(i, 1);
|
|
6841
|
+
break;
|
|
6842
|
+
}
|
|
6843
|
+
}
|
|
6844
|
+
this.setState({
|
|
6845
|
+
reduceSignAddPool: addPool,
|
|
6846
|
+
reduceSignReducePool: reducePool
|
|
6847
|
+
});
|
|
6848
|
+
}
|
|
6849
|
+
}, {
|
|
6850
|
+
key: 'changeReduceShortMessage',
|
|
6851
|
+
value: function changeReduceShortMessage(data) {
|
|
6852
|
+
var newremindStyle = "";
|
|
6853
|
+
for (var i = 0; i < data.length; i++) {
|
|
6854
|
+
if (i == data.length - 1) newremindStyle += data[i].value;else newremindStyle += data[i].value + ',';
|
|
6855
|
+
}
|
|
6856
|
+
this.setState({
|
|
6857
|
+
reduceShortMessage: newremindStyle || '0'
|
|
6858
|
+
});
|
|
6859
|
+
}
|
|
6860
|
+
}, {
|
|
6861
|
+
key: 'reduceSign',
|
|
6862
|
+
value: function reduceSign() {
|
|
6863
|
+
var t = this;
|
|
6864
|
+
var selected = t.state.reduceSignReducePool || [];
|
|
6865
|
+
var userIds = '';
|
|
6866
|
+
var userNames = '';
|
|
6867
|
+
selected.map(function (item) {
|
|
6868
|
+
userIds += item.userid + ',';
|
|
6869
|
+
userNames += item.username + ',';
|
|
6870
|
+
});
|
|
6871
|
+
if (userIds == '') {
|
|
6872
|
+
_Toast2.default.show({
|
|
6873
|
+
type: 'error',
|
|
6874
|
+
content: '请选择需要减签的用户'
|
|
6875
|
+
});
|
|
6876
|
+
return false;
|
|
6877
|
+
}
|
|
6878
|
+
userIds = userIds.substring(0, userIds.length - 1);
|
|
6879
|
+
userNames = userNames.substring(0, userNames.length - 1);
|
|
6880
|
+
var processTitle = t.state.processTitle || t.state.fileTitle || '';
|
|
6881
|
+
var reminders = t.state.reduceShortMessage;
|
|
6882
|
+
if (reminders == '0') {
|
|
6883
|
+
reminders = '';
|
|
6884
|
+
}
|
|
6885
|
+
var isPush = t.state.isPush;
|
|
6886
|
+
_db2.default.FlowModuleAPI.reduceSign({
|
|
6887
|
+
taskId: t.state.taskId,
|
|
6888
|
+
userIds: userIds,
|
|
6889
|
+
userNames: userNames,
|
|
6890
|
+
reminders: reminders,
|
|
6891
|
+
processTitle: processTitle,
|
|
6892
|
+
module: t.state.module,
|
|
6893
|
+
processInstanceId: t.state.processInstanceId,
|
|
6894
|
+
formId: t.state.formId,
|
|
6895
|
+
dataId: t.state.dataId,
|
|
6896
|
+
permissionCode: t.state.permissionCode,
|
|
6897
|
+
categoryCode: t.state.category || ''
|
|
6898
|
+
}).then(function (content) {
|
|
6899
|
+
_Toast2.default.show({
|
|
6900
|
+
type: 'success',
|
|
6901
|
+
content: (t.state.finalButtons.get('HELP_REDUCELOTS') || '减签') + '成功'
|
|
6902
|
+
});
|
|
6903
|
+
if (isPush == '1') {
|
|
6904
|
+
closePage();
|
|
6905
|
+
} else {
|
|
6906
|
+
setTimeout(function () {
|
|
6907
|
+
history.back();
|
|
6908
|
+
}, 1500);
|
|
6909
|
+
}
|
|
6910
|
+
}).catch(function (error) {
|
|
6911
|
+
if (typeof error.errorMsg == 'undefined') {
|
|
6912
|
+
_Toast2.default.show({
|
|
6913
|
+
type: 'error',
|
|
6914
|
+
content: '提交出错'
|
|
6915
|
+
});
|
|
6916
|
+
} else {
|
|
6917
|
+
_Toast2.default.show({
|
|
6918
|
+
type: 'error',
|
|
6919
|
+
content: error.errorMsg.replace('!', '').replace('!', '')
|
|
6920
|
+
});
|
|
6921
|
+
}
|
|
6922
|
+
});
|
|
6923
|
+
}
|
|
6541
6924
|
}, {
|
|
6542
6925
|
key: 'circulateNode',
|
|
6543
6926
|
value: function circulateNode() {
|
|
@@ -7282,6 +7665,11 @@ var PageHome = function (_React$Component) {
|
|
|
7282
7665
|
buttonCodeListNew.push({ name: buttonName, type: 'secondary', display: 'inline', no: 5 });
|
|
7283
7666
|
} else if (buttonCode == 'HELP_ADDLOTS') {
|
|
7284
7667
|
buttonCodeListNew.push({ name: buttonName, type: 'secondary', display: 'inline', no: 6 });
|
|
7668
|
+
var pmMore = String(_this4.state.participantMode);
|
|
7669
|
+
if (pmMore == '1' || pmMore == '2') {
|
|
7670
|
+
var reduceNameMore = _this4.state.finalButtons.get('HELP_REDUCELOTS') || '减签';
|
|
7671
|
+
buttonCodeListNew.push({ name: reduceNameMore, type: 'secondary', display: 'inline', no: 22 });
|
|
7672
|
+
}
|
|
7285
7673
|
} else if (buttonCode == 'BASE_END') {
|
|
7286
7674
|
buttonCodeListNew.push({ name: buttonName, type: 'secondary', display: 'inline', no: 8 });
|
|
7287
7675
|
} else if (buttonCode == 'BASE_NOTPASS') {
|
|
@@ -7292,6 +7680,8 @@ var PageHome = function (_React$Component) {
|
|
|
7292
7680
|
buttonCodeListNew.push({ name: buttonName, type: 'secondary', display: 'inline', no: 'distributeFlow' });
|
|
7293
7681
|
} else if (buttonCode == 'MAILSEND') {
|
|
7294
7682
|
buttonCodeListNew.push({ name: buttonName, type: 'secondary', display: 'inline', no: 18 });
|
|
7683
|
+
} else if (buttonCode == 'OTHER_RELATION') {
|
|
7684
|
+
buttonCodeListNew.push({ name: buttonName, type: 'secondary', display: 'inline', no: 'OTHER_RELATION' });
|
|
7295
7685
|
} else {
|
|
7296
7686
|
buttonCodeListNew.push({ name: buttonName, type: 'secondary', display: 'inline', no: buttonCode });
|
|
7297
7687
|
}
|
|
@@ -7299,6 +7689,13 @@ var PageHome = function (_React$Component) {
|
|
|
7299
7689
|
} else {
|
|
7300
7690
|
actionSheetButtonOpt.push(buttonCode);
|
|
7301
7691
|
actionSheetButtonOptName.push(buttonName);
|
|
7692
|
+
if (buttonCode == 'HELP_ADDLOTS') {
|
|
7693
|
+
var pmSheet = String(_this4.state.participantMode);
|
|
7694
|
+
if (pmSheet == '1' || pmSheet == '2') {
|
|
7695
|
+
actionSheetButtonOpt.push('HELP_REDUCELOTS');
|
|
7696
|
+
actionSheetButtonOptName.push(_this4.state.finalButtons.get('HELP_REDUCELOTS') || '减签');
|
|
7697
|
+
}
|
|
7698
|
+
}
|
|
7302
7699
|
}
|
|
7303
7700
|
}
|
|
7304
7701
|
var nowNum = mainSlotCount;
|
|
@@ -7337,6 +7734,11 @@ var PageHome = function (_React$Component) {
|
|
|
7337
7734
|
buttonList.push({ name: buttonName, type: 'secondary', display: 'inline', no: 5 });
|
|
7338
7735
|
} else if (buttonCode == 'HELP_ADDLOTS') {
|
|
7339
7736
|
buttonList.push({ name: buttonName, type: 'secondary', display: 'inline', no: 6 });
|
|
7737
|
+
var pmFew = String(_this4.state.participantMode);
|
|
7738
|
+
if (pmFew == '1' || pmFew == '2') {
|
|
7739
|
+
var reduceNameFew = _this4.state.finalButtons.get('HELP_REDUCELOTS') || '减签';
|
|
7740
|
+
buttonList.push({ name: reduceNameFew, type: 'secondary', display: 'inline', no: 22 });
|
|
7741
|
+
}
|
|
7340
7742
|
} else if (buttonCode == 'BASE_END') {
|
|
7341
7743
|
buttonList.push({ name: buttonName, type: 'secondary', display: 'inline', no: 8 });
|
|
7342
7744
|
} else if (buttonCode == 'BASE_NOTPASS') {
|
|
@@ -7349,6 +7751,8 @@ var PageHome = function (_React$Component) {
|
|
|
7349
7751
|
buttonList.push({ name: buttonName, type: 'secondary', display: 'inline', no: 20 });
|
|
7350
7752
|
} else if (buttonCode == 'MAILSEND') {
|
|
7351
7753
|
buttonList.push({ name: buttonName, type: 'secondary', display: 'inline', no: 18 });
|
|
7754
|
+
} else if (buttonCode == 'OTHER_RELATION') {
|
|
7755
|
+
buttonList.push({ name: buttonName, type: 'secondary', display: 'inline', no: 'OTHER_RELATION' });
|
|
7352
7756
|
} else {
|
|
7353
7757
|
buttonList.push({ name: buttonName, type: 'secondary', display: 'inline', no: buttonCode });
|
|
7354
7758
|
}
|
|
@@ -7923,11 +8327,19 @@ var PageHome = function (_React$Component) {
|
|
|
7923
8327
|
key: 'handleChange',
|
|
7924
8328
|
value: function handleChange(obj) {
|
|
7925
8329
|
var t = this;
|
|
7926
|
-
this.setState({ activeItemIndex: obj.active })
|
|
8330
|
+
this.setState({ activeItemIndex: obj.active }, function () {
|
|
8331
|
+
if (String(obj.active) === '3') {
|
|
8332
|
+
t.loadRelationCount();
|
|
8333
|
+
}
|
|
8334
|
+
});
|
|
7927
8335
|
if (obj.active == '2') {
|
|
7928
8336
|
t.refs.flowChart_list.componentDidMount();
|
|
7929
8337
|
} else if (obj.active == '3') {
|
|
7930
|
-
t.refs.relationProcess_list.
|
|
8338
|
+
if (t.refs.relationProcess_list && typeof t.refs.relationProcess_list.reload === 'function') {
|
|
8339
|
+
t.refs.relationProcess_list.reload();
|
|
8340
|
+
} else if (t.refs.relationProcess_list && typeof t.refs.relationProcess_list.componentDidMount === 'function') {
|
|
8341
|
+
t.refs.relationProcess_list.componentDidMount();
|
|
8342
|
+
}
|
|
7931
8343
|
}
|
|
7932
8344
|
}
|
|
7933
8345
|
|
|
@@ -9127,14 +9539,26 @@ var PageHome = function (_React$Component) {
|
|
|
9127
9539
|
),
|
|
9128
9540
|
_react2.default.createElement(
|
|
9129
9541
|
_Tab2.default.Item,
|
|
9130
|
-
{
|
|
9542
|
+
{
|
|
9543
|
+
key: '3',
|
|
9544
|
+
title: this.getRelationTabTitle()
|
|
9545
|
+
},
|
|
9131
9546
|
_react2.default.createElement(
|
|
9132
9547
|
_Group2.default.List,
|
|
9133
9548
|
null,
|
|
9134
9549
|
_react2.default.createElement(
|
|
9135
9550
|
'div',
|
|
9136
9551
|
{ className: this.state.activeItemIndex == 3 ? '' : 't-DN' },
|
|
9137
|
-
_react2.default.createElement(_RelationProcess2.default, {
|
|
9552
|
+
_react2.default.createElement(_RelationProcess2.default, {
|
|
9553
|
+
ref: "relationProcess_list",
|
|
9554
|
+
taskId: this.state.taskId,
|
|
9555
|
+
processInstanceId: this.state.processInstanceId,
|
|
9556
|
+
listType: this.state.listType,
|
|
9557
|
+
activityId: this.state.activityId,
|
|
9558
|
+
canManage: this.state.hasRelationBtn && (this.state.listType == '0' || this.state.isDraft == '1' || this.state.permissionCode == 'start' || this.state.isStart === true),
|
|
9559
|
+
onCountChange: this.onRelationCountChange.bind(this),
|
|
9560
|
+
onDeleted: this.refreshRelationTab.bind(this)
|
|
9561
|
+
})
|
|
9138
9562
|
)
|
|
9139
9563
|
)
|
|
9140
9564
|
),
|
|
@@ -9692,6 +10116,73 @@ var PageHome = function (_React$Component) {
|
|
|
9692
10116
|
onChange: this.changeAddlotsShortMessage.bind(this),
|
|
9693
10117
|
required: false })
|
|
9694
10118
|
),
|
|
10119
|
+
_react2.default.createElement(
|
|
10120
|
+
_Group2.default.List,
|
|
10121
|
+
{ className: this.state.operate == 22 ? '' : 't-DN' },
|
|
10122
|
+
_react2.default.createElement(
|
|
10123
|
+
'div',
|
|
10124
|
+
{ style: { background: '#f2f3f5', padding: '10px 5px' } },
|
|
10125
|
+
_react2.default.createElement(
|
|
10126
|
+
'span',
|
|
10127
|
+
{ className: 'theme-color' },
|
|
10128
|
+
_react2.default.createElement('i', { className: 'iconfont icon-back t-rotate-180 t-FS14 t-FR' }),
|
|
10129
|
+
this.state.finalButtons.get("HELP_REDUCELOTS") || '减签'
|
|
10130
|
+
)
|
|
10131
|
+
),
|
|
10132
|
+
_react2.default.createElement(
|
|
10133
|
+
'div',
|
|
10134
|
+
{ className: 't-field-box t-FBH t-FBAC', style: { padding: '10px 16px', flexWrap: 'wrap' } },
|
|
10135
|
+
_react2.default.createElement(
|
|
10136
|
+
'div',
|
|
10137
|
+
{ className: 't-field-layout-h-label', style: { width: '100%', marginBottom: '6px' } },
|
|
10138
|
+
'\u52A0\u7B7E\u7528\u6237'
|
|
10139
|
+
),
|
|
10140
|
+
_react2.default.createElement(
|
|
10141
|
+
'div',
|
|
10142
|
+
{ style: { display: 'flex', flexWrap: 'wrap', width: '100%' } },
|
|
10143
|
+
(this.state.reduceSignAddPool || []).map(function (item, idx) {
|
|
10144
|
+
return item.status == '1' ? _react2.default.createElement(
|
|
10145
|
+
'span',
|
|
10146
|
+
{ key: 'add-' + item.userid + '-' + idx, style: { margin: '0 8px 8px 0', padding: '4px 10px', background: '#f0f0f0', color: '#999', borderRadius: '4px', fontSize: '13px' } },
|
|
10147
|
+
item.username,
|
|
10148
|
+
'(\u5DF2\u529E)'
|
|
10149
|
+
) : _react2.default.createElement(
|
|
10150
|
+
'span',
|
|
10151
|
+
{ key: 'add-' + item.userid + '-' + idx, onClick: _this5.moveToReducePool.bind(_this5, item.userid), style: { margin: '0 8px 8px 0', padding: '4px 10px', background: '#e60012', color: '#fff', borderRadius: '4px', fontSize: '13px' } },
|
|
10152
|
+
item.username,
|
|
10153
|
+
' \xD7'
|
|
10154
|
+
);
|
|
10155
|
+
})
|
|
10156
|
+
)
|
|
10157
|
+
),
|
|
10158
|
+
_react2.default.createElement(
|
|
10159
|
+
'div',
|
|
10160
|
+
{ className: 't-field-box t-FBH t-FBAC', style: { padding: '10px 16px', flexWrap: 'wrap' } },
|
|
10161
|
+
_react2.default.createElement(
|
|
10162
|
+
'div',
|
|
10163
|
+
{ className: 't-field-layout-h-label', style: { width: '100%', marginBottom: '6px' } },
|
|
10164
|
+
'\u51CF\u7B7E\u7528\u6237'
|
|
10165
|
+
),
|
|
10166
|
+
_react2.default.createElement(
|
|
10167
|
+
'div',
|
|
10168
|
+
{ style: { display: 'flex', flexWrap: 'wrap', width: '100%' } },
|
|
10169
|
+
(this.state.reduceSignReducePool || []).map(function (item, idx) {
|
|
10170
|
+
return _react2.default.createElement(
|
|
10171
|
+
'span',
|
|
10172
|
+
{ key: 'reduce-' + item.userid + '-' + idx, onClick: _this5.moveToAddPool.bind(_this5, item.userid), style: { margin: '0 8px 8px 0', padding: '4px 10px', background: '#e60012', color: '#fff', borderRadius: '4px', fontSize: '13px' } },
|
|
10173
|
+
item.username,
|
|
10174
|
+
' \xD7'
|
|
10175
|
+
);
|
|
10176
|
+
})
|
|
10177
|
+
)
|
|
10178
|
+
),
|
|
10179
|
+
_react2.default.createElement(_CheckboxField2.default, {
|
|
10180
|
+
data: this.state.shortMessageList,
|
|
10181
|
+
className: '',
|
|
10182
|
+
mode: 'list',
|
|
10183
|
+
onChange: this.changeReduceShortMessage.bind(this),
|
|
10184
|
+
required: false })
|
|
10185
|
+
),
|
|
9695
10186
|
_react2.default.createElement(
|
|
9696
10187
|
_Group2.default.List,
|
|
9697
10188
|
{ className: this.state.operate == 4 ? '' : 't-DN' },
|