@kmkf-fe-packages/services-components 0.7.15-alpha.56 → 0.7.15-alpha.58
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/ActualPayment/index.d.ts +4 -4
- package/dist/esm/components/ActualPayment/index.js +25 -22
- package/dist/esm/components/BS/BsExchange/index.d.ts +14 -9
- package/dist/esm/components/BS/BsExchange/index.js +82 -79
- package/dist/esm/components/BS/BsReissue/index.d.ts +8 -1
- package/dist/esm/components/BS/BsReissue/index.js +14 -4
- package/dist/esm/components/BS/common/BsMemo.d.ts +4 -4
- package/dist/esm/components/BS/common/BsMemo.js +15 -15
- package/dist/esm/components/BS/common/BsType.d.ts +7 -6
- package/dist/esm/components/BS/common/BsType.js +20 -14
- package/dist/esm/components/Common/index.d.ts +1 -1
- package/dist/esm/components/Common/index.js +90 -87
- package/dist/esm/components/TradeDateTime/index.d.ts +1 -9
- package/dist/esm/components/TradeDateTime/index.js +6 -1
- package/dist/esm/factory.d.ts +1 -1
- package/dist/esm/type.d.ts +1 -0
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
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 ActualPayment implements ComponentInterface {
|
|
4
4
|
name: string;
|
|
5
5
|
id: string;
|
|
@@ -10,8 +10,8 @@ declare class ActualPayment implements ComponentInterface {
|
|
|
10
10
|
formField: string;
|
|
11
11
|
canSort: boolean;
|
|
12
12
|
children: ComponentInterface[];
|
|
13
|
-
componentConfig: ComponentInterface[
|
|
14
|
-
dataType: ComponentInterface[
|
|
13
|
+
componentConfig: ComponentInterface['componentConfig'];
|
|
14
|
+
dataType: ComponentInterface['dataType'];
|
|
15
15
|
dataMap: Record;
|
|
16
16
|
constructor(options: PickOption);
|
|
17
17
|
getKeyByComponentType: (type: string) => any;
|
|
@@ -9,17 +9,17 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
9
9
|
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; }
|
|
10
10
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
11
11
|
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); }
|
|
12
|
-
import React from
|
|
13
|
-
import { ApaasInput } from
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { ApaasInput } from '@kmkf-fe-packages/basic-components';
|
|
14
14
|
import GetFormItem from "../GetFormItem";
|
|
15
15
|
import ItemView from "../../commonComponents/ItemView";
|
|
16
|
-
import { isNull, filterFn as _filterFn } from
|
|
16
|
+
import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
|
|
17
17
|
import { SYMBOL } from "../../constant";
|
|
18
18
|
var typeMap = {
|
|
19
|
-
ACTUAL_PAYMENT:
|
|
20
|
-
BS_NET_RECEIPTS:
|
|
21
|
-
BS_DEPOSIT:
|
|
22
|
-
BS_PACKAGE_WEIGHT:
|
|
19
|
+
ACTUAL_PAYMENT: 'actualPayment',
|
|
20
|
+
BS_NET_RECEIPTS: 'bsNetReceipts',
|
|
21
|
+
BS_DEPOSIT: 'bsDeposit',
|
|
22
|
+
BS_PACKAGE_WEIGHT: 'bsPackageWeight'
|
|
23
23
|
};
|
|
24
24
|
var ActualPayment = /*#__PURE__*/_createClass(function ActualPayment(options) {
|
|
25
25
|
var _this = this;
|
|
@@ -37,7 +37,7 @@ var ActualPayment = /*#__PURE__*/_createClass(function ActualPayment(options) {
|
|
|
37
37
|
_defineProperty(this, "dataType", void 0);
|
|
38
38
|
_defineProperty(this, "dataMap", void 0);
|
|
39
39
|
_defineProperty(this, "getKeyByComponentType", function (type) {
|
|
40
|
-
return typeMap[type] ||
|
|
40
|
+
return typeMap[type] || '';
|
|
41
41
|
});
|
|
42
42
|
_defineProperty(this, "renderClient", function (record) {
|
|
43
43
|
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
@@ -49,7 +49,7 @@ var ActualPayment = /*#__PURE__*/_createClass(function ActualPayment(options) {
|
|
|
49
49
|
_defineProperty(this, "renderPc", function (value, record) {
|
|
50
50
|
var _record;
|
|
51
51
|
var type = _this.type;
|
|
52
|
-
return /*#__PURE__*/React.createElement("span", null, (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(typeMap[type])]) !== null && _record !== void 0 ? _record :
|
|
52
|
+
return /*#__PURE__*/React.createElement("span", null, (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(typeMap[type])]) !== null && _record !== void 0 ? _record : '--');
|
|
53
53
|
});
|
|
54
54
|
_defineProperty(this, "renderLog", function (r) {
|
|
55
55
|
var type = _this.type;
|
|
@@ -63,7 +63,7 @@ var ActualPayment = /*#__PURE__*/_createClass(function ActualPayment(options) {
|
|
|
63
63
|
_defineProperty(this, "renderExport", function (value, record) {
|
|
64
64
|
var _record2;
|
|
65
65
|
var type = _this.type;
|
|
66
|
-
return (_record2 = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(typeMap[type])]) !== null && _record2 !== void 0 ? _record2 :
|
|
66
|
+
return (_record2 = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(typeMap[type])]) !== null && _record2 !== void 0 ? _record2 : '--';
|
|
67
67
|
});
|
|
68
68
|
_defineProperty(this, "editRender", function (p) {
|
|
69
69
|
var _this$componentConfig, _this$componentConfig2;
|
|
@@ -87,7 +87,7 @@ var ActualPayment = /*#__PURE__*/_createClass(function ActualPayment(options) {
|
|
|
87
87
|
// 过滤组件id
|
|
88
88
|
name: item.name,
|
|
89
89
|
// 过滤组件名称
|
|
90
|
-
filterComponentType:
|
|
90
|
+
filterComponentType: 'Rate',
|
|
91
91
|
rules: [{
|
|
92
92
|
validator: function () {
|
|
93
93
|
var _validator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_, value) {
|
|
@@ -112,13 +112,13 @@ var ActualPayment = /*#__PURE__*/_createClass(function ActualPayment(options) {
|
|
|
112
112
|
_context.next = 5;
|
|
113
113
|
break;
|
|
114
114
|
}
|
|
115
|
-
return _context.abrupt("return", Promise.reject(new Error(
|
|
115
|
+
return _context.abrupt("return", Promise.reject(new Error('请输入正确的金额区间范围')));
|
|
116
116
|
case 5:
|
|
117
117
|
if (!(value[0] > value[1])) {
|
|
118
118
|
_context.next = 7;
|
|
119
119
|
break;
|
|
120
120
|
}
|
|
121
|
-
return _context.abrupt("return", Promise.reject(new Error(
|
|
121
|
+
return _context.abrupt("return", Promise.reject(new Error('开始金额必须小于结束金额')));
|
|
122
122
|
case 7:
|
|
123
123
|
case "end":
|
|
124
124
|
return _context.stop();
|
|
@@ -132,7 +132,7 @@ var ActualPayment = /*#__PURE__*/_createClass(function ActualPayment(options) {
|
|
|
132
132
|
}()
|
|
133
133
|
}],
|
|
134
134
|
props: {
|
|
135
|
-
placeholder: ["
|
|
135
|
+
placeholder: ["\u59CB-".concat(item.name), "\u7EC8-".concat(item.name)]
|
|
136
136
|
},
|
|
137
137
|
formatFilterValue: function formatFilterValue(val) {
|
|
138
138
|
if (val !== null && val !== void 0 && val.some(function (v) {
|
|
@@ -154,20 +154,23 @@ var ActualPayment = /*#__PURE__*/_createClass(function ActualPayment(options) {
|
|
|
154
154
|
this.formField = "".concat(options.id, "_").concat(this.getKeyByComponentType(options.type));
|
|
155
155
|
this.name = options.name;
|
|
156
156
|
this.type = options.type;
|
|
157
|
-
this.dataType =
|
|
157
|
+
this.dataType = 'number';
|
|
158
158
|
this.isCombinationComponent = false;
|
|
159
159
|
this.canSort = true;
|
|
160
160
|
this.children = [];
|
|
161
161
|
this.componentConfig = options.componentConfig;
|
|
162
|
-
this.rules = options.type ===
|
|
162
|
+
this.rules = options.type === 'ACTUAL_PAYMENT' ? [{
|
|
163
163
|
pattern: /^\d+(\.\d{1,2})?$/,
|
|
164
|
-
message:
|
|
165
|
-
}] : [
|
|
164
|
+
message: '字段为正数或最多两位小数'
|
|
165
|
+
}] : [{
|
|
166
|
+
pattern: /^(([0-9]*(\.[0-9]{1,})$)|([0-9]+$))/,
|
|
167
|
+
message: '请输入数字'
|
|
168
|
+
}];
|
|
166
169
|
this.dataMap = {
|
|
167
|
-
ACTUAL_PAYMENT:
|
|
168
|
-
BS_NET_RECEIPTS:
|
|
169
|
-
BS_DEPOSIT:
|
|
170
|
-
BS_PACKAGE_WEIGHT:
|
|
170
|
+
ACTUAL_PAYMENT: 'actualPayment',
|
|
171
|
+
BS_NET_RECEIPTS: 'bsNetReceipts',
|
|
172
|
+
BS_DEPOSIT: 'bsDeposit',
|
|
173
|
+
BS_PACKAGE_WEIGHT: 'bsPackageWeight'
|
|
171
174
|
};
|
|
172
175
|
});
|
|
173
176
|
export default ActualPayment;
|
|
@@ -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 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
|
constructor(options: PickOption);
|
|
@@ -24,15 +24,20 @@ declare class BsExchange implements ComponentInterface {
|
|
|
24
24
|
renderExport: (value: any, record: any) => null;
|
|
25
25
|
editRender: (p: any) => React.JSX.Element;
|
|
26
26
|
filterConfig: (item: ColumnConfig) => ({
|
|
27
|
-
searchDefaultConditions: "
|
|
27
|
+
searchDefaultConditions: "in";
|
|
28
28
|
type: string;
|
|
29
29
|
id: string;
|
|
30
30
|
name: string;
|
|
31
31
|
filterComponentType: "Cascader";
|
|
32
32
|
props: {
|
|
33
33
|
options: any[] | undefined;
|
|
34
|
+
fieldNames: {
|
|
35
|
+
label: string;
|
|
36
|
+
value: string;
|
|
37
|
+
children: string;
|
|
38
|
+
};
|
|
34
39
|
};
|
|
35
|
-
|
|
40
|
+
formatFilterValue: (val: Array<string>) => string[] | undefined;
|
|
36
41
|
} | {
|
|
37
42
|
searchDefaultConditions: "like";
|
|
38
43
|
type: string;
|
|
@@ -40,7 +45,7 @@ declare class BsExchange implements ComponentInterface {
|
|
|
40
45
|
name: string;
|
|
41
46
|
filterComponentType: "Input";
|
|
42
47
|
props?: undefined;
|
|
43
|
-
|
|
48
|
+
formatFilterValue?: undefined;
|
|
44
49
|
})[];
|
|
45
50
|
}
|
|
46
51
|
export default BsExchange;
|
|
@@ -14,146 +14,145 @@ 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, BsExchangeList } from "../../Common";
|
|
20
20
|
import ItemView from "../../../commonComponents/ItemView";
|
|
21
|
-
import { isNull
|
|
22
|
-
import { BsExchange as Exchange } from
|
|
21
|
+
import { isNull } from '@kmkf-fe-packages/kmkf-utils';
|
|
22
|
+
import { BsExchange as Exchange } from '@kmkf-fe-packages/basic-components';
|
|
23
23
|
import { SYMBOL } from "../../../constant";
|
|
24
24
|
import { BsType, BsMemo, BsHeaderPic, BsHeaderName, BsHeaderCode, BsHeaderSku, BsHeaderMoney, BsHeaderNumber, BsHeaderShare, BsHeaderType } from "../common/index";
|
|
25
25
|
var returnHeaderMap = {
|
|
26
26
|
pic: {
|
|
27
27
|
component: BsHeaderPic,
|
|
28
|
-
name:
|
|
29
|
-
key:
|
|
28
|
+
name: '退回图片',
|
|
29
|
+
key: 'pic'
|
|
30
30
|
},
|
|
31
31
|
name: {
|
|
32
32
|
component: BsHeaderName,
|
|
33
|
-
name:
|
|
34
|
-
key:
|
|
33
|
+
name: '退回名称',
|
|
34
|
+
key: 'name'
|
|
35
35
|
},
|
|
36
36
|
code: {
|
|
37
37
|
component: BsHeaderCode,
|
|
38
|
-
name:
|
|
39
|
-
key:
|
|
38
|
+
name: '退回编码',
|
|
39
|
+
key: 'code'
|
|
40
40
|
},
|
|
41
41
|
sku: {
|
|
42
42
|
component: BsHeaderSku,
|
|
43
|
-
name:
|
|
44
|
-
key:
|
|
43
|
+
name: '退回sku编码',
|
|
44
|
+
key: 'sku'
|
|
45
45
|
},
|
|
46
46
|
money: {
|
|
47
47
|
component: BsHeaderMoney,
|
|
48
|
-
name:
|
|
49
|
-
key:
|
|
48
|
+
name: '退回实付金额',
|
|
49
|
+
key: 'money'
|
|
50
50
|
},
|
|
51
51
|
number: {
|
|
52
52
|
component: BsHeaderNumber,
|
|
53
|
-
name:
|
|
54
|
-
key:
|
|
53
|
+
name: '退回数量',
|
|
54
|
+
key: 'number'
|
|
55
55
|
},
|
|
56
56
|
share: {
|
|
57
57
|
component: BsHeaderShare,
|
|
58
|
-
name:
|
|
59
|
-
key:
|
|
58
|
+
name: '退回分摊价',
|
|
59
|
+
key: 'share'
|
|
60
60
|
},
|
|
61
61
|
type: {
|
|
62
62
|
component: BsHeaderType,
|
|
63
|
-
name:
|
|
64
|
-
key:
|
|
63
|
+
name: '退回赠品类型',
|
|
64
|
+
key: 'giftType'
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
var swapOutHeaderMap = {
|
|
68
68
|
pic: {
|
|
69
69
|
component: BsHeaderPic,
|
|
70
|
-
name:
|
|
71
|
-
key:
|
|
70
|
+
name: '换出图片',
|
|
71
|
+
key: 'pic'
|
|
72
72
|
},
|
|
73
73
|
name: {
|
|
74
74
|
component: BsHeaderName,
|
|
75
|
-
name:
|
|
76
|
-
key:
|
|
75
|
+
name: '换出名称',
|
|
76
|
+
key: 'name'
|
|
77
77
|
},
|
|
78
78
|
code: {
|
|
79
79
|
component: BsHeaderCode,
|
|
80
|
-
name:
|
|
81
|
-
key:
|
|
80
|
+
name: '换出编码',
|
|
81
|
+
key: 'code'
|
|
82
82
|
},
|
|
83
83
|
sku: {
|
|
84
84
|
component: BsHeaderSku,
|
|
85
|
-
name:
|
|
86
|
-
key:
|
|
85
|
+
name: '换出sku编码',
|
|
86
|
+
key: 'sku'
|
|
87
87
|
},
|
|
88
88
|
money: {
|
|
89
89
|
component: BsHeaderMoney,
|
|
90
|
-
name:
|
|
91
|
-
key:
|
|
90
|
+
name: '换出实付金额',
|
|
91
|
+
key: 'money'
|
|
92
92
|
},
|
|
93
93
|
number: {
|
|
94
94
|
component: BsHeaderNumber,
|
|
95
|
-
name:
|
|
96
|
-
key:
|
|
95
|
+
name: '换出数量',
|
|
96
|
+
key: 'number'
|
|
97
97
|
},
|
|
98
98
|
share: {
|
|
99
99
|
component: BsHeaderShare,
|
|
100
|
-
name:
|
|
101
|
-
key:
|
|
100
|
+
name: '换出分摊价',
|
|
101
|
+
key: 'share'
|
|
102
102
|
},
|
|
103
103
|
type: {
|
|
104
104
|
component: BsHeaderType,
|
|
105
|
-
name:
|
|
106
|
-
key:
|
|
105
|
+
name: '换出赠品类型',
|
|
106
|
+
key: 'type'
|
|
107
107
|
}
|
|
108
108
|
};
|
|
109
109
|
var giftHeaderMap = {
|
|
110
110
|
pic: {
|
|
111
111
|
component: BsHeaderPic,
|
|
112
|
-
name:
|
|
113
|
-
key:
|
|
112
|
+
name: '赠品图片',
|
|
113
|
+
key: 'pic'
|
|
114
114
|
},
|
|
115
115
|
name: {
|
|
116
116
|
component: BsHeaderName,
|
|
117
|
-
name:
|
|
118
|
-
key:
|
|
117
|
+
name: '赠品名称',
|
|
118
|
+
key: 'name'
|
|
119
119
|
},
|
|
120
120
|
code: {
|
|
121
121
|
component: BsHeaderCode,
|
|
122
|
-
name:
|
|
123
|
-
key:
|
|
122
|
+
name: '赠品编码',
|
|
123
|
+
key: 'code'
|
|
124
124
|
},
|
|
125
125
|
sku: {
|
|
126
126
|
component: BsHeaderSku,
|
|
127
|
-
name:
|
|
128
|
-
key:
|
|
127
|
+
name: '赠品sku编码',
|
|
128
|
+
key: 'sku'
|
|
129
129
|
},
|
|
130
130
|
money: {
|
|
131
131
|
component: BsHeaderMoney,
|
|
132
|
-
name:
|
|
133
|
-
key:
|
|
132
|
+
name: '赠品实付金额',
|
|
133
|
+
key: 'money'
|
|
134
134
|
},
|
|
135
135
|
number: {
|
|
136
136
|
component: BsHeaderNumber,
|
|
137
|
-
name:
|
|
138
|
-
key:
|
|
137
|
+
name: '赠品数量',
|
|
138
|
+
key: 'number'
|
|
139
139
|
},
|
|
140
140
|
share: {
|
|
141
141
|
component: BsHeaderShare,
|
|
142
|
-
name:
|
|
143
|
-
key:
|
|
142
|
+
name: '赠品分摊价',
|
|
143
|
+
key: 'share'
|
|
144
144
|
},
|
|
145
145
|
type: {
|
|
146
146
|
component: BsHeaderType,
|
|
147
|
-
name:
|
|
148
|
-
key:
|
|
147
|
+
name: '赠品赠品类型',
|
|
148
|
+
key: 'giftType'
|
|
149
149
|
}
|
|
150
150
|
};
|
|
151
151
|
var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
152
152
|
var _this = this,
|
|
153
153
|
_options$componentCon,
|
|
154
154
|
_options$componentCon2,
|
|
155
|
-
_options$componentCon3
|
|
156
|
-
_this$componentConfig5;
|
|
155
|
+
_options$componentCon3;
|
|
157
156
|
_classCallCheck(this, BsExchange);
|
|
158
157
|
_defineProperty(this, "name", void 0);
|
|
159
158
|
_defineProperty(this, "id", void 0);
|
|
@@ -171,21 +170,21 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
|
171
170
|
_defineProperty(this, "bsMemo", void 0);
|
|
172
171
|
_defineProperty(this, "renderClient", function (record) {
|
|
173
172
|
var _record, _record$bsExchangeTyp, _this$componentConfig, _record2, _record2$bsExchangeTy, _this$componentConfig2, _record3, _record3$bsExchangeTy, _this$componentConfig3;
|
|
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), [
|
|
173
|
+
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), ['1', '3'].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, {
|
|
175
174
|
id: _this.id,
|
|
176
175
|
label: "".concat(_this.name),
|
|
177
176
|
value: /*#__PURE__*/React.createElement(BsGoodsTable, {
|
|
178
177
|
list: (record === null || record === void 0 ? void 0 : record["".concat(_this.id)].bsExchangeReturnGoods) || [],
|
|
179
178
|
showHeader: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.showHeader) || []
|
|
180
179
|
})
|
|
181
|
-
}) : null, [
|
|
180
|
+
}) : null, ['2', '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, {
|
|
182
181
|
id: _this.id,
|
|
183
182
|
label: "".concat(_this.name),
|
|
184
183
|
value: /*#__PURE__*/React.createElement(BsExchangeList, {
|
|
185
184
|
list: (record === null || record === void 0 ? void 0 : record["".concat(_this.id)].bsExchangeSwapOutGoods) || [],
|
|
186
185
|
showHeader: ((_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.showHeader) || []
|
|
187
186
|
})
|
|
188
|
-
}) : null, [
|
|
187
|
+
}) : null, ['3', '4'].includes(record === null || record === void 0 ? void 0 : (_record3 = record["".concat(_this.id)]) === null || _record3 === void 0 ? void 0 : (_record3$bsExchangeTy = _record3.bsExchangeType) === null || _record3$bsExchangeTy === void 0 ? void 0 : _record3$bsExchangeTy[0]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
189
188
|
id: _this.id,
|
|
190
189
|
label: "".concat(_this.name, "-\u8D60\u54C1"),
|
|
191
190
|
value: /*#__PURE__*/React.createElement(BsGoodsTable, {
|
|
@@ -223,39 +222,44 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
|
223
222
|
});
|
|
224
223
|
});
|
|
225
224
|
_defineProperty(this, "filterConfig", function (item) {
|
|
226
|
-
var _item$
|
|
225
|
+
var _item$templateConfig;
|
|
227
226
|
return [{
|
|
228
|
-
searchDefaultConditions: SYMBOL.
|
|
227
|
+
searchDefaultConditions: SYMBOL.in,
|
|
229
228
|
type: item.type,
|
|
230
|
-
id: "".concat(item.id, "
|
|
229
|
+
id: "".concat(item.id, "_bsExchangeType"),
|
|
231
230
|
name: "".concat(item.name, "-\u6362\u8D27\u7C7B\u578B"),
|
|
232
|
-
filterComponentType:
|
|
231
|
+
filterComponentType: 'Cascader',
|
|
233
232
|
props: {
|
|
234
|
-
options: item === null || item === void 0 ? void 0 : (_item$
|
|
233
|
+
options: item === null || item === void 0 ? void 0 : (_item$templateConfig = item.templateConfig) === null || _item$templateConfig === void 0 ? void 0 : _item$templateConfig.reasonList,
|
|
234
|
+
fieldNames: {
|
|
235
|
+
label: 'label',
|
|
236
|
+
value: 'value',
|
|
237
|
+
children: 'children'
|
|
238
|
+
}
|
|
235
239
|
},
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
return
|
|
239
|
-
}
|
|
240
|
+
formatFilterValue: function formatFilterValue(val) {
|
|
241
|
+
if ((val === null || val === void 0 ? void 0 : val.length) > 0) {
|
|
242
|
+
return [val[val.length - 1]];
|
|
243
|
+
}
|
|
240
244
|
}
|
|
241
245
|
}, {
|
|
242
246
|
searchDefaultConditions: SYMBOL.like,
|
|
243
247
|
type: item.type,
|
|
244
248
|
id: "".concat(item.id, "_bsExchangeReturnGoods"),
|
|
245
249
|
name: "".concat(_this.name, "-\u9000\u56DE"),
|
|
246
|
-
filterComponentType:
|
|
250
|
+
filterComponentType: 'Input'
|
|
247
251
|
}, {
|
|
248
252
|
searchDefaultConditions: SYMBOL.like,
|
|
249
253
|
type: item.type,
|
|
250
254
|
id: "".concat(item.id, "_bsExchangeSwapOutGoods"),
|
|
251
255
|
name: "".concat(_this.name, "-\u6362\u51FA"),
|
|
252
|
-
filterComponentType:
|
|
256
|
+
filterComponentType: 'Input'
|
|
253
257
|
}, {
|
|
254
258
|
searchDefaultConditions: SYMBOL.like,
|
|
255
259
|
type: item.type,
|
|
256
260
|
id: "".concat(item.id, "_bsExchangeGiftGoods"),
|
|
257
261
|
name: "".concat(_this.name, "-\u8D60\u54C1"),
|
|
258
|
-
filterComponentType:
|
|
262
|
+
filterComponentType: 'Input'
|
|
259
263
|
}];
|
|
260
264
|
});
|
|
261
265
|
this.name = options.name;
|
|
@@ -268,11 +272,11 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
|
268
272
|
this.canSort = false;
|
|
269
273
|
this.bsType = new BsType(_objectSpread(_objectSpread({}, options), {}, {
|
|
270
274
|
id: "".concat(options.id, "_bsExchangeType_type"),
|
|
271
|
-
name:
|
|
275
|
+
name: '换货类型'
|
|
272
276
|
}));
|
|
273
277
|
this.bsMemo = new BsMemo(_objectSpread(_objectSpread({}, options), {}, {
|
|
274
278
|
id: "".concat(options.id, "_bsExchangeType_memo"),
|
|
275
|
-
name:
|
|
279
|
+
name: '换货备注'
|
|
276
280
|
}));
|
|
277
281
|
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) {
|
|
278
282
|
if (returnHeaderMap[next]) {
|
|
@@ -301,23 +305,22 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
|
301
305
|
}, [])));
|
|
302
306
|
this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
|
|
303
307
|
this.rules = [{
|
|
304
|
-
required: (_this$componentConfig5 = this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.required,
|
|
305
308
|
validator: function validator(_, value) {
|
|
306
|
-
var _value$bsExchangeRetu;
|
|
307
|
-
if (
|
|
308
|
-
return Promise.reject(new Error(
|
|
309
|
+
var _this$componentConfig5, _value$bsExchangeRetu;
|
|
310
|
+
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)) {
|
|
311
|
+
return Promise.reject(new Error('请选择bs换货商品'));
|
|
309
312
|
}
|
|
310
313
|
return Promise.resolve();
|
|
311
314
|
}
|
|
312
315
|
}, {
|
|
313
316
|
validator: function validator(_, value) {
|
|
314
317
|
var _value$bsExchangeType;
|
|
315
|
-
if (value && [
|
|
318
|
+
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])) {
|
|
316
319
|
var hasNoGood = ((value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods) || []).some(function (item) {
|
|
317
320
|
return !(item !== null && item !== void 0 && item.bsExchangeReturnGoods.length);
|
|
318
321
|
});
|
|
319
322
|
if (hasNoGood) {
|
|
320
|
-
return Promise.reject(new Error(
|
|
323
|
+
return Promise.reject(new Error('请选择退回商品后再提交工单'));
|
|
321
324
|
}
|
|
322
325
|
var hasMore = ((value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods) || []).some(function (item) {
|
|
323
326
|
var returnMoney = ((item === null || item === void 0 ? void 0 : item.bsExchangeReturnGoods) || []).reduce(function (prv, next) {
|
|
@@ -331,18 +334,18 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
|
331
334
|
return returnMoney < swapOutMoney;
|
|
332
335
|
});
|
|
333
336
|
if (hasMore) {
|
|
334
|
-
return Promise.reject(new Error(
|
|
337
|
+
return Promise.reject(new Error('换货商品的金额不能大于退回商品的金额'));
|
|
335
338
|
}
|
|
336
339
|
var hasLen = ((value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods) || []).some(function (item) {
|
|
337
340
|
return (item === null || item === void 0 ? void 0 : item.bsExchangeReturnGoods.length) !== (item === null || item === void 0 ? void 0 : item.bsExchangeSwapOutGoods.length);
|
|
338
341
|
});
|
|
339
342
|
if (hasLen) {
|
|
340
|
-
return Promise.reject(new Error(
|
|
343
|
+
return Promise.reject(new Error('请核对商品数据,再提交工单'));
|
|
341
344
|
}
|
|
342
345
|
}
|
|
343
346
|
return Promise.resolve();
|
|
344
347
|
}
|
|
345
348
|
}];
|
|
346
|
-
this.dataType =
|
|
349
|
+
this.dataType = 'object';
|
|
347
350
|
});
|
|
348
351
|
export default BsExchange;
|
|
@@ -24,14 +24,20 @@ declare class BsReissue implements ComponentInterface {
|
|
|
24
24
|
renderExport: () => null;
|
|
25
25
|
editRender: (p: any) => React.JSX.Element;
|
|
26
26
|
filterConfig: (item: ColumnConfig) => ({
|
|
27
|
-
searchDefaultConditions: "
|
|
27
|
+
searchDefaultConditions: "in";
|
|
28
28
|
type: string;
|
|
29
29
|
id: string;
|
|
30
30
|
name: string;
|
|
31
31
|
filterComponentType: "Cascader";
|
|
32
32
|
props: {
|
|
33
33
|
options: any[] | undefined;
|
|
34
|
+
fieldNames: {
|
|
35
|
+
label: string;
|
|
36
|
+
value: string;
|
|
37
|
+
children: string;
|
|
38
|
+
};
|
|
34
39
|
};
|
|
40
|
+
formatFilterValue: (val: Array<string>) => string[] | undefined;
|
|
35
41
|
filterFn: (value: string) => (i: Record) => boolean;
|
|
36
42
|
} | {
|
|
37
43
|
searchDefaultConditions: "like";
|
|
@@ -40,6 +46,7 @@ declare class BsReissue implements ComponentInterface {
|
|
|
40
46
|
name: string;
|
|
41
47
|
filterComponentType: "Input";
|
|
42
48
|
props?: undefined;
|
|
49
|
+
formatFilterValue?: undefined;
|
|
43
50
|
filterFn?: undefined;
|
|
44
51
|
})[];
|
|
45
52
|
}
|
|
@@ -124,15 +124,25 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
|
124
124
|
});
|
|
125
125
|
});
|
|
126
126
|
_defineProperty(this, "filterConfig", function (item) {
|
|
127
|
-
var _item$
|
|
127
|
+
var _item$templateConfig;
|
|
128
128
|
return [{
|
|
129
|
-
searchDefaultConditions: SYMBOL.
|
|
129
|
+
searchDefaultConditions: SYMBOL.in,
|
|
130
130
|
type: item.type,
|
|
131
131
|
id: "".concat(item.id, "_bsReissueType"),
|
|
132
|
-
name: "".concat(item.name, "-\
|
|
132
|
+
name: "".concat(item.name, "-\u8865\u53D1\u7C7B\u578B"),
|
|
133
133
|
filterComponentType: 'Cascader',
|
|
134
134
|
props: {
|
|
135
|
-
options: item === null || item === void 0 ? void 0 : (_item$
|
|
135
|
+
options: item === null || item === void 0 ? void 0 : (_item$templateConfig = item.templateConfig) === null || _item$templateConfig === void 0 ? void 0 : _item$templateConfig.reasonList,
|
|
136
|
+
fieldNames: {
|
|
137
|
+
label: 'label',
|
|
138
|
+
value: 'value',
|
|
139
|
+
children: 'children'
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
formatFilterValue: function formatFilterValue(val) {
|
|
143
|
+
if ((val === null || val === void 0 ? void 0 : val.length) > 0) {
|
|
144
|
+
return [val[val.length - 1]];
|
|
145
|
+
}
|
|
136
146
|
},
|
|
137
147
|
filterFn: function filterFn(value) {
|
|
138
148
|
return function (i) {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, ALignType, Record } from
|
|
2
|
-
import React from
|
|
1
|
+
import { ComponentInterface, PickOption, ALignType, Record } from '../../../type';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
declare class BsMemo implements ComponentInterface {
|
|
4
4
|
name: string;
|
|
5
5
|
id: string;
|
|
6
6
|
sortField: string;
|
|
7
7
|
type: string;
|
|
8
|
-
componentConfig: ComponentInterface[
|
|
8
|
+
componentConfig: ComponentInterface['componentConfig'];
|
|
9
9
|
align: ALignType;
|
|
10
10
|
width: number;
|
|
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
|
getParentId: () => string;
|
|
18
18
|
renderClient: (r: any) => React.JSX.Element | null;
|