@kmkf-fe-packages/kmkf-work-order-service-component 2.2.25 → 2.2.26

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.
@@ -117,7 +117,8 @@ export var DEFAULT_STRING_COMPONENT_TYPE_FIELD_MAPPING = {
117
117
  SKX_CREATE_TIME: 'dateTime',
118
118
  SKX_OUTBOUND_NOTICE_NO: 'skxOutboundNoticeNo',
119
119
  ERP_ORDER_STATUS: 'erpOrderStatus',
120
- SKX_RETURN_BILL_NO: 'skxReturnBillNo'
120
+ SKX_RETURN_BILL_NO: 'skxReturnBillNo',
121
+ JST_OUTBOUND_STATUS: 'jstOutboundStatus'
121
122
  };
122
123
  export var DEFAULT_ARRAY_COMPONENT_TYPE_FIELD_MAPPING = {
123
124
  RATE: 'rate',
@@ -835,6 +835,7 @@ var processComponent = function processComponent(_ref59) {
835
835
  case 'SKX_OUTBOUND_NOTICE_NO':
836
836
  case 'ERP_ORDER_STATUS':
837
837
  case 'SKX_RETURN_BILL_NO':
838
+ case 'JST_OUTBOUND_STATUS':
838
839
  wrapFn(handleOnlyAddContent);
839
840
  break;
840
841
  case 'RATE':
@@ -64,7 +64,8 @@ var workTypeKeys = {
64
64
  BUSINESS_ORDER_NO: 'businessOrderNo',
65
65
  PAYMENT_VOUCHER_CODE: 'paymentVoucherCode',
66
66
  EXECUTE_ACTION_TYPE: 'executeActionType',
67
- ERP_ORDER_STATUS: 'erpOrderStatus'
67
+ ERP_ORDER_STATUS: 'erpOrderStatus',
68
+ JST_OUTBOUND_STATUS: 'jstOutboundStatus'
68
69
  };
69
70
 
70
71
  // 根据组件类型获取组件的UniqueKey
@@ -250,10 +251,11 @@ export var orderBack = /*#__PURE__*/function () {
250
251
  }));
251
252
  }
252
253
 
