fmui-base 2.3.83 → 2.3.85

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 CHANGED
@@ -3,6 +3,8 @@
3
3
  ---npm publish
4
4
 
5
5
  ## 更新日志
6
+ - 2.3.85:扩展开发时给表单字段赋值数字0时不生效
7
+ - 2.3.84:流程办理完支持根据配置自动打开下一待办
6
8
  - 2.3.83:数据表字段计算值differHalfDate函数不生效
7
9
  - 2.3.82:流程待办推送审批完再点进去看不到当时审批时写的批示意见
8
10
  - 2.3.81:流程提交提醒样式调整
package/lib/db/db.js CHANGED
@@ -1209,6 +1209,16 @@ context.create('FlowModuleAPI', {
1209
1209
  // });
1210
1210
  }
1211
1211
  },
1212
+ /** 移动待办列表分页(type=0 与列表默认序一致,用于办完进下一条) */
1213
+ queryProcessPage: {
1214
+ mockUrl: 'query/queryProcessPage.json',
1215
+ url: _variables2.default.URLS.queryProcessPage,
1216
+ method: 'GET',
1217
+ header: {
1218
+ Authorization: 'Bearer ' + getLoginUserInfo().token
1219
+ },
1220
+ willFetch: function willFetch() {}
1221
+ },
1212
1222
  getComplianceRule: {
1213
1223
  mockUrl: 'query/queryCanBack.json',
1214
1224
  url: _variables2.default.URLS.getComplianceRule,
@@ -103,6 +103,7 @@ exports.default = {
103
103
  forceEnd: approveUrlPrefix + 'forceEnd' + '?', //结束流程
104
104
  notPass: approveUrlPrefix + 'notPass' + '?', //不通过
105
105
  getUndoTaskInfo: approveUrlPrefix + "getUndoTaskInfo" + '?', //获取待办详情
106
+ queryProcessPage: approveUrlPrefix + "queryProcessPage" + '?', //分页查询待办/已办等列表
106
107
  batchValidateForm: approveUrlPrefix + "batchValidateForm" + '?', //批量校验表单必填
107
108
  batchCheckCaAuth: approveUrlPrefix + "batchCheckCaAuth" + '?', //批量通过前CA授权检测
108
109
  completeTaskBatch: approveUrlPrefix + "completeTaskBatch" + '?', //批量办理
package/lib/form/form.js CHANGED
@@ -2465,7 +2465,9 @@ var PageHome = function (_React$Component) {
2465
2465
  if (relatedItem.value || relatedItem.value == 0) {
2466
2466
  value = relatedItem.value;
2467
2467
  }
2468
-
2468
+ if (value === 0) {
2469
+ value = '0';
2470
+ }
2469
2471
  //}
2470
2472
  if (itemType == 'text' || itemType == 'textarea') {
2471
2473
  if (value) {
@@ -2500,7 +2502,9 @@ var PageHome = function (_React$Component) {
2500
2502
  if (item.value || item.value == 0) {
2501
2503
  value = item.value;
2502
2504
  }
2503
-
2505
+ if (value === 0) {
2506
+ value = '0';
2507
+ }
2504
2508
  //}
2505
2509
  if (itemType == 'text' || itemType == 'textarea') {
2506
2510
  if (value) {
@@ -389,26 +389,8 @@ var PageHome = function (_React$Component) {
389
389
  }).catch(function (error) {
390
390
  console.error(error);
391
391
  });
392
- //流程标题
393
- _db2.default.FlowModuleAPI.getProcessTitleByProId({
394
- processInstanceId: props.processInstanceId
395
- }).then(function (content) {
396
-
397
- if (typeof content.title != "undefined" && content.title != "" && content.title != null) {
398
- _this.setState({
399
- processTitle: content.title,
400
- processName: content.name,
401
- curStepName: content.curStepName
402
- });
403
- } else {
404
- _this.setState({
405
- processTitle: '',
406
- processName: ''
407
- });
408
- }
409
- }).catch(function (error) {
410
- console.error(error);
411
- });
392
+ // 流程标题:构造函数先拉一次;换下一条走 componentDidMount → refreshProcessTitle
393
+ _this.refreshProcessTitle(props.processInstanceId);
412
394
  //自动保存
413
395
  var autoSaveApprove = getSystemInfo().autoSaveApprove;
414
396
 
@@ -574,7 +556,7 @@ var PageHome = function (_React$Component) {
574
556
  selectProcessCode: '', //选中的子流程
575
557
  subProcessType: '', //子流程类型 0串行 1并行
576
558
  urgencyList: [], //紧急程度列表
577
- urgency: '' }, _defineProperty(_param, 'urgent', ''), _defineProperty(_param, 'backInitiatorEndFlow', '0'), _defineProperty(_param, 'oauthWindowURL', ''), _defineProperty(_param, 'signDataId', ''), _defineProperty(_param, 'isCaUser', '0'), _defineProperty(_param, 'caFirm', ''), _defineProperty(_param, 'caESignatureName', ''), _defineProperty(_param, 'caFormSign', ''), _defineProperty(_param, 'addlotsReturn', ''), _defineProperty(_param, 'inscriptionShow', ''), _defineProperty(_param, 'showOrgSwitcher', false), _defineProperty(_param, 'approveOrgOptions', []), _defineProperty(_param, 'approveOrgSelectValue', {}), _defineProperty(_param, 'approveOrgLocked', false), _defineProperty(_param, 'approveFormParttimeOrgEnabled', true), _defineProperty(_param, 'approveProcessMailForwardEnabled', false), _defineProperty(_param, 'approveCurOrgId', ''), _defineProperty(_param, 'startUserOrgId', ''), _defineProperty(_param, 'taskAssignOrgId', ''), _defineProperty(_param, 'approveOrgApiUnavailable', false), _param);
559
+ urgency: '' }, _defineProperty(_param, 'urgent', ''), _defineProperty(_param, 'backInitiatorEndFlow', '0'), _defineProperty(_param, 'oauthWindowURL', ''), _defineProperty(_param, 'signDataId', ''), _defineProperty(_param, 'isCaUser', '0'), _defineProperty(_param, 'caFirm', ''), _defineProperty(_param, 'caESignatureName', ''), _defineProperty(_param, 'caFormSign', ''), _defineProperty(_param, 'addlotsReturn', ''), _defineProperty(_param, 'inscriptionShow', ''), _defineProperty(_param, 'showOrgSwitcher', false), _defineProperty(_param, 'approveOrgOptions', []), _defineProperty(_param, 'approveOrgSelectValue', {}), _defineProperty(_param, 'approveOrgLocked', false), _defineProperty(_param, 'approveFormParttimeOrgEnabled', true), _defineProperty(_param, 'approveProcessMailForwardEnabled', false), _defineProperty(_param, 'mobilePendingAutoNextEnabled', false), _defineProperty(_param, 'navigatingToNextPending', false), _defineProperty(_param, 'approveCurOrgId', ''), _defineProperty(_param, 'startUserOrgId', ''), _defineProperty(_param, 'taskAssignOrgId', ''), _defineProperty(_param, 'approveOrgApiUnavailable', false), _param);
578
560
  FlowCommon = require('pages/flow_common/' + module).default ? require('pages/flow_common/' + module).default : require('pages/flow_common/' + module);
579
561
 
580
562
  //处理特有参数
@@ -781,6 +763,40 @@ var PageHome = function (_React$Component) {
781
763
  src: src
782
764
  });
783
765
  }
766
+
767
+ /** 按流程实例刷新顶栏标题(换下一条须重拉,构造函数不会再跑) */
768
+
769
+ }, {
770
+ key: 'refreshProcessTitle',
771
+ value: function refreshProcessTitle(processInstanceId) {
772
+ var t = this;
773
+ var pid = processInstanceId || t.state && t.state.processInstanceId || '';
774
+ if (!pid || pid === '-1' || pid === 'undefined') {
775
+ return;
776
+ }
777
+ _db2.default.FlowModuleAPI.getProcessTitleByProId({
778
+ processInstanceId: pid
779
+ }).then(function (content) {
780
+ // 异步返回时实例可能已切到别的流程,丢弃过期结果
781
+ if (String(t.state.processInstanceId || '') !== String(pid)) {
782
+ return;
783
+ }
784
+ if (content && typeof content.title != 'undefined' && content.title != '' && content.title != null) {
785
+ t.setState({
786
+ processTitle: content.title,
787
+ processName: content.name,
788
+ curStepName: content.curStepName
789
+ });
790
+ } else {
791
+ t.setState({
792
+ processTitle: '',
793
+ processName: ''
794
+ });
795
+ }
796
+ }).catch(function (error) {
797
+ console.error(error);
798
+ });
799
+ }
784
800
  }, {
785
801
  key: 'componentDidMount',
786
802
  value: function componentDidMount() {
@@ -790,6 +806,18 @@ var PageHome = function (_React$Component) {
790
806
  t.imageView(e.target.src);
791
807
  }
792
808
  });
809
+ // 换下一条复用实例时构造函数不跑,这里重拉顶栏标题
810
+ t.refreshProcessTitle(t.state.processInstanceId);
811
+ // 流程设置「移动端待办办完进下一条」:默认禁用,仅明确为 1 时启用
812
+ _db2.default.FlowModuleAPI.getSysSettingByMark({ mark: 'mobilePendingAutoNext' }).then(function (content) {
813
+ var val = content;
814
+ if (content && (typeof content === 'undefined' ? 'undefined' : _typeof(content)) === 'object' && content.content != null) {
815
+ val = content.content;
816
+ }
817
+ t.setState({ mobilePendingAutoNextEnabled: val == '1' });
818
+ }).catch(function () {
819
+ t.setState({ mobilePendingAutoNextEnabled: false });
820
+ });
793
821
  // 流程设置「流程办理邮件转发」:默认禁用,仅明确为 1 时启用
794
822
  _db2.default.FlowModuleAPI.getSysSettingByMark({ mark: 'approveProcessMailForward' }).then(function (content) {
795
823
  var val = content;
@@ -1337,7 +1365,7 @@ var PageHome = function (_React$Component) {
1337
1365
  var processIsComplete = content.processIsComplete;
1338
1366
  var handleUserDingId = content.handleUserDingId;
1339
1367
  transferReturn = content.transferReturn;
1340
- //流程标题
1368
+ //流程标题(详情接口带回时同步顶栏 processTitle,避免换下一条仍显示上一条)
1341
1369
  var fileTitle = content.title;
1342
1370
  if (!fileTitle) {
1343
1371
  fileTitle = "";
@@ -1720,6 +1748,7 @@ var PageHome = function (_React$Component) {
1720
1748
  commentIsNull: commentIsNull,
1721
1749
  commentIsNotNull: commentIsNotNull,
1722
1750
  fileTitle: fileTitle,
1751
+ processTitle: fileTitle || t.state.processTitle || '',
1723
1752
  fieldControll: content.fieldControll,
1724
1753
  readtype: readtype,
1725
1754
  loadSuccess: true,
@@ -5338,37 +5367,7 @@ var PageHome = function (_React$Component) {
5338
5367
  FlowCommon.operateCallBack({ type: 8, dataId: dataId, isBatch: 0 }, t.state);
5339
5368
  }
5340
5369
 
5341
- if (isPush == '1') {
5342
- closePage();
5343
- //alert("_thirdMenuType:"+_thirdMenuType);
5344
- //不得已的办法
5345
- // if(_thirdMenuType == 'WX'){
5346
- // wx.ready(function(){
5347
- // wx.closeWindow();
5348
- // });
5349
- // }else if(_thirdMenuType =='MH' && typeof(emp)!="undefined"){
5350
- // emp.window.close({
5351
- // id:'this', //指定被关闭窗口标识,如果id=‘this‘,则关闭当前窗口
5352
- // })
5353
- // }else{
5354
- // setTimeout(
5355
- // function () {
5356
-
5357
- // backPage();
5358
-
5359
- // }, 1500);
5360
- // }
5361
- } else {
5362
- setTimeout(function () {
5363
- // window.ReactNativeWebView.postMessage('final');
5364
- backPage();
5365
- //window.ReactNativeWebView.postMessage('final');
5366
- }, 1500);
5367
- }
5368
- // setTimeout(
5369
- // function () {
5370
- // backPage();
5371
- // }, 1500);
5370
+ t.afterPendingActionLeave({ delayMs: 1500 });
5372
5371
  }).catch(function (error) {
5373
5372
  setTimeout(function () {
5374
5373
  _Toast2.default.show({
@@ -6282,17 +6281,8 @@ var PageHome = function (_React$Component) {
6282
6281
  autoPassCommentContent: '',
6283
6282
  autoPassCommentId: ''
6284
6283
  });
6285
- if (isSub == '1') {
6286
- backPage(2);
6287
- }
6288
- if (isPush == '1') {
6289
- closePage();
6290
- } else {
6291
- setTimeout(function () {
6292
-
6293
- backPage();
6294
- }, 1500);
6295
- }
6284
+ // 同流程自动通过链已结束,再进列表下一条(或原关页)
6285
+ t.afterPendingActionLeave({ delayMs: 1500 });
6296
6286
  }
6297
6287
  }).catch(function (error) {
6298
6288
  if (typeof error.errorMsg == 'undefined') {
@@ -6541,34 +6531,7 @@ var PageHome = function (_React$Component) {
6541
6531
  if (typeof mobileExt !== 'undefined' && typeof mobileExt["operateCallBack"] === "function") {
6542
6532
  mobileExt["operateCallBack"]({ type: 7, dataId: dataId, isBatch: 0 }, t.state);
6543
6533
  }
6544
- if (isPush == '0') {
6545
- setTimeout(function () {
6546
- history.back();
6547
- }, 1500);
6548
- } else if (isPush == '1') {
6549
- closePage();
6550
- //alert("_thirdMenuType:"+_thirdMenuType);
6551
- //不得已的办法
6552
- // if(_thirdMenuType == 'WX'){
6553
- // wx.ready(function(){
6554
- // wx.closeWindow();
6555
- // });
6556
- // }else if(_thirdMenuType =='MH' && typeof(emp)!="undefined"){
6557
- // emp.window.close({
6558
- // id:'this', //指定被关闭窗口标识,如果id=‘this‘,则关闭当前窗口
6559
- // })
6560
- // } else {
6561
- // setTimeout(
6562
- // function () {
6563
- // // window.ReactNativeWebView.postMessage('final');
6564
- // backPage();
6565
-
6566
- // }, 1500);
6567
- // }
6568
- } else {
6569
- // window.ReactNativeWebView.postMessage('final');
6570
- backPage();
6571
- }
6534
+ t.afterPendingActionLeave({ delayMs: 1500 });
6572
6535
  }).catch(function (error) {
6573
6536
  setTimeout(function () {
6574
6537
  _Toast2.default.show({
@@ -6624,15 +6587,7 @@ var PageHome = function (_React$Component) {
6624
6587
  if (typeof mobileExt !== 'undefined' && typeof mobileExt["operateCallBack"] === "function") {
6625
6588
  mobileExt["operateCallBack"]({ type: 2, dataId: dataId, isBatch: 0 }, t.state);
6626
6589
  }
6627
- if (isPush == '0') {
6628
- setTimeout(function () {
6629
- history.back();
6630
- }, 1500);
6631
- } else if (isPush == '1') {
6632
- closePage();
6633
- } else {
6634
- backPage();
6635
- }
6590
+ t.afterPendingActionLeave({ delayMs: 1500 });
6636
6591
  }).catch(function (error) {
6637
6592
  setTimeout(function () {
6638
6593
  _Toast2.default.show({
@@ -6786,34 +6741,7 @@ var PageHome = function (_React$Component) {
6786
6741
  if (typeof mobileExt !== 'undefined' && typeof mobileExt["operateCallBack"] === "function") {
6787
6742
  mobileExt["operateCallBack"]({ type: 2, dataId: dataId, isBatch: 0 }, t.state);
6788
6743
  }
6789
- if (isPush == '0') {
6790
- setTimeout(function () {
6791
- history.back();
6792
- }, 1500);
6793
- } else if (isPush == '1') {
6794
- closePage();
6795
- //alert("_thirdMenuType:"+_thirdMenuType);
6796
- //不得已的办法
6797
- // if(_thirdMenuType == 'WX'){
6798
- // wx.ready(function(){
6799
- // wx.closeWindow();
6800
- // });
6801
- // }else if(_thirdMenuType =='MH' && typeof(emp)!="undefined"){
6802
- // emp.window.close({
6803
- // id:'this', //指定被关闭窗口标识,如果id=‘this‘,则关闭当前窗口
6804
- // })
6805
- // } else {
6806
- // setTimeout(
6807
- // function () {
6808
- // // window.ReactNativeWebView.postMessage('final');
6809
- // backPage();
6810
-
6811
- // }, 1500);
6812
- // }
6813
- } else {
6814
- //window.ReactNativeWebView.postMessage('final');
6815
- backPage();
6816
- }
6744
+ t.afterPendingActionLeave({ delayMs: 1500 });
6817
6745
  }).catch(function (error) {
6818
6746
  setTimeout(function () {
6819
6747
  _Toast2.default.show({
@@ -6954,34 +6882,7 @@ var PageHome = function (_React$Component) {
6954
6882
  mobileExt["fieldSignCA"]({ type: type, dataId: dataId, isBatch: 0 }, t.state);
6955
6883
  }
6956
6884
  }
6957
- if (isPush == '0') {
6958
- //window.ReactNativeWebView.postMessage('final');
6959
- backPage();
6960
- } else if (isPush == '1') {
6961
- closePage();
6962
- //alert("_thirdMenuType:"+_thirdMenuType);
6963
- //不得已的办法
6964
- // if(_thirdMenuType == 'WX'){
6965
- // wx.ready(function(){
6966
- // wx.closeWindow();
6967
- // });
6968
- // }else if(_thirdMenuType =='MH' && typeof(emp)!="undefined"){
6969
- // emp.window.close({
6970
- // id:'this', //指定被关闭窗口标识,如果id=‘this‘,则关闭当前窗口
6971
- // })
6972
- // } else {
6973
- // setTimeout(
6974
- // function () {
6975
- // // window.ReactNativeWebView.postMessage('final');
6976
- // backPage();
6977
-
6978
- // }, 1500);
6979
- // }
6980
- } else {
6981
- setTimeout(function () {
6982
- history.back();
6983
- }, 1500);
6984
- }
6885
+ t.afterPendingActionLeave({ delayMs: 0 });
6985
6886
  }).catch(function (error) {
6986
6887
  if (typeof error.errorMsg == 'undefined') {
6987
6888
  setTimeout(function () {
@@ -7056,30 +6957,14 @@ var PageHome = function (_React$Component) {
7056
6957
  type: 'success',
7057
6958
  content: t.state.finalButtons.get("HELP_ADDLOTS") + '成功'
7058
6959
  });
7059
- if (isPush == '1') {
7060
- closePage();
7061
- //alert("_thirdMenuType:"+_thirdMenuType);
7062
- //不得已的办法
7063
- // if(_thirdMenuType == 'WX'){
7064
- // wx.ready(function(){
7065
- // wx.closeWindow();
7066
- // });
7067
- // }else if(_thirdMenuType =='MH' && typeof(emp)!="undefined"){
7068
- // emp.window.close({
7069
- // id:'this', //指定被关闭窗口标识,如果id=‘this‘,则关闭当前窗口
7070
- // })
7071
- // } else {
7072
- // setTimeout(
7073
- // function () {
7074
- // // window.ReactNativeWebView.postMessage('final');
7075
- // backPage();
7076
-
7077
- // }, 1500);
7078
- // }
6960
+ // 加签后本人通常仍留本待办:启用自动下一条时不跳不关;关闭开关则保持原关页
6961
+ if (t.isMobilePendingAutoNextEnabled() && t.isPendingListType()) {
6962
+ t.afterPendingActionLeave({ stayOnPage: true });
6963
+ try {
6964
+ t.handleCancelClick();
6965
+ } catch (e) {}
7079
6966
  } else {
7080
- setTimeout(function () {
7081
- history.back();
7082
- }, 1500);
6967
+ t.afterPendingActionLeave({ delayMs: 1500 });
7083
6968
  }
7084
6969
  }).catch(function (error) {
7085
6970
  if (typeof error.errorMsg == 'undefined') {
@@ -7742,29 +7627,7 @@ var PageHome = function (_React$Component) {
7742
7627
  type: 'success',
7743
7628
  content: t.state.finalButtons.get("BASE_JUMP") + '成功'
7744
7629
  });
7745
- if (isPush == '1') {
7746
- closePage();
7747
- // if(_thirdMenuType == 'WX'){
7748
- // wx.ready(function(){
7749
- // wx.closeWindow();
7750
- // });
7751
- // }else if(_thirdMenuType =='MH' && typeof(emp)!="undefined"){
7752
- // emp.window.close({
7753
- // id:'this', //指定被关闭窗口标识,如果id=‘this‘,则关闭当前窗口
7754
- // })
7755
- // }else{
7756
- // setTimeout(
7757
- // function () {
7758
-
7759
- // backPage();
7760
-
7761
- // }, 1500);
7762
- // }
7763
- } else {
7764
- setTimeout(function () {
7765
- history.back();
7766
- }, 1500);
7767
- }
7630
+ t.afterPendingActionLeave({ delayMs: 1500 });
7768
7631
  }).catch(function (error) {
7769
7632
  if (typeof error.errorMsg == 'undefined') {
7770
7633
  setTimeout(function () {
@@ -8241,29 +8104,7 @@ var PageHome = function (_React$Component) {
8241
8104
  if (typeof mobileExt !== 'undefined' && typeof mobileExt["operateCallBack"] === "function") {
8242
8105
  mobileExt["operateCallBack"]({ type: 2, dataId: dataId, isBatch: 0 }, t.state);
8243
8106
  }
8244
- if (isPush == '1') {
8245
- closePage();
8246
- // if(_thirdMenuType == 'WX'){
8247
- // wx.ready(function(){
8248
- // wx.closeWindow();
8249
- // });
8250
- // }else if(_thirdMenuType =='MH' && typeof(emp)!="undefined"){
8251
- // emp.window.close({
8252
- // id:'this', //指定被关闭窗口标识,如果id=‘this‘,则关闭当前窗口
8253
- // })
8254
- // }else{
8255
- // setTimeout(
8256
- // function () {
8257
-
8258
- // backPage();
8259
-
8260
- // }, 1500);
8261
- // }
8262
- } else {
8263
- setTimeout(function () {
8264
- history.back();
8265
- }, 1500);
8266
- }
8107
+ t.afterPendingActionLeave({ delayMs: 1500 });
8267
8108
  }).catch(function (error) {
8268
8109
  setTimeout(function () {
8269
8110
  _Toast2.default.show({
@@ -9078,6 +8919,254 @@ var PageHome = function (_React$Component) {
9078
8919
  return this.state.approveProcessMailForwardEnabled === true;
9079
8920
  }
9080
8921
 
8922
+ /** 流程设置「移动端待办办完进下一条」是否启用,默认禁用(仅明确为 1 时启用) */
8923
+
8924
+ }, {
8925
+ key: 'isMobilePendingAutoNextEnabled',
8926
+ value: function isMobilePendingAutoNextEnabled() {
8927
+ return this.state.mobilePendingAutoNextEnabled === true;
8928
+ }
8929
+
8930
+ /** 待办场景(含推送:listType 仍为 0) */
8931
+
8932
+ }, {
8933
+ key: 'isPendingListType',
8934
+ value: function isPendingListType() {
8935
+ return String(this.state.listType) === '0';
8936
+ }
8937
+
8938
+ /** 开关未开或非待办时的原关页/返回逻辑 */
8939
+
8940
+ }, {
8941
+ key: 'leavePendingPageDefault',
8942
+ value: function leavePendingPageDefault(options) {
8943
+ options = options || {};
8944
+ var t = this;
8945
+ var isPush = String(t.state.isPush || '0');
8946
+ var delayMs = options.delayMs != null ? options.delayMs : 1500;
8947
+ if (typeof isSub !== 'undefined' && isSub == '1' && options.honorIsSub !== false) {
8948
+ if (typeof backPage === 'function') {
8949
+ backPage(2);
8950
+ } else {
8951
+ history.back();
8952
+ }
8953
+ return;
8954
+ }
8955
+ if (isPush === '1') {
8956
+ closePage();
8957
+ } else {
8958
+ setTimeout(function () {
8959
+ if (typeof backPage === 'function') {
8960
+ backPage();
8961
+ } else {
8962
+ history.back();
8963
+ }
8964
+ }, delayMs);
8965
+ }
8966
+ }
8967
+
8968
+ /** 按移动待办列表默认序取下一条(排除当前 taskId) */
8969
+
8970
+ }, {
8971
+ key: 'fetchNextPendingTask',
8972
+ value: function fetchNextPendingTask(excludeTaskId) {
8973
+ var t = this;
8974
+ var module = t.state.module || 'approve';
8975
+ var param = {
8976
+ type: '0',
8977
+ page: '1',
8978
+ pageSize: '20',
8979
+ module: module
8980
+ };
8981
+ return _db2.default.FlowModuleAPI.queryProcessPage(param).then(function (content) {
8982
+ var rows = [];
8983
+ if (content) {
8984
+ if (Array.isArray(content.data)) {
8985
+ rows = content.data;
8986
+ } else if (content.data && Array.isArray(content.data.data)) {
8987
+ rows = content.data.data;
8988
+ } else if (Array.isArray(content)) {
8989
+ rows = content;
8990
+ }
8991
+ }
8992
+ var exclude = String(excludeTaskId || '');
8993
+ for (var i = 0; i < rows.length; i++) {
8994
+ var item = rows[i] || {};
8995
+ var tid = String(item.id || item.taskId || '');
8996
+ if (tid && tid !== exclude) {
8997
+ return item;
8998
+ }
8999
+ }
9000
+ return null;
9001
+ });
9002
+ }
9003
+
9004
+ /**
9005
+ * 换待办/取消办理时清提交页选人与后继节点,避免下一条仍显示上次审批人。
9006
+ * SelectMember 多用 defaultValue,同 ref 不卸载时内部选中态会残留。
9007
+ */
9008
+
9009
+ }, {
9010
+ key: 'buildClearSubmitOperateState',
9011
+ value: function buildClearSubmitOperateState() {
9012
+ return {
9013
+ pageStatus: '0',
9014
+ operate: 0,
9015
+ nextActivityList: [],
9016
+ nextRadomList: [],
9017
+ nextActivityName: '',
9018
+ nextSelectType: '',
9019
+ circulatePersonValue: [],
9020
+ sendMailPersonValue: [],
9021
+ chaosongPersonValue: [],
9022
+ transferPersonValue: [],
9023
+ jumpPersonValue: [],
9024
+ sendMailText: '',
9025
+ addSignComment: '',
9026
+ reduceSignUserList: [],
9027
+ reduceSignAddPool: [],
9028
+ reduceSignReducePool: [],
9029
+ canBackActivity: [],
9030
+ selectBackActivity: {},
9031
+ nextJumpActivity: [],
9032
+ selectJumpActivity: {},
9033
+ backReasonText: '',
9034
+ backAttachId: '',
9035
+ backInitList: []
9036
+ };
9037
+ }
9038
+ }, {
9039
+ key: 'tryClearSubmitSelectMemberRefs',
9040
+ value: function tryClearSubmitSelectMemberRefs() {
9041
+ var t = this;
9042
+ try {
9043
+ var nextActivityList = t.state.nextActivityList || [];
9044
+ var nextRadomList = t.state.nextRadomList || [];
9045
+ for (var i = 0; i < nextActivityList.length; i++) {
9046
+ var refNext = t.refs[nextActivityList[i].value + '_' + i];
9047
+ if (refNext && typeof refNext.dialogClearItem === 'function') {
9048
+ refNext.dialogClearItem();
9049
+ }
9050
+ }
9051
+ for (var r = 0; r < nextRadomList.length; r++) {
9052
+ var sub = nextRadomList[r] && nextRadomList[r].subRandomList || [];
9053
+ for (var j = 0; j < sub.length; j++) {
9054
+ var refRadom = t.refs[sub[j].value + '_' + j];
9055
+ if (refRadom && typeof refRadom.dialogClearItem === 'function') {
9056
+ refRadom.dialogClearItem();
9057
+ }
9058
+ }
9059
+ }
9060
+ if (t.refs['selectMember_mailsend'] && typeof t.refs['selectMember_mailsend'].dialogClearItem === 'function') {
9061
+ t.refs['selectMember_mailsend'].dialogClearItem();
9062
+ }
9063
+ if (t.refs['selectMember_chaosong'] && typeof t.refs['selectMember_chaosong'].dialogClearItem === 'function') {
9064
+ t.refs['selectMember_chaosong'].dialogClearItem();
9065
+ }
9066
+ if (t.refs['selectMember_addSign'] && typeof t.refs['selectMember_addSign'].dialogClearItem === 'function') {
9067
+ t.refs['selectMember_addSign'].dialogClearItem();
9068
+ }
9069
+ if (t.refs['jumpUserSelect'] && typeof t.refs['jumpUserSelect'].dialogClearItem === 'function') {
9070
+ t.refs['jumpUserSelect'].dialogClearItem();
9071
+ }
9072
+ } catch (eClear) {}
9073
+ }
9074
+
9075
+ /** 打开下一条详情,透传 isPush;打标后由 componentWillReceiveProps 仅在此场景复位 pageStatus */
9076
+
9077
+ }, {
9078
+ key: 'navigateToNextPending',
9079
+ value: function navigateToNextPending(item, isPush) {
9080
+ var t = this;
9081
+ if (!item) {
9082
+ return;
9083
+ }
9084
+ var taskId = item.id || item.taskId;
9085
+ var formKey = item.formKey || item.formId || '-1';
9086
+ var dataId = item.businessKey || item.dataId || '-1';
9087
+ var processInstanceId = item.processInstanceId || '';
9088
+ var module = item.module || t.state.module || 'approve';
9089
+ var pushFlag = isPush === '1' || isPush === 1 ? '1' : '0';
9090
+ var loginUserId = '';
9091
+ try {
9092
+ loginUserId = getLoginUserInfo().userId || '';
9093
+ } catch (e) {}
9094
+ var hashPath = '/process/processDetails/' + taskId + '/' + formKey + '/' + dataId + '/0/' + pushFlag + '/' + processInstanceId + '/' + module;
9095
+ if (loginUserId) {
9096
+ hashPath += '/' + loginUserId;
9097
+ }
9098
+ // 同步打标:与自动通过(只改 state.taskId、不换路由)区分
9099
+ t._navigatingToNextPending = true;
9100
+ t.tryClearSubmitSelectMemberRefs();
9101
+ try {
9102
+ var clearState = t.buildClearSubmitOperateState();
9103
+ clearState.navigatingToNextPending = true;
9104
+ clearState.activeItemIndex = '0';
9105
+ t.setState(clearState);
9106
+ } catch (e) {}
9107
+ var base = (window.location.href || '').split('#')[0];
9108
+ window.location.replace(base + '#' + hashPath);
9109
+ // 若路由未触发 props 更新,避免标志长期残留
9110
+ setTimeout(function () {
9111
+ t._navigatingToNextPending = false;
9112
+ if (t.state && t.state.navigatingToNextPending) {
9113
+ t.setState({ navigatingToNextPending: false });
9114
+ }
9115
+ }, 3000);
9116
+ }
9117
+
9118
+ /**
9119
+ * 待办办理成功后统一离开:
9120
+ * 启用且 listType=0 → 取下一条 / 「流程处理完了」关页;否则走原逻辑。
9121
+ * options.stayOnPage=true 时不跳不关(加签仍留本待办)。
9122
+ */
9123
+
9124
+ }, {
9125
+ key: 'afterPendingActionLeave',
9126
+ value: function afterPendingActionLeave(options) {
9127
+ options = options || {};
9128
+ var t = this;
9129
+ if (options.stayOnPage) {
9130
+ return;
9131
+ }
9132
+ if (!t.isMobilePendingAutoNextEnabled() || !t.isPendingListType()) {
9133
+ t.leavePendingPageDefault(options);
9134
+ return;
9135
+ }
9136
+ var excludeTaskId = String(t.state.taskId || '');
9137
+ var isPush = String(t.state.isPush || '0');
9138
+ var fetchDelay = options.fetchDelayMs != null ? options.fetchDelayMs : 400;
9139
+ setTimeout(function () {
9140
+ t.fetchNextPendingTask(excludeTaskId).then(function (next) {
9141
+ if (next) {
9142
+ _Toast2.default.show({
9143
+ type: 'success',
9144
+ content: '正在进入下一条'
9145
+ });
9146
+ setTimeout(function () {
9147
+ t.navigateToNextPending(next, isPush);
9148
+ }, 400);
9149
+ } else {
9150
+ _Toast2.default.show({
9151
+ type: 'success',
9152
+ content: '流程处理完了'
9153
+ });
9154
+ setTimeout(function () {
9155
+ if (isPush === '1') {
9156
+ closePage();
9157
+ } else if (typeof backPage === 'function') {
9158
+ backPage();
9159
+ } else {
9160
+ history.back();
9161
+ }
9162
+ }, 800);
9163
+ }
9164
+ }).catch(function () {
9165
+ t.leavePendingPageDefault({ delayMs: 0, honorIsSub: false });
9166
+ });
9167
+ }, fetchDelay);
9168
+ }
9169
+
9081
9170
  /** 待办/待阅/已办/已阅/我的等办理入口(含推送待办,以 listType 为准) */
9082
9171
 
9083
9172
  }, {
@@ -9708,6 +9797,13 @@ var PageHome = function (_React$Component) {
9708
9797
  var status = '0';
9709
9798
  var dataId = nextProps.dataId;
9710
9799
  var editType = '';
9800
+ var taskChanged = String(nextProps.taskId || '') !== String(this.props.taskId || '') || String(nextProps.processInstanceId || '') !== String(this.props.processInstanceId || '') || String(nextProps.dataId || '') !== String(this.props.dataId || '');
9801
+ // 父级无意义重渲也会进这里:路由未变则直接返回,避免二次 componentDidMount 冲掉 optlock/表单导致首条待办无法提交
9802
+ if (!taskChanged) {
9803
+ return;
9804
+ }
9805
+ // 「列表下一条」打标:换路由后回到表单页;自动通过只改 state、不换路由,不会进此分支
9806
+ var fromListAutoNext = this._navigatingToNextPending === true || this.state && this.state.navigatingToNextPending === true;
9711
9807
  if (dataId && dataId != '-1') {
9712
9808
  //非新增
9713
9809
  if (listType == '0') {
@@ -9741,7 +9837,16 @@ var PageHome = function (_React$Component) {
9741
9837
  setPageTitle("新建");
9742
9838
  }
9743
9839
  var isPush = nextProps.isPush;
9744
- var isDraft = nextProps.query.isDraft; //是不是草稿箱,1是,0:不是
9840
+ var queryObj = nextProps.query;
9841
+ if (typeof queryObj === 'string') {
9842
+ try {
9843
+ queryObj = JSON.parse(queryObj || '{}');
9844
+ } catch (e) {
9845
+ queryObj = {};
9846
+ }
9847
+ }
9848
+ queryObj = queryObj || {};
9849
+ var isDraft = queryObj.isDraft; //是不是草稿箱,1是,0:不是
9745
9850
  if (isDraft) {
9746
9851
  permissionCode = 'draft';
9747
9852
  } else {
@@ -9754,12 +9859,13 @@ var PageHome = function (_React$Component) {
9754
9859
  status = '1';
9755
9860
  editType = 'edit';
9756
9861
  }
9862
+ // 换待办必须停在「表单信息」;旧逻辑 dataId!='-99'→3 会误切到「关联流程」
9757
9863
  var activeItemIndex = '0';
9758
- if (dataId != '-99') {
9759
- activeItemIndex = '3';
9760
- }
9761
9864
 
9762
- this.setState({
9865
+ // 换 task 一律清提交页选人/后继节点,防止下一条办理页残留上次审批人
9866
+ this.tryClearSubmitSelectMemberRefs();
9867
+ var clearSubmit = this.buildClearSubmitOperateState();
9868
+ var nextState = Object.assign({}, clearSubmit, {
9763
9869
  editType: editType,
9764
9870
  isPush: isPush,
9765
9871
  status: status,
@@ -9771,12 +9877,25 @@ var PageHome = function (_React$Component) {
9771
9877
  processInstanceId: nextProps.processInstanceId,
9772
9878
  taskId: nextProps.taskId,
9773
9879
  dataId: nextProps.dataId,
9774
- formId: nextProps.formId
9775
- }, function () {
9880
+ formId: nextProps.formId,
9881
+ formDataOptlock: '',
9882
+ formTableKey: (this.state.formTableKey || 0) + 1,
9883
+ loadSuccess: false,
9884
+ editFormData: {},
9885
+ buttonList: [],
9886
+ finalButtons: this.state.finalButtons,
9887
+ // 顶栏标题:先清空,避免闪上一条;CDM / 详情接口再写入新标题
9888
+ processTitle: '',
9889
+ fileTitle: '',
9890
+ processName: '',
9891
+ curStepName: ''
9892
+ });
9893
+ if (fromListAutoNext) {
9894
+ nextState.navigatingToNextPending = false;
9895
+ this._navigatingToNextPending = false;
9896
+ }
9897
+ this.setState(nextState, function () {
9776
9898
  this.componentDidMount();
9777
- if (activeItemIndex == '3') {
9778
- this.refs.relationProcess_list.componentDidMount();
9779
- }
9780
9899
  });
9781
9900
  }
9782
9901
 
@@ -10306,6 +10425,7 @@ var PageHome = function (_React$Component) {
10306
10425
  Box,
10307
10426
  { className: item.show ? "" : "t-DN" },
10308
10427
  _react2.default.createElement(_select2.default, {
10428
+ key: 'radomPerson_' + (this.state.taskId || '') + '_' + j + '_' + i + '_' + item.value,
10309
10429
  required: false,
10310
10430
  isShowInMyOrg: false,
10311
10431
  readOnly: item.selectUserReadOnly,
@@ -10383,6 +10503,7 @@ var PageHome = function (_React$Component) {
10383
10503
  Box,
10384
10504
  { className: item.end == true || item.show == false ? "t-DN" : "" },
10385
10505
  _react2.default.createElement(_select2.default, {
10506
+ key: 'nextPerson_' + (this.state.taskId || '') + '_' + i + '_' + item.value,
10386
10507
  readOnly: item.selectUserReadOnly,
10387
10508
  label: '审批人',
10388
10509
  placeholder: '\u8BF7\u9009\u62E9',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fmui-base",
3
- "version": "2.3.83",
3
+ "version": "2.3.85",
4
4
  "title": "fmui-base",
5
5
  "description": "fmui移动端组件",
6
6
  "main": "lib/index.js",