@kmkf-fe-packages/kmkf-work-order-service-component 2.2.5-beta.15 → 2.2.5-beta.16

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.
@@ -478,7 +478,7 @@ var FormRender = function FormRender(props, ref) {
478
478
  // 如果没有订单反填,则单独更新remark
479
479
  fetchRemark(shopId, currentNodeTid);
480
480
  case 35:
481
- _context2.next = 41;
481
+ _context2.next = 60;
482
482
  break;
483
483
  case 37:
484
484
  fillByShopId(shopId);
@@ -498,55 +498,64 @@ var FormRender = function FormRender(props, ref) {
498
498
  }
499
499
 
500
500
  // console.log(orderNo, initFormValues);
501
- if (initFormValues) {
502
- form.setFieldsValue(_objectSpread(_objectSpread({}, initFormValues), {}, {
503
- shopId: shopId
504
- }));
505
- // 没有触发订单反填的情况下,更新备注,
506
- // PS: orderNo 和 shopId 可能需要从initFormValues中获取
507
- _orderNo = orderNo;
508
- _shopId = shopId || initFormValues['shopId'];
509
- if (!_orderNo) {
510
- orderNoField = ((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList) || []).find(function (item) {
511
- return (item === null || item === void 0 ? void 0 : item.workOrderComponentType) === 'TRADE_ID_INPUT';
512
- });
513
- _orderNo = orderNoField !== null && orderNoField !== void 0 && orderNoField.uniqueKey ? initFormValues[orderNoField === null || orderNoField === void 0 ? void 0 : orderNoField.uniqueKey] || _orderNo : _orderNo;
514
- }
515
- fetchRemark(_shopId, _orderNo);
516
- } else {
517
- _transData = calcWorkOrderList([{
518
- jsonMap: jsonMap
519
- }], [].concat(_toConsumableArray((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.preNodeComponentDtoList) || []), _toConsumableArray((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList) || [])), 'init');
520
- _initialValues = get(_transData, '0', {});
521
- form.setFieldsValue(_objectSpread(_objectSpread({}, _initialValues), {}, {
522
- shopId: shopId
523
- }));
524
- // 默认值触发映射
525
- batchFillByMapping(_initialValues);
526
- //如果有订单号 订单返填 通过订单号入口进行工单录入,需要将订单数据反填到工单
527
-
528
- if (orderNo && shopId) {
529
- orderBack({
530
- order_no: orderNo,
531
- form: form,
532
- shopId: shopId,
533
- shopList: shopList,
534
- templateDetail: templateDetail,
535
- callback: orderBackReplace,
536
- fromQNCreateWorkOrderByOrderNo: fromQNCreateWorkOrderByOrderNo,
537
- // TODO: 只有在千牛端通过订单号录入工单的时候,订单备注不需要反填
538
- plat: plat,
539
- callKey: 2,
540
- setLoading: setLoading
541
- });
542
- queryLabels(orderNo, shopId);
543
- queryMemberLevels(orderNo, shopId);
544
- } else {
545
- // 如果没有订单反填,则单独更新remark
546
- fetchRemark(shopId, currentNodeTid);
547
- }
501
+ if (!initFormValues) {
502
+ _context2.next = 48;
503
+ break;
504
+ }
505
+ form.setFieldsValue(_objectSpread(_objectSpread({}, initFormValues), {}, {
506
+ shopId: shopId
507
+ }));
508
+ // 没有触发订单反填的情况下,更新备注,
509
+ // PS: orderNo 和 shopId 可能需要从initFormValues中获取
510
+ _orderNo = orderNo;
511
+ _shopId = shopId || initFormValues['shopId'];
512
+ if (!_orderNo) {
513
+ orderNoField = ((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList) || []).find(function (item) {
514
+ return (item === null || item === void 0 ? void 0 : item.workOrderComponentType) === 'TRADE_ID_INPUT';
515
+ });
516
+ _orderNo = orderNoField !== null && orderNoField !== void 0 && orderNoField.uniqueKey ? initFormValues[orderNoField === null || orderNoField === void 0 ? void 0 : orderNoField.uniqueKey] || _orderNo : _orderNo;
517
+ }
518
+ fetchRemark(_shopId, _orderNo);
519
+ _context2.next = 60;
520
+ break;
521
+ case 48:
522
+ _transData = calcWorkOrderList([{
523
+ jsonMap: jsonMap
524
+ }], [].concat(_toConsumableArray((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.preNodeComponentDtoList) || []), _toConsumableArray((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList) || [])), 'init');
525
+ _initialValues = get(_transData, '0', {});
526
+ form.setFieldsValue(_objectSpread(_objectSpread({}, _initialValues), {}, {
527
+ shopId: shopId
528
+ }));
529
+ // 默认值触发映射
530
+ batchFillByMapping(_initialValues);
531
+ //如果有订单号 订单返填 通过订单号入口进行工单录入,需要将订单数据反填到工单
532
+ if (!(orderNo && shopId)) {
533
+ _context2.next = 59;
534
+ break;
548
535
  }
549
- case 41:
536
+ queryLabels(orderNo, shopId);
537
+ queryMemberLevels(orderNo, shopId);
538
+ _context2.next = 57;
539
+ return orderBack({
540
+ order_no: orderNo,
541
+ form: form,
542
+ shopId: shopId,
543
+ shopList: shopList,
544
+ templateDetail: templateDetail,
545
+ callback: orderBackReplace,
546
+ fromQNCreateWorkOrderByOrderNo: fromQNCreateWorkOrderByOrderNo,
547
+ // TODO: 只有在千牛端通过订单号录入工单的时候,订单备注不需要反填
548
+ plat: plat,
549
+ callKey: 2,
550
+ setLoading: setLoading
551
+ });
552
+ case 57:
553
+ _context2.next = 60;
554
+ break;
555
+ case 59:
556
+ // 如果没有订单反填,则单独更新remark
557
+ fetchRemark(shopId, currentNodeTid);
558
+ case 60:
550
559
  antFormEl = document.getElementsByClassName('ant-form');
551
560
  (antFormEl === null || antFormEl === void 0 ? void 0 : antFormEl.length) > 0 && set(antFormEl, '0.scrollTop', 0);
552
561
  resetMappingHideComponents();
@@ -555,7 +564,7 @@ var FormRender = function FormRender(props, ref) {
555
564
  type: 'setaAutoSubmitFlag',
556
565
  payload: true
557
566
  });
558
- case 45:
567
+ case 64:
559
568
  case "end":
560
569
  return _context2.stop();
561
570
  }
