@kmkf-fe-packages/services-components 1.26.0 → 1.27.0

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 (40) hide show
  1. package/dist/esm/commonComponents/GlobalContext/index.d.ts +1 -1
  2. package/dist/esm/commonComponents/GlobalContext/index.js +1 -0
  3. package/dist/esm/components/BS/BsSystemOrder/index.js +6 -163
  4. package/dist/esm/components/BS/common/BsMemo.d.ts +4 -4
  5. package/dist/esm/components/BS/common/BsMemo.js +19 -18
  6. package/dist/esm/components/BS/common/BsType.d.ts +4 -4
  7. package/dist/esm/components/BS/common/BsType.js +17 -16
  8. package/dist/esm/components/BS/common/SystemOrderNo.js +2 -1
  9. package/dist/esm/components/Common/constants/bs.d.ts +3 -0
  10. package/dist/esm/components/Common/constants/bs.js +90 -0
  11. package/dist/esm/components/Common/constants/bs_e3.d.ts +3 -0
  12. package/dist/esm/components/Common/constants/bs_e3.js +154 -0
  13. package/dist/esm/components/Common/constants/columnsBaseInfoMap.d.ts +5 -0
  14. package/dist/esm/components/Common/constants/columnsBaseInfoMap.js +26 -0
  15. package/dist/esm/components/Common/constants/defaultColumns.d.ts +3 -0
  16. package/dist/esm/components/Common/constants/defaultColumns.js +76 -0
  17. package/dist/esm/components/Common/constants/gy.d.ts +3 -0
  18. package/dist/esm/components/Common/constants/gy.js +153 -0
  19. package/dist/esm/components/Common/constants/system.d.ts +3 -0
  20. package/dist/esm/components/Common/constants/system.js +58 -0
  21. package/dist/esm/components/Common/constants/wdt.d.ts +3 -0
  22. package/dist/esm/components/Common/constants/wdt.js +280 -0
  23. package/dist/esm/components/Common/dist/index.js +97 -603
  24. package/dist/esm/components/Common/index.js +20 -743
  25. package/dist/esm/components/CommonHeaderGood/index.js +196 -0
  26. package/dist/esm/components/GY/GyGoods/index.d.ts +33 -0
  27. package/dist/esm/components/GY/GyGoods/index.js +123 -0
  28. package/dist/esm/components/GY/GyReissue/index.d.ts +58 -0
  29. package/dist/esm/components/GY/GyReissue/index.js +188 -0
  30. package/dist/esm/components/JST/JstSendGood/index.js +32 -16
  31. package/dist/esm/components/KmErpSendGood/index.js +11 -11
  32. package/dist/esm/components/PostIng/index.js +2 -1
  33. package/dist/esm/components/Reissue/Logistics/index.d.ts +10 -1
  34. package/dist/esm/components/Reissue/Logistics/index.js +39 -10
  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/dist/esm/type.d.ts +1 -1
  40. package/package.json +4 -4
@@ -452,6 +452,202 @@ var GoodHeaderMap = {
452
452
  },
453
453
  moneyKey: "payment"
454
454
  },
