@kmkf-fe-packages/services-components 2.0.40 → 2.0.42

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.
@@ -17,6 +17,15 @@ import { SYMBOL } from "../../../constant";
17
17
  import { BsGoodsTable } from "../../Common/index";
18
18
  import { BsType, BsMemo, SystemOrderNo } from "../../BS/common/index";
19
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
+ }
20
29
  var typeMap = {
21
30
  GY_REISSUE_GOODS: {
22
31
  key: "gyReissueGoods",
@@ -24,7 +33,22 @@ var typeMap = {
24
33
  typeName: "gyReissueType",
25
34
  remark: "gyReissueType_memo",
26
35
  systemOrderNo: "gySystemOrderNo",
27
- errMsg: "请选择管易补发商品"
36
+ errMsg: "请选择管易补发商品",
37
+ validator: function validator(_rule, value) {
38
+ if (!_rule.required) return Promise.resolve();
39
+ var goodsName = "";
40
+ if (((value === null || value === void 0 ? void 0 : value.gyReissueGoods) || []).some(function (goods) {
41
+ var qty = toNum(goods === null || goods === void 0 ? void 0 : goods.qty);
42
+ var res = typeof qty === "number" ? qty < 1 : true;
43
+ if (res) {
44
+ goodsName = goods !== null && goods !== void 0 && goods.goodName ? "[".concat(goods === null || goods === void 0 ? void 0 : goods.goodName, "]") : "";
45
+ }
46
+ return res;
47
+ })) {
48
+ return Promise.reject("".concat(goodsName, "\u6570\u91CF\u5FC5\u987B\u5927\u4E8E0"));
49
+ }
50
+ return Promise.resolve();
51
+ }
28
52
  }
29
53
  };
30
54
  var GyReissue = /*#__PURE__*/_createClass(function GyReissue(options) {
@@ -33,7 +57,8 @@ var GyReissue = /*#__PURE__*/_createClass(function GyReissue(options) {
33
57
  _typeMap$options$type2,
34
58
  _typeMap$options$type3,
35
59
  _typeMap$options$type4,
36
- _this$componentConfig6;
60
+ _this$componentConfig6,
61
+ _typeMap$options$type7;
37
62
  _classCallCheck(this, GyReissue);
38
63
  _defineProperty(this, "name", void 0);
39
64
  _defineProperty(this, "id", void 0);
@@ -173,8 +198,9 @@ var GyReissue = /*#__PURE__*/_createClass(function GyReissue(options) {
173
198
  }));
174
199
  this.children = [this.bsType, this.systemOrderNo, this.bsMemo, this.reissueGoods];
175
200
  this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
176
- this.rules = this !== null && this !== void 0 && (_this$componentConfig6 = this.componentConfig) !== null && _this$componentConfig6 !== void 0 && _this$componentConfig6.required ? [{
177
- required: true,
201
+ var isRequired = this === null || this === void 0 ? void 0 : (_this$componentConfig6 = this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.required;
202
+ this.rules = [{
203
+ required: isRequired,
178
204
  validator: function validator(_, value) {
179
205
  var _value, _typeMap$options$type5;
180
206
  if (!value || !(value !== null && value !== void 0 && (_value = value["".concat((_typeMap$options$type5 = typeMap[options.type]) === null || _typeMap$options$type5 === void 0 ? void 0 : _typeMap$options$type5.key)]) !== null && _value !== void 0 && _value.length)) {
@@ -183,7 +209,12 @@ var GyReissue = /*#__PURE__*/_createClass(function GyReissue(options) {
183
209
  }
184
210
  return Promise.resolve();
185
211
  }
186
- }] : [];
212
+ }, {
213
+ required: isRequired,
214
+ validator: ((_typeMap$options$type7 = typeMap[options.type]) === null || _typeMap$options$type7 === void 0 ? void 0 : _typeMap$options$type7.validator) || function () {
215
+ return Promise.resolve();
216
+ }
217
+ }];
187
218
  this.dataType = "object";
188
219
  });
189
220
  export default GyReissue;
@@ -17,13 +17,37 @@ import { BsGoodsTable } from "../../Common";
17
17
  import CommonHeaderGoods from "../../CommonHeaderGood";
18
18
  import { GyReturn as Return } from "@kmkf-fe-packages/basic-components";
19
19
  import { BsType, SystemOrderNo } from "../../BS/common/index";
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
+ }
20
29
  var typeMap = {
21
30
  GY_RETURN_GOODS: {
22
31
  key: "gyReturnGoods",
23
32
  name: "管易",
24
33
  typeName: "gyReturnType",
25
34
  systemOrderNo: "gySystemOrderNo",
26
- errMsg: "请选择管易退货商品"
35
+ errMsg: "请选择管易退货商品",
36
+ validator: function validator(_rule, value) {
37
+ if (!_rule.required) return Promise.resolve();
38
+ var goodsName = "";
39
+ if (((value === null || value === void 0 ? void 0 : value.gyReturnGoods) || []).some(function (goods) {
40
+ var qty = toNum(goods === null || goods === void 0 ? void 0 : goods.qty);
41
+ var res = typeof qty === "number" ? qty < 1 : true;
42
+ if (res) {
43
+ goodsName = goods !== null && goods !== void 0 && goods.goodName ? "[".concat(goods === null || goods === void 0 ? void 0 : goods.goodName, "]") : "";
44
+ }
45
+ return res;
46
+ })) {
47
+ return Promise.reject("".concat(goodsName, "\u6570\u91CF\u5FC5\u987B\u5927\u4E8E0"));
48
+ }
49
+ return Promise.resolve();
50
+ }
27
51
  }
28
52
  };
29
53
  var GyReturn = /*#__PURE__*/_createClass(function GyReturn(options) {
@@ -31,7 +55,8 @@ var GyReturn = /*#__PURE__*/_createClass(function GyReturn(options) {
31
55
  _typeMap$options$type,
32
56
  _typeMap$options$type2,
33
57
  _typeMap$options$type3,
34
- _this$componentConfig6;
58
+ _this$componentConfig6,
59
+ _typeMap$options$type6;
35
60
  _classCallCheck(this, GyReturn);
36
61
  _defineProperty(this, "name", void 0);
37
62
  _defineProperty(this, "id", void 0);
@@ -165,8 +190,9 @@ var GyReturn = /*#__PURE__*/_createClass(function GyReturn(options) {
165
190
  }));
166
191
  this.children = [this.gyType, this.systemOrderNo, this.returnGoods];
167
192
  this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
168
- this.rules = this !== null && this !== void 0 && (_this$componentConfig6 = this.componentConfig) !== null && _this$componentConfig6 !== void 0 && _this$componentConfig6.required ? [{
169
- required: true,
193
+ var isRequired = this === null || this === void 0 ? void 0 : (_this$componentConfig6 = this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.required;
194
+ this.rules = [{
195
+ required: isRequired,
170
196
  validator: function validator(_, value) {
171
197
  var _value, _typeMap$options$type4;
172
198
  if (!value || !(value !== null && value !== void 0 && (_value = value["".concat((_typeMap$options$type4 = typeMap[options.type]) === null || _typeMap$options$type4 === void 0 ? void 0 : _typeMap$options$type4.key)]) !== null && _value !== void 0 && _value.length)) {
@@ -175,7 +201,12 @@ var GyReturn = /*#__PURE__*/_createClass(function GyReturn(options) {
175
201
  }
176
202
  return Promise.resolve();
177
203
  }
178
- }] : [];
204
+ }, {
205
+ required: isRequired,
206
+ validator: ((_typeMap$options$type6 = typeMap[options.type]) === null || _typeMap$options$type6 === void 0 ? void 0 : _typeMap$options$type6.validator) || function () {
207
+ return Promise.resolve();
208
+ }
209
+ }];
179
210
  this.dataType = "object";
180
211
  });
181
212
  export default GyReturn;
@@ -1,3 +1,3 @@
1
1
  import { ReissueLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, SubForm, CommonDataTime, TradeId, ShopName, BuyerNick, ReceiverName, ReceiverMobile, ReceiverAddress, TradeDateTime, Logistics, ReturnLogistics, ActualPayment, ERemark, AliPay, ItemSelect, ItemId, ItemEnCode, SystemOrderNo, Ordinary, ThirdItemSelect, FlowStatusSelect, FlowMarkSelect, FlowTag, Payment, TemplateSelect, WorkOrderId, PlatForm, ShopInput, Submitter, PrevSubmitter, FlowCreator, Handler, CompletedUser, LogisticsInterception, LogisticsMoreInterception, LogisticsTrajectory, LogisticsMoreTrajectory, FlowWorkOrderId, BsGoods, BsExchange, BsReissue, BsReturn, BsSystemOrder, BsLogistics, StatusSelect, CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods, BsPosting, MsgStatus, NodeInput, FlowWorkOrderStatus, WdtGoods, WdtReturn, WdtExchange, CommonInput, PaymentVoucherCode, Label, WdtReissue, GyReissue, AfterSalesOrderId, BsE3Goods, PublicGoods, PublicReissueGoods, PublicExchange, GyGoods, BsE3Reissue, MemberLevel, GyReturn } from "./index";
2
2
  import { PickOption } from "./type";
3
- export declare const factory: (type: string, options: PickOption) => GyReissue | GyReturn | LogisticsInterception | LogisticsMoreInterception | MsgStatus | BasicSelect | BasicInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicRadio | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting | SubForm | CommonDataTime | TradeId | ShopName | BuyerNick | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | ReissueLogistics | JstItemSelect | JstSendGood | JstSupply | BsSystemOrder | BsGoods | BsE3Goods | PublicGoods | PublicReissueGoods | PublicExchange | BsE3Reissue | BsExchange | BsReissue | BsReturn | BsLogistics | FlowStatusSelect | FlowMarkSelect | FlowTag | TemplateSelect | WorkOrderId | LogisticsTrajectory | LogisticsMoreTrajectory | PlatForm | ShopInput | Submitter | PrevSubmitter | FlowCreator | Handler | CompletedUser | FlowWorkOrderId | StatusSelect | Calculation | CommonSystemOrder | CommonMultiStatus | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | BsPosting | NodeInput | FlowWorkOrderStatus | WdtGoods | WdtReissue | WdtReturn | WdtExchange | CommonInput | PaymentVoucherCode | Label | MemberLevel | AfterSalesOrderId | GyGoods;
3
+ export declare const factory: (type: string, options: PickOption) => StatusSelect | BasicInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting | SubForm | CommonDataTime | TradeId | ShopName | BuyerNick | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | ReissueLogistics | JstItemSelect | JstSendGood | JstSupply | BsSystemOrder | BsGoods | BsE3Goods | PublicGoods | PublicReissueGoods | PublicExchange | BsE3Reissue | BsExchange | BsReissue | BsReturn | BsLogistics | FlowStatusSelect | FlowMarkSelect | FlowTag | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsMoreInterception | LogisticsTrajectory | LogisticsMoreTrajectory | PlatForm | ShopInput | Submitter | PrevSubmitter | FlowCreator | Handler | CompletedUser | FlowWorkOrderId | Calculation | CommonSystemOrder | CommonMultiStatus | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | BsPosting | NodeInput | FlowWorkOrderStatus | MsgStatus | WdtGoods | WdtReissue | WdtReturn | WdtExchange | CommonInput | PaymentVoucherCode | Label | MemberLevel | AfterSalesOrderId | GyGoods | GyReissue | GyReturn;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "2.0.40",
3
+ "version": "2.0.42",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -21,8 +21,8 @@
21
21
  ]
22
22
  },
23
23
  "dependencies": {
24
- "@kmkf-fe-packages/basic-components": "2.0.39",
25
- "@kmkf-fe-packages/kmkf-utils": "2.0.39",
24
+ "@kmkf-fe-packages/basic-components": "2.0.42",
25
+ "@kmkf-fe-packages/kmkf-utils": "2.0.42",
26
26
  "b64-to-blob": "^1.2.19",
27
27
  "html2canvas": "^1.4.1",
28
28
  "react-pdf-js": "^5.1.0"
@@ -41,7 +41,7 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "ab72ad58ac742ad06f1f265eb631fd20634a9f28",
44
+ "gitHead": "fa256bbf3b073a798c5d523e27d7205c1bd197e6",
45
45
  "gitHooks": {
46
46
  "pre-commit": "lint-staged"
47
47
  }