kmkf-work-order-service-component 0.4.0-alpha.2 → 0.4.0-alpha.21

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 (29) hide show
  1. package/dist/esm/FormRender/index.d.ts +4 -1
  2. package/dist/esm/FormRender/index.js +139 -69
  3. package/dist/esm/FormRender/index.less +6 -0
  4. package/dist/esm/ShopList/index.d.ts +19 -0
  5. package/dist/esm/ShopList/index.js +88 -0
  6. package/dist/esm/WorkOrder/components/CustomizeWorkOrderList/components/CustomizeWorkOrderCard/index.js +12 -5
  7. package/dist/esm/WorkOrder/components/CustomizeWorkOrderList/index.d.ts +2 -1
  8. package/dist/esm/WorkOrder/components/CustomizeWorkOrderList/index.js +42 -12
  9. package/dist/esm/WorkOrder/components/CustomizeWorkOrderList/index.less +91 -0
  10. package/dist/esm/WorkOrder/components/PaymentWorkOrderList/index.js +145 -72
  11. package/dist/esm/WorkOrder/components/PaymentWorkOrderList/index.less +0 -2
  12. package/dist/esm/WorkOrder/components/Widget/basic/Picture/index.js +2 -2
  13. package/dist/esm/WorkOrder/components/Widget/common/formItemWrap.d.ts +1 -2
  14. package/dist/esm/WorkOrder/components/Widget/common/formItemWrap.js +2 -16
  15. package/dist/esm/WorkOrder/index.d.ts +1 -0
  16. package/dist/esm/WorkOrder/index.js +18 -12
  17. package/dist/esm/WorkOrder/index.less +5 -3
  18. package/dist/esm/common/utils/tools.d.ts +1 -0
  19. package/dist/esm/common/utils/tools.js +37 -15
  20. package/dist/esm/model/customizeWorkOrder/api.d.ts +6 -1
  21. package/dist/esm/model/customizeWorkOrder/api.js +26 -0
  22. package/dist/esm/model/customizeWorkOrder/index.js +1 -1
  23. package/dist/esm/model/customizeWorkOrder/types.d.ts +5 -0
  24. package/dist/esm/model/workOrder.d.ts +1 -0
  25. package/dist/esm/model/workOrder.js +19 -28
  26. package/package.json +2 -2
  27. package/dist/esm/WorkOrder/components/CustomizeWorkOrderList/components/CustomizeFormModal/index.d.ts +0 -17
  28. package/dist/esm/WorkOrder/components/CustomizeWorkOrderList/components/CustomizeFormModal/index.js +0 -681
  29. package/dist/esm/WorkOrder/components/CustomizeWorkOrderList/components/CustomizeFormModal/index.less +0 -134
@@ -27,7 +27,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
27
27
  * Copyright (c) 2022 by wangzhenggui jianjia.wzg@raycloud.com, All Rights Reserved.
28
28
  */
29
29
  import React, { useState, useEffect, useLayoutEffect, useMemo } from 'react';
30
- import { Spin } from 'antd';
30
+ import { Spin, ConfigProvider } from 'antd';
31
31
  import { Provider } from 'react-redux';
32
32
  import { useAppSelector, useAppDispatch } from "../model/hooks";
33
33
  import { fetchQueryGroupCustomTemplate, fetchQueryCurrentCompanyUser } from "../model/workOrder";
@@ -38,6 +38,8 @@ import store from "../model/store";
38
38
  import OrderList from "./components/CustomizeWorkOrderList";
39
39
  import Reminder from "./components/Reminder";
40
40
  import PaymentWorkOrderList from "./components/PaymentWorkOrderList";
41
+ import zhCN from 'antd/es/locale/zh_CN';
42
+ import 'moment/locale/zh-cn';
41
43
  import { PlatForm } from "./types";
42
44
  import "./index.less";
43
45
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -61,7 +63,7 @@ var WorkOrder = function WorkOrder(props) {
61
63
  return state.workOrder.userInfo.shopList;
62
64
  });
63
65
 
64
- var _useState = useState('custom'),
66
+ var _useState = useState('payment'),
65
67
  _useState2 = _slicedToArray(_useState, 2),
66
68
  tabActive = _useState2[0],
67
69
  setTabActive = _useState2[1];
@@ -72,13 +74,13 @@ var WorkOrder = function WorkOrder(props) {
72
74
  type: 'workOrder/setIsBuyer',
73
75
  payload: true
74
76
  });
