kts-component-invoice-operate 2.0.1 → 2.0.2

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.
Files changed (61) hide show
  1. package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood/index.d.ts +10 -12
  2. package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/ProductComparison/index.d.ts +0 -2
  3. package/dist/Invoice/_test/buyerNameSearch/index.d.ts +1 -0
  4. package/dist/Invoice/_test/deduction/index.d.ts +1 -0
  5. package/dist/Invoice/_test/draft/index.d.ts +1 -0
  6. package/dist/Invoice/_test/easiest/index.d.ts +1 -0
  7. package/dist/Invoice/_test/endowCode/index.d.ts +1 -0
  8. package/dist/Invoice/_test/goodsMenuExpand/index.d.ts +1 -0
  9. package/dist/Invoice/_test/importBuyer/index.d.ts +1 -0
  10. package/dist/Invoice/_test/importGoods/index.d.ts +1 -0
  11. package/dist/Invoice/_test/invoiceType/index.d.ts +1 -0
  12. package/dist/Invoice/_test/isInvoiceNo/index.d.ts +1 -0
  13. package/dist/Invoice/_test/replaceHead/index.d.ts +1 -0
  14. package/dist/Invoice/_test/retrieveData/index.d.ts +1 -0
  15. package/dist/Invoice/_test/seller/index.d.ts +1 -0
  16. package/dist/Invoice/_test/setDataSource/index.d.ts +1 -0
  17. package/dist/Invoice/_test/unit/index.d.ts +1 -0
  18. package/dist/Invoice/ui/AddComparisonDrawer/index.d.ts +2 -3
  19. package/dist/Invoice/ui/Buyer/ui/BuyerNameInput/index.d.ts +1 -0
  20. package/dist/Invoice/ui/Buyer/ui/ImportBuyerButton/index.d.ts +1 -0
  21. package/dist/Invoice/ui/EndowCodeDrawer/index.d.ts +1 -0
  22. package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/RowEditButton/index.d.ts +1 -0
  23. package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useAddComparison/index.d.ts +1 -0
  24. package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.d.ts +1 -0
  25. package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useDelItem/index.d.ts +1 -0
  26. package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.d.ts +1 -0
  27. package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/index.d.ts +1 -0
  28. package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/RowSaveButton/index.d.ts +1 -0
  29. package/dist/Invoice/ui/GoodsList/hook/useRowSelection/index.d.ts +1 -0
  30. package/dist/Invoice/ui/GoodsList/ui/AddRowButton/index.d.ts +1 -0
  31. package/dist/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useAddDiscountRowButton/index.d.ts +1 -0
  32. package/dist/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useCommodityComparisonButton/index.d.ts +1 -0
  33. package/dist/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useDelRowButton/index.d.ts +1 -0
  34. package/dist/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useEndowCodeButton/index.d.ts +1 -0
  35. package/dist/Invoice/ui/GoodsList/ui/BulkMenu/index.d.ts +1 -0
  36. package/dist/Invoice/ui/GoodsList/ui/DescribeSwitch/index.d.ts +1 -0
  37. package/dist/Invoice/ui/GoodsList/ui/Search/index.d.ts +1 -0
  38. package/dist/Invoice/ui/GoodsList/ui/Statistics/index.d.ts +1 -0
  39. package/dist/Invoice/ui/GoodsList/ui/TableRow/index.d.ts +1 -0
  40. package/dist/Invoice/ui/GoodsList/ui/TableVirtual/index.d.ts +1 -0
  41. package/dist/Invoice/ui/GoodsList/ui/TaxIncludedSwitch/index.d.ts +1 -0
  42. package/dist/Invoice/ui/ImportBuyerDrawer/index.d.ts +1 -0
  43. package/dist/Invoice/ui/ImportGoodsDrawer/index.d.ts +1 -0
  44. package/dist/index.esm.js +135 -167
  45. package/dist/index.js +135 -167
  46. package/docs-dist/404.html +33 -0
  47. package/docs-dist/index.html +33 -0
  48. package/docs-dist/static/auto.a6cd905c.svg +1 -0
  49. package/docs-dist/static/magnifier.2b26be6e.svg +1 -0
  50. package/docs-dist/static/spot.42e620e1.svg +1 -0
  51. package/docs-dist/umi.css +21 -0
  52. package/docs-dist/umi.js +1 -0
  53. package/package.json +3 -1
  54. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood/index.ts +10 -13
  55. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/ProductComparison/index.ts +1 -1
  56. package/src/Invoice/ui/AddComparisonDrawer/index.tsx +73 -113
  57. package/src/Invoice/ui/EndowCodeDrawer/index.tsx +1 -1
  58. package/src/Invoice/ui/GoodsList/hook/useColumns/autoFillFn/index.ts +5 -4
  59. package/src/Invoice/ui/GoodsList/hook/useColumns/index.tsx +36 -16
  60. package/src/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useCommodityComparisonButton/index.tsx +7 -12
  61. package/src/Invoice/ui/ImportGoodsDrawer/index.tsx +10 -10