455
+ GY_GOODS: {
456
+ headerMap: {
457
+ goodName: {
458
+ component: BsHeaderChild,
459
+ name: "商品名称",
460
+ key: "goodName",
461
+ width: 100
462
+ },
463
+ goodShortName: {
464
+ component: BsHeaderChild,
465
+ name: "商品简称",
466
+ key: "goodShortName",
467
+ width: 70
468
+ },
469
+ goodNo: {
470
+ component: BsHeaderChild,
471
+ name: "商品编码",
472
+ key: "goodNo",
473
+ width: 70
474
+ },
475
+ specName: {
476
+ component: BsHeaderChild,
477
+ name: "SKU名称",
478
+ key: "specName",
479
+ width: 140
480
+ },
481
+ specNo: {
482
+ component: BsHeaderChild,
483
+ name: "SKU编码",
484
+ key: "specNo",
485
+ width: 140
486
+ },
487
+ qty: {
488
+ component: BsHeaderChild,
489
+ name: "数量",
490
+ key: "qty",
491
+ width: 140
492
+ },
493
+ price: {
494
+ component: BsHeaderChild,
495
+ name: "实际单价",
496
+ key: "price",
497
+ width: 140
498
+ },
499
+ amount: {
500
+ component: BsHeaderChild,
501
+ name: "实际金额",
502
+ key: "amount",
503
+ width: 140
504
+ },
505
+ originPrice: {
506
+ component: BsHeaderChild,
507
+ name: "标准单价",
508
+ key: "originPrice",
509
+ width: 140
510
+ },
511
+ originAmount: {
512
+ component: BsHeaderChild,
513
+ name: "标准金额",
514
+ key: "originAmount",
515
+ width: 140
516
+ },
517
+ discountFee: {
518
+ component: BsHeaderChild,
519
+ name: "让利金额",
520
+ key: "discountFee",
521
+ width: 140
522
+ },
523
+ amountAfter: {
524
+ component: BsHeaderChild,
525
+ name: "让利后金额",
526
+ key: "amountAfter",
527
+ width: 140
528
+ },
529
+ cancel: {
530
+ component: ReissueGift,
531
+ name: "是否取消",
532
+ key: "cancel",
533
+ width: 150
534
+ },
535
+ isGift: {
536
+ component: ReissueGift,
537
+ name: "是否赠品",
538
+ key: "isGift",
539
+ width: 150
540
+ },
541
+ skuNote: {
542
+ component: ReissueGift,
543
+ name: "商品备注",
544
+ key: "skuNote",
545
+ width: 150
546
+ }
547
+ },
548
+ itemKey: {
549
+ goodName: "商品名称",
550
+ goodShortName: "商品简称",
551
+ goodNo: "商品编码",
552
+ specName: "SKU名称",
553
+ specNo: "SKU编码",
554
+ qty: "数量",
555
+ price: "实际单价",
556
+ amount: "实际金额",
557
+ originPrice: "标准单价",
558
+ originAmount: "标准金额",
559
+ discountFee: "让利金额",
560
+ amountAfter: "让利后金额",
561
+ cancel: "是否取消",
562
+ isGift: "是否赠品",
563
+ skuNote: "商品备注"
564
+ },
565
+ moneyKey: "amount"
566
+ },
567
+ GY_REISSUE_GOODS: {
568
+ headerMap: {
569
+ goodName: {
570
+ component: BsHeaderChild,
571
+ name: "商品名称",
572
+ key: "goodName",
573
+ width: 100
574
+ },
575
+ goodShortName: {
576
+ component: BsHeaderChild,
577
+ name: "商品简称",
578
+ key: "goodShortName",
579
+ width: 70
580
+ },
581
+ goodNo: {
582
+ component: BsHeaderChild,
583
+ name: "商品编码",
584
+ key: "goodNo",
585
+ width: 70
586
+ },
587
+ specName: {
588
+ component: BsHeaderChild,
589
+ name: "SKU名称",
590
+ key: "specName",
591
+ width: 140
592
+ },
593
+ specNo: {
594
+ component: BsHeaderChild,
595
+ name: "SKU编码",
596
+ key: "specNo",
597
+ width: 140
598
+ },
599
+ qty: {
600
+ component: BsHeaderChild,
601
+ name: "数量",
602
+ key: "qty",
603
+ width: 140
604
+ },
605
+ price: {
606
+ component: BsHeaderChild,
607
+ name: "实际单价",
608
+ key: "price",
609
+ width: 140
610
+ },
611
+ amount: {
612
+ component: BsHeaderChild,
613
+ name: "实际金额",
614
+ key: "amount",
615
+ width: 140
616
+ },
617
+ originPrice: {
618
+ component: BsHeaderChild,
619
+ name: "标准单价",
620
+ key: "originPrice",
621
+ width: 140
622
+ },
623
+ originAmount: {
624
+ component: BsHeaderChild,
625
+ name: "标准金额",
626
+ key: "originAmount",
627
+ width: 140
628
+ },
629
+ isGift: {
630
+ component: ReissueGift,
631
+ name: "是否赠品",
632
+ key: "isGift",
633
+ width: 150
634
+ }
635
+ },
636
+ itemKey: {
637
+ goodName: "商品名称",
638
+ goodShortName: "商品简称",
639
+ goodNo: "商品编码",
640
+ specName: "SKU名称",
641
+ specNo: "SKU编码",
642
+ qty: "数量",
643
+ price: "实际单价",
644
+ amount: "实际金额",
645
+ originPrice: "标准单价",
646
+ originAmount: "标准金额",
647
+ isGift: "是否赠品"
648
+ },
649
+ moneyKey: "amount"
650
+ },
455
651
  BS_E3_REISSUE_GOODS: {
456
652
  headerMap: {
457
653
  sku: {
@@ -0,0 +1,33 @@
1
+ import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../../type";
2
+ import React from "react";
3
+ import CommonHeaderGoods from "../../CommonHeaderGood";
4
+ declare class GyGoods implements ComponentInterface {
5
+ name: string;
6
+ id: string;
7
+ sortField: string;
8
+ type: string;
9
+ rules: any[];
10
+ componentConfig: ComponentInterface["componentConfig"];
11
+ effects: ComponentInterface["effects"];
12
+ isCombinationComponent: boolean;
13
+ formField: string;
14
+ canSort: boolean;
15
+ children: ComponentInterface[];
16
+ dataType: ComponentInterface["dataType"];
17
+ gyGoods: CommonHeaderGoods;
18
+ constructor(options: PickOption);
19
+ renderClient: (record: any) => React.JSX.Element | null;
20
+ renderPc: () => null;
21
+ renderLog: (r: Record) => React.JSX.Element | null;
22
+ getComponentValue: (r: Record) => any;
23
+ renderExport: () => null;
24
+ editRender: (p: any) => React.JSX.Element;
25
+ filterConfig: (item: ColumnConfig) => {
26
+ searchDefaultConditions: "like";
27
+ type: string;
28
+ id: string;
29
+ name: string;
30
+ filterComponentType: "Input";
31
+ }[];
32
+ }
33
+ export default GyGoods;
@@ -0,0 +1,123 @@
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 _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); }
5
+ 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); } }
6
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
7
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
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 GetFormItem from "../../GetFormItem";
13
+ import { BsGoodsTable } from "../../Common";
14
+ import CommonHeaderGoods from "../../CommonHeaderGood";
15
+ import ItemView from "../../../commonComponents/ItemView";
16
+ import { isNull } from "@kmkf-fe-packages/kmkf-utils";
17
+ import { CommonGoods as Goods } from "@kmkf-fe-packages/basic-components";
18
+ import { SYMBOL } from "../../../constant";
19
+ var GyGoods = /*#__PURE__*/_createClass(function GyGoods(options) {
20
+ var _this = this,
21
+ _this$componentConfig6;
22
+ _classCallCheck(this, GyGoods);
23
+ _defineProperty(this, "name", void 0);
24
+ _defineProperty(this, "id", void 0);
25
+ _defineProperty(this, "sortField", void 0);
26
+ _defineProperty(this, "type", void 0);
27
+ _defineProperty(this, "rules", void 0);
28
+ _defineProperty(this, "componentConfig", void 0);
29
+ _defineProperty(this, "effects", void 0);
30
+ _defineProperty(this, "isCombinationComponent", void 0);
31
+ _defineProperty(this, "formField", void 0);
32
+ _defineProperty(this, "canSort", void 0);
33
+ _defineProperty(this, "children", void 0);
34
+ _defineProperty(this, "dataType", void 0);
35
+ _defineProperty(this, "gyGoods", void 0);
36
+ _defineProperty(this, "renderClient", function (record) {
37
+ var _record, _this$componentConfig;
38
+ return !isNull(record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ItemView, {
39
+ id: _this.id,
40
+ label: _this.name,
41
+ value: /*#__PURE__*/React.createElement(BsGoodsTable, {
42
+ type: _this.type,
43
+ list: (record === null || record === void 0 ? void 0 : (_record = record["".concat(_this.id)]) === null || _record === void 0 ? void 0 : _record.gyGoods) || [],
44
+ showHeader: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.showHeader) || []
45
+ })
46
+ })) : null;
47
+ });
48
+ _defineProperty(this, "renderPc", function () {
49
+ return null;
50
+ });
51
+ _defineProperty(this, "renderLog", function (r) {
52
+ var _this$componentConfig2;
53
+ if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_gyGoods")])) return null;
54
+ return /*#__PURE__*/React.createElement(BsGoodsTable, {
55
+ type: _this.type,
56
+ list: (r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_gyGoods")]) || [],
57
+ showHeader: ((_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.showHeader) || []
58
+ });
59
+ });
60
+ _defineProperty(this, "getComponentValue", function (r) {
61
+ return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_gyGoods")];
62
+ });
63
+ _defineProperty(this, "renderExport", function () {
64
+ return null;
65
+ });
66
+ _defineProperty(this, "editRender", function (p) {
67
+ var _this$componentConfig3, _this$componentConfig4, _this$componentConfig5, _this$effects, _this$effects2, _this$effects3;
68
+ return /*#__PURE__*/React.createElement(GetFormItem, {
69
+ title: _this.name,
70
+ name: _this.id,
71
+ rules: _this.rules,
72
+ required: false,
73
+ hidden: p === null || p === void 0 ? void 0 : p.hidden,
74
+ display: p === null || p === void 0 ? void 0 : p.display,
75
+ 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 : "",
76
+ component: /*#__PURE__*/React.createElement(Goods, _extends({}, _this.componentConfig, {
77
+ maxLength: ((_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.maxLength) || 20,
78
+ shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
79
+ shopList: ((_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopList) || [],
80
+ companyKey: (_this$effects3 = _this.effects) === null || _this$effects3 === void 0 ? void 0 : _this$effects3.companyKey,
81
+ type: _this.type,
82
+ width: "90%"
83
+ }))
84
+ });
85
+ });
86
+ _defineProperty(this, "filterConfig", function (item) {
87
+ return [{
88
+ searchDefaultConditions: SYMBOL.like,
89
+ type: item.type,
90
+ id: "".concat(item.id, "_gyGoods"),
91
+ // 过滤组件id
92
+ name: item.name,
93
+ // 过滤组件名称
94
+ filterComponentType: "Input"
95
+ }];
96
+ });
97
+ this.name = options.name;
98
+ this.id = options.id;
99
+ this.sortField = "".concat(options.id, "_gyGoods");
100
+ this.formField = "".concat(options.id, "_gyGoods");
101
+ this.type = options.type;
102
+ this.effects = options === null || options === void 0 ? void 0 : options.effects;
103
+ this.isCombinationComponent = true;
104
+ this.canSort = false;
105
+ this.gyGoods = new CommonHeaderGoods(_objectSpread(_objectSpread({}, options), {}, {
106
+ id: "".concat(options.id, "_gyGoods"),
107
+ name: "商品信息"
108
+ }));
109
+ this.children = [this.gyGoods];
110
+ this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
111
+ this.rules = this !== null && this !== void 0 && (_this$componentConfig6 = this.componentConfig) !== null && _this$componentConfig6 !== void 0 && _this$componentConfig6.required ? [{
112
+ required: true,
113
+ validator: function validator(_, value) {
114
+ var _value$gyGoods;
115
+ if (!value || !(value !== null && value !== void 0 && (_value$gyGoods = value.gyGoods) !== null && _value$gyGoods !== void 0 && _value$gyGoods.length)) {
116
+ return Promise.reject(new Error("请选择管易商品"));
117
+ }
118
+ return Promise.resolve();
119
+ }
120
+ }] : [];
121
+ this.dataType = "object";
122
+ });
123
+ export default GyGoods;
@@ -0,0 +1,58 @@
1
+ import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../../type";
2
+ import React from "react";
3
+ import { BsType, BsMemo, BsHeaderGood, SystemOrderNo } from "../../BS/common/index";
4
+ import CommonHeaderGoods from "../../CommonHeaderGood";
5
+ declare class GyReissue implements ComponentInterface {
6
+ name: string;
7
+ id: string;
8
+ sortField: string;
9
+ type: string;
10
+ rules: any[];
11
+ componentConfig: ComponentInterface["componentConfig"];
12
+ effects: ComponentInterface["effects"];
13
+ isCombinationComponent: boolean;
14
+ formField: string;
15
+ canSort: boolean;
16
+ children: ComponentInterface[];
17
+ dataType: ComponentInterface["dataType"];
18
+ bsType: BsType;
19
+ bsMemo: BsMemo;
20
+ systemOrderNo: SystemOrderNo;
21
+ reissueGoods: BsHeaderGood | CommonHeaderGoods;
22
+ constructor(options: PickOption);
23
+ renderClient: (record: any) => React.JSX.Element | null;
24
+ renderPc: () => null;
25
+ renderLog: (r: Record) => React.JSX.Element;
26
+ getComponentValue: (r: Record) => {
27
+ [key: string]: any;
28
+ };
29
+ renderExport: () => null;
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: "Cascader";
37
+ props: {
38
+ options: any[] | undefined;
39
+ fieldNames: {
40
+ label: string;
41
+ value: string;
42
+ children: string;
43
+ };
44
+ };
45
+ formatFilterValue: (val: Array<string>) => string[] | undefined;
46
+ filterFn: (value: string) => (i: Record) => boolean;
47
+ } | {
48
+ searchDefaultConditions: "like";
49
+ type: string;
50
+ id: string;
51
+ name: string;
52
+ filterComponentType: "Input";
53
+ props?: undefined;
54
+ formatFilterValue?: undefined;
55
+ filterFn?: undefined;
56
+ })[];
57
+ }
58
+ export default GyReissue;
@@ -0,0 +1,188 @@
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 _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); }
5
+ 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); } }
6
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
7
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
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 GetFormItem from "../../GetFormItem";
13
+ import ItemView from "../../../commonComponents/ItemView";
14
+ import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
15
+ import { GyReissue as Reissue } from "@kmkf-fe-packages/basic-components";
16
+ import { SYMBOL } from "../../../constant";
17
+ import { BsGoodsTable } from "../../Common/index";
18
+ import { BsType, BsMemo, SystemOrderNo } from "../../BS/common/index";
19
+ import CommonHeaderGoods from "../../CommonHeaderGood";
20
+ var typeMap = {
21
+ GY_REISSUE_GOODS: {
22
+ key: "gyReissueGoods",
23
+ name: "管易",
24
+ typeName: "gyReissueType",
25
+ remark: "gyReissueType_memo",
26
+ systemOrderNo: "gySystemOrderNo",
27
+ errMsg: "请选择管易补发商品"
28
+ }
29
+ };
30
+ var GyReissue = /*#__PURE__*/_createClass(function GyReissue(options) {
31
+ var _this = this,
32
+ _typeMap$options$type,
33
+ _typeMap$options$type2,
34
+ _typeMap$options$type3,
35
+ _typeMap$options$type4,
36
+ _this$componentConfig6;
37
+ _classCallCheck(this, GyReissue);
38
+ _defineProperty(this, "name", void 0);
39
+ _defineProperty(this, "id", void 0);
40
+ _defineProperty(this, "sortField", void 0);
41
+ _defineProperty(this, "type", void 0);
42
+ _defineProperty(this, "rules", void 0);
43
+ _defineProperty(this, "componentConfig", void 0);
44
+ _defineProperty(this, "effects", void 0);
45
+ _defineProperty(this, "isCombinationComponent", void 0);
46
+ _defineProperty(this, "formField", void 0);
47
+ _defineProperty(this, "canSort", void 0);
48
+ _defineProperty(this, "children", void 0);
49
+ _defineProperty(this, "dataType", void 0);
50
+ _defineProperty(this, "bsType", void 0);
51
+ _defineProperty(this, "bsMemo", void 0);
52
+ _defineProperty(this, "systemOrderNo", void 0);
53
+ _defineProperty(this, "reissueGoods", void 0);
54
+ _defineProperty(this, "renderClient", function (record) {
55
+ var _record, _typeMap$_this$type, _record2, _typeMap$_this$type2, _this$componentConfig;
56
+ return !isNull(record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) ? /*#__PURE__*/React.createElement(React.Fragment, null, _this.bsType.renderClient(record), _this.bsMemo.renderClient(record), _this.systemOrderNo.renderClient(record), record !== null && record !== void 0 && (_record = record["".concat(_this.id)]) !== null && _record !== void 0 && _record[(_typeMap$_this$type = typeMap[_this.type]) === null || _typeMap$_this$type === void 0 ? void 0 : _typeMap$_this$type.key].length ? /*#__PURE__*/React.createElement(ItemView, {
57
+ id: _this.id,
58
+ label: _this.name,
59
+ value: /*#__PURE__*/React.createElement(BsGoodsTable, {
60
+ list: (record === null || record === void 0 ? void 0 : (_record2 = record["".concat(_this.id)]) === null || _record2 === void 0 ? void 0 : _record2["".concat((_typeMap$_this$type2 = typeMap[_this.type]) === null || _typeMap$_this$type2 === void 0 ? void 0 : _typeMap$_this$type2.key)]) || [],
61
+ showHeader: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.showHeader) || [],
62
+ type: _this.type
63
+ })
64
+ }) : null) : null;
65
+ });
66
+ _defineProperty(this, "renderPc", function () {
67
+ return null;
68
+ });
69
+ _defineProperty(this, "renderLog", function (r) {
70
+ var _r, _typeMap$_this$type3, _typeMap$_this$type4, _r2, _typeMap$_this$type5, _typeMap$_this$type6, _this$componentConfig2;
71
+ return /*#__PURE__*/React.createElement(React.Fragment, null, r !== null && r !== void 0 && (_r = r["".concat(_this.id, "_").concat((_typeMap$_this$type3 = typeMap[_this.type]) === null || _typeMap$_this$type3 === void 0 ? void 0 : _typeMap$_this$type3.typeName)]) !== null && _r !== void 0 && _r.length ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, "\u5907\u6CE8\u7C7B\u578B:", _this.bsType.renderLog(r)), /*#__PURE__*/React.createElement("div", null, "\u5907\u6CE8\u4FE1\u606F:", _this.bsMemo.renderLog(r))) : null, r !== null && r !== void 0 && r["".concat(_this.id, "_").concat((_typeMap$_this$type4 = typeMap[_this.type]) === null || _typeMap$_this$type4 === void 0 ? void 0 : _typeMap$_this$type4.systemOrderNo)] ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, "\u7CFB\u7EDF\u8BA2\u5355\u53F7:", _this.systemOrderNo.renderLog(r))) : null, r !== null && r !== void 0 && (_r2 = r["".concat(_this.id, "_").concat((_typeMap$_this$type5 = typeMap[_this.type]) === null || _typeMap$_this$type5 === void 0 ? void 0 : _typeMap$_this$type5.key)]) !== null && _r2 !== void 0 && _r2.length ? /*#__PURE__*/React.createElement("div", null, "\u8865\u53D1\u5546\u54C1\uFF1A", /*#__PURE__*/React.createElement(BsGoodsTable, {
72
+ list: (r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_typeMap$_this$type6 = typeMap[_this.type]) === null || _typeMap$_this$type6 === void 0 ? void 0 : _typeMap$_this$type6.key)]) || [],
73
+ showHeader: ((_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.showHeader) || [],
74
+ type: _this.type
75
+ })) : null, r !== null && r !== void 0 && r["".concat(_this.id, "_shopCode")] ? /*#__PURE__*/React.createElement("div", null, "\u5E97\u94FAid:", r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_shopCode")]) : null);
76
+ });
77
+ _defineProperty(this, "getComponentValue", function (r) {
78
+ var _typeMap$_this$type7, _typeMap$_this$type8, _typeMap$_this$type9, _typeMap$_this$type10, _typeMap$_this$type11, _typeMap$_this$type12;
79
+ var obj = {};
80
+ obj["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$_this$type7 = typeMap[_this.type]) === null || _typeMap$_this$type7 === void 0 ? void 0 : _typeMap$_this$type7.typeName)] = r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_typeMap$_this$type8 = typeMap[_this.type]) === null || _typeMap$_this$type8 === void 0 ? void 0 : _typeMap$_this$type8.typeName)];
81
+ obj["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$_this$type9 = typeMap[_this.type]) === null || _typeMap$_this$type9 === void 0 ? void 0 : _typeMap$_this$type9.key)] = r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_typeMap$_this$type10 = typeMap[_this.type]) === null || _typeMap$_this$type10 === void 0 ? void 0 : _typeMap$_this$type10.key)];
82
+ obj["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$_this$type11 = typeMap[_this.type]) === null || _typeMap$_this$type11 === void 0 ? void 0 : _typeMap$_this$type11.systemOrderNo)] = r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_typeMap$_this$type12 = typeMap[_this.type]) === null || _typeMap$_this$type12 === void 0 ? void 0 : _typeMap$_this$type12.systemOrderNo)];
83
+ return obj;
84
+ });
85
+ _defineProperty(this, "renderExport", function () {
86
+ return null;
87
+ });
88
+ _defineProperty(this, "editRender", function (p) {
89
+ var _this$componentConfig3, _this$componentConfig4, _this$componentConfig5, _this$effects, _this$effects2, _this$effects3;
90
+ return /*#__PURE__*/React.createElement(GetFormItem, {
91
+ title: _this.name,
92
+ name: _this.id,
93
+ rules: _this.rules,
94
+ required: false,
95
+ hidden: p === null || p === void 0 ? void 0 : p.hidden,
96
+ display: p === null || p === void 0 ? void 0 : p.display,
97
+ 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 : "",
98
+ component: /*#__PURE__*/React.createElement(Reissue, _extends({}, _this.componentConfig, {
99
+ maxLength: ((_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.maxLength) || 20,
100
+ shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
101
+ shopList: ((_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopList) || [],
102
+ companyKey: (_this$effects3 = _this.effects) === null || _this$effects3 === void 0 ? void 0 : _this$effects3.companyKey,
103
+ width: "90%",
104
+ type: _this.type
105
+ }))
106
+ });
107
+ });
108
+ _defineProperty(this, "filterConfig", function (item) {
109
+ var _item$templateConfig;
110
+ return [{
111
+ searchDefaultConditions: SYMBOL.in,
112
+ type: item.type,
113
+ id: "".concat(item.id, "_").concat(typeMap[_this.type].typeName),
114
+ name: "".concat(item.name, "-\u8865\u53D1\u7C7B\u578B"),
115
+ filterComponentType: "Cascader",
116
+ props: {
117
+ options: item === null || item === void 0 ? void 0 : (_item$templateConfig = item.templateConfig) === null || _item$templateConfig === void 0 ? void 0 : _item$templateConfig.reasonList,
118
+ fieldNames: {
119
+ label: "label",
120
+ value: "value",
121
+ children: "children"
122
+ }
123
+ },
124
+ formatFilterValue: function formatFilterValue(val) {
125
+ if ((val === null || val === void 0 ? void 0 : val.length) > 0) {
126
+ return [val[val.length - 1]];
127
+ }
128
+ },
129
+ filterFn: function filterFn(value) {
130
+ return function (i) {
131
+ var _typeMap$_this$type13;
132
+ return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, "".concat((_typeMap$_this$type13 = typeMap[_this.type]) === null || _typeMap$_this$type13 === void 0 ? void 0 : _typeMap$_this$type13.typeName)), value);
133
+ };
134
+ }
135
+ }, {
136
+ searchDefaultConditions: SYMBOL.like,
137
+ type: item.type,
138
+ id: "".concat(item.id, "_").concat(typeMap[_this.type].systemOrderNo),
139
+ name: "".concat(item.name, "-\u8865\u53D1\u7CFB\u7EDF\u8BA2\u5355\u53F7"),
140
+ filterComponentType: "Input"
141
+ }, {
142
+ searchDefaultConditions: SYMBOL.like,
143
+ type: item.type,
144
+ id: "".concat(item.id, "_").concat(typeMap[_this.type].key),
145
+ name: "".concat(_this.name),
146
+ filterComponentType: "Input"
147
+ }];
148
+ });
149
+ this.name = options.name;
150
+ this.id = options.id;
151
+ this.sortField = "".concat(options.id);
152
+ this.formField = "".concat(options.id);
153
+ this.type = options.type;
154
+ this.effects = options === null || options === void 0 ? void 0 : options.effects;
155
+ this.isCombinationComponent = true;
156
+ this.canSort = false;
157
+ this.bsType = new BsType(_objectSpread(_objectSpread({}, options), {}, {
158
+ id: "".concat(options.id, "_").concat((_typeMap$options$type = typeMap[options.type]) === null || _typeMap$options$type === void 0 ? void 0 : _typeMap$options$type.typeName),
159
+ name: "补发类型"
160
+ }));
161
+ this.systemOrderNo = new SystemOrderNo(_objectSpread(_objectSpread({}, options), {}, {
162
+ id: "".concat(options.id, "_").concat((_typeMap$options$type2 = typeMap[options.type]) === null || _typeMap$options$type2 === void 0 ? void 0 : _typeMap$options$type2.systemOrderNo),
163
+ name: "补发系统订单号"
164
+ }));
165
+ this.bsMemo = new BsMemo(_objectSpread(_objectSpread({}, options), {}, {
166
+ id: "".concat(options.id, "_").concat((_typeMap$options$type3 = typeMap[options.type]) === null || _typeMap$options$type3 === void 0 ? void 0 : _typeMap$options$type3.remark),
167
+ name: "补发备注"
168
+ }));
169
+ this.reissueGoods = new CommonHeaderGoods(_objectSpread(_objectSpread({}, options), {}, {
170
+ id: "".concat(options.id, "_").concat((_typeMap$options$type4 = typeMap[options.type]) === null || _typeMap$options$type4 === void 0 ? void 0 : _typeMap$options$type4.key),
171
+ name: "商品信息"
172
+ }));
173
+ this.children = [this.bsType, this.systemOrderNo, this.bsMemo, this.reissueGoods];
174
+ this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
175
+ this.rules = this !== null && this !== void 0 && (_this$componentConfig6 = this.componentConfig) !== null && _this$componentConfig6 !== void 0 && _this$componentConfig6.required ? [{
176
+ required: true,
177
+ validator: function validator(_, value) {
178
+ var _value, _typeMap$options$type5;
179
+ if (!value || !(value !== null && value !== void 0 && (_value = value["".concat((_typeMap$options$type5 = typeMap[options.type]) === null || _typeMap$options$type5 === void 0 ? void 0 : _typeMap$options$type5.key)]) !== null && _value !== void 0 && _value.length)) {
180
+ var _typeMap$options$type6;
181
+ return Promise.reject(new Error("".concat((_typeMap$options$type6 = typeMap[options.type]) === null || _typeMap$options$type6 === void 0 ? void 0 : _typeMap$options$type6.errMsg)));
182
+ }
183
+ return Promise.resolve();
184
+ }
185
+ }] : [];
186
+ this.dataType = "object";
187
+ });
188
+ export default GyReissue;