@kmkf-fe-packages/services-components 2.2.44-beta.8 → 2.2.44-beta.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/esm/Hooks/useColumnsConfig.d.ts +1 -1
  2. package/dist/esm/Hooks/useColumnsConfig.js +2 -2
  3. package/dist/esm/commonComponents/GlobalContext/hook/dist/useGetHasErpData.js +52 -0
  4. package/dist/esm/commonComponents/GlobalContext/index.js +52 -19
  5. package/dist/esm/commonComponents/GlobalContext/orderQuery/dist/useGetErpAddressData.js +180 -0
  6. package/dist/esm/commonComponents/GlobalContext/orderQuery/dist/useGetErpLogisticsCompany.js +186 -0
  7. package/dist/esm/commonComponents/GlobalContext/orderQuery/useGetErpAddressData.js +11 -10
  8. package/dist/esm/commonComponents/QueryLogisticsTrack/index.d.ts +2 -1
  9. package/dist/esm/commonComponents/QueryLogisticsTrack/index.js +4 -2
  10. package/dist/esm/components/BS/BsGoods/dist/index.js +113 -0
  11. package/dist/esm/components/BS/BsSystemOrder/index.d.ts +8 -0
  12. package/dist/esm/components/BS/BsSystemOrder/index.js +43 -8
  13. package/dist/esm/components/BS/common/BsHeaderPic.js +4 -1
  14. package/dist/esm/components/BS/common/BsMemo.js +1 -0
  15. package/dist/esm/components/BS/common/BsType.js +1 -0
  16. package/dist/esm/components/BS/common/SystemOrderNo.js +1 -0
  17. package/dist/esm/components/Cascader/index.d.ts +8 -6
  18. package/dist/esm/components/Cascader/index.js +26 -22
  19. package/dist/esm/components/Common/dist/index.js +1019 -0
  20. package/dist/esm/components/Common/index.d.ts +1 -1
  21. package/dist/esm/components/Common/index.js +4 -3
  22. package/dist/esm/components/CommonHeaderGood/index.js +47 -3
  23. package/dist/esm/components/CommonMultiStatus/index.js +73 -36
  24. package/dist/esm/components/KM/KmExchange/index.d.ts +35 -0
  25. package/dist/esm/components/KM/KmExchange/index.js +136 -0
  26. package/dist/esm/components/Logistics/index.d.ts +1 -0
  27. package/dist/esm/components/Logistics/index.js +10 -0
  28. package/dist/esm/components/Payment/index.d.ts +13 -12
  29. package/dist/esm/components/Payment/index.js +31 -11
  30. package/dist/esm/components/PicturePro/index.d.ts +9 -0
  31. package/dist/esm/components/PicturePro/index.js +17 -0
  32. package/dist/esm/components/Public/Goods/index.d.ts +9 -0
  33. package/dist/esm/components/Public/Goods/index.js +23 -2
  34. package/dist/esm/components/Public/ReissueGoods/index.js +23 -5
  35. package/dist/esm/components/Public/ReturnWarehouse/index.d.ts +51 -0
  36. package/dist/esm/components/Public/ReturnWarehouse/index.js +203 -0
  37. package/dist/esm/components/ReceiverAddress/index.d.ts +7 -6
  38. package/dist/esm/components/ReceiverAddress/index.js +41 -27
  39. package/dist/esm/factory.d.ts +2 -2
  40. package/dist/esm/factory.js +7 -1
  41. package/dist/esm/index.d.ts +2 -0
  42. package/dist/esm/index.js +2 -0
  43. package/package.json +4 -4
@@ -8,8 +8,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
8
8
  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; }
9
9
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
10
10
  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); }
11
- import React from "react";
12
- import { Payment as ApaasPayment } from "@kmkf-fe-packages/basic-components";
11
+ import React from 'react';
12
+ import { Payment as ApaasPayment } from '@kmkf-fe-packages/basic-components';
13
13
  import GetFormItem from "../GetFormItem";
14
14
  import AlipayNick from "./AlipayNick";
15
15
  import AlipayNo from "./AlipayNo";
