@kmkf-fe-packages/services-components 1.4.0-rc.2 → 1.4.2

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 (28) hide show
  1. package/dist/esm/commonComponents/SelectMark/index.js +0 -9
  2. package/dist/esm/components/BS/common/BsMemo.js +1 -2
  3. package/dist/esm/components/BS/common/BsType.js +1 -2
  4. package/dist/esm/components/Common/index.d.ts +1 -1
  5. package/dist/esm/components/Common/index.js +5 -187
  6. package/dist/esm/components/CommonHeaderGood/index.js +0 -182
  7. package/dist/esm/components/CommonMultiStatus/index.js +19 -25
  8. package/dist/esm/components/CommonSystemOrder/index.js +8 -10
  9. package/dist/esm/components/FlowMarkSelect/index.js +1 -14
  10. package/dist/esm/components/Label/index.d.ts +2 -15
  11. package/dist/esm/components/Label/index.js +7 -34
  12. package/dist/esm/components/MsgStatus/index.js +1 -2
  13. package/dist/esm/components/StatusSelect/index.js +0 -3
  14. package/dist/esm/factory.d.ts +2 -2
  15. package/dist/esm/factory.js +1 -11
  16. package/dist/esm/index.d.ts +0 -4
  17. package/dist/esm/index.js +0 -4
  18. package/dist/esm/type.d.ts +0 -1
  19. package/package.json +4 -5
  20. package/dist/esm/commonComponents/SelectMark/img/xingxing-grey.png +0 -0
  21. package/dist/esm/components/AfterSalesOrderId/index.d.ts +0 -35
  22. package/dist/esm/components/AfterSalesOrderId/index.js +0 -107
  23. package/dist/esm/components/KmErpSendGood/index.d.ts +0 -53
  24. package/dist/esm/components/KmErpSendGood/index.js +0 -213
  25. package/dist/esm/components/WDT/WdtExchange/index.d.ts +0 -35
  26. package/dist/esm/components/WDT/WdtExchange/index.js +0 -183
  27. package/dist/esm/components/WDT/WdtReturn/index.d.ts +0 -54
  28. package/dist/esm/components/WDT/WdtReturn/index.js +0 -150