@@ -62,7 +62,7 @@ import { PlatForm } from "../WorkOrder/types";
62
62
  var Text = Typography.Text,
63
63
  Link = Typography.Link;
64
64
  var FlowTemplateDetail = function FlowTemplateDetail(props) {
65
- var _currentNodeDetail$wo, _currentNodeDetail$no, _currentNodeDetail$wo2, _currentNodeDetail$no14, _shopList$find, _JSON$parse, _currentNodeDetail$wo30, _currentNodeDetail$wo31, _currentNodeDetail$wo32, _currentNodeDetail$wo33, _currentNodeDetail$no25, _currentNodeDetail$no26, _currentNodeDetail$no27, _currentNodeDetail$no28;
65
+ var _currentNodeDetail$wo, _currentNodeDetail$no, _currentNodeDetail$wo2, _currentNodeDetail$no14, _shopList$find, _JSON$parse, _currentNodeDetail$wo31, _currentNodeDetail$wo32, _currentNodeDetail$wo33, _currentNodeDetail$wo34, _currentNodeDetail$no25, _currentNodeDetail$no26, _currentNodeDetail$no27, _currentNodeDetail$no28;
66
66
  var flowTemplateKey = props.flowTemplateKey,
67
67
  _props$shopList = props.shopList,
68
68
  shopList = _props$shopList === void 0 ? [] : _props$shopList,
@@ -1168,23 +1168,23 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
1168
1168
  };