@@ -40,6 +40,7 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(options) {
40
40
  _defineProperty(this, "children", void 0);
41
41
  _defineProperty(this, "dataType", void 0);
42
42
  _defineProperty(this, "effects", void 0);
43
+ _defineProperty(this, "compoundConfig", void 0);
43
44
  _defineProperty(this, "renderClient", function (record, params) {
44
45
  return /*#__PURE__*/React.createElement(React.Fragment, null, _this.alipayNick.renderClient(record), _this.paymentAmount.renderClient(record), _this.alipayNo.renderClient(record), _this.buyerNick.renderClient(record, params), _this.paymentTid.renderClient(record), _this.paymentStatus.renderClient(record), _this.payTime.renderClient(record));
45
46
  });
@@ -104,32 +105,51 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(options) {
104
105
  validator: function validator(_, value) {
105
106
  var _this$componentConfig6, _this$componentConfig7, _this$componentConfig8, _this$componentConfig9;
106
107
  if ((_this$componentConfig6 = _this.componentConfig) !== null && _this$componentConfig6 !== void 0 && _this$componentConfig6.required && !(value !== null && value !== void 0 && value.enterprisePaymentRefundFee)) {
107
- return Promise.reject(new Error("请输入打款金额"));
108
+ return Promise.reject(new Error('请输入打款金额'));
108
109
  } else if (value !== null && value !== void 0 && value.enterprisePaymentRefundFee && !/^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/.test(value === null || value === void 0 ? void 0 : value.enterprisePaymentRefundFee)) {
109
- return Promise.reject(new Error("打款金额最多2位小数"));
110
+ return Promise.reject(new Error('打款金额最多2位小数'));
110
111
  }
111
112
  if ((_this$componentConfig7 = _this.componentConfig) !== null && _this$componentConfig7 !== void 0 && _this$componentConfig7.required && !(value !== null && value !== void 0 && value.enterprisePaymentTid)) {
112
- return Promise.reject(new Error("请输入订单编号"));
113
+ return Promise.reject(new Error('请输入订单编号'));
113
114
  } else if (value.enterprisePaymentTid && !/^[0-9a-zA-Z_-]{1,}$/.test(value.enterprisePaymentTid)) {
114
- return Promise.reject(new Error("请输入正确的订单编号"));
115
+ return Promise.reject(new Error('请输入正确的订单编号'));
115
116
  }
116
117
  if ((_this$componentConfig8 = _this.componentConfig) !== null && _this$componentConfig8 !== void 0 && _this$componentConfig8.zhiFubaoRequired && !(value !== null && value !== void 0 && value.enterprisePaymentAlipayNick)) {
117
- return Promise.reject(new Error("请输入支付宝名称"));
118
+ return Promise.reject(new Error('请输入支付宝名称'));
118
119
  }
119
120
  if ((_this$componentConfig9 = _this.componentConfig) !== null && _this$componentConfig9 !== void 0 && _this$componentConfig9.zhiFubaoRequired && !(value !== null && value !== void 0 && value.enterprisePaymentAlipayNo)) {
120
- return Promise.reject(new Error("请输入支付宝账号"));
121
+ return Promise.reject(new Error('请输入支付宝账号'));
121
122
  } else if (value.enterprisePaymentAlipayNo && !/^(?:1[3-9]\d{9}|[a-zA-Z\d._-]*\@[a-zA-Z\d.-]{1,10}\.[a-zA-Z\d]{1,20})$/.test(value.enterprisePaymentAlipayNo)) {
122
- return Promise.reject(new Error("请输入正确的支付宝账号格式"));
123
+ return Promise.reject(new Error('请输入正确的支付宝账号格式'));
123
124
  }
124
125
  //支付宝信息不能只填一个,否则不能打款
125
126
  if (value !== null && value !== void 0 && value.enterprisePaymentAlipayNick || value !== null && value !== void 0 && value.enterprisePaymentAlipayNo) {
126
127
  if (!(value !== null && value !== void 0 && value.enterprisePaymentAlipayNick && value !== null && value !== void 0 && value.enterprisePaymentAlipayNo)) {
127
- return Promise.reject(new Error("支付宝姓名/账号都要填写"));
128
+ return Promise.reject(new Error('支付宝姓名/账号都要填写'));
128
129
  }
129
130
  }
130
131
  return Promise.resolve();
131
132
  }
132
133
  }];
133
- this.dataType = "object";
134
+ this.dataType = 'object';
135
+ this.compoundConfig = [{
136
+ name: "\u8BA2\u5355\u7F16\u53F7",
137
+ id: "".concat(options.id, "_enterprisePaymentTid")
138
+ }, {
139
+ name: "\u6253\u6B3E\u91D1\u989D",
140
+ id: "".concat(options.id, "_enterprisePaymentRefundFee")
141
+ }, {
142
+ name: "\u4E70\u5BB6\u6635\u79F0",
143
+ id: "".concat(options.id, "_enterprisePaymentBuyerNick")
144
+ }, {
145
+ name: "\u652F\u4ED8\u5B9D\u59D3\u540D",
146
+ id: "".concat(options.id, "_enterprisePaymentAlipayNick")
147
+ }, {
148
+ name: "\u652F\u4ED8\u5B9D\u8D26\u53F7",
149
+ id: "".concat(options.id, "_enterprisePaymentAlipayNo")
150
+ }, {
151
+ name: "\u6253\u6B3E\u72B6\u6001",
152
+ id: "".concat(options.id, "_enterprisePaymentStatus")
153
+ }];
134
154
  });
