kts-component-invoice-operate 3.2.35 → 3.2.36

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/index.esm.js CHANGED
@@ -1695,10 +1695,12 @@ var validateFields = function validateFields(form) {
1695
1695
  function getGoodsSearch(goodsList, search, isTaxIncluded) {
1696
1696
  if (!search) return goodsList;
1697
1697
  return goodsList.filter(function (e) {
1698
- var _e$itemName$indexOf, _e$itemName, _e$itemModelName$inde, _e$itemModelName, _e$lineAmountIncludeT, _e$lineAmountExcludeT;
1698
+ var _e$itemName$indexOf, _e$itemName, _e$itemCode$indexOf, _e$itemCode, _e$itemModelName$inde, _e$itemModelName, _e$lineAmountIncludeT, _e$lineAmountExcludeT;
1699
1699
 
1700
1700
  if (((_e$itemName$indexOf = (_e$itemName = e.itemName) === null || _e$itemName === void 0 ? void 0 : _e$itemName.indexOf(search)) !== null && _e$itemName$indexOf !== void 0 ? _e$itemName$indexOf : -1) >= 0) {
1701
1701
  return true;
1702
+ } else if (((_e$itemCode$indexOf = (_e$itemCode = e.itemCode) === null || _e$itemCode === void 0 ? void 0 : _e$itemCode.indexOf(search)) !== null && _e$itemCode$indexOf !== void 0 ? _e$itemCode$indexOf : -1) >= 0) {
1703
+ return true;
1702
1704
  } else if (((_e$itemModelName$inde = (_e$itemModelName = e.itemModelName) === null || _e$itemModelName === void 0 ? void 0 : _e$itemModelName.indexOf(search)) !== null && _e$itemModelName$inde !== void 0 ? _e$itemModelName$inde : -1) >= 0) {
1703
1705
  return true;
1704
1706
  } else if ("".concat(isTaxIncluded ? (_e$lineAmountIncludeT = e.lineAmountIncludeTax) === null || _e$lineAmountIncludeT === void 0 ? void 0 : _e$lineAmountIncludeT.toFixed(2) : (_e$lineAmountExcludeT = e.lineAmountExcludeTax) === null || _e$lineAmountExcludeT === void 0 ? void 0 : _e$lineAmountExcludeT.toFixed(2)).indexOf(search) >= 0) {
@@ -9999,6 +10001,9 @@ function Search() {
9999
10001
  var readOnly = controller.useMemo(function (s) {
10000
10002
  return !!s.goodsListState.editGood;
10001
10003
  }, []);
10004
+ var columnshide = controller.useMemo(function (s) {
10005
+ return s.goodsListState.columnshide;
10006
+ }, []);
10002
10007
  /** 是否含税 */
10003
10008
 
10004
10009
  var isTaxIncluded = controller.useMemo(function (s) {
@@ -10062,7 +10067,7 @@ function Search() {
10062
10067
  readOnly: readOnly,
10063
10068
  value: value,
10064
10069
  className: "kts-invoice-operate-goods-list-search",
10065
- placeholder: "\u8BF7\u60A8\u8F93\u5165\u9879\u76EE\u540D\u79F0\u3001\u89C4\u683C\u578B\u53F7\u3001\u91D1\u989D(".concat(isTaxIncluded ? '含税' : '不含税', ")\u641C\u7D22"),
10070
+ placeholder: "\u8BF7\u60A8\u8F93\u5165".concat(columnshide.includes('itemCode') ? '' : '商品编码、', "\u9879\u76EE\u540D\u79F0\u3001\u89C4\u683C\u578B\u53F7\u3001\u91D1\u989D(").concat(isTaxIncluded ? '含税' : '不含税', ")\u641C\u7D22"),
10066
10071
  prefix: React.createElement(Icon$1, {
10067
10072
  component: SvgMagnifier,
10068
10073
  style: {
@@ -12384,7 +12389,11 @@ var useColumns = (function (form) {
12384
12389
  render: function render(_, record) {
12385
12390
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
12386
12391
  return React.createElement(Form.Item, null, getFieldDecorator('itemCode', {
12387
- initialValue: editGood.itemCode
12392
+ initialValue: editGood.itemCode,
12393
+ rules: [].concat(_toConsumableArray(getReplenishRules('itemCode')), [{
12394
+ pattern: /^.{1,19}$/,
12395
+ message: '商品编码长度不能超过19位'
12396
+ }])
12388
12397
  })(React.createElement(ItemCodeInput, {
12389
12398
  record: record,
12390
12399
  onChange: function () {
@@ -12416,7 +12425,11 @@ var useColumns = (function (form) {
12416
12425
  }()
12417
12426
  })));
12418
12427
  } else {
12419
- return record.itemCode;
12428
+ return React.createElement("span", {
12429
+ style: {
12430
+ padding: '0 10px'
12431
+ }
12432
+ }, record.itemCode);
12420
12433
  }
12421
12434
  }
12422
12435
  }, {
@@ -21214,6 +21227,7 @@ var DrawerBody$2 = function DrawerBody() {
21214
21227
 
21215
21228
  between = _objectSpread2({}, record);
21216
21229
  between.itemName = getItemName(record, s.goodsListState.editGood);
21230
+ between.itemCode = getItemCode(record, s.goodsListState.editGood);
21217
21231
  between.itemNameOther = getItemNameOther(record, s.goodsListState.editGood); // 设置编辑货物
21218
21232
 
21219
21233
  editGood = s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), between);
@@ -21249,22 +21263,22 @@ var DrawerBody$2 = function DrawerBody() {
21249
21263
  s.goodsListState.importGoods.isVisibleDrawer = false;
21250
21264
 
21251
21265
  if (!s.goodsListState.isTaxIncluded) {
21252
- _context2.next = 25;
21266
+ _context2.next = 26;
21253
21267
  break;
21254
21268
  }
21255
21269
 
21256
- _context2.next = 23;
21270
+ _context2.next = 24;
21257
21271
  return updateUnitPriceExcludingTax(controller, s.goodsListState.form, record);
21258
21272
 
21259
- case 23:
21260
- _context2.next = 27;
21273
+ case 24:
21274
+ _context2.next = 28;
21261
21275
  break;
21262
21276
 
21263
- case 25:
21264
- _context2.next = 27;
21277
+ case 26:
21278
+ _context2.next = 28;
21265
21279
  return updateUnitPriceTax(controller, s.goodsListState.form, record);
21266
21280
 
21267
- case 27:
21281
+ case 28:
21268
21282
  case "end":
21269
21283
  return _context2.stop();
21270
21284
  }
@@ -21320,6 +21334,20 @@ var getItemNameOther = function getItemNameOther(record, editGood) {
21320
21334
  // return `*${shorthand}*${record.itemNameSelf}`;
21321
21335
  // }
21322
21336
  return record.itemName;
21337
+ }; // 获取商品编号
21338
+
21339
+
21340
+ var getItemCode = function getItemCode(record, editGood) {
21341
+ // let shorthand;
21342
+ // shorthand = record.shorthand;
21343
+ // if (shorthand) {
21344
+ // return `*${shorthand}*${record.itemName}`;
21345
+ // }
21346
+ // shorthand = getSN(editGood.itemName)?.shorthand;
21347
+ // if (shorthand) {
21348
+ // return `*${shorthand}*${record.itemNameSelf}`;
21349
+ // }
21350
+ return record.productCode;
21323
21351
  };
21324
21352
 
21325
21353
  var css_248z$q = ".kts-invoice-operate-goods-endow-code-button-list {\n display: flex;\n flex-direction: column;\n}\n.kts-invoice-operate-goods-endow-code-button-list > button {\n margin-bottom: 10px;\n}\n";
package/dist/index.js CHANGED
@@ -1705,10 +1705,12 @@ var validateFields = function validateFields(form) {
1705
1705
  function getGoodsSearch(goodsList, search, isTaxIncluded) {
1706
1706
  if (!search) return goodsList;
1707
1707
  return goodsList.filter(function (e) {
1708
- var _e$itemName$indexOf, _e$itemName, _e$itemModelName$inde, _e$itemModelName, _e$lineAmountIncludeT, _e$lineAmountExcludeT;
1708
+ var _e$itemName$indexOf, _e$itemName, _e$itemCode$indexOf, _e$itemCode, _e$itemModelName$inde, _e$itemModelName, _e$lineAmountIncludeT, _e$lineAmountExcludeT;
1709
1709
 
1710
1710
  if (((_e$itemName$indexOf = (_e$itemName = e.itemName) === null || _e$itemName === void 0 ? void 0 : _e$itemName.indexOf(search)) !== null && _e$itemName$indexOf !== void 0 ? _e$itemName$indexOf : -1) >= 0) {
1711
1711
  return true;
1712
+ } else if (((_e$itemCode$indexOf = (_e$itemCode = e.itemCode) === null || _e$itemCode === void 0 ? void 0 : _e$itemCode.indexOf(search)) !== null && _e$itemCode$indexOf !== void 0 ? _e$itemCode$indexOf : -1) >= 0) {
1713
+ return true;
1712
1714
  } else if (((_e$itemModelName$inde = (_e$itemModelName = e.itemModelName) === null || _e$itemModelName === void 0 ? void 0 : _e$itemModelName.indexOf(search)) !== null && _e$itemModelName$inde !== void 0 ? _e$itemModelName$inde : -1) >= 0) {
1713
1715
  return true;
1714
1716
  } else if ("".concat(isTaxIncluded ? (_e$lineAmountIncludeT = e.lineAmountIncludeTax) === null || _e$lineAmountIncludeT === void 0 ? void 0 : _e$lineAmountIncludeT.toFixed(2) : (_e$lineAmountExcludeT = e.lineAmountExcludeTax) === null || _e$lineAmountExcludeT === void 0 ? void 0 : _e$lineAmountExcludeT.toFixed(2)).indexOf(search) >= 0) {
@@ -10009,6 +10011,9 @@ function Search() {
10009
10011
  var readOnly = controller.useMemo(function (s) {
10010
10012
  return !!s.goodsListState.editGood;
10011
10013
  }, []);
10014
+ var columnshide = controller.useMemo(function (s) {
10015
+ return s.goodsListState.columnshide;
10016
+ }, []);
10012
10017
  /** 是否含税 */
10013
10018
 
10014
10019
  var isTaxIncluded = controller.useMemo(function (s) {
@@ -10072,7 +10077,7 @@ function Search() {
10072
10077
  readOnly: readOnly,
10073
10078
  value: value,
10074
10079
  className: "kts-invoice-operate-goods-list-search",
10075
- placeholder: "\u8BF7\u60A8\u8F93\u5165\u9879\u76EE\u540D\u79F0\u3001\u89C4\u683C\u578B\u53F7\u3001\u91D1\u989D(".concat(isTaxIncluded ? '含税' : '不含税', ")\u641C\u7D22"),
10080
+ placeholder: "\u8BF7\u60A8\u8F93\u5165".concat(columnshide.includes('itemCode') ? '' : '商品编码、', "\u9879\u76EE\u540D\u79F0\u3001\u89C4\u683C\u578B\u53F7\u3001\u91D1\u989D(").concat(isTaxIncluded ? '含税' : '不含税', ")\u641C\u7D22"),
10076
10081
  prefix: React__default['default'].createElement(ktsComponentsAntdX3.Icon, {
10077
10082
  component: SvgMagnifier,
10078
10083
  style: {
@@ -12394,7 +12399,11 @@ var useColumns = (function (form) {
12394
12399
  render: function render(_, record) {
12395
12400
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
12396
12401
  return React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('itemCode', {
12397
- initialValue: editGood.itemCode
12402
+ initialValue: editGood.itemCode,
12403
+ rules: [].concat(_toConsumableArray(getReplenishRules('itemCode')), [{
12404
+ pattern: /^.{1,19}$/,
12405
+ message: '商品编码长度不能超过19位'
12406
+ }])
12398
12407
  })(React__default['default'].createElement(ItemCodeInput, {
12399
12408
  record: record,
12400
12409
  onChange: function () {
@@ -12426,7 +12435,11 @@ var useColumns = (function (form) {
12426
12435
  }()
12427
12436
  })));
12428
12437
  } else {
12429
- return record.itemCode;
12438
+ return React__default['default'].createElement("span", {
12439
+ style: {
12440
+ padding: '0 10px'
12441
+ }
12442
+ }, record.itemCode);
12430
12443
  }
12431
12444
  }
12432
12445
  }, {
@@ -21224,6 +21237,7 @@ var DrawerBody$2 = function DrawerBody() {
21224
21237
 
21225
21238
  between = _objectSpread2({}, record);
21226
21239
  between.itemName = getItemName(record, s.goodsListState.editGood);
21240
+ between.itemCode = getItemCode(record, s.goodsListState.editGood);
21227
21241
  between.itemNameOther = getItemNameOther(record, s.goodsListState.editGood); // 设置编辑货物
21228
21242
 
21229
21243
  editGood = s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), between);
@@ -21259,22 +21273,22 @@ var DrawerBody$2 = function DrawerBody() {
21259
21273
  s.goodsListState.importGoods.isVisibleDrawer = false;
21260
21274
 
21261
21275
  if (!s.goodsListState.isTaxIncluded) {
21262
- _context2.next = 25;
21276
+ _context2.next = 26;
21263
21277
  break;
21264
21278
  }
21265
21279
 
21266
- _context2.next = 23;
21280
+ _context2.next = 24;
21267
21281
  return updateUnitPriceExcludingTax(controller, s.goodsListState.form, record);
21268
21282
 
21269
- case 23:
21270
- _context2.next = 27;
21283
+ case 24:
21284
+ _context2.next = 28;
21271
21285
  break;
21272
21286
 
21273
- case 25:
21274
- _context2.next = 27;
21287
+ case 26:
21288
+ _context2.next = 28;
21275
21289
  return updateUnitPriceTax(controller, s.goodsListState.form, record);
21276
21290
 
21277
- case 27:
21291
+ case 28:
21278
21292
  case "end":
21279
21293
  return _context2.stop();
21280
21294
  }
@@ -21330,6 +21344,20 @@ var getItemNameOther = function getItemNameOther(record, editGood) {
21330
21344
  // return `*${shorthand}*${record.itemNameSelf}`;
21331
21345
  // }
21332
21346
  return record.itemName;
21347
+ }; // 获取商品编号
21348
+
21349
+
21350
+ var getItemCode = function getItemCode(record, editGood) {
21351
+ // let shorthand;
21352
+ // shorthand = record.shorthand;
21353
+ // if (shorthand) {
21354
+ // return `*${shorthand}*${record.itemName}`;
21355
+ // }
21356
+ // shorthand = getSN(editGood.itemName)?.shorthand;
21357
+ // if (shorthand) {
21358
+ // return `*${shorthand}*${record.itemNameSelf}`;
21359
+ // }
21360
+ return record.productCode;
21333
21361
  };
21334
21362
 
21335
21363
  var css_248z$q = ".kts-invoice-operate-goods-endow-code-button-list {\n display: flex;\n flex-direction: column;\n}\n.kts-invoice-operate-goods-endow-code-button-list > button {\n margin-bottom: 10px;\n}\n";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.35",
3
+ "version": "3.2.36",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -6,13 +6,15 @@ import IGood from "../InvoiceControllerState/GoodsListState/IGood";
6
6
  * @param goodsList 被搜索列表
7
7
  * @param search 搜索条件
8
8
  * @param isTaxIncluded 是否含税
9
- * @returns
9
+ * @returns
10
10
  */
11
11
  export default function getGoodsSearch(goodsList: IGood[], search: string, isTaxIncluded: boolean) {
12
12
  if (!search) return goodsList;
13
13
  return goodsList.filter(e => {
14
14
  if ((e.itemName?.indexOf(search) ?? -1) >= 0) {
15
15
  return true;
16
+ } else if ((e.itemCode?.indexOf(search) ?? -1) >= 0) {
17
+ return true
16
18
  } else if ((e.itemModelName?.indexOf(search) ?? -1) >= 0) {
17
19
  return true
18
20
  } else if (`${isTaxIncluded ? e.lineAmountIncludeTax?.toFixed(2) : e.lineAmountExcludeTax?.toFixed(2)}`.indexOf(search) >= 0) {
@@ -21,4 +23,4 @@ export default function getGoodsSearch(goodsList: IGood[], search: string, isTax
21
23
  return false;
22
24
  }
23
25
  })
24
- }
26
+ }
@@ -107,6 +107,10 @@ export default (form: WrappedFormUtils) => {
107
107
  <Form.Item>
108
108
  {getFieldDecorator('itemCode', {
109
109
  initialValue: editGood.itemCode,
110
+ rules: [
111
+ ...getReplenishRules('itemCode'),
112
+ { pattern: /^.{1,19}$/, message: '商品编码长度不能超过19位' },
113
+ ]
110
114
  })(
111
115
  <ItemCodeInput
112
116
  record={record}
@@ -119,7 +123,7 @@ export default (form: WrappedFormUtils) => {
119
123
  </Form.Item>
120
124
  )
121
125
  } else {
122
- return record.itemCode
126
+ return <span style={{ padding: '0 10px' }}>{record.itemCode}</span>
123
127
  }
124
128
  }
125
129
  },
@@ -13,6 +13,8 @@ export default function Search() {
13
13
 
14
14
  const readOnly = controller.useMemo(s => !!s.goodsListState.editGood, [])
15
15
 
16
+ const columnshide = controller.useMemo(s => s.goodsListState.columnshide, [])
17
+
16
18
  /** 是否含税 */
17
19
  const isTaxIncluded = controller.useMemo(s => s.goodsListState.isTaxIncluded, [])
18
20
 
@@ -40,7 +42,7 @@ export default function Search() {
40
42
  readOnly={readOnly}
41
43
  value={value}
42
44
  className="kts-invoice-operate-goods-list-search"
43
- placeholder={`请您输入项目名称、规格型号、金额(${isTaxIncluded ? '含税' : '不含税'})搜索`}
45
+ placeholder={`请您输入${columnshide.includes('itemCode') ? '' : '商品编码、'}项目名称、规格型号、金额(${isTaxIncluded ? '含税' : '不含税'})搜索`}
44
46
  prefix={<Icon component={MagnifierSvg} style={{ color: "#b8b8b8" }} />}
45
47
  onChange={e => { setValue(e.target.value); }}
46
48
  onClick={onClick}
@@ -79,6 +79,7 @@ const DrawerBody = () => {
79
79
  // 中间数据
80
80
  const between = { ...record };
81
81
  between.itemName = getItemName(record, s.goodsListState.editGood);
82
+ between.itemCode = getItemCode(record, s.goodsListState.editGood);
82
83
  between.itemNameOther = getItemNameOther(record, s.goodsListState.editGood);
83
84
 
84
85
  // 设置编辑货物
@@ -171,4 +172,22 @@ const getItemNameOther = (record: any, editGood: IGood) => {
171
172
  // return `*${shorthand}*${record.itemNameSelf}`;
172
173
  // }
173
174
  return record.itemName;
174
- }
175
+ }
176
+
177
+ // 获取商品编号
178
+ const getItemCode = (record: any, editGood: IGood) => {
179
+
180
+ // let shorthand;
181
+
182
+ // shorthand = record.shorthand;
183
+ // if (shorthand) {
184
+ // return `*${shorthand}*${record.itemName}`;
185
+ // }
186
+
187
+ // shorthand = getSN(editGood.itemName)?.shorthand;
188
+ // if (shorthand) {
189
+ // return `*${shorthand}*${record.itemNameSelf}`;
190
+ // }
191
+
192
+ return record.productCode;
193
+ }