@kmkf-fe-packages/kmkf-work-order-service-component 0.28.2-beta.0 → 0.28.2-beta.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.
|
@@ -195,7 +195,9 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
|
|
|
195
195
|
});
|
|
196
196
|
}, [tid, formShopId]);
|
|
197
197
|
useEffect(function () {
|
|
198
|
+
console.debug('FlowTemplateDetail-didMount', flowTemplateKey, flowWorkOrderId);
|
|
198
199
|
return function () {
|
|
200
|
+
console.debug('FlowTemplateDetail-unMount', flowTemplateKey, flowWorkOrderId);
|
|
199
201
|
form.resetFields();
|
|
200
202
|
dispatch(setClearStore());
|
|
201
203
|
};
|
|
@@ -383,7 +385,7 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
|
|
|
383
385
|
// 提交
|
|
384
386
|
var handleSubmit = /*#__PURE__*/function () {
|
|
385
387
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
386
|
-
var _currentNodeDetail$wo7, _currentNodeDetail$wo8, formData, _result, params, res,
|
|
388
|
+
var _currentNodeDetail$wo7, _currentNodeDetail$wo8, formData, _result, params, res, _currentNodeDetail$wo9, _controllerRef$curren3;
|
|
387
389
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
388
390
|
while (1) switch (_context4.prev = _context4.next) {
|
|
389
391
|
case 0:
|
|
@@ -423,9 +425,11 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
|
|
|
423
425
|
return s.shopId === formData.shopId;
|
|
424
426
|
}), 'accessToken', '')
|
|
425
427
|
});
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
428
|
+
console.debug('提交参数: ', currentNodeDetail, formData);
|
|
429
|
+
// TODO: 自动提交时开启接口静默模式
|
|
430
|
+
_context4.next = 17;
|
|
431
|
+
return submitWorkOrder(params, autoSubmit ? 'quiet' : 'error');
|
|
432
|
+
case 17:
|
|
429
433
|
res = _context4.sent;
|
|
430
434
|
submitRequestUnlock();
|
|
431
435
|
// TODO: 兼容批量提交逻辑
|
|
@@ -437,13 +441,6 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
|
|
|
437
441
|
}
|
|
438
442
|
if (res.success) {
|
|
439
443
|
handleSuccessCallBack('submit');
|
|
440
|
-
dispatch(fetchPanelInfo({
|
|
441
|
-
flowTemplateKey: flowTemplateKey,
|
|
442
|
-
flowWorkOrderId: flowWorkOrderIdState
|
|
443
|
-
}, {
|
|
444
|
-
signal: controllerRef === null || controllerRef === void 0 ? void 0 : (_controllerRef$curren3 = controllerRef.current) === null || _controllerRef$curren3 === void 0 ? void 0 : _controllerRef$curren3.signal
|
|
445
|
-
}));
|
|
446
|
-
message.success('提交成功');
|
|
447
444
|
//删除缓存的订单信息
|
|
448
445
|
deleteCacheOrder({
|
|
449
446
|
templateList: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo9 = currentNodeDetail.workOrderTemplateInfo) === null || _currentNodeDetail$wo9 === void 0 ? void 0 : _currentNodeDetail$wo9.componentDtoList,
|
|
@@ -453,31 +450,40 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
|
|
|
453
450
|
plat: plat,
|
|
454
451
|
unDeleteOrderInfo: false
|
|
455
452
|
});
|
|
453
|
+
if (!autoSubmit) {
|
|
454
|
+
dispatch(fetchPanelInfo({
|
|
455
|
+
flowTemplateKey: flowTemplateKey,
|
|
456
|
+
flowWorkOrderId: flowWorkOrderIdState
|
|
457
|
+
}, {
|
|
458
|
+
signal: controllerRef === null || controllerRef === void 0 ? void 0 : (_controllerRef$curren3 = controllerRef.current) === null || _controllerRef$curren3 === void 0 ? void 0 : _controllerRef$curren3.signal
|
|
459
|
+
}));
|
|
460
|
+
message.success('提交成功');
|
|
461
|
+
}
|
|
456
462
|
}
|
|
457
|
-
_context4.next =
|
|
463
|
+
_context4.next = 31;
|
|
458
464
|
break;
|
|
459
|
-
case
|
|
460
|
-
_context4.prev =
|
|
465
|
+
case 23:
|
|
466
|
+
_context4.prev = 23;
|
|
461
467
|
_context4.t0 = _context4["catch"](0);
|
|
462
468
|
submitRequestUnlock();
|
|
463
469
|
if (!(autoSubmit && typeof callbackAutoSubmitResult === 'function')) {
|
|
464
|
-
_context4.next =
|
|
470
|
+
_context4.next = 30;
|
|
465
471
|
break;
|
|
466
472
|
}
|
|
467
473
|
if (!(get(_context4.t0, 'errorFields.length') > 0)) {
|
|
468
|
-
_context4.next =
|
|
474
|
+
_context4.next = 29;
|
|
469
475
|
break;
|
|
470
476
|
}
|
|
471
477
|
return _context4.abrupt("return", callbackAutoSubmitResult({
|
|
472
478
|
success: false,
|
|
473
479
|
message: get(_context4.t0, 'errorFields.0.errors.0', '组件校验失败')
|
|
474
480
|
}));
|
|
475
|
-
case
|
|
481
|
+
case 29:
|
|
476
482
|
return _context4.abrupt("return", callbackAutoSubmitResult({
|
|
477
483
|
success: false,
|
|
478
|
-
message: "接口请求异常"
|
|
484
|
+
message: (_context4.t0 === null || _context4.t0 === void 0 ? void 0 : _context4.t0.message) || "接口请求异常"
|
|
479
485
|
}));
|
|
480
|
-
case
|
|
486
|
+
case 30:
|
|
481
487
|
if (get(_context4.t0, 'errorFields.length') > 0) {
|
|
482
488
|
setTimeout(function () {
|
|
483
489
|
var _get;
|
|
@@ -490,11 +496,11 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
|
|
|
490
496
|
// TODO: 解决显影导致的组件校验失败未提示问题
|
|
491
497
|
message.error(get(_context4.t0, 'errorFields.0.errors.0', '组件校验失败'));
|
|
492
498
|
}
|
|
493
|
-
case
|
|
499
|
+
case 31:
|
|
494
500
|
case "end":
|
|
495
501
|
return _context4.stop();
|
|
496
502
|
}
|
|
497
|
-
}, _callee4, null, [[0,
|
|
503
|
+
}, _callee4, null, [[0, 23]]);
|
|
498
504
|
}));
|
|
499
505
|
return function handleSubmit() {
|
|
500
506
|
return _ref4.apply(this, arguments);
|
|
@@ -948,20 +954,22 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
|
|
|
948
954
|
dispatch(setPlat(plat));
|
|
949
955
|
}, [plat]);
|
|
950
956
|
useEffect(function () {
|
|
951
|
-
|
|
957
|
+
var _currentNodeDetail$wo24;
|
|
958
|
+
if (autoSubmit && !isNull(currentNodeDetail) && flowWorkOrderId === (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo24 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo24 === void 0 ? void 0 : _currentNodeDetail$wo24.flowWorkOrderId)) {
|
|
959
|
+
console.debug('currentNodeDetail', currentNodeDetail);
|
|
952
960
|
setTimeout(function () {
|
|
953
961
|
handleSubmit();
|
|
954
962
|
}, 0);
|
|
955
963
|
}
|
|
956
964
|
}, [currentNodeDetail]);
|
|
957
965
|
var isCurrentNodeHandler = useMemo(function () {
|
|
958
|
-
var _currentNodeDetail$no11, _currentNodeDetail$no12, _currentNodeDetail$no13, _currentNodeDetail$no14, _currentNodeDetail$no15, _currentNodeDetail$no16, _currentNodeDetail$
|
|
966
|
+
var _currentNodeDetail$no11, _currentNodeDetail$no12, _currentNodeDetail$no13, _currentNodeDetail$no14, _currentNodeDetail$no15, _currentNodeDetail$no16, _currentNodeDetail$wo25, _currentNodeDetail$no17, _currentNodeDetail$no18;
|
|
959
967
|
return currentUserHasOperatorAuth({
|
|
960
968
|
assistantList: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no11 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no11 === void 0 ? void 0 : _currentNodeDetail$no11.id) && assistantMap[currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no12 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no12 === void 0 ? void 0 : _currentNodeDetail$no12.id] || [],
|
|
961
969
|
currentUserKey: plat.userKey,
|
|
962
970
|
staffIds: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no13 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no13 === void 0 ? void 0 : (_currentNodeDetail$no14 = _currentNodeDetail$no13.assistants) === null || _currentNodeDetail$no14 === void 0 ? void 0 : _currentNodeDetail$no14.staffIds) || [],
|
|
963
971
|
operateDataPermission: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no15 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no15 === void 0 ? void 0 : (_currentNodeDetail$no16 = _currentNodeDetail$no15.assistants) === null || _currentNodeDetail$no16 === void 0 ? void 0 : _currentNodeDetail$no16.operateDataPermission,
|
|
964
|
-
handlerList: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$
|
|
972
|
+
handlerList: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo25 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo25 === void 0 ? void 0 : _currentNodeDetail$wo25.handlerList) || [],
|
|
965
973
|
isAllStaff: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no17 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no17 === void 0 ? void 0 : (_currentNodeDetail$no18 = _currentNodeDetail$no17.assistants) === null || _currentNodeDetail$no18 === void 0 ? void 0 : _currentNodeDetail$no18.isAllStaff
|
|
966
974
|
});
|
|
967
975
|
}, [currentNodeDetail, plat, assistantMap]);
|
|
@@ -4,7 +4,7 @@ export declare const queryPanelInfo: (data: QyFlowPanelInfoRequest, options: any
|
|
|
4
4
|
export declare const queryAllFlowOperateRecord: (data: QueryAllFlowOperateRecordRequest) => Promise<serverProps<Array<QyFlowOperateQueryAllFlowOperateRecordResponse>>>;
|
|
5
5
|
export declare const queryNodeDetail: (data: QueryNodeDetailRequest) => Promise<serverProps<QueryNodeDetailResponse>>;
|
|
6
6
|
export declare const saveWorkOrder: (data: any) => Promise<serverProps<string>>;
|
|
7
|
-
export declare const submitWorkOrder: (data: any) => Promise<serverProps<boolean>>;
|
|
7
|
+
export declare const submitWorkOrder: (data: any, infoLevel?: any) => Promise<serverProps<boolean>>;
|
|
8
8
|
export declare const modifyWorkOrder: (data: any) => Promise<serverProps<boolean>>;
|
|
9
9
|
export declare const addRemark: (data: any) => Promise<serverProps<boolean>>;
|
|
10
10
|
export declare const stopWorkOrder: (data: any) => Promise<serverProps<{
|
|
@@ -36,10 +36,12 @@ export var saveWorkOrder = function saveWorkOrder(data) {
|
|
|
36
36
|
|
|
37
37
|
// 提交
|
|
38
38
|
export var submitWorkOrder = function submitWorkOrder(data) {
|
|
39
|
+
var infoLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'error';
|
|
39
40
|
return request({
|
|
40
41
|
url: '/qy/flow/operate/submit',
|
|
41
42
|
method: 'post',
|
|
42
|
-
data: data
|
|
43
|
+
data: data,
|
|
44
|
+
infoLevel: infoLevel
|
|
43
45
|
});
|
|
44
46
|
};
|
|
45
47
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/kmkf-work-order-service-component",
|
|
3
|
-
"version": "0.28.2-beta.
|
|
3
|
+
"version": "0.28.2-beta.2",
|
|
4
4
|
"module": "dist/esm/index.js",
|
|
5
5
|
"typings": "dist/esm/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"publishConfig": {
|
|
74
74
|
"access": "public"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "bd5b027c20a77e006d58cb771d5502b8912047ab",
|
|
77
77
|
"gitHooks": {
|
|
78
78
|
"pre-commit": "lint-staged"
|
|
79
79
|
}
|