75
- setCurrentBuyerChecked(true);
77
+ dispatch(setCurrentBuyerChecked(true));
76
78
  } else {
77
79
  dispatch({
78
80
  type: 'workOrder/setIsBuyer',
79
81
  payload: false
80
82
  });
81
- setCurrentBuyerChecked(false);
83
+ dispatch(setCurrentBuyerChecked(false));
82
84
  }
83
85
  }, [buyerId]);
84
86
  useEffect(function () {
@@ -146,21 +148,22 @@ var WorkOrder = function WorkOrder(props) {
146
148
  children: /*#__PURE__*/_jsxs("div", {
147
149
  className: "order_header_tabs",
148
150
  children: [/*#__PURE__*/_jsx("div", {
149
- className: "order_header_tabs_button ".concat(tabActive === 'custom' ? 'active' : ''),
150
- onClick: function onClick() {
151
- return setTabActive('custom');
152
- },
153
- children: "\u81EA\u5B9A\u4E49\u5DE5\u5355"
154
- }), /*#__PURE__*/_jsx("div", {
155
151
  className: "order_header_tabs_button border_left ".concat(tabActive === 'payment' ? 'active' : ''),
156
152
  onClick: function onClick() {
157
153
  return setTabActive('payment');
158
154
  },
159
155
  children: "\u6253\u6B3E\u5DE5\u5355"
156
+ }), /*#__PURE__*/_jsx("div", {
157
+ className: "order_header_tabs_button ".concat(tabActive === 'custom' ? 'active' : ''),
158
+ onClick: function onClick() {
159
+ return setTabActive('custom');
160
+ },
161
+ children: "\u81EA\u5B9A\u4E49\u5DE5\u5355"
160
162
  })]
161
163
  })
162
164
  }), /*#__PURE__*/_jsx(OrderList, {
163
- tabActive: tabActive
165
+ tabActive: tabActive,
166
+ shopId: shopId
164
167
  }), /*#__PURE__*/_jsx(PaymentWorkOrderList, {
165
168
  tabActive: tabActive
166
169
  })]
@@ -174,7 +177,10 @@ var WorkOrder = function WorkOrder(props) {
174
177
  var ProviderWrap = function ProviderWrap(props) {
175
178
  return /*#__PURE__*/_jsx(Provider, {
176
179
  store: store,
177
- children: /*#__PURE__*/_jsx(WorkOrder, _objectSpread({}, props))
180
+ children: /*#__PURE__*/_jsx(ConfigProvider, {
181
+ locale: zhCN,
182
+ children: /*#__PURE__*/_jsx(WorkOrder, _objectSpread({}, props))
183
+ })
178
184
  });
179
185
  };
180
186
 
@@ -1,6 +1,7 @@
1
+ .order_container {
2
+ padding: 0 8px;
3
+ }
1
4
  .order_header {
2
- padding: 0 16px;
3
-
4
5
  .order_header_tabs {
5
6
  display: flex;
6
7
  align-items: center;
@@ -25,7 +26,8 @@
25
26
  }
26
27
 
27
28
  &.active {
28
- color: #1966ff;
29
+ color: #fff;
30
+ background-color: #1966ff;
29
31
  }
30
32
  }
31
33
  }
@@ -28,6 +28,7 @@ export declare const submitDataTransOldFormat: (nowData: {
28
28
  workOrderUpdateKeyVos: {
29
29
  type: string;
30
30
  isFlag: any;
31
+ tid: string;
31
32
  };
32
33
  buyerOpenUid: any;
33
34
  }) => any;
@@ -51,8 +51,7 @@ export var isNull = function isNull(value) {
51
51
  return isEmpty(value);
52
52
  };
53
53
  var workTypeKeys = {
54
- TRADE_ID_INPUT: 'tradeId',
55
- //订单号
54
+ // TRADE_ID_INPUT: 'tradeId', //订单号
56
55
  // BUYER_NICK_INPUT: 'buyerNick', //买家旺旺
57
56
  SHOP_NAME_INPUT: 'shopName',
58
57
  //店铺名称
@@ -159,6 +158,16 @@ export var submitDataTransOldFormat = function submitDataTransOldFormat(nowData,
159
158
  content: get(nowData, "".concat(item.uniqueKey), ''),
160
159
  name: item.name
161
160
  });