253
- // 京东自营订单数据获取
254
+ // 京东自营/pdd订单数据获取
254
255
  promise.push(
255
256
  // thirdShopSubType === 1 && shopSourceStr === 'JD' && window.invokerSDK
256
- shopSourceStr === 'JD' && window.invokerSDK ? xzSDK.getActiveUserTardeInfo(order_no) : Promise.reject());
257
+ // xzSDK.getActiveUserTardeInfoTest(order_no)
258
+ ['JD', 'PDD'].includes(shopSourceStr) && window.invokerSDK ? xzSDK.getActiveUserTardeInfo(order_no) : Promise.reject());
257
259
  Object.keys(hasFlagMap).forEach(function (key) {
258
260
  var _hasFlagMap$key = hasFlagMap[key],
259
261
  flag = _hasFlagMap$key.flag,
@@ -1158,7 +1160,7 @@ export var bsSystemOrderBackValues = function bsSystemOrderBackValues(_ref7) {
1158
1160
  //如果没有选择的值不返填,会有两种情况 1.有值为空 2.没有值 为空的时候需要返填
1159
1161
  if (!(value !== null && value !== void 0 && value.selectedRows)) return;
1160
1162
  var bsGoodsComponent = (_templateList$compone = templateList.componentDtoList) === null || _templateList$compone === void 0 ? void 0 : _templateList$compone.filter(function (item) {
1161
- return ['BS_GOODS', 'BS_DELIVERY_NO', 'BS_SEND_GOOD', 'BS_LOGISTICS', 'LOGISTICS_TRAJECTORY_MORE', 'LOGISTICS_INTERCEPTION_MORE'].includes(item.workOrderComponentType);
1163
+ return ['BS_GOODS', 'BS_DELIVERY_NO', 'BS_SEND_GOOD', 'BS_LOGISTICS', 'BS_REISSUE_GOODS', 'BS_RETURN_GOODS', 'BS_EXCHANGE_GOODS', 'LOGISTICS_TRAJECTORY_MORE', 'LOGISTICS_INTERCEPTION_MORE'].includes(item.workOrderComponentType);
1162
1164
  });
1163
1165
  if (!(bsGoodsComponent !== null && bsGoodsComponent !== void 0 && bsGoodsComponent.length)) return;
1164
1166
  var bsGoodsValue = form.getFieldValue(bsGoodsComponent[0].uniqueKey);
@@ -883,6 +883,11 @@ var processErpOrderStatus = function processErpOrderStatus(getValue) {
883
883
  return _defineProperty({}, nex.uniqueKey, getValue("".concat(nex.uniqueKey, "_erpOrderStatus")) || (config === null || config === void 0 ? void 0 : config.select));
884
884
  };
885
885
  };
886
+ var processJstOutboundStatus = function processJstOutboundStatus(getValue) {
887
+ return function (nex, config) {
888
+ return _defineProperty({}, nex.uniqueKey, getValue("".concat(nex.uniqueKey, "_jstOutboundStatus")) || (config === null || config === void 0 ? void 0 : config.select));
889
+ };
890
+ };
886
891
  var processRefundType = function processRefundType(getValue) {
887
892
  return function (nex, config) {
888
893
  return _defineProperty({}, nex.uniqueKey, getValue("".concat(nex.uniqueKey, "_orderRefundType")) || (config === null || config === void 0 ? void 0 : config.select));
@@ -1120,14 +1125,14 @@ var processJstReturnGoods = function processJstReturnGoods(templateColumns) {
1120
1125
  };
1121
1126
  var processLabel = function processLabel(getValue) {
1122
1127
  return function (nex, config) {
1123
- var _ref77;
1124
- return _ref77 = {}, _defineProperty(_ref77, nex.uniqueKey, jsonParseSecurity(getValue("".concat(nex.uniqueKey, "_label")), [])), _defineProperty(_ref77, "".concat(nex.uniqueKey, "_label"), jsonParseSecurity(getValue("".concat(nex.uniqueKey, "_label")), [])), _ref77;
1128
+ var _ref78;
1129
+ return _ref78 = {}, _defineProperty(_ref78, nex.uniqueKey, jsonParseSecurity(getValue("".concat(nex.uniqueKey, "_label")), [])), _defineProperty(_ref78, "".concat(nex.uniqueKey, "_label"), jsonParseSecurity(getValue("".concat(nex.uniqueKey, "_label")), [])), _ref78;
1125
1130
  };
1126
1131
  };
1127
1132
  var processMemberLevel = function processMemberLevel(getValue) {
1128
1133
  return function (nex, config) {
1129
- var _ref78;
1130
- return _ref78 = {}, _defineProperty(_ref78, nex.uniqueKey, jsonParseSecurity(getValue("".concat(nex.uniqueKey, "_memberLevel")), [])), _defineProperty(_ref78, "".concat(nex.uniqueKey, "_memberLevel"), jsonParseSecurity(getValue("".concat(nex.uniqueKey, "_memberLevel")), [])), _ref78;
1134
+ var _ref79;
1135
+ return _ref79 = {}, _defineProperty(_ref79, nex.uniqueKey, jsonParseSecurity(getValue("".concat(nex.uniqueKey, "_memberLevel")), [])), _defineProperty(_ref79, "".concat(nex.uniqueKey, "_memberLevel"), jsonParseSecurity(getValue("".concat(nex.uniqueKey, "_memberLevel")), [])), _ref79;
1131
1136
  };
1132
1137
  };
1133
1138
  var processAfterSalesOrderId = function processAfterSalesOrderId(getValue) {
@@ -1273,6 +1278,7 @@ var transformWorkOrderData = function transformWorkOrderData(templateColumns) {
1273
1278
  BUYER_MESSAGE_NOTICE: processBuyerMessageNotice,
1274
1279
  ORDER_TYPE: processOrderType,
1275
1280
  ERP_ORDER_STATUS: processErpOrderStatus,
1281
+ JST_OUTBOUND_STATUS: processJstOutboundStatus,
1276
1282
  REFUND_TYPE: processRefundType,
1277
1283
  RETURN_GOODS_TRADE_ID: processErpTradeId,
1278
1284
  BS_DELIVERY_NO: processErpTradeId,
@@ -104,10 +104,70 @@ declare type JDTradesRes = {
104
104
  subCode: string;
105
105
  uid: string;
106
106
  };
107
- export declare type ActiveUserTardeInfo = JDTrade & Buyer;
107
+ declare type PDDTrade = {
108
+ orderSn: string;
109
+ orderTime: number;
110
+ createdAt: number;
111
+ payTime: number;
112
+ orderStatusStr: string;
113
+ orderAmount: number;
114
+ goodsAmount: number;
115
+ trackingNumber: string;
116
+ note: string;
117
+ tagType: string;
118
+ orderGoodsList: {
119
+ goodsName: string;
120
+ goodsNumber: number;
121
+ goodsPrice: number;
122
+ skuId: string;
123
+ spec: string;
124
+ thumbUrl: string;
125
+ };
126
+ };
127
+ declare type PDDTradesRes = {
128
+ errorCode: number;
129
+ errorMsg: string | null;
130
+ req_id: string;
131
+ result: {
132
+ historyTotal: null;
133
+ historyTotalPeriodCode: number;
134
+ pageNo: number;
135
+ pageSize: number;
136
+ total: number;
137
+ orders: PDDTrade[];
138
+ };
139
+ success: boolean;
140
+ uid: string;
141
+ };
142
+ declare type TradesRes = JDTradesRes | PDDTradesRes;
143
+ declare type Trade = JDTrade | PDDTrade;
144
+ export declare type ActiveUserTardeInfo = Trade & Buyer;
108
145
  declare const _default: {
109
146
  getActiveUser: () => Promise<Buyer>;
110
147
  getActiveUserTardeInfo: (orderId: string) => Promise<void | {
148
+ orderNo: string;
149
+ buyerNick: string;
150
+ buyerOpenUid: string | number;
151
+ orderCreateDateTime: string | number;
152
+ orderPaymentDateTime: string | number;
153
+ actualReceiptPayment: number | undefined;
154
+ expressLogisticsCode: string;
155
+ itemList: {
156
+ numIid: string;
157
+ title: string;
158
+ price: number | undefined;
159
+ platform: string;
160
+ num: number;
161
+ skuInfoDTO: {
162
+ picUrl: string;
163
+ price: number | undefined;
164
+ skuId: string;
165
+ propertiesName: string;
166
+ };
167
+ }[];
168
+ remark: string;
169
+ flag: number | undefined;
170
+ } | {
111
171
  orderNo: string;
112
172
  buyerNick: string;
113
173
  buyerOpenUid: string | number;
@@ -127,8 +187,11 @@ declare const _default: {
127
187
  };
128
188
  }[];
129
189
  remark: string;
190
+ actualReceiptPayment?: undefined;
191
+ expressLogisticsCode?: undefined;
192
+ flag?: undefined;
130
193
  } | undefined>;
131
- getTradeInfoByBuyerId: (buyerId: string | number) => Promise<JDTradesRes>;
194
+ getTradeInfoByBuyerId: (buyerId: string | number) => Promise<TradesRes>;
132
195
  receiveTabMsg: (dispatch: any) => void;
133
196
  };
134
197
  export default _default;
@@ -2,9 +2,21 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2
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
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
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 ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
+ 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; }
8
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
9
+ 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); }
10
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
11
+ 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."); }
12
+ 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); }
13
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
14
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
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; }
5
16
  import { message } from 'antd';
