@kmkf-fe-packages/services-components 2.2.44-beta.9 → 2.2.44-beta.94

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 (39) 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/index.js +52 -19
  4. package/dist/esm/commonComponents/GlobalContext/orderQuery/useGetErpAddressData.js +11 -10
  5. package/dist/esm/commonComponents/QueryLogisticsTrack/index.d.ts +2 -1
  6. package/dist/esm/commonComponents/QueryLogisticsTrack/index.js +4 -2
  7. package/dist/esm/components/BS/BsSystemOrder/index.d.ts +8 -0
  8. package/dist/esm/components/BS/BsSystemOrder/index.js +43 -8
  9. package/dist/esm/components/BS/common/BsHeaderPic.js +4 -1
  10. package/dist/esm/components/BS/common/BsMemo.js +1 -0
  11. package/dist/esm/components/BS/common/BsType.js +1 -0
  12. package/dist/esm/components/BS/common/SystemOrderNo.js +1 -0
  13. package/dist/esm/components/Cascader/index.d.ts +8 -6
  14. package/dist/esm/components/Cascader/index.js +26 -22
  15. package/dist/esm/components/Common/index.d.ts +1 -1
  16. package/dist/esm/components/Common/index.js +4 -3
  17. package/dist/esm/components/CommonHeaderGood/index.js +47 -3
  18. package/dist/esm/components/CommonMultiStatus/index.js +73 -36
  19. package/dist/esm/components/KM/KmExchange/index.d.ts +35 -0
  20. package/dist/esm/components/KM/KmExchange/index.js +136 -0
  21. package/dist/esm/components/Logistics/index.d.ts +1 -0
  22. package/dist/esm/components/Logistics/index.js +10 -0
  23. package/dist/esm/components/Payment/index.d.ts +13 -12
  24. package/dist/esm/components/Payment/index.js +31 -11
  25. package/dist/esm/components/PicturePro/index.d.ts +9 -0
  26. package/dist/esm/components/PicturePro/index.js +17 -0
  27. package/dist/esm/components/PostIng/index.d.ts +1 -1
  28. package/dist/esm/components/Public/Goods/index.d.ts +9 -0
  29. package/dist/esm/components/Public/Goods/index.js +23 -2
  30. package/dist/esm/components/Public/ReissueGoods/index.js +23 -5
  31. package/dist/esm/components/Public/ReturnWarehouse/index.d.ts +51 -0
  32. package/dist/esm/components/Public/ReturnWarehouse/index.js +210 -0
  33. package/dist/esm/components/ReceiverAddress/index.d.ts +7 -6
  34. package/dist/esm/components/ReceiverAddress/index.js +41 -27
  35. package/dist/esm/factory.d.ts +2 -2
  36. package/dist/esm/factory.js +7 -1
  37. package/dist/esm/index.d.ts +2 -0
  38. package/dist/esm/index.js +2 -0
  39. package/package.json +4 -4