161
+ } else if (item.workOrderComponentType === 'TRADE_ID_INPUT') {
162
+ contentVoList.push({
163
+ uniqueKey: "".concat(item.uniqueKey, "_tradeId"),
164
+ content: get(nowData, "".concat(item.uniqueKey), ''),
165
+ name: item.name
166
+ });
167
+
168
+ if (updateFlag) {
169
+ params.workOrderUpdateKeyVos.tid = get(nowData, "".concat(item.uniqueKey), '');
170
+ }
162
171
  } else if (item.workOrderComponentType === 'RATE') {
163
172
  contentVoList.push({
164
173
  uniqueKey: "".concat(item.uniqueKey, "_rate"),
@@ -545,9 +554,8 @@ var transDataSource = function transDataSource(templateColumns) {
545
554
  } else if (nex.workOrderComponentType === 'DATETIME') {
546
555
  return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_dateTime")], item.jsonMap["".concat(nex.uniqueKey, "_dateTime")]) || config.dateTime));
547
556
  } else if (nex.workOrderComponentType === 'PICTURE') {
548
- var host = cache.getHost();
549
557
  return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), item.jsonMap["".concat(nex.uniqueKey, "_picture")] ? formatPictures(item.jsonMap["".concat(nex.uniqueKey, "_picture")]).map(function (item) {
550
- return "".concat(host, "/").concat(item);
558
+ return "".concat(item);
551
559
  }) : []));
552
560
  } else if (nex.workOrderComponentType === 'BASIC_MULT_SELECT') {
553
561
  return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_basicMultSelect")], '') || config.basicMultSelect || []));
@@ -652,17 +660,30 @@ export var orderBack = /*#__PURE__*/function () {
652
660
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
653
661
  var _shopList$find;
654
662
 
655
- var order_no, form, shopId, shopList, templateDetail, _ref$type, type, callback, shopSourceStr, _shopList$find2, _data$value, _buyer$value, taobaoId, promise, _yield$Promise$allSet, _yield$Promise$allSet2, data, buyer, orderInfo, buyerInfo, _ref3, orderNo, provinceCode, cityCode, townCode, orderCreateDateTime, orderPaymentDateTime, orderDeliveryDateTime, orderClosingDateTime, itemList, transField, finalResponse, formValue, detail, componentsParams, detailsValue, _templateDetail$compo, paymentUniqueKey;
663
+ var order_no, form, shopId, shopList, templateDetail, _ref$type, type, callback, JOIN_SHOP, shopSourceStr, _shopList$find2, _data$value, _buyer$value, taobaoId, promise, _yield$Promise$allSet, _yield$Promise$allSet2, data, buyer, orderInfo, buyerInfo, _ref3, orderNo, provinceCode, cityCode, townCode, orderCreateDateTime, orderPaymentDateTime, orderDeliveryDateTime, orderClosingDateTime, itemList, transField, finalResponse, formValue, detail, componentsParams, detailsValue, _templateDetail$compo, paymentUniqueKey;
656
664
 
657
665
  return _regeneratorRuntime().wrap(function _callee$(_context) {
658
666
  while (1) {
659
667
  switch (_context.prev = _context.next) {
660
668
  case 0:
661
669
  order_no = _ref.order_no, form = _ref.form, shopId = _ref.shopId, shopList = _ref.shopList, templateDetail = _ref.templateDetail, _ref$type = _ref.type, type = _ref$type === void 0 ? 'add' : _ref$type, callback = _ref.callback;
670
+ //是否是对接平台,只有对接平台才能返填订单号
671
+ JOIN_SHOP = shopList.find(function (item) {
672
+ return !item.notJoin && item.shopId == shopId;
673
+ });
674
+
675
+ if (JOIN_SHOP) {
676
+ _context.next = 4;
677
+ break;
678
+ }
679
+
680
+ return _context.abrupt("return");
681
+
682
+ case 4:
662
683
  shopSourceStr = (_shopList$find = shopList.find(function (item) {
663
684
  return item.shopId == shopId;
664
685
  })) === null || _shopList$find === void 0 ? void 0 : _shopList$find.shopSourceStr;
665
- _context.prev = 2;
686
+ _context.prev = 5;
666
687
  taobaoId = (_shopList$find2 = shopList.find(function (item) {
667
688
  return item.shopSourceStr === 'TAOBAO' && item.shopId == shopId;
668
689
  })) === null || _shopList$find2 === void 0 ? void 0 : _shopList$find2.taobaoId;
@@ -681,10 +702,10 @@ export var orderBack = /*#__PURE__*/function () {
681
702
  })) : promise.push(new Promise(function (resolve) {
682
703
  resolve({});
683
704
  }));
684
- _context.next = 8;
705
+ _context.next = 11;
685
706
  return Promise.allSettled(promise);
686
707
 
687
- case 8:
708
+ case 11:
688
709
  _yield$Promise$allSet = _context.sent;
689
710
  _yield$Promise$allSet2 = _slicedToArray(_yield$Promise$allSet, 2);
690
711
  data = _yield$Promise$allSet2[0];
@@ -813,19 +834,19 @@ export var orderBack = /*#__PURE__*/function () {
813
834
 
814
835
  form.setFieldsValue(_objectSpread(_objectSpread({}, formValue), detailsValue));
815
836
  callback === null || callback === void 0 ? void 0 : callback(finalResponse);
816
- _context.next = 31;
837
+ _context.next = 34;
817
838
  break;
818
839
 
819
- case 29:
820
- _context.prev = 29;
821
- _context.t0 = _context["catch"](2);
840
+ case 32:
841
+ _context.prev = 32;
842
+ _context.t0 = _context["catch"](5);
822
843
 
823
- case 31:
844
+ case 34:
824
845
  case "end":
825
846
  return _context.stop();
826
847
  }
827
848
  }
828
- }, _callee, null, [[2, 29]]);
849
+ }, _callee, null, [[5, 32]]);
829
850
  }));
