@kmkf-fe-packages/kmkf-work-order-service-component 2.2.31-beta.94 → 2.2.31-beta.96

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.
@@ -18,12 +18,13 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
18
18
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
19
19
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20
20
  import React, { useEffect, useMemo, useState, useRef, forwardRef, useImperativeHandle, useContext } from 'react';
21
+ import { Modal } from 'antd';
21
22
  import { message } from 'antd';
22
23
  import { useMemoizedFn } from 'ahooks';
23
24
  import { get, find } from 'lodash';
24
25
  import { calcWorkOrderList, submitParams } from "../../../common/utils/tools";
25
26
  import { FlowStatus, NodeType, NodeStatus } from "../../../model/flowTemplateDetail/types";
26
- import { modifyWorkOrder, restartAutoTask } from "../../../model/flowTemplateDetail/api";
27
+ import { modifyWorkOrder, restartAutoTask, skipNode } from "../../../model/flowTemplateDetail/api";
27
28
  import Header from "../Header";
28
29
  import FormRender from "../FormRender";
29
30
  import RenderDetail from "../RenderDetail";
@@ -36,12 +37,13 @@ import { fetchCurrentTradeIdLinkWorkOrder, fetchPanelInfo } from "../../store/re
36
37
  import { useSelector } from "../../context/useSelector";
37
38
  import { Context } from "../../context";
38
39
  import { AutoTaskDetail } from "../AutoTaskDetail";
40
+ import { SKIP_NODE_TYPES } from "../../../common/constant";
39
41
  var formProps = {
40
42
  className: 'customizeFormModalClassName',
41
43
  layout: 'vertical'
42
44
  };
43
45
  var CurrentNode = function CurrentNode(props, ref) {
44
- var _currentNodeDetail$no, _currentNodeDetail$no2, _currentNodeDetail$no3, _currentNodeDetail$no4, _currentNodeDetail$no18, _currentNodeDetail$fl, _currentNodeDetail$wo12, _localStorage, _currentNodeDetail$wo13, _currentNodeDetail$wo14, _currentNodeDetail$wo15, _currentNodeDetail$wo16, _currentNodeDetail$wo17, _currentNodeDetail$wo18, _currentNodeDetail$wo19, _currentNodeDetail$wo20, _currentNodeDetail$wo21, _currentNodeDetail$no21, _currentNodeDetail$no22, _currentNodeDetail$no23, _currentNodeDetail$wo22, _currentNodeDetail$no24, _currentNodeDetail$wo23;
46
+ var _currentNodeDetail$no, _currentNodeDetail$no2, _currentNodeDetail$no3, _currentNodeDetail$no4, _currentNodeDetail$no18, _currentNodeDetail$fl, _currentNodeDetail$wo12, _localStorage, _currentNodeDetail$fl2, _currentNodeDetail$wo13, _currentNodeDetail$wo14, _currentNodeDetail$wo15, _currentNodeDetail$wo16, _currentNodeDetail$wo17, _currentNodeDetail$wo18, _currentNodeDetail$wo19, _currentNodeDetail$wo20, _currentNodeDetail$wo21, _currentNodeDetail$no22, _currentNodeDetail$no23, _currentNodeDetail$no24, _currentNodeDetail$wo22, _currentNodeDetail$no25, _currentNodeDetail$wo23;
45
47
  var formRenderRef = useRef(null);
46
48
  useImperativeHandle(ref, function () {
47
49
  return {
@@ -282,6 +284,67 @@ var CurrentNode = function CurrentNode(props, ref) {
282
284
  return _ref2.apply(this, arguments);
283
285
  };
284
286
  }();
287
+ var handleSkip = /*#__PURE__*/function () {
288
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
289
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
290
+ while (1) switch (_context4.prev = _context4.next) {
291
+ case 0:
292
+ Modal.confirm({
293
+ title: '当前获取物流单号自动化任务正在执行中,确定要跳过吗?跳过后将无法获取物流信息',
294
+ okText: '确认',
295
+ cancelText: '取消',
296
+ onOk: function () {
297
+ var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
298
+ var _currentNodeDetail$no21;
299
+ var _yield$skipNode, success, _controllerRef$curren3;
300
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
301
+ while (1) switch (_context3.prev = _context3.next) {
302
+ case 0:
303
+ _context3.next = 2;
304
+ return skipNode({
305
+ operateParams: {
306
+ flowTemplateKey: operateParams === null || operateParams === void 0 ? void 0 : operateParams.flowTemplateKey,
307
+ flowWorkOrderUpdateTime: operateParams === null || operateParams === void 0 ? void 0 : operateParams.flowWorkOrderUpdateTime,
308
+ flowTemplateId: flowTemplateId,
309
+ flowWorkOrderId: flowWorkOrderId,
310
+ nodeId: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no21 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no21 === void 0 ? void 0 : _currentNodeDetail$no21.id) || ''
311
+ }
312
+ });
313
+ case 2:
314
+ _yield$skipNode = _context3.sent;
315
+ success = _yield$skipNode.success;
316
+ if (success) {
317
+ message.success('跳过成功');
318
+ queryRemarkList();
319
+ dispatch(fetchPanelInfo({
320
+ flowTemplateKey: operateParams === null || operateParams === void 0 ? void 0 : operateParams.flowTemplateKey,
321
+ flowWorkOrderId: flowWorkOrderId
322
+ }, {
323
+ signal: controllerRef === null || controllerRef === void 0 ? void 0 : (_controllerRef$curren3 = controllerRef.current) === null || _controllerRef$curren3 === void 0 ? void 0 : _controllerRef$curren3.signal
324
+ }));
325
+ }
326
+ case 5:
327
+ case "end":
328
+ return _context3.stop();
329
+ }
330
+ }, _callee3);
331
+ }));
332
+ function onOk() {
333
+ return _onOk.apply(this, arguments);
334
+ }
335
+ return onOk;
336
+ }()
337
+ });
338
+ case 1:
339
+ case "end":
340
+ return _context4.stop();
341
+ }
342
+ }, _callee4);
343
+ }));
344
+ return function handleSkip() {
345
+ return _ref3.apply(this, arguments);
346
+ };
347
+ }();
285
348
  var isArtificialNode = tag === 'artificial';
