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