830
851
 
831
852
  return function orderBack(_x) {
@@ -920,7 +941,8 @@ var getComponentsValue = function getComponentsValue() {
920
941
  export var imgResize = function imgResize(url) {
921
942
  var w = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 60;
922
943
  var h = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 60;
923
- return "".concat(url, "?x-oss-process=image/resize,h_").concat(h, ",w_").concat(w);
944
+ var modifyUrl = url.startsWith('/') ? url : "/".concat(url);
945
+ return "https://kefu.kuaimai.com".concat(modifyUrl, "?x-oss-process=image/resize,h_").concat(h, ",w_").concat(w);
924
946
  }; //重复校验数据映射字段
925
947
 
926
948
  export var COMPONENT_MAP = {
@@ -1,6 +1,11 @@
1
1
  import { serverProps } from '../servers/request';
2
- import { ColumnsConfigI } from './types';
2
+ import { ColumnsConfigI, PlatIProp } from './types';
3
3
  export declare const queryAllComponentList: (data: any) => Promise<serverProps<{
4
4
  fixedColumns: ColumnsConfigI[];
5
5
  nonFixedColumns: ColumnsConfigI[];
6
6
  }>>;
7
+ export declare const getPlatList: (data: any) => Promise<serverProps<{
8
+ all: PlatIProp[];
9
+ alreadyJoinedList: PlatIProp[];
10
+ notJoinList: PlatIProp[];
11
+ }>>;
@@ -1,3 +1,15 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+
3
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+
5
+ 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); }
6
+
7
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
8
+
9
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
10
+
11
+ 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; }
12
+
1
13
  import request from "../servers/request";
2
14
  // 所有组件信息
3
15
  export var queryAllComponentList = function queryAllComponentList(data) {
@@ -6,4 +18,18 @@ export var queryAllComponentList = function queryAllComponentList(data) {
6
18
  method: 'get',
7
19
  data: data
8
20
  });
21
+ }; // 平台信息
22
+
23
+ export var getPlatList = function getPlatList(data) {
24
+ return request({
25
+ url: '/qy/platform/listPlatform',
26
+ method: 'get',
27
+ data: data
28
+ }).then(function (res) {
29
+ var platType = res.data || {};
30
+ platType.alreadyJoinedList = platType.alreadyJoinedList || [];
31
+ platType.notJoinList = platType.notJoinList || [];
32
+ var list = [].concat(_toConsumableArray(platType.alreadyJoinedList), _toConsumableArray(platType.notJoinList));
33
+ return list;
34
+ });
9
35
  };