135
155
  export default Logistics;
@@ -18,8 +18,17 @@ declare class BasicPicturePro implements ComponentInterface {
18
18
  children: ComponentInterface[];
19
19
  dataType: ComponentInterface['dataType'];
20
20
  currenEnv: ComponentInterface['platform'];
21
+ sortChildField: {
22
+ name: string;
23
+ key: string;
24
+ dataType: string;
25
+ [key: string]: any;
26
+ }[];
27
+ exampleValue?: string;
28
+ standardDateType: ComponentInterface['standardDateType'];
21
29
  constructor(options: PickOption);
22
30
  formatPictures: (pictures: string) => string[];
31
+ getSortChildFields: () => any;
23
32
  render: (value: Value) => React.JSX.Element | null;
24
33
  renderPc: () => null;
25
34
  renderLog: (r: Record) => React.JSX.Element | null;
@@ -36,11 +36,25 @@ var BasicPicturePro = /*#__PURE__*/_createClass(function BasicPicturePro(options
36
36
  _defineProperty(this, "children", void 0);
37
37
  _defineProperty(this, "dataType", void 0);
38
38
  _defineProperty(this, "currenEnv", void 0);
39
+ _defineProperty(this, "sortChildField", void 0);
40
+ _defineProperty(this, "exampleValue", void 0);
41
+ _defineProperty(this, "standardDateType", void 0);
39
42
  _defineProperty(this, "formatPictures", function (pictures) {
40
43
  pictures = pictures.replace(/[\[\]]/g, '');
41
44
  pictures = pictures.replace(/\s/g, '');
42
45
  return pictures ? pictures.split(',') : [];
43
46
  });
47
+ _defineProperty(this, "getSortChildFields", function () {
48
+ return [{
49
+ name: '图片名称',
50
+ key: "".concat(_this.id, "_name"),
51
+ dataType: 'arrayObject'
52
+ }, {
53
+ name: '图片链接',
54
+ key: "".concat(_this.id, "_url"),
55
+ dataType: 'arrayObject'
56
+ }];
57
+ });
44
58
  _defineProperty(this, "render", function (value) {
45
59
  var _document;
46
60
  if (!(value !== null && value !== void 0 && value.length)) {
@@ -176,5 +190,8 @@ var BasicPicturePro = /*#__PURE__*/_createClass(function BasicPicturePro(options
176
190
  }))];
177
191
  this.dataType = 'object';
178
192
  this.currenEnv = options === null || options === void 0 ? void 0 : (_options$effects = options.effects) === null || _options$effects === void 0 ? void 0 : _options$effects.env;
193
+ this.sortChildField = this.getSortChildFields();
194
+ this.exampleValue = '[{"name":"c.jpeg","url":"https://kefu.kuaimai.com/pic/c.jpeg"}]';
195
+ this.standardDateType = 'Array';
179
196
  });
180
197
  export default BasicPicturePro;
@@ -16,7 +16,16 @@ declare class PublicGoods implements ComponentInterface {
16
16
  children: ComponentInterface[];
17
17
  dataType: ComponentInterface["dataType"];
18
18
  headers: CommonHeaderGoods;
19
+ exampleValue?: string;
20
+ standardDateType: ComponentInterface["standardDateType"];
21
+ sortChildField: {
22
+ name: string;
23
+ key: string;
24
+ dataType: string;
25
+ [key: string]: any;
26
+ }[];
19
27
  constructor(options: PickOption);
28
+ getSortChildFields: () => any;
20
29
  renderClient: (record: any) => React.JSX.Element | null;
21
30
  renderPc: () => null;
22
31
  renderLog: (r: Record) => React.JSX.Element | null;
@@ -15,6 +15,7 @@ import CommonHeaderGoods from "../../CommonHeaderGood";
15
15
  import ItemView from "../../../commonComponents/ItemView";
16
16
  import { isNull } from "@kmkf-fe-packages/kmkf-utils";
17
17
  import { CommonGoods as Goods } from "@kmkf-fe-packages/basic-components";
18
+ import { getColumnsMap } from "../../Common/constants/columnsBaseInfoMap";
18
19
  import { SYMBOL } from "../../../constant";
19
20
  var CONFIG_MAP = {
20
21
  JST_GOODS: {
@@ -27,7 +28,8 @@ var CONFIG_MAP = {
27
28
  },
28
29
  JY_GOODS: {
29
30
  name: "巨益",
30
- key: "jyGoods"
31
+ key: "jyGoods",
32
+ exampleValue: '[{"gift":"","bfit":"","mallSkuId":"","specCode":"","sellTotal":0,"canEdit":false,"sellPrice":0,"mallProductName":"","oid":"","uuid":"","productName":"","skuName":"","canDelete":false,"divideOrderFee":0,"goodsName":"","mallSellingPrice":0,"productId":"","mallProductId":"","productCode":"","specName":"","mallSkuName":"","sellCount":0,"settlementPrice":0,"goodsCode":"","systemOrderNo":"","skuCode":""}]'
31
33
  },
32
34
  JKY_GOODS: {
33
35
  name: "吉客云",
@@ -45,7 +47,8 @@ var CONFIG_MAP = {
45
47
  var PublicGoods = /*#__PURE__*/_createClass(function PublicGoods(options) {
46
48
  var _this = this,
47
49
  _CONFIG_MAP$this$type,
48
- _this$componentConfig6;
50
+ _this$componentConfig6,
51
+ _CONFIG_MAP$this$type2;
49
52
  _classCallCheck(this, PublicGoods);
50
53
  _defineProperty(this, "name", void 0);
51
54
  _defineProperty(this, "id", void 0);
@@ -60,6 +63,21 @@ var PublicGoods = /*#__PURE__*/_createClass(function PublicGoods(options) {
60
63
  _defineProperty(this, "children", void 0);
61
64
  _defineProperty(this, "dataType", void 0);
62
65
  _defineProperty(this, "headers", void 0);
66
+ _defineProperty(this, "exampleValue", void 0);
67
+ _defineProperty(this, "standardDateType", void 0);
68
+ _defineProperty(this, "sortChildField", void 0);
69
+ _defineProperty(this, "getSortChildFields", function () {
70
+ var Columns = getColumnsMap();
71
+ return Columns[_this.type].filter(function (item) {
72
+ return !["picUrl"].includes(item.dataIndex);
73
+ }).map(function (item) {
74
+ return {
75
+ name: item.title,
76
+ key: "".concat(_this.id, "_").concat(item.dataIndex),
77
+ dataType: "arrayObject"
78
+ };
79
+ });
80
+ });
63
81
  _defineProperty(this, "renderClient", function (record) {
64
82
  var _record, _CONFIG_MAP$_this$typ, _this$componentConfig;
65
83
  return !isNull(record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ItemView, {
@@ -150,5 +168,8 @@ var PublicGoods = /*#__PURE__*/_createClass(function PublicGoods(options) {
150
168
  }
151
169
  }] : [];
152
170
  this.dataType = "object";
171
+ this.sortChildField = this.getSortChildFields();
172
+ this.exampleValue = ((_CONFIG_MAP$this$type2 = CONFIG_MAP[this.type]) === null || _CONFIG_MAP$this$type2 === void 0 ? void 0 : _CONFIG_MAP$this$type2.exampleValue) || "";
173
+ this.standardDateType = "Array";
153
174
  });
154
175
  export default PublicGoods;
@@ -66,6 +66,24 @@ var typeMap = {
66
66
  errMsg: "请选择快麦补发商品",
67
67
  name: "快麦",
68
68
  compType: "补发",
69
+ validator: function validator(_rule, value, type, componentConfig) {
70
+ if (!_rule.required) return Promise.resolve();
71
+ var validatorFlag = erpFormValidator(_rule, value, type, componentConfig);
72
+ if (validatorFlag) {
73
+ return validatorFlag;
74
+ }
75
+ return Promise.resolve();
76
+ }
77
+ },
78
+ KM_RETURN_GOODS: {
79
+ key: "kmReturnGoods",
80
+ typeName: "kmReturnType",
81
+ remark: "kmReturnType_memo",
82
+ systemOrderNo: "kmSystemOrderNo",
83
+ systemOrderBillType: "kmSystemOrderBillType",
84
+ errMsg: "请选择快麦退货商品",
85
+ name: "快麦",
86
+ compType: "退货",
69
87
  validator: function validator(_rule, value, type) {
70
88
  if (!_rule.required) return Promise.resolve();
71
89
  var validatorFlag = erpFormValidator(_rule, value, type);
@@ -180,7 +198,7 @@ var PublicReissue = /*#__PURE__*/_createClass(function PublicReissue(options) {
180
198
  _defineProperty(this, "editRender", function (p) {
181
199
  var _this$componentConfig3, _this$componentConfig4, _this$componentConfig5, _this$effects, _this$effects2, _this$effects3;
182
200
  var onChange = function onChange(val, type) {
183
- if (_this.type === "KM_REISSUE_GOODS" && type === "systemOrder") {
201
+ if (["KM_REISSUE_GOODS", "KM_RETURN_GOODS"].includes(_this.type) && type === "systemOrder") {
184
202
  p === null || p === void 0 ? void 0 : p.onChange(val, "kmSystemOrder");
185
203
  }
186
204
  };
@@ -279,9 +297,9 @@ var PublicReissue = /*#__PURE__*/_createClass(function PublicReissue(options) {
279
297
  var _typeMap$options$type12;
280
298
  return Promise.reject(new Error("".concat((_typeMap$options$type12 = typeMap[options.type]) === null || _typeMap$options$type12 === void 0 ? void 0 : _typeMap$options$type12.errMsg)));
281
299
  }
282
- // 快麦补发商品补发系统单需要校验
283
- if (isRequired && ["KM_REISSUE_GOODS"].includes(options.type) && (!value || !(value !== null && value !== void 0 && value["".concat((_typeMap$options$type13 = typeMap[options.type]) === null || _typeMap$options$type13 === void 0 ? void 0 : _typeMap$options$type13.systemOrderNo)]))) {
284
- return Promise.reject(new Error("\u8BF7\u9009\u62E9\u8865\u53D1\u7CFB\u7EDF\u5355"));
300
+ // 快麦补发/退货商品需要校验系统单
301
+ if (isRequired && ["KM_REISSUE_GOODS", "KM_RETURN_GOODS"].includes(options.type) && (!value || !(value !== null && value !== void 0 && value["".concat((_typeMap$options$type13 = typeMap[options.type]) === null || _typeMap$options$type13 === void 0 ? void 0 : _typeMap$options$type13.systemOrderNo)]))) {
302
+ return Promise.reject(new Error(options.type === "KM_REISSUE_GOODS" ? "\u8BF7\u9009\u62E9\u8865\u53D1\u7CFB\u7EDF\u5355" : "\u8BF7\u9009\u62E9\u9000\u8D27\u7CFB\u7EDF\u5355"));
285
303
  }
286
304
  return Promise.resolve();
287
305
  }
@@ -289,7 +307,7 @@ var PublicReissue = /*#__PURE__*/_createClass(function PublicReissue(options) {
289
307
  required: isRequired,
290
308
  validator: function validator(_rule, value) {
291
309
  var _typeMap$options$type14, _typeMap$options$type15;
292
- return ((_typeMap$options$type14 = typeMap[options.type]) === null || _typeMap$options$type14 === void 0 ? void 0 : (_typeMap$options$type15 = _typeMap$options$type14.validator) === null || _typeMap$options$type15 === void 0 ? void 0 : _typeMap$options$type15.call(_typeMap$options$type14, _rule, value, options.type)) || function () {
310
+ return ((_typeMap$options$type14 = typeMap[options.type]) === null || _typeMap$options$type14 === void 0 ? void 0 : (_typeMap$options$type15 = _typeMap$options$type14.validator) === null || _typeMap$options$type15 === void 0 ? void 0 : _typeMap$options$type15.call(_typeMap$options$type14, _rule, value, options.type, _this.componentConfig)) || function () {
293
311
  return Promise.resolve();
294
312
  };
295
313
  }
@@ -0,0 +1,51 @@
1
+ import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from "../../../type";
2
+ import React from "react";
3
+ declare class ReturnWarehouse implements ComponentInterface {
4
+ name: string;
5
+ id: string;
6
+ sortField: string;
7
+ sortChildField: {
8
+ name: string;
9
+ key: string;
10
+ dataType: string;
11
+ [key: string]: any;
12
+ }[];
13
+ type: string;
14
+ rules: any[];
15
+ componentConfig: ComponentInterface["componentConfig"];
16
+ align: ALignType;
17
+ isCombinationComponent: boolean;
18
+ formField: string;
19
+ canSort: boolean;
20
+ children: ComponentInterface[];
21
+ dataType: ComponentInterface["dataType"];
22
+ format: ComponentInterface["format"];
23
+ constructor(options: PickOption);
24
+ getSortChildFields: (type: string, options: PickOption, fieldType?: string) => any;
25
+ renderClient: (record: Record) => React.JSX.Element | null;
26
+ renderPc: (value: any, record: Record) => React.JSX.Element;
27
+ renderLog: (r: Record) => React.JSX.Element | null;
28
+ getComponentValue: (r: Record) => any;
29
+ renderExport: (value: any, record: any) => any;
30
+ editRender: (p: any) => React.JSX.Element;
31
+ filterConfig: (item: ColumnConfig) => ({
32
+ searchDefaultConditions: "in";
33
+ type: string;
34
+ id: string;
35
+ name: string;
36
+ filterComponentType: "MultipleSelect";
37
+ props: {
38
+ options: any[];
39
+ };
40
+ filterFn: (value: string) => (i: Record) => any;
41
+ } | {
42
+ searchDefaultConditions: "like";
43
+ type: string;
44
+ id: string;
45
+ name: string;
46
+ filterComponentType: "Input";
47
+ filterFn: (value: string) => (i: Record) => any;
48
+ props?: undefined;
49
+ })[];
50
+ }
51
+ export default ReturnWarehouse;
@@ -0,0 +1,203 @@
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 _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
4
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6
+ 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; }
7
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
8
+ 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); }
9
+ import React from "react";
10
+ import some from "lodash/some";
11
+ import GetFormItem from "../../GetFormItem";
12
+ import { JstGoodImage } from "../../Common";
13
+ import { JstGoods } from "@kmkf-fe-packages/basic-components";
14
+ import ItemView from "../../../commonComponents/ItemView";
15
+ import { isNull, filterFn as _filterFn, SendDataCenter } from "@kmkf-fe-packages/kmkf-utils";
16
+ import { SYMBOL } from "../../../constant";
17
+ var typeMap = {
18
+ KM_RETURN_WAREHOUSE: {
19
+ key: "kmReturnWarehouse",
20
+ name: "km",
21
+ returnWarehouseId: "kmReturnWarehouseId",
22
+ returnWarehouseName: "kmReturnWarehouseName",
23
+ platformType: "km",
24
+ dataType: "weakenArray"
25
+ }
26
+ };
27
+ var ReturnWarehouse = /*#__PURE__*/_createClass(function ReturnWarehouse(_options) {
28
+ var _this = this,
29
+ _typeMap$_options$typ,
30
+ _typeMap$_options$typ2,
31
+ _this$componentConfig3,
32
+ _typeMap$_options$typ3,
33
+ _this$componentConfig4;
34
+ _classCallCheck(this, ReturnWarehouse);
35
+ _defineProperty(this, "name", void 0);
36
+ _defineProperty(this, "id", void 0);
37
+ _defineProperty(this, "sortField", void 0);
38
+ _defineProperty(this, "sortChildField", void 0);
39
+ _defineProperty(this, "type", void 0);
40
+ _defineProperty(this, "rules", void 0);
41
+ _defineProperty(this, "componentConfig", void 0);
42
+ _defineProperty(this, "align", void 0);
43
+ _defineProperty(this, "isCombinationComponent", void 0);
44
+ _defineProperty(this, "formField", void 0);
45
+ _defineProperty(this, "canSort", void 0);
46
+ _defineProperty(this, "children", void 0);
47
+ _defineProperty(this, "dataType", void 0);
48
+ _defineProperty(this, "format", void 0);
49
+ _defineProperty(this, "getSortChildFields", function (type, options, fieldType) {
50
+ var _typeMap$options$type, _typeMap$options$type2, _typeMap$options$type3;
51
+ var returnWarehouseName = {
52
+ name: "退货仓名称",
53
+ key: "".concat(options.id, "_").concat((_typeMap$options$type = typeMap[options.type]) === null || _typeMap$options$type === void 0 ? void 0 : _typeMap$options$type.returnWarehouseName),
54
+ dataType: (_typeMap$options$type2 = typeMap[options.type]) === null || _typeMap$options$type2 === void 0 ? void 0 : _typeMap$options$type2.dataType,
55
+ disabled: type === "returnWarehouseId"
56
+ };
57
+ var returnWarehouseId = {
58
+ name: "退货仓编码",
59
+ key: "".concat(options.id, "_").concat((_typeMap$options$type3 = typeMap[options.type]) === null || _typeMap$options$type3 === void 0 ? void 0 : _typeMap$options$type3.returnWarehouseId),
60
+ dataType: "arrayObject",
61
+ disabled: type === "returnWarehouseName"
62
+ };
63
+ returnWarehouseName.options = fieldType && SendDataCenter.getInstance(fieldType).getSendData();
64
+ return [returnWarehouseName, returnWarehouseId];
65
+ });
66
+ _defineProperty(this, "renderClient", function (record) {
67
+ var _typeMap$_this$type;
68
+ var isShow = Array.isArray(record === null || record === void 0 ? void 0 : record[_this.id]) ? some(record === null || record === void 0 ? void 0 : record[_this.id], function (item) {
69
+ return !isNull(item);
70
+ }) : false;
71
+ return isShow ? /*#__PURE__*/React.createElement(ItemView, {
72
+ id: _this.id,
73
+ label: _this.name,
74
+ value: /*#__PURE__*/React.createElement(JstGoodImage, {
75
+ list: record === null || record === void 0 ? void 0 : record[_this.id],
76
+ type: 5,
77
+ platformType: (_typeMap$_this$type = typeMap[_this.type]) === null || _typeMap$_this$type === void 0 ? void 0 : _typeMap$_this$type.platformType
78
+ })
79
+ }) : null;
80
+ });
81
+ _defineProperty(this, "renderPc", function (value, record) {
82
+ var _typeMap$_this$type2, _typeMap$_this$type3;
83
+ var list = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat((_typeMap$_this$type2 = typeMap[_this.type]) === null || _typeMap$_this$type2 === void 0 ? void 0 : _typeMap$_this$type2.key)];
84
+ //兼容多个商品
85
+ return /*#__PURE__*/React.createElement("span", {
86
+ onClick: function onClick(e) {
87
+ return e.stopPropagation();
88
+ }
89
+ }, /*#__PURE__*/React.createElement(JstGoodImage, {
90
+ list: list,
91
+ type: 5,
92
+ platformType: (_typeMap$_this$type3 = typeMap[_this.type]) === null || _typeMap$_this$type3 === void 0 ? void 0 : _typeMap$_this$type3.platformType
93
+ }));
94
+ });
95
+ _defineProperty(this, "renderLog", function (r) {
96
+ var _typeMap$_this$type4;
97
+ var list = r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_typeMap$_this$type4 = typeMap[_this.type]) === null || _typeMap$_this$type4 === void 0 ? void 0 : _typeMap$_this$type4.key)];
98
+ if (isNull(list)) return null;
99
+ return _this.renderPc(undefined, r);
100
+ });
101
+ _defineProperty(this, "getComponentValue", function (r) {
102
+ var _typeMap$_this$type5;
103
+ return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_typeMap$_this$type5 = typeMap[_this.type]) === null || _typeMap$_this$type5 === void 0 ? void 0 : _typeMap$_this$type5.key)];
104
+ });
105
+ _defineProperty(this, "renderExport", function (value, record) {
106
+ var _typeMap$_this$type6;
107
+ var list = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat((_typeMap$_this$type6 = typeMap[_this.type]) === null || _typeMap$_this$type6 === void 0 ? void 0 : _typeMap$_this$type6.key)];
108
+ return (list || []).map(function (item) {
109
+ return [item === null || item === void 0 ? void 0 : item.returnWarehouseId, SendDataCenter.getInstance(_this.type).getSendNameByCode(item === null || item === void 0 ? void 0 : item.returnWarehouseName)].join("/");
110
+ }).join(",");
111
+ });
112
+ _defineProperty(this, "editRender", function (p) {
113
+ var _this$componentConfig, _this$componentConfig2, _typeMap$_this$type7;
114
+ return /*#__PURE__*/React.createElement(GetFormItem, {
115
+ title: _this.name,
116
+ name: _this.id,
117
+ rules: _this.rules,
118
+ required: false,
119
+ hidden: p === null || p === void 0 ? void 0 : p.hidden,
120
+ display: p === null || p === void 0 ? void 0 : p.display,
121
+ tooltip: (_this$componentConfig = _this.componentConfig) !== null && _this$componentConfig !== void 0 && _this$componentConfig.showTooltip ? (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.tooltip : "",
122
+ component: /*#__PURE__*/React.createElement(JstGoods, _extends({}, _this.componentConfig, {
123
+ type: 5,
124
+ platformType: (_typeMap$_this$type7 = typeMap[_this.type]) === null || _typeMap$_this$type7 === void 0 ? void 0 : _typeMap$_this$type7.platformType,
125
+ onlyShowFieldSelect: _this.componentConfig ? _this.componentConfig.showField === "returnWarehouseName" : false
126
+ }))
127
+ });
128
+ });
129
+ _defineProperty(this, "filterConfig", function (item) {
130
+ var _typeMap$_this$type8, _typeMap$_this$type9;
131
+ return [{
132
+ searchDefaultConditions: SYMBOL.in,
133
+ type: item.type,
134
+ id: "".concat(item.id, "_").concat((_typeMap$_this$type8 = typeMap[_this.type]) === null || _typeMap$_this$type8 === void 0 ? void 0 : _typeMap$_this$type8.returnWarehouseName),
135
+ name: "".concat(_this.name, "-\u540D\u79F0"),
136
+ filterComponentType: "MultipleSelect",
137
+ props: {
138
+ options: SendDataCenter.getInstance(item.type).getSendData()
139
+ },
140
+ filterFn: function filterFn(value) {
141
+ return function (i) {
142
+ var _ref;
143
+ return (_ref = _filterFn.filterTableListItemColumnValue(i, item.id, "returnWarehouseName").split(",") || []) === null || _ref === void 0 ? void 0 : _ref.some(function (item) {
144
+ var _String;
145
+ var returnWarehouseName = item ? (_String = String(item)) === null || _String === void 0 ? void 0 : _String.includes(value) : false;
146
+ return returnWarehouseName;
147
+ });
148
+ };
149
+ }
150
+ }, {
151
+ searchDefaultConditions: SYMBOL.like,
152
+ type: item.type,
153
+ id: "".concat(item.id, "_").concat((_typeMap$_this$type9 = typeMap[_this.type]) === null || _typeMap$_this$type9 === void 0 ? void 0 : _typeMap$_this$type9.returnWarehouseId),
154
+ name: "".concat(_this.name, "-\u7F16\u7801"),
155
+ filterComponentType: "Input",
156
+ filterFn: function filterFn(value) {
157
+ return function (i) {
158
+ var _ref2, _typeMap$_this$type10;
159
+ return (_ref2 = _filterFn.filterTableListItemColumnValue(i, item.id, (_typeMap$_this$type10 = typeMap[_this.type]) === null || _typeMap$_this$type10 === void 0 ? void 0 : _typeMap$_this$type10.key) || []) === null || _ref2 === void 0 ? void 0 : _ref2.some(function (item) {
160
+ var _String2;
161
+ var id = item !== null && item !== void 0 && item.returnWarehouseId ? (_String2 = String(item === null || item === void 0 ? void 0 : item.returnWarehouseId)) === null || _String2 === void 0 ? void 0 : _String2.includes(value) : false;
162
+ return id;
163
+ });
164
+ };
165
+ }
166
+ }];
167
+ });
168
+ this.name = _options.name;
169
+ this.id = _options.id;
170
+ this.sortField = "".concat(_options.id, "_").concat((_typeMap$_options$typ = typeMap[_options.type]) === null || _typeMap$_options$typ === void 0 ? void 0 : _typeMap$_options$typ.key);
171
+ this.formField = "".concat(_options.id, "_").concat((_typeMap$_options$typ2 = typeMap[_options.type]) === null || _typeMap$_options$typ2 === void 0 ? void 0 : _typeMap$_options$typ2.key);
172
+ this.componentConfig = _options.componentConfig;
173
+ this.sortChildField = this.getSortChildFields(((_this$componentConfig3 = this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.showField) || "", _options, _options.type);
174
+ this.type = _options.type;
175
+ this.dataType = (_typeMap$_options$typ3 = typeMap[_options.type]) === null || _typeMap$_options$typ3 === void 0 ? void 0 : _typeMap$_options$typ3.dataType;
176
+ this.rules = (_this$componentConfig4 = this.componentConfig) !== null && _this$componentConfig4 !== void 0 && _this$componentConfig4.required ? [{
177
+ required: true,
178
+ validator: function validator(_, value) {
179
+ if (!value || !value.length) {
180
+ return Promise.reject(new Error("请选择宝贝"));
181
+ }
182
+ var hasNo = (value || []).some(function (item) {
183
+ var _this$componentConfig5, _this$componentConfig6;
184
+ if (["returnWarehouseName"].includes((_this === null || _this === void 0 ? void 0 : (_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.showField) || "")) {
185
+ return item.returnWarehouseName;
186
+ } else if (["returnWarehouseId"].includes((_this === null || _this === void 0 ? void 0 : (_this$componentConfig6 = _this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.showField) || "")) {
187
+ return item.returnWarehouseId;
188
+ } else {
189
+ return item.returnWarehouseId && item.returnWarehouseName;
190
+ }
191
+ });
192
+ if (!hasNo) {
193
+ return Promise.reject(new Error("\u81F3\u5C11\u586B\u5199\u4E00\u4E2A\u5B8C\u6574\u7684\u9000\u8D27\u4ED3\u4FE1\u606F"));
194
+ }
195
+ return Promise.resolve();
196
+ }
197
+ }] : [];
198
+ this.align = "left";
199
+ this.isCombinationComponent = false;
200
+ this.canSort = false;
201
+ this.children = [];
202
+ });
203
+ export default ReturnWarehouse;
@@ -1,6 +1,6 @@
1
- import { ComponentInterface, PickOption, Record } from "../../type";
2
- import React from "react";
3
- import { AddressData } from "@kmkf-fe-packages/kmkf-utils";
1
+ import { ComponentInterface, PickOption, Record } from '../../type';
2
+ import React from 'react';
3
+ import { AddressData } from '@kmkf-fe-packages/kmkf-utils';
4
4
  declare type Value = {
5
5
  address?: (string | number)[];
6
6
  detail?: string;
@@ -11,14 +11,15 @@ declare class BasicInput implements ComponentInterface {
11
11
  sortField: string;
12
12
  type: string;
13
13
  rules: any[];
14
- componentConfig: ComponentInterface["componentConfig"];
15
- effects: ComponentInterface["effects"];
14
+ componentConfig: ComponentInterface['componentConfig'];
15
+ effects: ComponentInterface['effects'];
16
16
  isCombinationComponent: boolean;
17
17
  formField: string;
18
18
  canSort: boolean;
19
19
  children: ComponentInterface[];
20
20
  addressDateInstance: InstanceType<typeof AddressData>;
21
- dataType: ComponentInterface["dataType"];
21
+ dataType: ComponentInterface['dataType'];
22
+ compoundConfig: ComponentInterface['compoundConfig'];
22
23
  constructor(options: PickOption);
23
24
  render: (value: Value) => React.JSX.Element;
24
25
  transTextToNumber: (value?: string) => string | number | undefined;