@@ -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;
@@ -31,7 +31,7 @@ declare class BasicPosting implements ComponentInterface {
31
31
  sortColumns: SortColumnsField;
32
32
  headerProvince: boolean;
33
33
  constructor(options: PickOption);
34
- getChildren: () => (Province | City | District | Detail | ReceiverName | ReceiverMobile | undefined)[];
34
+ getChildren: () => (City | Detail | District | Province | ReceiverMobile | ReceiverName | undefined)[];
35
35
  getSortColumns: (sortColumns: string | undefined) => SortColumnsField;
36
36
  renderPc: (value: any, record: Record) => React.JSX.Element | null;
37
37
  renderLog: (r: Record) => React.JSX.Element | null;
@@ -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,210 @@
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
+ placeholder: "请选择快麦退货仓"
26
+ }
27
+ };
28
+ var ReturnWarehouse = /*#__PURE__*/_createClass(function ReturnWarehouse(_options) {
29
+ var _this = this,
30
+ _typeMap$_options$typ,
31
+ _typeMap$_options$typ2,
32
+ _this$componentConfig3,
33
+ _typeMap$_options$typ3,
34
+ _this$componentConfig4;
35
+ _classCallCheck(this, ReturnWarehouse);
36
+ _defineProperty(this, "name", void 0);
37
+ _defineProperty(this, "id", void 0);
38
+ _defineProperty(this, "sortField", void 0);
39
+ _defineProperty(this, "sortChildField", void 0);
40
+ _defineProperty(this, "type", void 0);
41
+ _defineProperty(this, "rules", void 0);
42
+ _defineProperty(this, "componentConfig", void 0);
43
+ _defineProperty(this, "align", void 0);
44
+ _defineProperty(this, "isCombinationComponent", void 0);
45
+ _defineProperty(this, "formField", void 0);
46
+ _defineProperty(this, "canSort", void 0);
47
+ _defineProperty(this, "children", void 0);
48
+ _defineProperty(this, "dataType", void 0);
49
+ _defineProperty(this, "format", void 0);
50
+ _defineProperty(this, "getSortChildFields", function (type, options, fieldType) {
51
+ var _typeMap$options$type, _typeMap$options$type2, _typeMap$options$type3;
52
+ var returnWarehouseName = {
53
+ name: "退货仓名称",
54
+ key: "".concat(options.id, "_").concat((_typeMap$options$type = typeMap[options.type]) === null || _typeMap$options$type === void 0 ? void 0 : _typeMap$options$type.returnWarehouseName),
55
+ dataType: (_typeMap$options$type2 = typeMap[options.type]) === null || _typeMap$options$type2 === void 0 ? void 0 : _typeMap$options$type2.dataType,
56
+ disabled: type === "returnWarehouseId"
57
+ };
58
+ var returnWarehouseId = {
59
+ name: "退货仓编码",
60
+ key: "".concat(options.id, "_").concat((_typeMap$options$type3 = typeMap[options.type]) === null || _typeMap$options$type3 === void 0 ? void 0 : _typeMap$options$type3.returnWarehouseId),
61
+ dataType: "arrayObject",
62
+ disabled: type === "returnWarehouseName"
63
+ };
64
+ returnWarehouseName.options = fieldType && SendDataCenter.getInstance(fieldType).getSendData();
65
+ return [returnWarehouseName, returnWarehouseId];
66
+ });
67
+ _defineProperty(this, "renderClient", function (record) {
68
+ var _typeMap$_this$type;
69
+ 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) {
70
+ return !isNull(item);
71
+ }) : false;
72
+ return isShow ? /*#__PURE__*/React.createElement(ItemView, {
73
+ id: _this.id,
74
+ label: _this.name,
75
+ value: /*#__PURE__*/React.createElement(JstGoodImage, {
76
+ list: record === null || record === void 0 ? void 0 : record[_this.id],
77
+ type: 5,
78
+ platformType: (_typeMap$_this$type = typeMap[_this.type]) === null || _typeMap$_this$type === void 0 ? void 0 : _typeMap$_this$type.platformType
79
+ })
80
+ }) : null;
81
+ });
82
+ _defineProperty(this, "renderPc", function (value, record) {
83
+ var _typeMap$_this$type2, _typeMap$_this$type3;
84
+ 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)];
85
+ //兼容多个商品
86
+ return /*#__PURE__*/React.createElement("span", {
87
+ onClick: function onClick(e) {
88
+ return e.stopPropagation();
89
+ }
90
+ }, /*#__PURE__*/React.createElement(JstGoodImage, {
91
+ list: list,
92
+ type: 5,
93
+ platformType: (_typeMap$_this$type3 = typeMap[_this.type]) === null || _typeMap$_this$type3 === void 0 ? void 0 : _typeMap$_this$type3.platformType
94
+ }));
95
+ });
96
+ _defineProperty(this, "renderLog", function (r) {
97
+ var _typeMap$_this$type4;
98
+ 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)];
99
+ if (isNull(list)) return null;
100
+ return _this.renderPc(undefined, r);
101
+ });
102
+ _defineProperty(this, "getComponentValue", function (r) {
103
+ var _typeMap$_this$type5;
104
+ 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)];
105
+ });
106
+ _defineProperty(this, "renderExport", function (value, record) {
107
+ var _typeMap$_this$type6;
108
+ 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)];
109
+ return (list || []).map(function (item) {
110
+ 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("/");
111
+ }).join(",");
112
+ });
113
+ _defineProperty(this, "editRender", function (p) {
114
+ var _this$componentConfig, _this$componentConfig2, _typeMap$_this$type7;
115
+ return /*#__PURE__*/React.createElement(GetFormItem, {
116
+ title: _this.name,
117
+ name: _this.id,
118
+ rules: _this.rules,
119
+ required: false,
120
+ hidden: p === null || p === void 0 ? void 0 : p.hidden,
121
+ display: p === null || p === void 0 ? void 0 : p.display,
122
+ 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 : "",
123
+ component: /*#__PURE__*/React.createElement(JstGoods, _extends({}, _this.componentConfig, {
124
+ type: 5,
125
+ platformType: (_typeMap$_this$type7 = typeMap[_this.type]) === null || _typeMap$_this$type7 === void 0 ? void 0 : _typeMap$_this$type7.platformType,
126
+ onlyShowFieldSelect: _this.componentConfig ? _this.componentConfig.showField === "returnWarehouseName" : false
127
+ }))
128
+ });
129
+ });
130
+ _defineProperty(this, "filterConfig", function (item) {
131
+ var _typeMap$_this$type8, _typeMap$_this$type9;
132
+ return [{
133
+ searchDefaultConditions: SYMBOL.in,
134
+ type: item.type,
135
+ id: "".concat(item.id, "_").concat((_typeMap$_this$type8 = typeMap[_this.type]) === null || _typeMap$_this$type8 === void 0 ? void 0 : _typeMap$_this$type8.returnWarehouseName),
136
+ name: "".concat(_this.name, "-\u540D\u79F0"),
137
+ filterComponentType: "MultipleSelect",
138
+ props: {
139
+ options: SendDataCenter.getInstance(item.type).getSendData().map(function (item) {
140
+ return {
141
+ label: item.label,
142
+ value: item.label
143
+ };
144
+ })
145
+ },
146
+ filterFn: function filterFn(value) {
147
+ return function (i) {
148
+ var _ref;
149
+ return (_ref = _filterFn.filterTableListItemColumnValue(i, item.id, "returnWarehouseName").split(",") || []) === null || _ref === void 0 ? void 0 : _ref.some(function (item) {
150
+ var _String;
151
+ var returnWarehouseName = item ? (_String = String(item)) === null || _String === void 0 ? void 0 : _String.includes(value) : false;
152
+ return returnWarehouseName;
153
+ });
154
+ };
155
+ }
156
+ }, {
157
+ searchDefaultConditions: SYMBOL.like,
158
+ type: item.type,
159
+ id: "".concat(item.id, "_").concat((_typeMap$_this$type9 = typeMap[_this.type]) === null || _typeMap$_this$type9 === void 0 ? void 0 : _typeMap$_this$type9.returnWarehouseId),
160
+ name: "".concat(_this.name, "-\u7F16\u7801"),
161
+ filterComponentType: "Input",
162
+ filterFn: function filterFn(value) {
163
+ return function (i) {
164
+ var _ref2, _typeMap$_this$type10;
165
+ 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) {
166
+ var _String2;
167
+ 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;
168
+ return id;
169
+ });
170
+ };
171
+ }
172
+ }];
173
+ });
174
+ this.name = _options.name;
175
+ this.id = _options.id;
176
+ this.sortField = "".concat(_options.id, "_").concat((_typeMap$_options$typ = typeMap[_options.type]) === null || _typeMap$_options$typ === void 0 ? void 0 : _typeMap$_options$typ.key);
177
+ this.formField = "".concat(_options.id, "_").concat((_typeMap$_options$typ2 = typeMap[_options.type]) === null || _typeMap$_options$typ2 === void 0 ? void 0 : _typeMap$_options$typ2.key);
178
+ this.componentConfig = _options.componentConfig;
179
+ this.sortChildField = this.getSortChildFields(((_this$componentConfig3 = this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.showField) || "", _options, _options.type);
180
+ this.type = _options.type;
181
+ this.dataType = (_typeMap$_options$typ3 = typeMap[_options.type]) === null || _typeMap$_options$typ3 === void 0 ? void 0 : _typeMap$_options$typ3.dataType;
182
+ this.rules = (_this$componentConfig4 = this.componentConfig) !== null && _this$componentConfig4 !== void 0 && _this$componentConfig4.required ? [{
183
+ required: true,
184
+ validator: function validator(_, value) {
185
+ if (!value || !value.length) {
186
+ var _typeMap$_options$typ4;
187
+ return Promise.reject(new Error((_typeMap$_options$typ4 = typeMap[_options.type]) === null || _typeMap$_options$typ4 === void 0 ? void 0 : _typeMap$_options$typ4.placeholder));
188
+ }
189
+ var hasNo = (value || []).some(function (item) {
190
+ var _this$componentConfig5, _this$componentConfig6;
191
+ if (["returnWarehouseName"].includes((_this === null || _this === void 0 ? void 0 : (_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.showField) || "")) {
192
+ return item.returnWarehouseName;
193
+ } 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) || "")) {
194
+ return item.returnWarehouseId;
195
+ } else {
196
+ return item.returnWarehouseId && item.returnWarehouseName;
197
+ }
198
+ });
199
+ if (!hasNo) {
200
+ return Promise.reject(new Error("\u81F3\u5C11\u586B\u5199\u4E00\u4E2A\u5B8C\u6574\u7684\u9000\u8D27\u4ED3\u4FE1\u606F"));
201
+ }
202
+ return Promise.resolve();
203
+ }
204
+ }] : [];
205
+ this.align = "left";
206
+ this.isCombinationComponent = false;
207
+ this.canSort = false;
208
+ this.children = [];
209
+ });
210
+ 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;
@@ -8,17 +8,17 @@ 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 { Address } from "@kmkf-fe-packages/basic-components";
13
- import { AddressData } from "@kmkf-fe-packages/kmkf-utils";
11
+ import React from 'react';
12
+ import { Address } from '@kmkf-fe-packages/basic-components';
13
+ import { AddressData } from '@kmkf-fe-packages/kmkf-utils';
14
14
  import GetFormItem from "../GetFormItem";