@@ -110,7 +110,7 @@ export var fetchAllComponentList = /*#__PURE__*/function () {
110
110
  _context2.prev = 0;
111
111
  _context2.next = 3;
112
112
  return queryAllComponentList({
113
- templateId: '74TM7ZQQ7Z2N3754WWBV7ALB' // 这个模板标识是全部工单
113
+ templateId: 'EHS2XLO7QXHYOR65I6OHQWNY' // 这个模板标识是全部工单
114
114
 
115
115
  });
116
116
 
@@ -35,3 +35,8 @@ export declare type ComponentColumnsT = {
35
35
  uniqueKey: string;
36
36
  name: string;
37
37
  };
38
+ export declare type PlatIProp = {
39
+ alreadyJoin: boolean;
40
+ img: string;
41
+ platformType: number;
42
+ };
@@ -1,6 +1,7 @@
1
1
  export interface WorkOrderState {
2
2
  groupAllList: [];
3
3
  groupTemplateList: any[];
4
+ enabledTemplateList: string[];
4
5
  allTempLateList: any[];
5
6
  orderList: any[];
6
7
  orderListTotal: number;
@@ -6,18 +6,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
6
6
 
7
7
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
8
 
9
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
-
11
- 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."); }
12
-
13
- 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); }
14
-
15
- 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; }
16
-
17
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
18
-
19
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20
-
21
9
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
22
10
 