286
349
  var isAutoNode = tag === 'auto';
287
350
  var isShowAutoNodeDetail = isAutoNode && ['ORDER_MEMO_MANY_RULES', 'AFTER_SALE_AUTO_RETURN_GOODS_AGREE_REJECT', 'AFTER_SALE_AUTO_REFUND_REJECT', 'LOGISTICS_INTERCEPT_MULTI_RULE', 'MESSAGE_NOTIFY_EVENT', 'DING_TALK_ROBOT_NOTIFY', 'HTTP_INVOKE', 'ORDER_MEMO', 'LBDJ_ONE_PRICE_ORDER'].includes(currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$fl = currentNodeDetail.flowEventData) === null || _currentNodeDetail$fl === void 0 ? void 0 : _currentNodeDetail$fl.eventType);
@@ -289,6 +352,7 @@ var CurrentNode = function CurrentNode(props, ref) {
289
352
  // TODO: 决策节点给后端修复数据加了一个入口
290
353
  // @ts-ignore
291
354
  var showRestartAutoTask = tag === 'auto' && flowStatus === FlowStatus.PROCESSING || tag === 'judge' && ((_localStorage = localStorage) === null || _localStorage === void 0 ? void 0 : _localStorage.getItem('__isDEV__')) === 'true';
355
+ var showSkipButton = SKIP_NODE_TYPES.includes(currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$fl2 = currentNodeDetail.flowEventData) === null || _currentNodeDetail$fl2 === void 0 ? void 0 : _currentNodeDetail$fl2.eventType) && flowStatus && [FlowStatus.FLOWING, FlowStatus.PROCESSING].includes(flowStatus);
292
356
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Header, {
293
357
  tag: tag,
294
358
  nodeName: nodeName,
@@ -300,9 +364,11 @@ var CurrentNode = function CurrentNode(props, ref) {
300
364
  showReminder: isArtificialNode && [NodeStatus.WAITING, NodeStatus.STOPPING].includes(currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo18 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo18 === void 0 ? void 0 : _currentNodeDetail$wo18.flowStatus) &&
301
365
  // isCurrentNodeHandler &&
302
366
  !readonly,
367
+ showSkipButton: showSkipButton,
303
368
  isReminder: JSON.parse((currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo19 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo19 === void 0 ? void 0 : (_currentNodeDetail$wo20 = _currentNodeDetail$wo19.jsonMap) === null || _currentNodeDetail$wo20 === void 0 ? void 0 : _currentNodeDetail$wo20.flowTags) || '[]').includes('REMINDER'),
304
369
  handleWithdraw: handleWithdraw,
305
370
  handleReminder: onReminder,
371
+ handleSkip: handleSkip,
306
372
  editing: editing,
307
373
  handleEdit: handleEdit,
308
374
  handleSave: handleSave,
@@ -310,18 +376,18 @@ var CurrentNode = function CurrentNode(props, ref) {
310
376
  handleRestartAutoTask: handleRestartAutoTask,
311
377
  flowTemplateKey: (operateParams === null || operateParams === void 0 ? void 0 : operateParams.flowTemplateKey) || '',
312
378
  flowWorkOrderId: flowWorkOrderId || '',
313
- nodeId: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no21 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no21 === void 0 ? void 0 : _currentNodeDetail$no21.id) || '',
379
+ nodeId: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no22 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no22 === void 0 ? void 0 : _currentNodeDetail$no22.id) || '',
314
380
  flowTemplateId: flowTemplateId
315
381
  }), /*#__PURE__*/React.createElement("div", {
316
382
  className: styles.formRenderContainer
317
- }, [NodeType.START_NODE, NodeType.EXECUTE_NODE].includes(currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no22 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no22 === void 0 ? void 0 : _currentNodeDetail$no22.nodeType) && (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrderTemplateInfo) && (flowStatus === FlowStatus.COMPLETED && !editing ? /*#__PURE__*/React.createElement(RenderDetail, {
383
+ }, [NodeType.START_NODE, NodeType.EXECUTE_NODE].includes(currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no23 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no23 === void 0 ? void 0 : _currentNodeDetail$no23.nodeType) && (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrderTemplateInfo) && (flowStatus === FlowStatus.COMPLETED && !editing ? /*#__PURE__*/React.createElement(RenderDetail, {
318
384
  workOrderTemplateInfo: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrderTemplateInfo,
319
385
  transData: transData,
320
386
  platform: plat.platform,
321
387
  onOpenWangWang: onOpenWangWang
322
388
  }) : /*#__PURE__*/React.createElement(FormRender, {
323
389
  ref: formRenderRef,
324
- isShowShopList: NodeType.START_NODE === (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no23 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no23 === void 0 ? void 0 : _currentNodeDetail$no23.nodeType) && [PlatForm.PC, PlatForm.WEB].includes(plat.platform),
390
+ isShowShopList: NodeType.START_NODE === (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no24 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no24 === void 0 ? void 0 : _currentNodeDetail$no24.nodeType) && [PlatForm.PC, PlatForm.WEB].includes(plat.platform),
325
391
  plat: plat,
326
392
  templateDetail: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrderTemplateInfo,
327
393
  shopList: shopList,
@@ -338,7 +404,7 @@ var CurrentNode = function CurrentNode(props, ref) {
338
404
  handleChangeTradeId: handleChangeTradeId,
339
405
  canModifyPayment: true,
340
406
  flowAllShowHideRules: allShowHideRules,
341
- isStartNodeWaiting: NodeType.START_NODE === (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no24 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no24 === void 0 ? void 0 : _currentNodeDetail$no24.nodeType) && [NodeStatus.WAITING].includes(currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo23 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo23 === void 0 ? void 0 : _currentNodeDetail$wo23.flowStatus),
407
+ isStartNodeWaiting: NodeType.START_NODE === (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no25 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no25 === void 0 ? void 0 : _currentNodeDetail$no25.nodeType) && [NodeStatus.WAITING].includes(currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo23 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo23 === void 0 ? void 0 : _currentNodeDetail$wo23.flowStatus),
342
408
  firstOrderBackfill: flowStatus !== FlowStatus.COMPLETED,
343
409
  autoSubmit: autoSubmit
344
410
  })), isShowAutoNodeDetail && /*#__PURE__*/React.createElement(AutoTaskDetail, {
@@ -7,6 +7,7 @@ interface HeaderProps {
7
7
  showWithdraw: boolean;
8
8
  showReminder?: boolean;
9
9
  showRestartAutoTask?: boolean;
10
+ showSkipButton?: boolean;
10
11
  handleLook?: () => void;
11
12
  handleSave?: () => void;
12
13
  handleEdit?: () => void;
@@ -14,6 +15,7 @@ interface HeaderProps {
14
15
  handleWithdraw?: () => void;
15
16
  handleReminder?: (type: string) => void;
16
17
  handleRestartAutoTask?: () => void;
18
+ handleSkip?: () => void;
17
19
  loading?: boolean;
18
20
  editing?: boolean;
19
21
  opening?: boolean;
@@ -43,6 +43,7 @@ var Header = function Header(props) {
43
43
  handlePackUp = props.handlePackUp,
44
44
  handleWithdraw = props.handleWithdraw,
45
45
  handleReminder = props.handleReminder,
46
+ handleSkip = props.handleSkip,
46
47
  _props$loading = props.loading,
47
48
  loading = _props$loading === void 0 ? false : _props$loading,
48
49
  _props$editing = props.editing,
@@ -55,6 +56,8 @@ var Header = function Header(props) {
55
56
  showReminder = _props$showReminder === void 0 ? false : _props$showReminder,
56
57
  _props$showRestartAut = props.showRestartAutoTask,
57
58
  showRestartAutoTask = _props$showRestartAut === void 0 ? false : _props$showRestartAut,
59
+ _props$showSkipButton = props.showSkipButton,
60
+ showSkipButton = _props$showSkipButton === void 0 ? false : _props$showSkipButton,
58
61
  handler = props.handler,
59
62
  isReminder = props.isReminder,
60
63
  _props$handleLabel = props.handleLabel,
@@ -190,7 +193,14 @@ var Header = function Header(props) {
190
193
  },
191
194
  "data-spm-click": "\u53D6\u6D88\u50AC\u5355",
192
195
  "data-spm-param": "\u53D6\u6D88\u50AC\u5355"
193
- }, "\u53D6\u6D88"))), /*#__PURE__*/React.createElement(Modal, {
196
+ }, "\u53D6\u6D88"))), showSkipButton && /*#__PURE__*/React.createElement(Button, {
197
+ type: "link",
198
+ onClick: function onClick() {
199
+ return typeof handleSkip === 'function' && handleSkip();
200
+ },
201
+ "data-spm-click": "\u8DF3\u8FC7",
202
+ "data-spm-param": "\u8DF3\u8FC7"
203
+ }, "\u8DF3\u8FC7"), /*#__PURE__*/React.createElement(Modal, {
194
204
  title: "\u5F02\u5E38\u65E5\u5FD7",
195
205
  onOk: handleCancel,
196
206
  onCancel: handleCancel,
@@ -236,6 +236,7 @@ export declare const selectCurrentNodeDetail: (state: FlowTemplateDetailState) =
236
236
  }[];
237
237
  } | undefined;
238
238
  } | undefined;
239
+ uniqueKey: string;
239
240
  } | undefined;
240
241
  } | undefined;
241
242
  export declare const selectTid: (state: FlowTemplateDetailState) => string;
@@ -67,3 +67,4 @@ export declare const WORK_ORDER_STATUS_AI_BUILD: {
67
67
  STOPPING: string;
68
68
  COMPLETED: string;
69
69
  };
70
+ export declare const SKIP_NODE_TYPES: string[];
@@ -86,4 +86,7 @@ export var CHILD_FIELD_VALUE = {
86
86
  returnLogisticsCompany: 'company',
87
87
  returnLogisticsCode: 'order'
88
88
  };
89
- export var WORK_ORDER_STATUS_AI_BUILD = (_WORK_ORDER_STATUS_AI = {}, _defineProperty(_WORK_ORDER_STATUS_AI, WAITING, '暂存'), _defineProperty(_WORK_ORDER_STATUS_AI, STOPPING, '暂停'), _defineProperty(_WORK_ORDER_STATUS_AI, COMPLETED, '已提交'), _WORK_ORDER_STATUS_AI);
89
+ export var WORK_ORDER_STATUS_AI_BUILD = (_WORK_ORDER_STATUS_AI = {}, _defineProperty(_WORK_ORDER_STATUS_AI, WAITING, '暂存'), _defineProperty(_WORK_ORDER_STATUS_AI, STOPPING, '暂停'), _defineProperty(_WORK_ORDER_STATUS_AI, COMPLETED, '已提交'), _WORK_ORDER_STATUS_AI);
90
+
91
+ //支持跳过的节点类型
92
+ export var SKIP_NODE_TYPES = ['REISSUE_LOGISTICS_SYNC', 'BS_E3_REISSUE_LOGISTICS_SYNC', 'WDT_LOGISTICS_SYNC', 'GY_REISSUE_LOGISTICS_SYNC', 'KUAI_MAI_REISSUE_LOGISTICS_SYNC', 'JST_REISSUE_LOGISTICS_SYNC', 'JY_REISSUE_LOGISTICS_SYNC'];
@@ -93,3 +93,4 @@ export declare const getH5SharePermission: () => Promise<serverProps<any>>;
93
93
  export declare const shortLink: (data: any) => Promise<serverProps<any>>;
94
94
  export declare const createNodeLink: (data: any) => Promise<serverProps<any>>;
95
95
  export declare const createLink: (data: any) => Promise<serverProps<any>>;
96
+ export declare const skipNode: (data: any) => Promise<serverProps<any>>;
@@ -257,4 +257,11 @@ export var createLink = function createLink(data) {
257
257
  method: 'get',
258
258
  data: data
259
259
  });
