@kmkf-fe-packages/services-components 0.7.15-alpha.81 → 0.7.15-alpha.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/components/BS/BsExchange/index.d.ts +6 -6
- package/dist/esm/components/BS/BsExchange/index.js +26 -199
- package/dist/esm/components/BS/BsGoods/index.d.ts +6 -6
- package/dist/esm/components/BS/BsGoods/index.js +8 -65
- package/dist/esm/components/BS/BsReissue/index.d.ts +6 -6
- package/dist/esm/components/BS/BsReissue/index.js +15 -75
- package/dist/esm/components/BS/common/BsHeaderChild.d.ts +4 -4
- package/dist/esm/components/BS/common/BsHeaderChild.js +8 -8
- package/dist/esm/components/BS/common/BsHeaderGood.d.ts +4 -4
- package/dist/esm/components/BS/common/BsHeaderGood.js +41 -41
- package/dist/esm/components/BS/common/BsHeaderPic.js +1 -1
- package/dist/esm/components/BS/common/BsMemo.js +1 -1
- package/dist/esm/components/BS/common/BsType.js +1 -1
- package/dist/esm/components/BS/common/index.d.ts +5 -12
- package/dist/esm/components/BS/common/index.js +7 -7
- package/package.json +2 -2
- package/dist/esm/components/BS/common/BsHeaderCode.d.ts +0 -26
- package/dist/esm/components/BS/common/BsHeaderCode.js +0 -88
- package/dist/esm/components/BS/common/BsHeaderMoney.d.ts +0 -26
- package/dist/esm/components/BS/common/BsHeaderMoney.js +0 -88
- package/dist/esm/components/BS/common/BsHeaderName.d.ts +0 -26
- package/dist/esm/components/BS/common/BsHeaderName.js +0 -88
- package/dist/esm/components/BS/common/BsHeaderNumber.d.ts +0 -26
- package/dist/esm/components/BS/common/BsHeaderNumber.js +0 -88
- package/dist/esm/components/BS/common/BsHeaderShare.d.ts +0 -26
- package/dist/esm/components/BS/common/BsHeaderShare.js +0 -88
- package/dist/esm/components/BS/common/BsHeaderSku.d.ts +0 -26
- package/dist/esm/components/BS/common/BsHeaderSku.js +0 -88
- package/dist/esm/components/BS/common/BsHeaderType.d.ts +0 -26
- package/dist/esm/components/BS/common/BsHeaderType.js +0 -88
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, ColumnConfig, Record } from
|
|
2
|
-
import React from
|
|
3
|
-
import { BsType, BsMemo, BsHeaderGood } from
|
|
1
|
+
import { ComponentInterface, PickOption, ColumnConfig, Record } from '../../../type';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BsType, BsMemo, BsHeaderGood } from '../common/index';
|
|
4
4
|
declare class BsExchange implements ComponentInterface {
|
|
5
5
|
name: string;
|
|
6
6
|
id: string;
|
|
7
7
|
sortField: string;
|
|
8
8
|
type: string;
|
|
9
9
|
rules: any[];
|
|
10
|
-
componentConfig: ComponentInterface[
|
|
11
|
-
effects: ComponentInterface[
|
|
10
|
+
componentConfig: ComponentInterface['componentConfig'];
|
|
11
|
+
effects: ComponentInterface['effects'];
|
|
12
12
|
isCombinationComponent: boolean;
|
|
13
13
|
formField: string;
|
|
14
14
|
canSort: boolean;
|
|
15
15
|
children: ComponentInterface[];
|
|
16
|
-
dataType: ComponentInterface[
|
|
16
|
+
dataType: ComponentInterface['dataType'];
|
|
17
17
|
bsType: BsType;
|
|
18
18
|
bsMemo: BsMemo;
|
|
19
19
|
returnGoods: BsHeaderGood;
|
|
@@ -8,140 +8,14 @@ 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
|
|
11
|
+
import React from 'react';
|
|
12
12
|
import GetFormItem from "../../GetFormItem";
|
|
13
13
|
import { BsGoodsTable } from "../../Common";
|
|
14
14
|
import ItemView from "../../../commonComponents/ItemView";
|
|
15
|
-
import { isNull } from
|
|
16
|
-
import { BsExchange as Exchange } from
|
|
15
|
+
import { isNull } from '@kmkf-fe-packages/kmkf-utils';
|
|
16
|
+
import { BsExchange as Exchange } from '@kmkf-fe-packages/basic-components';
|
|
17
17
|
import { SYMBOL } from "../../../constant";
|
|
18
|
-
import { BsType, BsMemo,
|
|
19
|
-
var returnHeaderMap = {
|
|
20
|
-
pic: {
|
|
21
|
-
component: BsHeaderPic,
|
|
22
|
-
name: "退回图片",
|
|
23
|
-
key: "pic"
|
|
24
|
-
},
|
|
25
|
-
name: {
|
|
26
|
-
component: BsHeaderName,
|
|
27
|
-
name: "退回名称",
|
|
28
|
-
key: "name"
|
|
29
|
-
},
|
|
30
|
-
code: {
|
|
31
|
-
component: BsHeaderCode,
|
|
32
|
-
name: "退回编码",
|
|
33
|
-
key: "code"
|
|
34
|
-
},
|
|
35
|
-
sku: {
|
|
36
|
-
component: BsHeaderSku,
|
|
37
|
-
name: "退回sku编码",
|
|
38
|
-
key: "sku"
|
|
39
|
-
},
|
|
40
|
-
money: {
|
|
41
|
-
component: BsHeaderMoney,
|
|
42
|
-
name: "退回实付金额",
|
|
43
|
-
key: "money"
|
|
44
|
-
},
|
|
45
|
-
number: {
|
|
46
|
-
component: BsHeaderNumber,
|
|
47
|
-
name: "退回数量",
|
|
48
|
-
key: "number"
|
|
49
|
-
},
|
|
50
|
-
share: {
|
|
51
|
-
component: BsHeaderShare,
|
|
52
|
-
name: "退回分摊价",
|
|
53
|
-
key: "share"
|
|
54
|
-
},
|
|
55
|
-
type: {
|
|
56
|
-
component: BsHeaderType,
|
|
57
|
-
name: "退回赠品类型",
|
|
58
|
-
key: "giftType"
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
var swapOutHeaderMap = {
|
|
62
|
-
pic: {
|
|
63
|
-
component: BsHeaderPic,
|
|
64
|
-
name: "换出图片",
|
|
65
|
-
key: "pic"
|
|
66
|
-
},
|
|
67
|
-
name: {
|
|
68
|
-
component: BsHeaderName,
|
|
69
|
-
name: "换出名称",
|
|
70
|
-
key: "name"
|
|
71
|
-
},
|
|
72
|
-
code: {
|
|
73
|
-
component: BsHeaderCode,
|
|
74
|
-
name: "换出编码",
|
|
75
|
-
key: "code"
|
|
76
|
-
},
|
|
77
|
-
sku: {
|
|
78
|
-
component: BsHeaderSku,
|
|
79
|
-
name: "换出sku编码",
|
|
80
|
-
key: "sku"
|
|
81
|
-
},
|
|
82
|
-
money: {
|
|
83
|
-
component: BsHeaderMoney,
|
|
84
|
-
name: "换出实付金额",
|
|
85
|
-
key: "money"
|
|
86
|
-
},
|
|
87
|
-
number: {
|
|
88
|
-
component: BsHeaderNumber,
|
|
89
|
-
name: "换出数量",
|
|
90
|
-
key: "number"
|
|
91
|
-
},
|
|
92
|
-
share: {
|
|
93
|
-
component: BsHeaderShare,
|
|
94
|
-
name: "换出分摊价",
|
|
95
|
-
key: "share"
|
|
96
|
-
},
|
|
97
|
-
type: {
|
|
98
|
-
component: BsHeaderType,
|
|
99
|
-
name: "换出赠品类型",
|
|
100
|
-
key: "type"
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
var giftHeaderMap = {
|
|
104
|
-
pic: {
|
|
105
|
-
component: BsHeaderPic,
|
|
106
|
-
name: "赠品图片",
|
|
107
|
-
key: "pic"
|
|
108
|
-
},
|
|
109
|
-
name: {
|
|
110
|
-
component: BsHeaderName,
|
|
111
|
-
name: "赠品名称",
|
|
112
|
-
key: "name"
|
|
113
|
-
},
|
|
114
|
-
code: {
|
|
115
|
-
component: BsHeaderCode,
|
|
116
|
-
name: "赠品编码",
|
|
117
|
-
key: "code"
|
|
118
|
-
},
|
|
119
|
-
sku: {
|
|
120
|
-
component: BsHeaderSku,
|
|
121
|
-
name: "赠品sku编码",
|
|
122
|
-
key: "sku"
|
|
123
|
-
},
|
|
124
|
-
money: {
|
|
125
|
-
component: BsHeaderMoney,
|
|
126
|
-
name: "赠品实付金额",
|
|
127
|
-
key: "money"
|
|
128
|
-
},
|
|
129
|
-
number: {
|
|
130
|
-
component: BsHeaderNumber,
|
|
131
|
-
name: "赠品数量",
|
|
132
|
-
key: "number"
|
|
133
|
-
},
|
|
134
|
-
share: {
|
|
135
|
-
component: BsHeaderShare,
|
|
136
|
-
name: "赠品分摊价",
|
|
137
|
-
key: "share"
|
|
138
|
-
},
|
|
139
|
-
type: {
|
|
140
|
-
component: BsHeaderType,
|
|
141
|
-
name: "赠品赠品类型",
|
|
142
|
-
key: "giftType"
|
|
143
|
-
}
|
|
144
|
-
};
|
|
18
|
+
import { BsType, BsMemo, BsHeaderGood } from "../common/index";
|
|
145
19
|
var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
146
20
|
var _this = this;
|
|
147
21
|
_classCallCheck(this, BsExchange);
|
|
@@ -164,8 +38,8 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
|
164
38
|
_defineProperty(this, "giftGoods", void 0);
|
|
165
39
|
_defineProperty(this, "renderClient", function (record) {
|
|
166
40
|
var _this$componentConfig, _this$componentConfig2, _record, _record$bsExchangeTyp, _this$componentConfig3;
|
|
167
|
-
var bsExchangeReturnGoods = JSON.parse((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsExchangeReturnGoods")]) ||
|
|
168
|
-
var bsExchangeSwapOutGoods = JSON.parse((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsExchangeSwapOutGoods")]) ||
|
|
41
|
+
var bsExchangeReturnGoods = JSON.parse((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsExchangeReturnGoods")]) || '[]');
|
|
42
|
+
var bsExchangeSwapOutGoods = JSON.parse((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsExchangeSwapOutGoods")]) || '[]');
|
|
169
43
|
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), /*#__PURE__*/React.createElement(ItemView, {
|
|
170
44
|
id: _this.id,
|
|
171
45
|
label: "".concat(_this.name, "-\u9000\u56DE"),
|
|
@@ -180,7 +54,7 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
|
180
54
|
list: bsExchangeSwapOutGoods || [],
|
|
181
55
|
showHeader: ((_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.showHeader) || []
|
|
182
56
|
})
|
|
183
|
-
}), [
|
|
57
|
+
}), ['3', '4'].includes(record === null || record === void 0 ? void 0 : (_record = record["".concat(_this.id)]) === null || _record === void 0 ? void 0 : (_record$bsExchangeTyp = _record.bsExchangeType) === null || _record$bsExchangeTyp === void 0 ? void 0 : _record$bsExchangeTyp[0]) && record !== null && record !== void 0 && record["".concat(_this.id)].bsExchangeGiftGoods.length ? /*#__PURE__*/React.createElement(ItemView, {
|
|
184
58
|
id: "".concat(_this.id, "-gift"),
|
|
185
59
|
label: "".concat(_this.name, "-\u8D60\u54C1"),
|
|
186
60
|
value: /*#__PURE__*/React.createElement(BsGoodsTable, {
|
|
@@ -224,13 +98,13 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
|
224
98
|
type: item.type,
|
|
225
99
|
id: "".concat(item.id, "_bsExchangeType"),
|
|
226
100
|
name: "".concat(item.name, "-\u6362\u8D27\u7C7B\u578B"),
|
|
227
|
-
filterComponentType:
|
|
101
|
+
filterComponentType: 'Cascader',
|
|
228
102
|
props: {
|
|
229
103
|
options: item === null || item === void 0 ? void 0 : (_item$templateConfig = item.templateConfig) === null || _item$templateConfig === void 0 ? void 0 : _item$templateConfig.reasonList,
|
|
230
104
|
fieldNames: {
|
|
231
|
-
label:
|
|
232
|
-
value:
|
|
233
|
-
children:
|
|
105
|
+
label: 'label',
|
|
106
|
+
value: 'value',
|
|
107
|
+
children: 'children'
|
|
234
108
|
}
|
|
235
109
|
},
|
|
236
110
|
formatFilterValue: function formatFilterValue(val) {
|
|
@@ -243,19 +117,19 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
|
243
117
|
type: item.type,
|
|
244
118
|
id: "".concat(item.id, "_bsExchangeReturnGoods"),
|
|
245
119
|
name: "".concat(_this.name, "-\u9000\u56DE"),
|
|
246
|
-
filterComponentType:
|
|
120
|
+
filterComponentType: 'Input'
|
|
247
121
|
}, {
|
|
248
122
|
searchDefaultConditions: SYMBOL.like,
|
|
249
123
|
type: item.type,
|
|
250
124
|
id: "".concat(item.id, "_bsExchangeSwapOutGoods"),
|
|
251
125
|
name: "".concat(_this.name, "-\u6362\u51FA"),
|
|
252
|
-
filterComponentType:
|
|
126
|
+
filterComponentType: 'Input'
|
|
253
127
|
}, {
|
|
254
128
|
searchDefaultConditions: SYMBOL.like,
|
|
255
129
|
type: item.type,
|
|
256
130
|
id: "".concat(item.id, "_bsExchangeGiftGoods"),
|
|
257
131
|
name: "".concat(_this.name, "-\u8D60\u54C1"),
|
|
258
|
-
filterComponentType:
|
|
132
|
+
filterComponentType: 'Input'
|
|
259
133
|
}];
|
|
260
134
|
});
|
|
261
135
|
this.name = options.name;
|
|
@@ -268,90 +142,43 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
|
268
142
|
this.canSort = false;
|
|
269
143
|
this.bsType = new BsType(_objectSpread(_objectSpread({}, options), {}, {
|
|
270
144
|
id: "".concat(options.id, "_bsExchangeType_type"),
|
|
271
|
-
name:
|
|
145
|
+
name: '换货类型'
|
|
272
146
|
}));
|
|
273
147
|
this.bsMemo = new BsMemo(_objectSpread(_objectSpread({}, options), {}, {
|
|
274
148
|
id: "".concat(options.id, "_bsExchangeType_memo"),
|
|
275
|
-
name:
|
|
149
|
+
name: '换货备注'
|
|
276
150
|
}));
|
|
277
151
|
this.returnGoods = new BsHeaderGood(_objectSpread(_objectSpread({}, options), {}, {
|
|
278
152
|
id: "".concat(options.id, "_bsExchangeReturnGoods"),
|
|
279
|
-
name:
|
|
153
|
+
name: '退回商品'
|
|
280
154
|
}));
|
|
281
155
|
this.swapOutGoods = new BsHeaderGood(_objectSpread(_objectSpread({}, options), {}, {
|
|
282
156
|
id: "".concat(options.id, "_bsExchangeSwapOutGoods"),
|
|
283
|
-
name:
|
|
157
|
+
name: '换出商品'
|
|
284
158
|
}));
|
|
285
159
|
this.giftGoods = new BsHeaderGood(_objectSpread(_objectSpread({}, options), {}, {
|
|
286
160
|
id: "".concat(options.id, "_bsExchangeGiftGoods"),
|
|
287
|
-
name:
|
|
161
|
+
name: '赠品商品'
|
|
288
162
|
}));
|
|
289
|
-
this.children = [this.bsType, this.bsMemo, this.returnGoods, this.swapOutGoods, this.giftGoods
|
|
290
|
-
// ...(options?.componentConfig?.showHeader || []).reduce(
|
|
291
|
-
// (prv: any, next: string) => {
|
|
292
|
-
// if (returnHeaderMap[next]) {
|
|
293
|
-
// prv.push(
|
|
294
|
-
// new returnHeaderMap[next].component({
|
|
295
|
-
// ...options,
|
|
296
|
-
// name: returnHeaderMap[next].name,
|
|
297
|
-
// id: `${options.id}_bsExchangeReturnGoods_${returnHeaderMap[next].key}`,
|
|
298
|
-
// })
|
|
299
|
-
// );
|
|
300
|
-
// }
|
|
301
|
-
// return prv;
|
|
302
|
-
// },
|
|
303
|
-
// []
|
|
304
|
-
// ),
|
|
305
|
-
// ...(options?.componentConfig?.showHeader || []).reduce(
|
|
306
|
-
// (prv: any, next: string) => {
|
|
307
|
-
// if (swapOutHeaderMap[next]) {
|
|
308
|
-
// prv.push(
|
|
309
|
-
// new swapOutHeaderMap[next].component({
|
|
310
|
-
// ...options,
|
|
311
|
-
// name: swapOutHeaderMap[next].name,
|
|
312
|
-
// id: `${options.id}_bsExchangeSwapOutGoods_${swapOutHeaderMap[next].key}`,
|
|
313
|
-
// })
|
|
314
|
-
// );
|
|
315
|
-
// }
|
|
316
|
-
// return prv;
|
|
317
|
-
// },
|
|
318
|
-
// []
|
|
319
|
-
// ),
|
|
320
|
-
// ...(options?.componentConfig?.showHeader || []).reduce(
|
|
321
|
-
// (prv: any, next: string) => {
|
|
322
|
-
// if (giftHeaderMap[next]) {
|
|
323
|
-
// prv.push(
|
|
324
|
-
// new giftHeaderMap[next].component({
|
|
325
|
-
// ...options,
|
|
326
|
-
// name: giftHeaderMap[next].name,
|
|
327
|
-
// id: `${options.id}_bsExchangeGiftGoods_${giftHeaderMap[next].key}`,
|
|
328
|
-
// })
|
|
329
|
-
// );
|
|
330
|
-
// }
|
|
331
|
-
// return prv;
|
|
332
|
-
// },
|
|
333
|
-
// []
|
|
334
|
-
// ),
|
|
335
|
-
];
|
|
336
|
-
|
|
163
|
+
this.children = [this.bsType, this.bsMemo, this.returnGoods, this.swapOutGoods, this.giftGoods];
|
|
337
164
|
this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
|
|
338
165
|
this.rules = [{
|
|
339
166
|
validator: function validator(_, value) {
|
|
340
167
|
var _this$componentConfig5, _value$bsExchangeRetu;
|
|
341
168
|
if ((_this$componentConfig5 = _this.componentConfig) !== null && _this$componentConfig5 !== void 0 && _this$componentConfig5.required && !(value !== null && value !== void 0 && (_value$bsExchangeRetu = value.bsExchangeReturnGoods) !== null && _value$bsExchangeRetu !== void 0 && _value$bsExchangeRetu.length)) {
|
|
342
|
-
return Promise.reject(new Error(
|
|
169
|
+
return Promise.reject(new Error('请选择bs换货商品'));
|
|
343
170
|
}
|
|
344
171
|
return Promise.resolve();
|
|
345
172
|
}
|
|
346
173
|
}, {
|
|
347
174
|
validator: function validator(_, value) {
|
|
348
175
|
var _value$bsExchangeType;
|
|
349
|
-
if (value && [
|
|
176
|
+
if (value && ['2', '4'].includes(value === null || value === void 0 ? void 0 : (_value$bsExchangeType = value.bsExchangeType) === null || _value$bsExchangeType === void 0 ? void 0 : _value$bsExchangeType[0])) {
|
|
350
177
|
var hasNoGood = ((value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods) || []).some(function (item) {
|
|
351
178
|
return !(item !== null && item !== void 0 && item.bsExchangeReturnGoods.length);
|
|
352
179
|
});
|
|
353
180
|
if (hasNoGood) {
|
|
354
|
-
return Promise.reject(new Error(
|
|
181
|
+
return Promise.reject(new Error('请选择退回商品后再提交工单'));
|
|
355
182
|
}
|
|
356
183
|
var hasMore = ((value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods) || []).some(function (item) {
|
|
357
184
|
var returnMoney = ((item === null || item === void 0 ? void 0 : item.bsExchangeReturnGoods) || []).reduce(function (prv, next) {
|
|
@@ -365,18 +192,18 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
|
365
192
|
return returnMoney < swapOutMoney;
|
|
366
193
|
});
|
|
367
194
|
if (hasMore) {
|
|
368
|
-
return Promise.reject(new Error(
|
|
195
|
+
return Promise.reject(new Error('换货商品的金额不能大于退回商品的金额'));
|
|
369
196
|
}
|
|
370
197
|
var hasLen = ((value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods) || []).some(function (item) {
|
|
371
198
|
return (item === null || item === void 0 ? void 0 : item.bsExchangeReturnGoods.length) !== (item === null || item === void 0 ? void 0 : item.bsExchangeSwapOutGoods.length);
|
|
372
199
|
});
|
|
373
200
|
if (hasLen) {
|
|
374
|
-
return Promise.reject(new Error(
|
|
201
|
+
return Promise.reject(new Error('请核对商品数据,再提交工单'));
|
|
375
202
|
}
|
|
376
203
|
}
|
|
377
204
|
return Promise.resolve();
|
|
378
205
|
}
|
|
379
206
|
}];
|
|
380
|
-
this.dataType =
|
|
207
|
+
this.dataType = 'object';
|
|
381
208
|
});
|
|
382
209
|
export default BsExchange;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, ColumnConfig, Record } from
|
|
2
|
-
import React from
|
|
3
|
-
import { BsHeaderGood } from
|
|
1
|
+
import { ComponentInterface, PickOption, ColumnConfig, Record } from '../../../type';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BsHeaderGood } from '../common/index';
|
|
4
4
|
declare class BsGoods implements ComponentInterface {
|
|
5
5
|
name: string;
|
|
6
6
|
id: string;
|
|
7
7
|
sortField: string;
|
|
8
8
|
type: string;
|
|
9
9
|
rules: any[];
|
|
10
|
-
componentConfig: ComponentInterface[
|
|
11
|
-
effects: ComponentInterface[
|
|
10
|
+
componentConfig: ComponentInterface['componentConfig'];
|
|
11
|
+
effects: ComponentInterface['effects'];
|
|
12
12
|
isCombinationComponent: boolean;
|
|
13
13
|
formField: string;
|
|
14
14
|
canSort: boolean;
|
|
15
15
|
children: ComponentInterface[];
|
|
16
|
-
dataType: ComponentInterface[
|
|
16
|
+
dataType: ComponentInterface['dataType'];
|
|
17
17
|
bsGoods: BsHeaderGood;
|
|
18
18
|
constructor(options: PickOption);
|
|
19
19
|
renderClient: (record: any) => React.JSX.Element | null;
|
|
@@ -8,56 +8,14 @@ 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
|
|
11
|
+
import React from 'react';
|
|
12
12
|
import GetFormItem from "../../GetFormItem";
|
|
13
13
|
import { BsGoodsTable } from "../../Common";
|
|
14
|
-
import {
|
|
14
|
+
import { BsHeaderGood } from "../common/index";
|
|
15
15
|
import ItemView from "../../../commonComponents/ItemView";
|
|
16
|
-
import { isNull } from
|
|
17
|
-
import { BsGoods as Goods } from
|
|
16
|
+
import { isNull } from '@kmkf-fe-packages/kmkf-utils';
|
|
17
|
+
import { BsGoods as Goods } from '@kmkf-fe-packages/basic-components';
|
|
18
18
|
import { SYMBOL } from "../../../constant";
|
|
19
|
-
var childHeaderMap = {
|
|
20
|
-
pic: {
|
|
21
|
-
component: BsHeaderPic,
|
|
22
|
-
name: "图片",
|
|
23
|
-
key: "pic"
|
|
24
|
-
},
|
|
25
|
-
name: {
|
|
26
|
-
component: BsHeaderName,
|
|
27
|
-
name: "名称",
|
|
28
|
-
key: "name"
|
|
29
|
-
},
|
|
30
|
-
code: {
|
|
31
|
-
component: BsHeaderCode,
|
|
32
|
-
name: "编码",
|
|
33
|
-
key: "code"
|
|
34
|
-
},
|
|
35
|
-
sku: {
|
|
36
|
-
component: BsHeaderSku,
|
|
37
|
-
name: "sku编码",
|
|
38
|
-
key: "sku"
|
|
39
|
-
},
|
|
40
|
-
money: {
|
|
41
|
-
component: BsHeaderMoney,
|
|
42
|
-
name: "实付金额",
|
|
43
|
-
key: "money"
|
|
44
|
-
},
|
|
45
|
-
number: {
|
|
46
|
-
component: BsHeaderNumber,
|
|
47
|
-
name: "数量",
|
|
48
|
-
key: "number"
|
|
49
|
-
},
|
|
50
|
-
share: {
|
|
51
|
-
component: BsHeaderShare,
|
|
52
|
-
name: "分摊价",
|
|
53
|
-
key: "share"
|
|
54
|
-
},
|
|
55
|
-
type: {
|
|
56
|
-
component: BsHeaderType,
|
|
57
|
-
name: "赠品类型",
|
|
58
|
-
key: "giftType"
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
19
|
var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
|
|
62
20
|
var _this = this,
|
|
63
21
|
_this$componentConfig3;
|
|
@@ -122,7 +80,7 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
|
|
|
122
80
|
// 过滤组件id
|
|
123
81
|
name: item.name,
|
|
124
82
|
// 过滤组件名称
|
|
125
|
-
filterComponentType:
|
|
83
|
+
filterComponentType: 'Input'
|
|
126
84
|
}];
|
|
127
85
|
});
|
|
128
86
|
this.name = options.name;
|
|
@@ -135,35 +93,20 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
|
|
|
135
93
|
this.canSort = false;
|
|
136
94
|
this.bsGoods = new BsHeaderGood(_objectSpread(_objectSpread({}, options), {}, {
|
|
137
95
|
id: "".concat(options.id, "_bsGoods"),
|
|
138
|
-
name:
|
|
96
|
+
name: '商品信息'
|
|
139
97
|
}));
|
|
140
98
|
this.children = [this.bsGoods];
|
|
141
|
-
// this.children = (options?.componentConfig?.showHeader || []).reduce(
|
|
142
|
-
// (prv: any, next: string) => {
|
|
143
|
-
// if (childHeaderMap[next]) {
|
|
144
|
-
// prv.push(
|
|
145
|
-
// new childHeaderMap[next].component({
|
|
146
|
-
// ...options,
|
|
147
|
-
// name: childHeaderMap[next].name,
|
|
148
|
-
// id: `${options.id}_bsGoods_${childHeaderMap[next].key}`,
|
|
149
|
-
// }),
|
|
150
|
-
// );
|
|
151
|
-
// }
|
|
152
|
-
// return prv;
|
|
153
|
-
// },
|
|
154
|
-
// [],
|
|
155
|
-
// );
|
|
156
99
|
this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
|
|
157
100
|
this.rules = this !== null && this !== void 0 && (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
|
|
158
101
|
required: true,
|
|
159
102
|
validator: function validator(_, value) {
|
|
160
103
|
var _value$bsGoods;
|
|
161
104
|
if (!value || !(value !== null && value !== void 0 && (_value$bsGoods = value.bsGoods) !== null && _value$bsGoods !== void 0 && _value$bsGoods.length)) {
|
|
162
|
-
return Promise.reject(new Error(
|
|
105
|
+
return Promise.reject(new Error('请选择bs商品'));
|
|
163
106
|
}
|
|
164
107
|
return Promise.resolve();
|
|
165
108
|
}
|
|
166
109
|
}] : [];
|
|
167
|
-
this.dataType =
|
|
110
|
+
this.dataType = 'object';
|
|
168
111
|
});
|
|
169
112
|
export default BsGoods;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, ColumnConfig, Record } from
|
|
2
|
-
import React from
|
|
3
|
-
import { BsType, BsMemo, BsHeaderGood } from
|
|
1
|
+
import { ComponentInterface, PickOption, ColumnConfig, Record } from '../../../type';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BsType, BsMemo, BsHeaderGood } from '../common/index';
|
|
4
4
|
declare class BsReissue implements ComponentInterface {
|
|
5
5
|
name: string;
|
|
6
6
|
id: string;
|
|
7
7
|
sortField: string;
|
|
8
8
|
type: string;
|
|
9
9
|
rules: any[];
|
|
10
|
-
componentConfig: ComponentInterface[
|
|
11
|
-
effects: ComponentInterface[
|
|
10
|
+
componentConfig: ComponentInterface['componentConfig'];
|
|
11
|
+
effects: ComponentInterface['effects'];
|
|
12
12
|
isCombinationComponent: boolean;
|
|
13
13
|
formField: string;
|
|
14
14
|
canSort: boolean;
|
|
15
15
|
children: ComponentInterface[];
|
|
16
|
-
dataType: ComponentInterface[
|
|
16
|
+
dataType: ComponentInterface['dataType'];
|
|
17
17
|
bsType: BsType;
|
|
18
18
|
bsMemo: BsMemo;
|
|
19
19
|
reissueGoods: BsHeaderGood;
|
|
@@ -8,56 +8,14 @@ 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
|
|
11
|
+
import React from 'react';
|
|
12
12
|
import GetFormItem from "../../GetFormItem";
|
|
13
13
|
import ItemView from "../../../commonComponents/ItemView";
|
|
14
|
-
import { isNull, filterFn as _filterFn } from
|
|
15
|
-
import { BsReissue as Reissue } from
|
|
14
|
+
import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
|
|
15
|
+
import { BsReissue as Reissue } from '@kmkf-fe-packages/basic-components';
|
|
16
16
|
import { SYMBOL } from "../../../constant";
|
|
17
17
|
import { BsGoodsTable } from "../../Common";
|
|
18
|
-
import { BsType, BsMemo,
|
|
19
|
-
var childHeaderMap = {
|
|
20
|
-
pic: {
|
|
21
|
-
component: BsHeaderPic,
|
|
22
|
-
name: "图片",
|
|
23
|
-
key: "pic"
|
|
24
|
-
},
|
|
25
|
-
name: {
|
|
26
|
-
component: BsHeaderName,
|
|
27
|
-
name: "名称",
|
|
28
|
-
key: "name"
|
|
29
|
-
},
|
|
30
|
-
code: {
|
|
31
|
-
component: BsHeaderCode,
|
|
32
|
-
name: "编码",
|
|
33
|
-
key: "code"
|
|
34
|
-
},
|
|
35
|
-
sku: {
|
|
36
|
-
component: BsHeaderSku,
|
|
37
|
-
name: "sku编码",
|
|
38
|
-
key: "sku"
|
|
39
|
-
},
|
|
40
|
-
money: {
|
|
41
|
-
component: BsHeaderMoney,
|
|
42
|
-
name: "实付金额",
|
|
43
|
-
key: "money"
|
|
44
|
-
},
|
|
45
|
-
number: {
|
|
46
|
-
component: BsHeaderNumber,
|
|
47
|
-
name: "数量",
|
|
48
|
-
key: "number"
|
|
49
|
-
},
|
|
50
|
-
share: {
|
|
51
|
-
component: BsHeaderShare,
|
|
52
|
-
name: "分摊价",
|
|
53
|
-
key: "share"
|
|
54
|
-
},
|
|
55
|
-
type: {
|
|
56
|
-
component: BsHeaderType,
|
|
57
|
-
name: "赠品类型",
|
|
58
|
-
key: "giftType"
|
|
59
|
-
}
|
|
60
|
-
};
|
|
18
|
+
import { BsType, BsMemo, BsHeaderGood } from "../common/index";
|
|
61
19
|
var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
62
20
|
var _this = this,
|
|
63
21
|
_this$componentConfig3;
|
|
@@ -79,7 +37,6 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
|
79
37
|
_defineProperty(this, "reissueGoods", void 0);
|
|
80
38
|
_defineProperty(this, "renderClient", function (record) {
|
|
81
39
|
var _this$componentConfig;
|
|
82
|
-
console.log("bsreissue", record);
|
|
83
40
|
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), record !== null && record !== void 0 && record["".concat(_this.id)].bsReissueGoods.length ? /*#__PURE__*/React.createElement(ItemView, {
|
|
84
41
|
id: _this.id,
|
|
85
42
|
label: _this.name,
|
|
@@ -124,13 +81,13 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
|
124
81
|
type: item.type,
|
|
125
82
|
id: "".concat(item.id, "_bsReissueType"),
|
|
126
83
|
name: "".concat(item.name, "-\u8865\u53D1\u7C7B\u578B"),
|
|
127
|
-
filterComponentType:
|
|
84
|
+
filterComponentType: 'Cascader',
|
|
128
85
|
props: {
|
|
129
86
|
options: item === null || item === void 0 ? void 0 : (_item$templateConfig = item.templateConfig) === null || _item$templateConfig === void 0 ? void 0 : _item$templateConfig.reasonList,
|
|
130
87
|
fieldNames: {
|
|
131
|
-
label:
|
|
132
|
-
value:
|
|
133
|
-
children:
|
|
88
|
+
label: 'label',
|
|
89
|
+
value: 'value',
|
|
90
|
+
children: 'children'
|
|
134
91
|
}
|
|
135
92
|
},
|
|
136
93
|
formatFilterValue: function formatFilterValue(val) {
|
|
@@ -148,7 +105,7 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
|
148
105
|
type: item.type,
|
|
149
106
|
id: "".concat(item.id, "_bsReissueGoods"),
|
|
150
107
|
name: "".concat(_this.name),
|
|
151
|
-
filterComponentType:
|
|
108
|
+
filterComponentType: 'Input'
|
|
152
109
|
}];
|
|
153
110
|
});
|
|
154
111
|
this.name = options.name;
|
|
@@ -161,45 +118,28 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
|
161
118
|
this.canSort = false;
|
|
162
119
|
this.bsType = new BsType(_objectSpread(_objectSpread({}, options), {}, {
|
|
163
120
|
id: "".concat(options.id, "_bsReissueType_type"),
|
|
164
|
-
name:
|
|
121
|
+
name: '补发类型'
|
|
165
122
|
}));
|
|
166
123
|
this.bsMemo = new BsMemo(_objectSpread(_objectSpread({}, options), {}, {
|
|
167
124
|
id: "".concat(options.id, "_bsReissueType_memo"),
|
|
168
|
-
name:
|
|
125
|
+
name: '补发备注'
|
|
169
126
|
}));
|
|
170
127
|
this.reissueGoods = new BsHeaderGood(_objectSpread(_objectSpread({}, options), {}, {
|
|
171
128
|
id: "".concat(options.id, "_bsReissueGoods"),
|
|
172
|
-
name:
|
|
129
|
+
name: '商品信息'
|
|
173
130
|
}));
|
|
174
|
-
this.children = [this.bsType, this.bsMemo, this.reissueGoods
|
|
175
|
-
// ...(options?.componentConfig?.showHeader || []).reduce(
|
|
176
|
-
// (prv: any, next: string) => {
|
|
177
|
-
// if (childHeaderMap[next]) {
|
|
178
|
-
// prv.push(
|
|
179
|
-
// new childHeaderMap[next].component({
|
|
180
|
-
// ...options,
|
|
181
|
-
// name: childHeaderMap[next].name,
|
|
182
|
-
// id: `${options.id}_bsReissueGoods_${childHeaderMap[next].key}`,
|
|
183
|
-
// }),
|
|
184
|
-
// );
|
|
185
|
-
// }
|
|
186
|
-
// return prv;
|
|
187
|
-
// },
|
|
188
|
-
// [],
|
|
189
|
-
// ),
|
|
190
|
-
];
|
|
191
|
-
|
|
131
|
+
this.children = [this.bsType, this.bsMemo, this.reissueGoods];
|
|
192
132
|
this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
|
|
193
133
|
this.rules = this !== null && this !== void 0 && (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
|
|
194
134
|
required: true,
|
|
195
135
|
validator: function validator(_, value) {
|
|
196
136
|
var _value$bsReissueGoods;
|
|
197
137
|
if (!value || !(value !== null && value !== void 0 && (_value$bsReissueGoods = value.bsReissueGoods) !== null && _value$bsReissueGoods !== void 0 && _value$bsReissueGoods.length)) {
|
|
198
|
-
return Promise.reject(new Error(
|
|
138
|
+
return Promise.reject(new Error('请选择bs补发商品'));
|
|
199
139
|
}
|
|
200
140
|
return Promise.resolve();
|
|
201
141
|
}
|
|
202
142
|
}] : [];
|
|
203
|
-
this.dataType =
|
|
143
|
+
this.dataType = 'object';
|
|
204
144
|
});
|
|
205
145
|
export default BsReissue;
|