23
11
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
@@ -39,6 +27,8 @@ var initialState = {
39
27
  //模版组列表包含模版
40
28
  groupTemplateList: [],
41
29
  //模版组列表 不包含模版
30
+ enabledTemplateList: [],
31
+ //禁用组件模版列表
42
32
  allTempLateList: [],
43
33
  //组列表下的模版
44
34
  orderList: [],
@@ -64,9 +54,10 @@ var initialState = {
64
54
  //打款工单搜索条件
65
55
  pageNo: 1,
66
56
  pageSize: 20,
67
- time: [moment().subtract(31, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss'), moment().endOf('day').format('YYYY-MM-DD HH:mm:ss')],
57
+ time: [moment().subtract(30, 'day').startOf('day'), moment().endOf('day')],
68
58
  workPayStatus: '',
69
- timeType: 'submitTime',
59
+ tid: '',
60
+ paymentOrderKey: '',
70
61
  isBuyer: false
71
62
  },
72
63
  templateDetails: {} //打开的模版
@@ -171,30 +162,26 @@ export var fetchQueryWorkOrder = createAsyncThunk('workOrder/queryWorkOrder', /*
171
162
 
172
163
  export var fetchQueryPaymentWorkOrderList = createAsyncThunk('workOrder/queryPaymentWorkOrderList', /*#__PURE__*/function () {
173
164
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_, action) {
174
- var _action$getState2, paySearch, global, timeType, _paySearch$time, start, end, workPayStatus, pageNo, pageSize, isBuyer, params, _yield$queryPaymentWo, data;
165
+ var _action$getState2, paySearch, global, _paySearch$tid, tid, _paySearch$paymentOrd, paymentOrderKey, time, workPayStatus, pageNo, pageSize, isBuyer, params, _yield$queryPaymentWo, data;
175
166
 
176
167
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
177
168
  while (1) {
178
169
  switch (_context4.prev = _context4.next) {
179
170
  case 0:
180
171
  _action$getState2 = action.getState(), paySearch = _action$getState2.workOrder.paySearch, global = _action$getState2.global;
181
- timeType = paySearch.timeType, _paySearch$time = _slicedToArray(paySearch.time, 2), start = _paySearch$time[0], end = _paySearch$time[1], workPayStatus = paySearch.workPayStatus, pageNo = paySearch.pageNo, pageSize = paySearch.pageSize, isBuyer = paySearch.isBuyer;
172
+ _paySearch$tid = paySearch.tid, tid = _paySearch$tid === void 0 ? undefined : _paySearch$tid, _paySearch$paymentOrd = paySearch.paymentOrderKey, paymentOrderKey = _paySearch$paymentOrd === void 0 ? undefined : _paySearch$paymentOrd, time = paySearch.time, workPayStatus = paySearch.workPayStatus, pageNo = paySearch.pageNo, pageSize = paySearch.pageSize, isBuyer = paySearch.isBuyer;
182
173
  params = {
183
174
  workPayStatus: workPayStatus,
184
175
  pageNo: pageNo,
185
176
  pageSize: pageSize,
186
177
  shopId: global.platformInfo.shopId
187
178
  };
179
+ tid && (params.tid = tid);
180
+ paymentOrderKey && (params.paymentOrderKey = paymentOrderKey);
188
181
 
189
- if (timeType === 'submitTime') {
190
- params.operateStartTime = start;
191
- params.operateEndTime = end;
192
- } else if (timeType === 'auditTime') {
193
- params.auditorStartTime = start;
194
- params.auditorEndTime = end;
195
- } else {
196
- params.workPayStartTime = start;
197
- params.workPayEndTime = end;
182
+ if (time.length) {
183
+ params.operateStartTime = moment(time[0]).format('YYYY-MM-DD HH:mm:ss');
184
+ params.operateEndTime = moment(new Date(time[1]).getTime() + 24 * 60 * 60 * 1000 - 1000).format('YYYY-MM-DD HH:mm:ss');
198
185
  }
199
186
 
200
187
  if (isBuyer) {
@@ -202,15 +189,15 @@ export var fetchQueryPaymentWorkOrderList = createAsyncThunk('workOrder/queryPay
202
189
  params.buyerOpenUid = global.platformInfo.buyerId;
203
190
  }
204
191
 
205
- _context4.next = 7;
192
+ _context4.next = 9;
206
193
  return queryPaymentWorkOrderList(params);
207
194
 
208
- case 7:
195
+ case 9:
209
196
  _yield$queryPaymentWo = _context4.sent;
210
197
  data = _yield$queryPaymentWo.data;
211
198
  return _context4.abrupt("return", data);
212
199
 
213
- case 10:
200
+ case 12:
214
201
  case "end":
215
202
  return _context4.stop();
216
203
  }
@@ -266,6 +253,7 @@ export var workOrderSlice = createSlice({
266
253
  var list = action.payload;
267
254
  var groupList = [];
268
255
  var tempList = [];
256
+ var enabledTemplateList = [];
269
257
  var groupAllList = list.reduce(function (prv, item) {
270
258
  if (item.workOrderTemplates.length) {
271
259
  var groupId = item.groupId,
@@ -282,6 +270,8 @@ export var workOrderSlice = createSlice({
282
270
 
283
271
  if (t.enabled) {
284
272
  tempList.push(t);
273
+ } else {
274
+ enabledTemplateList.push(t.uniqueKey);
285
275
  }
286
276
 
287
277
  return t.enabled;
@@ -296,6 +286,7 @@ export var workOrderSlice = createSlice({
296
286
  return prv;
297
287
  }, []);
298
288
  state.groupAllList = groupAllList;
289
+ state.enabledTemplateList = enabledTemplateList;
299
290
  state.customSearch.tempSelect = (groupAllList === null || groupAllList === void 0 ? void 0 : groupAllList.length) && [(_groupAllList$ = groupAllList[0]) === null || _groupAllList$ === void 0 ? void 0 : _groupAllList$.value, (_groupAllList$2 = groupAllList[0]) === null || _groupAllList$2 === void 0 ? void 0 : (_groupAllList$2$child = _groupAllList$2.children[0]) === null || _groupAllList$2$child === void 0 ? void 0 : _groupAllList$2$child.value];
300
291
  }), builder.addCase(fetchQueryWorkOrder.pending, function (state) {
301
292
  state.loading = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kmkf-work-order-service-component",
3
- "version": "0.4.0-alpha.2",
3
+ "version": "0.4.0-alpha.21",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@ant-design/icons": "^4.7.0",
42
- "@raycloud-apaas-fe-setup/apaas-react-basics-widgets": "^1.1.2",
42
+ "@raycloud-apaas-fe-setup/apaas-react-basics-widgets": "^1.1.3-alpha.2",
43
43
  "@reduxjs/toolkit": "^1.8.5",
44
44
  "ahooks": "^3.7.4",
45
45
  "copy-to-clipboard": "^3.3.3",
@@ -1,17 +0,0 @@
1
- /// <reference types="react" />
2
- import 'moment/locale/zh-cn';
3
- import './index.less';
4
- declare type CustomizeFormModal = {
5
- width?: string;
6
- shopList: any[];
7
- look?: boolean;
8
- templateId: string;
9
- shopId: string;
10
- orderNo: string;
11
- buyerId: string;
12
- buyerNick: string;
13
- platform: string;
14
- onSuccess?: (val: any) => void;
15
- };
16
- declare const CustomizeFormModal: (props: CustomizeFormModal) => JSX.Element;
17
- export default CustomizeFormModal;