@kmkf-fe-packages/services-components 2.0.15 → 2.0.17
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/commonComponents/GlobalContext/orderQuery/useGetErpSendData.js +10 -9
- package/dist/esm/components/BS/BsSystemOrder/index.js +3 -2
- package/dist/esm/components/BS/common/BsHeaderChild.d.ts +3 -2
- package/dist/esm/components/BS/common/BsHeaderChild.js +6 -2
- 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/Common/constants/columnsBaseInfoMap.js +5 -2
- package/dist/esm/components/Common/index.js +6 -4
- package/dist/esm/components/CommonHeaderGood/index.js +225 -4
- package/dist/esm/components/CommonSystemOrder/index.js +7 -0
- package/dist/esm/components/CommonTradeId/index.js +3 -0
- package/dist/esm/components/JST/JstSendGood/index.js +4 -4
- package/dist/esm/components/MsgStatus/index.js +1 -1
- package/dist/esm/components/Public/Exchange/index.d.ts +42 -0
- package/dist/esm/components/Public/Exchange/index.js +173 -0
- package/dist/esm/components/Public/Goods/index.d.ts +38 -0
- package/dist/esm/components/Public/Goods/index.js +132 -0
- package/dist/esm/components/Public/ReissueGoods/index.d.ts +60 -0
- package/dist/esm/components/Public/ReissueGoods/index.js +281 -0
- package/dist/esm/components/Public/SystemOrderType/index.d.ts +26 -0
- package/dist/esm/components/Public/SystemOrderType/index.js +95 -0
- package/dist/esm/components/StatusSelect/index.js +4 -0
- package/dist/esm/factory.d.ts +2 -2
- package/dist/esm/factory.js +12 -1
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/type.d.ts +1 -1
- package/package.json +4 -4
- package/dist/esm/commonComponents/GlobalContext/hook/dist/useGetHasErpData.js +0 -52
- package/dist/esm/commonComponents/GlobalContext/orderQuery/dist/useGetErpAddressData.js +0 -180
- package/dist/esm/commonComponents/GlobalContext/orderQuery/dist/useGetErpLogisticsCompany.js +0 -186
- package/dist/esm/components/BS/BsGoods/dist/index.js +0 -113
- package/dist/esm/components/Common/dist/index.js +0 -1019
|
@@ -0,0 +1,173 @@
|
|
|
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; }
|
|
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); }
|
|
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); } }
|
|
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; }
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
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
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
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 "react";
|
|
12
|
+
import GetFormItem from "../../GetFormItem";
|
|
13
|
+
import { BsGoodsTable } from "../../Common";
|
|
14
|
+
import ItemView from "../../../commonComponents/ItemView";
|
|
15
|
+
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
16
|
+
import { SYMBOL } from "../../../constant";
|
|
17
|
+
// import { BsType, BsMemo } from "../../Bs/common";
|
|
18
|
+
import { CommonExchangeGoods } from "@kmkf-fe-packages/basic-components";
|
|
19
|
+
import CommonHeaderGoods from "../../CommonHeaderGood";
|
|
20
|
+
function toNum(value) {
|
|
21
|
+
if (typeof value === "string") {
|
|
22
|
+
return value ? +value : void 0;
|
|
23
|
+
}
|
|
24
|
+
if (typeof value === "number") {
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
return void 0;
|
|
28
|
+
}
|
|
29
|
+
var CONF_MAP = {
|
|
30
|
+
JST_EXCHANGE_GOODS: {
|
|
31
|
+
goodsKey: 'jstExchangeGoods',
|
|
32
|
+
validator: function validator(_rule, value) {
|
|
33
|
+
if (!_rule.required) return Promise.resolve();
|
|
34
|
+
var goodsName = "";
|
|
35
|
+
if (((value === null || value === void 0 ? void 0 : value.jstExchangeGoods) || []).some(function (goods) {
|
|
36
|
+
var qty = toNum(goods === null || goods === void 0 ? void 0 : goods.qty);
|
|
37
|
+
var res = typeof qty === "number" ? qty < 1 : true;
|
|
38
|
+
if (res) {
|
|
39
|
+
goodsName = goods !== null && goods !== void 0 && goods.name ? "[".concat(goods === null || goods === void 0 ? void 0 : goods.name, "]") : '';
|
|
40
|
+
}
|
|
41
|
+
return res;
|
|
42
|
+
})) {
|
|
43
|
+
return Promise.reject("".concat(goodsName, "\u6570\u91CF\u5FC5\u987B\u5927\u4E8E0"));
|
|
44
|
+
}
|
|
45
|
+
if (((value === null || value === void 0 ? void 0 : value.jstExchangeGoods) || []).some(function (goods) {
|
|
46
|
+
var v = toNum(goods === null || goods === void 0 ? void 0 : goods.salePrice);
|
|
47
|
+
var res = typeof v === "number" ? v < 0 : true;
|
|
48
|
+
if (res) {
|
|
49
|
+
goodsName = goods !== null && goods !== void 0 && goods.name ? "[".concat(goods === null || goods === void 0 ? void 0 : goods.name, "]") : '';
|
|
50
|
+
}
|
|
51
|
+
return res;
|
|
52
|
+
})) {
|
|
53
|
+
return Promise.reject("".concat(goodsName, "\u5355\u4EF7\u4E3A\u5927\u4E8E\u7B49\u4E8E0\u7684\u6570"));
|
|
54
|
+
}
|
|
55
|
+
return Promise.resolve();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
var Exchange = /*#__PURE__*/_createClass(function Exchange(options) {
|
|
60
|
+
var _this = this,
|
|
61
|
+
_options$effects,
|
|
62
|
+
_this$componentConfig6,
|
|
63
|
+
_this$componentConfig8;
|
|
64
|
+
_classCallCheck(this, Exchange);
|
|
65
|
+
_defineProperty(this, "name", void 0);
|
|
66
|
+
_defineProperty(this, "id", void 0);
|
|
67
|
+
_defineProperty(this, "sortField", void 0);
|
|
68
|
+
_defineProperty(this, "type", void 0);
|
|
69
|
+
_defineProperty(this, "rules", void 0);
|
|
70
|
+
_defineProperty(this, "componentConfig", void 0);
|
|
71
|
+
_defineProperty(this, "effects", void 0);
|
|
72
|
+
_defineProperty(this, "isCombinationComponent", void 0);
|
|
73
|
+
_defineProperty(this, "formField", void 0);
|
|
74
|
+
_defineProperty(this, "canSort", void 0);
|
|
75
|
+
_defineProperty(this, "children", void 0);
|
|
76
|
+
_defineProperty(this, "dataType", void 0);
|
|
77
|
+
_defineProperty(this, "returnGoods", void 0);
|
|
78
|
+
_defineProperty(this, "config", void 0);
|
|
79
|
+
_defineProperty(this, "form", void 0);
|
|
80
|
+
_defineProperty(this, "renderClient", function (record) {
|
|
81
|
+
var _this$componentConfig;
|
|
82
|
+
var exchangeGoods = JSON.parse((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(_this.config.goodsKey)]) || "[]");
|
|
83
|
+
return !isNull(record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ItemView, {
|
|
84
|
+
id: "".concat(_this.id, "-out"),
|
|
85
|
+
label: "".concat(_this.name, "-\u6362\u51FA"),
|
|
86
|
+
value: /*#__PURE__*/React.createElement(BsGoodsTable, {
|
|
87
|
+
type: _this.type,
|
|
88
|
+
list: exchangeGoods || [],
|
|
89
|
+
showHeader: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.showHeader) || []
|
|
90
|
+
})
|
|
91
|
+
})) : null;
|
|
92
|
+
});
|
|
93
|
+
_defineProperty(this, "renderPc", function () {
|
|
94
|
+
return null;
|
|
95
|
+
});
|
|
96
|
+
_defineProperty(this, "renderLog", function (r) {
|
|
97
|
+
var _r, _this$componentConfig2;
|
|
98
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, r !== null && r !== void 0 && (_r = r["".concat(_this.id, "_").concat(_this.config.goodsKey)]) !== null && _r !== void 0 && _r.length ? /*#__PURE__*/React.createElement("div", null, "\u6362\u51FA\u5546\u54C1\uFF1A", /*#__PURE__*/React.createElement(BsGoodsTable, {
|
|
99
|
+
type: _this.type,
|
|
100
|
+
list: (r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat(_this.config.goodsKey)]) || [],
|
|
101
|
+
showHeader: ((_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.showHeader) || []
|
|
102
|
+
})) : null, r !== null && r !== void 0 && r["".concat(_this.id, "_shopCode")] ? /*#__PURE__*/React.createElement("div", null, "\u5E97\u94FAid:", r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_shopCode")]) : null);
|
|
103
|
+
});
|
|
104
|
+
_defineProperty(this, "getComponentValue", function (r) {
|
|
105
|
+
return _defineProperty({}, _this.config.goodsKey, r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat(_this.config.goodsKey)]);
|
|
106
|
+
});
|
|
107
|
+
_defineProperty(this, "renderExport", function (value, record) {
|
|
108
|
+
return null;
|
|
109
|
+
});
|
|
110
|
+
_defineProperty(this, "editRender", function (p) {
|
|
111
|
+
var _this$componentConfig3, _this$componentConfig4, _this$componentConfig5, _this$effects, _this$effects2, _this$effects3;
|
|
112
|
+
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
113
|
+
title: _this.name,
|
|
114
|
+
name: _this.id,
|
|
115
|
+
rules: _this.rules,
|
|
116
|
+
required: false,
|
|
117
|
+
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
118
|
+
display: p === null || p === void 0 ? void 0 : p.display,
|
|
119
|
+
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 : '',
|
|
120
|
+
component: /*#__PURE__*/React.createElement(CommonExchangeGoods, _extends({}, _this.componentConfig, {
|
|
121
|
+
maxLength: ((_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.maxLength) || 20,
|
|
122
|
+
shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
|
|
123
|
+
shopList: ((_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopList) || [],
|
|
124
|
+
companyKey: (_this$effects3 = _this.effects) === null || _this$effects3 === void 0 ? void 0 : _this$effects3.companyKey,
|
|
125
|
+
width: "90%",
|
|
126
|
+
type: _this.type,
|
|
127
|
+
form: _this.form
|
|
128
|
+
}))
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
_defineProperty(this, "filterConfig", function (item) {
|
|
132
|
+
return [{
|
|
133
|
+
searchDefaultConditions: SYMBOL.like,
|
|
134
|
+
type: item.type,
|
|
135
|
+
id: "".concat(item.id, "_").concat(_this.config.goodsKey),
|
|
136
|
+
name: "".concat(_this.name, "-\u6362\u51FA"),
|
|
137
|
+
filterComponentType: "Input"
|
|
138
|
+
}];
|
|
139
|
+
});
|
|
140
|
+
this.name = options.name;
|
|
141
|
+
this.id = options.id;
|
|
142
|
+
this.sortField = "".concat(options.id);
|
|
143
|
+
this.formField = "".concat(options.id);
|
|
144
|
+
this.type = options.type;
|
|
145
|
+
this.config = CONF_MAP[this.type];
|
|
146
|
+
this.effects = options === null || options === void 0 ? void 0 : options.effects;
|
|
147
|
+
this.isCombinationComponent = true;
|
|
148
|
+
this.canSort = false;
|
|
149
|
+
this.form = (_options$effects = options.effects) === null || _options$effects === void 0 ? void 0 : _options$effects.form;
|
|
150
|
+
this.returnGoods = new CommonHeaderGoods(_objectSpread(_objectSpread({}, options), {}, {
|
|
151
|
+
id: "".concat(options.id, "_").concat(this.config.goodsKey),
|
|
152
|
+
name: "商品信息"
|
|
153
|
+
}));
|
|
154
|
+
this.children = [this.returnGoods];
|
|
155
|
+
this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
|
|
156
|
+
this.rules = [{
|
|
157
|
+
required: (_this$componentConfig6 = this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.required,
|
|
158
|
+
validator: function validator(_, value) {
|
|
159
|
+
var _this$componentConfig7, _value$_this$config$g;
|
|
160
|
+
if ((_this$componentConfig7 = _this.componentConfig) !== null && _this$componentConfig7 !== void 0 && _this$componentConfig7.required && !(value !== null && value !== void 0 && (_value$_this$config$g = value[_this.config.goodsKey]) !== null && _value$_this$config$g !== void 0 && _value$_this$config$g.length)) {
|
|
161
|
+
return Promise.reject(new Error("请选择换货商品"));
|
|
162
|
+
}
|
|
163
|
+
return Promise.resolve();
|
|
164
|
+
}
|
|
165
|
+
}, {
|
|
166
|
+
required: (_this$componentConfig8 = this.componentConfig) === null || _this$componentConfig8 === void 0 ? void 0 : _this$componentConfig8.required,
|
|
167
|
+
validator: this.config.validator || function () {
|
|
168
|
+
return Promise.resolve();
|
|
169
|
+
}
|
|
170
|
+
}];
|
|
171
|
+
this.dataType = "object";
|
|
172
|
+
});
|
|
173
|
+
export default Exchange;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../../type";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import CommonHeaderGoods from "../../CommonHeaderGood";
|
|
4
|
+
declare const CONFIG_MAP: {
|
|
5
|
+
JST_GOODS: {
|
|
6
|
+
key: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
declare class PublicGoods implements ComponentInterface {
|
|
10
|
+
name: string;
|
|
11
|
+
id: string;
|
|
12
|
+
sortField: string;
|
|
13
|
+
type: keyof typeof CONFIG_MAP;
|
|
14
|
+
rules: any[];
|
|
15
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
16
|
+
effects: ComponentInterface["effects"];
|
|
17
|
+
isCombinationComponent: boolean;
|
|
18
|
+
formField: string;
|
|
19
|
+
canSort: boolean;
|
|
20
|
+
children: ComponentInterface[];
|
|
21
|
+
dataType: ComponentInterface["dataType"];
|
|
22
|
+
headers: CommonHeaderGoods;
|
|
23
|
+
constructor(options: PickOption);
|
|
24
|
+
renderClient: (record: any) => React.JSX.Element | null;
|
|
25
|
+
renderPc: () => null;
|
|
26
|
+
renderLog: (r: Record) => React.JSX.Element | null;
|
|
27
|
+
getComponentValue: (r: Record) => any;
|
|
28
|
+
renderExport: () => null;
|
|
29
|
+
editRender: (p: any) => React.JSX.Element;
|
|
30
|
+
filterConfig: (item: ColumnConfig) => {
|
|
31
|
+
searchDefaultConditions: "like";
|
|
32
|
+
type: string;
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
filterComponentType: "Input";
|
|
36
|
+
}[];
|
|
37
|
+
}
|
|
38
|
+
export default PublicGoods;
|
|
@@ -0,0 +1,132 @@
|
|
|
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; }
|
|
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); }
|
|
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); } }
|
|
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; }
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
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
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
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 "react";
|
|
12
|
+
import GetFormItem from "../../GetFormItem";
|
|
13
|
+
import { BsGoodsTable } from "../../Common";
|
|
14
|
+
import CommonHeaderGoods from "../../CommonHeaderGood";
|
|
15
|
+
import ItemView from "../../../commonComponents/ItemView";
|
|
16
|
+
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
17
|
+
import { CommonGoods as Goods } from "@kmkf-fe-packages/basic-components";
|
|
18
|
+
import { SYMBOL } from "../../../constant";
|
|
19
|
+
var CONFIG_MAP = {
|
|
20
|
+
JST_GOODS: {
|
|
21
|
+
key: 'jstGoods'
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
var PublicGoods = /*#__PURE__*/_createClass(function PublicGoods(options) {
|
|
25
|
+
var _this = this,
|
|
26
|
+
_CONFIG_MAP$this$type,
|
|
27
|
+
_this$componentConfig6;
|
|
28
|
+
_classCallCheck(this, PublicGoods);
|
|
29
|
+
_defineProperty(this, "name", void 0);
|
|
30
|
+
_defineProperty(this, "id", void 0);
|
|
31
|
+
_defineProperty(this, "sortField", void 0);
|
|
32
|
+
_defineProperty(this, "type", void 0);
|
|
33
|
+
_defineProperty(this, "rules", void 0);
|
|
34
|
+
_defineProperty(this, "componentConfig", void 0);
|
|
35
|
+
_defineProperty(this, "effects", void 0);
|
|
36
|
+
_defineProperty(this, "isCombinationComponent", void 0);
|
|
37
|
+
_defineProperty(this, "formField", void 0);
|
|
38
|
+
_defineProperty(this, "canSort", void 0);
|
|
39
|
+
_defineProperty(this, "children", void 0);
|
|
40
|
+
_defineProperty(this, "dataType", void 0);
|
|
41
|
+
_defineProperty(this, "headers", void 0);
|
|
42
|
+
_defineProperty(this, "renderClient", function (record) {
|
|
43
|
+
var _record, _CONFIG_MAP$_this$typ, _this$componentConfig;
|
|
44
|
+
return !isNull(record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ItemView, {
|
|
45
|
+
id: _this.id,
|
|
46
|
+
label: _this.name,
|
|
47
|
+
value: /*#__PURE__*/React.createElement(BsGoodsTable, {
|
|
48
|
+
type: _this.type,
|
|
49
|
+
list: (record === null || record === void 0 ? void 0 : (_record = record["".concat(_this.id)]) === null || _record === void 0 ? void 0 : _record[(_CONFIG_MAP$_this$typ = CONFIG_MAP[_this.type]) === null || _CONFIG_MAP$_this$typ === void 0 ? void 0 : _CONFIG_MAP$_this$typ.key]) || [],
|
|
50
|
+
showHeader: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.showHeader) || []
|
|
51
|
+
})
|
|
52
|
+
})) : null;
|
|
53
|
+
});
|
|
54
|
+
_defineProperty(this, "renderPc", function () {
|
|
55
|
+
return null;
|
|
56
|
+
});
|
|
57
|
+
_defineProperty(this, "renderLog", function (r) {
|
|
58
|
+
var _CONFIG_MAP$_this$typ2, _CONFIG_MAP$_this$typ3, _this$componentConfig2;
|
|
59
|
+
if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_CONFIG_MAP$_this$typ2 = CONFIG_MAP[_this.type]) === null || _CONFIG_MAP$_this$typ2 === void 0 ? void 0 : _CONFIG_MAP$_this$typ2.key)])) return null;
|
|
60
|
+
return /*#__PURE__*/React.createElement(BsGoodsTable, {
|
|
61
|
+
type: _this.type,
|
|
62
|
+
list: (r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_CONFIG_MAP$_this$typ3 = CONFIG_MAP[_this.type]) === null || _CONFIG_MAP$_this$typ3 === void 0 ? void 0 : _CONFIG_MAP$_this$typ3.key)]) || [],
|
|
63
|
+
showHeader: ((_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.showHeader) || []
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
_defineProperty(this, "getComponentValue", function (r) {
|
|
67
|
+
var _CONFIG_MAP$_this$typ4;
|
|
68
|
+
return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_CONFIG_MAP$_this$typ4 = CONFIG_MAP[_this.type]) === null || _CONFIG_MAP$_this$typ4 === void 0 ? void 0 : _CONFIG_MAP$_this$typ4.key)];
|
|
69
|
+
});
|
|
70
|
+
_defineProperty(this, "renderExport", function () {
|
|
71
|
+
return null;
|
|
72
|
+
});
|
|
73
|
+
_defineProperty(this, "editRender", function (p) {
|
|
74
|
+
var _this$componentConfig3, _this$componentConfig4, _this$componentConfig5, _this$effects, _this$effects2, _this$effects3;
|
|
75
|
+
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
76
|
+
title: _this.name,
|
|
77
|
+
name: _this.id,
|
|
78
|
+
rules: _this.rules,
|
|
79
|
+
required: false,
|
|
80
|
+
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
81
|
+
display: p === null || p === void 0 ? void 0 : p.display,
|
|
82
|
+
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 : "",
|
|
83
|
+
component: /*#__PURE__*/React.createElement(Goods, _extends({}, _this.componentConfig, {
|
|
84
|
+
maxLength: ((_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.maxLength) || 20,
|
|
85
|
+
shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
|
|
86
|
+
shopList: ((_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopList) || [],
|
|
87
|
+
companyKey: (_this$effects3 = _this.effects) === null || _this$effects3 === void 0 ? void 0 : _this$effects3.companyKey,
|
|
88
|
+
type: _this.type,
|
|
89
|
+
width: "90%"
|
|
90
|
+
}))
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
_defineProperty(this, "filterConfig", function (item) {
|
|
94
|
+
var _CONFIG_MAP$_this$typ5;
|
|
95
|
+
return [{
|
|
96
|
+
searchDefaultConditions: SYMBOL.like,
|
|
97
|
+
type: item.type,
|
|
98
|
+
id: "".concat(item.id, "_").concat((_CONFIG_MAP$_this$typ5 = CONFIG_MAP[_this.type]) === null || _CONFIG_MAP$_this$typ5 === void 0 ? void 0 : _CONFIG_MAP$_this$typ5.key),
|
|
99
|
+
// 过滤组件id
|
|
100
|
+
name: item.name,
|
|
101
|
+
// 过滤组件名称
|
|
102
|
+
filterComponentType: "Input"
|
|
103
|
+
}];
|
|
104
|
+
});
|
|
105
|
+
this.type = options.type;
|
|
106
|
+
var key = (_CONFIG_MAP$this$type = CONFIG_MAP[this.type]) === null || _CONFIG_MAP$this$type === void 0 ? void 0 : _CONFIG_MAP$this$type.key;
|
|
107
|
+
this.name = options.name;
|
|
108
|
+
this.id = options.id;
|
|
109
|
+
this.sortField = "".concat(options.id, "_").concat(key);
|
|
110
|
+
this.formField = "".concat(options.id, "_").concat(key);
|
|
111
|
+
this.effects = options === null || options === void 0 ? void 0 : options.effects;
|
|
112
|
+
this.isCombinationComponent = true;
|
|
113
|
+
this.canSort = false;
|
|
114
|
+
this.headers = new CommonHeaderGoods(_objectSpread(_objectSpread({}, options), {}, {
|
|
115
|
+
id: "".concat(options.id, "_").concat(key),
|
|
116
|
+
name: "商品信息"
|
|
117
|
+
}));
|
|
118
|
+
this.children = [this.headers];
|
|
119
|
+
this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
|
|
120
|
+
this.rules = this !== null && this !== void 0 && (_this$componentConfig6 = this.componentConfig) !== null && _this$componentConfig6 !== void 0 && _this$componentConfig6.required ? [{
|
|
121
|
+
required: true,
|
|
122
|
+
validator: function validator(_, value) {
|
|
123
|
+
var _value$key;
|
|
124
|
+
if (!value || !(value !== null && value !== void 0 && (_value$key = value[key]) !== null && _value$key !== void 0 && _value$key.length)) {
|
|
125
|
+
return Promise.reject(new Error("请选择聚水潭商品"));
|
|
126
|
+
}
|
|
127
|
+
return Promise.resolve();
|
|
128
|
+
}
|
|
129
|
+
}] : [];
|
|
130
|
+
this.dataType = "object";
|
|
131
|
+
});
|
|
132
|
+
export default PublicGoods;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../../type";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { BsType, BsMemo, BsHeaderGood, SystemOrderNo } from "../../BS/common/index";
|
|
4
|
+
import SystemOrderType from '../SystemOrderType';
|
|
5
|
+
import CommonHeaderGoods from "../../CommonHeaderGood";
|
|
6
|
+
declare class PublicReissue implements ComponentInterface {
|
|
7
|
+
name: string;
|
|
8
|
+
id: string;
|
|
9
|
+
sortField: string;
|
|
10
|
+
type: string;
|
|
11
|
+
rules: any[];
|
|
12
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
13
|
+
effects: ComponentInterface["effects"];
|
|
14
|
+
isCombinationComponent: boolean;
|
|
15
|
+
formField: string;
|
|
16
|
+
canSort: boolean;
|
|
17
|
+
children: ComponentInterface[];
|
|
18
|
+
dataType: ComponentInterface["dataType"];
|
|
19
|
+
bsType: BsType;
|
|
20
|
+
bsMemo: BsMemo;
|
|
21
|
+
systemOrderNo: SystemOrderNo;
|
|
22
|
+
systemOrderType: SystemOrderType;
|
|
23
|
+
goods: BsHeaderGood | CommonHeaderGoods;
|
|
24
|
+
constructor(options: PickOption);
|
|
25
|
+
renderClient: (record: any) => React.JSX.Element | null;
|
|
26
|
+
renderPc: () => null;
|
|
27
|
+
renderLog: (r: Record) => React.JSX.Element;
|
|
28
|
+
getComponentValue: (r: Record) => {
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
};
|
|
31
|
+
renderExport: () => null;
|
|
32
|
+
editRender: (p: any) => React.JSX.Element;
|
|
33
|
+
filterConfig: (item: ColumnConfig) => ({
|
|
34
|
+
searchDefaultConditions: "in";
|
|
35
|
+
type: string;
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
filterComponentType: "Cascader";
|
|
39
|
+
props: {
|
|
40
|
+
options: any[] | undefined;
|
|
41
|
+
fieldNames: {
|
|
42
|
+
label: string;
|
|
43
|
+
value: string;
|
|
44
|
+
children: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
formatFilterValue: (val: Array<string>) => string[] | undefined;
|
|
48
|
+
filterFn: (value: string) => (i: Record) => boolean;
|
|
49
|
+
} | {
|
|
50
|
+
searchDefaultConditions: "like";
|
|
51
|
+
type: string;
|
|
52
|
+
id: string;
|
|
53
|
+
name: string;
|
|
54
|
+
filterComponentType: "Input";
|
|
55
|
+
props?: undefined;
|
|
56
|
+
formatFilterValue?: undefined;
|
|
57
|
+
filterFn?: undefined;
|
|
58
|
+
})[];
|
|
59
|
+
}
|
|
60
|
+
export default PublicReissue;
|