@@ -1,213 +0,0 @@
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, WdtSendData } from "@kmkf-fe-packages/kmkf-utils";
16
- import { SYMBOL } from "../../constant";
17
- var JstSendGood = /*#__PURE__*/_createClass(function JstSendGood(_options) {
18
- var _this = this,
19
- _this$componentConfig,
20
- _this$componentConfig2;
21
- _classCallCheck(this, JstSendGood);
22
- _defineProperty(this, "name", void 0);
23
- _defineProperty(this, "id", void 0);
24
- _defineProperty(this, "sortField", void 0);
25
- _defineProperty(this, "sortChildField", void 0);
26
- _defineProperty(this, "type", void 0);
27
- _defineProperty(this, "rules", void 0);
28
- _defineProperty(this, "componentConfig", void 0);
29
- _defineProperty(this, "align", 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, "suffixKey", void 0);
36
- _defineProperty(this, "suffixSendId", void 0);
37
- _defineProperty(this, "suffixSendName", void 0);
38
- _defineProperty(this, "getSortChildFields", function (type, options) {
39
- if (type === 'all') {
40
- return [{
41
- name: "发货仓名称",
42
- key: "".concat(options.id, "_").concat(_this.suffixSendName),
43
- dataType: "string"
44
- }, {
45
- name: "发货仓编码",
46
- key: "".concat(options.id, "_").concat(_this.suffixSendId),
47
- dataType: "string"
48
- }];
49
- }
50
- if (type === 'sendName') {
51
- return [{
52
- name: "发货仓名称",
53
- key: "".concat(options.id, "_").concat(_this.suffixSendName),
54
- dataType: "string"
55
- }];
56
- }
57
- if (type === 'sendId') {
58
- return [{
59
- name: "发货仓编码",
60
- key: "".concat(options.id, "_").concat(_this.suffixSendId),
61
- dataType: "string"
62
- }];
63
- }
64
- return [];
65
- });
66
- _defineProperty(this, "renderClient", function (record) {
67
- 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) {
68
- return !isNull(item);
69
- }) : false;
70
- return isShow ? /*#__PURE__*/React.createElement(ItemView, {
71
- id: _this.id,
72
- label: _this.name,
73
- value: /*#__PURE__*/React.createElement(JstGoodImage, {
74
- list: record === null || record === void 0 ? void 0 : record[_this.id],
75
- type: 3,
76
- platformType: _this.type === 'WDT_SEND_GOOD' ? 'wdt' : 'default'
77
- })
78
- }) : null;
79
- });
80
- _defineProperty(this, "renderPc", function (value, record) {
81
- var list = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(_this.suffixKey)];
82
- //兼容多个商品
83
- return /*#__PURE__*/React.createElement("span", {
84
- onClick: function onClick(e) {
85
- return e.stopPropagation();
86
- }
87
- }, /*#__PURE__*/React.createElement(JstGoodImage, {
88
- list: list,
89
- type: 3,
90
- platformType: _this.type === 'WDT_SEND_GOOD' ? 'wdt' : 'default'
91
- }));
92
- });
93
- _defineProperty(this, "renderLog", function (r) {
94
- var list = r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat(_this.suffixKey)];
95
- if (isNull(list)) return null;
96
- return _this.renderPc(undefined, r);
97
- });
98
- _defineProperty(this, "getComponentValue", function (r) {
99
- return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat(_this.suffixKey)];
100
- });
101
- _defineProperty(this, "renderExport", function (value, record) {
102
- var list = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(_this.suffixKey)];
103
- return (list || []).map(function (item) {
104
- return [item === null || item === void 0 ? void 0 : item.sendId, _this.type === 'WDT_SEND_GOOD' ? WdtSendData.getInstance().getWdtSendNameByCode(item === null || item === void 0 ? void 0 : item.sendName) : item === null || item === void 0 ? void 0 : item.sendName].join("/");
105
- }).join(",");
106
- });
107
- _defineProperty(this, "editRender", function (p) {
108
- return /*#__PURE__*/React.createElement(GetFormItem, {
109
- title: _this.name,
110
- name: _this.id,
111
- rules: _this.rules,
112
- required: false,
113
- hidden: p === null || p === void 0 ? void 0 : p.hidden,
114
- display: p === null || p === void 0 ? void 0 : p.display,
115
- component: /*#__PURE__*/React.createElement(JstGoods, _extends({}, _this.componentConfig, {
116
- type: 3,
117
- platformType: _this.type === 'WDT_SEND_GOOD' ? 'wdt' : 'default'
118
- }))
119
- });
120
- });
121
- _defineProperty(this, "filterConfig", function (item) {
122
- return [_this.type === 'WDT_SEND_GOOD' ? {
123
- searchDefaultConditions: SYMBOL.in,
124
- type: item.type,
125
- id: "".concat(item.id, "_").concat(_this.suffixSendName),
126
- name: "".concat(_this.name, "\u540D\u79F0"),
127
- filterComponentType: "MultipleSelect",
128
- props: {
129
- options: WdtSendData.getInstance().getWdtSendData() || []
130
- },
131
- filterFn: function filterFn(value) {
132
- return function (i) {
133
- var _ref;
134
- return (_ref = _filterFn.filterTableListItemColumnValue(i, item.id, "sendName").split(",") || []) === null || _ref === void 0 ? void 0 : _ref.some(function (item) {
135
- var _String;
136
- var sendName = item ? (_String = String(item)) === null || _String === void 0 ? void 0 : _String.includes(value) : false;
137
- return sendName;
138
- });
139
- };
140
- }
141
- } : {
142
- searchDefaultConditions: SYMBOL.like,
143
- type: item.type,
144
- id: "".concat(item.id, "_").concat(_this.suffixSendName),
145
- name: "".concat(_this.name, "\u540D\u79F0"),
146
- filterComponentType: "Input",
147
- filterFn: function filterFn(value) {
148
- return function (i) {
149
- var _ref2;
150
- return (_ref2 = _filterFn.filterTableListItemColumnValue(i, item.id, _this.suffixKey) || []) === null || _ref2 === void 0 ? void 0 : _ref2.some(function (item) {
151
- var _String2;
152
- var name = item !== null && item !== void 0 && item.sendName ? (_String2 = String(item === null || item === void 0 ? void 0 : item.sendName)) === null || _String2 === void 0 ? void 0 : _String2.includes(value) : false;
153
- return name;
154
- });
155
- };
156
- }
157
- }, {
158
- searchDefaultConditions: SYMBOL.like,
159
- type: item.type,
160
- id: "".concat(item.id, "_").concat(_this.suffixSendId),
161
- name: "".concat(_this.name, "\u7F16\u7801"),
162
- filterComponentType: "Input",
163
- filterFn: function filterFn(value) {
164
- return function (i) {
165
- var _ref3;
166
- return (_ref3 = _filterFn.filterTableListItemColumnValue(i, item.id, _this.suffixKey) || []) === null || _ref3 === void 0 ? void 0 : _ref3.some(function (item) {
167
- var _String3;
168
- var id = item !== null && item !== void 0 && item.sendId ? (_String3 = String(item === null || item === void 0 ? void 0 : item.sendId)) === null || _String3 === void 0 ? void 0 : _String3.includes(value) : false;
169
- return id;
170
- });
171
- };
172
- }
173
- }];
174
- });
175
- this.name = _options.name;
176
- this.id = _options.id;
177
- this.suffixKey = 'kmSendGood';
178
- this.suffixSendId = 'kmSendId';
179
- this.suffixSendName = 'kmSendName';
180
- this.sortField = "".concat(_options.id, "_").concat(this.suffixKey);
181
- this.formField = "".concat(_options.id, "_").concat(this.suffixKey);
182
- this.componentConfig = _options.componentConfig;
183
- this.sortChildField = this.getSortChildFields(((_this$componentConfig = this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.showField) || '', _options);
184
- this.type = _options.type;
185
- this.dataType = "object";
186
- this.rules = (_this$componentConfig2 = this.componentConfig) !== null && _this$componentConfig2 !== void 0 && _this$componentConfig2.required ? [{
187
- required: true,
188
- validator: function validator(_, value) {
189
- if (!value || !value.length) {
190
- return Promise.reject(new Error("请选择宝贝"));
191
- }
192
- var hasNo = (value || []).some(function (item) {
193
- var _this$componentConfig3, _this$componentConfig4;
194
- if (["sendName"].includes((_this === null || _this === void 0 ? void 0 : (_this$componentConfig3 = _this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.showField) || "")) {
195
- return item.sendName;
196
- } else if (["sendId"].includes((_this === null || _this === void 0 ? void 0 : (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.showField) || "")) {
197
- return item.sendId;
198
- } else {
199
- return item.sendId && item.sendName;
200
- }
201
- });
202
- if (!hasNo) {
203
- return Promise.reject(new Error("\u81F3\u5C11\u586B\u5199\u4E00\u4E2A\u5B8C\u6574\u7684\u53D1\u8D27\u4ED3\u4FE1\u606F"));
204
- }
205
- return Promise.resolve();
206
- }
207
- }] : [];
208
- this.align = "left";
209
- this.isCombinationComponent = false;
210
- this.canSort = false;
211
- this.children = [];
212
- });
213
- export default JstSendGood;
@@ -1,35 +0,0 @@
1
- import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../../type";
2
- import React from "react";
3
- import CommonHeaderGoods from "../../CommonHeaderGood";
4
- declare class WDTExchange 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
- returnGoods: CommonHeaderGoods;
18
- constructor(options: PickOption);
19
- renderClient: (record: any) => React.JSX.Element | null;
20
- renderPc: () => null;
21
- renderLog: (r: Record) => React.JSX.Element;
22
- getComponentValue: (r: Record) => {
23
- wdtExchangeGoods: any;
24
- };
25
- renderExport: (value: any, record: any) => null;
26
- editRender: (p: any) => React.JSX.Element;
27
- filterConfig: (item: ColumnConfig) => {
28
- searchDefaultConditions: "like";
29
- type: string;
30
- id: string;
31
- name: string;
32
- filterComponentType: "Input";
33
- }[];
34
- }
35
- export default WDTExchange;
@@ -1,183 +0,0 @@
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 ItemView from "../../../commonComponents/ItemView";
15
- import { isNull } from "@kmkf-fe-packages/kmkf-utils";
16
- import { SYMBOL } from "../../../constant";
17
- // import { BsType, BsMemo } from "../../Bs/common";
18
- import { CommonExchangeGoods } from "@kmkf-fe-packages/basic-components";
19
- import CommonHeaderGoods from "../../CommonHeaderGood";
20
- var WDTExchange = /*#__PURE__*/_createClass(
21
- // wdtType: BsType;
22
- // wdtMemo: BsMemo;
23
-
24
- // swapOutGoods: BsHeaderGood;
25
- // giftGoods: BsHeaderGood;
26
- function WDTExchange(options) {
27
- var _this = this,
28
- _this$componentConfig4;
29
- _classCallCheck(this, WDTExchange);
30
- _defineProperty(this, "name", void 0);
31
- _defineProperty(this, "id", void 0);
32
- _defineProperty(this, "sortField", void 0);
33
- _defineProperty(this, "type", void 0);
34
- _defineProperty(this, "rules", void 0);
35
- _defineProperty(this, "componentConfig", void 0);
36
- _defineProperty(this, "effects", void 0);
37
- _defineProperty(this, "isCombinationComponent", void 0);
38
- _defineProperty(this, "formField", void 0);
39
- _defineProperty(this, "canSort", void 0);
40
- _defineProperty(this, "children", void 0);
41
- _defineProperty(this, "dataType", void 0);
42
- _defineProperty(this, "returnGoods", void 0);
43
- _defineProperty(this, "renderClient", function (record) {
44
- var _this$componentConfig;
45
- var wdtExchangeGoods = JSON.parse((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_wdtExchangeGoods")]) || "[]");
46
- return !isNull(record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ItemView, {
47
- id: "".concat(_this.id, "-out"),
48
- label: "".concat(_this.name, "-\u6362\u51FA"),
49
- value: /*#__PURE__*/React.createElement(BsGoodsTable, {
50
- type: _this.type,
51
- list: wdtExchangeGoods || [],
52
- showHeader: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.showHeader) || []
53
- })
54
- })) : null;
55
- });
56
- _defineProperty(this, "renderPc", function () {
57
- return null;
58
- });
59
- _defineProperty(this, "renderLog", function (r) {
60
- var _r, _this$componentConfig2;
61
- return /*#__PURE__*/React.createElement(React.Fragment, null, r !== null && r !== void 0 && (_r = r["".concat(_this.id, "_wdtExchangeGoods")]) !== null && _r !== void 0 && _r.length ? /*#__PURE__*/React.createElement("div", null, "\u6362\u51FA\u5546\u54C1\uFF1A", /*#__PURE__*/React.createElement(BsGoodsTable, {
62
- type: _this.type,
63
- list: (r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_wdtExchangeGoods")]) || [],
64
- showHeader: ((_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.showHeader) || []
65
- })) : 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);
66
- });
67
- _defineProperty(this, "getComponentValue", function (r) {
68
- return {
69
- wdtExchangeGoods: r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_wdtExchangeGoods")]
70
- };
71
- });
72
- _defineProperty(this, "renderExport", function (value, record) {
73
- return null;
74
- });
75
- _defineProperty(this, "editRender", function (p) {
76
- var _this$componentConfig3, _this$effects, _this$effects2, _this$effects3;
77
- return /*#__PURE__*/React.createElement(GetFormItem, {
78
- title: _this.name,
79
- name: _this.id,
80
- rules: _this.rules,
81
- required: false,
82
- hidden: p === null || p === void 0 ? void 0 : p.hidden,
83
- display: p === null || p === void 0 ? void 0 : p.display,
84
- component: /*#__PURE__*/React.createElement(CommonExchangeGoods, _extends({}, _this.componentConfig, {
85
- maxLength: ((_this$componentConfig3 = _this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.maxLength) || 20,
86
- shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
87
- shopList: ((_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopList) || [],
88
- companyKey: (_this$effects3 = _this.effects) === null || _this$effects3 === void 0 ? void 0 : _this$effects3.companyKey,
89
- width: "90%",
90
- type: "WDT_EXCHANGE_GOODS"
91
- }))
92
- });
93
- });
94
- _defineProperty(this, "filterConfig", function (item) {
95
- return [{
96
- searchDefaultConditions: SYMBOL.like,
97
- type: item.type,
98
- id: "".concat(item.id, "_wdtExchangeGoods"),
99
- name: "".concat(_this.name, "-\u6362\u51FA"),
100
- filterComponentType: "Input"
101
- }];
102
- });
103
- this.name = options.name;
104
- this.id = options.id;
105
- this.sortField = "".concat(options.id);
106
- this.formField = "".concat(options.id);
107
- this.type = options.type;
108
- this.effects = options === null || options === void 0 ? void 0 : options.effects;
109
- this.isCombinationComponent = true;
110
- this.canSort = false;
111
- // this.wdtType = new BsType({
112
- // ...options,
113
- // id: `${options.id}_wdtExchangeType`,
114
- // name: "换货类型",
115
- // });
116
- // this.wdtMemo = new BsMemo({
117
- // ...options,
118
- // id: `${options.id}_wdtExchangeType_memo`,
119
- // name: "换货备注",
120
- // });
121
- this.returnGoods = new CommonHeaderGoods(_objectSpread(_objectSpread({}, options), {}, {
122
- id: "".concat(options.id, "_wdtExchangeGoods"),
123
- name: "商品信息"
124
- }));
125
- // this.swapOutGoods = new BsHeaderGood({
126
- // ...options,
127
- // id: `${options.id}_wdtExchangeSwapOutGoods`,
128
- // name: "换出商品",
129
- // });
130
- // this.giftGoods = new BsHeaderGood({
131
- // ...options,
132
- // id: `${options.id}_wdtExchangeGiftGoods`,
133
- // name: "赠品商品",
134
- // });
135
- this.children = [
136
- // this.wdtType,
137
- // this.wdtMemo,
138
- this.returnGoods
139
- // this.swapOutGoods,
140
- // this.giftGoods,
141
- ];
142
-
143
- this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
144
- this.rules = [{
145
- required: (_this$componentConfig4 = this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.required,
146
- validator: function validator(_, value) {
147
- var _this$componentConfig5, _value$wdtExchangeGoo;
148
- if ((_this$componentConfig5 = _this.componentConfig) !== null && _this$componentConfig5 !== void 0 && _this$componentConfig5.required && !(value !== null && value !== void 0 && (_value$wdtExchangeGoo = value.wdtExchangeGoods) !== null && _value$wdtExchangeGoo !== void 0 && _value$wdtExchangeGoo.length)) {
149
- return Promise.reject(new Error("请选择wdt换货商品"));
150
- }
151
- return Promise.resolve();
152
- }
153
- }
154
- /* {
155
- validator: (_: any, value: any) => {
156
- if (value && ["2", "4"].includes(value?.wdtExchangeType?.[0])) {
157
- const hasNoGood = (value?.wdtExchangeGoods || []).some(
158
- (item: any) => {
159
- return !item?.wdtExchangeGoods.length;
160
- }
161
- );
162
- if (hasNoGood) {
163
- return Promise.reject(new Error("请选择退回商品后再提交工单"));
164
- }
165
- const hasLen = (value?.wdtExchangeGoods || []).some(
166
- (item: any) => {
167
- return (
168
- item?.wdtExchangeGoods.length !==
169
- item?.wdtExchangeSwapOutGoods.length
170
- );
171
- }
172
- );
173
- if (hasLen) {
174
- return Promise.reject(new Error("请核对商品数据,再提交工单"));
175
- }
176
- }
177
- return Promise.resolve();
178
- },
179
- },*/];
180
-
181
- this.dataType = "object";
182
- });
183
- export default WDTExchange;
@@ -1,54 +0,0 @@
1
- import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../../type";
2
- import React from "react";
3
- import { BsType } from "../../BS/common/index";
4
- import CommonHeaderGoods from "../../CommonHeaderGood";
5
- declare class WdtReturn 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
- wdtType: BsType;
19
- reissueGoods: CommonHeaderGoods;
20
- constructor(options: PickOption);
21
- renderClient: (record: any) => React.JSX.Element | null;
22
- renderPc: () => null;
23
- renderLog: (r: Record) => React.JSX.Element;
24
- getComponentValue: (r: Record) => any;
25
- renderExport: () => null;
26
- editRender: (p: any) => React.JSX.Element;
27
- filterConfig: (item: ColumnConfig) => ({
28
- searchDefaultConditions: "in";
29
- type: string;
30
- id: string;
31
- name: string;
32
- filterComponentType: "Cascader";
33
- props: {
34
- options: any[] | undefined;
35
- fieldNames: {
36
- label: string;
37
- value: string;
38
- children: string;
39
- };
40
- };
41
- formatFilterValue: (val: Array<string>) => string[] | undefined;
42
- filterFn: (value: string) => (i: Record) => boolean;
43
- } | {
44
- searchDefaultConditions: "like";
45
- type: string;
46
- id: string;
47
- name: string;
48
- filterComponentType: "Input";
49
- props?: undefined;
50
- formatFilterValue?: undefined;
51
- filterFn?: undefined;
52
- })[];
53
- }
54
- export default WdtReturn;
@@ -1,150 +0,0 @@
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 { SYMBOL } from "../../../constant";
16
- import { BsGoodsTable } from "../../Common";
17
- import { BsType } from "../../BS/common/index";
18
- import { CommonReturnGoods } from "@kmkf-fe-packages/basic-components";
19
- import CommonHeaderGoods from "../../CommonHeaderGood";
20
- var WdtReturn = /*#__PURE__*/_createClass(function WdtReturn(options) {
21
- var _this = this,
22
- _this$componentConfig4;
23
- _classCallCheck(this, WdtReturn);
24
- _defineProperty(this, "name", void 0);
25
- _defineProperty(this, "id", void 0);
26
- _defineProperty(this, "sortField", void 0);
27
- _defineProperty(this, "type", void 0);
28
- _defineProperty(this, "rules", void 0);
29
- _defineProperty(this, "componentConfig", void 0);
30
- _defineProperty(this, "effects", void 0);
31
- _defineProperty(this, "isCombinationComponent", void 0);
32
- _defineProperty(this, "formField", void 0);
33
- _defineProperty(this, "canSort", void 0);
34
- _defineProperty(this, "children", void 0);
35
- _defineProperty(this, "dataType", void 0);
36
- _defineProperty(this, "wdtType", void 0);
37
- _defineProperty(this, "reissueGoods", void 0);
38
- _defineProperty(this, "renderClient", function (record) {
39
- var _this$componentConfig;
40
- return !isNull(record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) ? /*#__PURE__*/React.createElement(React.Fragment, null, _this.wdtType.renderClient(record), record !== null && record !== void 0 && record["".concat(_this.id)].wdtReturnGoods.length ? /*#__PURE__*/React.createElement(ItemView, {
41
- id: _this.id,
42
- label: _this.name,
43
- value: /*#__PURE__*/React.createElement(BsGoodsTable, {
44
- type: _this.type,
45
- list: (record === null || record === void 0 ? void 0 : record["".concat(_this.id)].wdtReturnGoods) || [],
46
- showHeader: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.showHeader) || []
47
- })
48
- }) : null) : null;
49
- });
50
- _defineProperty(this, "renderPc", function () {
51
- return null;
52
- });
53
- _defineProperty(this, "renderLog", function (r) {
54
- var _r, _r2, _this$componentConfig2;
55
- return /*#__PURE__*/React.createElement(React.Fragment, null, r !== null && r !== void 0 && (_r = r["".concat(_this.id, "_wdtReturnType")]) !== null && _r !== void 0 && _r.length ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, "\u5907\u6CE8\u7C7B\u578B:", _this.wdtType.renderLog(r))) : null, r !== null && r !== void 0 && (_r2 = r["".concat(_this.id, "_wdtReturnGoods")]) !== null && _r2 !== void 0 && _r2.length ? /*#__PURE__*/React.createElement("div", null, "\u5546\u54C1\uFF1A", /*#__PURE__*/React.createElement(BsGoodsTable, {
56
- type: _this.type,
57
- list: (r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_wdtReturnGoods")]) || [],
58
- showHeader: ((_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.showHeader) || []
59
- })) : 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);
60
- });
61
- _defineProperty(this, "getComponentValue", function (r) {
62
- return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_wdtReturnGoods")];
63
- });
64
- _defineProperty(this, "renderExport", function () {
65
- return null;
66
- });
67
- _defineProperty(this, "editRender", function (p) {
68
- var _this$componentConfig3, _this$effects, _this$effects2, _this$effects3;
69
- return /*#__PURE__*/React.createElement(GetFormItem, {
70
- title: _this.name,
71
- name: _this.id,
72
- rules: _this.rules,
73
- required: false,
74
- hidden: p === null || p === void 0 ? void 0 : p.hidden,
75
- display: p === null || p === void 0 ? void 0 : p.display,
76
- component: /*#__PURE__*/React.createElement(CommonReturnGoods, _extends({}, _this.componentConfig, {
77
- maxLength: ((_this$componentConfig3 = _this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.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: "WDT_RETURN_GOODS",
82
- width: "90%"
83
- }))
84
- });
85
- });
86
- _defineProperty(this, "filterConfig", function (item) {
87
- var _item$templateConfig;
88
- return [{
89
- searchDefaultConditions: SYMBOL.in,
90
- type: item.type,
91
- id: "".concat(item.id, "_wdtReturnType"),
92
- name: "".concat(item.name, "-\u9000\u8D27\u7C7B\u578B"),
93
- filterComponentType: "Cascader",
94
- props: {
95
- options: item === null || item === void 0 ? void 0 : (_item$templateConfig = item.templateConfig) === null || _item$templateConfig === void 0 ? void 0 : _item$templateConfig.reasonList,
96
- fieldNames: {
97
- label: "label",
98
- value: "value",
99
- children: "children"
100
- }
101
- },
102
- formatFilterValue: function formatFilterValue(val) {
103
- if ((val === null || val === void 0 ? void 0 : val.length) > 0) {
104
- return [val[val.length - 1]];
105
- }
106
- },
107
- filterFn: function filterFn(value) {
108
- return function (i) {
109
- return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, "wdtReturnType"), value);
110
- };
111
- }
112
- }, {
113
- searchDefaultConditions: SYMBOL.like,
114
- type: item.type,
115
- id: "".concat(item.id, "_wdtReturnGoods"),
116
- name: "".concat(_this.name),
117
- filterComponentType: "Input"
118
- }];
119
- });
120
- this.name = options.name;
121
- this.id = options.id;
122
- this.sortField = "".concat(options.id);
123
- this.formField = "".concat(options.id);
124
- this.type = options.type;
125
- this.effects = options === null || options === void 0 ? void 0 : options.effects;
126
- this.isCombinationComponent = true;
127
- this.canSort = false;
128
- this.wdtType = new BsType(_objectSpread(_objectSpread({}, options), {}, {
129
- id: "".concat(options.id, "_wdtReturnType"),
130
- name: "退货类型"
131
- }));
132
- this.reissueGoods = new CommonHeaderGoods(_objectSpread(_objectSpread({}, options), {}, {
133
- id: "".concat(options.id, "_wdtReturnGoods"),
134
- name: "商品信息"
135
- }));
136
- this.children = [this.wdtType, this.reissueGoods];
137
- this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
138
- this.rules = this !== null && this !== void 0 && (_this$componentConfig4 = this.componentConfig) !== null && _this$componentConfig4 !== void 0 && _this$componentConfig4.required ? [{
139
- required: true,
140
- validator: function validator(_, value) {
141
- var _value$wdtReturnGoods;
142
- if (!value || !(value !== null && value !== void 0 && (_value$wdtReturnGoods = value.wdtReturnGoods) !== null && _value$wdtReturnGoods !== void 0 && _value$wdtReturnGoods.length)) {
143
- return Promise.reject(new Error("请选择wdt退货商品"));
144
- }
145
- return Promise.resolve();
146
- }
147
- }] : [];
148
- this.dataType = "object";
149
- });
150
- export default WdtReturn;