kts-component-invoice-operate 2.0.1 → 2.0.4

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 (63) 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 +136 -169
  45. package/dist/index.js +136 -169
  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/_test/importGoods/index.tsx +3 -4
  57. package/src/Invoice/tools/itemName/index.ts +0 -1
  58. package/src/Invoice/ui/AddComparisonDrawer/index.tsx +73 -113
  59. package/src/Invoice/ui/EndowCodeDrawer/index.tsx +1 -1
  60. package/src/Invoice/ui/GoodsList/hook/useColumns/autoFillFn/index.ts +5 -4
  61. package/src/Invoice/ui/GoodsList/hook/useColumns/index.tsx +36 -16
  62. package/src/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useCommodityComparisonButton/index.tsx +8 -13
  63. 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() {
@@ -2934,7 +2934,6 @@ var useEndowCodeButton = (function () {
2934
2934
 
2935
2935
  /** 拆分全称加简称 */
2936
2936
  var getSN = function getSN(value) {
2937
- debugger;
2938
2937
  if (!value) return undefined;
2939
2938
  var arr = value.match(/\*[^*]+\*/);
2940
2939
 
@@ -2980,7 +2979,7 @@ var useCommodityComparisonButton = (function () {
2980
2979
 
2981
2980
 
2982
2981
  var disabled = controller.useMemo(function (s) {
2983
- if (s.goodsListState.selectedGoodIndex.length <= 0) return true;
2982
+ return s.goodsListState.selectedGoodIndex.length <= 0;
2984
2983
  }, []);
2985
2984
  /** 点击了 */
2986
2985
 
@@ -3033,7 +3032,7 @@ var useCommodityComparisonButton = (function () {
3033
3032
  if (!t) return undefined;
3034
3033
  return _objectSpread2(_objectSpread2({}, t), {}, {
3035
3034
  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
3035
+ itemNameSelf: (_getSN2 = getSN(t.itemNameSelf)) === null || _getSN2 === void 0 ? void 0 : _getSN2.full
3037
3036
  });
3038
3037
  }).filter(function (e) {
3039
3038
  return !!e;
@@ -3044,19 +3043,17 @@ var useCommodityComparisonButton = (function () {
3044
3043
 
3045
3044
  case 8:
3046
3045
  newGoods = _context.sent;
3047
- newGoods.filter(function (e) {
3046
+ newGoods.forEach(function (e) {
3048
3047
  var _getSN3, _getSN4;
3049
3048
 
3050
3049
  var vt = s.goodsListState.goodsMap.get(e.$index);
3051
3050
  if (!vt) return undefined;
3052
3051
  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;
3052
+ vt.itemNameSelf = e.itemNameSelf ? setShorthand(e.itemNameSelf, (_getSN4 = getSN(vt.itemNameSelf)) === null || _getSN4 === void 0 ? void 0 : _getSN4.shorthand) : vt.itemNameSelf;
3056
3053
  vt.itemModelName = e.itemModelName ? e.itemModelName : vt.itemModelName;
3057
- vt.itemModelNameOther = e.itemModelNameOther ? e.itemModelNameOther : vt.itemModelNameOther;
3054
+ vt.itemModelNameSelf = e.itemModelNameSelf ? e.itemModelNameSelf : vt.itemModelNameSelf;
3058
3055
  vt.itemCode = e.itemCode ? e.itemCode : vt.itemCode;
3059
- vt.itemCodeOther = e.itemCodeOther ? e.itemCodeOther : vt.itemCodeOther;
3056
+ vt.itemCodeSelf = e.itemCodeSelf ? e.itemCodeSelf : vt.itemCodeSelf;
3060
3057
  });
3061
3058
 
3062
3059
  case 10:
@@ -3087,7 +3084,7 @@ var useCommodityComparisonButton = (function () {
3087
3084
  disabled: disabled,
3088
3085
  onClick: onClick
3089
3086
  }, "\u6267\u884C\u5546\u54C1\u5BF9\u7167");
3090
- }, []);
3087
+ }, [disabled, onClick, onComply]);
3091
3088
  return {
3092
3089
  menuItem: menuItem
3093
3090
  };
@@ -9869,11 +9866,11 @@ var onChangeItemName = /*#__PURE__*/function () {
9869
9866
 
9870
9867
  _context12.next = 5;
9871
9868
  return controller.setEditGood({
9872
- itemName: value
9869
+ itemNameSelf: value
9873
9870
  });
9874
9871
 
9875
9872
  case 5:
9876
- _context12.t0 = record.itemNameOther;
9873
+ _context12.t0 = record.itemName;
9877
9874
 
9878
9875
  if (!_context12.t0) {
9879
9876
  _context12.next = 9;
@@ -9882,7 +9879,7 @@ var onChangeItemName = /*#__PURE__*/function () {
9882
9879
 
9883
9880
  _context12.next = 9;
9884
9881
  return controller.setEditGood({
9885
- itemNameOther: setShorthand(record.itemNameOther, shorthand)
9882
+ itemName: setShorthand(record.itemName, shorthand)
9886
9883
  });
9887
9884
 
9888
9885
  case 9:
@@ -9892,11 +9889,11 @@ var onChangeItemName = /*#__PURE__*/function () {
9892
9889
  case 11:
9893
9890
  _context12.next = 13;
9894
9891
  return controller.setEditGood({
9895
- itemNameOther: value
9892
+ itemName: value
9896
9893
  });
9897
9894
 
9898
9895
  case 13:
9899
- _context12.t1 = record.itemName;
9896
+ _context12.t1 = record.itemNameSelf;
9900
9897
 
9901
9898
  if (!_context12.t1) {
9902
9899
  _context12.next = 17;
@@ -9905,7 +9902,7 @@ var onChangeItemName = /*#__PURE__*/function () {
9905
9902
 
9906
9903
  _context12.next = 17;
9907
9904
  return controller.setEditGood({
9908
- itemName: setShorthand(record.itemName, shorthand)
9905
+ itemNameSelf: setShorthand(record.itemNameSelf, shorthand)
9909
9906
  });
9910
9907
 
9911
9908
  case 17:
@@ -10174,7 +10171,7 @@ var useColumns = (function (form) {
10174
10171
  display: 'flex'
10175
10172
  }
10176
10173
  }, getFieldDecorator('itemName', {
10177
- initialValue: isMyShow ? record.itemName : record.itemNameOther,
10174
+ initialValue: isMyShow ? record.itemNameSelf : record.itemName,
10178
10175
  rules: [{
10179
10176
  validator: function () {
10180
10177
  var _validator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_, __, callback) {
@@ -10189,7 +10186,7 @@ var useColumns = (function (form) {
10189
10186
  case 2:
10190
10187
  value = controller.state.goodsListState.editGood;
10191
10188
 
10192
- if (!(!(value === null || value === void 0 ? void 0 : value.itemName) && !(value === null || value === void 0 ? void 0 : value.itemNameOther))) {
10189
+ if (!(!(value === null || value === void 0 ? void 0 : value.itemName) && !(value === null || value === void 0 ? void 0 : value.itemNameSelf))) {
10193
10190
  _context.next = 7;
10194
10191
  break;
10195
10192
  }
@@ -10257,8 +10254,8 @@ var useColumns = (function (form) {
10257
10254
  }))));
10258
10255
  } else {
10259
10256
  return React.createElement(MyItemNameDiv, {
10260
- valueT: formatSearch(record.itemName, searchValue),
10261
- valueF: record.itemNameOther,
10257
+ valueT: formatSearch(record.itemNameSelf, searchValue),
10258
+ valueF: formatSearch(record.itemName, searchValue),
10262
10259
  isMyShow: isMyShow
10263
10260
  }); // return (
10264
10261
  // <span style={{ padding: '0 10px' }}>{formatSearch(value, searchValue)}</span>
@@ -10272,7 +10269,7 @@ var useColumns = (function (form) {
10272
10269
  render: function render(_, record) {
10273
10270
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
10274
10271
  return React.createElement(Form.Item, null, getFieldDecorator('itemModelName', {
10275
- initialValue: isMyShow ? editGood.itemModelName : editGood.itemModelNameOther
10272
+ initialValue: isMyShow ? editGood.itemModelNameSelf : editGood.itemModelName
10276
10273
  })(React.createElement(MyInput, {
10277
10274
  onChange: function () {
10278
10275
  var _onChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
@@ -10285,7 +10282,7 @@ var useColumns = (function (form) {
10285
10282
  return controller.wait();
10286
10283
 
10287
10284
  case 2:
10288
- key = isMyShow ? 'itemModelName' : 'itemModelNameOther';
10285
+ key = isMyShow ? 'itemModelNameSelf' : 'itemModelName';
10289
10286
  value = {};
10290
10287
  value[key] = form.getFieldsValue().itemModelName;
10291
10288
  controller.setEditGood(value);
@@ -10307,10 +10304,10 @@ var useColumns = (function (form) {
10307
10304
  })));
10308
10305
  } else {
10309
10306
  return React.createElement(MyItemNameDiv, {
10310
- valueT: formatSearch(record.itemModelName, searchValue),
10311
- valueF: formatSearch(record.itemModelNameOther, searchValue),
10307
+ valueT: formatSearch(record.itemModelNameSelf, searchValue),
10308
+ valueF: formatSearch(record.itemModelName, searchValue),
10312
10309
  isMyShow: isMyShow
10313
- }); // return <span style={{ padding: '0 10px' }}>{formatSearch(value, searchValue)}</span>;
10310
+ });
10314
10311
  }
10315
10312
  }
10316
10313
  }, {
@@ -10358,11 +10355,7 @@ var useColumns = (function (form) {
10358
10355
  }()
10359
10356
  })));
10360
10357
  } else {
10361
- return React.createElement(MyItemNameDiv, {
10362
- valueT: record.unit,
10363
- valueF: record.unitOther,
10364
- isMyShow: isMyShow
10365
- });
10358
+ return record.unit;
10366
10359
  }
10367
10360
  }
10368
10361
  }, {
@@ -10759,6 +10752,7 @@ var useColumns = (function (form) {
10759
10752
  width: '100%'
10760
10753
  },
10761
10754
  onChange: function onChange() {
10755
+ setChangeField('taxRate');
10762
10756
  onChangeTaxRate(controller, form, record);
10763
10757
  }
10764
10758
  }, taxRateList.map(function (e, i) {
@@ -10785,7 +10779,9 @@ var useColumns = (function (form) {
10785
10779
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
10786
10780
  return getFieldDecorator('taxAmount', {
10787
10781
  initialValue: editGood.taxAmount
10788
- })(React.createElement(MyDiv, null));
10782
+ })(React.createElement(MyDiv, {
10783
+ loading: isCipher(changeField, 'taxAmount')
10784
+ }));
10789
10785
  } else {
10790
10786
  return React.createElement("span", {
10791
10787
  style: {
@@ -10881,11 +10877,21 @@ var MyDiv = /*#__PURE__*/function (_React$Component2) {
10881
10877
  _createClass(MyDiv, [{
10882
10878
  key: "render",
10883
10879
  value: function render() {
10884
- return React.createElement("span", {
10885
- style: {
10886
- padding: '0 10px'
10887
- }
10888
- }, this.props.value);
10880
+ if (this.props.loading) {
10881
+ return React.createElement(Spin, {
10882
+ size: "small"
10883
+ }, React.createElement("span", {
10884
+ style: {
10885
+ padding: '0 10px'
10886
+ }
10887
+ }, this.props.value));
10888
+ } else {
10889
+ return React.createElement("span", {
10890
+ style: {
10891
+ padding: '0 10px'
10892
+ }
10893
+ }, this.props.value);
10894
+ }
10889
10895
  }
10890
10896
  }]);
10891
10897
 
@@ -10953,7 +10959,9 @@ var MyItemNameDiv = /*#__PURE__*/function (_React$Component3) {
10953
10959
  function formatSearch(value, search) {
10954
10960
  if (!value || !search) return value;
10955
10961
 
10956
- var __html = value.split(new RegExp(search, 'g')).join("<span class=\"kts-invoice-operate-goods-list-table-search-protrude\" >".concat(search, "</span>"));
10962
+ var __html = ucoding(value).split(new RegExp(ucoding(search), 'g')).map(function (e) {
10963
+ return dcoding(e);
10964
+ }).join("<span class=\"kts-invoice-operate-goods-list-table-search-protrude\" >".concat(search, "</span>"));
10957
10965
 
10958
10966
  return React.createElement("span", {
10959
10967
  dangerouslySetInnerHTML: {
@@ -10961,6 +10969,22 @@ function formatSearch(value, search) {
10961
10969
  }
10962
10970
  });
10963
10971
  }
10972
+ /** 编码 */
10973
+
10974
+
10975
+ function ucoding(v) {
10976
+ return v.split('').map(function (e) {
10977
+ return "U".concat(e.charCodeAt(0), "E");
10978
+ }).join('');
10979
+ }
10980
+ /** 解码 */
10981
+
10982
+
10983
+ function dcoding(v) {
10984
+ return v.split('U').map(function (e) {
10985
+ return e ? String.fromCharCode(parseInt(e.replace('E', ''))) : '';
10986
+ }).join('');
10987
+ }
10964
10988
 
10965
10989
  var useOnRow = (function () {
10966
10990
  /** 控制器 */
@@ -12565,13 +12589,12 @@ var DrawerBody$2 = function DrawerBody() {
12565
12589
 
12566
12590
 
12567
12591
  if (s.goodsListState.isMyShow) {
12568
- s.goodsListState.form.setFieldsValue(editGood);
12569
- } else {
12570
12592
  s.goodsListState.form.setFieldsValue(_objectSpread2(_objectSpread2({}, editGood), {}, {
12571
- itemName: editGood.itemNameOther,
12572
- unit: editGood.unitOther,
12573
- itemModelName: editGood.itemModelNameOther
12593
+ itemName: editGood.itemNameSelf,
12594
+ itemModelName: editGood.itemModelNameSelf
12574
12595
  }));
12596
+ } else {
12597
+ s.goodsListState.form.setFieldsValue(_objectSpread2({}, editGood));
12575
12598
  }
12576
12599
 
12577
12600
  s.goodsListState.importGoods.isVisibleDrawer = false;
@@ -12621,10 +12644,10 @@ var getItemName$1 = function getItemName(record, editGood) {
12621
12644
  return "*".concat(shorthand, "*").concat(record.itemName);
12622
12645
  }
12623
12646
 
12624
- shorthand = (_getSN = getSN(editGood.itemNameOther)) === null || _getSN === void 0 ? void 0 : _getSN.shorthand;
12647
+ shorthand = (_getSN = getSN(editGood.itemName)) === null || _getSN === void 0 ? void 0 : _getSN.shorthand;
12625
12648
 
12626
12649
  if (shorthand) {
12627
- return "*".concat(shorthand, "*").concat(record.itemName);
12650
+ return "*".concat(shorthand, "*").concat(record.itemNameSelf);
12628
12651
  }
12629
12652
 
12630
12653
  return record.itemName;
@@ -12632,15 +12655,15 @@ var getItemName$1 = function getItemName(record, editGood) {
12632
12655
 
12633
12656
 
12634
12657
  var getItemNameOther = function getItemNameOther(record, editGood) {
12635
- if (!editGood.itemNameOther) return editGood.itemNameOther;
12658
+ if (!editGood.itemName) return editGood.itemName;
12636
12659
  var shorthand;
12637
12660
  shorthand = record.shorthand;
12638
12661
 
12639
12662
  if (shorthand) {
12640
- return "*".concat(shorthand, "*").concat(record.itemName);
12663
+ return "*".concat(shorthand, "*").concat(record.itemNameSelf);
12641
12664
  }
12642
12665
 
12643
- return record.itemNameOther;
12666
+ return record.itemName;
12644
12667
  };
12645
12668
 
12646
12669
  /**
@@ -13202,7 +13225,7 @@ var DrawerBody$3 = function DrawerBody(props) {
13202
13225
  endowCodeGood.forEach(function (good) {
13203
13226
  if (!good) return;
13204
13227
  good.itemName = setShorthand(good.itemName, values.shorthand);
13205
- good.itemNameOther = setShorthand(good.itemNameOther, values.shorthand); // const name = getItemName(good.itemName, values.shorthand);
13228
+ good.itemNameSelf = setShorthand(good.itemNameSelf, values.shorthand); // const name = getItemName(good.itemName, values.shorthand);
13206
13229
  // good.itemName = getItemName(good.itemName, values.shorthand); // `*${values.shorthand}*${name}`;
13207
13230
 
13208
13231
  good.taxClassificationCode = values.taxClassificationCode;
@@ -13452,11 +13475,13 @@ var getShorthand = function getShorthand(value) {
13452
13475
  }
13453
13476
  };
13454
13477
 
13455
- var AddComparisonDrawer = decorator(Form.create())(function (props) {
13456
- var form = props.form;
13457
- var getFieldDecorator = form.getFieldDecorator;
13478
+ function AddComparisonDrawer() {
13479
+ var _Form$useForm = Form$1.useForm(),
13480
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
13481
+ form = _Form$useForm2[0];
13458
13482
  /** 控制器 */
13459
13483
 
13484
+
13460
13485
  var controller = Invoice.useInvoiceController();
13461
13486
  /** 正在 添加商品对照 的货物索引 */
13462
13487
 
@@ -13500,9 +13525,7 @@ var AddComparisonDrawer = decorator(Form.create())(function (props) {
13500
13525
  var onSubmit = React.useCallback(function () {
13501
13526
  controller.run( /*#__PURE__*/function () {
13502
13527
  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;
13528
+ var _getSN, _getSN2, values, shorthand;
13506
13529
 
13507
13530
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
13508
13531
  while (1) {
@@ -13516,49 +13539,34 @@ var AddComparisonDrawer = decorator(Form.create())(function (props) {
13516
13539
  return _context2.abrupt("return");
13517
13540
 
13518
13541
  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");
13542
+ _context2.prev = 2;
13543
+ _context2.next = 5;
13544
+ return form.validateFields();
13533
13545
 
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;
13546
+ case 5:
13547
+ values = _context2.sent;
13548
+ 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
13549
  good.itemCode = values.itemCode;
13537
- good.itemCodeOther = values.itemCodeOther;
13550
+ good.itemCodeSelf = values.itemCodeSelf;
13538
13551
  good.itemName = shorthand ? "*".concat(shorthand, "*").concat(values.itemName) : values.itemName;
13539
- good.itemNameOther = shorthand ? "*".concat(shorthand, "*").concat(values.itemNameOther) : values.itemNameOther;
13552
+ good.itemNameSelf = shorthand ? "*".concat(shorthand, "*").concat(values.itemNameSelf) : values.itemNameSelf;
13540
13553
  good.itemModelName = values.itemModelName;
13541
- good.itemModelNameOther = values.itemModelNameOther;
13542
- good.unit = values.unit;
13543
- good.unitOther = values.unitOther;
13554
+ good.itemModelNameSelf = values.itemModelNameSelf;
13544
13555
  s.goodsListState.addComparisonIndex = undefined;
13545
13556
  s.goodsListState.goodsList = _toConsumableArray(s.goodsListState.goodsList);
13557
+ _context2.next = 19;
13558
+ break;
13546
13559
 
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);
13560
+ case 17:
13561
+ _context2.prev = 17;
13562
+ _context2.t0 = _context2["catch"](2);
13555
13563
 
13556
- case 24:
13564
+ case 19:
13557
13565
  case "end":
13558
13566
  return _context2.stop();
13559
13567
  }
13560
13568
  }
13561
- }, _callee2);
13569
+ }, _callee2, null, [[2, 17]]);
13562
13570
  }));
13563
13571
 
13564
13572
  return function (_x2) {
@@ -13574,115 +13582,74 @@ var AddComparisonDrawer = decorator(Form.create())(function (props) {
13574
13582
 
13575
13583
  form.setFieldsValue(_objectSpread2(_objectSpread2({}, good), {}, {
13576
13584
  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
13585
+ itemNameSelf: (_getSN4 = getSN(good.itemNameSelf)) === null || _getSN4 === void 0 ? void 0 : _getSN4.full
13578
13586
  }));
13579
13587
  }
13580
13588
  }, [good]);
13581
- return React.createElement(Drawer, {
13589
+ return React.createElement(Drawer$1, {
13582
13590
  width: 500,
13583
13591
  onClose: onClose,
13584
13592
  placement: "right",
13585
13593
  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, {
13594
+ visible: !!good,
13595
+ footer: React.createElement("div", {
13596
+ style: {
13597
+ display: 'flex',
13598
+ justifyContent: 'flex-end',
13599
+ gap: 10
13600
+ }
13601
+ }, React.createElement(Button, {
13602
+ type: "primary",
13603
+ onClick: onSubmit
13604
+ }, "\u63D0\u4EA4"), React.createElement(Button, {
13605
+ onClick: onClose
13606
+ }, "\u53D6\u6D88"))
13607
+ }, !!good && React.createElement(Form$1, {
13597
13608
  layout: "vertical",
13598
13609
  style: {
13599
13610
  flex: 1
13600
- }
13611
+ },
13612
+ form: form
13601
13613
  }, React.createElement(Row, {
13602
13614
  gutter: [8, 8]
13603
13615
  }, React.createElement(Col, {
13604
13616
  span: 12
13605
- }, getFieldDecorator('itemCode', {})(React.createElement(Form.Item, {
13617
+ }, React.createElement(Form$1.Item, {
13618
+ name: "itemCodeSelf",
13606
13619
  label: "\u6211\u65B9\u5546\u54C1\u7F16\u7801"
13607
- }, React.createElement(Input, null)))), React.createElement(Col, {
13620
+ }, React.createElement(Input, null))), React.createElement(Col, {
13608
13621
  span: 12
13609
- }, getFieldDecorator('itemCodeOther', {})(React.createElement(Form.Item, {
13622
+ }, React.createElement(Form$1.Item, {
13623
+ name: "itemCode",
13610
13624
  label: "\u5BF9\u65B9\u5546\u54C1\u7F16\u7801"
13611
- }, React.createElement(Input, null)))), React.createElement(Col, {
13625
+ }, React.createElement(Input, null))), React.createElement(Col, {
13612
13626
  span: 12
13613
- }, getFieldDecorator('itemName', {
13614
- rules: [{
13615
- required: true,
13616
- message: "请输入我方商品名称"
13617
- }]
13618
- })(React.createElement(Form.Item, {
13627
+ }, React.createElement(Form$1.Item, {
13628
+ name: "itemNameSelf",
13619
13629
  label: "\u6211\u65B9\u5546\u54C1\u540D\u79F0"
13620
- }, React.createElement(Input, null)))), React.createElement(Col, {
13630
+ }, React.createElement(Input, null))), React.createElement(Col, {
13621
13631
  span: 12
13622
- }, getFieldDecorator('itemNameOther', {
13623
- rules: [{
13624
- required: true,
13625
- message: "请输入对方商品名称"
13626
- }]
13627
- })(React.createElement(Form.Item, {
13632
+ }, React.createElement(Form$1.Item, {
13633
+ name: "itemName",
13628
13634
  label: "\u5BF9\u65B9\u5546\u54C1\u540D\u79F0"
13629
- }, React.createElement(Input, null)))), React.createElement(Col, {
13635
+ }, React.createElement(Input, null))), React.createElement(Col, {
13630
13636
  span: 12
13631
- }, React.createElement(Form.Item, {
13637
+ }, React.createElement(Form$1.Item, {
13638
+ name: 'itemModelNameSelf',
13632
13639
  label: "\u6211\u65B9\u89C4\u683C\u578B\u53F7"
13633
13640
  }, React.createElement(Input, null))), React.createElement(Col, {
13634
13641
  span: 12
13635
- }, getFieldDecorator('itemModelNameOther', {
13636
- rules: [{
13637
- required: true,
13638
- message: "请输入对方规格型号"
13639
- }]
13640
- })(React.createElement(Form.Item, {
13642
+ }, React.createElement(Form$1.Item, {
13643
+ name: "itemModelName",
13641
13644
  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
- }
13645
+ }, React.createElement(Input, null))))));
13646
+ } // function validateFields(form: WrappedFormUtils<any>) {
13647
+ // return new Promise<{ err: any, values: any }>(resolve => {
13648
+ // form.validateFields((err, values) => {
13649
+ // resolve({ err, values })
13650
+ // })
13651
+ // })
13652
+ // }
13686
13653
 
13687
13654
  /** 发票组件的上下文 */
13688
13655