6
17
  var globalResolveMap = new Map();
7
18
  window.replyTradeInfo = function (res) {
19
+ console.debug("in replyTradeInfo res:", res);
8
20
  var jsonRes = JSON.parse(res);
9
21
  if (jsonRes.reqId && globalResolveMap.has(jsonRes.reqId)) {
10
22
  var _globalResolveMap$get;
@@ -130,33 +142,132 @@ var getTradeInfoByBuyerId = function getTradeInfoByBuyerId(buyerId) {
130
142
  code: -1,
131
143
  msg: '请检查当前环境是否属于小智面板'
132
144
  });
133
- var reqId = "".concat(Date.now(), "_").concat(buyerId);
134
145
  setTimeout(function () {
135
146
  reject(new Error('window.invokerSDK执行超时,未调用回调函数'));
136
147
  }, 30000);
137
- // getTradeInfo 同步回调不再执行, 所以默认记录reqId
138
- globalResolveMap.set(reqId, resolve);
139
- window.invokerSDK(jsonToBase64({
140
- cmd: 'getTradeInfo',
141
- param: {
142
- reqId: reqId,
143
- buyerId: buyerId
144
- }
145
- }), function (cmd, res) {
146
- var jsonRes = JSON.parse(res);
147
- if (jsonRes.code === 200) {
148
- // globalResolveMap.set(reqId, resolve);
149
- } else {
150
- reject(jsonRes.msg || jsonRes);
151
- }
152
- });
148
+ var allOrders = [];
149
+ var getOrders = function getOrders() {
150
+ var pageNo = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
151
+ var pageSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 40;
152
+ var checkIsGetAll = function checkIsGetAll(res) {
153
+ var _res$data, _res$result;
154
+ var list = 'data' in res ? (res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.data) || [] : (res === null || res === void 0 ? void 0 : (_res$result = res.result) === null || _res$result === void 0 ? void 0 : _res$result.orders) || [];
155
+ allOrders.push.apply(allOrders, _toConsumableArray(list));
156
+ if (list.length < pageSize || 'result' in res && res.result.pageNo !== pageNo || 'data' in res && (!res.data.totalSize || res.data.totalSize <= allOrders.length)) {
157
+ if ('data' in res) {
158
+ resolve(_objectSpread(_objectSpread({}, res), {}, {
159
+ data: _objectSpread(_objectSpread({}, res.data), {}, {
160
+ data: allOrders
161
+ })
162
+ }));
163
+ } else {
164
+ resolve(_objectSpread(_objectSpread({}, res), {}, {
165
+ result: _objectSpread(_objectSpread({}, res.result), {}, {
166
+ orders: allOrders
167
+ })
168
+ }));
169
+ }
170
+ } else {
171
+ getOrders(pageNo + 1, pageSize);
172
+ }
173
+ };
174
+ if (!window.invokerSDK) return reject({
175
+ code: -1,
176
+ msg: '请检查当前环境是否属于小智面板'
177
+ });
178
+ var reqId = "".concat(Date.now(), "_").concat(buyerId);
179
+ // getTradeInfo 同步回调不再执行, 所以默认记录reqId
180
+ globalResolveMap.set(reqId, checkIsGetAll);
181
+ window.invokerSDK(jsonToBase64({
182
+ cmd: 'getTradeInfo',
183
+ param: {
184
+ reqId: reqId,
185
+ buyerId: buyerId,
186
+ ext: {
187
+ pageNo: pageNo,
188
+ // 可选 分页从1开始
189
+ pageSize: pageSize // 可选
190
+ }
191
+ }
192
+ }), function (cmd, res) {
193
+ var jsonRes = JSON.parse(res);
194
+ if (jsonRes.code === 200) {
195
+ // globalResolveMap.set(reqId, resolve);
196
+ } else {
197
+ reject(jsonRes.msg || jsonRes);
198
+ }
199
+ });
200
+ };
201
+ getOrders();
153
202
  } catch (e) {
154
203
  reject(e);
155
204
  }
