@kmkf-fe-packages/kmkf-utils 2.10.9-beta.12 → 2.10.9-beta.15

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.
package/README.md CHANGED
@@ -1 +1 @@
1
- 1123111111
1
+ 112311111111
@@ -9,6 +9,9 @@ interface OptionsItem {
9
9
  mobile: string;
10
10
  userKCode?: string;
11
11
  userSecretKey?: string;
12
+ customerCode?: string;
13
+ customerCodeType?: "K" | "EBU";
14
+ remark?: string;
12
15
  }
13
16
  export default class logisticsAddressData {
14
17
  private static instance;
@@ -135,7 +135,7 @@ var updateDxdItemListHandle = function updateDxdItemListHandle(list, type, comLi
135
135
  var params = {};
136
136
  if (type === "logistics") {
137
137
  params.logisticsCompany = next === null || next === void 0 ? void 0 : next.monthCardNo;
138
- params.logisticsCode = next === null || next === void 0 ? void 0 : next.logsticsNo;
138
+ params.logisticsCode = next === null || next === void 0 ? void 0 : next.logisticsNo;
139
139
  } else if (type === "send") {
140
140
  params.sendId = next.warehouseCode;
141
141
  // sendName 是下拉框,最终存的是编码,所以用 warehouseCode 反填
@@ -198,7 +198,8 @@ export var dxdOrderTransform = function dxdOrderTransform(detail, form) {
198
198
  componentList = _ref.componentList,
199
199
  inputSelectedRows = _ref.selectedRows,
200
200
  matchLogisticsNo = _ref.matchLogisticsNo;
201
- var data = (detail === null || detail === void 0 ? void 0 : detail.data) || {};
201
+ var data = doOrders[0] || {};
202
+
202
203
  // 参考 KM:判断是否只有一个出库订单(用于系统订单组件的默认选中逻辑)
203
204
  var onlyOneSystemOrder = doOrders.length === 1;
204
205
 
@@ -31,3 +31,4 @@ export * as tree from "./multidimensionalFindChild";
31
31
  export { default as unTransField } from "./unTransField";
32
32
  export { fetchAll } from "./FetchAll";
33
33
  export { default as getSystemShowHead } from "./getSystemShowHead";
34
+ export * from "./logisticsInterceptionCustomerCode";
@@ -34,4 +34,5 @@ import * as _tree from "./multidimensionalFindChild";
34
34
  export { _tree as tree };
35
35
  export { default as unTransField } from "./unTransField";
36
36
  export { fetchAll } from "./FetchAll";
37
- export { default as getSystemShowHead } from "./getSystemShowHead";
37
+ export { default as getSystemShowHead } from "./getSystemShowHead";
38
+ export * from "./logisticsInterceptionCustomerCode";
@@ -0,0 +1,15 @@
1
+ export declare type LogisticsCustomerCodeType = "K" | "EBU";
2
+ export interface LogisticsCustomerCodeRecord {
3
+ cpCode?: string;
4
+ customerCode?: string;
5
+ customerCodeType?: LogisticsCustomerCodeType | string;
6
+ remark?: string;
7
+ }
8
+ export interface LogisticsCustomerCodeOption extends LogisticsCustomerCodeRecord {
9
+ label: string;
10
+ value: string;
11
+ }
12
+ export declare const JD_LOGISTICS_COMPANY_CODES: readonly ["JD", "JDKY"];
13
+ export declare const isJdLogisticsCompany: (company?: string) => boolean;
14
+ export declare const getJdCustomerCodeType: (company?: string) => LogisticsCustomerCodeType | undefined;
15
+ export declare const getJdCustomerCodeOptions: (records?: LogisticsCustomerCodeRecord[], company?: string) => LogisticsCustomerCodeOption[];
@@ -0,0 +1,29 @@
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 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; }
3
+ 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; }
4
+ 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; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ 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); }
7
+ export var JD_LOGISTICS_COMPANY_CODES = ["JD", "JDKY"];
8
+ export var isJdLogisticsCompany = function isJdLogisticsCompany(company) {
9
+ return JD_LOGISTICS_COMPANY_CODES.includes(company);
10
+ };
11
+ export var getJdCustomerCodeType = function getJdCustomerCodeType(company) {
12
+ if (company === "JD") return "K";
13
+ if (company === "JDKY") return "EBU";
14
+ return undefined;
15
+ };
16
+ export var getJdCustomerCodeOptions = function getJdCustomerCodeOptions() {
17
+ var records = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
18
+ var company = arguments.length > 1 ? arguments[1] : undefined;
19
+ var customerCodeType = getJdCustomerCodeType(company);
20
+ if (!customerCodeType) return [];
21
+ return records.filter(function (item) {
22
+ return item.cpCode === "JD" && item.customerCodeType === customerCodeType && !!item.customerCode;
23
+ }).map(function (item) {
24
+ return _objectSpread(_objectSpread({}, item), {}, {
25
+ label: item.remark ? "".concat(item.customerCode, "\uFF08").concat(item.remark, "\uFF09") : "".concat(item.customerCode),
26
+ value: item.customerCode
27
+ });
28
+ });
29
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/kmkf-utils",
3
- "version": "2.10.9-beta.12",
3
+ "version": "2.10.9-beta.15",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -41,7 +41,7 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "5a0d12c8caf0912d82e12ed94e64afd3ff746c65",
44
+ "gitHead": "951c615176f420e82fd527c8f4b1245c922ebc74",
45
45
  "gitHooks": {
46
46
  "pre-commit": "lint-staged"
47
47
  }