@kmkf-fe-packages/services-components 0.7.15-alpha.3 → 0.7.15-alpha.4
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 +4 -3
- package/dist/esm/components/BS/BsExchange/index.js +133 -18
- package/dist/esm/components/BS/BsGoods/index.d.ts +1 -1
- package/dist/esm/components/BS/BsGoods/index.js +30 -6
- package/dist/esm/components/BS/BsReissue/index.d.ts +4 -8
- package/dist/esm/components/BS/BsReissue/index.js +57 -23
- package/dist/esm/components/BS/common/BsChildCode.d.ts +25 -0
- package/dist/esm/components/BS/common/BsChildCode.js +71 -0
- package/dist/esm/components/BS/common/BsChildMoney.d.ts +25 -0
- package/dist/esm/components/BS/common/BsChildMoney.js +71 -0
- package/dist/esm/components/BS/common/BsChildName.d.ts +25 -0
- package/dist/esm/components/BS/common/BsChildName.js +71 -0
- package/dist/esm/components/BS/common/BsChildNumber.d.ts +25 -0
- package/dist/esm/components/BS/common/BsChildNumber.js +71 -0
- package/dist/esm/components/BS/common/BsChildPic.d.ts +25 -0
- package/dist/esm/components/BS/common/BsChildPic.js +72 -0
- package/dist/esm/components/BS/common/BsChildShare.d.ts +25 -0
- package/dist/esm/components/BS/common/BsChildShare.js +71 -0
- package/dist/esm/components/BS/common/BsChildSku.d.ts +25 -0
- package/dist/esm/components/BS/common/BsChildSku.js +71 -0
- package/dist/esm/components/BS/common/BsChildType.d.ts +25 -0
- package/dist/esm/components/BS/common/BsChildType.js +71 -0
- package/dist/esm/components/BS/common/index.d.ts +10 -0
- package/dist/esm/components/BS/common/index.js +10 -0
- package/dist/esm/components/Common/index.d.ts +1 -0
- package/dist/esm/components/Common/index.js +11 -1
- package/package.json +3 -3
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../../type";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import BsExchangeImage from "../common/BsExchangeImage";
|
|
4
|
-
import BsType from "../common/
|
|
5
|
-
import BsMemo from "../common/BsMemo";
|
|
4
|
+
import { BsType, BsMemo } from "../common/index";
|
|
6
5
|
declare class BsExchange implements ComponentInterface {
|
|
7
6
|
name: string;
|
|
8
7
|
id: string;
|
|
@@ -24,7 +23,7 @@ declare class BsExchange implements ComponentInterface {
|
|
|
24
23
|
renderPc: () => null;
|
|
25
24
|
renderLog: (r: Record) => null;
|
|
26
25
|
getComponentValue: (r: Record) => any;
|
|
27
|
-
renderExport: (value: any, record: any) =>
|
|
26
|
+
renderExport: (value: any, record: any) => null;
|
|
28
27
|
editRender: (p: any) => React.JSX.Element;
|
|
29
28
|
filterConfig: (item: ColumnConfig) => ({
|
|
30
29
|
searchDefaultConditions: "eq";
|
|
@@ -42,6 +41,8 @@ declare class BsExchange implements ComponentInterface {
|
|
|
42
41
|
id: string;
|
|
43
42
|
name: string;
|
|
44
43
|
filterComponentType: "Input";
|
|
44
|
+
props?: undefined;
|
|
45
|
+
filterFn?: undefined;
|
|
45
46
|
})[];
|
|
46
47
|
}
|
|
47
48
|
export default BsExchange;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
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
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
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
5
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
7
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
9
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
10
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); }
|
|
11
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); } }
|
|
12
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; }
|
|
@@ -18,11 +12,11 @@ import React from "react";
|
|
|
18
12
|
import GetFormItem from "../../GetFormItem";
|
|
19
13
|
import { GoodImage } from "../../Common";
|
|
20
14
|
import ItemView from "../../../commonComponents/ItemView";
|
|
21
|
-
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
15
|
+
import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
|
|
22
16
|
import { BsExchange as Exchange } from "@kmkf-fe-packages/basic-components";
|
|
17
|
+
import { SYMBOL } from "../../../constant";
|
|
23
18
|
import BsExchangeImage from "../common/BsExchangeImage";
|
|
24
|
-
import BsType from "../common/
|
|
25
|
-
import BsMemo from "../common/BsMemo";
|
|
19
|
+
import { BsType, BsMemo, BsChildPic, BsChildName, BsChildCode, BsChildSku, BsChildMoney, BsChildNumber, BsChildShare, BsChildType } from "../common/index";
|
|
26
20
|
var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
27
21
|
var _this = this;
|
|
28
22
|
_classCallCheck(this, BsExchange);
|
|
@@ -58,13 +52,10 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
|
58
52
|
return null;
|
|
59
53
|
});
|
|
60
54
|
_defineProperty(this, "getComponentValue", function (r) {
|
|
61
|
-
return r === null || r === void 0 ? void 0 : r["".concat(_this.id
|
|
55
|
+
return r === null || r === void 0 ? void 0 : r["".concat(_this.id)];
|
|
62
56
|
});
|
|
63
57
|
_defineProperty(this, "renderExport", function (value, record) {
|
|
64
|
-
|
|
65
|
-
return (_ref = (record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsGoods")]) || []) === null || _ref === void 0 ? void 0 : _ref.map(function (i) {
|
|
66
|
-
return i.numIid;
|
|
67
|
-
}).join("\n");
|
|
58
|
+
return null;
|
|
68
59
|
});
|
|
69
60
|
_defineProperty(this, "editRender", function (p) {
|
|
70
61
|
var _this$componentConfig, _this$effects, _this$effects2;
|
|
@@ -83,12 +74,45 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
|
83
74
|
});
|
|
84
75
|
});
|
|
85
76
|
_defineProperty(this, "filterConfig", function (item) {
|
|
86
|
-
|
|
77
|
+
var _item$config;
|
|
78
|
+
return [{
|
|
79
|
+
searchDefaultConditions: SYMBOL.eq,
|
|
80
|
+
type: item.type,
|
|
81
|
+
id: "".concat(item.id, "_bsReissueType"),
|
|
82
|
+
name: "".concat(item.name, "-\u6362\u8D27\u7C7B\u578B"),
|
|
83
|
+
filterComponentType: "Cascader",
|
|
84
|
+
props: {
|
|
85
|
+
options: item === null || item === void 0 ? void 0 : (_item$config = item.config) === null || _item$config === void 0 ? void 0 : _item$config.reasonList
|
|
86
|
+
},
|
|
87
|
+
filterFn: function filterFn(value) {
|
|
88
|
+
return function (i) {
|
|
89
|
+
return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, "bsReissueType"), value);
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
}, {
|
|
93
|
+
searchDefaultConditions: SYMBOL.like,
|
|
94
|
+
type: item.type,
|
|
95
|
+
id: "".concat(item.id, "_bsExchangeReturnGoods"),
|
|
96
|
+
name: "".concat(_this.name, "-\u9000\u56DE"),
|
|
97
|
+
filterComponentType: "Input"
|
|
98
|
+
}, {
|
|
99
|
+
searchDefaultConditions: SYMBOL.like,
|
|
100
|
+
type: item.type,
|
|
101
|
+
id: "".concat(item.id, "_bsExchangeSwapOutGoods"),
|
|
102
|
+
name: "".concat(_this.name, "-\u6362\u51FA"),
|
|
103
|
+
filterComponentType: "Input"
|
|
104
|
+
}, {
|
|
105
|
+
searchDefaultConditions: SYMBOL.like,
|
|
106
|
+
type: item.type,
|
|
107
|
+
id: "".concat(item.id, "_bsExchangeGiftGoods"),
|
|
108
|
+
name: "".concat(_this.name, "-\u8D60\u54C1"),
|
|
109
|
+
filterComponentType: "Input"
|
|
110
|
+
}];
|
|
87
111
|
});
|
|
88
112
|
this.name = options.name;
|
|
89
113
|
this.id = options.id;
|
|
90
|
-
this.sortField = "".concat(options.id
|
|
91
|
-
this.formField = "".concat(options.id
|
|
114
|
+
this.sortField = "".concat(options.id);
|
|
115
|
+
this.formField = "".concat(options.id);
|
|
92
116
|
this.type = options.type;
|
|
93
117
|
this.effects = options === null || options === void 0 ? void 0 : options.effects;
|
|
94
118
|
this.isCombinationComponent = false;
|
|
@@ -105,7 +129,85 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
|
105
129
|
id: "".concat(options.id, "_bsReissueType"),
|
|
106
130
|
name: "换货备注"
|
|
107
131
|
}));
|
|
108
|
-
this.children = [
|
|
132
|
+
this.children = [new BsType(_objectSpread(_objectSpread({}, options), {}, {
|
|
133
|
+
id: "".concat(options.id, "_bsReissueType"),
|
|
134
|
+
name: "换货类型"
|
|
135
|
+
})), new BsMemo(_objectSpread(_objectSpread({}, options), {}, {
|
|
136
|
+
id: "".concat(options.id, "_bsReissueType"),
|
|
137
|
+
name: "换货备注"
|
|
138
|
+
})), new BsChildPic(_objectSpread(_objectSpread({}, options), {}, {
|
|
139
|
+
name: "退回图片",
|
|
140
|
+
id: "".concat(options.id, "_bsExchangeReturnGoods")
|
|
141
|
+
})), new BsChildName(_objectSpread(_objectSpread({}, options), {}, {
|
|
142
|
+
name: "退回名称",
|
|
143
|
+
id: "".concat(options.id, "_bsExchangeReturnGoods")
|
|
144
|
+
})), new BsChildCode(_objectSpread(_objectSpread({}, options), {}, {
|
|
145
|
+
name: "退回编码",
|
|
146
|
+
id: "".concat(options.id, "_bsExchangeReturnGoods")
|
|
147
|
+
})), new BsChildSku(_objectSpread(_objectSpread({}, options), {}, {
|
|
148
|
+
name: "退回sku编码",
|
|
149
|
+
id: "".concat(options.id, "_bsExchangeReturnGoods")
|
|
150
|
+
})), new BsChildMoney(_objectSpread(_objectSpread({}, options), {}, {
|
|
151
|
+
name: "退回实付金额",
|
|
152
|
+
id: "".concat(options.id, "_bsExchangeReturnGoods")
|
|
153
|
+
})), new BsChildNumber(_objectSpread(_objectSpread({}, options), {}, {
|
|
154
|
+
name: "退回数量",
|
|
155
|
+
id: "".concat(options.id, "_bsExchangeReturnGoods")
|
|
156
|
+
})), new BsChildShare(_objectSpread(_objectSpread({}, options), {}, {
|
|
157
|
+
name: "退回分摊价",
|
|
158
|
+
id: "".concat(options.id, "_bsExchangeReturnGoods")
|
|
159
|
+
})), new BsChildType(_objectSpread(_objectSpread({}, options), {}, {
|
|
160
|
+
name: "退回赠品类型",
|
|
161
|
+
id: "".concat(options.id, "_bsExchangeReturnGoods")
|
|
162
|
+
})), new BsChildPic(_objectSpread(_objectSpread({}, options), {}, {
|
|
163
|
+
name: "换出图片",
|
|
164
|
+
id: "".concat(options.id, "_bsExchangeSwapOutGoods")
|
|
165
|
+
})), new BsChildName(_objectSpread(_objectSpread({}, options), {}, {
|
|
166
|
+
name: "换出名称",
|
|
167
|
+
id: "".concat(options.id, "_bsExchangeSwapOutGoods")
|
|
168
|
+
})), new BsChildCode(_objectSpread(_objectSpread({}, options), {}, {
|
|
169
|
+
name: "换出编码",
|
|
170
|
+
id: "".concat(options.id, "_bsExchangeSwapOutGoods")
|
|
171
|
+
})), new BsChildSku(_objectSpread(_objectSpread({}, options), {}, {
|
|
172
|
+
name: "换出sku编码",
|
|
173
|
+
id: "".concat(options.id, "_bsExchangeSwapOutGoods")
|
|
174
|
+
})), new BsChildMoney(_objectSpread(_objectSpread({}, options), {}, {
|
|
175
|
+
name: "换出实付金额",
|
|
176
|
+
id: "".concat(options.id, "_bsExchangeSwapOutGoods")
|
|
177
|
+
})), new BsChildNumber(_objectSpread(_objectSpread({}, options), {}, {
|
|
178
|
+
name: "换出数量",
|
|
179
|
+
id: "".concat(options.id, "_bsExchangeSwapOutGoods")
|
|
180
|
+
})), new BsChildShare(_objectSpread(_objectSpread({}, options), {}, {
|
|
181
|
+
name: "换出分摊价",
|
|
182
|
+
id: "".concat(options.id, "_bsExchangeSwapOutGoods")
|
|
183
|
+
})), new BsChildType(_objectSpread(_objectSpread({}, options), {}, {
|
|
184
|
+
name: "换出赠品类型",
|
|
185
|
+
id: "".concat(options.id, "_bsExchangeSwapOutGoods")
|
|
186
|
+
})), new BsChildPic(_objectSpread(_objectSpread({}, options), {}, {
|
|
187
|
+
name: "赠品图片",
|
|
188
|
+
id: "".concat(options.id, "_bsExchangeGiftGoods")
|
|
189
|
+
})), new BsChildName(_objectSpread(_objectSpread({}, options), {}, {
|
|
190
|
+
name: "赠品名称",
|
|
191
|
+
id: "".concat(options.id, "_bsExchangeGiftGoods")
|
|
192
|
+
})), new BsChildCode(_objectSpread(_objectSpread({}, options), {}, {
|
|
193
|
+
name: "赠品编码",
|
|
194
|
+
id: "".concat(options.id, "_bsExchangeGiftGoods")
|
|
195
|
+
})), new BsChildSku(_objectSpread(_objectSpread({}, options), {}, {
|
|
196
|
+
name: "赠品sku编码",
|
|
197
|
+
id: "".concat(options.id, "_bsExchangeGiftGoods")
|
|
198
|
+
})), new BsChildMoney(_objectSpread(_objectSpread({}, options), {}, {
|
|
199
|
+
name: "赠品实付金额",
|
|
200
|
+
id: "".concat(options.id, "_bsExchangeGiftGoods")
|
|
201
|
+
})), new BsChildNumber(_objectSpread(_objectSpread({}, options), {}, {
|
|
202
|
+
name: "赠品数量",
|
|
203
|
+
id: "".concat(options.id, "_bsExchangeGiftGoods")
|
|
204
|
+
})), new BsChildShare(_objectSpread(_objectSpread({}, options), {}, {
|
|
205
|
+
name: "赠品分摊价",
|
|
206
|
+
id: "".concat(options.id, "_bsExchangeGiftGoods")
|
|
207
|
+
})), new BsChildType(_objectSpread(_objectSpread({}, options), {}, {
|
|
208
|
+
name: "赠品赠品类型",
|
|
209
|
+
id: "".concat(options.id, "_bsExchangeGiftGoods")
|
|
210
|
+
}))];
|
|
109
211
|
this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
|
|
110
212
|
this.rules = [{
|
|
111
213
|
required: true,
|
|
@@ -119,7 +221,14 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
|
119
221
|
}, {
|
|
120
222
|
validator: function validator(_, value) {
|
|
121
223
|
var _value$bsExchangeType;
|
|
224
|
+
console.log(value);
|
|
122
225
|
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])) {
|
|
226
|
+
var hasNoGood = ((value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods) || []).some(function (item) {
|
|
227
|
+
return !(item !== null && item !== void 0 && item.bsExchangeReturnGoods.length);
|
|
228
|
+
});
|
|
229
|
+
if (hasNoGood) {
|
|
230
|
+
return Promise.reject(new Error("请选择退回商品后再提交工单"));
|
|
231
|
+
}
|
|
123
232
|
var hasMore = ((value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods) || []).some(function (item) {
|
|
124
233
|
var returnMoney = ((item === null || item === void 0 ? void 0 : item.bsExchangeReturnGoods) || []).reduce(function (prv, next) {
|
|
125
234
|
prv += Number(next.money || 0);
|
|
@@ -134,6 +243,12 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
|
134
243
|
if (hasMore) {
|
|
135
244
|
return Promise.reject(new Error("换货商品的金额不能大于退回商品的金额"));
|
|
136
245
|
}
|
|
246
|
+
var hasLen = ((value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods) || []).some(function (item) {
|
|
247
|
+
return (item === null || item === void 0 ? void 0 : item.bsExchangeReturnGoods.length) !== (item === null || item === void 0 ? void 0 : item.bsExchangeSwapOutGoods.length);
|
|
248
|
+
});
|
|
249
|
+
if (hasLen) {
|
|
250
|
+
return Promise.reject(new Error("请核对商品数据,再提交工单"));
|
|
251
|
+
}
|
|
137
252
|
}
|
|
138
253
|
return Promise.resolve();
|
|
139
254
|
}
|
|
@@ -18,7 +18,7 @@ declare class BsGoods implements ComponentInterface {
|
|
|
18
18
|
renderPc: (value: unknown, record: Record) => any;
|
|
19
19
|
renderLog: (r: Record) => any;
|
|
20
20
|
getComponentValue: (r: Record) => any;
|
|
21
|
-
renderExport: (
|
|
21
|
+
renderExport: () => null;
|
|
22
22
|
editRender: (p: any) => React.JSX.Element;
|
|
23
23
|
filterConfig: (item: ColumnConfig) => {
|
|
24
24
|
searchDefaultConditions: "like";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
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; }
|
|
2
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); }
|
|
3
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); } }
|
|
4
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; }
|
|
@@ -9,6 +11,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
9
11
|
import React from "react";
|
|
10
12
|
import GetFormItem from "../../GetFormItem";
|
|
11
13
|
import { BsGoodImage } from "../../Common";
|
|
14
|
+
import { BsChildPic, BsChildName, BsChildCode, BsChildSku, BsChildMoney, BsChildNumber, BsChildShare, BsChildType } from "../common/index";
|
|
12
15
|
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
13
16
|
import { BsGoods as Goods } from "@kmkf-fe-packages/basic-components";
|
|
14
17
|
import { SYMBOL } from "../../../constant";
|
|
@@ -55,11 +58,8 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
|
|
|
55
58
|
_defineProperty(this, "getComponentValue", function (r) {
|
|
56
59
|
return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_bsGoods")];
|
|
57
60
|
});
|
|
58
|
-
_defineProperty(this, "renderExport", function (
|
|
59
|
-
|
|
60
|
-
return (_ref = (record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsGoods")]) || []) === null || _ref === void 0 ? void 0 : _ref.map(function (i) {
|
|
61
|
-
return i.numIid;
|
|
62
|
-
}).join("\n");
|
|
61
|
+
_defineProperty(this, "renderExport", function () {
|
|
62
|
+
return null;
|
|
63
63
|
});
|
|
64
64
|
_defineProperty(this, "editRender", function (p) {
|
|
65
65
|
var _this$componentConfig, _this$effects, _this$effects2;
|
|
@@ -96,7 +96,31 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
|
|
|
96
96
|
this.effects = options === null || options === void 0 ? void 0 : options.effects;
|
|
97
97
|
this.isCombinationComponent = false;
|
|
98
98
|
this.canSort = false;
|
|
99
|
-
this.children = [
|
|
99
|
+
this.children = [new BsChildPic(_objectSpread(_objectSpread({}, options), {}, {
|
|
100
|
+
name: "bs图片",
|
|
101
|
+
id: "".concat(options.id, "_bsGoods")
|
|
102
|
+
})), new BsChildName(_objectSpread(_objectSpread({}, options), {}, {
|
|
103
|
+
name: "名称",
|
|
104
|
+
id: "".concat(options.id, "_bsGoods")
|
|
105
|
+
})), new BsChildCode(_objectSpread(_objectSpread({}, options), {}, {
|
|
106
|
+
name: "编码",
|
|
107
|
+
id: "".concat(options.id, "_bsGoods")
|
|
108
|
+
})), new BsChildSku(_objectSpread(_objectSpread({}, options), {}, {
|
|
109
|
+
name: "sku编码",
|
|
110
|
+
id: "".concat(options.id, "_bsGoods")
|
|
111
|
+
})), new BsChildMoney(_objectSpread(_objectSpread({}, options), {}, {
|
|
112
|
+
name: "实付金额",
|
|
113
|
+
id: "".concat(options.id, "_bsGoods")
|
|
114
|
+
})), new BsChildNumber(_objectSpread(_objectSpread({}, options), {}, {
|
|
115
|
+
name: "数量",
|
|
116
|
+
id: "".concat(options.id, "_bsGoods")
|
|
117
|
+
})), new BsChildShare(_objectSpread(_objectSpread({}, options), {}, {
|
|
118
|
+
name: "分摊价",
|
|
119
|
+
id: "".concat(options.id, "_bsGoods")
|
|
120
|
+
})), new BsChildType(_objectSpread(_objectSpread({}, options), {}, {
|
|
121
|
+
name: "赠品类型",
|
|
122
|
+
id: "".concat(options.id, "_bsGoods")
|
|
123
|
+
}))];
|
|
100
124
|
this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
|
|
101
125
|
this.rules = this !== null && this !== void 0 && (_this$componentConfig2 = this.componentConfig) !== null && _this$componentConfig2 !== void 0 && _this$componentConfig2.required ? [{
|
|
102
126
|
required: true,
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../../type";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import BsGoodImage from "../common/BsGoodImage";
|
|
4
|
-
import BsType from "../common/BsType";
|
|
5
|
-
import BsMemo from "../common/BsMemo";
|
|
6
3
|
declare class BsReissue implements ComponentInterface {
|
|
7
4
|
name: string;
|
|
8
5
|
id: string;
|
|
@@ -16,13 +13,10 @@ declare class BsReissue implements ComponentInterface {
|
|
|
16
13
|
canSort: boolean;
|
|
17
14
|
children: ComponentInterface[];
|
|
18
15
|
dataType: ComponentInterface["dataType"];
|
|
19
|
-
goodImage: BsGoodImage;
|
|
20
|
-
bsType: BsType;
|
|
21
|
-
bsMemo: BsMemo;
|
|
22
16
|
constructor(options: PickOption);
|
|
23
17
|
renderClient: (record: any) => React.JSX.Element | null;
|
|
24
|
-
renderPc: (
|
|
25
|
-
renderLog: (r: Record) =>
|
|
18
|
+
renderPc: () => null;
|
|
19
|
+
renderLog: (r: Record) => null;
|
|
26
20
|
getComponentValue: (r: Record) => any;
|
|
27
21
|
renderExport: () => null;
|
|
28
22
|
editRender: (p: any) => React.JSX.Element;
|
|
@@ -42,6 +36,8 @@ declare class BsReissue implements ComponentInterface {
|
|
|
42
36
|
id: string;
|
|
43
37
|
name: string;
|
|
44
38
|
filterComponentType: "Input";
|
|
39
|
+
props?: undefined;
|
|
40
|
+
filterFn?: undefined;
|
|
45
41
|
})[];
|
|
46
42
|
}
|
|
47
43
|
export default BsReissue;
|
|
@@ -12,11 +12,10 @@ import React from "react";
|
|
|
12
12
|
import GetFormItem from "../../GetFormItem";
|
|
13
13
|
import { GoodImage } from "../../Common";
|
|
14
14
|
import ItemView from "../../../commonComponents/ItemView";
|
|
15
|
-
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
15
|
+
import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
|
|
16
16
|
import { BsReissue as Reissue } from "@kmkf-fe-packages/basic-components";
|
|
17
|
-
import
|
|
18
|
-
import BsType from "../common/
|
|
19
|
-
import BsMemo from "../common/BsMemo";
|
|
17
|
+
import { SYMBOL } from "../../../constant";
|
|
18
|
+
import { BsType, BsMemo, BsChildPic, BsChildName, BsChildCode, BsChildSku, BsChildMoney, BsChildNumber, BsChildShare, BsChildType } from "../common/index";
|
|
20
19
|
var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
21
20
|
var _this = this,
|
|
22
21
|
_this$componentConfig2;
|
|
@@ -33,9 +32,6 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
|
33
32
|
_defineProperty(this, "canSort", void 0);
|
|
34
33
|
_defineProperty(this, "children", void 0);
|
|
35
34
|
_defineProperty(this, "dataType", void 0);
|
|
36
|
-
_defineProperty(this, "goodImage", void 0);
|
|
37
|
-
_defineProperty(this, "bsType", void 0);
|
|
38
|
-
_defineProperty(this, "bsMemo", void 0);
|
|
39
35
|
_defineProperty(this, "renderClient", function (record) {
|
|
40
36
|
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
41
37
|
id: _this.id,
|
|
@@ -46,12 +42,11 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
|
46
42
|
})
|
|
47
43
|
}) : null;
|
|
48
44
|
});
|
|
49
|
-
_defineProperty(this, "renderPc", function (
|
|
50
|
-
return
|
|
45
|
+
_defineProperty(this, "renderPc", function () {
|
|
46
|
+
return null;
|
|
51
47
|
});
|
|
52
48
|
_defineProperty(this, "renderLog", function (r) {
|
|
53
|
-
|
|
54
|
-
return _this.renderPc(undefined, r);
|
|
49
|
+
return null;
|
|
55
50
|
});
|
|
56
51
|
_defineProperty(this, "getComponentValue", function (r) {
|
|
57
52
|
return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_bsReissueGoods")];
|
|
@@ -76,29 +71,68 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
|
76
71
|
});
|
|
77
72
|
});
|
|
78
73
|
_defineProperty(this, "filterConfig", function (item) {
|
|
79
|
-
|
|
74
|
+
var _item$config;
|
|
75
|
+
return [{
|
|
76
|
+
searchDefaultConditions: SYMBOL.eq,
|
|
77
|
+
type: item.type,
|
|
78
|
+
id: "".concat(item.id, "_bsReissueType"),
|
|
79
|
+
name: "".concat(item.name, "-\u6362\u8D27\u7C7B\u578B"),
|
|
80
|
+
filterComponentType: "Cascader",
|
|
81
|
+
props: {
|
|
82
|
+
options: item === null || item === void 0 ? void 0 : (_item$config = item.config) === null || _item$config === void 0 ? void 0 : _item$config.reasonList
|
|
83
|
+
},
|
|
84
|
+
filterFn: function filterFn(value) {
|
|
85
|
+
return function (i) {
|
|
86
|
+
return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, "bsReissueType"), value);
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
}, {
|
|
90
|
+
searchDefaultConditions: SYMBOL.like,
|
|
91
|
+
type: item.type,
|
|
92
|
+
id: "".concat(item.id, "_bsReissueGoods"),
|
|
93
|
+
name: "".concat(_this.name),
|
|
94
|
+
filterComponentType: "Input"
|
|
95
|
+
}];
|
|
80
96
|
});
|
|
81
97
|
this.name = options.name;
|
|
82
98
|
this.id = options.id;
|
|
83
|
-
this.sortField = "".concat(options.id
|
|
84
|
-
this.formField = "".concat(options.id
|
|
99
|
+
this.sortField = "".concat(options.id);
|
|
100
|
+
this.formField = "".concat(options.id);
|
|
85
101
|
this.type = options.type;
|
|
86
102
|
this.effects = options === null || options === void 0 ? void 0 : options.effects;
|
|
87
103
|
this.isCombinationComponent = false;
|
|
88
104
|
this.canSort = false;
|
|
89
|
-
this.
|
|
90
|
-
id: "".concat(options.id, "_bsReissueGoods"),
|
|
91
|
-
name: "补发商品"
|
|
92
|
-
}));
|
|
93
|
-
this.bsType = new BsType(_objectSpread(_objectSpread({}, options), {}, {
|
|
105
|
+
this.children = [new BsType(_objectSpread(_objectSpread({}, options), {}, {
|
|
94
106
|
id: "".concat(options.id, "_bsReissueType"),
|
|
95
107
|
name: "补发类型"
|
|
96
|
-
}))
|
|
97
|
-
this.bsMemo = new BsMemo(_objectSpread(_objectSpread({}, options), {}, {
|
|
108
|
+
})), new BsMemo(_objectSpread(_objectSpread({}, options), {}, {
|
|
98
109
|
id: "".concat(options.id, "_bsReissueType"),
|
|
99
110
|
name: "补发备注"
|
|
100
|
-
}))
|
|
101
|
-
|
|
111
|
+
})), new BsChildPic(_objectSpread(_objectSpread({}, options), {}, {
|
|
112
|
+
name: "bs图片",
|
|
113
|
+
id: "".concat(options.id, "_bsReissueGoods")
|
|
114
|
+
})), new BsChildName(_objectSpread(_objectSpread({}, options), {}, {
|
|
115
|
+
name: "名称",
|
|
116
|
+
id: "".concat(options.id, "_bsReissueGoods")
|
|
117
|
+
})), new BsChildCode(_objectSpread(_objectSpread({}, options), {}, {
|
|
118
|
+
name: "编码",
|
|
119
|
+
id: "".concat(options.id, "_bsReissueGoods")
|
|
120
|
+
})), new BsChildSku(_objectSpread(_objectSpread({}, options), {}, {
|
|
121
|
+
name: "sku编码",
|
|
122
|
+
id: "".concat(options.id, "_bsReissueGoods")
|
|
123
|
+
})), new BsChildMoney(_objectSpread(_objectSpread({}, options), {}, {
|
|
124
|
+
name: "实付金额",
|
|
125
|
+
id: "".concat(options.id, "_bsReissueGoods")
|
|
126
|
+
})), new BsChildNumber(_objectSpread(_objectSpread({}, options), {}, {
|
|
127
|
+
name: "数量",
|
|
128
|
+
id: "".concat(options.id, "_bsReissueGoods")
|
|
129
|
+
})), new BsChildShare(_objectSpread(_objectSpread({}, options), {}, {
|
|
130
|
+
name: "分摊价",
|
|
131
|
+
id: "".concat(options.id, "_bsReissueGoods")
|
|
132
|
+
})), new BsChildType(_objectSpread(_objectSpread({}, options), {}, {
|
|
133
|
+
name: "赠品类型",
|
|
134
|
+
id: "".concat(options.id, "_bsReissueGoods")
|
|
135
|
+
}))];
|
|
102
136
|
this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
|
|
103
137
|
this.rules = this !== null && this !== void 0 && (_this$componentConfig2 = this.componentConfig) !== null && _this$componentConfig2 !== void 0 && _this$componentConfig2.required ? [{
|
|
104
138
|
required: true,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComponentInterface, PickOption, ALignType, Record } from "../../../type";
|
|
2
|
+
import React from "react";
|
|
3
|
+
declare class BsChildCode implements ComponentInterface {
|
|
4
|
+
name: string;
|
|
5
|
+
id: string;
|
|
6
|
+
sortField: string;
|
|
7
|
+
type: string;
|
|
8
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
9
|
+
align: ALignType;
|
|
10
|
+
width: number;
|
|
11
|
+
isCombinationComponent: boolean;
|
|
12
|
+
formField: string;
|
|
13
|
+
canSort: boolean;
|
|
14
|
+
children: ComponentInterface[];
|
|
15
|
+
dataType: ComponentInterface["dataType"];
|
|
16
|
+
constructor(options: PickOption);
|
|
17
|
+
renderClient: (record: any) => React.JSX.Element | null;
|
|
18
|
+
renderPc: (value: unknown, record: Record) => React.JSX.Element;
|
|
19
|
+
renderLog: (r: Record) => React.JSX.Element | null;
|
|
20
|
+
getComponentValue: (r: Record) => any;
|
|
21
|
+
renderExport: (value: string, record: Record) => any;
|
|
22
|
+
editRender: () => null;
|
|
23
|
+
filterConfig: () => never[];
|
|
24
|
+
}
|
|
25
|
+
export default BsChildCode;
|
|
@@ -0,0 +1,71 @@
|
|
|
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 _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); } }
|
|
3
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5
|
+
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; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
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); }
|
|
8
|
+
import React from "react";
|
|
9
|
+
import ItemView from "../../../commonComponents/ItemView";
|
|
10
|
+
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
11
|
+
var BsChildCode = /*#__PURE__*/_createClass(function BsChildCode(options) {
|
|
12
|
+
var _this = this;
|
|
13
|
+
_classCallCheck(this, BsChildCode);
|
|
14
|
+
_defineProperty(this, "name", void 0);
|
|
15
|
+
_defineProperty(this, "id", void 0);
|
|
16
|
+
_defineProperty(this, "sortField", void 0);
|
|
17
|
+
_defineProperty(this, "type", void 0);
|
|
18
|
+
_defineProperty(this, "componentConfig", void 0);
|
|
19
|
+
_defineProperty(this, "align", void 0);
|
|
20
|
+
_defineProperty(this, "width", void 0);
|
|
21
|
+
_defineProperty(this, "isCombinationComponent", void 0);
|
|
22
|
+
_defineProperty(this, "formField", void 0);
|
|
23
|
+
_defineProperty(this, "canSort", void 0);
|
|
24
|
+
_defineProperty(this, "children", void 0);
|
|
25
|
+
_defineProperty(this, "dataType", void 0);
|
|
26
|
+
_defineProperty(this, "renderClient", function (record) {
|
|
27
|
+
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
28
|
+
id: _this.id,
|
|
29
|
+
label: _this.name,
|
|
30
|
+
value: _this.getComponentValue(record)
|
|
31
|
+
}) : null;
|
|
32
|
+
});
|
|
33
|
+
_defineProperty(this, "renderPc", function (value, record) {
|
|
34
|
+
var _this$getComponentVal;
|
|
35
|
+
return /*#__PURE__*/React.createElement("span", null, (_this$getComponentVal = _this.getComponentValue(record)) !== null && _this$getComponentVal !== void 0 ? _this$getComponentVal : "--");
|
|
36
|
+
});
|
|
37
|
+
_defineProperty(this, "renderLog", function (r) {
|
|
38
|
+
if (isNull(r === null || r === void 0 ? void 0 : r[_this.id])) return null;
|
|
39
|
+
return _this.renderPc(undefined, r);
|
|
40
|
+
});
|
|
41
|
+
_defineProperty(this, "getComponentValue", function (r) {
|
|
42
|
+
var list = ((r === null || r === void 0 ? void 0 : r[_this.id]) || []).reduce(function (prv, next) {
|
|
43
|
+
next["code"] && prv.push(next["code"]);
|
|
44
|
+
return prv;
|
|
45
|
+
}, []);
|
|
46
|
+
return list.join(",");
|
|
47
|
+
});
|
|
48
|
+
_defineProperty(this, "renderExport", function (value, record) {
|
|
49
|
+
var _this$getComponentVal2;
|
|
50
|
+
return (_this$getComponentVal2 = _this.getComponentValue(record)) !== null && _this$getComponentVal2 !== void 0 ? _this$getComponentVal2 : "--";
|
|
51
|
+
});
|
|
52
|
+
_defineProperty(this, "editRender", function () {
|
|
53
|
+
return null;
|
|
54
|
+
});
|
|
55
|
+
_defineProperty(this, "filterConfig", function () {
|
|
56
|
+
return [];
|
|
57
|
+
});
|
|
58
|
+
this.name = options.name;
|
|
59
|
+
this.id = options.id;
|
|
60
|
+
this.sortField = options.id;
|
|
61
|
+
this.formField = options.id;
|
|
62
|
+
this.type = options.type;
|
|
63
|
+
this.componentConfig = options.componentConfig;
|
|
64
|
+
this.align = "left";
|
|
65
|
+
this.width = 200;
|
|
66
|
+
this.isCombinationComponent = false;
|
|
67
|
+
this.canSort = true;
|
|
68
|
+
this.dataType = "string";
|
|
69
|
+
this.children = [];
|
|
70
|
+
});
|
|
71
|
+
export default BsChildCode;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComponentInterface, PickOption, ALignType, Record } from "../../../type";
|
|
2
|
+
import React from "react";
|
|
3
|
+
declare class BsChildMoney implements ComponentInterface {
|
|
4
|
+
name: string;
|
|
5
|
+
id: string;
|
|
6
|
+
sortField: string;
|
|
7
|
+
type: string;
|
|
8
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
9
|
+
align: ALignType;
|
|
10
|
+
width: number;
|
|
11
|
+
isCombinationComponent: boolean;
|
|
12
|
+
formField: string;
|
|
13
|
+
canSort: boolean;
|
|
14
|
+
children: ComponentInterface[];
|
|
15
|
+
dataType: ComponentInterface["dataType"];
|
|
16
|
+
constructor(options: PickOption);
|
|
17
|
+
renderClient: (record: any) => React.JSX.Element | null;
|
|
18
|
+
renderPc: (value: unknown, record: Record) => React.JSX.Element;
|
|
19
|
+
renderLog: (r: Record) => React.JSX.Element | null;
|
|
20
|
+
getComponentValue: (r: Record) => any;
|
|
21
|
+
renderExport: (value: string, record: Record) => any;
|
|
22
|
+
editRender: () => null;
|
|
23
|
+
filterConfig: () => never[];
|
|
24
|
+
}
|
|
25
|
+
export default BsChildMoney;
|