156
205
  });
157
206
  };
158
207
  var transformTardeInfo = function transformTardeInfo(buyer, tradeInfo) {
208
+ console.debug("***** \u6570\u636E\u8F6C\u6362 *****", tradeInfo);
159
209
  if (!tradeInfo) return;
210
+ if ('orderSn' in tradeInfo) {
211
+ var _tradeInfo$tagType;
212
+ var trade = tradeInfo.orderGoodsList || {};
213
+ var flagType = ((_tradeInfo$tagType = tradeInfo.tagType) === null || _tradeInfo$tagType === void 0 ? void 0 : _tradeInfo$tagType.toLowerCase()) || '';
214
+ var flag = ['gray', 'red', 'yellow', 'green', 'blue', 'purple'].findIndex(function (item) {
215
+ return item === flagType;
216
+ });
217
+ return {
218
+ // TRADE_ID_INPUT
219
+ orderNo: tradeInfo.orderSn,
220
+ // BUYER_NICK_INPUT 买家昵称
221
+ buyerNick: buyer.buyerNick,
222
+ buyerOpenUid: buyer.buyerId,
223
+ // // ERP_ORDER_STATUS 这个值和后端接口拿到的不一致,所以不反填了
224
+ // statusDesc: tradeInfo.orderStatusStr,
225
+ // RECEIVER_NAME_INPUT 收件人姓名
226
+ // RECEIVER_MOBILE_INPUT 收件人手机号
227
+ // RECEIVER_ADDRESS_INPUT 收货地址
228
+ // TRADE_CREATE_DATETIME 下单时间
229
+ orderCreateDateTime: tradeInfo.createdAt ? tradeInfo.createdAt * 1000 : '',
230
+ // TRADE_PAYMENT_DATETIME 付款时间
231
+ orderPaymentDateTime: tradeInfo.payTime ? tradeInfo.payTime * 1000 : '',
232
+ // TRADE_DELIVERY_DATETIME 发货时间
233
+ // TRADE_CLOSING_DATETIME 成交时间
234
+ // ACTUAL_PAYMENT 实付金额
235
+ // actualPayment: tradeInfo.goodsAmount ? tradeInfo.goodsAmount / 100 : undefined, // 是否就是实付
236
+ // ACTUAL_RECEIPT_PAYMENT 实收金额
237
+ actualReceiptPayment: tradeInfo.orderAmount ? tradeInfo.orderAmount / 100 : undefined,
238
+ // EXPRESS_LOGISTICS_SELECT 快递物流
239
+ expressLogisticsCode: tradeInfo.trackingNumber,
240
+ // RETURN_LOGISTICS_SELECT 退货物流
241
+ // ALI_PAY_INPUT 支付宝
242
+
243
+ // ITEM_SELECT/ITEM_ID/ITEM_ENCODE/ITEM_SELECT_THIRD 宝贝类组件
244
+ itemList: [{
245
+ numIid: trade.skuId,
246
+ title: trade.goodsName,
247
+ // picUrl: string,
248
+ price: trade.goodsPrice ? trade.goodsPrice / 100 : undefined,
249
+ platform: 'pdd',
250
+ // outerId: string;
251
+ num: trade.goodsNumber,
252
+ skuInfoDTO: {
253
+ picUrl: trade.thumbUrl,
254
+ price: typeof trade.goodsPrice === 'number' ? trade.goodsPrice / 100 : undefined,
255
+ skuId: trade.skuId,
256
+ propertiesName: trade.spec
257
+ // outerSkuId: number | string;
258
+ // itemId: string;
259
+ // supplierName: string;
260
+ }
261
+ }],
262
+
263
+ // REMARK_INPUT 备注
264
+ remark: tradeInfo.note || '',
265
+ flag: flag >= 0 ? flag : undefined
266
+ // ENTERPRISE_PAYMENT 打款组件 只反填订单号,已经有了
267
+ // LOGISTICS_INTERCEPTION 物流拦截
268
+ };
269
+ }
270
+
160
271
  return {
161
272
  // TRADE_ID_INPUT
162
273
  orderNo: tradeInfo.orderId,
@@ -213,7 +324,7 @@ var getActiveUserTardeInfo = function getActiveUserTardeInfo(orderId) {
213
324
  console.debug('orderId: ', orderId);
214
325
  return getActiveUser().then( /*#__PURE__*/function () {
215
326
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(buyer) {
216
- var _tardes$data;
327
+ var _tardes$data, _tardes$result;
217
328
  var tardes, tradeInfo;
218
329
  return _regeneratorRuntime().wrap(function _callee$(_context) {
219
330
  while (1) switch (_context.prev = _context.next) {
@@ -230,8 +341,8 @@ var getActiveUserTardeInfo = function getActiveUserTardeInfo(orderId) {
230
341
  return getTradeInfoByBuyerId(buyer.buyerId);
231
342
  case 6:
232
343
  tardes = _context.sent;
233
- tradeInfo = ((tardes === null || tardes === void 0 ? void 0 : (_tardes$data = tardes.data) === null || _tardes$data === void 0 ? void 0 : _tardes$data.data) || []).find(function (tarde) {
234
- return orderId === tarde.orderId;
344
+ tradeInfo = (('data' in tardes ? tardes === null || tardes === void 0 ? void 0 : (_tardes$data = tardes.data) === null || _tardes$data === void 0 ? void 0 : _tardes$data.data : tardes === null || tardes === void 0 ? void 0 : (_tardes$result = tardes.result) === null || _tardes$result === void 0 ? void 0 : _tardes$result.orders) || []).find(function (tarde) {
345
+ return 'orderId' in tarde ? orderId === tarde.orderId : orderId === tarde.orderSn;
235
346
  });
236
347
  return _context.abrupt("return", transformTardeInfo(buyer, tradeInfo));
237
348
  case 9:
@@ -251,6 +362,25 @@ var getActiveUserTardeInfo = function getActiveUserTardeInfo(orderId) {
251
362
  }
252
363
  });
253
364
  };
365
+
366
+ // const getActiveUserTardeInfoTest = (orderId: string) => {
367
+ // return new Promise((resolve, reject) => {
368
+ // const tardes = base64ToJson(text) as TradesRes
369
+ // const tradeInfo = (
370
+ // ('data' in tardes ? tardes?.data?.data : tardes?.result?.orders) || []
371
+ // ).find((tarde) => {
372
+ // return 'orderId' in tarde ? orderId === tarde.orderId : orderId === tarde.orderSn ;
373
+ // });
374
+ // resolve(transformTardeInfo({
375
+ // buyerId: "3633810253",
376
+ // buyerNick: "e***",
377
+ // clientType: 3,
378
+ // qnCCode: "",
379
+ // qnPrefix: ""
380
+ // }, tradeInfo))
381
+ // })
382
+ // }
383
+
254
384
  var sendMsgToTab = function sendMsgToTab(dispatch) {
255
385
  return function (msg) {
256
386
  try {
@@ -298,5 +428,6 @@ export default {
298
428
  getActiveUser: getActiveUser,
299
429
  getActiveUserTardeInfo: getActiveUserTardeInfo,
300
430
  getTradeInfoByBuyerId: getTradeInfoByBuyerId,
431
+ // getActiveUserTardeInfoTest,
301
432
  receiveTabMsg: receiveTabMsg
302
433
  };
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.25",
3
+ "version": "2.2.26",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -32,9 +32,9 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@ant-design/icons": "^4.7.0",
35
- "@kmkf-fe-packages/basic-components": "2.2.25",
36
- "@kmkf-fe-packages/kmkf-utils": "2.2.24",
37
- "@kmkf-fe-packages/services-components": "2.2.25",
35
+ "@kmkf-fe-packages/basic-components": "2.2.26",
36
+ "@kmkf-fe-packages/kmkf-utils": "2.2.26",
37
+ "@kmkf-fe-packages/services-components": "2.2.26",
38
38
  "@reduxjs/toolkit": "^1.8.5",
39
39
  "ahooks": "^3.7.4",
40
40
  "copy-to-clipboard": "^3.3.3",
@@ -74,7 +74,7 @@
74
74
  "publishConfig": {
75
75
  "access": "public"
76
76
  },
77
- "gitHead": "eb88c3c93e2a120ed15b41688edff56c7faaf043",
77
+ "gitHead": "786169beb384512f2dd49ceb5ecee234058f4434",
78
78
  "gitHooks": {
79
79
  "pre-commit": "lint-staged"
80
80
  }