1169
1169
  useEffect(function () {
1170
1170
  if (autoSubmit && !isNull(currentNodeDetail)) {
1171
- var _currentNodeDetail$wo26;
1171
+ var _currentNodeDetail$wo26, _currentNodeDetail$wo27;
1172
1172
  // SKX首节点满足下列条件、此时批量提交会等订单数据反填再提交, 其余企业批量提交还是原先逻辑,不涉及订单数据反填
1173
1173
  if (currentNodeDetail !== null && currentNodeDetail !== void 0 && (_currentNodeDetail$wo26 = currentNodeDetail.workOrder) !== null && _currentNodeDetail$wo26 !== void 0 && _currentNodeDetail$wo26.notAutoFillWithFirstSubmit && autoSubmitFlag) {
1174
1174
  autoSubmitFn();
1175
- } else if (!autoSubmitFlag) {
1175
+ } else if (!(currentNodeDetail !== null && currentNodeDetail !== void 0 && (_currentNodeDetail$wo27 = currentNodeDetail.workOrder) !== null && _currentNodeDetail$wo27 !== void 0 && _currentNodeDetail$wo27.notAutoFillWithFirstSubmit) && !autoSubmitFlag) {
1176
1176
  autoSubmitFn();
1177
1177
  }
1178
1178
  }
1179
1179
  }, [currentNodeDetail, autoSubmitFlag]);
1180
1180
  var isCurrentNodeHandler = useMemo(function () {
1181
- var _currentNodeDetail$no15, _currentNodeDetail$no16, _currentNodeDetail$no17, _currentNodeDetail$no18, _currentNodeDetail$no19, _currentNodeDetail$no20, _currentNodeDetail$wo27, _currentNodeDetail$no21, _currentNodeDetail$no22;
1181
+ var _currentNodeDetail$no15, _currentNodeDetail$no16, _currentNodeDetail$no17, _currentNodeDetail$no18, _currentNodeDetail$no19, _currentNodeDetail$no20, _currentNodeDetail$wo28, _currentNodeDetail$no21, _currentNodeDetail$no22;
1182
1182
  return currentUserHasOperatorAuth({
1183
1183
  assistantList: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no15 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no15 === void 0 ? void 0 : _currentNodeDetail$no15.id) && assistantMap[currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no16 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no16 === void 0 ? void 0 : _currentNodeDetail$no16.id] || [],
1184
1184
  currentUserKey: plat.userKey,
1185
1185
  staffIds: (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.staffIds) || [],
1186
1186
  operateDataPermission: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no19 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no19 === void 0 ? void 0 : (_currentNodeDetail$no20 = _currentNodeDetail$no19.assistants) === null || _currentNodeDetail$no20 === void 0 ? void 0 : _currentNodeDetail$no20.operateDataPermission,
1187
- handlerList: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo27 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo27 === void 0 ? void 0 : _currentNodeDetail$wo27.handlerList) || [],
1187
+ handlerList: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo28 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo28 === void 0 ? void 0 : _currentNodeDetail$wo28.handlerList) || [],
1188
1188
  isAllStaff: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no21 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no21 === void 0 ? void 0 : (_currentNodeDetail$no22 = _currentNodeDetail$no21.assistants) === null || _currentNodeDetail$no22 === void 0 ? void 0 : _currentNodeDetail$no22.isAllStaff
1189
1189
  });
1190
1190
  }, [currentNodeDetail, plat, assistantMap]);
@@ -1193,9 +1193,9 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
1193
1193
  return item.accessToken === (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no23 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no23 === void 0 ? void 0 : (_currentNodeDetail$no24 = _currentNodeDetail$no23.relationEvent) === null || _currentNodeDetail$no24 === void 0 ? void 0 : _currentNodeDetail$no24.defaultShopUniqueKey);
1194
1194
  })) === null || _shopList$find === void 0 ? void 0 : _shopList$find.shopId;
1195
1195
  var ReportOrderRender = function ReportOrderRender(props) {
1196
- var _currentNodeDetail$wo28, _currentNodeDetail$wo29;
1196
+ var _currentNodeDetail$wo29, _currentNodeDetail$wo30;
1197
1197
  var details = props.details;
1198
- var componentDtoList = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo28 = currentNodeDetail.workOrderTemplateInfo) === null || _currentNodeDetail$wo28 === void 0 ? void 0 : _currentNodeDetail$wo28.componentDtoList.filter(function (t) {
1198
+ var componentDtoList = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo29 = currentNodeDetail.workOrderTemplateInfo) === null || _currentNodeDetail$wo29 === void 0 ? void 0 : _currentNodeDetail$wo29.componentDtoList.filter(function (t) {
1199
1199
  return !CANNOT_BACK_FILL.includes(t.workOrderComponentType || '');
1200
1200
  });
1201
1201
  //获取可以返填的组件值
@@ -1203,7 +1203,7 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
1203
1203
  _calcWorkOrderList2 = _slicedToArray(_calcWorkOrderList, 1),
1204
1204
  transData = _calcWorkOrderList2[0];
1205
1205
  //获取表单显示值
1206
- var _calcWorkOrderList3 = calcWorkOrderList([details], currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo29 = currentNodeDetail.workOrderTemplateInfo) === null || _currentNodeDetail$wo29 === void 0 ? void 0 : _currentNodeDetail$wo29.componentDtoList),
1206
+ var _calcWorkOrderList3 = calcWorkOrderList([details], currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo30 = currentNodeDetail.workOrderTemplateInfo) === null || _currentNodeDetail$wo30 === void 0 ? void 0 : _currentNodeDetail$wo30.componentDtoList),
1207
1207
  _calcWorkOrderList4 = _slicedToArray(_calcWorkOrderList3, 1),
