@kmkf-fe-packages/kmkf-work-order-service-component 2.2.44-beta.95 → 2.2.44-beta.96

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,8 @@
2
2
  .flowWorkOrderDetail {
3
3
  display: flex;
4
4
  flex-direction: column;
5
+ height: 100%;
6
+ min-height: 0;
5
7
  .ant-input-number {
6
8
  width: 200px
7
9
  }
@@ -50,13 +52,15 @@
50
52
  }
51
53
  }
52
54
  .center {
53
- height: calc(100vh - 168px);
54
- overflow-y: scroll;
55
+ flex: 1;
56
+ min-height: 0;
57
+ overflow-y: auto;
55
58
  padding: 8px 0px;
56
59
  }
57
60
 
58
61
  .readonly, .center {
59
- height: 100%;
62
+ flex: 1;
63
+ min-height: 0;
60
64
  overflow-y: auto;
61
65
  }
62
66
  .hasStatus {
@@ -1,3 +1,11 @@
1
+ /*
2
+ * @Author: wangzhenggui jianjia.wzg@raycloud.com
3
+ * @Date: 2026-04-10 14:32:36
4
+ * @LastEditors: wangzhenggui jianjia.wzg@raycloud.com
5
+ * @LastEditTime: 2026-04-10 15:03:30
6
+ * @FilePath: /kmkf-fe-packages/packages/kmkf-work-order-service-component/src/KmErpTradeList/components/Search.tsx
7
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
8
+ */
1
9
  import { Input } from 'antd';
2
10
  import React from 'react';
3
11
  /**
@@ -22,7 +30,6 @@ var Search = function Search(props) {
22
30
  placeholder: "\u8BF7\u8F93\u5165\u5E73\u53F0\u8BA2\u5355\u53F7\u641C\u7D22",
23
31
  allowClear: true,
24
32
  enterButton: "\u67E5\u8BE2",
25
- size: "large",
26
33
  onSearch: handleSearch,
27
34
  disabled: disabled
28
35
  }));
@@ -0,0 +1,7 @@
1
+ declare type LogicFlow = {
2
+ id: string;
3
+ name: string;
4
+ key: string;
5
+ };
6
+ export declare const filterFlowTemplates: (flowList: LogicFlow[], keyword: string) => LogicFlow[];
7
+ export {};
@@ -0,0 +1,10 @@
1
+ export var filterFlowTemplates = function filterFlowTemplates(flowList, keyword) {
2
+ var normalizedKeyword = keyword.trim();
3
+ if (!normalizedKeyword) {
4
+ return flowList;
5
+ }
6
+ return flowList.filter(function (item) {
7
+ var _item$name;
8
+ return (_item$name = item.name) === null || _item$name === void 0 ? void 0 : _item$name.includes(normalizedKeyword);
9
+ });
10
+ };
@@ -5,7 +5,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5
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
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import React, { useState } from 'react';
8
- import { Divider, Tag, Tooltip, message, Button, List, Empty, Drawer } from 'antd';
8
+ import { Divider, Tag, Tooltip, message, Button, List, Empty, Drawer, Input } from 'antd';
9
9
  import { CopyOutlined, LeftOutlined } from '@ant-design/icons';
10
10
  import copy from 'copy-to-clipboard';
11
11
  import { useSelector } from 'react-redux';
@@ -14,6 +14,7 @@ import PlatformOrderCard from "./PlatformOrderCard";
14
14
  import OrderLogDrawer from "./OrderLogDrawer";
15
15
  import FlowTemplateDetail from "../../FlowTemplateDetailV2";
16
16
  import { selectFlowList } from "../../model/logicFlow/selector";
17
+ import { filterFlowTemplates } from "./SystemOrderCard.filter";
17
18
  import "./index.less";
18
19
  // 系统状态映射 - 中文标签
19
20
  var SYS_STATUS_LABEL = {
@@ -60,37 +61,41 @@ var SYS_STATUS_COLOR = {
60
61
  var SystemOrderCard = function SystemOrderCard(_ref) {
61
62
  var _order$subOrders2, _order$subOrders2$;
62
63
  var order = _ref.order;
63
- var _useState = useState(false),
64
+ var _useState = useState(''),
64
65
  _useState2 = _slicedToArray(_useState, 2),
65
- logDrawerVisible = _useState2[0],
66
- setLogDrawerVisible = _useState2[1];
66
+ templateSearchValue = _useState2[0],
67
+ setTemplateSearchValue = _useState2[1];
67
68
  var _useState3 = useState(false),
68
69
  _useState4 = _slicedToArray(_useState3, 2),
69
- flowTemplateDrawerVisible = _useState4[0],
70
- setFlowTemplateDrawerVisible = _useState4[1];
70
+ logDrawerVisible = _useState4[0],
71
+ setLogDrawerVisible = _useState4[1];
71
72
  var _useState5 = useState(false),
72
73
  _useState6 = _slicedToArray(_useState5, 2),
73
- templateDrawerVisible = _useState6[0],
74
- setTemplateDrawerVisible = _useState6[1];
75
- var _useState7 = useState(null),
74
+ flowTemplateDrawerVisible = _useState6[0],
75
+ setFlowTemplateDrawerVisible = _useState6[1];
76
+ var _useState7 = useState(false),
76
77
  _useState8 = _slicedToArray(_useState7, 2),
77
- selectedFlow = _useState8[0],
78
- setSelectedFlow = _useState8[1];
78
+ templateDrawerVisible = _useState8[0],
79
+ setTemplateDrawerVisible = _useState8[1];
80
+ var _useState9 = useState(null),
81
+ _useState10 = _slicedToArray(_useState9, 2),
82
+ selectedFlow = _useState10[0],
83
+ setSelectedFlow = _useState10[1];
79
84
  var flowList = useSelector(selectFlowList);
80
85
  var shopList = useAppSelector(function (state) {
81
- return state.kmErpTradeList.userInfo.shopList;
86
+ return state.workOrder.userInfo.shopList;
82
87
  });
83
88
  var accountName = useAppSelector(function (state) {
84
- return state.kmErpTradeList.userInfo.account;
89
+ return state.workOrder.userInfo.account;
85
90
  });
86
91
  var companyKey = useAppSelector(function (state) {
87
- return state.kmErpTradeList.userInfo.companyKey;
92
+ return state.workOrder.userInfo.companyKey;
88
93
  });
89
94
  var bindERP = useAppSelector(function (state) {
90
- return state.kmErpTradeList.userInfo.bindERP;
95
+ return state.workOrder.userInfo.bindERP;
91
96
  });
92
97
  var platformInfo = useAppSelector(function (state) {
93
- return state.kmErpTradeList.platformInfo;
98
+ return state.global.platformInfo;
94
99
  });
95
100
  var buyerNick = platformInfo.buyerNick,
96
101
  buyerId = platformInfo.buyerId,
@@ -99,14 +104,14 @@ var SystemOrderCard = function SystemOrderCard(_ref) {
99
104
  userKey = platformInfo.userKey;
100
105
  var hasBindWdt = useAppSelector(function (state) {
101
106
  var _JSON$parse, _JSON$parse$plugins, _JSON$parse$plugins$w;
102
- return ((_JSON$parse = JSON.parse(state.kmErpTradeList.userInfo.companyUserConfig || '{}')) === null || _JSON$parse === void 0 ? void 0 : (_JSON$parse$plugins = _JSON$parse.plugins) === null || _JSON$parse$plugins === void 0 ? void 0 : (_JSON$parse$plugins$w = _JSON$parse$plugins.wdt) === null || _JSON$parse$plugins$w === void 0 ? void 0 : _JSON$parse$plugins$w.show) || false;
107
+ return ((_JSON$parse = JSON.parse(state.workOrder.userInfo.companyUserConfig || '{}')) === null || _JSON$parse === void 0 ? void 0 : (_JSON$parse$plugins = _JSON$parse.plugins) === null || _JSON$parse$plugins === void 0 ? void 0 : (_JSON$parse$plugins$w = _JSON$parse$plugins.wdt) === null || _JSON$parse$plugins$w === void 0 ? void 0 : _JSON$parse$plugins$w.show) || false;
103
108
  });
104
109
  var hasBindJst = useAppSelector(function (state) {
105
110
  var _JSON$parse2, _JSON$parse2$plugins, _JSON$parse2$plugins$;
106
- return ((_JSON$parse2 = JSON.parse(state.kmErpTradeList.userInfo.companyUserConfig || '{}')) === null || _JSON$parse2 === void 0 ? void 0 : (_JSON$parse2$plugins = _JSON$parse2.plugins) === null || _JSON$parse2$plugins === void 0 ? void 0 : (_JSON$parse2$plugins$ = _JSON$parse2$plugins.jst) === null || _JSON$parse2$plugins$ === void 0 ? void 0 : _JSON$parse2$plugins$.show) || false;
111
+ return ((_JSON$parse2 = JSON.parse(state.workOrder.userInfo.companyUserConfig || '{}')) === null || _JSON$parse2 === void 0 ? void 0 : (_JSON$parse2$plugins = _JSON$parse2.plugins) === null || _JSON$parse2$plugins === void 0 ? void 0 : (_JSON$parse2$plugins$ = _JSON$parse2$plugins.jst) === null || _JSON$parse2$plugins$ === void 0 ? void 0 : _JSON$parse2$plugins$.show) || false;
107
112
  });
108
113
  var hasSuperAdminRole = useAppSelector(function (state) {
109
- return state.kmErpTradeList.userInfo.hasSuperAdminRole;
114
+ return state.workOrder.userInfo.hasSuperAdminRole;
110
115
  });
111
116
  var sid = order.sid,
112
117
  sysStatus = order.sysStatus,
@@ -149,6 +154,7 @@ var SystemOrderCard = function SystemOrderCard(_ref) {
149
154
  // 关闭模板选择抽屉
150
155
  var handleCloseTemplateDrawer = function handleCloseTemplateDrawer() {
151
156
  setTemplateDrawerVisible(false);
157
+ setTemplateSearchValue('');
152
158
  };
153
159
 
154
160
  // 选择工单模板
@@ -194,12 +200,23 @@ var SystemOrderCard = function SystemOrderCard(_ref) {
194
200
  if (!status) return 'default';
195
201
  return SYS_STATUS_COLOR[status] || 'processing';
196
202
  };
203
+ var filteredFlowList = filterFlowTemplates(flowList || [], templateSearchValue);
204
+ var isSearching = Boolean(templateSearchValue.trim());
197
205
 
198
206
  // 模板选择抽屉内容
199
207
  var templateDrawerContent = /*#__PURE__*/React.createElement("div", {
200
208
  className: "flow-list-popover"
201
- }, flowList && flowList.length > 0 ? /*#__PURE__*/React.createElement(List, {
202
- dataSource: flowList,
209
+ }, /*#__PURE__*/React.createElement("div", {
210
+ className: "flow-list-search"
211
+ }, /*#__PURE__*/React.createElement(Input.Search, {
212
+ placeholder: "\u8BF7\u8F93\u5165\u6A21\u677F\u540D\u79F0",
213
+ value: templateSearchValue,
214
+ onChange: function onChange(e) {
215
+ return setTemplateSearchValue(e.target.value);
216
+ },
217
+ allowClear: true
218
+ })), flowList && flowList.length > 0 ? filteredFlowList.length > 0 ? /*#__PURE__*/React.createElement(List, {
219
+ dataSource: filteredFlowList,
203
220
  className: "flow-list",
204
221
  grid: {
205
222
  gutter: 8,
@@ -218,6 +235,11 @@ var SystemOrderCard = function SystemOrderCard(_ref) {
218
235
  }
219
236
  }) : /*#__PURE__*/React.createElement("div", {
220
237
  className: "flow-list-empty"
238
+ }, /*#__PURE__*/React.createElement(Empty, {
239
+ description: isSearching ? '未找到匹配的工单模板' : '暂无工单模板',
240
+ image: Empty.PRESENTED_IMAGE_SIMPLE
241
+ })) : /*#__PURE__*/React.createElement("div", {
242
+ className: "flow-list-empty"
221
243
  }, /*#__PURE__*/React.createElement(Empty, {
222
244
  description: "\u6682\u65E0\u5DE5\u5355\u6A21\u677F",
223
245
  image: Empty.PRESENTED_IMAGE_SIMPLE
@@ -1,17 +1,16 @@
1
1
  import React from 'react';
2
2
  import './index.less';
3
3
  interface KmErpTradeListProps {
4
- isTbZnkf?: boolean;
5
- platform?: string;
6
- shopId?: string;
7
- buyerNick?: string;
4
+ isHistory: boolean;
8
5
  buyerId?: string;
9
- orderNo?: string;
10
- userKey?: string;
11
- otherInfo?: any;
12
- platInfo?: any;
13
- onEmpowerCallback?: () => void;
14
- onOpenWangWang?: (nick: string, id: string) => void;
6
+ shopId?: string;
15
7
  }
16
- declare const KmErpTradeListWrap: (props: KmErpTradeListProps) => React.JSX.Element;
17
- export default KmErpTradeListWrap;
8
+ /**
9
+ * 快麦 ERP 订单列表组件
10
+ * 使用场景:
11
+ * - 组件接受一个 buyerId 的 Props
12
+ * - 当 buyerId 不为空且每次发生变化之后重新调用订单列表接口
13
+ * - 如果该参数为空时,订单列表区域展示请选择当前买家的 Empty 提示
14
+ */
15
+ declare const KmErpTradeList: React.FC<KmErpTradeListProps>;
16
+ export default KmErpTradeList;
@@ -1,21 +1,21 @@
1
- /*
2
- * @Author: wangzhenggui jianjia.wzg@raycloud.com
3
- * @Date: 2026-04-02 10:55:30
4
- * @LastEditors: wangzhenggui jianjia.wzg@raycloud.com
5
- * @LastEditTime: 2026-04-07 15:22:51
6
- * @FilePath: /kmkf-fe-packages/packages/kmkf-work-order-service-component/src/KmErpTradeList/index.tsx
7
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AEit
8
- */
9
- import React, { useEffect } from 'react';
10
- import { Provider } from 'react-redux';
11
- import { Tabs, ConfigProvider } from 'antd';
12
- import store from "../model/store";
13
- import { useAppDispatch } from "../model/hooks";
14
- import { fetchLogicFlowList } from "../model/logicFlow";
15
- import { fetchQueryCurrentCompanyUser } from "../model/kmErpTradeList";
16
- import TradeList from "./TradeList";
17
- import zhCN from 'antd/es/locale/zh_CN';
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ 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, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $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 defineProperty(generator, "_invoke", { value: makeInvokeMethod(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; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(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); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), 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, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), 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 (val) { var object = Object(val), 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; }
3
+ 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); } }
4
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
5
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
+ 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."); }
7
+ 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); }
8
+ 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; }
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
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
+ import React, { useEffect, useState } from 'react';
12
+ import { Empty } from 'antd';
13
+ import Search from "./components/Search";
14
+ import TradeList from "./components/TradeList";
15
+ import { kmErpOrderDetail } from "./api";
18
16
  import "./index.less";
17
+ var DEFAULT_PAGE_SIZE = 20;
18
+
19
19
  /**
20
20
  * 快麦 ERP 订单列表组件
21
21
  * 使用场景:
@@ -24,69 +24,148 @@ import "./index.less";
24
24
  * - 如果该参数为空时,订单列表区域展示请选择当前买家的 Empty 提示
25
25
  */
26
26
  var KmErpTradeList = function KmErpTradeList(props) {
27
- var dispatch = useAppDispatch();
28
- var platform = props.platform,
29
- _props$isTbZnkf = props.isTbZnkf,
30
- isTbZnkf = _props$isTbZnkf === void 0 ? false : _props$isTbZnkf,
27
+ var _useState = useState(false),
28
+ _useState2 = _slicedToArray(_useState, 2),
29
+ loading = _useState2[0],
30
+ setLoading = _useState2[1];
31
+ var _useState3 = useState([]),
32
+ _useState4 = _slicedToArray(_useState3, 2),
33
+ list = _useState4[0],
34
+ setList = _useState4[1];
35
+ var _useState5 = useState(0),
36
+ _useState6 = _slicedToArray(_useState5, 2),
37
+ total = _useState6[0],
38
+ setTotal = _useState6[1];
39
+ var _useState7 = useState(1),
40
+ _useState8 = _slicedToArray(_useState7, 2),
41
+ pageNo = _useState8[0],
42
+ setPageNo = _useState8[1];
43
+ var _useState9 = useState(''),
44
+ _useState10 = _slicedToArray(_useState9, 2),
45
+ searchTid = _useState10[0],
46
+ setSearchTid = _useState10[1];
47
+ var _useState11 = useState(''),
48
+ _useState12 = _slicedToArray(_useState11, 2),
49
+ error = _useState12[0],
50
+ setError = _useState12[1];
51
+ var buyerId = props.buyerId,
31
52
  shopId = props.shopId,
32
- buyerNick = props.buyerNick,
33
- buyerId = props.buyerId,
34
- orderNo = props.orderNo,
35
- userKey = props.userKey,
36
- _props$otherInfo = props.otherInfo,
37
- otherInfo = _props$otherInfo === void 0 ? {} : _props$otherInfo;
38
- useEffect(function () {
39
- //存储平台信息
40
- dispatch({
41
- type: 'kmErpTradeList/setState',
42
- payload: {
43
- platformInfo: {
44
- isTbZnkf: isTbZnkf,
45
- platform: platform,
46
- shopId: shopId,
47
- buyerNick: buyerNick,
48
- buyerId: buyerId,
49
- orderNo: orderNo,
50
- userKey: userKey,
51
- otherInfo: otherInfo
53
+ isHistory = props.isHistory;
54
+
55
+ // 获取订单列表
56
+ var fetchOrderList = /*#__PURE__*/function () {
57
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
58
+ var page,
59
+ tid,
60
+ res,
61
+ _args = arguments;
62
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
63
+ while (1) switch (_context.prev = _context.next) {
64
+ case 0:
65
+ page = _args.length > 0 && _args[0] !== undefined ? _args[0] : 1;
66
+ tid = _args.length > 1 ? _args[1] : undefined;
67
+ if (!(!buyerId && !tid)) {
68
+ _context.next = 8;
69
+ break;
70
+ }
71
+ setList([]);
72
+ setTotal(0);
73
+ setError('');
74
+ setLoading(false);
75
+ return _context.abrupt("return");
76
+ case 8:
77
+ setLoading(true);
78
+ setError('');
79
+ _context.prev = 10;
80
+ _context.next = 13;
81
+ return kmErpOrderDetail({
82
+ buyerOpenUid: buyerId,
83
+ shopIdList: shopId ? [shopId] : [],
84
+ tid: tid || searchTid,
85
+ pageNo: page,
86
+ pageSize: DEFAULT_PAGE_SIZE,
87
+ timeRangeType: isHistory ? 'BEFORE_LIMIT' : 'WITHIN_LIMIT'
88
+ });
89
+ case 13:
90
+ res = _context.sent;
91
+ if (res !== null && res !== void 0 && res.success && res !== null && res !== void 0 && res.data) {
92
+ setList(res.data.orderDetailDtoList || []);
93
+ setTotal(res.data.total || 0);
94
+ setPageNo(page);
95
+ } else {
96
+ setError((res === null || res === void 0 ? void 0 : res.message) || '获取订单列表失败');
97
+ }
98
+ _context.next = 20;
99
+ break;
100
+ case 17:
101
+ _context.prev = 17;
102
+ _context.t0 = _context["catch"](10);
103
+ setError((_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.message) || '请求失败,请稍后重试');
104
+ case 20:
105
+ _context.prev = 20;
106
+ setLoading(false);
107
+ return _context.finish(20);
108
+ case 23:
109
+ case "end":
110
+ return _context.stop();
52
111
  }
53
- }
54
- });
55
- }, [platform, shopId, buyerNick, buyerId, orderNo, userKey, otherInfo]);
56
- var initHandle = function initHandle() {
57
- dispatch(fetchLogicFlowList);
58
- dispatch(fetchQueryCurrentCompanyUser());
59
- };
112
+ }, _callee, null, [[10, 17, 20, 23]]);
113
+ }));
114
+ return function fetchOrderList() {
115
+ return _ref.apply(this, arguments);
116
+ };
117
+ }();
118
+
119
+ // 监听 buyerId 变化
60
120
  useEffect(function () {
61
- initHandle();
62
- }, []);
121
+ if (buyerId) {
122
+ // 重置搜索条件和分页
123
+ setSearchTid('');
124
+ fetchOrderList(1, '');
125
+ }
126
+ }, [buyerId]);
127
+
128
+ // 搜索处理
129
+ var handleSearch = function handleSearch(params) {
130
+ var tid = params.value.tid || '';
131
+ setSearchTid(tid);
132
+ fetchOrderList(1, tid);
133
+ };
134
+
135
+ // 分页处理
136
+ var handlePageChange = function handlePageChange(page) {
137
+ fetchOrderList(page, searchTid);
138
+ };
139
+
140
+ // buyerId 为空时显示空状态
141
+ if (!buyerId) {
142
+ return /*#__PURE__*/React.createElement("div", {
143
+ className: "km-erp-trade-list-container"
144
+ }, /*#__PURE__*/React.createElement(Search, {
145
+ onSearch: handleSearch,
146
+ disabled: true
147
+ }), /*#__PURE__*/React.createElement("div", {
148
+ className: "km-erp-trade-list-content"
149
+ }, /*#__PURE__*/React.createElement(Empty, {
150
+ description: "\u8BF7\u9009\u62E9\u5F53\u524D\u4E70\u5BB6"
151
+ })));
152
+ }
63
153
  return /*#__PURE__*/React.createElement("div", {
64
154
  className: "km-erp-trade-list-container"
65
- }, /*#__PURE__*/React.createElement(Tabs, {
66
- items: [{
67
- key: '1',
68
- label: '三个月内订单',
69
- children: /*#__PURE__*/React.createElement(TradeList, {
70
- isHistory: false,
71
- buyerId: buyerId,
72
- shopId: shopId
73
- })
74
- }, {
75
- key: '2',
76
- label: '归档订单',
77
- children: /*#__PURE__*/React.createElement(TradeList, {
78
- isHistory: true,
79
- buyerId: buyerId,
80
- shopId: shopId
81
- })
82
- }]
83
- }));
84
- };
85
- var KmErpTradeListWrap = function KmErpTradeListWrap(props) {
86
- return /*#__PURE__*/React.createElement(Provider, {
87
- store: store
88
- }, /*#__PURE__*/React.createElement(ConfigProvider, {
89
- locale: zhCN
90
- }, /*#__PURE__*/React.createElement(KmErpTradeList, props)));
155
+ }, /*#__PURE__*/React.createElement(Search, {
156
+ onSearch: handleSearch,
157
+ disabled: loading
158
+ }), /*#__PURE__*/React.createElement("div", {
159
+ className: "km-erp-trade-list-content"
160
+ }, /*#__PURE__*/React.createElement(TradeList, {
161
+ list: list,
162
+ loading: loading,
163
+ pageNo: pageNo,
164
+ pageSize: DEFAULT_PAGE_SIZE,
165
+ total: total,
166
+ onPageChange: handlePageChange,
167
+ error: error,
168
+ buyerId: buyerId
169
+ })));
91
170
  };
