@kmkf-fe-packages/kmkf-work-order-service-component 1.19.2 → 2.0.0-rc.0

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.
Files changed (30) hide show
  1. package/dist/esm/FlowTemplateDetailV2/common.d.ts +2 -0
  2. package/dist/esm/FlowTemplateDetailV2/common.js +19 -12
  3. package/dist/esm/FlowTemplateDetailV2/components/ActionList/index.js +1 -1
  4. package/dist/esm/FlowTemplateDetailV2/components/CurrentNode/index.js +57 -11
  5. package/dist/esm/FlowTemplateDetailV2/components/FormRender/index.js +3 -0
  6. package/dist/esm/FlowTemplateDetailV2/components/Header/index.d.ts +5 -0
  7. package/dist/esm/FlowTemplateDetailV2/components/Header/index.js +84 -6
  8. package/dist/esm/FlowTemplateDetailV2/components/Item/index.d.ts +1 -0
  9. package/dist/esm/FlowTemplateDetailV2/components/Item/index.js +6 -2
  10. package/dist/esm/FlowTemplateDetailV2/components/RejectedModal/index.js +6 -3
  11. package/dist/esm/FlowTemplateDetailV2/components/WithdrawModal/index.js +6 -3
  12. package/dist/esm/FlowTemplateDetailV2/index.d.ts +1 -21
  13. package/dist/esm/FlowTemplateDetailV2/index.js +154 -117
  14. package/dist/esm/FlowTemplateDetailV2/index.less +6 -0
  15. package/dist/esm/FlowTemplateDetailV2/pollOperationResult.d.ts +2 -0
  16. package/dist/esm/FlowTemplateDetailV2/pollOperationResult.js +39 -0
  17. package/dist/esm/FlowTemplateDetailV2/store/reducers.d.ts +4 -0
  18. package/dist/esm/FlowTemplateDetailV2/store/reducers.js +14 -2
  19. package/dist/esm/FlowTemplateDetailV2/store/selector.d.ts +2 -0
  20. package/dist/esm/FlowTemplateDetailV2/store/selector.js +6 -0
  21. package/dist/esm/FlowTemplateDetailV2/type.d.ts +28 -0
  22. package/dist/esm/FlowTemplateDetailV2/type.js +1 -0
  23. package/dist/esm/WorkOrder/components/WorkOrderList/components/CustomizeWorkOrderCard/index.js +8 -0
  24. package/dist/esm/WorkOrder/components/WorkOrderList/index.js +6 -0
  25. package/dist/esm/common/utils/tools.js +3 -1
  26. package/dist/esm/model/flowTemplateDetail/api.d.ts +3 -0
  27. package/dist/esm/model/flowTemplateDetail/api.js +25 -0
  28. package/dist/esm/model/flowTemplateDetail/types.d.ts +5 -1
  29. package/dist/esm/model/flowTemplateDetail/types.js +2 -0
  30. package/package.json +5 -5
@@ -12,6 +12,8 @@ export declare const FLOW_STATUS_V2: {
12
12
  STOPPING: string;
13
13
  COMPLETED: string;
14
14
  CLOSED: string;
15
+ FLOWING: string;
16
+ RETURNING: string;
15
17
  };
16
18
  export declare const CANNOT_BACK_FILL: string[];