260
+ };
261
+ export var skipNode = function skipNode(data) {
262
+ return request({
263
+ url: "/qy/flow/operate/jump",
264
+ method: 'post',
265
+ data: data
266
+ });
260
267
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/kmkf-work-order-service-component",
3
- "version": "2.2.31-beta.94",
3
+ "version": "2.2.31-beta.96",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -32,9 +32,9 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@ant-design/icons": "^4.7.0",
35
- "@kmkf-fe-packages/basic-components": "2.2.31-beta.94",
35
+ "@kmkf-fe-packages/basic-components": "2.2.31-beta.95",
36
36
  "@kmkf-fe-packages/kmkf-utils": "2.2.31-beta.94",
37
- "@kmkf-fe-packages/services-components": "2.2.31-beta.94",
37
+ "@kmkf-fe-packages/services-components": "2.2.31-beta.95",
38
38
  "@reduxjs/toolkit": "^1.8.5",
39
39
  "ahooks": "^3.7.4",
40
40
  "copy-to-clipboard": "^3.3.3",
@@ -75,7 +75,7 @@
75
75
  "publishConfig": {
76
76
  "access": "public"
77
77
  },
78
- "gitHead": "8f41fd8a6ee2b93292b48e5473f951df970896b3",
78
+ "gitHead": "b2e797bb637b38f2dc178de1ce5e8ee0c46c5416",
79
79
  "gitHooks": {
80
80
  "pre-commit": "lint-staged"
81
81
  }