92
- export default KmErpTradeListWrap;
171
+ export default KmErpTradeList;
@@ -531,6 +531,10 @@
531
531
  }
532
532
 
533
533
  .flow-list-popover {
534
+ .flow-list-search {
535
+ margin-bottom: 16px;
536
+ }
537
+
534
538
  .flow-list {
535
539
  .flow-list-item {
536
540
  cursor: pointer;
@@ -2,6 +2,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2
2
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
3
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
4
4
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
6
+ 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."); }
7
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
8
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
5
9
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
10
  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."); }
7
11
  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); }
@@ -11,8 +15,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
15
  /*
12
16
  * @Author: wangzhenggui jianjia.wzg@raycloud.com
13
17
  * @Date: 2022-09-16 11:19:43
14
- * @LastEditors: litian
15
- * @LastEditTime: 2022-11-24 14:11:47
18
+ * @LastEditors: wangzhenggui jianjia.wzg@raycloud.com
19
+ * @LastEditTime: 2026-04-10 15:19:14
16
20
  * @FilePath: /kmkf-work-order-service-component/src/WorkOrder/index.tsx
17
21
  * @Description:
18
22
  *
@@ -33,6 +37,7 @@ import { LogoutOutlined } from '@ant-design/icons';
33
37
  import OrderList from "./components/WorkOrderList";
34
38
  import Reminder from "./components/Reminder";
35
39
  import WdtTradeList from "../WdtTradeList";
40
+ import TradeList from "../KmErpTradeList";
36
41
  import PaymentWorkOrderList from "./components/PaymentWorkOrderList";
37
42
  import CustomerServiceToDoList from "../CustomerServiceToDoList";
38
43
  import CustomerServiceToDoCard from "./components/CustomerServiceToDoCard";
@@ -50,7 +55,7 @@ message.config({
50
55
  rtl: false
51
56
  });
52
57
  var WorkOrder = function WorkOrder(props) {
53
- var _companyUserConfig, _companyUserConfig$pd, _companyUserConfig2, _companyUserConfig2$p, _companyUserConfig2$p2;
58
+ var _companyUserConfig, _companyUserConfig$pd, _companyUserConfig4, _companyUserConfig4$f, _companyUserConfig5, _companyUserConfig5$k, _companyUserConfig8, _companyUserConfig8$f, _companyUserConfig9, _companyUserConfig9$k, _companyUserConfig10, _companyUserConfig10$, _companyUserConfig10$2;
54
59
  var platform = props.platform,
55
60
  _props$isTbZnkf = props.isTbZnkf,
56
61
  isTbZnkf = _props$isTbZnkf === void 0 ? false : _props$isTbZnkf,
@@ -176,11 +181,27 @@ var WorkOrder = function WorkOrder(props) {
176
181
  setIsEmpower(_isEmpower);
177
182
  }
178
183
  }, [shopList]);
184
+ useEffect(function () {
185
+ var _companyUserConfig2, _companyUserConfig2$f, _companyUserConfig3, _companyUserConfig3$k;
186
+ if (platform === PlatForm.FXG && (_companyUserConfig2 = companyUserConfig) !== null && _companyUserConfig2 !== void 0 && (_companyUserConfig2$f = _companyUserConfig2.fxg) !== null && _companyUserConfig2$f !== void 0 && _companyUserConfig2$f.isShowErpTradeList || platform === PlatForm.KS && (_companyUserConfig3 = companyUserConfig) !== null && _companyUserConfig3 !== void 0 && (_companyUserConfig3$k = _companyUserConfig3.ks) !== null && _companyUserConfig3$k !== void 0 && _companyUserConfig3$k.isShowErpTradeList) {
187
+ setTabActive('kmErpTradeList');
188
+ }
189
+ }, [platform, (_companyUserConfig4 = companyUserConfig) === null || _companyUserConfig4 === void 0 ? void 0 : (_companyUserConfig4$f = _companyUserConfig4.fxg) === null || _companyUserConfig4$f === void 0 ? void 0 : _companyUserConfig4$f.isShowErpTradeList, (_companyUserConfig5 = companyUserConfig) === null || _companyUserConfig5 === void 0 ? void 0 : (_companyUserConfig5$k = _companyUserConfig5.ks) === null || _companyUserConfig5$k === void 0 ? void 0 : _companyUserConfig5$k.isShowErpTradeList]);
179
190
  var options = useMemo(function () {
191
+ var _companyUserConfig6, _companyUserConfig6$f, _companyUserConfig7, _companyUserConfig7$k;
180
192
  var opt = [{
181
193
  label: '自定义工单',
182
194
  value: 'custom'
183
195
  }];
196
+ if (platform === PlatForm.FXG && (_companyUserConfig6 = companyUserConfig) !== null && _companyUserConfig6 !== void 0 && (_companyUserConfig6$f = _companyUserConfig6.fxg) !== null && _companyUserConfig6$f !== void 0 && _companyUserConfig6$f.isShowErpTradeList || platform === PlatForm.KS && (_companyUserConfig7 = companyUserConfig) !== null && _companyUserConfig7 !== void 0 && (_companyUserConfig7$k = _companyUserConfig7.ks) !== null && _companyUserConfig7$k !== void 0 && _companyUserConfig7$k.isShowErpTradeList) {
197
+ opt = [{
198
+ label: '三个月内订单',
199
+ value: 'kmErpTradeList'
200
+ }, {
201
+ label: '归档订单',
202
+ value: 'kmErpTradeListHistory'
203
+ }].concat(_toConsumableArray(opt));
204
+ }
184
205
  if (isShowPayment) {
185
206
  opt.push({
186
207
  label: '打款工单',
@@ -194,7 +215,7 @@ var WorkOrder = function WorkOrder(props) {
194
215
  });
195
216
  }
196
217
  return opt;
197
- }, [isShowPayment, isShowWdt]);
218
+ }, [isShowPayment, isShowWdt, platform, (_companyUserConfig8 = companyUserConfig) === null || _companyUserConfig8 === void 0 ? void 0 : (_companyUserConfig8$f = _companyUserConfig8.fxg) === null || _companyUserConfig8$f === void 0 ? void 0 : _companyUserConfig8$f.isShowErpTradeList, (_companyUserConfig9 = companyUserConfig) === null || _companyUserConfig9 === void 0 ? void 0 : (_companyUserConfig9$k = _companyUserConfig9.ks) === null || _companyUserConfig9$k === void 0 ? void 0 : _companyUserConfig9$k.isShowErpTradeList]);
198
219
  var shopUniqueKey = useMemo(function () {
199
220
  var _find;
200
221
  return (_find = (shopList || []).find(function (item) {
@@ -353,7 +374,15 @@ var WorkOrder = function WorkOrder(props) {
353
374
  tabActive: tabActive,
354
375
  onOpenWangWang: onOpenWangWang
355
376
  }), tabActive === 'wdt' && /*#__PURE__*/React.createElement(WdtTradeList, {
356
- version: ((_companyUserConfig2 = companyUserConfig) === null || _companyUserConfig2 === void 0 ? void 0 : (_companyUserConfig2$p = _companyUserConfig2.plugins) === null || _companyUserConfig2$p === void 0 ? void 0 : (_companyUserConfig2$p2 = _companyUserConfig2$p.wdt) === null || _companyUserConfig2$p2 === void 0 ? void 0 : _companyUserConfig2$p2.version) || ''
377
+ version: ((_companyUserConfig10 = companyUserConfig) === null || _companyUserConfig10 === void 0 ? void 0 : (_companyUserConfig10$ = _companyUserConfig10.plugins) === null || _companyUserConfig10$ === void 0 ? void 0 : (_companyUserConfig10$2 = _companyUserConfig10$.wdt) === null || _companyUserConfig10$2 === void 0 ? void 0 : _companyUserConfig10$2.version) || ''
378
+ }), tabActive === 'kmErpTradeList' && /*#__PURE__*/React.createElement(TradeList, {
379
+ isHistory: false,
380
+ buyerId: buyerId,
381
+ shopId: shopId
382
+ }), tabActive === 'kmErpTradeListHistory' && /*#__PURE__*/React.createElement(TradeList, {
383
+ isHistory: true,
384
+ buyerId: buyerId,
385
+ shopId: shopId
357
386
  }), customerServiceToDoListOpen && /*#__PURE__*/React.createElement(CustomerServiceToDoList, {
358
387
  shopUniqueKey: shopUniqueKey
359
388
  }), [PlatForm.XIAOZHI].includes(platform) && (userInfo === null || userInfo === void 0 ? void 0 : userInfo.isAICreateOrder) && /*#__PURE__*/React.createElement(CustomerServiceToDoCard, {
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.44-beta.95",
3
+ "version": "2.2.44-beta.96",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -75,7 +75,7 @@
75
75
  "publishConfig": {
76
76
  "access": "public"
77
77
  },
78
- "gitHead": "e762245e5dfdb19966a19366af45ce56f7397b24",
78
+ "gitHead": "a164ac77bce709744010639ada694db0be99e5d5",
79
79
  "gitHooks": {
80
80
  "pre-commit": "lint-staged"
81
81
  }
@@ -1,16 +0,0 @@
1
- import React from 'react';
2
- import './index.less';
3
- interface KmErpTradeListProps {
4
- isHistory: boolean;
5
- buyerId?: string;
6
- shopId?: string;
7
- }
8
- /**
9
- * 快麦 ERP 订单列表组件
10
- * 使用场景:
11
- * - 组件接受一个 buyerId 的 Props
12
- * - 当 buyerId 不为空且每次发生变化之后重新调用订单列表接口
13
- * - 如果该参数为空时,订单列表区域展示请选择当前买家的 Empty 提示
14
- */
15
- declare const KmErpTradeList: React.FC<KmErpTradeListProps>;
16
- export default KmErpTradeList;
@@ -1,171 +0,0 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- 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, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $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 defineProperty(generator, "_invoke", { value: makeInvokeMethod(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; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(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); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), 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, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), 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 (val) { var object = Object(val), 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; }
3
- 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); } }
4
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
5
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
- 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."); }
7
- 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); }
8
- 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; }
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
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
- import React, { useEffect, useState } from 'react';
12
- import { Empty } from 'antd';
13
- import Search from "./components/Search";
14
- import TradeList from "./components/TradeList";
15
- import { kmErpOrderDetail } from "./api";
16
- import "./index.less";
17
- var DEFAULT_PAGE_SIZE = 20;
18
-
19
- /**
20
- * 快麦 ERP 订单列表组件
21
- * 使用场景:
22
- * - 组件接受一个 buyerId 的 Props
23
- * - 当 buyerId 不为空且每次发生变化之后重新调用订单列表接口
24
- * - 如果该参数为空时,订单列表区域展示请选择当前买家的 Empty 提示
25
- */
26
- var KmErpTradeList = function KmErpTradeList(props) {
27
- var _useState = useState(false),
28
- _useState2 = _slicedToArray(_useState, 2),
29
- loading = _useState2[0],
30
- setLoading = _useState2[1];
31
- var _useState3 = useState([]),
32
- _useState4 = _slicedToArray(_useState3, 2),
33
- list = _useState4[0],
34
- setList = _useState4[1];
35
- var _useState5 = useState(0),
36
- _useState6 = _slicedToArray(_useState5, 2),
37
- total = _useState6[0],
38
- setTotal = _useState6[1];
39
- var _useState7 = useState(1),
40
- _useState8 = _slicedToArray(_useState7, 2),
41
- pageNo = _useState8[0],
42
- setPageNo = _useState8[1];
43
- var _useState9 = useState(''),
44
- _useState10 = _slicedToArray(_useState9, 2),
45
- searchTid = _useState10[0],
46
- setSearchTid = _useState10[1];
47
- var _useState11 = useState(''),
48
- _useState12 = _slicedToArray(_useState11, 2),
49
- error = _useState12[0],
50
- setError = _useState12[1];
51
- var buyerId = props.buyerId,
52
- shopId = props.shopId,
53
- isHistory = props.isHistory;
54
-
55
- // 获取订单列表
56
- var fetchOrderList = /*#__PURE__*/function () {
57
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
58
- var page,
59
- tid,
60
- res,
61
- _args = arguments;
62
- return _regeneratorRuntime().wrap(function _callee$(_context) {
63
- while (1) switch (_context.prev = _context.next) {
64
- case 0:
65
- page = _args.length > 0 && _args[0] !== undefined ? _args[0] : 1;
66
- tid = _args.length > 1 ? _args[1] : undefined;
67
- if (!(!buyerId && !tid)) {
68
- _context.next = 8;
69
- break;
70
- }
71
- setList([]);
72
- setTotal(0);
73
- setError('');
74
- setLoading(false);
75
- return _context.abrupt("return");
76
- case 8:
77
- setLoading(true);
78
- setError('');
79
- _context.prev = 10;
80
- _context.next = 13;
81
- return kmErpOrderDetail({
82
- buyerOpenUid: buyerId,
83
- shopIdList: shopId ? [shopId] : [],
84
- tid: tid || searchTid,
85
- pageNo: page,
86
- pageSize: DEFAULT_PAGE_SIZE,
87
- timeRangeType: isHistory ? 'BEFORE_LIMIT' : 'WITHIN_LIMIT'
88
- });
89
- case 13:
90
- res = _context.sent;
91
- if (res !== null && res !== void 0 && res.success && res !== null && res !== void 0 && res.data) {
92
- setList(res.data.orderDetailDtoList || []);
93
- setTotal(res.data.total || 0);
94
- setPageNo(page);
95
- } else {
96
- setError((res === null || res === void 0 ? void 0 : res.message) || '获取订单列表失败');
97
- }
98
- _context.next = 20;
99
- break;
100
- case 17:
101
- _context.prev = 17;
102
- _context.t0 = _context["catch"](10);
103
- setError((_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.message) || '请求失败,请稍后重试');
104
- case 20:
105
- _context.prev = 20;
106
- setLoading(false);
107
- return _context.finish(20);
108
- case 23:
109
- case "end":
110
- return _context.stop();
111
- }
112
- }, _callee, null, [[10, 17, 20, 23]]);
113
- }));
114
- return function fetchOrderList() {
115
- return _ref.apply(this, arguments);
116
- };
117
- }();
118
-
119
- // 监听 buyerId 变化
120
- useEffect(function () {
121
- if (buyerId) {
122
- // 重置搜索条件和分页
123
- setSearchTid('');
124
- fetchOrderList(1, '');
125
- }
126
- }, [buyerId]);
127
-
128
- // 搜索处理
129
- var handleSearch = function handleSearch(params) {
130
- var tid = params.value.tid || '';
131
- setSearchTid(tid);
132
- fetchOrderList(1, tid);
133
- };
134
-
135
- // 分页处理
136
- var handlePageChange = function handlePageChange(page) {
137
- fetchOrderList(page, searchTid);
138
- };
139
-
140
- // buyerId 为空时显示空状态
141
- if (!buyerId) {
142
- return /*#__PURE__*/React.createElement("div", {
143
- className: "km-erp-trade-list-container"
144
- }, /*#__PURE__*/React.createElement(Search, {
145
- onSearch: handleSearch,
146
- disabled: true
147
- }), /*#__PURE__*/React.createElement("div", {
148
- className: "km-erp-trade-list-content"
149
- }, /*#__PURE__*/React.createElement(Empty, {
150
- description: "\u8BF7\u9009\u62E9\u5F53\u524D\u4E70\u5BB6"
151
- })));
152
- }
153
- return /*#__PURE__*/React.createElement("div", {
154
- className: "km-erp-trade-list-container"
155
- }, /*#__PURE__*/React.createElement(Search, {
156
- onSearch: handleSearch,
157
- disabled: loading
158
- }), /*#__PURE__*/React.createElement("div", {
159
- className: "km-erp-trade-list-content"
160
- }, /*#__PURE__*/React.createElement(TradeList, {
161
- list: list,
162
- loading: loading,
163
- pageNo: pageNo,
164
- pageSize: DEFAULT_PAGE_SIZE,
165
- total: total,
166
- onPageChange: handlePageChange,
167
- error: error,
168
- buyerId: buyerId
169
- })));
170
- };
171
- export default KmErpTradeList;