17
19
  export declare const verifyHandle: (data: any, componentDtoList: Array<any>) => {
@@ -42,14 +42,17 @@ export var getFlowOperate = {
42
42
  MODIFY_WORK_ORDER: '修改',
43
43
  WITHDRAW: '撤回',
44
44
  REMINDER: '催单',
45
- CANCEL_REMINDER: '取消催单'
45
+ CANCEL_REMINDER: '取消催单',
46
+ AUTO_TASK_RETRY: '自动任务重试'
46
47
  };
47
48
  export var FLOW_STATUS_V2 = {
48
49
  WAIT_COMMIT: '待提交',
49
50
  PROCESSING: '处理中',
50
51
  STOPPING: '暂停中',
51
52
  COMPLETED: '已完成',
52
- CLOSED: '已关闭'
53
+ CLOSED: '已关闭',
54
+ FLOWING: '流转中',
55
+ RETURNING: '回退中'
53
56
  };
54
57
  //不能回填的组件type
55
58
  export var CANNOT_BACK_FILL = ['LOGISTICS_TRAJECTORY', 'LOGISTICS_TRAJECTORY_MORE', 'BUYER_MESSAGE_NOTICE', 'MSG_STATUS', 'NEW_PAYMENT_STATUS', 'REISSUE_STATUS', 'REISSUE_LOGISTICS', 'RETURN_GOODS_STATUS', 'RETURN_GOODS_TRADE_ID', 'ADJUST_WORK_ORDER_STATUS', 'INVOICE_STATUS', 'INVOICING_STATUS', 'EXCHANGE_STATUS', 'WAREHOUSING_STATUS', 'EXCHANGE_TRADE_ID', 'REISSUE_TRADE_ID', 'LOGISTICS_INTERCEPTION', 'LOGISTICS_INTERCEPTION_MORE'];
@@ -136,7 +139,7 @@ export var submitParams = function submitParams(_ref) {
136
139
  delete params.workOrderUpdateKeyVos;
137
140
  delete params.needTransForm;
138
141
  } else {
139
- var _Object$keys, _currentNodeDetail$wo7, _currentNodeDetail$wo8, _currentNodeDetail$wo9, _currentNodeDetail$wo10, _currentNodeDetail$wo11, _currentNodeDetail$wo12, _currentNodeDetail$wo13, _currentNodeDetail$wo14, _currentNodeDetail$wo15, _currentNodeDetail$wo16, _currentNodeDetail$wo17, _currentNodeDetail$wo18, _currentNodeDetail$wo19, _currentNodeDetail$wo20;
142
+ var _Object$keys, _currentNodeDetail$wo7, _currentNodeDetail$wo8, _currentNodeDetail$wo9, _currentNodeDetail$wo10, _currentNodeDetail$wo11, _currentNodeDetail$wo12, _currentNodeDetail$wo13, _currentNodeDetail$wo14, _currentNodeDetail$wo15, _currentNodeDetail$wo16, _currentNodeDetail$wo17;
140
143
  // TODO: 新保存工单
141
144
  // 获取当前表单中非空字段
142
145
  var finalComponentList = (_Object$keys = Object.keys(formData)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.filter(function (i) {
@@ -168,22 +171,26 @@ export var submitParams = function submitParams(_ref) {
168
171
  })) === null || _currentNodeDetail$wo16 === void 0 ? void 0 : _currentNodeDetail$wo16.uniqueKey;
169
172
 
170
173
  // 判断是否有买家昵称或者
171
- var buyerNickUniqueKey = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo17 = currentNodeDetail.workOrderTemplateInfo) === null || _currentNodeDetail$wo17 === void 0 ? void 0 : (_currentNodeDetail$wo18 = _currentNodeDetail$wo17.componentDtoList) === null || _currentNodeDetail$wo18 === void 0 ? void 0 : (_currentNodeDetail$wo19 = _currentNodeDetail$wo18.find(function (item) {
172
- return item.workOrderComponentType === 'BUYER_NICK_INPUT';
173
- })) === null || _currentNodeDetail$wo19 === void 0 ? void 0 : _currentNodeDetail$wo19.uniqueKey;
174
+ // const buyerNickUniqueKey = currentNodeDetail?.workOrderTemplateInfo?.componentDtoList?.find(
175
+ // (item: any) => item.workOrderComponentType === 'BUYER_NICK_INPUT',
176
+ // )?.uniqueKey;
174
177
  if (paymentTradeIdUniqueKey) {
175
- var _formData, _formData2;
178
+ var _formData;
176
179
  params.workOrder.tid = formData === null || formData === void 0 ? void 0 : (_formData = formData["".concat(paymentTradeIdUniqueKey)]) === null || _formData === void 0 ? void 0 : _formData.enterprisePaymentTid;
177
- params.workOrder.buyerOpenUid = formData === null || formData === void 0 ? void 0 : (_formData2 = formData["".concat(paymentTradeIdUniqueKey)]) === null || _formData2 === void 0 ? void 0 : _formData2.enterprisePaymentBuyerOpenUid;
180
+ // params.workOrder.buyerOpenUid =
181
+ // formData?.[`${paymentTradeIdUniqueKey}`]?.enterprisePaymentBuyerOpenUid;
178
182
  }
183
+
179
184
  if (tradeIdUniqueKey) {
180
185
  params.workOrder.tid = formData === null || formData === void 0 ? void 0 : formData[tradeIdUniqueKey];
181
186
  }
182
- if (buyerNickUniqueKey) {
183
- var _formData$buyerNickUn;
184
- params.workOrder.buyerOpenUid = formData === null || formData === void 0 ? void 0 : (_formData$buyerNickUn = formData[buyerNickUniqueKey]) === null || _formData$buyerNickUn === void 0 ? void 0 : _formData$buyerNickUn.buyerOpenUid;
187
+ // if (buyerNickUniqueKey) {
188
+ // params.workOrder.buyerOpenUid = formData?.[buyerNickUniqueKey]?.buyerOpenUid;
189
+ // }
190
+ if (formData !== null && formData !== void 0 && formData['fixed_field_buyerOpenUid']) {
191
+ params.workOrder.buyerOpenUid = formData === null || formData === void 0 ? void 0 : formData['fixed_field_buyerOpenUid'];
185
192
  }
186
- params.workOrder.workOrderComponents = submitDataTransOldFormat(formData, newTemplateDetail, !!(currentNodeDetail !== null && currentNodeDetail !== void 0 && (_currentNodeDetail$wo20 = currentNodeDetail.workOrder) !== null && _currentNodeDetail$wo20 !== void 0 && _currentNodeDetail$wo20.id), currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrder, params.workOrder, (plat === null || plat === void 0 ? void 0 : plat.accountName) || '');
193
+ params.workOrder.workOrderComponents = submitDataTransOldFormat(formData, newTemplateDetail, !!(currentNodeDetail !== null && currentNodeDetail !== void 0 && (_currentNodeDetail$wo17 = currentNodeDetail.workOrder) !== null && _currentNodeDetail$wo17 !== void 0 && _currentNodeDetail$wo17.id), currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrder, params.workOrder, (plat === null || plat === void 0 ? void 0 : plat.accountName) || '');
187
194
  //端上有买家id 就返填当前买家 即使不是当前买家的订单
188
195
  if (plat.platform !== PlatForm.PC && plat !== null && plat !== void 0 && plat.buyerId) {
189
196
  params.workOrder.buyerOpenUid = plat === null || plat === void 0 ? void 0 : plat.buyerId;
@@ -10,7 +10,7 @@ var getActionMap = function getActionMap(nodeStatus, hasPreNode, flowType) {
10
10
  return flowType === FlowType.SINGLE_PAGE ? ['save', 'forward', 'close', 'stop', 'submit'] : ['forward', 'save', 'submit', 'close', 'stop'];
11
11
  } else if (nodeStatus === FlowStatus.STOPPING) {
12
12
  return ['open', 'close'];
13
- } else if (nodeStatus === FlowStatus.CLOSE || nodeStatus === FlowStatus.COMPLETED) {
13
+ } else if ([FlowStatus.CLOSE, FlowStatus.COMPLETED, FlowStatus.RETURNING, FlowStatus.FLOWING].includes(nodeStatus)) {
14
14
  return [];
15
15
  } else {
16
16
  return ['save', 'submit'];
@@ -22,7 +22,7 @@ import { message } from 'antd';
22
22
  import { useMemoizedFn } from 'ahooks';
23
23
  import { calcWorkOrderList } from "../../../common/utils/tools";
24
24
  import { FlowStatus, NodeType, NodeStatus } from "../../../model/flowTemplateDetail/types";
25
- import { modifyWorkOrder } from "../../../model/flowTemplateDetail/api";
25
+ import { modifyWorkOrder, restartAutoTask } from "../../../model/flowTemplateDetail/api";
26
26
  import Header from "../Header";
27
27
  import FormRender from "../FormRender";
28
28
  import RenderDetail from "../RenderDetail";
@@ -39,7 +39,7 @@ var formProps = {
39
39
  layout: 'vertical'
40
40
  };
41
41
  var CurrentNode = function CurrentNode(props, ref) {
42
- var _currentNodeDetail$no, _currentNodeDetail$no2, _currentNodeDetail$no3, _currentNodeDetail$no4, _currentNodeDetail$no16, _currentNodeDetail$wo10, _currentNodeDetail$wo11, _currentNodeDetail$wo12, _currentNodeDetail$wo13, _currentNodeDetail$wo14, _currentNodeDetail$wo15, _currentNodeDetail$wo16, _currentNodeDetail$wo17, _currentNodeDetail$wo18, _currentNodeDetail$wo19, _currentNodeDetail$no18, _currentNodeDetail$no19, _currentNodeDetail$wo20;
42
+ var _currentNodeDetail$no, _currentNodeDetail$no2, _currentNodeDetail$no3, _currentNodeDetail$no4, _currentNodeDetail$no16, _currentNodeDetail$wo12, _currentNodeDetail$wo13, _currentNodeDetail$wo14, _currentNodeDetail$wo15, _currentNodeDetail$wo16, _currentNodeDetail$wo17, _currentNodeDetail$wo18, _currentNodeDetail$wo19, _currentNodeDetail$wo20, _currentNodeDetail$wo21, _currentNodeDetail$no19, _currentNodeDetail$no20, _currentNodeDetail$no21, _currentNodeDetail$wo22;
43
43
  var formRenderRef = useRef(null);
44
44
  useImperativeHandle(ref, function () {
45
45
  return {
@@ -233,38 +233,84 @@ var CurrentNode = function CurrentNode(props, ref) {
233
233
  return _ref.apply(this, arguments);
234
234
  };
235
235
  }();
236
+ var handleRestartAutoTask = /*#__PURE__*/function () {
237
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
238
+ var _currentNodeDetail$wo10, _currentNodeDetail$wo11, _currentNodeDetail$no18;
239
+ var _yield$restartAutoTas, success, _controllerRef$curren2;
240
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
241
+ while (1) switch (_context2.prev = _context2.next) {
242
+ case 0:
243
+ _context2.next = 2;
244
+ return restartAutoTask({
245
+ operateParams: _objectSpread(_objectSpread({}, operateParams), {}, {
246
+ flowTemplateId: flowTemplateId,
247
+ flowWorkOrderId: flowWorkOrderId,
248
+ workOrderId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo10 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo10 === void 0 ? void 0 : _currentNodeDetail$wo10.id,
249
+ workOrderUpdateTime: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo11 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo11 === void 0 ? void 0 : _currentNodeDetail$wo11.update,
250
+ nodeId: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no18 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no18 === void 0 ? void 0 : _currentNodeDetail$no18.id) || ''
251
+ })
252
+ });
253
+ case 2:
254
+ _yield$restartAutoTas = _context2.sent;
255
+ success = _yield$restartAutoTas.success;
256
+ if (success) {
257
+ message.success('重试成功');
258
+ queryRemarkList();
259
+ dispatch(fetchPanelInfo({
260
+ flowTemplateKey: operateParams === null || operateParams === void 0 ? void 0 : operateParams.flowTemplateKey,
261
+ flowWorkOrderId: flowWorkOrderId
262
+ }, {
263
+ signal: controllerRef === null || controllerRef === void 0 ? void 0 : (_controllerRef$curren2 = controllerRef.current) === null || _controllerRef$curren2 === void 0 ? void 0 : _controllerRef$curren2.signal
264
+ }));
265
+ }
266
+ case 5:
267
+ case "end":
268
+ return _context2.stop();
269
+ }
270
+ }, _callee2);
271
+ }));
272
+ return function handleRestartAutoTask() {
273
+ return _ref2.apply(this, arguments);
274
+ };
275
+ }();
236
276
  var isArtificialNode = tag === 'artificial';
237
- var showEdit = isArtificialNode && isCurrentNodeHandler && !readonly && (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo10 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo10 === void 0 ? void 0 : _currentNodeDetail$wo10.flowStatus) === FlowStatus.COMPLETED;
277
+ var showEdit = isArtificialNode && isCurrentNodeHandler && !readonly && (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo12 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo12 === void 0 ? void 0 : _currentNodeDetail$wo12.flowStatus) === FlowStatus.COMPLETED;
278
+ var showRestartAutoTask = tag === 'auto' && flowStatus === FlowStatus.PROCESSING;
238
279
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Header, {
239
280
  tag: tag,
240
281
  nodeName: nodeName,
241
282
  showEdit: showEdit,
242
283
  showLook: false,
243
- handler: isArtificialNode ? (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo11 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo11 === void 0 ? void 0 : _currentNodeDetail$wo11.completedUserName) || (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo12 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo12 === void 0 ? void 0 : (_currentNodeDetail$wo13 = _currentNodeDetail$wo12.handlerList) === null || _currentNodeDetail$wo13 === void 0 ? void 0 : (_currentNodeDetail$wo14 = _currentNodeDetail$wo13[0]) === null || _currentNodeDetail$wo14 === void 0 ? void 0 : _currentNodeDetail$wo14.account) : '',
244
- showWithdraw: isArtificialNode && (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo15 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo15 === void 0 ? void 0 : _currentNodeDetail$wo15.flowStatus) === FlowStatus.COMPLETED && isCurrentNodeHandler && !readonly,
245
- showReminder: isArtificialNode && [NodeStatus.WAITING, NodeStatus.STOPPING].includes(currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo16 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo16 === void 0 ? void 0 : _currentNodeDetail$wo16.flowStatus) && isCurrentNodeHandler && !readonly,
246
- isReminder: JSON.parse((currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo17 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo17 === void 0 ? void 0 : (_currentNodeDetail$wo18 = _currentNodeDetail$wo17.jsonMap) === null || _currentNodeDetail$wo18 === void 0 ? void 0 : _currentNodeDetail$wo18.flowTags) || '[]').includes('REMINDER'),
284
+ showRestartAutoTask: showRestartAutoTask,
285
+ handler: isArtificialNode ? (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo13 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo13 === void 0 ? void 0 : _currentNodeDetail$wo13.completedUserName) || (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo14 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo14 === void 0 ? void 0 : (_currentNodeDetail$wo15 = _currentNodeDetail$wo14.handlerList) === null || _currentNodeDetail$wo15 === void 0 ? void 0 : (_currentNodeDetail$wo16 = _currentNodeDetail$wo15[0]) === null || _currentNodeDetail$wo16 === void 0 ? void 0 : _currentNodeDetail$wo16.account) : '',
286
+ showWithdraw: isArtificialNode && (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo17 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo17 === void 0 ? void 0 : _currentNodeDetail$wo17.flowStatus) === FlowStatus.COMPLETED && isCurrentNodeHandler && !readonly,
287
+ 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) && isCurrentNodeHandler && !readonly,
288
+ 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'),
247
289
  handleWithdraw: handleWithdraw,
248
290
  handleReminder: onReminder,
249
291
  editing: editing,
250
292
  handleEdit: handleEdit,
251
293
  handleSave: handleSave,
252
- handleLabel: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo19 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo19 === void 0 ? void 0 : _currentNodeDetail$wo19.flowStatus) === FlowStatus.COMPLETED ? '完成人' : '处理人'
294
+ handleLabel: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo21 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo21 === void 0 ? void 0 : _currentNodeDetail$wo21.flowStatus) === FlowStatus.COMPLETED ? '完成人' : '处理人',
295
+ handleRestartAutoTask: handleRestartAutoTask,
296
+ flowTemplateKey: (operateParams === null || operateParams === void 0 ? void 0 : operateParams.flowTemplateKey) || '',
297
+ flowWorkOrderId: flowWorkOrderId || '',
298
+ nodeId: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no19 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no19 === void 0 ? void 0 : _currentNodeDetail$no19.id) || ''
253
299
  }), /*#__PURE__*/React.createElement("div", {
254
300
  className: styles.formRenderContainer
255
- }, [NodeType.START_NODE, NodeType.EXECUTE_NODE].includes(currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no18 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no18 === void 0 ? void 0 : _currentNodeDetail$no18.nodeType) && (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrderTemplateInfo) && (flowStatus === FlowStatus.COMPLETED && !editing ? /*#__PURE__*/React.createElement(RenderDetail, {
301
+ }, [NodeType.START_NODE, NodeType.EXECUTE_NODE].includes(currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no20 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no20 === void 0 ? void 0 : _currentNodeDetail$no20.nodeType) && (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrderTemplateInfo) && (flowStatus === FlowStatus.COMPLETED && !editing ? /*#__PURE__*/React.createElement(RenderDetail, {
256
302
  workOrderTemplateInfo: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrderTemplateInfo,
257
303
  transData: transData,
258
304
  platform: plat.platform,
259
305
  onOpenWangWang: onOpenWangWang
260
306
  }) : /*#__PURE__*/React.createElement(FormRender, {
261
307
  ref: formRenderRef,
262
- isShowShopList: NodeType.START_NODE === (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no19 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no19 === void 0 ? void 0 : _currentNodeDetail$no19.nodeType) && PlatForm.PC === plat.platform,
308
+ isShowShopList: NodeType.START_NODE === (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no21 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no21 === void 0 ? void 0 : _currentNodeDetail$no21.nodeType) && PlatForm.PC === plat.platform,
263
309
  plat: plat,
264
310
  templateDetail: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrderTemplateInfo,
265
311
  shopList: shopList,
266
312
  record: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrder,
267
- shopId: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo20 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo20 === void 0 ? void 0 : _currentNodeDetail$wo20.shopId) || plat.shopId || defaultShopId,
313
+ shopId: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo22 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo22 === void 0 ? void 0 : _currentNodeDetail$wo22.shopId) || plat.shopId || defaultShopId,
268
314
  accountName: plat === null || plat === void 0 ? void 0 : plat.accountName,
269
315
  onOpenWangWang: onOpenWangWang,
270
316
  onUpdateRemark: onUpdateRemark,
@@ -1166,6 +1166,9 @@ var FormRender = function FormRender(props, ref) {
1166
1166
  handleChangeShopId: handleChangeShopId,
1167
1167
  hidden: !isShowShopList,
1168
1168
  disabled: !!workOrderId || look
1169
+ }), /*#__PURE__*/React.createElement(Form.Item, {
1170
+ name: "fixed_field_buyerOpenUid",
1171
+ hidden: true
1169
1172
  }), finalFormItems));
1170
1173
  };
