@kmkf-fe-packages/services-components 2.2.44-beta.1 → 2.2.44-beta.101
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/Hooks/useColumnsConfig.d.ts +1 -1
- package/dist/esm/Hooks/useColumnsConfig.js +2 -2
- package/dist/esm/commonComponents/GlobalContext/hook/useGetHasErpData.d.ts +1 -1
- package/dist/esm/commonComponents/GlobalContext/hook/useGetHasErpData.js +3 -2
- package/dist/esm/commonComponents/GlobalContext/index.js +52 -19
- package/dist/esm/commonComponents/GlobalContext/orderQuery/useGetErpAddressData.js +4 -2
- package/dist/esm/commonComponents/GlobalContext/orderQuery/useGetErpLogisticsCompany.js +13 -12
- package/dist/esm/commonComponents/QueryLogisticsTrack/index.d.ts +2 -1
- package/dist/esm/commonComponents/QueryLogisticsTrack/index.js +4 -2
- package/dist/esm/components/BS/BsSystemOrder/index.d.ts +8 -0
- package/dist/esm/components/BS/BsSystemOrder/index.js +43 -8
- package/dist/esm/components/BS/common/BsHeaderPic.js +4 -1
- package/dist/esm/components/BS/common/BsMemo.js +3 -1
- package/dist/esm/components/BS/common/BsType.js +3 -1
- package/dist/esm/components/BS/common/SystemOrderNo.js +3 -1
- package/dist/esm/components/Cascader/index.d.ts +8 -6
- package/dist/esm/components/Cascader/index.js +26 -22
- package/dist/esm/components/Common/index.d.ts +1 -1
- package/dist/esm/components/Common/index.js +4 -3
- package/dist/esm/components/CommonHeaderGood/index.js +47 -3
- package/dist/esm/components/CommonMultiStatus/index.js +73 -36
- package/dist/esm/components/KM/KmExchange/index.d.ts +35 -0
- package/dist/esm/components/KM/KmExchange/index.js +136 -0
- package/dist/esm/components/Logistics/index.d.ts +1 -0
- package/dist/esm/components/Logistics/index.js +10 -0
- package/dist/esm/components/LogisticsMoreInterception/index.js +1 -0
- package/dist/esm/components/Payment/index.d.ts +13 -12
- package/dist/esm/components/Payment/index.js +31 -11
- package/dist/esm/components/PicturePro/index.d.ts +9 -0
- package/dist/esm/components/PicturePro/index.js +17 -0
- package/dist/esm/components/PostIng/index.d.ts +1 -1
- package/dist/esm/components/Public/Goods/index.d.ts +9 -0
- package/dist/esm/components/Public/Goods/index.js +23 -2
- package/dist/esm/components/Public/ReissueGoods/index.js +41 -5
- package/dist/esm/components/Public/ReturnWarehouse/index.d.ts +51 -0
- package/dist/esm/components/Public/ReturnWarehouse/index.js +210 -0
- package/dist/esm/components/ReceiverAddress/index.d.ts +7 -6
- package/dist/esm/components/ReceiverAddress/index.js +41 -27
- package/dist/esm/factory.d.ts +2 -2
- package/dist/esm/factory.js +8 -1
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/service/api.js +1 -0
- package/package.json +4 -4
|
@@ -33,6 +33,7 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(options) {
|
|
|
33
33
|
_defineProperty(this, "children", void 0);
|
|
34
34
|
_defineProperty(this, "dataType", void 0);
|
|
35
35
|
_defineProperty(this, "isChange", void 0);
|
|
36
|
+
_defineProperty(this, "compoundConfig", void 0);
|
|
36
37
|
_defineProperty(this, "editRender", function (p) {
|
|
37
38
|
var _this$componentConfig, _this$componentConfig2, _this$componentConfig3, _this$componentConfig4;
|
|
38
39
|
var onExpressLogisticsCodeBlur = function onExpressLogisticsCodeBlur(val) {
|
|
@@ -130,5 +131,14 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(options) {
|
|
|
130
131
|
}
|
|
131
132
|
}] : [];
|
|
132
133
|
this.isChange = false;
|
|
134
|
+
this.compoundConfig = [{
|
|
135
|
+
name: "快递物流公司",
|
|
136
|
+
id: "".concat(options.id, "_expressLogisticsCompany"),
|
|
137
|
+
standardDateType: "String"
|
|
138
|
+
}, {
|
|
139
|
+
name: "快递物流单号",
|
|
140
|
+
id: "".concat(options.id, "_expressLogisticsCode"),
|
|
141
|
+
standardDateType: "String"
|
|
142
|
+
}];
|
|
133
143
|
});
|
|
134
144
|
export default Logistics;
|
|
@@ -113,6 +113,7 @@ function Logistics(options) {
|
|
|
113
113
|
name: _this.id,
|
|
114
114
|
rules: _this.rules,
|
|
115
115
|
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
116
|
+
display: p === null || p === void 0 ? void 0 : p.display,
|
|
116
117
|
required: (_this$componentConfig = (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.required) !== null && _this$componentConfig !== void 0 ? _this$componentConfig : false,
|
|
117
118
|
tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : "",
|
|
118
119
|
component: /*#__PURE__*/React.createElement(LogisticsMoreInterception, _extends({}, _this.componentConfig, {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, ColumnConfig, Record } from
|
|
2
|
-
import React from
|
|
3
|
-
import AlipayNick from
|
|
4
|
-
import AlipayNo from
|
|
5
|
-
import AlipayTime from
|
|
6
|
-
import BuyerNick from
|
|
7
|
-
import PaymentAmount from
|
|
8
|
-
import PaymentStatus from
|
|
9
|
-
import PaymentTid from
|
|
1
|
+
import { ComponentInterface, PickOption, ColumnConfig, Record } from '../../type';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import AlipayNick from './AlipayNick';
|
|
4
|
+
import AlipayNo from './AlipayNo';
|
|
5
|
+
import AlipayTime from './AlipayTime';
|
|
6
|
+
import BuyerNick from './BuyerNick';
|
|
7
|
+
import PaymentAmount from './PaymentAmount';
|
|
8
|
+
import PaymentStatus from './PaymentStatus';
|
|
9
|
+
import PaymentTid from './PaymentTid';
|
|
10
10
|
declare class Logistics implements ComponentInterface {
|
|
11
11
|
name: string;
|
|
12
12
|
id: string;
|
|
13
13
|
sortField: string;
|
|
14
14
|
type: string;
|
|
15
15
|
rules: any[];
|
|
16
|
-
componentConfig: ComponentInterface[
|
|
16
|
+
componentConfig: ComponentInterface['componentConfig'];
|
|
17
17
|
paymentTid: PaymentTid;
|
|
18
18
|
paymentStatus: PaymentStatus;
|
|
19
19
|
paymentAmount: PaymentAmount;
|
|
@@ -25,8 +25,9 @@ declare class Logistics implements ComponentInterface {
|
|
|
25
25
|
formField: string;
|
|
26
26
|
canSort: boolean;
|
|
27
27
|
children: ComponentInterface[];
|
|
28
|
-
dataType: ComponentInterface[
|
|
29
|
-
effects: ComponentInterface[
|
|
28
|
+
dataType: ComponentInterface['dataType'];
|
|
29
|
+
effects: ComponentInterface['effects'];
|
|
30
|
+
compoundConfig: ComponentInterface['compoundConfig'];
|
|
30
31
|
constructor(options: PickOption);
|
|
31
32
|
renderClient: (record: any, params: any) => React.JSX.Element;
|
|
32
33
|
renderPc: () => null;
|
|
@@ -8,8 +8,8 @@ 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
|
|
12
|
-
import { Payment as ApaasPayment } from
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import { Payment as ApaasPayment } from '@kmkf-fe-packages/basic-components';
|
|
13
13
|
import GetFormItem from "../GetFormItem";
|
|
14
14
|
import AlipayNick from "./AlipayNick";
|
|
15
15
|
import AlipayNo from "./AlipayNo";
|
|
@@ -40,6 +40,7 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(options) {
|
|
|
40
40
|
_defineProperty(this, "children", void 0);
|
|
41
41
|
_defineProperty(this, "dataType", void 0);
|
|
42
42
|
_defineProperty(this, "effects", void 0);
|
|
43
|
+
_defineProperty(this, "compoundConfig", void 0);
|
|
43
44
|
_defineProperty(this, "renderClient", function (record, params) {
|
|
44
45
|
return /*#__PURE__*/React.createElement(React.Fragment, null, _this.alipayNick.renderClient(record), _this.paymentAmount.renderClient(record), _this.alipayNo.renderClient(record), _this.buyerNick.renderClient(record, params), _this.paymentTid.renderClient(record), _this.paymentStatus.renderClient(record), _this.payTime.renderClient(record));
|
|
45
46
|
});
|
|
@@ -104,32 +105,51 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(options) {
|
|
|
104
105
|
validator: function validator(_, value) {
|
|
105
106
|
var _this$componentConfig6, _this$componentConfig7, _this$componentConfig8, _this$componentConfig9;
|
|
106
107
|
if ((_this$componentConfig6 = _this.componentConfig) !== null && _this$componentConfig6 !== void 0 && _this$componentConfig6.required && !(value !== null && value !== void 0 && value.enterprisePaymentRefundFee)) {
|
|
107
|
-
return Promise.reject(new Error(
|
|
108
|
+
return Promise.reject(new Error('请输入打款金额'));
|
|
108
109
|
} else if (value !== null && value !== void 0 && value.enterprisePaymentRefundFee && !/^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/.test(value === null || value === void 0 ? void 0 : value.enterprisePaymentRefundFee)) {
|
|
109
|
-
return Promise.reject(new Error(
|
|
110
|
+
return Promise.reject(new Error('打款金额最多2位小数'));
|
|
110
111
|
}
|
|
111
112
|
if ((_this$componentConfig7 = _this.componentConfig) !== null && _this$componentConfig7 !== void 0 && _this$componentConfig7.required && !(value !== null && value !== void 0 && value.enterprisePaymentTid)) {
|
|
112
|
-
return Promise.reject(new Error(
|
|
113
|
+
return Promise.reject(new Error('请输入订单编号'));
|
|
113
114
|
} else if (value.enterprisePaymentTid && !/^[0-9a-zA-Z_-]{1,}$/.test(value.enterprisePaymentTid)) {
|
|
114
|
-
return Promise.reject(new Error(
|
|
115
|
+
return Promise.reject(new Error('请输入正确的订单编号'));
|
|
115
116
|
}
|
|
116
117
|
if ((_this$componentConfig8 = _this.componentConfig) !== null && _this$componentConfig8 !== void 0 && _this$componentConfig8.zhiFubaoRequired && !(value !== null && value !== void 0 && value.enterprisePaymentAlipayNick)) {
|
|
117
|
-
return Promise.reject(new Error(
|
|
118
|
+
return Promise.reject(new Error('请输入支付宝名称'));
|
|
118
119
|
}
|
|
119
120
|
if ((_this$componentConfig9 = _this.componentConfig) !== null && _this$componentConfig9 !== void 0 && _this$componentConfig9.zhiFubaoRequired && !(value !== null && value !== void 0 && value.enterprisePaymentAlipayNo)) {
|
|
120
|
-
return Promise.reject(new Error(
|
|
121
|
+
return Promise.reject(new Error('请输入支付宝账号'));
|
|
121
122
|
} else if (value.enterprisePaymentAlipayNo && !/^(?:1[3-9]\d{9}|[a-zA-Z\d._-]*\@[a-zA-Z\d.-]{1,10}\.[a-zA-Z\d]{1,20})$/.test(value.enterprisePaymentAlipayNo)) {
|
|
122
|
-
return Promise.reject(new Error(
|
|
123
|
+
return Promise.reject(new Error('请输入正确的支付宝账号格式'));
|
|
123
124
|
}
|
|
124
125
|
//支付宝信息不能只填一个,否则不能打款
|
|
125
126
|
if (value !== null && value !== void 0 && value.enterprisePaymentAlipayNick || value !== null && value !== void 0 && value.enterprisePaymentAlipayNo) {
|
|
126
127
|
if (!(value !== null && value !== void 0 && value.enterprisePaymentAlipayNick && value !== null && value !== void 0 && value.enterprisePaymentAlipayNo)) {
|
|
127
|
-
return Promise.reject(new Error(
|
|
128
|
+
return Promise.reject(new Error('支付宝姓名/账号都要填写'));
|
|
128
129
|
}
|
|
129
130
|
}
|
|
130
131
|
return Promise.resolve();
|
|
131
132
|
}
|
|
132
133
|
}];
|
|
133
|
-
this.dataType =
|
|
134
|
+
this.dataType = 'object';
|
|
135
|
+
this.compoundConfig = [{
|
|
136
|
+
name: "\u8BA2\u5355\u7F16\u53F7",
|
|
137
|
+
id: "".concat(options.id, "_enterprisePaymentTid")
|
|
138
|
+
}, {
|
|
139
|
+
name: "\u6253\u6B3E\u91D1\u989D",
|
|
140
|
+
id: "".concat(options.id, "_enterprisePaymentRefundFee")
|
|
141
|
+
}, {
|
|
142
|
+
name: "\u4E70\u5BB6\u6635\u79F0",
|
|
143
|
+
id: "".concat(options.id, "_enterprisePaymentBuyerNick")
|
|
144
|
+
}, {
|
|
145
|
+
name: "\u652F\u4ED8\u5B9D\u59D3\u540D",
|
|
146
|
+
id: "".concat(options.id, "_enterprisePaymentAlipayNick")
|
|
147
|
+
}, {
|
|
148
|
+
name: "\u652F\u4ED8\u5B9D\u8D26\u53F7",
|
|
149
|
+
id: "".concat(options.id, "_enterprisePaymentAlipayNo")
|
|
150
|
+
}, {
|
|
151
|
+
name: "\u6253\u6B3E\u72B6\u6001",
|
|
152
|
+
id: "".concat(options.id, "_enterprisePaymentStatus")
|
|
153
|
+
}];
|
|
134
154
|
});
|
|
135
155
|
export default Logistics;
|
|
@@ -18,8 +18,17 @@ declare class BasicPicturePro implements ComponentInterface {
|
|
|
18
18
|
children: ComponentInterface[];
|
|
19
19
|
dataType: ComponentInterface['dataType'];
|
|
20
20
|
currenEnv: ComponentInterface['platform'];
|
|
21
|
+
sortChildField: {
|
|
22
|
+
name: string;
|
|
23
|
+
key: string;
|
|
24
|
+
dataType: string;
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
}[];
|
|
27
|
+
exampleValue?: string;
|
|
28
|
+
standardDateType: ComponentInterface['standardDateType'];
|
|
21
29
|
constructor(options: PickOption);
|
|
22
30
|
formatPictures: (pictures: string) => string[];
|
|
31
|
+
getSortChildFields: () => any;
|
|
23
32
|
render: (value: Value) => React.JSX.Element | null;
|
|
24
33
|
renderPc: () => null;
|
|
25
34
|
renderLog: (r: Record) => React.JSX.Element | null;
|
|
@@ -36,11 +36,25 @@ var BasicPicturePro = /*#__PURE__*/_createClass(function BasicPicturePro(options
|
|
|
36
36
|
_defineProperty(this, "children", void 0);
|
|
37
37
|
_defineProperty(this, "dataType", void 0);
|
|
38
38
|
_defineProperty(this, "currenEnv", void 0);
|
|
39
|
+
_defineProperty(this, "sortChildField", void 0);
|
|
40
|
+
_defineProperty(this, "exampleValue", void 0);
|
|
41
|
+
_defineProperty(this, "standardDateType", void 0);
|
|
39
42
|
_defineProperty(this, "formatPictures", function (pictures) {
|
|
40
43
|
pictures = pictures.replace(/[\[\]]/g, '');
|
|
41
44
|
pictures = pictures.replace(/\s/g, '');
|
|
42
45
|
return pictures ? pictures.split(',') : [];
|
|
43
46
|
});
|
|
47
|
+
_defineProperty(this, "getSortChildFields", function () {
|
|
48
|
+
return [{
|
|
49
|
+
name: '图片名称',
|
|
50
|
+
key: "".concat(_this.id, "_name"),
|
|
51
|
+
dataType: 'arrayObject'
|
|
52
|
+
}, {
|
|
53
|
+
name: '图片链接',
|
|
54
|
+
key: "".concat(_this.id, "_url"),
|
|
55
|
+
dataType: 'arrayObject'
|
|
56
|
+
}];
|
|
57
|
+
});
|
|
44
58
|
_defineProperty(this, "render", function (value) {
|
|
45
59
|
var _document;
|
|
46
60
|
if (!(value !== null && value !== void 0 && value.length)) {
|
|
@@ -176,5 +190,8 @@ var BasicPicturePro = /*#__PURE__*/_createClass(function BasicPicturePro(options
|
|
|
176
190
|
}))];
|
|
177
191
|
this.dataType = 'object';
|
|
178
192
|
this.currenEnv = options === null || options === void 0 ? void 0 : (_options$effects = options.effects) === null || _options$effects === void 0 ? void 0 : _options$effects.env;
|
|
193
|
+
this.sortChildField = this.getSortChildFields();
|
|
194
|
+
this.exampleValue = '[{"name":"c.jpeg","url":"https://kefu.kuaimai.com/pic/c.jpeg"}]';
|
|
195
|
+
this.standardDateType = 'Array';
|
|
179
196
|
});
|
|
180
197
|
export default BasicPicturePro;
|
|
@@ -31,7 +31,7 @@ declare class BasicPosting implements ComponentInterface {
|
|
|
31
31
|
sortColumns: SortColumnsField;
|
|
32
32
|
headerProvince: boolean;
|
|
33
33
|
constructor(options: PickOption);
|
|
34
|
-
getChildren: () => (
|
|
34
|
+
getChildren: () => (City | Detail | District | Province | ReceiverMobile | ReceiverName | undefined)[];
|
|
35
35
|
getSortColumns: (sortColumns: string | undefined) => SortColumnsField;
|
|
36
36
|
renderPc: (value: any, record: Record) => React.JSX.Element | null;
|
|
37
37
|
renderLog: (r: Record) => React.JSX.Element | null;
|
|
@@ -16,7 +16,16 @@ declare class PublicGoods implements ComponentInterface {
|
|
|
16
16
|
children: ComponentInterface[];
|
|
17
17
|
dataType: ComponentInterface["dataType"];
|
|
18
18
|
headers: CommonHeaderGoods;
|
|
19
|
+
exampleValue?: string;
|
|
20
|
+
standardDateType: ComponentInterface["standardDateType"];
|
|
21
|
+
sortChildField: {
|
|
22
|
+
name: string;
|
|
23
|
+
key: string;
|
|
24
|
+
dataType: string;
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
}[];
|
|
19
27
|
constructor(options: PickOption);
|
|
28
|
+
getSortChildFields: () => any;
|
|
20
29
|
renderClient: (record: any) => React.JSX.Element | null;
|
|
21
30
|
renderPc: () => null;
|
|
22
31
|
renderLog: (r: Record) => React.JSX.Element | null;
|
|
@@ -15,6 +15,7 @@ import CommonHeaderGoods from "../../CommonHeaderGood";
|
|
|
15
15
|
import ItemView from "../../../commonComponents/ItemView";
|
|
16
16
|
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
17
17
|
import { CommonGoods as Goods } from "@kmkf-fe-packages/basic-components";
|
|
18
|
+
import { getColumnsMap } from "../../Common/constants/columnsBaseInfoMap";
|
|
18
19
|
import { SYMBOL } from "../../../constant";
|
|
19
20
|
var CONFIG_MAP = {
|
|
20
21
|
JST_GOODS: {
|
|
@@ -27,7 +28,8 @@ var CONFIG_MAP = {
|
|
|
27
28
|
},
|
|
28
29
|
JY_GOODS: {
|
|
29
30
|
name: "巨益",
|
|
30
|
-
key: "jyGoods"
|
|
31
|
+
key: "jyGoods",
|
|
32
|
+
exampleValue: '[{"gift":"","bfit":"","mallSkuId":"","specCode":"","sellTotal":0,"canEdit":false,"sellPrice":0,"mallProductName":"","oid":"","uuid":"","productName":"","skuName":"","canDelete":false,"divideOrderFee":0,"goodsName":"","mallSellingPrice":0,"productId":"","mallProductId":"","productCode":"","specName":"","mallSkuName":"","sellCount":0,"settlementPrice":0,"goodsCode":"","systemOrderNo":"","skuCode":""}]'
|
|
31
33
|
},
|
|
32
34
|
JKY_GOODS: {
|
|
33
35
|
name: "吉客云",
|
|
@@ -45,7 +47,8 @@ var CONFIG_MAP = {
|
|
|
45
47
|
var PublicGoods = /*#__PURE__*/_createClass(function PublicGoods(options) {
|
|
46
48
|
var _this = this,
|
|
47
49
|
_CONFIG_MAP$this$type,
|
|
48
|
-
_this$componentConfig6
|
|
50
|
+
_this$componentConfig6,
|
|
51
|
+
_CONFIG_MAP$this$type2;
|
|
49
52
|
_classCallCheck(this, PublicGoods);
|
|
50
53
|
_defineProperty(this, "name", void 0);
|
|
51
54
|
_defineProperty(this, "id", void 0);
|
|
@@ -60,6 +63,21 @@ var PublicGoods = /*#__PURE__*/_createClass(function PublicGoods(options) {
|
|
|
60
63
|
_defineProperty(this, "children", void 0);
|
|
61
64
|
_defineProperty(this, "dataType", void 0);
|
|
62
65
|
_defineProperty(this, "headers", void 0);
|
|
66
|
+
_defineProperty(this, "exampleValue", void 0);
|
|
67
|
+
_defineProperty(this, "standardDateType", void 0);
|
|
68
|
+
_defineProperty(this, "sortChildField", void 0);
|
|
69
|
+
_defineProperty(this, "getSortChildFields", function () {
|
|
70
|
+
var Columns = getColumnsMap();
|
|
71
|
+
return Columns[_this.type].filter(function (item) {
|
|
72
|
+
return !["picUrl"].includes(item.dataIndex);
|
|
73
|
+
}).map(function (item) {
|
|
74
|
+
return {
|
|
75
|
+
name: item.title,
|
|
76
|
+
key: "".concat(_this.id, "_").concat(item.dataIndex),
|
|
77
|
+
dataType: "arrayObject"
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
});
|
|
63
81
|
_defineProperty(this, "renderClient", function (record) {
|
|
64
82
|
var _record, _CONFIG_MAP$_this$typ, _this$componentConfig;
|
|
65
83
|
return !isNull(record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ItemView, {
|
|
@@ -150,5 +168,8 @@ var PublicGoods = /*#__PURE__*/_createClass(function PublicGoods(options) {
|
|
|
150
168
|
}
|
|
151
169
|
}] : [];
|
|
152
170
|
this.dataType = "object";
|
|
171
|
+
this.sortChildField = this.getSortChildFields();
|
|
172
|
+
this.exampleValue = ((_CONFIG_MAP$this$type2 = CONFIG_MAP[this.type]) === null || _CONFIG_MAP$this$type2 === void 0 ? void 0 : _CONFIG_MAP$this$type2.exampleValue) || "";
|
|
173
|
+
this.standardDateType = "Array";
|
|
153
174
|
});
|
|
154
175
|
export default PublicGoods;
|
|
@@ -66,6 +66,24 @@ var typeMap = {
|
|
|
66
66
|
errMsg: "请选择快麦补发商品",
|
|
67
67
|
name: "快麦",
|
|
68
68
|
compType: "补发",
|
|
69
|
+
validator: function validator(_rule, value, type, componentConfig) {
|
|
70
|
+
if (!_rule.required) return Promise.resolve();
|
|
71
|
+
var validatorFlag = erpFormValidator(_rule, value, type, componentConfig);
|
|
72
|
+
if (validatorFlag) {
|
|
73
|
+
return validatorFlag;
|
|
74
|
+
}
|
|
75
|
+
return Promise.resolve();
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
KM_RETURN_GOODS: {
|
|
79
|
+
key: "kmReturnGoods",
|
|
80
|
+
typeName: "kmReturnType",
|
|
81
|
+
remark: "kmReturnType_memo",
|
|
82
|
+
systemOrderNo: "kmSystemOrderNo",
|
|
83
|
+
systemOrderBillType: "kmSystemOrderBillType",
|
|
84
|
+
errMsg: "请选择快麦退货商品",
|
|
85
|
+
name: "快麦",
|
|
86
|
+
compType: "退货",
|
|
69
87
|
validator: function validator(_rule, value, type) {
|
|
70
88
|
if (!_rule.required) return Promise.resolve();
|
|
71
89
|
var validatorFlag = erpFormValidator(_rule, value, type);
|
|
@@ -92,6 +110,24 @@ var typeMap = {
|
|
|
92
110
|
}
|
|
93
111
|
return Promise.resolve();
|
|
94
112
|
}
|
|
113
|
+
},
|
|
114
|
+
JKY_REISSUE_GOODS: {
|
|
115
|
+
key: "jkyReissueGoods",
|
|
116
|
+
typeName: "jkyReissueType",
|
|
117
|
+
remark: "jkyReissueType_memo",
|
|
118
|
+
systemOrderNo: "jkySystemOrderNo",
|
|
119
|
+
systemOrderBillType: "jkySystemOrderBillType",
|
|
120
|
+
errMsg: "请选择吉客云补发商品",
|
|
121
|
+
name: "吉客云",
|
|
122
|
+
compType: "补发",
|
|
123
|
+
validator: function validator(_rule, value, type) {
|
|
124
|
+
if (!_rule.required) return Promise.resolve();
|
|
125
|
+
var validatorFlag = erpFormValidator(_rule, value, type);
|
|
126
|
+
if (validatorFlag) {
|
|
127
|
+
return validatorFlag;
|
|
128
|
+
}
|
|
129
|
+
return Promise.resolve();
|
|
130
|
+
}
|
|
95
131
|
}
|
|
96
132
|
};
|
|
97
133
|
var PublicReissue = /*#__PURE__*/_createClass(function PublicReissue(options) {
|
|
@@ -162,7 +198,7 @@ var PublicReissue = /*#__PURE__*/_createClass(function PublicReissue(options) {
|
|
|
162
198
|
_defineProperty(this, "editRender", function (p) {
|
|
163
199
|
var _this$componentConfig3, _this$componentConfig4, _this$componentConfig5, _this$effects, _this$effects2, _this$effects3;
|
|
164
200
|
var onChange = function onChange(val, type) {
|
|
165
|
-
if (_this.type
|
|
201
|
+
if (["KM_REISSUE_GOODS", "KM_RETURN_GOODS"].includes(_this.type) && type === "systemOrder") {
|
|
166
202
|
p === null || p === void 0 ? void 0 : p.onChange(val, "kmSystemOrder");
|
|
167
203
|
}
|
|
168
204
|
};
|
|
@@ -261,9 +297,9 @@ var PublicReissue = /*#__PURE__*/_createClass(function PublicReissue(options) {
|
|
|
261
297
|
var _typeMap$options$type12;
|
|
262
298
|
return Promise.reject(new Error("".concat((_typeMap$options$type12 = typeMap[options.type]) === null || _typeMap$options$type12 === void 0 ? void 0 : _typeMap$options$type12.errMsg)));
|
|
263
299
|
}
|
|
264
|
-
//
|
|
265
|
-
if (isRequired && ["KM_REISSUE_GOODS"].includes(options.type) && (!value || !(value !== null && value !== void 0 && value["".concat((_typeMap$options$type13 = typeMap[options.type]) === null || _typeMap$options$type13 === void 0 ? void 0 : _typeMap$options$type13.systemOrderNo)]))) {
|
|
266
|
-
return Promise.reject(new Error("\u8BF7\u9009\u62E9\u8865\u53D1\u7CFB\u7EDF\u5355"));
|
|
300
|
+
// 快麦补发/退货商品需要校验系统单
|
|
301
|
+
if (isRequired && ["KM_REISSUE_GOODS", "KM_RETURN_GOODS"].includes(options.type) && (!value || !(value !== null && value !== void 0 && value["".concat((_typeMap$options$type13 = typeMap[options.type]) === null || _typeMap$options$type13 === void 0 ? void 0 : _typeMap$options$type13.systemOrderNo)]))) {
|
|
302
|
+
return Promise.reject(new Error(options.type === "KM_REISSUE_GOODS" ? "\u8BF7\u9009\u62E9\u8865\u53D1\u7CFB\u7EDF\u5355" : "\u8BF7\u9009\u62E9\u9000\u8D27\u7CFB\u7EDF\u5355"));
|
|
267
303
|
}
|
|
268
304
|
return Promise.resolve();
|
|
269
305
|
}
|
|
@@ -271,7 +307,7 @@ var PublicReissue = /*#__PURE__*/_createClass(function PublicReissue(options) {
|
|
|
271
307
|
required: isRequired,
|
|
272
308
|
validator: function validator(_rule, value) {
|
|
273
309
|
var _typeMap$options$type14, _typeMap$options$type15;
|
|
274
|
-
return ((_typeMap$options$type14 = typeMap[options.type]) === null || _typeMap$options$type14 === void 0 ? void 0 : (_typeMap$options$type15 = _typeMap$options$type14.validator) === null || _typeMap$options$type15 === void 0 ? void 0 : _typeMap$options$type15.call(_typeMap$options$type14, _rule, value, options.type)) || function () {
|
|
310
|
+
return ((_typeMap$options$type14 = typeMap[options.type]) === null || _typeMap$options$type14 === void 0 ? void 0 : (_typeMap$options$type15 = _typeMap$options$type14.validator) === null || _typeMap$options$type15 === void 0 ? void 0 : _typeMap$options$type15.call(_typeMap$options$type14, _rule, value, options.type, _this.componentConfig)) || function () {
|
|
275
311
|
return Promise.resolve();
|
|
276
312
|
};
|
|
277
313
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from "../../../type";
|
|
2
|
+
import React from "react";
|
|
3
|
+
declare class ReturnWarehouse implements ComponentInterface {
|
|
4
|
+
name: string;
|
|
5
|
+
id: string;
|
|
6
|
+
sortField: string;
|
|
7
|
+
sortChildField: {
|
|
8
|
+
name: string;
|
|
9
|
+
key: string;
|
|
10
|
+
dataType: string;
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}[];
|
|
13
|
+
type: string;
|
|
14
|
+
rules: any[];
|
|
15
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
16
|
+
align: ALignType;
|
|
17
|
+
isCombinationComponent: boolean;
|
|
18
|
+
formField: string;
|
|
19
|
+
canSort: boolean;
|
|
20
|
+
children: ComponentInterface[];
|
|
21
|
+
dataType: ComponentInterface["dataType"];
|
|
22
|
+
format: ComponentInterface["format"];
|
|
23
|
+
constructor(options: PickOption);
|
|
24
|
+
getSortChildFields: (type: string, options: PickOption, fieldType?: string) => any;
|
|
25
|
+
renderClient: (record: Record) => React.JSX.Element | null;
|
|
26
|
+
renderPc: (value: any, record: Record) => React.JSX.Element;
|
|
27
|
+
renderLog: (r: Record) => React.JSX.Element | null;
|
|
28
|
+
getComponentValue: (r: Record) => any;
|
|
29
|
+
renderExport: (value: any, record: any) => any;
|
|
30
|
+
editRender: (p: any) => React.JSX.Element;
|
|
31
|
+
filterConfig: (item: ColumnConfig) => ({
|
|
32
|
+
searchDefaultConditions: "in";
|
|
33
|
+
type: string;
|
|
34
|
+
id: string;
|
|
35
|
+
name: string;
|
|
36
|
+
filterComponentType: "MultipleSelect";
|
|
37
|
+
props: {
|
|
38
|
+
options: any[];
|
|
39
|
+
};
|
|
40
|
+
filterFn: (value: string) => (i: Record) => any;
|
|
41
|
+
} | {
|
|
42
|
+
searchDefaultConditions: "like";
|
|
43
|
+
type: string;
|
|
44
|
+
id: string;
|
|
45
|
+
name: string;
|
|
46
|
+
filterComponentType: "Input";
|
|
47
|
+
filterFn: (value: string) => (i: Record) => any;
|
|
48
|
+
props?: undefined;
|
|
49
|
+
})[];
|
|
50
|
+
}
|
|
51
|
+
export default ReturnWarehouse;
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
9
|
+
import React from "react";
|
|
10
|
+
import some from "lodash/some";
|
|
11
|
+
import GetFormItem from "../../GetFormItem";
|
|
12
|
+
import { JstGoodImage } from "../../Common";
|
|
13
|
+
import { JstGoods } from "@kmkf-fe-packages/basic-components";
|
|
14
|
+
import ItemView from "../../../commonComponents/ItemView";
|
|
15
|
+
import { isNull, filterFn as _filterFn, SendDataCenter } from "@kmkf-fe-packages/kmkf-utils";
|
|
16
|
+
import { SYMBOL } from "../../../constant";
|
|
17
|
+
var typeMap = {
|
|
18
|
+
KM_RETURN_WAREHOUSE: {
|
|
19
|
+
key: "kmReturnWarehouse",
|
|
20
|
+
name: "km",
|
|
21
|
+
returnWarehouseId: "kmReturnWarehouseId",
|
|
22
|
+
returnWarehouseName: "kmReturnWarehouseName",
|
|
23
|
+
platformType: "km",
|
|
24
|
+
dataType: "weakenArray",
|
|
25
|
+
placeholder: "请选择快麦退货仓"
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
var ReturnWarehouse = /*#__PURE__*/_createClass(function ReturnWarehouse(_options) {
|
|
29
|
+
var _this = this,
|
|
30
|
+
_typeMap$_options$typ,
|
|
31
|
+
_typeMap$_options$typ2,
|
|
32
|
+
_this$componentConfig3,
|
|
33
|
+
_typeMap$_options$typ3,
|
|
34
|
+
_this$componentConfig4;
|
|
35
|
+
_classCallCheck(this, ReturnWarehouse);
|
|
36
|
+
_defineProperty(this, "name", void 0);
|
|
37
|
+
_defineProperty(this, "id", void 0);
|
|
38
|
+
_defineProperty(this, "sortField", void 0);
|
|
39
|
+
_defineProperty(this, "sortChildField", void 0);
|
|
40
|
+
_defineProperty(this, "type", void 0);
|
|
41
|
+
_defineProperty(this, "rules", void 0);
|
|
42
|
+
_defineProperty(this, "componentConfig", void 0);
|
|
43
|
+
_defineProperty(this, "align", void 0);
|
|
44
|
+
_defineProperty(this, "isCombinationComponent", void 0);
|
|
45
|
+
_defineProperty(this, "formField", void 0);
|
|
46
|
+
_defineProperty(this, "canSort", void 0);
|
|
47
|
+
_defineProperty(this, "children", void 0);
|
|
48
|
+
_defineProperty(this, "dataType", void 0);
|
|
49
|
+
_defineProperty(this, "format", void 0);
|
|
50
|
+
_defineProperty(this, "getSortChildFields", function (type, options, fieldType) {
|
|
51
|
+
var _typeMap$options$type, _typeMap$options$type2, _typeMap$options$type3;
|
|
52
|
+
var returnWarehouseName = {
|
|
53
|
+
name: "退货仓名称",
|
|
54
|
+
key: "".concat(options.id, "_").concat((_typeMap$options$type = typeMap[options.type]) === null || _typeMap$options$type === void 0 ? void 0 : _typeMap$options$type.returnWarehouseName),
|
|
55
|
+
dataType: (_typeMap$options$type2 = typeMap[options.type]) === null || _typeMap$options$type2 === void 0 ? void 0 : _typeMap$options$type2.dataType,
|
|
56
|
+
disabled: type === "returnWarehouseId"
|
|
57
|
+
};
|
|
58
|
+
var returnWarehouseId = {
|
|
59
|
+
name: "退货仓编码",
|
|
60
|
+
key: "".concat(options.id, "_").concat((_typeMap$options$type3 = typeMap[options.type]) === null || _typeMap$options$type3 === void 0 ? void 0 : _typeMap$options$type3.returnWarehouseId),
|
|
61
|
+
dataType: "arrayObject",
|
|
62
|
+
disabled: type === "returnWarehouseName"
|
|
63
|
+
};
|
|
64
|
+
returnWarehouseName.options = fieldType && SendDataCenter.getInstance(fieldType).getSendData();
|
|
65
|
+
return [returnWarehouseName, returnWarehouseId];
|
|
66
|
+
});
|
|
67
|
+
_defineProperty(this, "renderClient", function (record) {
|
|
68
|
+
var _typeMap$_this$type;
|
|
69
|
+
var isShow = Array.isArray(record === null || record === void 0 ? void 0 : record[_this.id]) ? some(record === null || record === void 0 ? void 0 : record[_this.id], function (item) {
|
|
70
|
+
return !isNull(item);
|
|
71
|
+
}) : false;
|
|
72
|
+
return isShow ? /*#__PURE__*/React.createElement(ItemView, {
|
|
73
|
+
id: _this.id,
|
|
74
|
+
label: _this.name,
|
|
75
|
+
value: /*#__PURE__*/React.createElement(JstGoodImage, {
|
|
76
|
+
list: record === null || record === void 0 ? void 0 : record[_this.id],
|
|
77
|
+
type: 5,
|
|
78
|
+
platformType: (_typeMap$_this$type = typeMap[_this.type]) === null || _typeMap$_this$type === void 0 ? void 0 : _typeMap$_this$type.platformType
|
|
79
|
+
})
|
|
80
|
+
}) : null;
|
|
81
|
+
});
|
|
82
|
+
_defineProperty(this, "renderPc", function (value, record) {
|
|
83
|
+
var _typeMap$_this$type2, _typeMap$_this$type3;
|
|
84
|
+
var list = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat((_typeMap$_this$type2 = typeMap[_this.type]) === null || _typeMap$_this$type2 === void 0 ? void 0 : _typeMap$_this$type2.key)];
|
|
85
|
+
//兼容多个商品
|
|
86
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
87
|
+
onClick: function onClick(e) {
|
|
88
|
+
return e.stopPropagation();
|
|
89
|
+
}
|
|
90
|
+
}, /*#__PURE__*/React.createElement(JstGoodImage, {
|
|
91
|
+
list: list,
|
|
92
|
+
type: 5,
|
|
93
|
+
platformType: (_typeMap$_this$type3 = typeMap[_this.type]) === null || _typeMap$_this$type3 === void 0 ? void 0 : _typeMap$_this$type3.platformType
|
|
94
|
+
}));
|
|
95
|
+
});
|
|
96
|
+
_defineProperty(this, "renderLog", function (r) {
|
|
97
|
+
var _typeMap$_this$type4;
|
|
98
|
+
var list = r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_typeMap$_this$type4 = typeMap[_this.type]) === null || _typeMap$_this$type4 === void 0 ? void 0 : _typeMap$_this$type4.key)];
|
|
99
|
+
if (isNull(list)) return null;
|
|
100
|
+
return _this.renderPc(undefined, r);
|
|
101
|
+
});
|
|
102
|
+
_defineProperty(this, "getComponentValue", function (r) {
|
|
103
|
+
var _typeMap$_this$type5;
|
|
104
|
+
return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_typeMap$_this$type5 = typeMap[_this.type]) === null || _typeMap$_this$type5 === void 0 ? void 0 : _typeMap$_this$type5.key)];
|
|
105
|
+
});
|
|
106
|
+
_defineProperty(this, "renderExport", function (value, record) {
|
|
107
|
+
var _typeMap$_this$type6;
|
|
108
|
+
var list = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat((_typeMap$_this$type6 = typeMap[_this.type]) === null || _typeMap$_this$type6 === void 0 ? void 0 : _typeMap$_this$type6.key)];
|
|
109
|
+
return (list || []).map(function (item) {
|
|
110
|
+
return [item === null || item === void 0 ? void 0 : item.returnWarehouseId, SendDataCenter.getInstance(_this.type).getSendNameByCode(item === null || item === void 0 ? void 0 : item.returnWarehouseName)].join("/");
|
|
111
|
+
}).join(",");
|
|
112
|
+
});
|
|
113
|
+
_defineProperty(this, "editRender", function (p) {
|
|
114
|
+
var _this$componentConfig, _this$componentConfig2, _typeMap$_this$type7;
|
|
115
|
+
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
116
|
+
title: _this.name,
|
|
117
|
+
name: _this.id,
|
|
118
|
+
rules: _this.rules,
|
|
119
|
+
required: false,
|
|
120
|
+
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
121
|
+
display: p === null || p === void 0 ? void 0 : p.display,
|
|
122
|
+
tooltip: (_this$componentConfig = _this.componentConfig) !== null && _this$componentConfig !== void 0 && _this$componentConfig.showTooltip ? (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.tooltip : "",
|
|
123
|
+
component: /*#__PURE__*/React.createElement(JstGoods, _extends({}, _this.componentConfig, {
|
|
124
|
+
type: 5,
|
|
125
|
+
platformType: (_typeMap$_this$type7 = typeMap[_this.type]) === null || _typeMap$_this$type7 === void 0 ? void 0 : _typeMap$_this$type7.platformType,
|
|
126
|
+
onlyShowFieldSelect: _this.componentConfig ? _this.componentConfig.showField === "returnWarehouseName" : false
|
|
127
|
+
}))
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
_defineProperty(this, "filterConfig", function (item) {
|
|
131
|
+
var _typeMap$_this$type8, _typeMap$_this$type9;
|
|
132
|
+
return [{
|
|
133
|
+
searchDefaultConditions: SYMBOL.in,
|
|
134
|
+
type: item.type,
|
|
135
|
+
id: "".concat(item.id, "_").concat((_typeMap$_this$type8 = typeMap[_this.type]) === null || _typeMap$_this$type8 === void 0 ? void 0 : _typeMap$_this$type8.returnWarehouseName),
|
|
136
|
+
name: "".concat(_this.name, "-\u540D\u79F0"),
|
|
137
|
+
filterComponentType: "MultipleSelect",
|
|
138
|
+
props: {
|
|
139
|
+
options: SendDataCenter.getInstance(item.type).getSendData().map(function (item) {
|
|
140
|
+
return {
|
|
141
|
+
label: item.label,
|
|
142
|
+
value: item.label
|
|
143
|
+
};
|
|
144
|
+
})
|
|
145
|
+
},
|
|
146
|
+
filterFn: function filterFn(value) {
|
|
147
|
+
return function (i) {
|
|
148
|
+
var _ref;
|
|
149
|
+
return (_ref = _filterFn.filterTableListItemColumnValue(i, item.id, "returnWarehouseName").split(",") || []) === null || _ref === void 0 ? void 0 : _ref.some(function (item) {
|
|
150
|
+
var _String;
|
|
151
|
+
var returnWarehouseName = item ? (_String = String(item)) === null || _String === void 0 ? void 0 : _String.includes(value) : false;
|
|
152
|
+
return returnWarehouseName;
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
}, {
|
|
157
|
+
searchDefaultConditions: SYMBOL.like,
|
|
158
|
+
type: item.type,
|
|
159
|
+
id: "".concat(item.id, "_").concat((_typeMap$_this$type9 = typeMap[_this.type]) === null || _typeMap$_this$type9 === void 0 ? void 0 : _typeMap$_this$type9.returnWarehouseId),
|
|
160
|
+
name: "".concat(_this.name, "-\u7F16\u7801"),
|
|
161
|
+
filterComponentType: "Input",
|
|
162
|
+
filterFn: function filterFn(value) {
|
|
163
|
+
return function (i) {
|
|
164
|
+
var _ref2, _typeMap$_this$type10;
|
|
165
|
+
return (_ref2 = _filterFn.filterTableListItemColumnValue(i, item.id, (_typeMap$_this$type10 = typeMap[_this.type]) === null || _typeMap$_this$type10 === void 0 ? void 0 : _typeMap$_this$type10.key) || []) === null || _ref2 === void 0 ? void 0 : _ref2.some(function (item) {
|
|
166
|
+
var _String2;
|
|
167
|
+
var id = item !== null && item !== void 0 && item.returnWarehouseId ? (_String2 = String(item === null || item === void 0 ? void 0 : item.returnWarehouseId)) === null || _String2 === void 0 ? void 0 : _String2.includes(value) : false;
|
|
168
|
+
return id;
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
}];
|
|
173
|
+
});
|
|
174
|
+
this.name = _options.name;
|
|
175
|
+
this.id = _options.id;
|
|
176
|
+
this.sortField = "".concat(_options.id, "_").concat((_typeMap$_options$typ = typeMap[_options.type]) === null || _typeMap$_options$typ === void 0 ? void 0 : _typeMap$_options$typ.key);
|
|
177
|
+
this.formField = "".concat(_options.id, "_").concat((_typeMap$_options$typ2 = typeMap[_options.type]) === null || _typeMap$_options$typ2 === void 0 ? void 0 : _typeMap$_options$typ2.key);
|
|
178
|
+
this.componentConfig = _options.componentConfig;
|
|
179
|
+
this.sortChildField = this.getSortChildFields(((_this$componentConfig3 = this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.showField) || "", _options, _options.type);
|
|
180
|
+
this.type = _options.type;
|
|
181
|
+
this.dataType = (_typeMap$_options$typ3 = typeMap[_options.type]) === null || _typeMap$_options$typ3 === void 0 ? void 0 : _typeMap$_options$typ3.dataType;
|
|
182
|
+
this.rules = (_this$componentConfig4 = this.componentConfig) !== null && _this$componentConfig4 !== void 0 && _this$componentConfig4.required ? [{
|
|
183
|
+
required: true,
|
|
184
|
+
validator: function validator(_, value) {
|
|
185
|
+
if (!value || !value.length) {
|
|
186
|
+
var _typeMap$_options$typ4;
|
|
187
|
+
return Promise.reject(new Error((_typeMap$_options$typ4 = typeMap[_options.type]) === null || _typeMap$_options$typ4 === void 0 ? void 0 : _typeMap$_options$typ4.placeholder));
|
|
188
|
+
}
|
|
189
|
+
var hasNo = (value || []).some(function (item) {
|
|
190
|
+
var _this$componentConfig5, _this$componentConfig6;
|
|
191
|
+
if (["returnWarehouseName"].includes((_this === null || _this === void 0 ? void 0 : (_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.showField) || "")) {
|
|
192
|
+
return item.returnWarehouseName;
|
|
193
|
+
} else if (["returnWarehouseId"].includes((_this === null || _this === void 0 ? void 0 : (_this$componentConfig6 = _this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.showField) || "")) {
|
|
194
|
+
return item.returnWarehouseId;
|
|
195
|
+
} else {
|
|
196
|
+
return item.returnWarehouseId && item.returnWarehouseName;
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
if (!hasNo) {
|
|
200
|
+
return Promise.reject(new Error("\u81F3\u5C11\u586B\u5199\u4E00\u4E2A\u5B8C\u6574\u7684\u9000\u8D27\u4ED3\u4FE1\u606F"));
|
|
201
|
+
}
|
|
202
|
+
return Promise.resolve();
|
|
203
|
+
}
|
|
204
|
+
}] : [];
|
|
205
|
+
this.align = "left";
|
|
206
|
+
this.isCombinationComponent = false;
|
|
207
|
+
this.canSort = false;
|
|
208
|
+
this.children = [];
|
|
209
|
+
});
|
|
210
|
+
export default ReturnWarehouse;
|