15
15
  import ItemView from "../../commonComponents/ItemView";
16
- import { isNull } from "@kmkf-fe-packages/kmkf-utils";
17
- import every from "lodash/every";
16
+ import { isNull } from '@kmkf-fe-packages/kmkf-utils';
17
+ import every from 'lodash/every';
18
18
  import { queryWorkOrderDetail } from "../../service/api";
19
- import copy from "copy-to-clipboard";
20
- import { message } from "antd";
21
- import { CopyOutlined } from "@ant-design/icons";
19
+ import copy from 'copy-to-clipboard';
20
+ import { message } from 'antd';
21
+ import { CopyOutlined } from '@ant-design/icons';
22
22
  var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
23
23
  var _this = this,
24
24
  _this$componentConfig5;
@@ -36,13 +36,14 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
36
36
  _defineProperty(this, "children", void 0);
37
37
  _defineProperty(this, "addressDateInstance", void 0);
38
38
  _defineProperty(this, "dataType", void 0);
39
+ _defineProperty(this, "compoundConfig", void 0);
39
40
  _defineProperty(this, "render", function (value) {
40
41
  var _value$address;
41
42
  return /*#__PURE__*/React.createElement("span", {
42
43
  className: "pointer"
43
44
  }, value === null || value === void 0 ? void 0 : (_value$address = value.address) === null || _value$address === void 0 ? void 0 : _value$address.map(function (suffix) {
44
45
  return _this.addressDateInstance.getNameByCode(suffix);
45
- }).join(""), value === null || value === void 0 ? void 0 : value.detail);
46
+ }).join(''), value === null || value === void 0 ? void 0 : value.detail);
46
47
  });