1171
1174
  export default /*#__PURE__*/forwardRef(FormRender);
@@ -6,18 +6,23 @@ interface HeaderProps {
6
6
  showEdit: boolean;
7
7
  showWithdraw: boolean;
8
8
  showReminder?: boolean;
9
+ showRestartAutoTask?: boolean;
9
10
  handleLook?: () => void;
10
11
  handleSave?: () => void;
11
12
  handleEdit?: () => void;
12
13
  handlePackUp?: () => void;
13
14
  handleWithdraw?: () => void;
14
15
  handleReminder?: (type: string) => void;
16
+ handleRestartAutoTask?: () => void;
15
17
  loading?: boolean;
16
18
  editing?: boolean;
17
19
  opening?: boolean;
18
20
  handler?: string;
19
21
  isReminder?: string;
20
22
  handleLabel?: string;
23
+ flowTemplateKey: string;
24
+ nodeId: string;
25
+ flowWorkOrderId: string;
21
26
  }
22
27
  declare const Header: (props: HeaderProps) => React.JSX.Element;
23
28
  export default Header;
@@ -1,10 +1,35 @@
1
- import React from 'react';
2
- import { Button, Spin, Tooltip, Typography } from 'antd';
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
+ 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; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import React, { useState } from 'react';
8
+ import { Button, Spin, Tooltip, Typography, Space, Modal, Table } from 'antd';
9
+ import moment from 'moment';
10
+ import { useRequest } from 'ahooks';
11
+ import { queryFlowFail } from "../../../model/flowTemplateDetail/api";
3
12
  import { NODE_TYPE } from "../../../common/constant";
4
13
  import styles from "./index.module.less";
5
14
  var Text = Typography.Text;
15
+ var columns = [{
16
+ title: '创建时间',
17
+ dataIndex: 'created',
18
+ width: '200px',
19
+ render: function render(val) {
20
+ return moment(val).format('YYYY-MM-DD HH:mm:ss');
21
+ }
22
+ }, {
23
+ title: '处理人',
24
+ dataIndex: 'lastManualOperatorName',
25
+ width: '100px'
26
+ }, {
27
+ title: '失败原因',
28
+ dataIndex: 'cancelReason',
29
+ width: '550px'
30
+ }];
6
31
  var Header = function Header(props) {
7
- var _NODE_TYPE$tag, _NODE_TYPE$tag2;
32
+ var _NODE_TYPE$tag, _NODE_TYPE$tag2, _data$data;
8
33
  var tag = props.tag,
9
34
  nodeName = props.nodeName,
10
35
  showLook = props.showLook,
@@ -25,10 +50,39 @@ var Header = function Header(props) {
25
50
  showWithdraw = _props$showWithdraw === void 0 ? false : _props$showWithdraw,
26
51
  _props$showReminder = props.showReminder,
27
52
  showReminder = _props$showReminder === void 0 ? false : _props$showReminder,
53
+ _props$showRestartAut = props.showRestartAutoTask,
54
+ showRestartAutoTask = _props$showRestartAut === void 0 ? false : _props$showRestartAut,
28
55
  handler = props.handler,
29
56
  isReminder = props.isReminder,
30
57
  _props$handleLabel = props.handleLabel,
31
- handleLabel = _props$handleLabel === void 0 ? '处理人' : _props$handleLabel;
58
+ handleLabel = _props$handleLabel === void 0 ? '处理人' : _props$handleLabel,
59
+ handleRestartAutoTask = props.handleRestartAutoTask,
60
+ flowTemplateKey = props.flowTemplateKey,
61
+ nodeId = props.nodeId,
62
+ flowWorkOrderId = props.flowWorkOrderId;
63
+ var _useState = useState(false),
64
+ _useState2 = _slicedToArray(_useState, 2),
65
+ visible = _useState2[0],
66
+ setVisible = _useState2[1];
67
+ var _useRequest = useRequest(function () {
68
+ return queryFlowFail({
69
+ flowTemplateKeys: [flowTemplateKey],
70
+ nodeIdList: [nodeId],
71
+ flowWorkOrderIdList: [flowWorkOrderId]
72
+ });
73
+ }, {
74
+ manual: true
75
+ }),
76
+ requestLoading = _useRequest.loading,
77
+ run = _useRequest.run,
78
+ data = _useRequest.data;
79
+ var handleLookAbnormal = function handleLookAbnormal() {
80
+ run();
81
+ setVisible(true);
82
+ };
83
+ var handleCancel = function handleCancel() {
84
+ setVisible(false);
85
+ };
32
86
  return /*#__PURE__*/React.createElement("div", {
33
87
  className: styles.wrap
34
88
  }, (NODE_TYPE === null || NODE_TYPE === void 0 ? void 0 : NODE_TYPE[tag]) && /*#__PURE__*/React.createElement("div", {
@@ -46,7 +100,17 @@ var Header = function Header(props) {
46
100
  }, /*#__PURE__*/React.createElement(Spin, {
47
101
  spinning: loading,
48
102
  size: "small"
49
- })), /*#__PURE__*/React.createElement("div", null, showWithdraw && /*#__PURE__*/React.createElement(Button, {
103
+ })), /*#__PURE__*/React.createElement("div", null, showRestartAutoTask && /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Button, {
104
+ type: "link",
105
+ onClick: handleLookAbnormal,
106
+ "data-spm-click": "\u5F02\u5E38\u65E5\u5FD7",
107
+ "data-spm-param": "\u5F02\u5E38\u65E5\u5FD7"
108
+ }, "\u5F02\u5E38\u65E5\u5FD7"), /*#__PURE__*/React.createElement(Button, {
109
+ type: "link",
110
+ onClick: handleRestartAutoTask,
111
+ "data-spm-click": "\u91CD\u8BD5",
112
+ "data-spm-param": "\u91CD\u8BD5"
113
+ }, "\u91CD\u8BD5")), showWithdraw && /*#__PURE__*/React.createElement(Button, {
50
114
  type: "link",
51
115
  onClick: handleWithdraw,
52
116
  "data-spm-click": "\u64A4\u56DE",
@@ -89,6 +153,20 @@ var Header = function Header(props) {
89
153
  },
90
154
  "data-spm-click": "\u53D6\u6D88\u50AC\u5355",
91
155
  "data-spm-param": "\u53D6\u6D88\u50AC\u5355"
92
- }, "\u53D6\u6D88")))));
156
+ }, "\u53D6\u6D88"))), /*#__PURE__*/React.createElement(Modal, {
157
+ title: "\u5F02\u5E38\u65E5\u5FD7",
158
+ onOk: handleCancel,
159
+ onCancel: handleCancel,
160
+ visible: visible
161
+ }, /*#__PURE__*/React.createElement(Table, {
162
+ columns: columns,
163
+ dataSource: (data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.list) || [],
164
+ loading: requestLoading,
165
+ pagination: false,
166
+ scroll: {
167
+ x: 850,
168
+ y: 300
169
+ }
170
+ }))));
93
171
  };