1208
1208
  transDataall = _calcWorkOrderList4[0];
1209
1209
  return /*#__PURE__*/React.createElement("div", {
@@ -1301,9 +1301,9 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
1301
1301
  }), shopItem === null || shopItem === void 0 ? void 0 : shopItem.shopName, "-"), /*#__PURE__*/React.createElement("span", null, flowWorkOrderId), !['created', 'edit'].includes(privilege) && /*#__PURE__*/React.createElement(Button, {
1302
1302
  type: "link",
1303
1303
  onClick: handleFollow
1304
- }, !follow ? '关注' : '已关注')), /*#__PURE__*/React.createElement("div", null, (_JSON$parse = JSON.parse((currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo30 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo30 === void 0 ? void 0 : (_currentNodeDetail$wo31 = _currentNodeDetail$wo30.jsonMap) === null || _currentNodeDetail$wo31 === void 0 ? void 0 : _currentNodeDetail$wo31.flowTags) || '[]')) !== null && _JSON$parse !== void 0 && _JSON$parse.includes('AI_BUILD') ? /*#__PURE__*/React.createElement(Tag, {
1304
+ }, !follow ? '关注' : '已关注')), /*#__PURE__*/React.createElement("div", null, (_JSON$parse = JSON.parse((currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo31 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo31 === void 0 ? void 0 : (_currentNodeDetail$wo32 = _currentNodeDetail$wo31.jsonMap) === null || _currentNodeDetail$wo32 === void 0 ? void 0 : _currentNodeDetail$wo32.flowTags) || '[]')) !== null && _JSON$parse !== void 0 && _JSON$parse.includes('AI_BUILD') ? /*#__PURE__*/React.createElement(Tag, {
1305
1305
  color: "blue"
1306
- }, "AI\u81EA\u52A8\u5EFA\u5355-".concat(WORK_ORDER_STATUS_AI_BUILD[currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo32 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo32 === void 0 ? void 0 : (_currentNodeDetail$wo33 = _currentNodeDetail$wo32.jsonMap) === null || _currentNodeDetail$wo33 === void 0 ? void 0 : _currentNodeDetail$wo33.flowStatus])) : null)), flowStatus && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Row, {
1306
+ }, "AI\u81EA\u52A8\u5EFA\u5355-".concat(WORK_ORDER_STATUS_AI_BUILD[currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo33 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo33 === void 0 ? void 0 : (_currentNodeDetail$wo34 = _currentNodeDetail$wo33.jsonMap) === null || _currentNodeDetail$wo34 === void 0 ? void 0 : _currentNodeDetail$wo34.flowStatus])) : null)), flowStatus && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Row, {
1307
1307
  justify: 'space-between',
1308
1308
  className: "header"
1309
1309
  }, /*#__PURE__*/React.createElement(Col, null, /*#__PURE__*/React.createElement("div", {
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.5-beta.15",
3
+ "version": "2.2.5-beta.16",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -74,7 +74,7 @@
74
74
  "publishConfig": {
75
75
  "access": "public"
76
76
  },
77
- "gitHead": "e0b1476c25dcd0dfb393de92f545968f87f1c6dc",
77
+ "gitHead": "5d8342d76a231a901654b4c7c4ddd699201ddb6f",
78
78
  "gitHooks": {
79
79
  "pre-commit": "lint-staged"
80
80
  }