47
48
  _defineProperty(this, "transTextToNumber", function (value) {
48
49
  return value ? +value : value;
@@ -66,10 +67,10 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
66
67
  e.stopPropagation();
67
68
  _context.prev = 1;
68
69
  addressText = (_address = address) === null || _address === void 0 ? void 0 : _address.map(function () {
69
- var suffix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
70
+ var suffix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
70
71
  return _this.addressDateInstance.getNameByCode(suffix);
71
- }).join("");
72
- if (!(detail.indexOf("*") > -1)) {
72
+ }).join('');
73
+ if (!(detail.indexOf('*') > -1)) {
73
74
  _context.next = 12;
74
75
  break;
75
76
  }
@@ -85,13 +86,13 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
85
86
  success = _yield$queryWorkOrder.success;
86
87
  if (success) {
87
88
  copy("".concat(addressText).concat(data === null || data === void 0 ? void 0 : (_data$jsonMap = data.jsonMap) === null || _data$jsonMap === void 0 ? void 0 : _data$jsonMap["".concat(_this.id, "_address")]));
88
- message.success("复制成功");
89
+ message.success('复制成功');
89
90
  }
90
91
  _context.next = 14;
91
92
  break;
92
93
  case 12:
93
94
  copy("".concat(addressText).concat(detail));
94
- message.success("复制成功");
95
+ message.success('复制成功');
95
96
  case 14:
96
97
  _context.next = 19;
97
98
  break;
@@ -113,15 +114,15 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
113
114
  className: "pointer",
114
115
  onClick: function onClick(e) {
115
116
  var _this$effects, _this$effects2;
116
- typeof (_this === null || _this === void 0 ? void 0 : (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.queryWorkOrderDetail) === "function" && (_this === null || _this === void 0 ? void 0 : (_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.queryWorkOrderDetail(record));
117
+ typeof (_this === null || _this === void 0 ? void 0 : (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.queryWorkOrderDetail) === 'function' && (_this === null || _this === void 0 ? void 0 : (_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.queryWorkOrderDetail(record));
117
118
  e.stopPropagation();
118
119
  }
119
120
  }, (_address2 = address) === null || _address2 === void 0 ? void 0 : _address2.map(function () {
120
- var suffix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
121
+ var suffix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
121
122
  return _this.addressDateInstance.getNameByCode(suffix);
122
- }).join(""), detail, " ", /*#__PURE__*/React.createElement(CopyOutlined, {
123
+ }).join(''), detail, ' ', /*#__PURE__*/React.createElement(CopyOutlined, {
123
124
  style: {
124
- color: "#1B5BF3"
125
+ color: '#1B5BF3'
125
126
  },
126
127
  onClick: function onClick(e) {
127
128
  return copyHandler(e, record);
@@ -136,9 +137,9 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
136
137
  }) ? [] : address;
137
138
  var detail = r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_address")];
138
139
  return "".concat((_address3 = address) === null || _address3 === void 0 ? void 0 : _address3.map(function () {
139
- var suffix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
140
+ var suffix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
140
141
  return _this.addressDateInstance.getNameByCode(suffix);
141
- }).join(""), " ").concat(detail || "");
142
+ }).join(''), " ").concat(detail || '');
142
143
  });