package/dist/index.esm.js CHANGED
@@ -7,6 +7,7 @@ import { v4 } from 'uuid';
7
7
  import classnames from 'classnames';
8
8
  import { Input as Input$1, NumberPicker } from '@formily/antd-components';
9
9
  import { createAsyncFormActions, FormEffectHooks, SchemaForm, FormButtonGroup, SchemaMarkupField } from '@formily/antd';
10
+ import { Form as Form$1, Drawer as Drawer$1 } from 'kts-xui';
10
11
 
11
12
  function ownKeys(object, enumerableOnly) {
12
13
  var keys = Object.keys(object);
@@ -976,7 +977,6 @@ var ProductComparison = /*#__PURE__*/_createClass(function ProductComparison() {
976
977
  _classCallCheck(this, ProductComparison);
977
978
 
978
979
  this.onComply = void 0;
979
- this.onUpdateComparisonTable = void 0;
980
980
  });
981
981
 
982
982
  var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
@@ -2980,7 +2980,7 @@ var useCommodityComparisonButton = (function () {
2980
2980
 
2981
2981
 
2982
2982
  var disabled = controller.useMemo(function (s) {
2983
- if (s.goodsListState.selectedGoodIndex.length <= 0) return true;
2983
+ return s.goodsListState.selectedGoodIndex.length <= 0;
2984
2984
  }, []);
2985
2985
  /** 点击了 */
2986
2986
 
@@ -3033,7 +3033,7 @@ var useCommodityComparisonButton = (function () {
3033
3033
  if (!t) return undefined;
3034
3034
  return _objectSpread2(_objectSpread2({}, t), {}, {
3035
3035
  itemName: (_getSN = getSN(t.itemName)) === null || _getSN === void 0 ? void 0 : _getSN.full,
3036
- itemNameOther: (_getSN2 = getSN(t.itemNameOther)) === null || _getSN2 === void 0 ? void 0 : _getSN2.full
3036
+ itemNameSelf: (_getSN2 = getSN(t.itemNameSelf)) === null || _getSN2 === void 0 ? void 0 : _getSN2.full
3037
3037
  });
3038
3038
  }).filter(function (e) {
3039
3039
  return !!e;
@@ -3050,13 +3050,11 @@ var useCommodityComparisonButton = (function () {
3050
3050
  var vt = s.goodsListState.goodsMap.get(e.$index);
3051
3051
  if (!vt) return undefined;
3052
3052
  vt.itemName = e.itemName ? setShorthand(e.itemName, (_getSN3 = getSN(vt.itemName)) === null || _getSN3 === void 0 ? void 0 : _getSN3.shorthand) : vt.itemName;
3053
- vt.itemNameOther = e.itemNameOther ? setShorthand(e.itemNameOther, (_getSN4 = getSN(vt.itemNameOther)) === null || _getSN4 === void 0 ? void 0 : _getSN4.shorthand) : vt.itemNameOther;
3054
- vt.unit = e.unit ? e.unit : vt.unit;
3055
- vt.unitOther = e.unitOther ? e.unitOther : vt.unitOther;
3053
+ vt.itemNameSelf = e.itemNameSelf ? setShorthand(e.itemNameSelf, (_getSN4 = getSN(vt.itemNameSelf)) === null || _getSN4 === void 0 ? void 0 : _getSN4.shorthand) : vt.itemNameSelf;
3056
3054
  vt.itemModelName = e.itemModelName ? e.itemModelName : vt.itemModelName;
3057
- vt.itemModelNameOther = e.itemModelNameOther ? e.itemModelNameOther : vt.itemModelNameOther;
3055
+ vt.itemModelNameSelf = e.itemModelNameSelf ? e.itemModelNameSelf : vt.itemModelNameSelf;
3058
3056
  vt.itemCode = e.itemCode ? e.itemCode : vt.itemCode;
3059
- vt.itemCodeOther = e.itemCodeOther ? e.itemCodeOther : vt.itemCodeOther;
3057
+ vt.itemCodeSelf = e.itemCodeSelf ? e.itemCodeSelf : vt.itemCodeSelf;
3060
3058
  });
3061
3059
 
3062
3060
  case 10:
@@ -3087,7 +3085,7 @@ var useCommodityComparisonButton = (function () {
3087
3085
  disabled: disabled,
3088
3086
  onClick: onClick
3089
3087
  }, "\u6267\u884C\u5546\u54C1\u5BF9\u7167");
3090
- }, []);
3088
+ }, [disabled, onClick, onComply]);
3091
3089
  return {
3092
3090
  menuItem: menuItem
3093
3091
  };
@@ -9869,11 +9867,11 @@ var onChangeItemName = /*#__PURE__*/function () {
9869
9867
 
9870
9868
  _context12.next = 5;
9871
9869
  return controller.setEditGood({
9872
- itemName: value
9870
+ itemNameSelf: value
9873
9871
  });
9874
9872
 
9875
9873
  case 5:
9876
- _context12.t0 = record.itemNameOther;
9874
+ _context12.t0 = record.itemName;
9877
9875
 
9878
9876
  if (!_context12.t0) {
9879
9877
  _context12.next = 9;
@@ -9882,7 +9880,7 @@ var onChangeItemName = /*#__PURE__*/function () {
9882
9880
 
9883
9881
  _context12.next = 9;
9884
9882
  return controller.setEditGood({
9885
- itemNameOther: setShorthand(record.itemNameOther, shorthand)
9883
+ itemName: setShorthand(record.itemName, shorthand)
9886
9884
  });
9887
9885
 
9888
9886
  case 9:
@@ -9892,11 +9890,11 @@ var onChangeItemName = /*#__PURE__*/function () {
9892
9890
  case 11:
9893
9891
  _context12.next = 13;
9894
9892
  return controller.setEditGood({
9895
- itemNameOther: value
9893
+ itemName: value
9896
9894
  });
9897
9895
 
9898
9896
  case 13:
9899
- _context12.t1 = record.itemName;
9897
+ _context12.t1 = record.itemNameSelf;
9900
9898
 
9901
9899
  if (!_context12.t1) {
9902
9900
  _context12.next = 17;
@@ -9905,7 +9903,7 @@ var onChangeItemName = /*#__PURE__*/function () {
9905
9903
 
9906
9904
  _context12.next = 17;
9907
9905
  return controller.setEditGood({
9908
- itemName: setShorthand(record.itemName, shorthand)
9906
+ itemNameSelf: setShorthand(record.itemNameSelf, shorthand)
9909
9907
  });
9910
9908
 
9911
9909
  case 17:
@@ -10174,7 +10172,7 @@ var useColumns = (function (form) {
10174
10172
  display: 'flex'
10175
10173
  }
10176
10174
  }, getFieldDecorator('itemName', {
10177
- initialValue: isMyShow ? record.itemName : record.itemNameOther,
10175
+ initialValue: isMyShow ? record.itemNameSelf : record.itemName,
10178
10176
  rules: [{
10179
10177
  validator: function () {
10180
10178
  var _validator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_, __, callback) {
@@ -10189,7 +10187,7 @@ var useColumns = (function (form) {
10189
10187
  case 2:
10190
10188
  value = controller.state.goodsListState.editGood;
10191
10189
 
10192
- if (!(!(value === null || value === void 0 ? void 0 : value.itemName) && !(value === null || value === void 0 ? void 0 : value.itemNameOther))) {
10190
+ if (!(!(value === null || value === void 0 ? void 0 : value.itemName) && !(value === null || value === void 0 ? void 0 : value.itemNameSelf))) {
10193
10191
  _context.next = 7;
10194
10192
  break;
10195
10193
  }
@@ -10257,8 +10255,8 @@ var useColumns = (function (form) {
10257
10255
  }))));
10258
10256
  } else {
10259
10257
  return React.createElement(MyItemNameDiv, {
10260
- valueT: formatSearch(record.itemName, searchValue),
10261
- valueF: record.itemNameOther,
10258
+ valueT: formatSearch(record.itemNameSelf, searchValue),
10259
+ valueF: formatSearch(record.itemName, searchValue),
10262
10260
  isMyShow: isMyShow
10263
10261
  }); // return (
10264
10262
  // <span style={{ padding: '0 10px' }}>{formatSearch(value, searchValue)}</span>
@@ -10272,7 +10270,7 @@ var useColumns = (function (form) {
10272
10270
  render: function render(_, record) {
10273
10271
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
10274
10272
  return React.createElement(Form.Item, null, getFieldDecorator('itemModelName', {
10275
- initialValue: isMyShow ? editGood.itemModelName : editGood.itemModelNameOther
10273
+ initialValue: isMyShow ? editGood.itemModelNameSelf : editGood.itemModelName
10276
10274
  })(React.createElement(MyInput, {
10277
10275
  onChange: function () {
10278
10276
  var _onChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
@@ -10285,7 +10283,7 @@ var useColumns = (function (form) {
10285
10283
  return controller.wait();
10286
10284
 
10287
10285
  case 2:
10288
- key = isMyShow ? 'itemModelName' : 'itemModelNameOther';
10286
+ key = isMyShow ? 'itemModelNameSelf' : 'itemModelName';
10289
10287
  value = {};
10290
10288
  value[key] = form.getFieldsValue().itemModelName;
10291
10289
  controller.setEditGood(value);
@@ -10307,10 +10305,10 @@ var useColumns = (function (form) {
10307
10305
  })));
10308
10306
  } else {
10309
10307
  return React.createElement(MyItemNameDiv, {
10310
- valueT: formatSearch(record.itemModelName, searchValue),
10311
- valueF: formatSearch(record.itemModelNameOther, searchValue),
10308
+ valueT: formatSearch(record.itemModelNameSelf, searchValue),
10309
+ valueF: formatSearch(record.itemModelName, searchValue),
10312
10310
  isMyShow: isMyShow
10313
- }); // return <span style={{ padding: '0 10px' }}>{formatSearch(value, searchValue)}</span>;
10311
+ });
10314
10312
  }
10315
10313
  }
10316
10314
  }, {
@@ -10358,11 +10356,7 @@ var useColumns = (function (form) {
10358
10356
  }()
10359
10357
  })));
10360
10358
  } else {
10361
- return React.createElement(MyItemNameDiv, {
10362
- valueT: record.unit,
10363
- valueF: record.unitOther,
10364
- isMyShow: isMyShow
10365
- });
10359
+ return record.unit;
10366
10360
  }
10367
10361
  }
10368
10362
  }, {
@@ -10759,6 +10753,7 @@ var useColumns = (function (form) {
10759
10753
  width: '100%'
10760
10754
  },
10761
10755
  onChange: function onChange() {
10756
+ setChangeField('taxRate');
10762
10757
  onChangeTaxRate(controller, form, record);
10763
10758
  }
10764
10759
  }, taxRateList.map(function (e, i) {
@@ -10785,7 +10780,9 @@ var useColumns = (function (form) {
10785
10780
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
10786
10781
  return getFieldDecorator('taxAmount', {
10787
10782
  initialValue: editGood.taxAmount
10788
- })(React.createElement(MyDiv, null));
10783
+ })(React.createElement(MyDiv, {
10784
+ loading: isCipher(changeField, 'taxAmount')
10785
+ }));
10789
10786
  } else {
10790
10787
  return React.createElement("span", {
10791
10788
  style: {
@@ -10881,11 +10878,21 @@ var MyDiv = /*#__PURE__*/function (_React$Component2) {
10881
10878
  _createClass(MyDiv, [{
10882
10879
  key: "render",
10883
10880
  value: function render() {
10884
- return React.createElement("span", {
10885
- style: {
10886
- padding: '0 10px'
10887
- }
10888
- }, this.props.value);
10881
+ if (this.props.loading) {
10882
+ return React.createElement(Spin, {
10883
+ size: "small"
10884
+ }, React.createElement("span", {
10885
+ style: {
10886
+ padding: '0 10px'
10887
+ }
10888
+ }, this.props.value));
10889
+ } else {
10890
+ return React.createElement("span", {
10891
+ style: {
10892
+ padding: '0 10px'
10893
+ }
10894
+ }, this.props.value);
10895
+ }
10889
10896
  }
10890
10897
  }]);
10891
10898
 
@@ -10953,7 +10960,9 @@ var MyItemNameDiv = /*#__PURE__*/function (_React$Component3) {
10953
10960
  function formatSearch(value, search) {
10954
10961
  if (!value || !search) return value;
10955
10962
 
10956
- var __html = value.split(new RegExp(search, 'g')).join("<span class=\"kts-invoice-operate-goods-list-table-search-protrude\" >".concat(search, "</span>"));
10963
+ var __html = ucoding(value).split(new RegExp(ucoding(search), 'g')).map(function (e) {
10964
+ return dcoding(e);
10965
+ }).join("<span class=\"kts-invoice-operate-goods-list-table-search-protrude\" >".concat(search, "</span>"));
10957
10966
 
10958
10967
  return React.createElement("span", {
10959
10968
  dangerouslySetInnerHTML: {
@@ -10961,6 +10970,22 @@ function formatSearch(value, search) {
10961
10970
  }
10962
10971
  });
10963
10972
  }
10973
+ /** 编码 */
10974
+
10975
+
10976
+ function ucoding(v) {
10977
+ return v.split('').map(function (e) {
10978
+ return "U".concat(e.charCodeAt(0), "E");
10979
+ }).join('');
10980
+ }
10981
+ /** 解码 */
10982
+
10983
+
10984
+ function dcoding(v) {
10985
+ return v.split('U').map(function (e) {
10986
+ return e ? String.fromCharCode(parseInt(e.replace('E', ''))) : '';
10987
+ }).join('');
10988
+ }
10964
10989
 
10965
10990
  var useOnRow = (function () {
10966
10991
  /** 控制器 */
@@ -12565,13 +12590,12 @@ var DrawerBody$2 = function DrawerBody() {
12565
12590
 
12566
12591
 
12567
12592
  if (s.goodsListState.isMyShow) {
12568
- s.goodsListState.form.setFieldsValue(editGood);
12569
- } else {
12570
12593
  s.goodsListState.form.setFieldsValue(_objectSpread2(_objectSpread2({}, editGood), {}, {
12571
- itemName: editGood.itemNameOther,
12572
- unit: editGood.unitOther,
12573
- itemModelName: editGood.itemModelNameOther
12594
+ itemName: editGood.itemNameSelf,
12595
+ itemModelName: editGood.itemModelNameSelf
12574
12596
  }));
12597
+ } else {
12598
+ s.goodsListState.form.setFieldsValue(_objectSpread2({}, editGood));
12575
12599
  }
12576
12600
 
12577
12601
  s.goodsListState.importGoods.isVisibleDrawer = false;
@@ -12621,10 +12645,10 @@ var getItemName$1 = function getItemName(record, editGood) {
12621
12645
  return "*".concat(shorthand, "*").concat(record.itemName);
12622
12646
  }
12623
12647
 
12624
- shorthand = (_getSN = getSN(editGood.itemNameOther)) === null || _getSN === void 0 ? void 0 : _getSN.shorthand;
12648
+ shorthand = (_getSN = getSN(editGood.itemName)) === null || _getSN === void 0 ? void 0 : _getSN.shorthand;
12625
12649
 
12626
12650
  if (shorthand) {
12627
- return "*".concat(shorthand, "*").concat(record.itemName);
12651
+ return "*".concat(shorthand, "*").concat(record.itemNameSelf);
12628
12652
  }
12629
12653
 
12630
12654
  return record.itemName;
@@ -12632,15 +12656,15 @@ var getItemName$1 = function getItemName(record, editGood) {
12632
12656
 
12633
12657
 
12634
12658
  var getItemNameOther = function getItemNameOther(record, editGood) {
12635
- if (!editGood.itemNameOther) return editGood.itemNameOther;
12659
+ if (!editGood.itemName) return editGood.itemName;
12636
12660
  var shorthand;
12637
12661
  shorthand = record.shorthand;
12638
12662
 
12639
12663
  if (shorthand) {
12640
- return "*".concat(shorthand, "*").concat(record.itemName);
12664
+ return "*".concat(shorthand, "*").concat(record.itemNameSelf);
12641
12665
  }
12642
12666
 
12643
- return record.itemNameOther;
12667
+ return record.itemName;
12644
12668
  };
12645
12669
 
12646
12670
  /**
@@ -13202,7 +13226,7 @@ var DrawerBody$3 = function DrawerBody(props) {
13202
13226
  endowCodeGood.forEach(function (good) {
13203
13227
  if (!good) return;
13204
13228
  good.itemName = setShorthand(good.itemName, values.shorthand);
13205
- good.itemNameOther = setShorthand(good.itemNameOther, values.shorthand); // const name = getItemName(good.itemName, values.shorthand);
13229
+ good.itemNameSelf = setShorthand(good.itemNameSelf, values.shorthand); // const name = getItemName(good.itemName, values.shorthand);
13206
13230
  // good.itemName = getItemName(good.itemName, values.shorthand); // `*${values.shorthand}*${name}`;
13207
13231
 
13208
13232
  good.taxClassificationCode = values.taxClassificationCode;
@@ -13452,11 +13476,13 @@ var getShorthand = function getShorthand(value) {
13452
13476
  }
13453
13477
  };
13454
13478
 
13455
- var AddComparisonDrawer = decorator(Form.create())(function (props) {
13456
- var form = props.form;
13457
- var getFieldDecorator = form.getFieldDecorator;
13479
+ function AddComparisonDrawer() {
13480
+ var _Form$useForm = Form$1.useForm(),
13481
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
13482
+ form = _Form$useForm2[0];
13458
13483
  /** 控制器 */
13459
13484
 
13485
+
13460
13486
  var controller = Invoice.useInvoiceController();
13461
13487
  /** 正在 添加商品对照 的货物索引 */
13462
13488
 
@@ -13500,9 +13526,7 @@ var AddComparisonDrawer = decorator(Form.create())(function (props) {
13500
13526
  var onSubmit = React.useCallback(function () {
13501
13527
  controller.run( /*#__PURE__*/function () {
13502
13528
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
13503
- var _getSN, _getSN2, _s$goodsListState, _s$goodsListState$pro;
13504
-
13505
- var _yield$validateFields, err, values, shorthand;
13529
+ var _getSN, _getSN2, values, shorthand;
13506
13530
 
13507
13531
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
13508
13532
  while (1) {
@@ -13516,49 +13540,34 @@ var AddComparisonDrawer = decorator(Form.create())(function (props) {
13516
13540
  return _context2.abrupt("return");
13517
13541
 
13518
13542
  case 2:
13519
- _context2.next = 4;
13520
- return validateFields$1(form);
13521
-
13522
- case 4:
13523
- _yield$validateFields = _context2.sent;
13524
- err = _yield$validateFields.err;
13525
- values = _yield$validateFields.values;
13526
-
13527
- if (!err) {
13528
- _context2.next = 9;
13529
- break;
13530
- }
13531
-
13532
- return _context2.abrupt("return");
13543
+ _context2.prev = 2;
13544
+ _context2.next = 5;
13545
+ return form.validateFields();
13533
13546
 
13534
- case 9:
13535
- shorthand = s.goodsListState.isMyShow ? (_getSN = getSN(good.itemName)) === null || _getSN === void 0 ? void 0 : _getSN.shorthand : (_getSN2 = getSN(good.itemNameOther)) === null || _getSN2 === void 0 ? void 0 : _getSN2.shorthand;
13547
+ case 5:
13548
+ values = _context2.sent;
13549
+ shorthand = s.goodsListState.isMyShow ? (_getSN = getSN(good.itemNameSelf)) === null || _getSN === void 0 ? void 0 : _getSN.shorthand : (_getSN2 = getSN(good.itemName)) === null || _getSN2 === void 0 ? void 0 : _getSN2.shorthand;
13536
13550
  good.itemCode = values.itemCode;
13537
- good.itemCodeOther = values.itemCodeOther;
13551
+ good.itemCodeSelf = values.itemCodeSelf;
13538
13552
  good.itemName = shorthand ? "*".concat(shorthand, "*").concat(values.itemName) : values.itemName;
13539
- good.itemNameOther = shorthand ? "*".concat(shorthand, "*").concat(values.itemNameOther) : values.itemNameOther;
13553
+ good.itemNameSelf = shorthand ? "*".concat(shorthand, "*").concat(values.itemNameSelf) : values.itemNameSelf;
13540
13554
  good.itemModelName = values.itemModelName;
13541
- good.itemModelNameOther = values.itemModelNameOther;
13542
- good.unit = values.unit;
13543
- good.unitOther = values.unitOther;
13555
+ good.itemModelNameSelf = values.itemModelNameSelf;
13544
13556
  s.goodsListState.addComparisonIndex = undefined;
13545
13557
  s.goodsListState.goodsList = _toConsumableArray(s.goodsListState.goodsList);
13558
+ _context2.next = 19;
13559
+ break;
13546
13560
 
13547
- if (!(((_s$goodsListState = s.goodsListState) === null || _s$goodsListState === void 0 ? void 0 : (_s$goodsListState$pro = _s$goodsListState.productComparison) === null || _s$goodsListState$pro === void 0 ? void 0 : _s$goodsListState$pro.onUpdateComparisonTable) && values.isUpdate)) {
13548
- _context2.next = 24;
13549
- break;
13550
- }
13551
-
13552
- debugger;
13553
- _context2.next = 24;
13554
- return s.goodsListState.productComparison.onUpdateComparisonTable(good, values);
13561
+ case 17:
13562
+ _context2.prev = 17;
13563
+ _context2.t0 = _context2["catch"](2);
13555
13564
 
13556
- case 24:
13565
+ case 19:
13557
13566
  case "end":
13558
13567
  return _context2.stop();
13559
13568
  }
13560
13569
  }
13561
- }, _callee2);
13570
+ }, _callee2, null, [[2, 17]]);
13562
13571
  }));
13563
13572
 
13564
13573
  return function (_x2) {
@@ -13574,115 +13583,74 @@ var AddComparisonDrawer = decorator(Form.create())(function (props) {
13574
13583
 
13575
13584
  form.setFieldsValue(_objectSpread2(_objectSpread2({}, good), {}, {
13576
13585
  itemName: (_getSN3 = getSN(good.itemName)) === null || _getSN3 === void 0 ? void 0 : _getSN3.full,
13577
- itemNameOther: (_getSN4 = getSN(good.itemNameOther)) === null || _getSN4 === void 0 ? void 0 : _getSN4.full
13586
+ itemNameSelf: (_getSN4 = getSN(good.itemNameSelf)) === null || _getSN4 === void 0 ? void 0 : _getSN4.full
13578
13587
  }));
13579
13588
  }
13580
13589
  }, [good]);
13581
- return React.createElement(Drawer, {
13590
+ return React.createElement(Drawer$1, {
13582
13591
  width: 500,
13583
13592
  onClose: onClose,
13584
13593
  placement: "right",
13585
13594
  title: "\u6DFB\u52A0\u5546\u54C1\u5BF9\u7167",
13586
- visible: !!addComparisonIndex,
13587
- drawerStyle: {
13588
- display: 'flex',
13589
- flexDirection: 'column'
13590
- },
13591
- bodyStyle: {
13592
- flex: 1,
13593
- display: 'flex',
13594
- flexDirection: 'column'
13595
- }
13596
- }, React.createElement(Form, {
13595
+ visible: !!good,
13596
+ footer: React.createElement("div", {
13597
+ style: {
13598
+ display: 'flex',
13599
+ justifyContent: 'flex-end',
13600
+ gap: 10
13601
+ }
13602
+ }, React.createElement(Button, {
13603
+ type: "primary",
13604
+ onClick: onSubmit
13605
+ }, "\u63D0\u4EA4"), React.createElement(Button, {
13606
+ onClick: onClose
13607
+ }, "\u53D6\u6D88"))
13608
+ }, !!good && React.createElement(Form$1, {
13597
13609
  layout: "vertical",
13598
13610
  style: {
13599
13611
  flex: 1
13600
- }
13612
+ },
13613
+ form: form
13601
13614
  }, React.createElement(Row, {
13602
13615
  gutter: [8, 8]
13603
13616
  }, React.createElement(Col, {
13604
13617
  span: 12
13605
- }, getFieldDecorator('itemCode', {})(React.createElement(Form.Item, {
13618
+ }, React.createElement(Form$1.Item, {
13619
+ name: "itemCodeSelf",
13606
13620
  label: "\u6211\u65B9\u5546\u54C1\u7F16\u7801"
13607
- }, React.createElement(Input, null)))), React.createElement(Col, {
13621
+ }, React.createElement(Input, null))), React.createElement(Col, {
13608
13622
  span: 12
13609
- }, getFieldDecorator('itemCodeOther', {})(React.createElement(Form.Item, {
13623
+ }, React.createElement(Form$1.Item, {
13624
+ name: "itemCode",
13610
13625
  label: "\u5BF9\u65B9\u5546\u54C1\u7F16\u7801"
13611
- }, React.createElement(Input, null)))), React.createElement(Col, {
13626
+ }, React.createElement(Input, null))), React.createElement(Col, {
13612
13627
  span: 12
13613
- }, getFieldDecorator('itemName', {
13614
- rules: [{
13615
- required: true,
13616
- message: "请输入我方商品名称"
13617
- }]
13618
- })(React.createElement(Form.Item, {
13628
+ }, React.createElement(Form$1.Item, {
13629
+ name: "itemNameSelf",
13619
13630
  label: "\u6211\u65B9\u5546\u54C1\u540D\u79F0"
13620
- }, React.createElement(Input, null)))), React.createElement(Col, {
13631
+ }, React.createElement(Input, null))), React.createElement(Col, {
13621
13632
  span: 12
13622
- }, getFieldDecorator('itemNameOther', {
13623
- rules: [{
13624
- required: true,
13625
- message: "请输入对方商品名称"
13626
- }]
13627
- })(React.createElement(Form.Item, {
13633
+ }, React.createElement(Form$1.Item, {
13634
+ name: "itemName",
13628
13635
  label: "\u5BF9\u65B9\u5546\u54C1\u540D\u79F0"
13629
- }, React.createElement(Input, null)))), React.createElement(Col, {
13636
+ }, React.createElement(Input, null))), React.createElement(Col, {
13630
13637
  span: 12
13631
- }, React.createElement(Form.Item, {
13638
+ }, React.createElement(Form$1.Item, {
13639
+ name: 'itemModelNameSelf',
13632
13640
  label: "\u6211\u65B9\u89C4\u683C\u578B\u53F7"
13633
13641
  }, React.createElement(Input, null))), React.createElement(Col, {
13634
13642
  span: 12
13635
- }, getFieldDecorator('itemModelNameOther', {
13636
- rules: [{
13637
- required: true,
13638
- message: "请输入对方规格型号"
13639
- }]
13640
- })(React.createElement(Form.Item, {
13643
+ }, React.createElement(Form$1.Item, {
13644
+ name: "itemModelName",
13641
13645
  label: "\u5BF9\u65B9\u89C4\u683C\u578B\u53F7"
13642
- }, React.createElement(Input, null)))), React.createElement(Col, {
13643
- span: 12
13644
- }, getFieldDecorator('unit', {
13645
- rules: [{
13646
- required: true,
13647
- message: "请输入对方规格型号"
13648
- }]
13649
- })(React.createElement(Form.Item, {
13650
- label: "\u6211\u65B9\u8BA1\u91CF\u5355\u4F4D"
13651
- }, React.createElement(Input, null)))), React.createElement(Col, {
13652
- span: 12
13653
- }, getFieldDecorator('unitOther', {
13654
- rules: [{
13655
- required: true,
13656
- message: "请输入对方计量单位"
13657
- }]
13658
- })(React.createElement(Form.Item, {
13659
- label: "\u5BF9\u65B9\u8BA1\u91CF\u5355\u4F4D"
13660
- }, React.createElement(Input, null)))), React.createElement(Col, {
13661
- span: 24
13662
- }, getFieldDecorator('isUpdate', {})(React.createElement(Form.Item, null, React.createElement(Checkbox, null, "\u66F4\u65B0\u5230\u5546\u54C1\u5BF9\u7167\u8868\u4E2D")))))), React.createElement("div", {
13663
- style: {
13664
- display: 'flex',
13665
- justifyContent: 'flex-end',
13666
- gap: 10
13667
- }
13668
- }, React.createElement(Button, {
13669
- type: "primary",
13670
- onClick: onSubmit
13671
- }, "\u63D0\u4EA4"), React.createElement(Button, {
13672
- onClick: onClose
13673
- }, "\u53D6\u6D88")));
13674
- });
13675
-
13676
- function validateFields$1(form) {
13677
- return new Promise(function (resolve) {
13678
- form.validateFields(function (err, values) {
13679
- resolve({
13680
- err: err,
13681
- values: values
13682
- });
13683
- });
13684
- });
13685
- }
13646
+ }, React.createElement(Input, null))))));
13647
+ } // function validateFields(form: WrappedFormUtils<any>) {
13648
+ // return new Promise<{ err: any, values: any }>(resolve => {
13649
+ // form.validateFields((err, values) => {
13650
+ // resolve({ err, values })
13651
+ // })
13652
+ // })
13653
+ // }
13686
13654
 
13687
13655
  /** 发票组件的上下文 */
13688
13656