94
172
  export default Header;
@@ -14,6 +14,7 @@ interface NodeItem {
14
14
  readonly?: boolean;
15
15
  visibleType?: string;
16
16
  nodeIsAuto: boolean;
17
+ flowTemplateKey: string;
17
18
  }
18
19
  declare const NodeItem: (props: NodeItem) => React.JSX.Element;
19
20
  export default NodeItem;
@@ -51,7 +51,8 @@ var NodeItem = function NodeItem(props) {
51
51
  readonly = _props$readonly === void 0 ? false : _props$readonly,
52
52
  _props$visibleType = props.visibleType,
53
53
  visibleType = _props$visibleType === void 0 ? '' : _props$visibleType,
54
- nodeIsAuto = props.nodeIsAuto;
54
+ nodeIsAuto = props.nodeIsAuto,
55
+ flowTemplateKey = props.flowTemplateKey;
55
56
  var _useContext = useContext(Context),
56
57
  dispatch = _useContext.dispatch;
57
58
  var plat = useSelector(selectPlatInfo);
@@ -272,7 +273,10 @@ var NodeItem = function NodeItem(props) {
272
273
  handler: isArtificialNode ? handler : '',
273
274
  showWithdraw: showWithdraw,
274
275
  showReminder: false,
275
- handleLabel: '完成人'
276
+ handleLabel: '完成人',
277
+ flowTemplateKey: flowTemplateKey,
278
+ nodeId: nodeId,
279
+ flowWorkOrderId: flowWorkOrderId
276
280
  }), /*#__PURE__*/React.createElement("div", {
277
281
  style: {
278
282
  display: open ? 'block' : 'none',
@@ -9,11 +9,11 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
9
9
  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; } }
10
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
11
  import React, { useRef, useEffect, useState, useContext } from 'react';
12
- import { Modal, Form, Input, message, Select } from 'antd';
12
+ import { Modal, Form, Input, message, Select, Spin } from 'antd';
13
13
  import { ApaasUploadAsync } from '@kmkf-fe-packages/basic-components';
14
14
  import { queryIntersectionPreNodes } from "../../../model/flowTemplateDetail/api";
15
15
  import { useSelector } from "../../context/useSelector";
16
- import { selectCurrentAction } from "../../store/selector";
16
+ import { selectCurrentAction, selectRejectLoading } from "../../store/selector";
17
17
  import { Context } from "../../context";
18
18
  var TextArea = Input.TextArea;
19
19
  var RejectedModal = function RejectedModal(_ref) {
@@ -28,6 +28,7 @@ var RejectedModal = function RejectedModal(_ref) {
28
28
  preNods = _useState2[0],
29
29
  setPreNodes = _useState2[1];
30
30
  var action = useSelector(selectCurrentAction);
31
+ var rejectLoading = useSelector(selectRejectLoading);
31
32
  var _useContext = useContext(Context),
32
33
  dispatch = _useContext.dispatch;
33
34
  var imageRef = useRef();
@@ -109,7 +110,9 @@ var RejectedModal = function RejectedModal(_ref) {
109
110
  onCancel: closeModal,
110
111
  onOk: handleOk,
111
112
  destroyOnClose: true
112
- }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Form, {
113
+ }, /*#__PURE__*/React.createElement(Spin, {
114
+ spinning: rejectLoading
115
+ }, /*#__PURE__*/React.createElement(Form, {
113
116
  form: form,
114
117
  layout: "vertical"
115
118
  }, /*#__PURE__*/React.createElement(Form.Item, {
@@ -9,9 +9,9 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
9
9
  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; } }
10
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
11
  import React, { useRef, useContext } from 'react';
12
- import { Modal, Form, Input, message } from 'antd';
12
+ import { Modal, Form, Input, message, Spin } from 'antd';
13
13
  import { ApaasUploadAsync } from '@kmkf-fe-packages/basic-components';
14
- import { selectCurrentAction } from "../../store/selector";
14
+ import { selectCurrentAction, selectWithDrawLoading } from "../../store/selector";
15
15
  import { Context } from "../../context";
16
16
  import { useSelector } from "../../context/useSelector";
17
17
  var TextArea = Input.TextArea;
@@ -21,6 +21,7 @@ var WithdrawModal = function WithdrawModal(_ref) {
21
21
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
22
22
  form = _Form$useForm2[0];
23
23
  var action = useSelector(selectCurrentAction);
24
+ var withdrawLoading = useSelector(selectWithDrawLoading);
24
25
  var _useContext = useContext(Context),
25
26
  dispatch = _useContext.dispatch;
26
27
  var imageRef = useRef();
@@ -64,7 +65,9 @@ var WithdrawModal = function WithdrawModal(_ref) {
64
65
  visible: action === 'withdraw',
65
66
  onCancel: closeModal,
66
67
  onOk: handleOK
67
- }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
68
+ }, /*#__PURE__*/React.createElement(Spin, {
69
+ spinning: withdrawLoading
70
+ }, /*#__PURE__*/React.createElement("div", {
68
71
  style: {
69
72
  marginBottom: '16px'
70
73
  }
@@ -1,25 +1,5 @@
1
1
  import React from 'react';
2
- import { PlatFormInfo } from '../model/flowTemplateDetail/types';
3
2
  import './index.less';
4
- declare type FlowTemplateDetailProps = {
5
- flowTemplateKey: string;
6
- flowWorkOrderId?: string;
7
- plat: PlatFormInfo;
8
- shopList: any[];
9
- readonly?: boolean;
10
- privilege?: boolean;
11
- onOpenWangWang?: (nick: string, id: string) => void;
12
- callbackDealWorkOrderSuccess?: (type: string, workOrderId?: string) => void;
13
- onJumpMemoPage?: () => void;
14
- onTalkChange?: (data: {
15
- tid: string;
16
- shopId: string;
17
- }) => void;
18
- autoSubmit?: boolean;
19
- callbackAutoSubmitResult?: (result: {
20
- success: boolean;
21
- message?: string;
22
- }) => void;
23
- };
3
+ import { FlowTemplateDetailProps } from './type';
24
4
  declare const ProviderWrap: (props: FlowTemplateDetailProps) => React.JSX.Element;
25
5
  export default ProviderWrap;
@@ -52,6 +52,7 @@ import "./index.less";
52
52
  import { isNull } from '@kmkf-fe-packages/kmkf-utils';
53
53
  import { Provide, Context } from "./context";
54
54
  import { useSelector } from "./context/useSelector";
55
+ import { pollOperationResult } from "./pollOperationResult";
55
56
  var FlowTemplateDetail = function FlowTemplateDetail(props) {
56
57
  var _currentNodeDetail$wo, _currentNodeDetail$no, _currentNodeDetail$wo2, _shopList$find, _currentNodeDetail$no21, _currentNodeDetail$no22, _currentNodeDetail$no23, _currentNodeDetail$no24;
57
58
  var flowTemplateKey = props.flowTemplateKey,
@@ -227,7 +228,7 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
227
228
  // 保存
228
229
  var handleSave = /*#__PURE__*/function () {
229
230
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
230
- var _currentNodeDetail$wo4, update, formData, params, res, _controllerRef$curren, _currentNodeDetail$wo5;
231
+ var _currentNodeDetail$wo4, update, formData, params, res, _currentNodeDetail$wo5;
231
232
  return _regeneratorRuntime().wrap(function _callee$(_context) {
232
233
  while (1) switch (_context.prev = _context.next) {
233
234
  case 0:
@@ -274,12 +275,7 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
274
275
  if (res.success) {
275
276
  message.success('暂存成功');
276
277
  //保存
277
- dispatch(fetchPanelInfo({
278
- flowTemplateKey: flowTemplateKey,
279
- flowWorkOrderId: flowWorkOrderIdState
280
- }, {
281
- signal: controllerRef === null || controllerRef === void 0 ? void 0 : (_controllerRef$curren = controllerRef.current) === null || _controllerRef$curren === void 0 ? void 0 : _controllerRef$curren.signal
282
- }));
278
+ reFreshPanel();
283
279
  handleSuccessCallBack('save');
284
280
  if (res.data !== flowWorkOrderIdState) {
285
281
  setFlowWorkOrderIdState(res.data || '');
@@ -339,16 +335,10 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
339
335
  message.success('开启工单成功');
340
336
  handleSuccessCallBack('open');
341
337
  batch(function () {
342
- var _controllerRef$curren2;
343
338
  dispatch({
344
339
  type: 'setAction'
345
340
  });
346
- dispatch(fetchPanelInfo({
347
- flowTemplateKey: flowTemplateKey,
348
- flowWorkOrderId: flowWorkOrderIdState
349
- }, {
350
- signal: controllerRef === null || controllerRef === void 0 ? void 0 : (_controllerRef$curren2 = controllerRef.current) === null || _controllerRef$curren2 === void 0 ? void 0 : _controllerRef$curren2.signal
351
- }));
341
+ reFreshPanel();
352
342
  dispatch(fetchAllFlowOperateRecord({
353
343
  flowTemplateId: flowTemplateId,
354
344
  flowWorkOrderId: flowWorkOrderIdState
@@ -410,7 +400,7 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
410
400
  // 提交
411
401
  var handleSubmit = /*#__PURE__*/function () {
412
402
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
413
- var _currentNodeDetail$wo7, _currentNodeDetail$wo8, formData, _result, params, res, _currentNodeDetail$wo9, _controllerRef$curren3;
403
+ var _currentNodeDetail$wo7, _currentNodeDetail$wo8, formData, result, params, res, _currentNodeDetail$wo9;
414
404
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
415
405
  while (1) switch (_context4.prev = _context4.next) {
416
406
  case 0:
@@ -430,12 +420,12 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
430
420
  return form.validateFields();
431
421
  case 7:
432
422
  formData = _context4.sent;
433
- _result = verifyHandle(formData, (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo7 = currentNodeDetail.workOrderTemplateInfo) === null || _currentNodeDetail$wo7 === void 0 ? void 0 : _currentNodeDetail$wo7.componentDtoList) || []);
434
- if (_result.success) {
423
+ result = verifyHandle(formData, (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo7 = currentNodeDetail.workOrderTemplateInfo) === null || _currentNodeDetail$wo7 === void 0 ? void 0 : _currentNodeDetail$wo7.componentDtoList) || []);
424
+ if (result.success) {
435
425
  _context4.next = 13;
436
426
  break;
437
427
  }
438
- message.error(_result.message);
428
+ message.error(result.message);
439
429
  submitRequestUnlock();
440
430
  return _context4.abrupt("return");
441
431
  case 13:
@@ -479,12 +469,7 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
479
469
  unDeleteOrderInfo: false
480
470
  });
481
471
  if (!autoSubmit) {
482
- dispatch(fetchPanelInfo({
483
- flowTemplateKey: flowTemplateKey,
484
- flowWorkOrderId: flowWorkOrderIdState
485
- }, {
486
- signal: controllerRef === null || controllerRef === void 0 ? void 0 : (_controllerRef$curren3 = controllerRef.current) === null || _controllerRef$curren3 === void 0 ? void 0 : _controllerRef$curren3.signal
487
- }));
472
+ reFreshPanel();
488
473
  message.success('提交成功');
489
474
  }
490
475
  }
@@ -659,17 +644,11 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
659
644
  message.success('暂停工单成功');
660
645
  handleSuccessCallBack('stop');
661
646
  batch(function () {
662
- var _controllerRef$curren4;
663
647
  dispatch({
664
648
  type: 'setAction'
665
649
  });
666
650
  // TODO: 暂停之后,重新查询一次
667
- dispatch(fetchPanelInfo({
668
- flowTemplateKey: flowTemplateKey,
669
- flowWorkOrderId: flowWorkOrderIdState
670
- }, {
671
- signal: controllerRef === null || controllerRef === void 0 ? void 0 : (_controllerRef$curren4 = controllerRef.current) === null || _controllerRef$curren4 === void 0 ? void 0 : _controllerRef$curren4.signal
672
- }));
651
+ reFreshPanel();
673
652
  dispatch(fetchAllFlowOperateRecord({
674
653
  flowTemplateId: flowTemplateId,
675
654
  flowWorkOrderId: flowWorkOrderIdState
@@ -718,13 +697,7 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
718
697
  handleSuccessCallBack('close');
719
698
  message.success('关闭工单成功');
720
699
  batch(function () {
721
- var _controllerRef$curren5;
722
- dispatch(fetchPanelInfo({
723
- flowTemplateKey: flowTemplateKey,
724
- flowWorkOrderId: flowWorkOrderIdState
725
- }, {
726
- signal: controllerRef === null || controllerRef === void 0 ? void 0 : (_controllerRef$curren5 = controllerRef.current) === null || _controllerRef$curren5 === void 0 ? void 0 : _controllerRef$curren5.signal
727
- }));
700
+ reFreshPanel();
728
701
  dispatch({
729
702
  type: 'setAction'
730
703
  });
@@ -771,13 +744,7 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
771
744
  handleSuccessCallBack('forward');
772
745
  message.success('转交成功');
773
746
  batch(function () {
774
- var _controllerRef$curren6;
775
- dispatch(fetchPanelInfo({
776
- flowTemplateKey: flowTemplateKey,
777
- flowWorkOrderId: flowWorkOrderIdState
778
- }, {
779
- signal: controllerRef === null || controllerRef === void 0 ? void 0 : (_controllerRef$curren6 = controllerRef.current) === null || _controllerRef$curren6 === void 0 ? void 0 : _controllerRef$curren6.signal
780
- }));
747
+ reFreshPanel();
781
748
  dispatch({
782
749
  type: 'setAction'
783
750
  });
@@ -801,15 +768,48 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
801
768
  return _ref8.apply(this, arguments);
802
769
  };
803
770
  }();
771
+
804
772
  // 驳回
805
773
  var handleReturnWorkOrder = /*#__PURE__*/function () {
806
774
  var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(formData) {
807
- var _currentNodeDetail$no7, _currentNodeDetail$wo15, _res$data12, _res$data12$failList, res, _res$data13, _res$data13$failList, _res$data13$failList$;
775
+ var handleFail, handleSuccess, handleTimeOut, _currentNodeDetail$no7, _currentNodeDetail$wo15, res, _res$data$failList$0$, _res$data12, _res$data12$failList, _res$data12$failList$;
808
776
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
809
777
  while (1) switch (_context9.prev = _context9.next) {
810
778
  case 0:
811
- _context9.prev = 0;
812
- _context9.next = 3;
779
+ handleFail = function handleFail(failReason) {
780
+ message.error(failReason);
781
+ dispatch({
782
+ type: 'setRejectLoading',
783
+ payload: false
784
+ });
785
+ };
786
+ handleSuccess = function handleSuccess() {
787
+ handleSuccessCallBack('rejected');
788
+ message.success('驳回成功');
789
+ batch(function () {
790
+ reFreshPanel();
791
+ dispatch({
792
+ type: 'setAction'
793
+ });
794
+ dispatch({
795
+ type: 'setRejectLoading',
796
+ payload: false
797
+ });
798
+ });
799
+ };
800
+ handleTimeOut = function handleTimeOut() {
801
+ message.error("接口响应超时");
802
+ dispatch({
803
+ type: 'setRejectLoading',
804
+ payload: false
805
+ });
806
+ };
807
+ _context9.prev = 3;
808
+ dispatch({
809
+ type: 'setRejectLoading',
810
+ payload: true
811
+ });
812
+ _context9.next = 7;
813
813
  return returnWorkOrder(_objectSpread(_objectSpread({}, formData), {}, {
814
814
  operateParams: _objectSpread(_objectSpread({}, operateParams), {}, {
815
815
  nodeId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no7 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no7 === void 0 ? void 0 : _currentNodeDetail$no7.id,
@@ -818,37 +818,41 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
818
818
  workOrderId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo15 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo15 === void 0 ? void 0 : _currentNodeDetail$wo15.id
819
819
  })
820
820
  }));
821
- case 3:
821
+ case 7:
822
822
  res = _context9.sent;
823
- if (((_res$data12 = res.data) === null || _res$data12 === void 0 ? void 0 : (_res$data12$failList = _res$data12.failList) === null || _res$data12$failList === void 0 ? void 0 : _res$data12$failList.length) === 0) {
824
- handleSuccessCallBack('rejected');
825
- message.success('驳回成功');
826
- batch(function () {
827
- var _controllerRef$curren7;
828
- dispatch(fetchPanelInfo({
829
- flowTemplateKey: flowTemplateKey,
830
- flowWorkOrderId: flowWorkOrderIdState
831
- }, {
832
- signal: controllerRef === null || controllerRef === void 0 ? void 0 : (_controllerRef$curren7 = controllerRef.current) === null || _controllerRef$curren7 === void 0 ? void 0 : _controllerRef$curren7.signal
833
- }));
834
- dispatch({
835
- type: 'setAction'
836
- });
837
- });
823
+ if (!(get(res, 'data.failList.length', 0) > 0)) {
824
+ _context9.next = 10;
825
+ break;
826
+ }
827
+ return _context9.abrupt("return", handleFail((_res$data$failList$0$ = (_res$data12 = res.data) === null || _res$data12 === void 0 ? void 0 : (_res$data12$failList = _res$data12.failList) === null || _res$data12$failList === void 0 ? void 0 : (_res$data12$failList$ = _res$data12$failList[0]) === null || _res$data12$failList$ === void 0 ? void 0 : _res$data12$failList$.failReason) !== null && _res$data$failList$0$ !== void 0 ? _res$data$failList$0$ : ''));
828
+ case 10:
829
+ // 没有错误,也没有处理中任务,我们认为任务成功了
830
+ if (get(res, 'data.processingList.length') === 0) {
831
+ handleSuccess();
838
832
  } else {
839
- message.error((_res$data13 = res.data) === null || _res$data13 === void 0 ? void 0 : (_res$data13$failList = _res$data13.failList) === null || _res$data13$failList === void 0 ? void 0 : (_res$data13$failList$ = _res$data13$failList[0]) === null || _res$data13$failList$ === void 0 ? void 0 : _res$data13$failList$.failReason);
833
+ pollOperationResult({
834
+ processingList: get(res, 'data.processingList', []),
835
+ maxAttempts: 60,
836
+ handleSuccess: handleSuccess,
837
+ handleFail: handleFail,
838
+ handleTimeOut: handleTimeOut
839
+ });
840
840
  }
841
- _context9.next = 10;
841
+ _context9.next = 17;
842
842
  break;
843
- case 7:
844
- _context9.prev = 7;
845
- _context9.t0 = _context9["catch"](0);
843
+ case 13:
844
+ _context9.prev = 13;
845
+ _context9.t0 = _context9["catch"](3);
846
846
  console.log('驳回失败', _context9.t0);
847
- case 10:
847
+ dispatch({
848
+ type: 'setRejectLoading',
849
+ payload: false
850
+ });
851
+ case 17:
848
852
  case "end":
849
853
  return _context9.stop();
850
854
  }
851
- }, _callee9, null, [[0, 7]]);
855
+ }, _callee9, null, [[3, 13]]);
852
856
  }));
853
857
  return function handleReturnWorkOrder(_x6) {
854
858
  return _ref9.apply(this, arguments);
@@ -857,12 +861,44 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
857
861
  // 撤回
858
862
  var handleWithdraw = /*#__PURE__*/function () {
859
863
  var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(formData) {
860
- var _currentNodeDetail$no8, _currentNodeDetail$wo16, _res$data14, _res$data14$failList, res, _res$data15, _res$data15$failList, _res$data15$failList$;
864
+ var handleFail, handleSuccess, handleTimeOut, _currentNodeDetail$no8, _currentNodeDetail$wo16, res, _res$data$failList$0$2, _res$data13, _res$data13$failList, _res$data13$failList$;
861
865
  return _regeneratorRuntime().wrap(function _callee10$(_context10) {
862
866
  while (1) switch (_context10.prev = _context10.next) {
863
867
  case 0:
864
- _context10.prev = 0;
865
- _context10.next = 3;
868
+ handleFail = function handleFail(failReason) {
869
+ message.error(failReason);
870
+ dispatch({
871
+ type: 'setWithDrawLoading',
872
+ payload: false
873
+ });
874
+ };
875
+ handleSuccess = function handleSuccess() {
876
+ handleSuccessCallBack('withdraw');
877
+ message.success('撤回成功');
878
+ batch(function () {
879
+ reFreshPanel();
880
+ dispatch({
881
+ type: 'setAction'
882
+ });
883
+ dispatch({
884
+ type: 'setWithDrawLoading',
885
+ payload: false
886
+ });
887
+ });
888
+ };
889
+ handleTimeOut = function handleTimeOut() {
890
+ message.error("接口响应超时");
891
+ dispatch({
892
+ type: 'setWithDrawLoading',
893
+ payload: false
894
+ });
895
+ };
896
+ _context10.prev = 3;
897
+ dispatch({
898
+ type: 'setWithDrawLoading',
899
+ payload: true
900
+ });
901
+ _context10.next = 7;
866
902
  return withDrawWorkOrder(_objectSpread(_objectSpread({}, formData), {}, {
867
903
  backToNodeId: withdrawWorkOrderDetail === null || withdrawWorkOrderDetail === void 0 ? void 0 : withdrawWorkOrderDetail.nodeId,
868
904
  operateParams: _objectSpread(_objectSpread({}, operateParams), {}, {
@@ -872,41 +908,41 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
872
908
  workOrderId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo16 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo16 === void 0 ? void 0 : _currentNodeDetail$wo16.id
873
909
  })
874
910
  }));
875
- case 3:
911
+ case 7:
876
912
  res = _context10.sent;
877
- if (((_res$data14 = res.data) === null || _res$data14 === void 0 ? void 0 : (_res$data14$failList = _res$data14.failList) === null || _res$data14$failList === void 0 ? void 0 : _res$data14$failList.length) === 0) {
878
- handleSuccessCallBack('withdraw');
879
- message.success('撤回成功');
880
- batch(function () {
881
- var _controllerRef$curren8;
882
- dispatch(fetchPanelInfo({
883
- flowTemplateKey: flowTemplateKey,
884
- flowWorkOrderId: flowWorkOrderIdState
885
- }, {
886
- signal: controllerRef === null || controllerRef === void 0 ? void 0 : (_controllerRef$curren8 = controllerRef.current) === null || _controllerRef$curren8 === void 0 ? void 0 : _controllerRef$curren8.signal
887
- }));
888
- dispatch(fetchAllFlowOperateRecord({
889
- flowTemplateId: flowTemplateId,
890
- flowWorkOrderId: flowWorkOrderIdState
891
- }));
892
- dispatch({
893
- type: 'setAction'
894
- });
895
- });
913
+ if (!(get(res, 'data.failList.length', 0) > 0)) {
914
+ _context10.next = 10;
915
+ break;
916
+ }
917
+ return _context10.abrupt("return", handleFail((_res$data$failList$0$2 = (_res$data13 = res.data) === null || _res$data13 === void 0 ? void 0 : (_res$data13$failList = _res$data13.failList) === null || _res$data13$failList === void 0 ? void 0 : (_res$data13$failList$ = _res$data13$failList[0]) === null || _res$data13$failList$ === void 0 ? void 0 : _res$data13$failList$.failReason) !== null && _res$data$failList$0$2 !== void 0 ? _res$data$failList$0$2 : ''));
918
+ case 10:
919
+ // 没有错误,也没有处理中任务,我们认为任务成功了
920
+ if (get(res, 'data.processingList.length') === 0) {
921
+ handleSuccess();
896
922
  } else {
897
- message.error((_res$data15 = res.data) === null || _res$data15 === void 0 ? void 0 : (_res$data15$failList = _res$data15.failList) === null || _res$data15$failList === void 0 ? void 0 : (_res$data15$failList$ = _res$data15$failList[0]) === null || _res$data15$failList$ === void 0 ? void 0 : _res$data15$failList$.failReason);
923
+ pollOperationResult({
924
+ processingList: get(res, 'data.processingList', []),
925
+ maxAttempts: 60,
926
+ handleSuccess: handleSuccess,
927
+ handleFail: handleFail,
928
+ handleTimeOut: handleTimeOut
929
+ });
898
930
  }
899
- _context10.next = 10;
931
+ _context10.next = 17;
900
932
  break;
901
- case 7:
902
- _context10.prev = 7;
903
- _context10.t0 = _context10["catch"](0);
933
+ case 13:
934
+ _context10.prev = 13;
935
+ _context10.t0 = _context10["catch"](3);
904
936
  console.log('撤回成功', _context10.t0);
905
- case 10:
937
+ dispatch({
938
+ type: 'setWithDrawLoading',
939
+ payload: false
940
+ });
941
+ case 17:
906
942
  case "end":
907
943
  return _context10.stop();
908
944
  }
909
- }, _callee10, null, [[0, 7]]);
945
+ }, _callee10, null, [[3, 13]]);
910
946
  }));
911
947
  return function handleWithdraw(_x7) {
912
948
  return _ref10.apply(this, arguments);
@@ -961,13 +997,7 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
961
997
  handleSuccessCallBack(type);
962
998
  message.success(type === 'reminder' ? '催单成功' : '取消催单成功');
963
999
  batch(function () {
964
- var _controllerRef$curren9;
965
- dispatch(fetchPanelInfo({
966
- flowTemplateKey: flowTemplateKey,
967
- flowWorkOrderId: flowWorkOrderIdState
968
- }, {
969
- signal: controllerRef === null || controllerRef === void 0 ? void 0 : (_controllerRef$curren9 = controllerRef.current) === null || _controllerRef$curren9 === void 0 ? void 0 : _controllerRef$curren9.signal
970
- }));
1000
+ reFreshPanel();
971
1001
  dispatch(fetchAllFlowOperateRecord({
972
1002
  flowTemplateId: flowTemplateId,
973
1003
  flowWorkOrderId: flowWorkOrderIdState
@@ -1022,13 +1052,7 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
1022
1052
  };
1023
1053
  useEffect(function () {
1024
1054
  if (flowTemplateKey) {
1025
- var _controllerRef$curren10;
1026
- dispatch(fetchPanelInfo({
1027
- flowTemplateKey: flowTemplateKey,
1028
- flowWorkOrderId: flowWorkOrderIdState
1029
- }, {
1030
- signal: controllerRef === null || controllerRef === void 0 ? void 0 : (_controllerRef$curren10 = controllerRef.current) === null || _controllerRef$curren10 === void 0 ? void 0 : _controllerRef$curren10.signal
1031
- }));
1055
+ reFreshPanel();
1032
1056
  }
1033
1057
  }, [flowTemplateKey, flowWorkOrderIdState]);
1034
1058
  useEffect(function () {
@@ -1127,6 +1151,15 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
1127
1151
  onOpenWangWang: onOpenWangWang
1128
1152
  }));
1129
1153
  };
1154
+ var reFreshPanel = function reFreshPanel() {
1155
+ var _controllerRef$curren;
1156
+ dispatch(fetchPanelInfo({
1157
+ flowTemplateKey: flowTemplateKey,
1158
+ flowWorkOrderId: flowWorkOrderIdState
1159
+ }, {
1160
+ signal: controllerRef === null || controllerRef === void 0 ? void 0 : (_controllerRef$curren = controllerRef.current) === null || _controllerRef$curren === void 0 ? void 0 : _controllerRef$curren.signal
1161
+ }));
1162
+ };
1130
1163
  return /*#__PURE__*/React.createElement(Spin, {
1131
1164
  spinning: loading
1132
1165
  }, /*#__PURE__*/React.createElement("div", {
@@ -1138,7 +1171,10 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
1138
1171
  className: "statusWrap"
1139
1172
  }, "\u6D41\u7A0B\u72B6\u6001\uFF1A", /*#__PURE__*/React.createElement("div", {
1140
1173
  className: "status ".concat(flowStatus)
1141
- }), /*#__PURE__*/React.createElement("span", null, FLOW_STATUS_V2[flowStatus]))), flowTemplateType !== 'SINGLE_PAGE' && /*#__PURE__*/React.createElement(Col, {
1174
+ }), /*#__PURE__*/React.createElement("span", null, FLOW_STATUS_V2[flowStatus]), /*#__PURE__*/React.createElement(Button, {
1175
+ onClick: reFreshPanel,
1176
+ type: "link"
1177
+ }, "\u5237\u65B0"))), flowTemplateType !== 'SINGLE_PAGE' && /*#__PURE__*/React.createElement(Col, {
1142
1178
  style: {
1143
1179
  position: 'relative',
1144
1180
  zIndex: 1,
@@ -1171,8 +1207,9 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
1171
1207
  }, item.flowWorkOrderId));
1172
1208
  })))
1173
1209
  })), /*#__PURE__*/React.createElement(Timeline, null, flowRecordList.map(function (flowRecord, index) {
1174
- var canWithdraw = currentNodeCanWithdraw(index) && !readonly;
1210
+ var canWithdraw = currentNodeCanWithdraw(index) && !readonly && flowStatus !== FlowStatus.FLOWING;
1175
1211
  return /*#__PURE__*/React.createElement(Timeline.Item, null, /*#__PURE__*/React.createElement(NodeItem, {
1212
+ flowTemplateKey: flowTemplateKey,
1176
1213
  flowTemplateId: flowTemplateId,
1177
1214
  flowWorkOrderId: flowWorkOrderIdState,
1178
1215
  tag: flowRecord.tag,
@@ -29,6 +29,12 @@
29
29
  .PROCESSING {
30
30
  background-color: #FAAD14;
31
31
  }
32
+ .FLOWING {
33
+ background-color: #FAAD14;
34
+ }
35
+ .RETURNING {
36
+ background-color: #FAAD14;
37
+ }
32
38
  .STOPPING {
33
39
  background-color: #FF4D4F;
34
40
  }
@@ -0,0 +1,2 @@
1
+ import { pollRejectOperationResultP } from './type';
2
+ export declare const pollOperationResult: ({ processingList, maxAttempts, handleSuccess, handleFail, handleTimeOut }: pollRejectOperationResultP) => void;
@@ -0,0 +1,39 @@
1
+ import { queryFlowReturnResult } from "../model/flowTemplateDetail/api";
2
+ export var pollOperationResult = function pollOperationResult(_ref) {
3
+ var processingList = _ref.processingList,
4
+ _ref$maxAttempts = _ref.maxAttempts,
5
+ maxAttempts = _ref$maxAttempts === void 0 ? 1 : _ref$maxAttempts,
6
+ handleSuccess = _ref.handleSuccess,
7
+ handleFail = _ref.handleFail,
8
+ handleTimeOut = _ref.handleTimeOut;
9
+ var attemptCount = 0; // 初始化计数器
10
+ var timer = null;
11
+ var checkResult = function checkResult() {
12
+ queryFlowReturnResult({
13
+ returnInfoList: processingList
14
+ }).then(function (res) {
15
+ var _res$data, _res$data$, _res$data2, _res$data2$;
16
+ attemptCount++; // 增加轮询计数
17
+ if ((res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$ = _res$data[0]) === null || _res$data$ === void 0 ? void 0 : _res$data$.returnHandleStatus) === 'SUCCESS') {
18
+ clearTimeout(timer);
19
+ handleSuccess();
20
+ } else if ((res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : (_res$data2$ = _res$data2[0]) === null || _res$data2$ === void 0 ? void 0 : _res$data2$.returnHandleStatus) === 'FAIL') {
21
+ var _res$data3, _res$data3$;
22
+ // 停止轮询并处理失败情况
23
+ clearTimeout(timer);
24
+ handleFail((res === null || res === void 0 ? void 0 : (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : (_res$data3$ = _res$data3[0]) === null || _res$data3$ === void 0 ? void 0 : _res$data3$.failReason) || '');
25
+ } else if (attemptCount < maxAttempts) {
26
+ console.log('等待操作结果...');
27
+ // 如果未达到最大尝试次数,继续轮询
28
+ timer = setTimeout(checkResult, 1000);
29
+ } else {
30
+ console.log('达到最大轮询次数,停止轮询');
31
+ // 执行其他清理或错误处理操作
32
+ clearTimeout(timer);
33
+ handleTimeOut();
34
+ }
35
+ });
36
+ };
37
+ // 开始第一次轮询
38
+ checkResult();
39
+ };
@@ -34,6 +34,8 @@ export declare const setClearStore: (state: FlowTemplateDetailState, { payload }
34
34
  export declare const setFlowTemplateType: (state: FlowTemplateDetailState, { payload }: PayloadAction<FlowType>) => void;
35
35
  export declare const setLabelList: (state: FlowTemplateDetailState, { payload }: PayloadAction<Array<string>>) => void;
36
36
  export declare const clearLabelList: (state: FlowTemplateDetailState) => void;
37
+ export declare const setRejectLoading: (state: FlowTemplateDetailState, { payload }: PayloadAction<boolean>) => void;
38
+ export declare const setWithDrawLoading: (state: FlowTemplateDetailState, { payload }: PayloadAction<boolean>) => void;
37
39
  declare const reducers: (state: FlowTemplateDetailState | undefined, action: {
38
40
  type: string;
39
41
  payload: any;
@@ -69,5 +71,7 @@ declare const reducers: (state: FlowTemplateDetailState | undefined, action: {
69
71
  shopUniqueKey: string;
70
72
  flowTemplateType: FlowType;
71
73
  labelList: string[];
74
+ rejectLoading: boolean;
75
+ withdrawLoading: boolean;
72
76
  };
73
77
  export default reducers;
@@ -40,7 +40,9 @@ export var initState = {
40
40
  tid: '',
41
41
  shopUniqueKey: '',
42
42
  flowTemplateType: '',
43
- labelList: []
43
+ labelList: [],
44
+ rejectLoading: false,
45
+ withdrawLoading: false
44
46
  };
45
47
  export var fetchPanelInfo = function fetchPanelInfo(params, options) {
46
48
  return /*#__PURE__*/function () {
@@ -375,6 +377,14 @@ export var setLabelList = function setLabelList(state, _ref23) {
375
377
  export var clearLabelList = function clearLabelList(state) {
376
378
  state.labelList = [];
377
379
  };
380
+ export var setRejectLoading = function setRejectLoading(state, _ref24) {
381
+ var payload = _ref24.payload;
382
+ state.rejectLoading = payload;
383
+ };
384
+ export var setWithDrawLoading = function setWithDrawLoading(state, _ref25) {
385
+ var payload = _ref25.payload;
386
+ state.withdrawLoading = payload;
387
+ };
378
388
  var reducerMap = {
379
389
  setNodeAssistantInfo: setNodeAssistantInfo,
380
390
  setLoading: setLoading,
@@ -396,7 +406,9 @@ var reducerMap = {
396
406
  setClearStore: setClearStore,
397
407
  setFlowTemplateType: setFlowTemplateType,
398
408
  setLabelList: setLabelList,
399
- clearLabelList: clearLabelList
409
+ clearLabelList: clearLabelList,
410
+ setRejectLoading: setRejectLoading,
411
+ setWithDrawLoading: setWithDrawLoading
400
412
  };
401
413
  var reducers = function reducers() {
402
414
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initState;
@@ -242,3 +242,5 @@ export declare const selectWithDrawOrder: (state: FlowTemplateDetailState) => {
242
242
  };
243
243
  export declare const selectFlowTemplateType: (state: FlowTemplateDetailState) => import("../../model/flowTemplateDetail/types").FlowType;
244
244
  export declare const selectLabelList: (state: FlowTemplateDetailState) => string[];
245
+ export declare const selectRejectLoading: (state: FlowTemplateDetailState) => boolean;
246
+ export declare const selectWithDrawLoading: (state: FlowTemplateDetailState) => boolean;
@@ -55,4 +55,10 @@ export var selectFlowTemplateType = function selectFlowTemplateType(state) {
55
55
  };
56
56
  export var selectLabelList = function selectLabelList(state) {
57
57
  return state.labelList;
58
+ };
59
+ export var selectRejectLoading = function selectRejectLoading(state) {
60
+ return state.rejectLoading;
61
+ };
62
+ export var selectWithDrawLoading = function selectWithDrawLoading(state) {
63
+ return state.withdrawLoading;
58
64
  };
@@ -0,0 +1,28 @@
1
+ import { PlatFormInfo } from '../model/flowTemplateDetail/types';
2
+ export declare type pollRejectOperationResultP = {
3
+ processingList: Array<any>;
4
+ maxAttempts: number;
5
+ handleSuccess: () => void;
6
+ handleFail: (p: string) => void;
7
+ handleTimeOut: () => void;
8
+ };
9
+ export declare type FlowTemplateDetailProps = {
10
+ flowTemplateKey: string;
11
+ flowWorkOrderId?: string;
12
+ plat: PlatFormInfo;
13
+ shopList: any[];
14
+ readonly?: boolean;
15
+ privilege?: boolean;
16
+ onOpenWangWang?: (nick: string, id: string) => void;
17
+ callbackDealWorkOrderSuccess?: (type: string, workOrderId?: string) => void;
18
+ onJumpMemoPage?: () => void;
19
+ onTalkChange?: (data: {
20
+ tid: string;
21
+ shopId: string;
22
+ }) => void;
23
+ autoSubmit?: boolean;
24
+ callbackAutoSubmitResult?: (result: {
25
+ success: boolean;
26
+ message?: string;
27
+ }) => void;
28
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -38,6 +38,14 @@ var FlowStatus = {
38
38
  CLOSED: {
39
39
  name: '已关闭',
40
40
  class: 'status_close'
41
+ },
42
+ FLOWING: {
43
+ name: '流转中',
44
+ class: 'status_handle'
45
+ },
46
+ RETURNING: {
47
+ name: '回退中',
48
+ class: 'status_handle'
41
49
  }
42
50
  };
43
51
  var CustomizeWorkOrderCard = function CustomizeWorkOrderCard(props) {
@@ -41,6 +41,12 @@ var workOrderStatus = [{
41
41
  }, {
42
42
  label: '已关闭',
43
43
  value: 'CLOSED'
44
+ }, {
45
+ label: '流转中',
46
+ value: 'FLOWING'
47
+ }, {
48
+ label: '回退中',
49
+ value: 'RETURNING'
44
50
  }];
45
51
  var getTableData = function getTableData(_ref) {
46
52
  var checkedBuyerId = _ref.checkedBuyerId,
@@ -1941,7 +1941,9 @@ export var orderBack = /*#__PURE__*/function () {
1941
1941
  }
1942
1942
  }
1943
1943
  // console.log('orderback', values);
1944
- form.setFieldsValue(_objectSpread(_objectSpread({}, formValue), values));
1944
+ form.setFieldsValue(_objectSpread(_objectSpread(_objectSpread({}, formValue), values), {}, {
1945
+ 'fixed_field_buyerOpenUid': orderInfo === null || orderInfo === void 0 ? void 0 : orderInfo.buyerOpenUid
1946
+ }));
1945
1947
  callback === null || callback === void 0 ? void 0 : callback(detail, templateDetail);
1946
1948
  _context.next = 66;
1947
1949
  break;
@@ -81,3 +81,6 @@ export declare const batchQueryNodeDetail: (data: any) => Promise<serverProps<Ar
81
81
  export declare const reminder: (data: any) => Promise<serverProps<any>>;
82
82
  export declare const cancelReminder: (data: any) => Promise<serverProps<any>>;
83
83
  export declare const queryIntersectionPreNodes: (data: any) => Promise<serverProps<any>>;
84
+ export declare const restartAutoTask: (data: any) => Promise<serverProps<any>>;
85
+ export declare const queryFlowReturnResult: (data: any) => Promise<serverProps<any>>;
86
+ export declare const queryFlowFail: (data: any) => Promise<serverProps<any>>;
@@ -175,4 +175,29 @@ export var queryIntersectionPreNodes = function queryIntersectionPreNodes(data)
175
175
  method: 'post',
176
176
  data: data
177
177
  });
178
+ };
179
+
180
+ // 自动化任务重试
181
+ export var restartAutoTask = function restartAutoTask(data) {
182
+ return request({
183
+ url: '/qy/flow/operate/autoTaskRetry',
184
+ method: 'post',
185
+ data: data
186
+ });
187
+ };
188
+ export var queryFlowReturnResult = function queryFlowReturnResult(data) {
189
+ return request({
190
+ url: '/qy/flow/operate/queryFlowReturnResult',
191
+ method: 'post',
192
+ data: data
193
+ });
194
+ };
195
+
196
+ // 查询自动化任务异常日志
197
+ export var queryFlowFail = function queryFlowFail(data) {
198
+ return request({
199
+ url: '/qy/flow/queryFlowFail',
200
+ method: 'post',
201
+ data: data
202
+ });
178
203
  };
@@ -63,6 +63,8 @@ export interface FlowTemplateDetailState {
63
63
  shopUniqueKey: string;
64
64
  flowTemplateType: FlowType;
65
65
  labelList: Array<string>;
66
+ rejectLoading: boolean;
67
+ withdrawLoading: boolean;
66
68
  }
67
69
  export interface QyFlowPanelInfoRequest {
68
70
  /**
@@ -875,7 +877,9 @@ export declare enum FlowStatus {
875
877
  PROCESSING = "PROCESSING",
876
878
  STOPPING = "STOPPING",
877
879
  COMPLETED = "COMPLETED",
878
- CLOSE = "CLOSED"
880
+ CLOSE = "CLOSED",
881
+ FLOWING = "FLOWING",
882
+ RETURNING = "RETURNING"
879
883
  }
880
884
  export declare enum FlowType {
881
885
  SINGLE_PAGE = "SINGLE_PAGE",
@@ -44,6 +44,8 @@ export var FlowStatus;
44
44
  FlowStatus["STOPPING"] = "STOPPING";
45
45
  FlowStatus["COMPLETED"] = "COMPLETED";
46
46
  FlowStatus["CLOSE"] = "CLOSED";
47
+ FlowStatus["FLOWING"] = "FLOWING";
48
+ FlowStatus["RETURNING"] = "RETURNING";
47
49
  })(FlowStatus || (FlowStatus = {}));
48
50
  export var FlowType;
49
51
  (function (FlowType) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/kmkf-work-order-service-component",
3
- "version": "1.19.2",
3
+ "version": "2.0.0-rc.0",
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": "1.19.2",
36
- "@kmkf-fe-packages/kmkf-utils": "1.19.2",
37
- "@kmkf-fe-packages/services-components": "1.19.2",
35
+ "@kmkf-fe-packages/basic-components": "2.0.0-rc.0",
36
+ "@kmkf-fe-packages/kmkf-utils": "2.0.0-rc.0",
37
+ "@kmkf-fe-packages/services-components": "2.0.0-rc.0",
38
38
  "@reduxjs/toolkit": "^1.8.5",
39
39
  "ahooks": "^3.7.4",
40
40
  "copy-to-clipboard": "^3.3.3",
@@ -73,7 +73,7 @@
73
73
  "publishConfig": {
74
74
  "access": "public"
75
75
  },
76
- "gitHead": "2e2f27ba765c9dfa3ee60dbbc3fa4cf37c9ef689",
76
+ "gitHead": "5770273c5177f0dc9eb9c1ee91eb9ba6e98d54f0",
77
77
  "gitHooks": {
78
78
  "pre-commit": "lint-staged"
79
79
  }