143
144
  _defineProperty(this, "getComponentValue", function (r) {
144
145
  return {
@@ -149,7 +150,7 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
149
150
  _defineProperty(this, "renderExport", function (value, record) {
150
151
  var _address4;
151
152
  if (record["".concat(_this.id, "_province")] === undefined) {
152
- return "--";
153
+ return '--';
153
154
  }
154
155
  var address = [_this.transTextToNumber(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_province")]), _this.transTextToNumber(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_city")]), _this.transTextToNumber(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_district")])];
155
156
  address = every(address, function (item) {
@@ -157,9 +158,9 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
157
158
  }) ? [] : address;
158
159
  var detail = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_address")];
159
160
  return "".concat((_address4 = address) === null || _address4 === void 0 ? void 0 : _address4.map(function () {
160
- var suffix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
161
+ var suffix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
161
162
  return _this.addressDateInstance.getNameByCode(suffix);
162
- }).join(""), " ").concat(detail || "");
163
+ }).join(''), " ").concat(detail || '');
163
164
  });
164
165
  _defineProperty(this, "renderClient", function (record) {
165
166
  return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
@@ -177,7 +178,7 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
177
178
  hidden: p === null || p === void 0 ? void 0 : p.hidden,
178
179
  display: p === null || p === void 0 ? void 0 : p.display,
179
180
  required: (_this$componentConfig = (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.required) !== null && _this$componentConfig !== void 0 ? _this$componentConfig : false,
180
- tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : "",
181
+ tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : '',
181
182
  component: /*#__PURE__*/React.createElement(Address, _this.componentConfig)
182
183
  });
183
184
  });
@@ -197,16 +198,29 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
197
198
  validator: function validator(_, value) {
198
199
  var _value$address2;
199
200
  if (!(value !== null && value !== void 0 && (_value$address2 = value.address) !== null && _value$address2 !== void 0 && _value$address2.length)) {
200
- return Promise.reject(new Error("请选择地址"));
201
+ return Promise.reject(new Error('请选择地址'));
201
202
  }
202
203
  if (!(value !== null && value !== void 0 && value.detail)) {
203
- return Promise.reject(new Error("请填写详细地址"));
204
+ return Promise.reject(new Error('请填写详细地址'));
204
205
  }
205
206
  return Promise.resolve();
206
207
  }
207
208
  }] : [];
208
209
  this.effects = options.effects;
209
210
  this.addressDateInstance = AddressData.getInstance();
210
- this.dataType = "object";
211
+ this.dataType = 'object';
212
+ this.compoundConfig = [{
213
+ name: "\u7701",
214
+ id: "".concat(options.id, "_province")
215
+ }, {
216
+ name: "\u5E02",
217
+ id: "".concat(options.id, "_city")
218
+ }, {
219
+ name: "\u533A",
220
+ id: "".concat(options.id, "_district")
221
+ }, {
222
+ name: "\u8BE6\u7EC6\u5730\u5740",
223
+ id: "".concat(options.id, "_address")
224
+ }];
211
225
  });
212
226
  export default BasicInput;