ls-pro-common 1.1.0 → 1.1.2
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/dist/common.css +138 -1
- package/dist/common.js +1 -1
- package/dist/common.js.LICENSE.txt +5 -3
- package/dist/common.min.css +138 -1
- package/dist/common.min.js +1 -1
- package/dist/common.min.js.LICENSE.txt +5 -3
- package/es/components/AreaCascader.js +35 -48
- package/es/components/AreaCascaderPanel.d.ts +5 -0
- package/es/components/AreaCascaderPanel.js +230 -0
- package/es/components/DescritionCard.js +14 -19
- package/es/components/DtlLayout.js +25 -38
- package/es/components/IconSelector.js +27 -50
- package/es/components/ImageSelector.js +89 -139
- package/es/components/InputMultiLine.js +33 -45
- package/es/components/InputTable.d.ts +2 -0
- package/es/components/InputTable.js +118 -160
- package/es/components/Loading.js +3 -6
- package/es/components/common.less +158 -1
- package/es/hooks/useDtl/index.d.ts +2 -0
- package/es/hooks/useDtl/index.js +676 -941
- package/es/hooks/usePermission/index.js +0 -9
- package/es/hooks/useSingle/index.d.ts +2 -0
- package/es/hooks/useSingle/index.js +440 -599
- package/es/http/index.js +113 -149
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -2
- package/es/service/BaseService.js +121 -195
- package/es/utils/index.js +12 -111
- package/lib/components/404.js +1 -6
- package/lib/components/AreaCascader.js +37 -63
- package/lib/components/AreaCascaderPanel.d.ts +5 -0
- package/lib/components/AreaCascaderPanel.js +239 -0
- package/lib/components/DescritionCard.js +16 -33
- package/lib/components/DtlLayout.js +27 -49
- package/lib/components/IconSelector.js +29 -64
- package/lib/components/ImageSelector.js +91 -162
- package/lib/components/InputMultiLine.js +35 -61
- package/lib/components/InputTable.d.ts +2 -0
- package/lib/components/InputTable.js +120 -185
- package/lib/components/Loading.js +4 -16
- package/lib/components/common.less +158 -1
- package/lib/hooks/useDtl/index.d.ts +2 -0
- package/lib/hooks/useDtl/index.js +677 -957
- package/lib/hooks/usePermission/index.js +0 -12
- package/lib/hooks/useSingle/index.d.ts +2 -0
- package/lib/hooks/useSingle/index.js +441 -614
- package/lib/http/index.js +111 -158
- package/lib/index.d.ts +2 -1
- package/lib/index.js +9 -20
- package/lib/service/BaseService.js +121 -201
- package/lib/utils/index.js +13 -209
- package/package.json +2 -2
|
@@ -1,1165 +1,886 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
6
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports.default = void 0;
|
|
11
|
-
|
|
12
9
|
require("antd/es/button/style");
|
|
13
|
-
|
|
14
10
|
var _button = _interopRequireDefault(require("antd/es/button"));
|
|
15
|
-
|
|
16
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
17
|
-
|
|
18
12
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
19
|
-
|
|
20
13
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
21
|
-
|
|
22
14
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
23
|
-
|
|
24
15
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
25
|
-
|
|
26
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
27
|
-
|
|
28
17
|
var _icons = require("@ant-design/icons");
|
|
29
|
-
|
|
30
18
|
var _utils = require("../../utils");
|
|
31
|
-
|
|
32
19
|
var _http = require("../../http");
|
|
33
|
-
|
|
34
20
|
var _usePermission2 = _interopRequireDefault(require("../usePermission"));
|
|
35
|
-
|
|
36
21
|
var _excluded = ["current", "pageSize", "sumProperties"];
|
|
37
|
-
|
|
38
22
|
function useDtl(dtlParam) {
|
|
39
23
|
var mstService = dtlParam.service,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
24
|
+
masterObject = dtlParam.initItem,
|
|
25
|
+
_dtlParam$mstKeyField = dtlParam.mstKeyField,
|
|
26
|
+
mstKeyField = _dtlParam$mstKeyField === void 0 ? 'id' : _dtlParam$mstKeyField,
|
|
27
|
+
dtlService = dtlParam.dtlService,
|
|
28
|
+
relationField = dtlParam.relationField,
|
|
29
|
+
toolConfig = dtlParam.toolConfig,
|
|
30
|
+
dtlItem = dtlParam.dtlItem,
|
|
31
|
+
auditStatus = dtlParam.auditStatus,
|
|
32
|
+
statusField = dtlParam.statusField,
|
|
33
|
+
beforeLoad = dtlParam.beforeLoad,
|
|
34
|
+
beforeAdd = dtlParam.beforeAdd,
|
|
35
|
+
beforeEdit = dtlParam.beforeEdit,
|
|
36
|
+
beforeSave = dtlParam.beforeSave,
|
|
37
|
+
beforeRemove = dtlParam.beforeRemove,
|
|
38
|
+
afterSave = dtlParam.afterSave,
|
|
39
|
+
afterRemove = dtlParam.afterRemove,
|
|
40
|
+
btnStatus = dtlParam.btnStatus,
|
|
41
|
+
beforeAudit = dtlParam.beforeAudit,
|
|
42
|
+
afterAudit = dtlParam.afterAudit,
|
|
43
|
+
_dtlParam$ifHistoryDa = dtlParam.ifHistoryData,
|
|
44
|
+
ifHistoryData = _dtlParam$ifHistoryDa === void 0 ? 0 : _dtlParam$ifHistoryDa;
|
|
60
45
|
var _usePermission = (0, _usePermission2.default)(),
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
46
|
+
canAdd = _usePermission.canAdd,
|
|
47
|
+
canEdit = _usePermission.canEdit,
|
|
48
|
+
canDelete = _usePermission.canDelete,
|
|
49
|
+
canImport = _usePermission.canImport,
|
|
50
|
+
canExport = _usePermission.canExport;
|
|
66
51
|
/** @name 选中行数据 */
|
|
67
|
-
|
|
68
|
-
|
|
69
52
|
var _useState = (0, _react.useState)([]),
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
53
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
54
|
+
selectedRows = _useState2[0],
|
|
55
|
+
setSelectedRows = _useState2[1];
|
|
73
56
|
/** @name 显示新增编辑框 */
|
|
74
|
-
|
|
75
|
-
|
|
76
57
|
var _useState3 = (0, _react.useState)(false),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
58
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
59
|
+
showEdit = _useState4[0],
|
|
60
|
+
setShowEdit = _useState4[1];
|
|
80
61
|
/** @name 新增或编辑对象初始值 */
|
|
81
|
-
|
|
82
|
-
|
|
83
62
|
var _useState5 = (0, _react.useState)(dtlItem),
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
63
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
64
|
+
editItem = _useState6[0],
|
|
65
|
+
setEditItem = _useState6[1];
|
|
87
66
|
/** @name 从表表格Ref */
|
|
88
|
-
|
|
89
|
-
|
|
90
67
|
var tableRef = (0, _react.useRef)();
|
|
91
68
|
/** @name 主表表单Ref */
|
|
92
|
-
|
|
93
69
|
var formRef = (0, _react.useRef)();
|
|
94
70
|
/** @name 从表编辑表单Ref */
|
|
95
|
-
|
|
96
71
|
var dtlFormRef = (0, _react.useRef)();
|
|
97
72
|
/**@name 判断是否已审核 */
|
|
98
|
-
|
|
99
73
|
var isAudit = (0, _react.useCallback)(function () {
|
|
100
74
|
if (!auditStatus || !statusField) return false;
|
|
101
75
|
return Number(masterObject[statusField] || 0) >= auditStatus;
|
|
102
76
|
}, [auditStatus, statusField, masterObject]);
|
|
103
77
|
/** @name 保存主表 */
|
|
104
|
-
|
|
105
78
|
var onSaveMst = /*#__PURE__*/function () {
|
|
106
79
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(values) {
|
|
107
80
|
var _result$flag;
|
|
108
|
-
|
|
109
81
|
var data, result;
|
|
110
82
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
111
|
-
while (1) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
return _context.abrupt("return", false);
|
|
173
|
-
|
|
174
|
-
case 23:
|
|
175
|
-
if (!((result === null || result === void 0 ? void 0 : (_result$flag = result.flag) === null || _result$flag === void 0 ? void 0 : _result$flag.retCode) === '0')) {
|
|
176
|
-
_context.next = 28;
|
|
177
|
-
break;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
(0, _utils.showSuccess)(result.flag.retMsg || '操作成功');
|
|
181
|
-
Object.assign(masterObject, result.data);
|
|
182
|
-
setEditItem({});
|
|
183
|
-
return _context.abrupt("return", true);
|
|
184
|
-
|
|
185
|
-
case 28:
|
|
186
|
-
return _context.abrupt("return", false);
|
|
187
|
-
|
|
188
|
-
case 29:
|
|
189
|
-
case "end":
|
|
190
|
-
return _context.stop();
|
|
191
|
-
}
|
|
83
|
+
while (1) switch (_context.prev = _context.next) {
|
|
84
|
+
case 0:
|
|
85
|
+
if (!isAudit()) {
|
|
86
|
+
_context.next = 3;
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
(0, _utils.showWarn)('当前单据已审核,不能保存');
|
|
90
|
+
return _context.abrupt("return", false);
|
|
91
|
+
case 3:
|
|
92
|
+
data = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, masterObject), values);
|
|
93
|
+
_context.t0 = beforeSave;
|
|
94
|
+
if (!_context.t0) {
|
|
95
|
+
_context.next = 10;
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
_context.next = 8;
|
|
99
|
+
return beforeSave(data, false);
|
|
100
|
+
case 8:
|
|
101
|
+
_context.t1 = _context.sent;
|
|
102
|
+
_context.t0 = _context.t1 === false;
|
|
103
|
+
case 10:
|
|
104
|
+
if (!_context.t0) {
|
|
105
|
+
_context.next = 12;
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
return _context.abrupt("return", false);
|
|
109
|
+
case 12:
|
|
110
|
+
_context.next = 14;
|
|
111
|
+
return mstService.save(data);
|
|
112
|
+
case 14:
|
|
113
|
+
result = _context.sent;
|
|
114
|
+
_context.t2 = afterSave;
|
|
115
|
+
if (!_context.t2) {
|
|
116
|
+
_context.next = 21;
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
_context.next = 19;
|
|
120
|
+
return afterSave(result, data, false);
|
|
121
|
+
case 19:
|
|
122
|
+
_context.t3 = _context.sent;
|
|
123
|
+
_context.t2 = _context.t3 === false;
|
|
124
|
+
case 21:
|
|
125
|
+
if (!_context.t2) {
|
|
126
|
+
_context.next = 23;
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
return _context.abrupt("return", false);
|
|
130
|
+
case 23:
|
|
131
|
+
if (!((result === null || result === void 0 ? void 0 : (_result$flag = result.flag) === null || _result$flag === void 0 ? void 0 : _result$flag.retCode) === '0')) {
|
|
132
|
+
_context.next = 28;
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
(0, _utils.showSuccess)(result.flag.retMsg || '操作成功');
|
|
136
|
+
Object.assign(masterObject, result.data);
|
|
137
|
+
setEditItem({});
|
|
138
|
+
return _context.abrupt("return", true);
|
|
139
|
+
case 28:
|
|
140
|
+
return _context.abrupt("return", false);
|
|
141
|
+
case 29:
|
|
142
|
+
case "end":
|
|
143
|
+
return _context.stop();
|
|
192
144
|
}
|
|
193
145
|
}, _callee);
|
|
194
146
|
}));
|
|
195
|
-
|
|
196
147
|
return function onSaveMst(_x) {
|
|
197
148
|
return _ref.apply(this, arguments);
|
|
198
149
|
};
|
|
199
150
|
}();
|
|
200
151
|
/** @name 主从一起保存 */
|
|
201
|
-
|
|
202
|
-
|
|
203
152
|
var onSaveMstDtl = /*#__PURE__*/function () {
|
|
204
153
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
205
154
|
var _formRef$current, _formRef$current$getF, _tableRef$current, _tableRef$current$get, _tableRef$current2, _tableRef$current2$ge, _result$flag2;
|
|
206
|
-
|
|
207
155
|
var isDelete,
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
156
|
+
values,
|
|
157
|
+
mst,
|
|
158
|
+
dtlEditData,
|
|
159
|
+
dtlData,
|
|
160
|
+
param,
|
|
161
|
+
result,
|
|
162
|
+
_args2 = arguments;
|
|
215
163
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
216
|
-
while (1) {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
164
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
165
|
+
case 0:
|
|
166
|
+
isDelete = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : false;
|
|
167
|
+
if (!isAudit()) {
|
|
168
|
+
_context2.next = 4;
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
(0, _utils.showWarn)('当前单据已审核,不能保存');
|
|
172
|
+
return _context2.abrupt("return", false);
|
|
173
|
+
case 4:
|
|
174
|
+
if (dtlParam.dtlName) {
|
|
175
|
+
_context2.next = 7;
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
(0, _utils.showWarn)('useDtl未传入dtlName参数,不能主从一起保存');
|
|
179
|
+
return _context2.abrupt("return");
|
|
180
|
+
case 7:
|
|
181
|
+
values = (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : (_formRef$current$getF = _formRef$current.getFieldsFormatValue) === null || _formRef$current$getF === void 0 ? void 0 : _formRef$current$getF.call(_formRef$current);
|
|
182
|
+
mst = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, masterObject), values);
|
|
183
|
+
dtlEditData = ((_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : (_tableRef$current$get = _tableRef$current.getChanged) === null || _tableRef$current$get === void 0 ? void 0 : _tableRef$current$get.call(_tableRef$current)) || {
|
|
184
|
+
insertRows: [],
|
|
185
|
+
updateRows: [],
|
|
186
|
+
deleteRows: []
|
|
187
|
+
};
|
|
188
|
+
dtlData = ((_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : (_tableRef$current2$ge = _tableRef$current2.getDatasource) === null || _tableRef$current2$ge === void 0 ? void 0 : _tableRef$current2$ge.call(_tableRef$current2)) || [];
|
|
189
|
+
param = {
|
|
190
|
+
master: mst,
|
|
191
|
+
opType: 'inserted',
|
|
192
|
+
billType: dtlParam.billType,
|
|
193
|
+
codeRuleDynamicField: dtlParam.codeRuleDynamicField,
|
|
194
|
+
details: {}
|
|
195
|
+
};
|
|
196
|
+
if (isDelete) {
|
|
197
|
+
param.opType = 'deleted';
|
|
198
|
+
param.details[dtlParam.dtlName] = {
|
|
199
|
+
insertRows: dtlData,
|
|
243
200
|
updateRows: [],
|
|
244
201
|
deleteRows: []
|
|
245
202
|
};
|
|
246
|
-
|
|
247
|
-
param =
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
203
|
+
} else if (mst[mstKeyField] && mst.id) {
|
|
204
|
+
param.opType = 'updated';
|
|
205
|
+
param.details[dtlParam.dtlName] = (0, _objectSpread2.default)({}, dtlEditData);
|
|
206
|
+
} else {
|
|
207
|
+
param.details[dtlParam.dtlName] = {
|
|
208
|
+
insertRows: dtlData,
|
|
209
|
+
updateRows: [],
|
|
210
|
+
deleteRows: []
|
|
253
211
|
};
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
_context2.next = 28;
|
|
309
|
-
return afterSave(result, param, false);
|
|
310
|
-
|
|
311
|
-
case 28:
|
|
312
|
-
_context2.t3 = _context2.sent;
|
|
313
|
-
_context2.t2 = _context2.t3 === false;
|
|
314
|
-
|
|
315
|
-
case 30:
|
|
316
|
-
if (!_context2.t2) {
|
|
317
|
-
_context2.next = 32;
|
|
318
|
-
break;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
return _context2.abrupt("return", false);
|
|
322
|
-
|
|
323
|
-
case 32:
|
|
324
|
-
if (!((result === null || result === void 0 ? void 0 : (_result$flag2 = result.flag) === null || _result$flag2 === void 0 ? void 0 : _result$flag2.retCode) === '0')) {
|
|
325
|
-
_context2.next = 37;
|
|
326
|
-
break;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
(0, _utils.showSuccess)(result.flag.retMsg || '操作成功');
|
|
330
|
-
Object.assign(masterObject, result.data);
|
|
331
|
-
setEditItem({});
|
|
332
|
-
return _context2.abrupt("return", true);
|
|
333
|
-
|
|
334
|
-
case 37:
|
|
335
|
-
return _context2.abrupt("return", false);
|
|
336
|
-
|
|
337
|
-
case 38:
|
|
338
|
-
case "end":
|
|
339
|
-
return _context2.stop();
|
|
340
|
-
}
|
|
212
|
+
}
|
|
213
|
+
_context2.t0 = beforeSave;
|
|
214
|
+
if (!_context2.t0) {
|
|
215
|
+
_context2.next = 19;
|
|
216
|
+
break;
|
|
217
|
+
}
|
|
218
|
+
_context2.next = 17;
|
|
219
|
+
return beforeSave(param, false);
|
|
220
|
+
case 17:
|
|
221
|
+
_context2.t1 = _context2.sent;
|
|
222
|
+
_context2.t0 = _context2.t1 === false;
|
|
223
|
+
case 19:
|
|
224
|
+
if (!_context2.t0) {
|
|
225
|
+
_context2.next = 21;
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
return _context2.abrupt("return", false);
|
|
229
|
+
case 21:
|
|
230
|
+
_context2.next = 23;
|
|
231
|
+
return mstService.saveMstDtl(param);
|
|
232
|
+
case 23:
|
|
233
|
+
result = _context2.sent;
|
|
234
|
+
_context2.t2 = afterSave;
|
|
235
|
+
if (!_context2.t2) {
|
|
236
|
+
_context2.next = 30;
|
|
237
|
+
break;
|
|
238
|
+
}
|
|
239
|
+
_context2.next = 28;
|
|
240
|
+
return afterSave(result, param, false);
|
|
241
|
+
case 28:
|
|
242
|
+
_context2.t3 = _context2.sent;
|
|
243
|
+
_context2.t2 = _context2.t3 === false;
|
|
244
|
+
case 30:
|
|
245
|
+
if (!_context2.t2) {
|
|
246
|
+
_context2.next = 32;
|
|
247
|
+
break;
|
|
248
|
+
}
|
|
249
|
+
return _context2.abrupt("return", false);
|
|
250
|
+
case 32:
|
|
251
|
+
if (!((result === null || result === void 0 ? void 0 : (_result$flag2 = result.flag) === null || _result$flag2 === void 0 ? void 0 : _result$flag2.retCode) === '0')) {
|
|
252
|
+
_context2.next = 37;
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
(0, _utils.showSuccess)(result.flag.retMsg || '操作成功');
|
|
256
|
+
Object.assign(masterObject, result.data);
|
|
257
|
+
setEditItem({});
|
|
258
|
+
return _context2.abrupt("return", true);
|
|
259
|
+
case 37:
|
|
260
|
+
return _context2.abrupt("return", false);
|
|
261
|
+
case 38:
|
|
262
|
+
case "end":
|
|
263
|
+
return _context2.stop();
|
|
341
264
|
}
|
|
342
265
|
}, _callee2);
|
|
343
266
|
}));
|
|
344
|
-
|
|
345
267
|
return function onSaveMstDtl() {
|
|
346
268
|
return _ref2.apply(this, arguments);
|
|
347
269
|
};
|
|
348
270
|
}();
|
|
349
271
|
/** 删除按钮事件 */
|
|
350
|
-
|
|
351
|
-
|
|
352
272
|
var onRemoveMst = /*#__PURE__*/function () {
|
|
353
273
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
354
274
|
var _result$flag3;
|
|
355
|
-
|
|
356
275
|
var ids, result;
|
|
357
276
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
358
|
-
while (1) {
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
ids =
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
if (!_context3.t0) {
|
|
426
|
-
_context3.next = 25;
|
|
427
|
-
break;
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
return _context3.abrupt("return");
|
|
431
|
-
|
|
432
|
-
case 25:
|
|
433
|
-
if (!((result === null || result === void 0 ? void 0 : (_result$flag3 = result.flag) === null || _result$flag3 === void 0 ? void 0 : _result$flag3.retCode) === '0')) {
|
|
434
|
-
_context3.next = 28;
|
|
435
|
-
break;
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
(0, _utils.showSuccess)(result.flag.retMsg || '删除成功');
|
|
439
|
-
return _context3.abrupt("return", true);
|
|
440
|
-
|
|
441
|
-
case 28:
|
|
442
|
-
return _context3.abrupt("return", false);
|
|
443
|
-
|
|
444
|
-
case 29:
|
|
445
|
-
case "end":
|
|
446
|
-
return _context3.stop();
|
|
447
|
-
}
|
|
277
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
278
|
+
case 0:
|
|
279
|
+
if (!(!masterObject || !masterObject[mstKeyField])) {
|
|
280
|
+
_context3.next = 2;
|
|
281
|
+
break;
|
|
282
|
+
}
|
|
283
|
+
return _context3.abrupt("return", false);
|
|
284
|
+
case 2:
|
|
285
|
+
if (!isAudit()) {
|
|
286
|
+
_context3.next = 5;
|
|
287
|
+
break;
|
|
288
|
+
}
|
|
289
|
+
(0, _utils.showWarn)('当前单据已审核,不能删除');
|
|
290
|
+
return _context3.abrupt("return", false);
|
|
291
|
+
case 5:
|
|
292
|
+
_context3.next = 7;
|
|
293
|
+
return (0, _utils.showConfirm)('确认要删除当前数据?');
|
|
294
|
+
case 7:
|
|
295
|
+
if (!beforeRemove) {
|
|
296
|
+
_context3.next = 13;
|
|
297
|
+
break;
|
|
298
|
+
}
|
|
299
|
+
_context3.next = 10;
|
|
300
|
+
return beforeRemove([masterObject]);
|
|
301
|
+
case 10:
|
|
302
|
+
ids = _context3.sent;
|
|
303
|
+
if (!(ids === false)) {
|
|
304
|
+
_context3.next = 13;
|
|
305
|
+
break;
|
|
306
|
+
}
|
|
307
|
+
return _context3.abrupt("return", false);
|
|
308
|
+
case 13:
|
|
309
|
+
if (!ids) {
|
|
310
|
+
ids = [masterObject[mstKeyField]];
|
|
311
|
+
}
|
|
312
|
+
_context3.next = 16;
|
|
313
|
+
return mstService.remove(ids);
|
|
314
|
+
case 16:
|
|
315
|
+
result = _context3.sent;
|
|
316
|
+
_context3.t0 = afterRemove;
|
|
317
|
+
if (!_context3.t0) {
|
|
318
|
+
_context3.next = 23;
|
|
319
|
+
break;
|
|
320
|
+
}
|
|
321
|
+
_context3.next = 21;
|
|
322
|
+
return afterRemove(result, masterObject);
|
|
323
|
+
case 21:
|
|
324
|
+
_context3.t1 = _context3.sent;
|
|
325
|
+
_context3.t0 = _context3.t1 === false;
|
|
326
|
+
case 23:
|
|
327
|
+
if (!_context3.t0) {
|
|
328
|
+
_context3.next = 25;
|
|
329
|
+
break;
|
|
330
|
+
}
|
|
331
|
+
return _context3.abrupt("return");
|
|
332
|
+
case 25:
|
|
333
|
+
if (!((result === null || result === void 0 ? void 0 : (_result$flag3 = result.flag) === null || _result$flag3 === void 0 ? void 0 : _result$flag3.retCode) === '0')) {
|
|
334
|
+
_context3.next = 28;
|
|
335
|
+
break;
|
|
336
|
+
}
|
|
337
|
+
(0, _utils.showSuccess)(result.flag.retMsg || '删除成功');
|
|
338
|
+
return _context3.abrupt("return", true);
|
|
339
|
+
case 28:
|
|
340
|
+
return _context3.abrupt("return", false);
|
|
341
|
+
case 29:
|
|
342
|
+
case "end":
|
|
343
|
+
return _context3.stop();
|
|
448
344
|
}
|
|
449
345
|
}, _callee3);
|
|
450
346
|
}));
|
|
451
|
-
|
|
452
347
|
return function onRemoveMst() {
|
|
453
348
|
return _ref3.apply(this, arguments);
|
|
454
349
|
};
|
|
455
350
|
}();
|
|
456
351
|
/** 新增按钮事件 */
|
|
457
|
-
|
|
458
|
-
|
|
459
352
|
var onAddDtl = /*#__PURE__*/function () {
|
|
460
353
|
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
461
354
|
var item,
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
355
|
+
_formRef$current2,
|
|
356
|
+
mstVal,
|
|
357
|
+
mst,
|
|
358
|
+
_args4 = arguments;
|
|
467
359
|
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
468
|
-
while (1) {
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
if (!(!masterObject[mstKeyField] && formRef.current)) {
|
|
474
|
-
_context4.next = 16;
|
|
475
|
-
break;
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
_context4.prev = 2;
|
|
479
|
-
_context4.next = 5;
|
|
480
|
-
return (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : _formRef$current2.validateFields();
|
|
481
|
-
|
|
482
|
-
case 5:
|
|
483
|
-
mstVal = formRef.current.getFieldsValue();
|
|
484
|
-
_context4.next = 8;
|
|
485
|
-
return onSaveMst(mstVal);
|
|
486
|
-
|
|
487
|
-
case 8:
|
|
488
|
-
mst = _context4.sent;
|
|
489
|
-
|
|
490
|
-
if (!(mst !== true)) {
|
|
491
|
-
_context4.next = 11;
|
|
492
|
-
break;
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
return _context4.abrupt("return", false);
|
|
496
|
-
|
|
497
|
-
case 11:
|
|
360
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
361
|
+
case 0:
|
|
362
|
+
item = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : (0, _objectSpread2.default)({}, dtlItem);
|
|
363
|
+
if (!(!masterObject[mstKeyField] && formRef.current)) {
|
|
498
364
|
_context4.next = 16;
|
|
499
365
|
break;
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
366
|
+
}
|
|
367
|
+
_context4.prev = 2;
|
|
368
|
+
_context4.next = 5;
|
|
369
|
+
return (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : _formRef$current2.validateFields();
|
|
370
|
+
case 5:
|
|
371
|
+
mstVal = formRef.current.getFieldsValue();
|
|
372
|
+
_context4.next = 8;
|
|
373
|
+
return onSaveMst(mstVal);
|
|
374
|
+
case 8:
|
|
375
|
+
mst = _context4.sent;
|
|
376
|
+
if (!(mst !== true)) {
|
|
377
|
+
_context4.next = 11;
|
|
378
|
+
break;
|
|
379
|
+
}
|
|
380
|
+
return _context4.abrupt("return", false);
|
|
381
|
+
case 11:
|
|
382
|
+
_context4.next = 16;
|
|
383
|
+
break;
|
|
384
|
+
case 13:
|
|
385
|
+
_context4.prev = 13;
|
|
386
|
+
_context4.t0 = _context4["catch"](2);
|
|
387
|
+
return _context4.abrupt("return", false);
|
|
388
|
+
case 16:
|
|
389
|
+
_context4.t1 = beforeAdd;
|
|
390
|
+
if (!_context4.t1) {
|
|
391
|
+
_context4.next = 22;
|
|
392
|
+
break;
|
|
393
|
+
}
|
|
394
|
+
_context4.next = 20;
|
|
395
|
+
return beforeAdd(item);
|
|
396
|
+
case 20:
|
|
397
|
+
_context4.t2 = _context4.sent;
|
|
398
|
+
_context4.t1 = _context4.t2 === false;
|
|
399
|
+
case 22:
|
|
400
|
+
if (!_context4.t1) {
|
|
401
|
+
_context4.next = 24;
|
|
402
|
+
break;
|
|
403
|
+
}
|
|
404
|
+
return _context4.abrupt("return", false);
|
|
405
|
+
case 24:
|
|
406
|
+
setEditItem(item);
|
|
407
|
+
setShowEdit(true);
|
|
408
|
+
return _context4.abrupt("return", true);
|
|
409
|
+
case 27:
|
|
410
|
+
case "end":
|
|
411
|
+
return _context4.stop();
|
|
538
412
|
}
|
|
539
413
|
}, _callee4, null, [[2, 13]]);
|
|
540
414
|
}));
|
|
541
|
-
|
|
542
415
|
return function onAddDtl() {
|
|
543
416
|
return _ref4.apply(this, arguments);
|
|
544
417
|
};
|
|
545
418
|
}();
|
|
546
419
|
/** 编辑按钮事件 */
|
|
547
|
-
|
|
548
|
-
|
|
549
420
|
var onEditDtl = /*#__PURE__*/function () {
|
|
550
421
|
var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
551
422
|
var item,
|
|
552
|
-
|
|
423
|
+
_args5 = arguments;
|
|
553
424
|
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
554
|
-
while (1) {
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
return _context5.abrupt("return", false);
|
|
589
|
-
|
|
590
|
-
case 12:
|
|
591
|
-
setEditItem(item);
|
|
592
|
-
setShowEdit(true);
|
|
593
|
-
return _context5.abrupt("return", true);
|
|
594
|
-
|
|
595
|
-
case 15:
|
|
596
|
-
case "end":
|
|
597
|
-
return _context5.stop();
|
|
598
|
-
}
|
|
425
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
426
|
+
case 0:
|
|
427
|
+
item = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : (0, _objectSpread2.default)({}, selectedRows[0]);
|
|
428
|
+
if (selectedRows.length) {
|
|
429
|
+
_context5.next = 4;
|
|
430
|
+
break;
|
|
431
|
+
}
|
|
432
|
+
(0, _utils.showWarn)('请先选择需要更改的数据');
|
|
433
|
+
return _context5.abrupt("return", false);
|
|
434
|
+
case 4:
|
|
435
|
+
_context5.t0 = beforeEdit;
|
|
436
|
+
if (!_context5.t0) {
|
|
437
|
+
_context5.next = 10;
|
|
438
|
+
break;
|
|
439
|
+
}
|
|
440
|
+
_context5.next = 8;
|
|
441
|
+
return beforeEdit(item);
|
|
442
|
+
case 8:
|
|
443
|
+
_context5.t1 = _context5.sent;
|
|
444
|
+
_context5.t0 = _context5.t1 === false;
|
|
445
|
+
case 10:
|
|
446
|
+
if (!_context5.t0) {
|
|
447
|
+
_context5.next = 12;
|
|
448
|
+
break;
|
|
449
|
+
}
|
|
450
|
+
return _context5.abrupt("return", false);
|
|
451
|
+
case 12:
|
|
452
|
+
setEditItem(item);
|
|
453
|
+
setShowEdit(true);
|
|
454
|
+
return _context5.abrupt("return", true);
|
|
455
|
+
case 15:
|
|
456
|
+
case "end":
|
|
457
|
+
return _context5.stop();
|
|
599
458
|
}
|
|
600
459
|
}, _callee5);
|
|
601
460
|
}));
|
|
602
|
-
|
|
603
461
|
return function onEditDtl() {
|
|
604
462
|
return _ref5.apply(this, arguments);
|
|
605
463
|
};
|
|
606
464
|
}();
|
|
607
465
|
/** 删除按钮事件 */
|
|
608
|
-
|
|
609
|
-
|
|
610
466
|
var onRemoveDtl = function onRemoveDtl() {
|
|
611
467
|
var rows = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : selectedRows;
|
|
612
|
-
|
|
613
468
|
if (!rows || !rows.length) {
|
|
614
469
|
(0, _utils.showWarn)('请选择需要删除的数据');
|
|
615
470
|
return;
|
|
616
471
|
}
|
|
617
|
-
|
|
618
472
|
(0, _utils.showConfirm)('确认要删除选择的数据?').then( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
619
473
|
var _result$flag4;
|
|
620
|
-
|
|
621
474
|
var ids, result;
|
|
622
475
|
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
623
|
-
while (1) {
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
case 16:
|
|
671
|
-
if (!_context6.t0) {
|
|
672
|
-
_context6.next = 18;
|
|
673
|
-
break;
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
return _context6.abrupt("return");
|
|
677
|
-
|
|
678
|
-
case 18:
|
|
679
|
-
if ((result === null || result === void 0 ? void 0 : (_result$flag4 = result.flag) === null || _result$flag4 === void 0 ? void 0 : _result$flag4.retCode) === '0') {
|
|
680
|
-
(0, _utils.showSuccess)(result.flag.retMsg);
|
|
681
|
-
|
|
682
|
-
if (tableRef.current) {
|
|
683
|
-
tableRef.current.reload(false);
|
|
684
|
-
}
|
|
476
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
477
|
+
case 0:
|
|
478
|
+
if (!beforeRemove) {
|
|
479
|
+
_context6.next = 6;
|
|
480
|
+
break;
|
|
481
|
+
}
|
|
482
|
+
_context6.next = 3;
|
|
483
|
+
return beforeRemove(rows);
|
|
484
|
+
case 3:
|
|
485
|
+
ids = _context6.sent;
|
|
486
|
+
if (!(ids === false)) {
|
|
487
|
+
_context6.next = 6;
|
|
488
|
+
break;
|
|
489
|
+
}
|
|
490
|
+
return _context6.abrupt("return");
|
|
491
|
+
case 6:
|
|
492
|
+
if (!ids) {
|
|
493
|
+
ids = rows.map(function (o) {
|
|
494
|
+
return o.id;
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
_context6.next = 9;
|
|
498
|
+
return dtlService.remove(ids);
|
|
499
|
+
case 9:
|
|
500
|
+
result = _context6.sent;
|
|
501
|
+
_context6.t0 = afterRemove;
|
|
502
|
+
if (!_context6.t0) {
|
|
503
|
+
_context6.next = 16;
|
|
504
|
+
break;
|
|
505
|
+
}
|
|
506
|
+
_context6.next = 14;
|
|
507
|
+
return afterRemove(result, rows);
|
|
508
|
+
case 14:
|
|
509
|
+
_context6.t1 = _context6.sent;
|
|
510
|
+
_context6.t0 = _context6.t1 === false;
|
|
511
|
+
case 16:
|
|
512
|
+
if (!_context6.t0) {
|
|
513
|
+
_context6.next = 18;
|
|
514
|
+
break;
|
|
515
|
+
}
|
|
516
|
+
return _context6.abrupt("return");
|
|
517
|
+
case 18:
|
|
518
|
+
if ((result === null || result === void 0 ? void 0 : (_result$flag4 = result.flag) === null || _result$flag4 === void 0 ? void 0 : _result$flag4.retCode) === '0') {
|
|
519
|
+
(0, _utils.showSuccess)(result.flag.retMsg);
|
|
520
|
+
if (tableRef.current) {
|
|
521
|
+
tableRef.current.reload(false);
|
|
685
522
|
}
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
}
|
|
523
|
+
}
|
|
524
|
+
case 19:
|
|
525
|
+
case "end":
|
|
526
|
+
return _context6.stop();
|
|
691
527
|
}
|
|
692
528
|
}, _callee6);
|
|
693
529
|
})));
|
|
694
530
|
};
|
|
695
531
|
/** 新增,更改对应的保存事件 */
|
|
696
|
-
|
|
697
|
-
|
|
698
532
|
var onSaveDtl = /*#__PURE__*/function () {
|
|
699
533
|
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(formData) {
|
|
700
534
|
var _result$flag5;
|
|
701
|
-
|
|
702
535
|
var data, result;
|
|
703
536
|
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
704
|
-
while (1) {
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
case 21:
|
|
764
|
-
if (!((result === null || result === void 0 ? void 0 : (_result$flag5 = result.flag) === null || _result$flag5 === void 0 ? void 0 : _result$flag5.retCode) === '0')) {
|
|
765
|
-
_context7.next = 25;
|
|
766
|
-
break;
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
(0, _utils.showSuccess)(result.flag.retMsg);
|
|
770
|
-
|
|
771
|
-
if (tableRef.current) {
|
|
772
|
-
tableRef.current.reload(false);
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
return _context7.abrupt("return", true);
|
|
776
|
-
|
|
777
|
-
case 25:
|
|
778
|
-
return _context7.abrupt("return", false);
|
|
779
|
-
|
|
780
|
-
case 26:
|
|
781
|
-
case "end":
|
|
782
|
-
return _context7.stop();
|
|
783
|
-
}
|
|
537
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
538
|
+
case 0:
|
|
539
|
+
data = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, editItem), formData);
|
|
540
|
+
if (!data.id) {
|
|
541
|
+
data[relationField] = masterObject[mstKeyField];
|
|
542
|
+
}
|
|
543
|
+
_context7.t0 = beforeSave;
|
|
544
|
+
if (!_context7.t0) {
|
|
545
|
+
_context7.next = 8;
|
|
546
|
+
break;
|
|
547
|
+
}
|
|
548
|
+
_context7.next = 6;
|
|
549
|
+
return beforeSave(data, true);
|
|
550
|
+
case 6:
|
|
551
|
+
_context7.t1 = _context7.sent;
|
|
552
|
+
_context7.t0 = _context7.t1 === false;
|
|
553
|
+
case 8:
|
|
554
|
+
if (!_context7.t0) {
|
|
555
|
+
_context7.next = 10;
|
|
556
|
+
break;
|
|
557
|
+
}
|
|
558
|
+
return _context7.abrupt("return", false);
|
|
559
|
+
case 10:
|
|
560
|
+
_context7.next = 12;
|
|
561
|
+
return dtlService.save(data);
|
|
562
|
+
case 12:
|
|
563
|
+
result = _context7.sent;
|
|
564
|
+
_context7.t2 = afterSave;
|
|
565
|
+
if (!_context7.t2) {
|
|
566
|
+
_context7.next = 19;
|
|
567
|
+
break;
|
|
568
|
+
}
|
|
569
|
+
_context7.next = 17;
|
|
570
|
+
return afterSave(result, data, true);
|
|
571
|
+
case 17:
|
|
572
|
+
_context7.t3 = _context7.sent;
|
|
573
|
+
_context7.t2 = _context7.t3 === false;
|
|
574
|
+
case 19:
|
|
575
|
+
if (!_context7.t2) {
|
|
576
|
+
_context7.next = 21;
|
|
577
|
+
break;
|
|
578
|
+
}
|
|
579
|
+
return _context7.abrupt("return", false);
|
|
580
|
+
case 21:
|
|
581
|
+
if (!((result === null || result === void 0 ? void 0 : (_result$flag5 = result.flag) === null || _result$flag5 === void 0 ? void 0 : _result$flag5.retCode) === '0')) {
|
|
582
|
+
_context7.next = 25;
|
|
583
|
+
break;
|
|
584
|
+
}
|
|
585
|
+
(0, _utils.showSuccess)(result.flag.retMsg);
|
|
586
|
+
if (tableRef.current) {
|
|
587
|
+
tableRef.current.reload(false);
|
|
588
|
+
}
|
|
589
|
+
return _context7.abrupt("return", true);
|
|
590
|
+
case 25:
|
|
591
|
+
return _context7.abrupt("return", false);
|
|
592
|
+
case 26:
|
|
593
|
+
case "end":
|
|
594
|
+
return _context7.stop();
|
|
784
595
|
}
|
|
785
596
|
}, _callee7);
|
|
786
597
|
}));
|
|
787
|
-
|
|
788
598
|
return function onSaveDtl(_x2) {
|
|
789
599
|
return _ref7.apply(this, arguments);
|
|
790
600
|
};
|
|
791
601
|
}();
|
|
792
602
|
/** 加载数据方法 */
|
|
793
|
-
|
|
794
|
-
|
|
795
603
|
var onLoadDtl = /*#__PURE__*/function () {
|
|
796
604
|
var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(params, sort, filter) {
|
|
797
605
|
var _tableRef$current3, _tableRef$current3$cl;
|
|
798
|
-
|
|
799
606
|
var current, pageSize, sumProperties, rest, param, key, sortArr, _key, _key2, result;
|
|
800
|
-
|
|
801
607
|
return _regenerator.default.wrap(function _callee8$(_context8) {
|
|
802
|
-
while (1) {
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
if (Object.keys(rest).length) {
|
|
836
|
-
Object.assign(param.where, rest);
|
|
837
|
-
}
|
|
838
|
-
|
|
839
|
-
if (filter && Object.keys(filter).length) {
|
|
840
|
-
for (key in filter) {
|
|
841
|
-
if (filter[key] && !param.where[key]) {
|
|
842
|
-
param.where[key] = filter[key];
|
|
843
|
-
}
|
|
844
|
-
}
|
|
845
|
-
} //处理排序
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
if (!sumProperties && sort && Object.keys(sort).length) {
|
|
849
|
-
sortArr = [];
|
|
850
|
-
|
|
851
|
-
for (_key in sort) {
|
|
852
|
-
sortArr.push(_key + ' ' + (sort[_key] === 'ascend' ? 'asc' : 'desc'));
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
param.sort = sortArr.join(',');
|
|
856
|
-
}
|
|
857
|
-
|
|
858
|
-
for (_key2 in param.where) {
|
|
859
|
-
if (param.where[_key2] === '') {
|
|
860
|
-
delete param.where[_key2];
|
|
608
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
609
|
+
case 0:
|
|
610
|
+
current = params.current, pageSize = params.pageSize, sumProperties = params.sumProperties, rest = (0, _objectWithoutProperties2.default)(params, _excluded);
|
|
611
|
+
if (!(!masterObject || !masterObject[mstKeyField])) {
|
|
612
|
+
_context8.next = 3;
|
|
613
|
+
break;
|
|
614
|
+
}
|
|
615
|
+
return _context8.abrupt("return", {
|
|
616
|
+
data: [],
|
|
617
|
+
success: true
|
|
618
|
+
});
|
|
619
|
+
case 3:
|
|
620
|
+
param = {};
|
|
621
|
+
if (current) {
|
|
622
|
+
param.page = current;
|
|
623
|
+
param.pageSize = pageSize;
|
|
624
|
+
}
|
|
625
|
+
// 合计
|
|
626
|
+
if (sumProperties) {
|
|
627
|
+
param.sumProperties = sumProperties;
|
|
628
|
+
delete param.page;
|
|
629
|
+
delete param.pageSize;
|
|
630
|
+
}
|
|
631
|
+
param.where = {};
|
|
632
|
+
param.where[relationField] = masterObject[mstKeyField];
|
|
633
|
+
if (Object.keys(rest).length) {
|
|
634
|
+
Object.assign(param.where, rest);
|
|
635
|
+
}
|
|
636
|
+
if (filter && Object.keys(filter).length) {
|
|
637
|
+
for (key in filter) {
|
|
638
|
+
if (filter[key] && !param.where[key]) {
|
|
639
|
+
param.where[key] = filter[key];
|
|
861
640
|
}
|
|
862
641
|
}
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
642
|
+
}
|
|
643
|
+
//处理排序
|
|
644
|
+
if (!sumProperties && sort && Object.keys(sort).length) {
|
|
645
|
+
sortArr = [];
|
|
646
|
+
for (_key in sort) {
|
|
647
|
+
sortArr.push(_key + ' ' + (sort[_key] === 'ascend' ? 'asc' : 'desc'));
|
|
648
|
+
}
|
|
649
|
+
param.sort = sortArr.join(',');
|
|
650
|
+
}
|
|
651
|
+
for (_key2 in param.where) {
|
|
652
|
+
if (param.where[_key2] === '') {
|
|
653
|
+
delete param.where[_key2];
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
setSelectedRows([]);
|
|
657
|
+
(_tableRef$current3 = tableRef.current) === null || _tableRef$current3 === void 0 ? void 0 : (_tableRef$current3$cl = _tableRef$current3.clearSelected) === null || _tableRef$current3$cl === void 0 ? void 0 : _tableRef$current3$cl.call(_tableRef$current3);
|
|
658
|
+
if (ifHistoryData === 1) {
|
|
659
|
+
param.history = 1;
|
|
660
|
+
}
|
|
661
|
+
_context8.t0 = beforeLoad;
|
|
662
|
+
if (!_context8.t0) {
|
|
663
|
+
_context8.next = 21;
|
|
664
|
+
break;
|
|
665
|
+
}
|
|
666
|
+
_context8.next = 19;
|
|
667
|
+
return beforeLoad(param);
|
|
668
|
+
case 19:
|
|
669
|
+
_context8.t1 = _context8.sent;
|
|
670
|
+
_context8.t0 = _context8.t1 === false;
|
|
671
|
+
case 21:
|
|
672
|
+
if (!_context8.t0) {
|
|
673
|
+
_context8.next = 23;
|
|
674
|
+
break;
|
|
675
|
+
}
|
|
676
|
+
return _context8.abrupt("return", {
|
|
677
|
+
data: [],
|
|
678
|
+
success: true
|
|
679
|
+
});
|
|
680
|
+
case 23:
|
|
681
|
+
if (sumProperties && param.sort) {
|
|
682
|
+
delete param.sort;
|
|
683
|
+
}
|
|
684
|
+
_context8.next = 26;
|
|
685
|
+
return dtlService.load(param);
|
|
686
|
+
case 26:
|
|
687
|
+
result = _context8.sent;
|
|
688
|
+
result.data = result.rows;
|
|
689
|
+
result.success = true;
|
|
690
|
+
if (sumProperties) {
|
|
691
|
+
result.data = result.footer;
|
|
692
|
+
}
|
|
693
|
+
return _context8.abrupt("return", result);
|
|
694
|
+
case 31:
|
|
695
|
+
case "end":
|
|
696
|
+
return _context8.stop();
|
|
914
697
|
}
|
|
915
698
|
}, _callee8);
|
|
916
699
|
}));
|
|
917
|
-
|
|
918
700
|
return function onLoadDtl(_x3, _x4, _x5) {
|
|
919
701
|
return _ref8.apply(this, arguments);
|
|
920
702
|
};
|
|
921
703
|
}();
|
|
922
|
-
|
|
923
704
|
var onExportDtl = /*#__PURE__*/function () {
|
|
924
705
|
var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(url, param) {
|
|
925
706
|
var _param$exportColumns;
|
|
926
|
-
|
|
927
707
|
var _result$flag6, result, _result$flag7, _result$flag8;
|
|
928
|
-
|
|
929
708
|
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
930
|
-
while (1) {
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
_context9.next = 3;
|
|
935
|
-
break;
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
(0, _utils.showWarn)('请选择要导出的列');
|
|
939
|
-
return _context9.abrupt("return", false);
|
|
940
|
-
|
|
941
|
-
case 3:
|
|
942
|
-
if (param.findUrl) {
|
|
943
|
-
_context9.next = 6;
|
|
944
|
-
break;
|
|
945
|
-
}
|
|
946
|
-
|
|
947
|
-
(0, _utils.showWarn)('请配置业务接口 bizApi 属性');
|
|
948
|
-
return _context9.abrupt("return", false);
|
|
949
|
-
|
|
950
|
-
case 6:
|
|
951
|
-
_context9.prev = 6;
|
|
952
|
-
_context9.next = 9;
|
|
953
|
-
return (0, _http.httpPost)(url, param);
|
|
954
|
-
|
|
955
|
-
case 9:
|
|
956
|
-
result = _context9.sent;
|
|
957
|
-
|
|
958
|
-
if (!(result.data && typeof result.data === 'string')) {
|
|
959
|
-
_context9.next = 13;
|
|
960
|
-
break;
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
window.open(result.data);
|
|
964
|
-
return _context9.abrupt("return", true);
|
|
965
|
-
|
|
966
|
-
case 13:
|
|
967
|
-
if (!(((_result$flag6 = result.flag) === null || _result$flag6 === void 0 ? void 0 : _result$flag6.retCode) === '0')) {
|
|
968
|
-
_context9.next = 18;
|
|
969
|
-
break;
|
|
970
|
-
}
|
|
971
|
-
|
|
972
|
-
(0, _utils.showSuccess)(((_result$flag7 = result.flag) === null || _result$flag7 === void 0 ? void 0 : _result$flag7.retMsg) || '导出成功');
|
|
973
|
-
return _context9.abrupt("return", true);
|
|
974
|
-
|
|
975
|
-
case 18:
|
|
976
|
-
(0, _utils.showError)(((_result$flag8 = result.flag) === null || _result$flag8 === void 0 ? void 0 : _result$flag8.retMsg) || '导出失败,请联系系统管理员');
|
|
977
|
-
return _context9.abrupt("return", false);
|
|
978
|
-
|
|
979
|
-
case 20:
|
|
980
|
-
_context9.next = 27;
|
|
709
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
710
|
+
case 0:
|
|
711
|
+
if ((_param$exportColumns = param.exportColumns) === null || _param$exportColumns === void 0 ? void 0 : _param$exportColumns.length) {
|
|
712
|
+
_context9.next = 3;
|
|
981
713
|
break;
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
714
|
+
}
|
|
715
|
+
(0, _utils.showWarn)('请选择要导出的列');
|
|
716
|
+
return _context9.abrupt("return", false);
|
|
717
|
+
case 3:
|
|
718
|
+
if (param.findUrl) {
|
|
719
|
+
_context9.next = 6;
|
|
720
|
+
break;
|
|
721
|
+
}
|
|
722
|
+
(0, _utils.showWarn)('请配置业务接口 bizApi 属性');
|
|
723
|
+
return _context9.abrupt("return", false);
|
|
724
|
+
case 6:
|
|
725
|
+
_context9.prev = 6;
|
|
726
|
+
_context9.next = 9;
|
|
727
|
+
return (0, _http.httpPost)(url, param);
|
|
728
|
+
case 9:
|
|
729
|
+
result = _context9.sent;
|
|
730
|
+
if (!(result.data && typeof result.data === 'string')) {
|
|
731
|
+
_context9.next = 13;
|
|
732
|
+
break;
|
|
733
|
+
}
|
|
734
|
+
window.open(result.data);
|
|
735
|
+
return _context9.abrupt("return", true);
|
|
736
|
+
case 13:
|
|
737
|
+
if (!(((_result$flag6 = result.flag) === null || _result$flag6 === void 0 ? void 0 : _result$flag6.retCode) === '0')) {
|
|
738
|
+
_context9.next = 18;
|
|
739
|
+
break;
|
|
740
|
+
}
|
|
741
|
+
(0, _utils.showSuccess)(((_result$flag7 = result.flag) === null || _result$flag7 === void 0 ? void 0 : _result$flag7.retMsg) || '导出成功');
|
|
742
|
+
return _context9.abrupt("return", true);
|
|
743
|
+
case 18:
|
|
744
|
+
(0, _utils.showError)(((_result$flag8 = result.flag) === null || _result$flag8 === void 0 ? void 0 : _result$flag8.retMsg) || '导出失败,请联系系统管理员');
|
|
745
|
+
return _context9.abrupt("return", false);
|
|
746
|
+
case 20:
|
|
747
|
+
_context9.next = 26;
|
|
748
|
+
break;
|
|
749
|
+
case 22:
|
|
750
|
+
_context9.prev = 22;
|
|
751
|
+
_context9.t0 = _context9["catch"](6);
|
|
752
|
+
(0, _utils.showError)(_context9.t0.message);
|
|
753
|
+
return _context9.abrupt("return", false);
|
|
754
|
+
case 26:
|
|
755
|
+
case "end":
|
|
756
|
+
return _context9.stop();
|
|
994
757
|
}
|
|
995
758
|
}, _callee9, null, [[6, 22]]);
|
|
996
759
|
}));
|
|
997
|
-
|
|
998
760
|
return function onExportDtl(_x6, _x7) {
|
|
999
761
|
return _ref9.apply(this, arguments);
|
|
1000
762
|
};
|
|
1001
763
|
}();
|
|
1002
764
|
/** 审核按钮事件 */
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
765
|
var onAudit = /*#__PURE__*/function () {
|
|
1006
766
|
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
1007
767
|
var obj, _result$flag9, result;
|
|
1008
|
-
|
|
1009
768
|
return _regenerator.default.wrap(function _callee10$(_context10) {
|
|
1010
|
-
while (1) {
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
_context10.next = 3;
|
|
1015
|
-
break;
|
|
1016
|
-
}
|
|
1017
|
-
|
|
1018
|
-
(0, _utils.showWarn)('当前数据已审核,不能再做审核操作!');
|
|
1019
|
-
return _context10.abrupt("return");
|
|
1020
|
-
|
|
1021
|
-
case 3:
|
|
1022
|
-
obj = (0, _objectSpread2.default)({}, masterObject);
|
|
1023
|
-
|
|
1024
|
-
if (masterObject[mstKeyField]) {
|
|
1025
|
-
_context10.next = 7;
|
|
1026
|
-
break;
|
|
1027
|
-
}
|
|
1028
|
-
|
|
1029
|
-
(0, _utils.showWarn)('当前数据未保存,不能审核');
|
|
1030
|
-
return _context10.abrupt("return");
|
|
1031
|
-
|
|
1032
|
-
case 7:
|
|
1033
|
-
_context10.prev = 7;
|
|
1034
|
-
_context10.next = 10;
|
|
1035
|
-
return (0, _utils.showConfirm)('确认要审核此数据?', '审核提示');
|
|
1036
|
-
|
|
1037
|
-
case 10:
|
|
1038
|
-
_context10.next = 16;
|
|
769
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
770
|
+
case 0:
|
|
771
|
+
if (!isAudit()) {
|
|
772
|
+
_context10.next = 3;
|
|
1039
773
|
break;
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
case 16:
|
|
1048
|
-
_context10.t1 = beforeAudit;
|
|
1049
|
-
|
|
1050
|
-
if (!_context10.t1) {
|
|
1051
|
-
_context10.next = 22;
|
|
1052
|
-
break;
|
|
1053
|
-
}
|
|
1054
|
-
|
|
1055
|
-
_context10.next = 20;
|
|
1056
|
-
return beforeAudit(obj);
|
|
1057
|
-
|
|
1058
|
-
case 20:
|
|
1059
|
-
_context10.t2 = _context10.sent;
|
|
1060
|
-
_context10.t1 = _context10.t2 === false;
|
|
1061
|
-
|
|
1062
|
-
case 22:
|
|
1063
|
-
if (!_context10.t1) {
|
|
1064
|
-
_context10.next = 24;
|
|
1065
|
-
break;
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
return _context10.abrupt("return");
|
|
1069
|
-
|
|
1070
|
-
case 24:
|
|
1071
|
-
_context10.prev = 24;
|
|
1072
|
-
_context10.next = 27;
|
|
1073
|
-
return mstService.audit([obj]);
|
|
1074
|
-
|
|
1075
|
-
case 27:
|
|
1076
|
-
result = _context10.sent;
|
|
1077
|
-
_context10.t3 = afterAudit;
|
|
1078
|
-
|
|
1079
|
-
if (!_context10.t3) {
|
|
1080
|
-
_context10.next = 34;
|
|
1081
|
-
break;
|
|
1082
|
-
}
|
|
1083
|
-
|
|
1084
|
-
_context10.next = 32;
|
|
1085
|
-
return afterAudit(result, [obj]);
|
|
1086
|
-
|
|
1087
|
-
case 32:
|
|
1088
|
-
_context10.t4 = _context10.sent;
|
|
1089
|
-
_context10.t3 = _context10.t4 === false;
|
|
1090
|
-
|
|
1091
|
-
case 34:
|
|
1092
|
-
if (!_context10.t3) {
|
|
1093
|
-
_context10.next = 36;
|
|
1094
|
-
break;
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
|
-
return _context10.abrupt("return");
|
|
1098
|
-
|
|
1099
|
-
case 36:
|
|
1100
|
-
if ((result === null || result === void 0 ? void 0 : (_result$flag9 = result.flag) === null || _result$flag9 === void 0 ? void 0 : _result$flag9.retCode) === '0') {
|
|
1101
|
-
(0, _utils.showSuccess)(result.flag.retMsg || '审核成功');
|
|
1102
|
-
Object.assign(masterObject, result.data);
|
|
1103
|
-
}
|
|
1104
|
-
|
|
1105
|
-
_context10.next = 42;
|
|
774
|
+
}
|
|
775
|
+
(0, _utils.showWarn)('当前数据已审核,不能再做审核操作!');
|
|
776
|
+
return _context10.abrupt("return");
|
|
777
|
+
case 3:
|
|
778
|
+
obj = (0, _objectSpread2.default)({}, masterObject);
|
|
779
|
+
if (masterObject[mstKeyField]) {
|
|
780
|
+
_context10.next = 7;
|
|
1106
781
|
break;
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
782
|
+
}
|
|
783
|
+
(0, _utils.showWarn)('当前数据未保存,不能审核');
|
|
784
|
+
return _context10.abrupt("return");
|
|
785
|
+
case 7:
|
|
786
|
+
_context10.prev = 7;
|
|
787
|
+
_context10.next = 10;
|
|
788
|
+
return (0, _utils.showConfirm)('确认要审核此数据?', '审核提示');
|
|
789
|
+
case 10:
|
|
790
|
+
_context10.next = 16;
|
|
791
|
+
break;
|
|
792
|
+
case 12:
|
|
793
|
+
_context10.prev = 12;
|
|
794
|
+
_context10.t0 = _context10["catch"](7);
|
|
795
|
+
console.log('终止审核', _context10.t0);
|
|
796
|
+
return _context10.abrupt("return");
|
|
797
|
+
case 16:
|
|
798
|
+
_context10.t1 = beforeAudit;
|
|
799
|
+
if (!_context10.t1) {
|
|
800
|
+
_context10.next = 22;
|
|
801
|
+
break;
|
|
802
|
+
}
|
|
803
|
+
_context10.next = 20;
|
|
804
|
+
return beforeAudit(obj);
|
|
805
|
+
case 20:
|
|
806
|
+
_context10.t2 = _context10.sent;
|
|
807
|
+
_context10.t1 = _context10.t2 === false;
|
|
808
|
+
case 22:
|
|
809
|
+
if (!_context10.t1) {
|
|
810
|
+
_context10.next = 24;
|
|
811
|
+
break;
|
|
812
|
+
}
|
|
813
|
+
return _context10.abrupt("return");
|
|
814
|
+
case 24:
|
|
815
|
+
_context10.prev = 24;
|
|
816
|
+
_context10.next = 27;
|
|
817
|
+
return mstService.audit([obj]);
|
|
818
|
+
case 27:
|
|
819
|
+
result = _context10.sent;
|
|
820
|
+
_context10.t3 = afterAudit;
|
|
821
|
+
if (!_context10.t3) {
|
|
822
|
+
_context10.next = 34;
|
|
823
|
+
break;
|
|
824
|
+
}
|
|
825
|
+
_context10.next = 32;
|
|
826
|
+
return afterAudit(result, [obj]);
|
|
827
|
+
case 32:
|
|
828
|
+
_context10.t4 = _context10.sent;
|
|
829
|
+
_context10.t3 = _context10.t4 === false;
|
|
830
|
+
case 34:
|
|
831
|
+
if (!_context10.t3) {
|
|
832
|
+
_context10.next = 36;
|
|
833
|
+
break;
|
|
834
|
+
}
|
|
835
|
+
return _context10.abrupt("return");
|
|
836
|
+
case 36:
|
|
837
|
+
if ((result === null || result === void 0 ? void 0 : (_result$flag9 = result.flag) === null || _result$flag9 === void 0 ? void 0 : _result$flag9.retCode) === '0') {
|
|
838
|
+
(0, _utils.showSuccess)(result.flag.retMsg || '审核成功');
|
|
839
|
+
Object.assign(masterObject, result.data);
|
|
840
|
+
}
|
|
841
|
+
_context10.next = 42;
|
|
842
|
+
break;
|
|
843
|
+
case 39:
|
|
844
|
+
_context10.prev = 39;
|
|
845
|
+
_context10.t5 = _context10["catch"](24);
|
|
846
|
+
console.log('审核异常', _context10.t5);
|
|
847
|
+
case 42:
|
|
848
|
+
case "end":
|
|
849
|
+
return _context10.stop();
|
|
1117
850
|
}
|
|
1118
851
|
}, _callee10, null, [[7, 12], [24, 39]]);
|
|
1119
852
|
}));
|
|
1120
|
-
|
|
1121
853
|
return function onAudit() {
|
|
1122
854
|
return _ref10.apply(this, arguments);
|
|
1123
855
|
};
|
|
1124
856
|
}();
|
|
1125
|
-
|
|
1126
857
|
var btnDisabled = function btnDisabled(key) {
|
|
1127
858
|
if (btnStatus && typeof btnStatus(key) === 'boolean') return btnStatus(key);
|
|
1128
|
-
|
|
1129
859
|
switch (key) {
|
|
1130
860
|
case 'edit':
|
|
1131
861
|
return selectedRows.length !== 1;
|
|
1132
|
-
|
|
1133
862
|
case 'remove':
|
|
1134
863
|
return selectedRows.length === 0 || isAudit();
|
|
1135
|
-
|
|
1136
864
|
default:
|
|
1137
865
|
return false;
|
|
1138
866
|
}
|
|
1139
867
|
};
|
|
1140
|
-
|
|
1141
868
|
var onExport = function onExport() {
|
|
1142
869
|
var _tableRef$current4, _tableRef$current4$sh;
|
|
1143
|
-
|
|
1144
870
|
if (!masterObject[mstKeyField]) {
|
|
1145
871
|
(0, _utils.showWarn)('主表没保存,无法导出数据');
|
|
1146
872
|
return;
|
|
1147
873
|
}
|
|
1148
|
-
|
|
1149
874
|
tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$current4 = tableRef.current) === null || _tableRef$current4 === void 0 ? void 0 : (_tableRef$current4$sh = _tableRef$current4.showExport) === null || _tableRef$current4$sh === void 0 ? void 0 : _tableRef$current4$sh.call(_tableRef$current4);
|
|
1150
875
|
};
|
|
1151
|
-
|
|
1152
876
|
var onImport = function onImport() {
|
|
1153
877
|
var _tableRef$current5, _tableRef$current5$sh;
|
|
1154
|
-
|
|
1155
878
|
if (!masterObject[mstKeyField]) {
|
|
1156
879
|
(0, _utils.showWarn)('主表没保存,无法导入数据');
|
|
1157
880
|
return;
|
|
1158
881
|
}
|
|
1159
|
-
|
|
1160
882
|
tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$current5 = tableRef.current) === null || _tableRef$current5 === void 0 ? void 0 : (_tableRef$current5$sh = _tableRef$current5.showImport) === null || _tableRef$current5$sh === void 0 ? void 0 : _tableRef$current5$sh.call(_tableRef$current5);
|
|
1161
883
|
};
|
|
1162
|
-
|
|
1163
884
|
var tableTools = (0, _react.useMemo)(function () {
|
|
1164
885
|
return [(toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.add) && !isAudit() && canAdd ? /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
1165
886
|
key: "add",
|
|
@@ -1225,7 +946,6 @@ function useDtl(dtlParam) {
|
|
|
1225
946
|
onAudit: onAudit
|
|
1226
947
|
};
|
|
1227
948
|
}
|
|
1228
|
-
|
|
1229
949
|
;
|
|
1230
950
|
var _default = useDtl;
|
|
1231
951
|
exports.default = _default;
|