fmui-base 2.3.12 → 2.3.14
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 +3 -1
- package/lib/db/db.js +10 -0
- package/lib/db/variables.js +2 -1
- package/lib/form/form.js +2 -1
- package/lib/form/table.js +3 -3
- package/lib/nvoice/index.js +16 -0
- package/lib/nvoice/nvoice.js +177 -0
- package/lib/nvoice/nvoice.less +0 -0
- package/lib/process_info/processInfo.js +223 -36
- package/lib/selectMember/select.js +26 -194
- package/lib/tblform/FlowCommentPane.js +2 -2
- package/package.json +1 -1
- package/lib/selectMember/select copy.js +0 -11393
package/README.md
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
---npm publish
|
|
4
4
|
|
|
5
5
|
## 更新日志
|
|
6
|
-
- 2.3.
|
|
6
|
+
- 2.3.14:表单切换组织增加开关
|
|
7
|
+
- 2.3.13:子表字段带$时计算不生效,表单切换组织时,表单赋值的宏值实时更新
|
|
8
|
+
- 2.3.12:门户首页grid常用应用部件增加扩展入口调整为页签(一网通办项目需求,临时版本)
|
|
7
9
|
- 2.3.11:子表支持子表按钮自定义
|
|
8
10
|
- 2.3.10:门户首页grid常用应用部件增加扩展入口(一网通办项目需求,临时版本)
|
|
9
11
|
- 2.3.9:子表支持整个子表隐藏
|
package/lib/db/db.js
CHANGED
|
@@ -1140,6 +1140,16 @@ context.create('FlowModuleAPI', {
|
|
|
1140
1140
|
Authorization: 'Bearer ' + getLoginUserInfo().token
|
|
1141
1141
|
},
|
|
1142
1142
|
willFetch: function willFetch() {}
|
|
1143
|
+
},
|
|
1144
|
+
reloadFuzhiMacroFields: {
|
|
1145
|
+
mockUrl: 'query/reloadFuzhiMacroFields.json',
|
|
1146
|
+
url: _variables2.default.URLS.reloadFuzhiMacroFields,
|
|
1147
|
+
method: 'POST',
|
|
1148
|
+
postDataFomat: 'FORM',
|
|
1149
|
+
header: {
|
|
1150
|
+
Authorization: 'Bearer ' + getLoginUserInfo().token
|
|
1151
|
+
},
|
|
1152
|
+
willFetch: function willFetch() {}
|
|
1143
1153
|
}
|
|
1144
1154
|
|
|
1145
1155
|
});
|
package/lib/db/variables.js
CHANGED
|
@@ -143,7 +143,8 @@ exports.default = {
|
|
|
143
143
|
getSysSettingByMark: approveUrlPrefix + "getSysSettingByMark" + '?', //获取系统设置
|
|
144
144
|
getUserSetInfo: urlBasicPrefix + 'setting/userinfo/getUserSetInfo' + '?', //获取用户组织信息
|
|
145
145
|
orgSwitch: urlBasicPrefix + 'front/personal/orgSwitch' + '?', //切换组织
|
|
146
|
-
updateStartUserOrg: approveUrlPrefix + 'updateStartUserOrg' + '?' //更新发起人组织
|
|
146
|
+
updateStartUserOrg: approveUrlPrefix + 'updateStartUserOrg' + '?', //更新发起人组织
|
|
147
|
+
reloadFuzhiMacroFields: approveUrlPrefix + 'reloadFuzhiMacroFields' + '?' //组织切换后重载赋值宏值
|
|
147
148
|
},
|
|
148
149
|
nodataIcon: context + "/mobile/fmui/images/noData.png",
|
|
149
150
|
loadingIcon: context + "/mobile/fmui/images/loading.gif",
|
package/lib/form/form.js
CHANGED
|
@@ -2109,8 +2109,9 @@ var PageHome = function (_React$Component) {
|
|
|
2109
2109
|
}
|
|
2110
2110
|
}
|
|
2111
2111
|
}
|
|
2112
|
+
// 浅拷贝强制触发重渲染(只读 TextField 同引用时可能不刷新展示)
|
|
2112
2113
|
this.setState({
|
|
2113
|
-
itemParam: itemParam
|
|
2114
|
+
itemParam: Object.assign({}, itemParam)
|
|
2114
2115
|
}, function () {
|
|
2115
2116
|
if (checkboxValueHas) {
|
|
2116
2117
|
this.refs["checkbox_" + itemParam.tableName + "_" + itemParam.key].setState({
|
package/lib/form/table.js
CHANGED
|
@@ -1973,17 +1973,17 @@ var PageHome = function (_React$Component) {
|
|
|
1973
1973
|
filedItemValue = 0;
|
|
1974
1974
|
//return false;
|
|
1975
1975
|
}
|
|
1976
|
-
var sumRegExp = new RegExp("sum\\(\\[" + fieldArrayItem + "\\]\\)", "g");
|
|
1976
|
+
var sumRegExp = new RegExp("sum\\(\\[" + this.replaceDollar(fieldArrayItem) + "\\]\\)", "g");
|
|
1977
1977
|
|
|
1978
1978
|
if (exp.match(sumRegExp)) {
|
|
1979
1979
|
//当有sum函数
|
|
1980
1980
|
if (Array.isArray(fieldItem)) {
|
|
1981
1981
|
var sumValue = this.sum(fieldItem);
|
|
1982
|
-
exp = exp.replace(new RegExp("sum\\(\\[" + fieldArrayItem + "\\]\\)", "g"), "(" + sumValue + ")");
|
|
1982
|
+
exp = exp.replace(new RegExp("sum\\(\\[" + this.replaceDollar(fieldArrayItem) + "\\]\\)", "g"), "(" + sumValue + ")");
|
|
1983
1983
|
}
|
|
1984
1984
|
}
|
|
1985
1985
|
|
|
1986
|
-
exp = exp.replace(new RegExp("\\[" + fieldArrayItem + "\\]", "g"), "(" + filedItemValue + ")");
|
|
1986
|
+
exp = exp.replace(new RegExp("\\[" + this.replaceDollar(fieldArrayItem) + "\\]", "g"), "(" + filedItemValue + ")");
|
|
1987
1987
|
}
|
|
1988
1988
|
}
|
|
1989
1989
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _nvoice = require('./nvoice');
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, 'default', {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function get() {
|
|
12
|
+
return _interopRequireDefault(_nvoice).default;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = undefined;
|
|
7
|
+
|
|
8
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
9
|
+
|
|
10
|
+
var _react = require('react');
|
|
11
|
+
|
|
12
|
+
var _react2 = _interopRequireDefault(_react);
|
|
13
|
+
|
|
14
|
+
var _Group = require('saltui/lib/Group');
|
|
15
|
+
|
|
16
|
+
var _Group2 = _interopRequireDefault(_Group);
|
|
17
|
+
|
|
18
|
+
var _Field = require('saltui/lib/Field');
|
|
19
|
+
|
|
20
|
+
var _Field2 = _interopRequireDefault(_Field);
|
|
21
|
+
|
|
22
|
+
var _upload = require('../upload/upload');
|
|
23
|
+
|
|
24
|
+
var _upload2 = _interopRequireDefault(_upload);
|
|
25
|
+
|
|
26
|
+
var _Boxs = require('saltui/lib/Boxs');
|
|
27
|
+
|
|
28
|
+
var _Boxs2 = _interopRequireDefault(_Boxs);
|
|
29
|
+
|
|
30
|
+
var _db = require('../db/db');
|
|
31
|
+
|
|
32
|
+
var _db2 = _interopRequireDefault(_db);
|
|
33
|
+
|
|
34
|
+
require('./nvoice.less');
|
|
35
|
+
|
|
36
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
|
+
|
|
38
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
39
|
+
|
|
40
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
41
|
+
|
|
42
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
43
|
+
|
|
44
|
+
var HBox = _Boxs2.default.HBox,
|
|
45
|
+
Box = _Boxs2.default.Box,
|
|
46
|
+
VBox = _Boxs2.default.VBox;
|
|
47
|
+
|
|
48
|
+
var Nvoice = function (_React$Component) {
|
|
49
|
+
_inherits(Nvoice, _React$Component);
|
|
50
|
+
|
|
51
|
+
function Nvoice(props) {
|
|
52
|
+
_classCallCheck(this, Nvoice);
|
|
53
|
+
|
|
54
|
+
// 传入的props参数
|
|
55
|
+
var _this = _possibleConstructorReturn(this, (Nvoice.__proto__ || Object.getPrototypeOf(Nvoice)).call(this, props));
|
|
56
|
+
|
|
57
|
+
_this.initFn = function (id) {
|
|
58
|
+
|
|
59
|
+
// 初始发票详情数据
|
|
60
|
+
_db2.default.form.getNoInvoiceList({
|
|
61
|
+
invoicedataid: id
|
|
62
|
+
}).then(function (content) {
|
|
63
|
+
_this.setState({
|
|
64
|
+
invoicedata: content
|
|
65
|
+
});
|
|
66
|
+
}).catch(function (error) {
|
|
67
|
+
console.error('获取详情数据失败', error);
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
var invoicedataid = _this.props.id;
|
|
72
|
+
var title = _this.props.label || '发票详情';
|
|
73
|
+
var required = _this.props.required || false;
|
|
74
|
+
|
|
75
|
+
_this.state = {
|
|
76
|
+
invoicedataid: invoicedataid,
|
|
77
|
+
invoicedata: [],
|
|
78
|
+
title: title,
|
|
79
|
+
required: required
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
return _this;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
_createClass(Nvoice, [{
|
|
86
|
+
key: 'componentDidMount',
|
|
87
|
+
value: function componentDidMount() {
|
|
88
|
+
this.initFn(this.state.invoicedataid);
|
|
89
|
+
}
|
|
90
|
+
}, {
|
|
91
|
+
key: 'downloadFile',
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
// 下载函数
|
|
95
|
+
value: function (_downloadFile) {
|
|
96
|
+
function downloadFile(_x) {
|
|
97
|
+
return _downloadFile.apply(this, arguments);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
downloadFile.toString = function () {
|
|
101
|
+
return _downloadFile.toString();
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
return downloadFile;
|
|
105
|
+
}(function (file) {
|
|
106
|
+
downloadFile(file.relaObjId);
|
|
107
|
+
})
|
|
108
|
+
}, {
|
|
109
|
+
key: 'render',
|
|
110
|
+
value: function render() {
|
|
111
|
+
return _react2.default.createElement(
|
|
112
|
+
_Group2.default.List,
|
|
113
|
+
{ borderTopNone: true },
|
|
114
|
+
_react2.default.createElement(
|
|
115
|
+
_Field2.default,
|
|
116
|
+
{ required: this.state.required, label: this.state.title, layout: 'h', multiLine: true },
|
|
117
|
+
_react2.default.createElement(
|
|
118
|
+
'div',
|
|
119
|
+
null,
|
|
120
|
+
this.state.invoicedata.map(function (item, index) {
|
|
121
|
+
var fileList = [];
|
|
122
|
+
try {
|
|
123
|
+
if (item.invoicefileInfo) {
|
|
124
|
+
fileList = JSON.parse(item.invoicefileInfo);
|
|
125
|
+
}
|
|
126
|
+
} catch (e) {
|
|
127
|
+
console.error('发票附件解析失败', e);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return _react2.default.createElement(
|
|
131
|
+
'div',
|
|
132
|
+
{ key: item.id, className: 't-MT2' },
|
|
133
|
+
_react2.default.createElement(
|
|
134
|
+
VBox,
|
|
135
|
+
{ className: 'nvoice-filetitle', hAlign: 'start' },
|
|
136
|
+
_react2.default.createElement(
|
|
137
|
+
Box,
|
|
138
|
+
null,
|
|
139
|
+
item.invoicename
|
|
140
|
+
),
|
|
141
|
+
_react2.default.createElement(
|
|
142
|
+
HBox,
|
|
143
|
+
{ vAlign: 'center' },
|
|
144
|
+
_react2.default.createElement(
|
|
145
|
+
Box,
|
|
146
|
+
{ className: 'label label-primary' },
|
|
147
|
+
item.invoicetype
|
|
148
|
+
),
|
|
149
|
+
_react2.default.createElement(
|
|
150
|
+
Box,
|
|
151
|
+
null,
|
|
152
|
+
'\uFFE5',
|
|
153
|
+
item.invoiceamount
|
|
154
|
+
)
|
|
155
|
+
)
|
|
156
|
+
),
|
|
157
|
+
_react2.default.createElement(_upload2.default, {
|
|
158
|
+
required: false,
|
|
159
|
+
canDel: false,
|
|
160
|
+
canPreview: true,
|
|
161
|
+
canDownload: true,
|
|
162
|
+
initList: fileList,
|
|
163
|
+
dir: 'form_invoice',
|
|
164
|
+
ref: 'upload_invoice'
|
|
165
|
+
})
|
|
166
|
+
);
|
|
167
|
+
})
|
|
168
|
+
)
|
|
169
|
+
)
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
}]);
|
|
173
|
+
|
|
174
|
+
return Nvoice;
|
|
175
|
+
}(_react2.default.Component);
|
|
176
|
+
|
|
177
|
+
exports.default = Nvoice;
|
|
File without changes
|
|
@@ -4,6 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
8
|
+
|
|
7
9
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
8
10
|
|
|
9
11
|
var _react = require('react');
|
|
@@ -391,6 +393,7 @@ var PageHome = function (_React$Component) {
|
|
|
391
393
|
dataId: dataId,
|
|
392
394
|
formId: props.formId,
|
|
393
395
|
editFormData: {},
|
|
396
|
+
formDataOptlock: '',
|
|
394
397
|
formDataNew: {},
|
|
395
398
|
data: {
|
|
396
399
|
dataId: "",
|
|
@@ -514,7 +517,7 @@ var PageHome = function (_React$Component) {
|
|
|
514
517
|
selectProcessCode: '', //选中的子流程
|
|
515
518
|
subProcessType: '', //子流程类型 0串行 1并行
|
|
516
519
|
urgencyList: [], //紧急程度列表
|
|
517
|
-
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, 'approveCurOrgId', ''), _defineProperty(_param, 'startUserOrgId', ''), _defineProperty(_param, 'taskAssignOrgId', ''), _defineProperty(_param, 'approveOrgApiUnavailable', false), _param);
|
|
520
|
+
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, 'approveFormParttimeOrgEnabled', true), _defineProperty(_param, 'approveCurOrgId', ''), _defineProperty(_param, 'startUserOrgId', ''), _defineProperty(_param, 'taskAssignOrgId', ''), _defineProperty(_param, 'approveOrgApiUnavailable', false), _param);
|
|
518
521
|
FlowCommon = require('pages/flow_common/' + module).default ? require('pages/flow_common/' + module).default : require('pages/flow_common/' + module);
|
|
519
522
|
|
|
520
523
|
//处理特有参数
|
|
@@ -1471,6 +1474,7 @@ var PageHome = function (_React$Component) {
|
|
|
1471
1474
|
// }
|
|
1472
1475
|
t.setState({
|
|
1473
1476
|
editFormData: formData,
|
|
1477
|
+
formDataOptlock: formData && formData.optlock !== undefined && formData.optlock !== null && formData.optlock !== '' ? String(formData.optlock) : '',
|
|
1474
1478
|
//formDataNew:content.formDataNew,
|
|
1475
1479
|
// formData: formData,
|
|
1476
1480
|
// fileContent: fileContent,
|
|
@@ -2497,6 +2501,9 @@ var PageHome = function (_React$Component) {
|
|
|
2497
2501
|
processInstanceId: _this2.state.processInstanceId,
|
|
2498
2502
|
permissionCode: _this2.state.permissionCode
|
|
2499
2503
|
};
|
|
2504
|
+
if (t.state.formDataOptlock !== '' && t.state.formDataOptlock !== null && typeof t.state.formDataOptlock !== 'undefined') {
|
|
2505
|
+
param.optlock = t.state.formDataOptlock;
|
|
2506
|
+
}
|
|
2500
2507
|
var dealActionName = "";
|
|
2501
2508
|
if (_this2.state.isStart == true) {
|
|
2502
2509
|
dealActionName = "提交";
|
|
@@ -4676,6 +4683,9 @@ var PageHome = function (_React$Component) {
|
|
|
4676
4683
|
formType: "4",
|
|
4677
4684
|
editType: editType
|
|
4678
4685
|
}, _defineProperty(_param2, 'module', t.state.module), _defineProperty(_param2, 'comment', newComment), _defineProperty(_param2, 'commentType', 'text'), _defineProperty(_param2, 'commentId', t.state.commentId), _defineProperty(_param2, 'commentAttitude', t.getSelectedCommentAttitude()), _defineProperty(_param2, 'attachId', t.state.commentAttachId), _defineProperty(_param2, 'sealId', t.state.commentSealId), _defineProperty(_param2, 'permissionCode', t.state.permissionCode), _defineProperty(_param2, 'hasCommentField', t.state.hasCommentField), _defineProperty(_param2, 'dataId', dataId), _param2);
|
|
4686
|
+
if (t.state.formDataOptlock !== '' && t.state.formDataOptlock !== null && typeof t.state.formDataOptlock !== 'undefined') {
|
|
4687
|
+
param.optlock = t.state.formDataOptlock;
|
|
4688
|
+
}
|
|
4679
4689
|
var commentbizSn = t.guid2();
|
|
4680
4690
|
if (param.commentId && param.commentId != "" && param.commentId != null && typeof param.commentId != "undefined") {
|
|
4681
4691
|
commentbizSn = param.commentId;
|
|
@@ -4689,6 +4699,12 @@ var PageHome = function (_React$Component) {
|
|
|
4689
4699
|
type: 'success',
|
|
4690
4700
|
content: '保存成功'
|
|
4691
4701
|
});
|
|
4702
|
+
if (t.state.formDataOptlock !== '' && t.state.formDataOptlock !== null) {
|
|
4703
|
+
var ol = parseInt(t.state.formDataOptlock, 10);
|
|
4704
|
+
if (!isNaN(ol)) {
|
|
4705
|
+
t.setState({ formDataOptlock: String(ol + 1) });
|
|
4706
|
+
}
|
|
4707
|
+
}
|
|
4692
4708
|
|
|
4693
4709
|
var dataId = content.dataId;
|
|
4694
4710
|
//操作回调
|
|
@@ -5082,6 +5098,9 @@ var PageHome = function (_React$Component) {
|
|
|
5082
5098
|
// param.commentbizSn=commentbizSn;
|
|
5083
5099
|
// }
|
|
5084
5100
|
param.commentbizSn = commentbizSn;
|
|
5101
|
+
if (t.state.formDataOptlock !== '' && t.state.formDataOptlock !== null && typeof t.state.formDataOptlock !== 'undefined') {
|
|
5102
|
+
param.optlock = t.state.formDataOptlock;
|
|
5103
|
+
}
|
|
5085
5104
|
|
|
5086
5105
|
var db = _db2.default;
|
|
5087
5106
|
db.FlowModuleAPI.sendFlow(param).then(function (content) {
|
|
@@ -7619,10 +7638,18 @@ var PageHome = function (_React$Component) {
|
|
|
7619
7638
|
value: org.id
|
|
7620
7639
|
};
|
|
7621
7640
|
}
|
|
7641
|
+
|
|
7642
|
+
/** 流程设置「表单切换兼职组织」是否启用,默认启用(仅明确为 0 时禁用) */
|
|
7643
|
+
|
|
7644
|
+
}, {
|
|
7645
|
+
key: 'isApproveFormParttimeOrgEnabled',
|
|
7646
|
+
value: function isApproveFormParttimeOrgEnabled() {
|
|
7647
|
+
return this.state.approveFormParttimeOrgEnabled !== false;
|
|
7648
|
+
}
|
|
7622
7649
|
}, {
|
|
7623
7650
|
key: 'renderApproveOrgSwitcher',
|
|
7624
7651
|
value: function renderApproveOrgSwitcher(orgList, selectedOrgId) {
|
|
7625
|
-
if (!orgList || orgList.length <= 1) {
|
|
7652
|
+
if (!this.isApproveFormParttimeOrgEnabled() || !orgList || orgList.length <= 1) {
|
|
7626
7653
|
this.setState({
|
|
7627
7654
|
showOrgSwitcher: false,
|
|
7628
7655
|
approveOrgOptions: [],
|
|
@@ -7667,44 +7694,85 @@ var PageHome = function (_React$Component) {
|
|
|
7667
7694
|
if (!window.approveOrgAutoSwitchedMap) {
|
|
7668
7695
|
window.approveOrgAutoSwitchedMap = {};
|
|
7669
7696
|
}
|
|
7670
|
-
|
|
7671
|
-
|
|
7672
|
-
|
|
7673
|
-
}
|
|
7674
|
-
|
|
7675
|
-
|
|
7676
|
-
|
|
7677
|
-
|
|
7678
|
-
|
|
7679
|
-
|
|
7680
|
-
|
|
7681
|
-
|
|
7682
|
-
|
|
7683
|
-
|
|
7684
|
-
|
|
7685
|
-
|
|
7686
|
-
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
|
|
7691
|
-
|
|
7692
|
-
|
|
7693
|
-
|
|
7694
|
-
|
|
7695
|
-
|
|
7696
|
-
|
|
7697
|
-
|
|
7697
|
+
// 先读取流程设置「表单切换兼职组织」(默认启用)
|
|
7698
|
+
var loadOrgSwitcher = function loadOrgSwitcher(parttimeOrgEnabled) {
|
|
7699
|
+
t.setState({ approveFormParttimeOrgEnabled: parttimeOrgEnabled !== false });
|
|
7700
|
+
_db2.default.FlowModuleAPI.getUserSetInfo({}).then(function (userInfo) {
|
|
7701
|
+
if (currentSeq != window.approveOrgSwitcherSeq || t.state.approveOrgApiUnavailable) {
|
|
7702
|
+
return;
|
|
7703
|
+
}
|
|
7704
|
+
if (!userInfo) {
|
|
7705
|
+
t.hideApproveOrgSwitcherSilently();
|
|
7706
|
+
return;
|
|
7707
|
+
}
|
|
7708
|
+
if (userInfo.content && !userInfo.orgList) {
|
|
7709
|
+
userInfo = userInfo.content;
|
|
7710
|
+
}
|
|
7711
|
+
var orgList = userInfo.orgList || [];
|
|
7712
|
+
var showSwitcher = parttimeOrgEnabled !== false && orgList && orgList.length > 1;
|
|
7713
|
+
if (!orgList || orgList.length == 0 || !showSwitcher) {
|
|
7714
|
+
// 开关禁用但有兼职时,仍可静默切到目标组织,仅隐藏切换区
|
|
7715
|
+
if (orgList && orgList.length > 1 && parttimeOrgEnabled === false) {
|
|
7716
|
+
var curOrgIdHide = userInfo.curOrgId || '';
|
|
7717
|
+
var hideTargetOrgId = t.resolveApproveOrgTargetId(orgList, curOrgIdHide, t.state.taskAssignOrgId, t.state.startUserOrgId);
|
|
7718
|
+
if (hideTargetOrgId && hideTargetOrgId != curOrgIdHide && !window.approveOrgAutoSwitchedMap[autoSwitchKey]) {
|
|
7719
|
+
t.switchApproveOrg(hideTargetOrgId, function () {
|
|
7720
|
+
if (currentSeq != window.approveOrgSwitcherSeq) {
|
|
7721
|
+
return;
|
|
7722
|
+
}
|
|
7723
|
+
window.approveOrgAutoSwitchedMap[autoSwitchKey] = true;
|
|
7724
|
+
t.setState({ showOrgSwitcher: false });
|
|
7725
|
+
}, function () {
|
|
7726
|
+
if (currentSeq != window.approveOrgSwitcherSeq) {
|
|
7727
|
+
return;
|
|
7728
|
+
}
|
|
7729
|
+
t.setState({ showOrgSwitcher: false });
|
|
7730
|
+
}, { silent: true });
|
|
7731
|
+
return;
|
|
7732
|
+
}
|
|
7698
7733
|
}
|
|
7734
|
+
t.setState({ showOrgSwitcher: false });
|
|
7735
|
+
return;
|
|
7736
|
+
}
|
|
7737
|
+
var curOrgId = userInfo.curOrgId || '';
|
|
7738
|
+
var targetOrgId = t.resolveApproveOrgTargetId(orgList, curOrgId, t.state.taskAssignOrgId, t.state.startUserOrgId);
|
|
7739
|
+
if (targetOrgId && targetOrgId != curOrgId && !window.approveOrgAutoSwitchedMap[autoSwitchKey]) {
|
|
7740
|
+
t.switchApproveOrg(targetOrgId, function () {
|
|
7741
|
+
if (currentSeq != window.approveOrgSwitcherSeq) {
|
|
7742
|
+
return;
|
|
7743
|
+
}
|
|
7744
|
+
window.approveOrgAutoSwitchedMap[autoSwitchKey] = true;
|
|
7745
|
+
t.renderApproveOrgSwitcher(orgList, targetOrgId);
|
|
7746
|
+
}, function () {
|
|
7747
|
+
if (currentSeq != window.approveOrgSwitcherSeq) {
|
|
7748
|
+
return;
|
|
7749
|
+
}
|
|
7750
|
+
t.hideApproveOrgSwitcherSilently();
|
|
7751
|
+
}, { silent: true });
|
|
7752
|
+
return;
|
|
7753
|
+
}
|
|
7754
|
+
t.renderApproveOrgSwitcher(orgList, targetOrgId || curOrgId);
|
|
7755
|
+
}).catch(function (err) {
|
|
7756
|
+
if (currentSeq == window.approveOrgSwitcherSeq) {
|
|
7699
7757
|
t.hideApproveOrgSwitcherSilently();
|
|
7700
|
-
}
|
|
7758
|
+
}
|
|
7759
|
+
});
|
|
7760
|
+
};
|
|
7761
|
+
_db2.default.FlowModuleAPI.getSysSettingByMark({ mark: 'approveFormParttimeOrg' }).then(function (content) {
|
|
7762
|
+
if (currentSeq != window.approveOrgSwitcherSeq) {
|
|
7701
7763
|
return;
|
|
7702
7764
|
}
|
|
7703
|
-
|
|
7704
|
-
|
|
7705
|
-
|
|
7706
|
-
|
|
7765
|
+
var val = content;
|
|
7766
|
+
if (content && (typeof content === 'undefined' ? 'undefined' : _typeof(content)) === 'object' && content.content != null) {
|
|
7767
|
+
val = content.content;
|
|
7768
|
+
}
|
|
7769
|
+
// 默认启用:仅明确为 '0' 时禁用
|
|
7770
|
+
loadOrgSwitcher(val != '0');
|
|
7771
|
+
}).catch(function () {
|
|
7772
|
+
if (currentSeq != window.approveOrgSwitcherSeq) {
|
|
7773
|
+
return;
|
|
7707
7774
|
}
|
|
7775
|
+
loadOrgSwitcher(true);
|
|
7708
7776
|
});
|
|
7709
7777
|
}
|
|
7710
7778
|
}, {
|
|
@@ -7728,6 +7796,9 @@ var PageHome = function (_React$Component) {
|
|
|
7728
7796
|
approveCurOrgId: newOrgId,
|
|
7729
7797
|
approveOrgSelectValue: value,
|
|
7730
7798
|
startUserOrgId: t.isApproveStartOrgUpdateScene() ? newOrgId : t.state.startUserOrgId
|
|
7799
|
+
}, function () {
|
|
7800
|
+
// 用户手动切换组织后,重载赋值宏值字段
|
|
7801
|
+
t.reloadFuzhiMacroFieldsByOrg();
|
|
7731
7802
|
});
|
|
7732
7803
|
}, function () {
|
|
7733
7804
|
t.setState({
|
|
@@ -7736,6 +7807,122 @@ var PageHome = function (_React$Component) {
|
|
|
7736
7807
|
});
|
|
7737
7808
|
});
|
|
7738
7809
|
}
|
|
7810
|
+
|
|
7811
|
+
/** 所属组织切换后,按当前组织重载赋值宏值字段并写回表单 */
|
|
7812
|
+
|
|
7813
|
+
}, {
|
|
7814
|
+
key: 'reloadFuzhiMacroFieldsByOrg',
|
|
7815
|
+
value: function reloadFuzhiMacroFieldsByOrg() {
|
|
7816
|
+
var t = this;
|
|
7817
|
+
var fuzhiFields = '';
|
|
7818
|
+
if (t.state.fieldControll && t.state.fieldControll.fuzhiFields) {
|
|
7819
|
+
fuzhiFields = t.state.fieldControll.fuzhiFields;
|
|
7820
|
+
}
|
|
7821
|
+
if (!fuzhiFields || fuzhiFields == 'null' || fuzhiFields == 'undefined' || !t.state.formId) {
|
|
7822
|
+
return;
|
|
7823
|
+
}
|
|
7824
|
+
_db2.default.FlowModuleAPI.reloadFuzhiMacroFields({
|
|
7825
|
+
formId: t.state.formId,
|
|
7826
|
+
fuzhiFields: fuzhiFields
|
|
7827
|
+
}).then(function (content) {
|
|
7828
|
+
var fieldMap = content || {};
|
|
7829
|
+
if (content && content.content && _typeof(content.content) === 'object' && !Array.isArray(content.content)) {
|
|
7830
|
+
fieldMap = content.content;
|
|
7831
|
+
}
|
|
7832
|
+
if (!fieldMap || Object.keys(fieldMap).length == 0) {
|
|
7833
|
+
return;
|
|
7834
|
+
}
|
|
7835
|
+
var editFormData = t.state.editFormData || {};
|
|
7836
|
+
var mainTblData = editFormData.mainTblData || [];
|
|
7837
|
+
var mainTblName = editFormData.mainTblName || t.state.form && t.state.form.formTblName || '';
|
|
7838
|
+
var tableRef = t.refs.approveFormTable;
|
|
7839
|
+
var resolveMacroVal = function resolveMacroVal(it) {
|
|
7840
|
+
if (!it) {
|
|
7841
|
+
return undefined;
|
|
7842
|
+
}
|
|
7843
|
+
if (it.uniqueName && typeof fieldMap[it.uniqueName] != 'undefined') {
|
|
7844
|
+
return fieldMap[it.uniqueName];
|
|
7845
|
+
}
|
|
7846
|
+
if (it.itemCode && typeof fieldMap[it.itemCode] != 'undefined') {
|
|
7847
|
+
return fieldMap[it.itemCode];
|
|
7848
|
+
}
|
|
7849
|
+
return undefined;
|
|
7850
|
+
};
|
|
7851
|
+
Object.keys(fieldMap).forEach(function (mapKey) {
|
|
7852
|
+
var newVal = fieldMap[mapKey];
|
|
7853
|
+
if (typeof newVal == 'undefined' || newVal == null) {
|
|
7854
|
+
return;
|
|
7855
|
+
}
|
|
7856
|
+
var itemCode = mapKey;
|
|
7857
|
+
if (mainTblName && mapKey.indexOf(mainTblName + '_') === 0) {
|
|
7858
|
+
itemCode = mapKey.substring(mainTblName.length + 1);
|
|
7859
|
+
} else if (mainTblName && mapKey.indexOf(mainTblName + '$') === 0) {
|
|
7860
|
+
itemCode = mapKey.substring(mainTblName.length + 1);
|
|
7861
|
+
}
|
|
7862
|
+
for (var i = 0; i < mainTblData.length; i++) {
|
|
7863
|
+
if (mainTblData[i].key == itemCode || mainTblData[i].key == mapKey) {
|
|
7864
|
+
mainTblData[i].value = newVal;
|
|
7865
|
+
}
|
|
7866
|
+
}
|
|
7867
|
+
// 可编辑 / 只读字段均通过 Form.reloadItemParam 刷新展示
|
|
7868
|
+
if (tableRef && tableRef.refs) {
|
|
7869
|
+
var tryKeys = [mapKey];
|
|
7870
|
+
if (mainTblName) {
|
|
7871
|
+
tryKeys.push(mainTblName + '_' + itemCode);
|
|
7872
|
+
tryKeys.push(mainTblName + '_' + mapKey);
|
|
7873
|
+
}
|
|
7874
|
+
if (mapKey.indexOf('$') >= 0) {
|
|
7875
|
+
tryKeys.push(mapKey.replace(/\$/g, '_'));
|
|
7876
|
+
if (mainTblName) {
|
|
7877
|
+
tryKeys.push(mainTblName + '_' + itemCode);
|
|
7878
|
+
}
|
|
7879
|
+
}
|
|
7880
|
+
for (var k = 0; k < tryKeys.length; k++) {
|
|
7881
|
+
var hitKey = tryKeys[k];
|
|
7882
|
+
var formRef = tableRef.refs[hitKey];
|
|
7883
|
+
if (!formRef || !formRef.reloadItemParam) {
|
|
7884
|
+
continue;
|
|
7885
|
+
}
|
|
7886
|
+
try {
|
|
7887
|
+
formRef.reloadItemParam([{ key: 'value', value: newVal }]);
|
|
7888
|
+
// 只读 TextField 偶发不跟 props,强制再刷一次
|
|
7889
|
+
if (typeof formRef.forceUpdate === 'function') {
|
|
7890
|
+
formRef.forceUpdate();
|
|
7891
|
+
}
|
|
7892
|
+
} catch (e) {}
|
|
7893
|
+
break;
|
|
7894
|
+
}
|
|
7895
|
+
}
|
|
7896
|
+
});
|
|
7897
|
+
editFormData.mainTblData = mainTblData;
|
|
7898
|
+
// 同步字段定义中的 value / defaultValue(只读赋值宏依赖)
|
|
7899
|
+
var formItem = t.state.formItem || [];
|
|
7900
|
+
var syncDefault = function syncDefault(items) {
|
|
7901
|
+
if (!items || !items.length) {
|
|
7902
|
+
return;
|
|
7903
|
+
}
|
|
7904
|
+
for (var i = 0; i < items.length; i++) {
|
|
7905
|
+
var it = items[i];
|
|
7906
|
+
if (!it) {
|
|
7907
|
+
continue;
|
|
7908
|
+
}
|
|
7909
|
+
var mv = resolveMacroVal(it);
|
|
7910
|
+
if (typeof mv != 'undefined') {
|
|
7911
|
+
it.defaultValue = mv;
|
|
7912
|
+
it.value = mv;
|
|
7913
|
+
}
|
|
7914
|
+
if (it.children && it.children.length) {
|
|
7915
|
+
syncDefault(it.children);
|
|
7916
|
+
}
|
|
7917
|
+
}
|
|
7918
|
+
};
|
|
7919
|
+
syncDefault(formItem);
|
|
7920
|
+
t.setState({
|
|
7921
|
+
editFormData: editFormData,
|
|
7922
|
+
formItem: formItem
|
|
7923
|
+
});
|
|
7924
|
+
}).catch(function () {});
|
|
7925
|
+
}
|
|
7739
7926
|
}, {
|
|
7740
7927
|
key: 'switchApproveOrg',
|
|
7741
7928
|
value: function switchApproveOrg(orgId, callback, failCallback, options) {
|
|
@@ -8154,7 +8341,7 @@ var PageHome = function (_React$Component) {
|
|
|
8154
8341
|
_react2.default.createElement(
|
|
8155
8342
|
_Group2.default.List,
|
|
8156
8343
|
null,
|
|
8157
|
-
this.state.tableStatus == '0' ? "" : _react2.default.createElement(_table2.default, { module: this.state.module, operate: this.state.operate, editType: this.state.editType, dataId: this.state.dataId, hasCommentField: t.state.hasCommentField, newspyj: t.state.newspyj, commentField: t.state.commentField, commentAttitude: t.state.commentAttitude, status: t.state.status, form: t.state.formItem, formStyleObj: t.state.formStyleObj, subColumnCount: t.state.subColumnCount, allForm: t.state.form, data: t.state.editFormData, commentFieldList: t.state.commentFieldList, defaultValue: t.state.defaultValue, commentDefaultList: t.state.commentDefaultList, commentBackList: t.state.commentBackList, fieldControll: t.state.fieldControll, caIsPrd: t.state.caIsPrd, preCaFields: t.state.preCaFields, formRelaField: t.state.formRelaField, isRemoveCommentFormHtml: t.state.isRemoveCommentFormHtml, commentUpload: t.state.commentUpload, isCaUser: t.state.isCaUser, caFirm: t.state.caFirm, caESignatureName: t.state.caESignatureName, caFormSign: t.state.caFormSign, inscriptionShow: t.state.inscriptionShow, onChange: this.change.bind(this) })
|
|
8344
|
+
this.state.tableStatus == '0' ? "" : _react2.default.createElement(_table2.default, { ref: 'approveFormTable', module: this.state.module, operate: this.state.operate, editType: this.state.editType, dataId: this.state.dataId, hasCommentField: t.state.hasCommentField, newspyj: t.state.newspyj, commentField: t.state.commentField, commentAttitude: t.state.commentAttitude, status: t.state.status, form: t.state.formItem, formStyleObj: t.state.formStyleObj, subColumnCount: t.state.subColumnCount, allForm: t.state.form, data: t.state.editFormData, commentFieldList: t.state.commentFieldList, defaultValue: t.state.defaultValue, commentDefaultList: t.state.commentDefaultList, commentBackList: t.state.commentBackList, fieldControll: t.state.fieldControll, caIsPrd: t.state.caIsPrd, preCaFields: t.state.preCaFields, formRelaField: t.state.formRelaField, isRemoveCommentFormHtml: t.state.isRemoveCommentFormHtml, commentUpload: t.state.commentUpload, isCaUser: t.state.isCaUser, caFirm: t.state.caFirm, caESignatureName: t.state.caESignatureName, caFormSign: t.state.caFormSign, inscriptionShow: t.state.inscriptionShow, onChange: this.change.bind(this) })
|
|
8158
8345
|
)
|
|
8159
8346
|
)
|
|
8160
8347
|
)
|