kts-component-invoice-operate 3.2.154 → 3.2.155

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.js CHANGED
@@ -1104,6 +1104,7 @@ var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
1104
1104
  this.goodMax = void 0;
1105
1105
  this.isSwitchTax = void 0;
1106
1106
  this.isRecalculateWhenSwitchTax = false;
1107
+ this.isUpdateGoodsTaxRateList = false;
1107
1108
  this.isAddDiscount = void 0;
1108
1109
  this.isAddRow = true;
1109
1110
  this.isRemRow = true;
@@ -9749,6 +9750,7 @@ var InvoiceController = /*#__PURE__*/function (_InvoiceControllerFor) {
9749
9750
  _this.getGoodsList = void 0;
9750
9751
  _this.getTaxCategoryCodeList = void 0;
9751
9752
  _this.getGoodsSearch = getGoodsSearch;
9753
+ _this.getGoodsTaxRateList = void 0;
9752
9754
  return _this;
9753
9755
  } // ----------------- 发票头 模块相关 -----------------
9754
9756
 
@@ -10174,8 +10176,8 @@ function TableVirtual (props) {
10174
10176
  var cont = self.querySelector('.kts-invoice-operate-goods-table-virtual .ktsAntX-table-body');
10175
10177
  if (!cont) return;
10176
10178
  cont.scrollTop = 0;
10177
- }, [(_props$dataSource = props.dataSource) === null || _props$dataSource === void 0 ? void 0 : _props$dataSource.length]);
10178
- console.log('===> pointer', pointer, dataSource);
10179
+ }, [(_props$dataSource = props.dataSource) === null || _props$dataSource === void 0 ? void 0 : _props$dataSource.length]); // console.log('===> pointer', pointer, dataSource);
10180
+
10179
10181
  return /*#__PURE__*/React__default['default'].createElement("span", {
10180
10182
  className: "kts-invoice-operate-goods-table-virtual",
10181
10183
  ref: function ref(e) {
@@ -14017,7 +14019,7 @@ var useColumns = (function (form) {
14017
14019
  setChangeField('taxRate');
14018
14020
  onChangeTaxRate(controller, form, record);
14019
14021
  }
14020
- }, taxRateList.map(function (e, i) {
14022
+ }, (record.goodsTaxRateList || taxRateList).map(function (e, i) {
14021
14023
  return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Select.Option, {
14022
14024
  key: i,
14023
14025
  value: e
@@ -14381,7 +14383,7 @@ var useOnRow = (function () {
14381
14383
 
14382
14384
  case 7:
14383
14385
  if (!editGood) {
14384
- _context2.next = 18;
14386
+ _context2.next = 22;
14385
14387
  break;
14386
14388
  }
14387
14389
 
@@ -14401,7 +14403,19 @@ var useOnRow = (function () {
14401
14403
  return controller.wait();
14402
14404
 
14403
14405
  case 14:
14404
- _context2.next = 16;
14406
+ if (!(controller.getGoodsTaxRateList && record.taxClassificationCode && !record.goodsTaxRateList)) {
14407
+ _context2.next = 18;
14408
+ break;
14409
+ }
14410
+
14411
+ _context2.next = 17;
14412
+ return controller.getGoodsTaxRateList(record.taxClassificationCode);
14413
+
14414
+ case 17:
14415
+ record.goodsTaxRateList = _context2.sent;
14416
+
14417
+ case 18:
14418
+ _context2.next = 20;
14405
14419
  return controller.pipeline( /*#__PURE__*/function () {
14406
14420
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
14407
14421
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -14431,15 +14445,27 @@ var useOnRow = (function () {
14431
14445
  };
14432
14446
  }())();
14433
14447
 
14434
- case 16:
14435
- _context2.next = 20;
14448
+ case 20:
14449
+ _context2.next = 28;
14436
14450
  break;
14437
14451
 
14438
- case 18:
14439
- _context2.next = 20;
14452
+ case 22:
14453
+ if (!(controller.getGoodsTaxRateList && record.taxClassificationCode && !record.goodsTaxRateList)) {
14454
+ _context2.next = 26;
14455
+ break;
14456
+ }
14457
+
14458
+ _context2.next = 25;
14459
+ return controller.getGoodsTaxRateList(record.taxClassificationCode);
14460
+
14461
+ case 25:
14462
+ record.goodsTaxRateList = _context2.sent;
14463
+
14464
+ case 26:
14465
+ _context2.next = 28;
14440
14466
  return controller.setEditGood(record);
14441
14467
 
14442
- case 20:
14468
+ case 28:
14443
14469
  case "end":
14444
14470
  return _context2.stop();
14445
14471
  }
@@ -14819,7 +14845,7 @@ var useRowSelection = (function () {
14819
14845
  onSelect: onSelect,
14820
14846
  selectedRowKeys: selectedRowKeys,
14821
14847
  getCheckboxProps: function getCheckboxProps(record) {
14822
- console.log('===> getCheckboxProps', record, record.level);
14848
+ // console.log('===> getCheckboxProps', record, record.level)
14823
14849
  return {
14824
14850
  disabled: record.level > 0,
14825
14851
  style: record.level > 0 ? {
@@ -20235,6 +20261,11 @@ var useColumns$1 = (function (form) {
20235
20261
  var model = controller.useMemo(function (e) {
20236
20262
  return e.model;
20237
20263
  }, []);
20264
+ /** 计算类型 */
20265
+
20266
+ var calculateType = controller.useMemo(function (e) {
20267
+ return e.goodsListState.calculateType;
20268
+ }, []);
20238
20269
  /** 是否显示我方 */
20239
20270
 
20240
20271
  var isMyShow = controller.useMemo(function (e) {
@@ -20361,7 +20392,7 @@ var useColumns$1 = (function (form) {
20361
20392
  }, "\u9879\u76EE\u540D\u79F0"),
20362
20393
  key: 'itemName',
20363
20394
  render: function render(_, record) {
20364
- if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('itemName')) {
20395
+ if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('itemName') && model !== 'prefab') {
20365
20396
  return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, /*#__PURE__*/React__default['default'].createElement("div", {
20366
20397
  style: {
20367
20398
  display: 'flex'
@@ -20471,7 +20502,7 @@ var useColumns$1 = (function (form) {
20471
20502
  key: 'itemModelName',
20472
20503
  width: 119,
20473
20504
  render: function render(_, record) {
20474
- if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('itemModelName')) {
20505
+ if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('itemModelName') && model !== 'prefab') {
20475
20506
  return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('itemModelName', {
20476
20507
  initialValue: isMyShow ? editGood.itemModelNameSelf : editGood.itemModelName,
20477
20508
  rules: getReplenishRules('itemModelName')
@@ -20522,7 +20553,7 @@ var useColumns$1 = (function (form) {
20522
20553
  key: 'unit',
20523
20554
  width: 70,
20524
20555
  render: function render(_, record) {
20525
- if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('unit')) {
20556
+ if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('unit') && model !== 'prefab') {
20526
20557
  return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('unit', {
20527
20558
  initialValue: editGood.unit,
20528
20559
  rules: getReplenishRules('unit')
@@ -20580,7 +20611,7 @@ var useColumns$1 = (function (form) {
20580
20611
  align: 'right',
20581
20612
  width: 149,
20582
20613
  render: function render(value, record) {
20583
- if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('quantity')) {
20614
+ if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('quantity') && model !== 'prefab') {
20584
20615
  return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('quantity', {
20585
20616
  initialValue: nonScientificNotation(editGood.quantity),
20586
20617
  getValueFromEvent: onNumberValueChange,
@@ -20675,7 +20706,7 @@ var useColumns$1 = (function (form) {
20675
20706
  align: 'right',
20676
20707
  width: 149,
20677
20708
  render: function render(value, record) {
20678
- if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('priceIncludeTax')) {
20709
+ if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('priceIncludeTax') && model !== 'prefab') {
20679
20710
  return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('priceIncludeTax', {
20680
20711
  initialValue: nonScientificNotation(editGood.priceIncludeTax),
20681
20712
  getValueFromEvent: onNumberValueChange,
@@ -20750,7 +20781,7 @@ var useColumns$1 = (function (form) {
20750
20781
  align: 'right',
20751
20782
  width: 149,
20752
20783
  render: function render(value, record) {
20753
- if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('priceExcludeTax')) {
20784
+ if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('priceExcludeTax') && model !== 'prefab') {
20754
20785
  return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('priceExcludeTax', {
20755
20786
  initialValue: nonScientificNotation(editGood.priceExcludeTax),
20756
20787
  getValueFromEvent: onNumberValueChange,
@@ -20825,7 +20856,7 @@ var useColumns$1 = (function (form) {
20825
20856
  width: 119,
20826
20857
  align: 'right',
20827
20858
  render: function render(value, record) {
20828
- if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('lineAmountIncludeTax')) {
20859
+ if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('lineAmountIncludeTax') && model !== 'prefab') {
20829
20860
  return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('lineAmountIncludeTax', {
20830
20861
  initialValue: editGood.lineAmountIncludeTax,
20831
20862
  getValueFromEvent: onNumberValueChange,
@@ -20913,7 +20944,7 @@ var useColumns$1 = (function (form) {
20913
20944
  align: 'right',
20914
20945
  width: 119,
20915
20946
  render: function render(value, record) {
20916
- if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('lineAmountExcludeTax')) {
20947
+ if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('lineAmountExcludeTax') && model !== 'prefab') {
20917
20948
  return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('lineAmountExcludeTax', {
20918
20949
  initialValue: editGood.lineAmountExcludeTax,
20919
20950
  getValueFromEvent: onNumberValueChange,
@@ -20976,7 +21007,7 @@ var useColumns$1 = (function (form) {
20976
21007
  align: 'right',
20977
21008
  width: 70,
20978
21009
  render: function render(value, record) {
20979
- if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('taxRate')) {
21010
+ if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('taxRate') && !(model === 'prefab' && calculateType === '3')) {
20980
21011
  return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('taxRate', {
20981
21012
  initialValue: editGood.taxRate,
20982
21013
  rules: [].concat(_toConsumableArray(getReplenishRules('taxRate')), [{
@@ -21000,7 +21031,7 @@ var useColumns$1 = (function (form) {
21000
21031
  setChangeField('taxRate');
21001
21032
  onChangeTaxRate$1(controller, form, record);
21002
21033
  }
21003
- }, taxRateList.map(function (e, i) {
21034
+ }, (record.goodsTaxRateList || taxRateList).map(function (e, i) {
21004
21035
  return /*#__PURE__*/React__default['default'].createElement(ktsXui.Select.Option, {
21005
21036
  key: i,
21006
21037
  value: e
@@ -21068,7 +21099,7 @@ var useColumns$1 = (function (form) {
21068
21099
  ellipsis: true
21069
21100
  });
21070
21101
  });
21071
- }, [isTaxIncluded, editGood, controller, taxRateList, changeField, deduction, isMyShow, searchValue, model, columnsReplenish, isStart]); // React.useEffect(() => {
21102
+ }, [isTaxIncluded, editGood, controller, taxRateList, changeField, deduction, isMyShow, searchValue, model, columnsReplenish, isStart, calculateType]); // React.useEffect(() => {
21072
21103
  // clearTimeout(t)
21073
21104
  // const t = setTimeout(() => { setChangeField('') }, 1000);
21074
21105
  // return () => { clearTimeout(t) }
@@ -21268,7 +21299,7 @@ var useOnRow$1 = (function () {
21268
21299
  while (1) {
21269
21300
  switch (_context2.prev = _context2.next) {
21270
21301
  case 0:
21271
- if (!(model === 'prefab')) {
21302
+ if (!(model === 'readOnly')) {
21272
21303
  _context2.next = 2;
21273
21304
  break;
21274
21305
  }
@@ -21276,46 +21307,50 @@ var useOnRow$1 = (function () {
21276
21307
  return _context2.abrupt("return");
21277
21308
 
21278
21309
  case 2:
21279
- if (!(model === 'readOnly')) {
21280
- _context2.next = 4;
21281
- break;
21282
- }
21283
-
21284
- return _context2.abrupt("return");
21285
-
21286
- case 4:
21287
21310
  editGood = controller.state.goodsListState.editGood;
21288
21311
 
21289
21312
  if (!(record.lineAttribute !== LineAttributeType$1.正常)) {
21290
- _context2.next = 7;
21313
+ _context2.next = 5;
21291
21314
  break;
21292
21315
  }
21293
21316
 
21294
21317
  return _context2.abrupt("return");
21295
21318
 
21296
- case 7:
21319
+ case 5:
21297
21320
  if (!editGood) {
21298
- _context2.next = 18;
21321
+ _context2.next = 20;
21299
21322
  break;
21300
21323
  }
21301
21324
 
21302
21325
  if (!(editGood.$index === record.$index)) {
21303
- _context2.next = 10;
21326
+ _context2.next = 8;
21304
21327
  break;
21305
21328
  }
21306
21329
 
21307
21330
  return _context2.abrupt("return");
21308
21331
 
21332
+ case 8:
21333
+ _context2.next = 10;
21334
+ return controller.saveEditGood();
21335
+
21309
21336
  case 10:
21310
21337
  _context2.next = 12;
21311
- return controller.saveEditGood();
21338
+ return controller.wait();
21312
21339
 
21313
21340
  case 12:
21314
- _context2.next = 14;
21315
- return controller.wait();
21341
+ if (!(controller.getGoodsTaxRateList && record.taxClassificationCode && !record.goodsTaxRateList)) {
21342
+ _context2.next = 16;
21343
+ break;
21344
+ }
21316
21345
 
21317
- case 14:
21318
- _context2.next = 16;
21346
+ _context2.next = 15;
21347
+ return controller.getGoodsTaxRateList(record.taxClassificationCode);
21348
+
21349
+ case 15:
21350
+ record.goodsTaxRateList = _context2.sent;
21351
+
21352
+ case 16:
21353
+ _context2.next = 18;
21319
21354
  return controller.pipeline( /*#__PURE__*/function () {
21320
21355
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
21321
21356
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -21345,15 +21380,27 @@ var useOnRow$1 = (function () {
21345
21380
  };
21346
21381
  }())();
21347
21382
 
21348
- case 16:
21349
- _context2.next = 20;
21383
+ case 18:
21384
+ _context2.next = 26;
21350
21385
  break;
21351
21386
 
21352
- case 18:
21353
- _context2.next = 20;
21387
+ case 20:
21388
+ if (!(controller.getGoodsTaxRateList && record.taxClassificationCode && !record.goodsTaxRateList)) {
21389
+ _context2.next = 24;
21390
+ break;
21391
+ }
21392
+
21393
+ _context2.next = 23;
21394
+ return controller.getGoodsTaxRateList(record.taxClassificationCode);
21395
+
21396
+ case 23:
21397
+ record.goodsTaxRateList = _context2.sent;
21398
+
21399
+ case 24:
21400
+ _context2.next = 26;
21354
21401
  return controller.setEditGood(record);
21355
21402
 
21356
- case 20:
21403
+ case 26:
21357
21404
  case "end":
21358
21405
  return _context2.stop();
21359
21406
  }
@@ -23655,7 +23702,7 @@ var EndowCodeDrawer = (function () {
23655
23702
  if (visible) {
23656
23703
  controller.pipeline( /*#__PURE__*/function () {
23657
23704
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
23658
- var endowcodeGoodIndex, good, getDefaultValue;
23705
+ var endowcodeGoodIndex, good, getDefaultValue, goodsTaxRateList;
23659
23706
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
23660
23707
  while (1) {
23661
23708
  switch (_context2.prev = _context2.next) {
@@ -23689,19 +23736,40 @@ var EndowCodeDrawer = (function () {
23689
23736
  case 9:
23690
23737
  _context2.t1 = _context2.sent;
23691
23738
  (0, _context2.t0)(_context2.t1);
23692
- _context2.next = 14;
23739
+ _context2.next = 23;
23693
23740
  break;
23694
23741
 
23695
23742
  case 13:
23696
- if (endowcodeGoodIndex.length === 1) {
23697
- setDefaultValue(good);
23698
- } else {
23699
- setDefaultValue({
23700
- taxRate: good.taxRate
23701
- });
23743
+ if (!(endowcodeGoodIndex.length === 1)) {
23744
+ _context2.next = 22;
23745
+ break;
23746
+ }
23747
+
23748
+ if (!(controller.state.goodsListState.isUpdateGoodsTaxRateList && controller.getGoodsTaxRateList && good.taxClassificationCode)) {
23749
+ _context2.next = 19;
23750
+ break;
23702
23751
  }
23703
23752
 
23704
- case 14:
23753
+ _context2.next = 17;
23754
+ return controller.getGoodsTaxRateList(good.taxClassificationCode);
23755
+
23756
+ case 17:
23757
+ goodsTaxRateList = _context2.sent;
23758
+ good.goodsTaxRateList = goodsTaxRateList; // if (good.taxRate !== undefined && good.taxRate !== null && !goodsTaxRateList.includes(good.taxRate)) {
23759
+ // good.taxRate = undefined;
23760
+ // }
23761
+
23762
+ case 19:
23763
+ setDefaultValue(good);
23764
+ _context2.next = 23;
23765
+ break;
23766
+
23767
+ case 22:
23768
+ setDefaultValue({
23769
+ taxRate: good.taxRate
23770
+ });
23771
+
23772
+ case 23:
23705
23773
  case "end":
23706
23774
  return _context2.stop();
23707
23775
  }
@@ -23767,12 +23835,7 @@ var DrawerBody$3 = function DrawerBody(props) {
23767
23835
  /** 税率列表 */
23768
23836
 
23769
23837
  var taxRateList = controller.useMemo(function (s) {
23770
- return s.goodsListState.taxRateList.map(function (e) {
23771
- return {
23772
- label: "".concat(e, "%"),
23773
- value: e
23774
- };
23775
- });
23838
+ return s.goodsListState.taxRateList;
23776
23839
  }, []);
23777
23840
  /** 免税类型 列表 */
23778
23841
 
@@ -23793,14 +23856,29 @@ var DrawerBody$3 = function DrawerBody(props) {
23793
23856
  _React$useState4 = _slicedToArray(_React$useState3, 2),
23794
23857
  taxRate = _React$useState4[0],
23795
23858
  setTaxRate = _React$useState4[1];
23796
- /** 税收分类编码 选择组件 */
23859
+ /** 商品可用税率 */
23860
+
23797
23861
 
23862
+ var _React$useState5 = React__default['default'].useState(defaultValue.goodsTaxRateList),
23863
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
23864
+ goodsTaxRateList = _React$useState6[0],
23865
+ setGoodsTaxRateList = _React$useState6[1];
23866
+
23867
+ var formattedTaxRateList = React__default['default'].useMemo(function () {
23868
+ return (goodsTaxRateList || taxRateList).map(function (e) {
23869
+ return {
23870
+ label: "".concat(e, "%"),
23871
+ value: e
23872
+ };
23873
+ });
23874
+ }, [goodsTaxRateList, taxRateList]);
23875
+ /** 税收分类编码 选择组件 */
23798
23876
 
23799
23877
  var ShowSearch = React__default['default'].useCallback(function (props) {
23800
- var _React$useState5 = React__default['default'].useState([]),
23801
- _React$useState6 = _slicedToArray(_React$useState5, 2),
23802
- dataSource = _React$useState6[0],
23803
- setDataSource = _React$useState6[1];
23878
+ var _React$useState7 = React__default['default'].useState([]),
23879
+ _React$useState8 = _slicedToArray(_React$useState7, 2),
23880
+ dataSource = _React$useState8[0],
23881
+ setDataSource = _React$useState8[1];
23804
23882
 
23805
23883
  var onSearch = React__default['default'].useCallback( /*#__PURE__*/function () {
23806
23884
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(e) {
@@ -23883,22 +23961,22 @@ var DrawerBody$3 = function DrawerBody(props) {
23883
23961
 
23884
23962
  var ShowSearch2 = React__default['default'].useCallback(function (props) {
23885
23963
  // 是否显示
23886
- var _React$useState7 = React__default['default'].useState(false),
23887
- _React$useState8 = _slicedToArray(_React$useState7, 2),
23888
- visible = _React$useState8[0],
23889
- setVisible = _React$useState8[1]; // 税收分类编码树
23890
-
23891
-
23892
- var _React$useState9 = React__default['default'].useState(),
23964
+ var _React$useState9 = React__default['default'].useState(false),
23893
23965
  _React$useState10 = _slicedToArray(_React$useState9, 2),
23894
- list = _React$useState10[0],
23895
- setList = _React$useState10[1]; // 搜索条件
23966
+ visible = _React$useState10[0],
23967
+ setVisible = _React$useState10[1]; // 税收分类编码树
23896
23968
 
23897
23969
 
23898
23970
  var _React$useState11 = React__default['default'].useState(),
23899
23971
  _React$useState12 = _slicedToArray(_React$useState11, 2),
23900
- filter = _React$useState12[0],
23901
- setFilter = _React$useState12[1];
23972
+ list = _React$useState12[0],
23973
+ setList = _React$useState12[1]; // 搜索条件
23974
+
23975
+
23976
+ var _React$useState13 = React__default['default'].useState(),
23977
+ _React$useState14 = _slicedToArray(_React$useState13, 2),
23978
+ filter = _React$useState14[0],
23979
+ setFilter = _React$useState14[1];
23902
23980
  /** 创建 树节点 */
23903
23981
 
23904
23982
 
@@ -24084,15 +24162,15 @@ var DrawerBody$3 = function DrawerBody(props) {
24084
24162
  /** 税收分类编码 选择组件3 */
24085
24163
 
24086
24164
  var ShowSearch3 = React__default['default'].useCallback(function (props) {
24087
- var _React$useState13 = React__default['default'].useState(false),
24088
- _React$useState14 = _slicedToArray(_React$useState13, 2),
24089
- open = _React$useState14[0],
24090
- setOpen = _React$useState14[1];
24091
-
24092
- var _React$useState15 = React__default['default'].useState([]),
24165
+ var _React$useState15 = React__default['default'].useState(false),
24093
24166
  _React$useState16 = _slicedToArray(_React$useState15, 2),
24094
- list = _React$useState16[0],
24095
- setList = _React$useState16[1];
24167
+ open = _React$useState16[0],
24168
+ setOpen = _React$useState16[1];
24169
+
24170
+ var _React$useState17 = React__default['default'].useState([]),
24171
+ _React$useState18 = _slicedToArray(_React$useState17, 2),
24172
+ list = _React$useState18[0],
24173
+ setList = _React$useState18[1];
24096
24174
 
24097
24175
  var onSearch = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
24098
24176
  var _value$target;
@@ -24200,16 +24278,55 @@ var DrawerBody$3 = function DrawerBody(props) {
24200
24278
  }, _callee11);
24201
24279
  })), []);
24202
24280
  var onSelect = React__default['default'].useCallback(function (key, info) {
24203
- // !readOnlyTaxRate && actions.setFieldState('taxRate', async s => {
24281
+ // 根据税编改变税率列表
24282
+ // 如果只有一个,默认选中,有多个时,置空,用户手选
24283
+ if (controller.state.goodsListState.isUpdateGoodsTaxRateList) {
24284
+ var _info$node$taxRateLis;
24285
+
24286
+ if ((_info$node$taxRateLis = info.node.taxRateList) === null || _info$node$taxRateLis === void 0 ? void 0 : _info$node$taxRateLis.length) {
24287
+ setGoodsTaxRateList(info.node.taxRateList);
24288
+ }
24289
+
24290
+ if (!readOnlyTaxRate) {
24291
+ actions.setFieldState('taxRate', /*#__PURE__*/function () {
24292
+ var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(s) {
24293
+ var _info$node$taxRateLis2;
24294
+
24295
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
24296
+ while (1) {
24297
+ switch (_context12.prev = _context12.next) {
24298
+ case 0:
24299
+ if (info.node.taxRateList && ((_info$node$taxRateLis2 = info.node.taxRateList) === null || _info$node$taxRateLis2 === void 0 ? void 0 : _info$node$taxRateLis2.length) === 1) {
24300
+ s.value = info.node.taxRateList[0];
24301
+ } else {
24302
+ s.value = undefined;
24303
+ }
24304
+
24305
+ case 1:
24306
+ case "end":
24307
+ return _context12.stop();
24308
+ }
24309
+ }
24310
+ }, _callee12);
24311
+ }));
24312
+
24313
+ return function (_x8) {
24314
+ return _ref12.apply(this, arguments);
24315
+ };
24316
+ }());
24317
+ }
24318
+ } // !readOnlyTaxRate && actions.setFieldState('taxRate', async s => {
24204
24319
  // if (info.node.taxRate || info.taxRate === 0) {
24205
24320
  // s.value = info.node.taxRate
24206
24321
  // }
24207
24322
  // });
24323
+
24324
+
24208
24325
  actions.setFieldState('taxClassificationCode', /*#__PURE__*/function () {
24209
- var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(s) {
24210
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
24326
+ var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(s) {
24327
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
24211
24328
  while (1) {
24212
- switch (_context12.prev = _context12.next) {
24329
+ switch (_context13.prev = _context13.next) {
24213
24330
  case 0:
24214
24331
  if (info.node.taxCategoryCode) {
24215
24332
  s.value = info.node.taxCategoryCode;
@@ -24217,21 +24334,21 @@ var DrawerBody$3 = function DrawerBody(props) {
24217
24334
 
24218
24335
  case 1:
24219
24336
  case "end":
24220
- return _context12.stop();
24337
+ return _context13.stop();
24221
24338
  }
24222
24339
  }
24223
- }, _callee12);
24340
+ }, _callee13);
24224
24341
  }));
24225
24342
 
24226
- return function (_x8) {
24227
- return _ref12.apply(this, arguments);
24343
+ return function (_x9) {
24344
+ return _ref13.apply(this, arguments);
24228
24345
  };
24229
24346
  }());
24230
24347
  actions.setFieldState('shorthand', /*#__PURE__*/function () {
24231
- var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(s) {
24232
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
24348
+ var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
24349
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
24233
24350
  while (1) {
24234
- switch (_context13.prev = _context13.next) {
24351
+ switch (_context14.prev = _context14.next) {
24235
24352
  case 0:
24236
24353
  if (info.node.shorthand) {
24237
24354
  s.value = info.node.shorthand;
@@ -24239,14 +24356,14 @@ var DrawerBody$3 = function DrawerBody(props) {
24239
24356
 
24240
24357
  case 1:
24241
24358
  case "end":
24242
- return _context13.stop();
24359
+ return _context14.stop();
24243
24360
  }
24244
24361
  }
24245
- }, _callee13);
24362
+ }, _callee14);
24246
24363
  }));
24247
24364
 
24248
- return function (_x9) {
24249
- return _ref13.apply(this, arguments);
24365
+ return function (_x10) {
24366
+ return _ref14.apply(this, arguments);
24250
24367
  };
24251
24368
  }());
24252
24369
  setOpen(false);
@@ -24297,19 +24414,19 @@ var DrawerBody$3 = function DrawerBody(props) {
24297
24414
  }));
24298
24415
  }, [controller, actions]); // 是否享受优惠政策
24299
24416
 
24300
- var _React$useState17 = React__default['default'].useState(0),
24301
- _React$useState18 = _slicedToArray(_React$useState17, 2),
24302
- favouredPolicyMark = _React$useState18[0],
24303
- setFavouredPolicyMark = _React$useState18[1]; // 确定
24417
+ var _React$useState19 = React__default['default'].useState(0),
24418
+ _React$useState20 = _slicedToArray(_React$useState19, 2),
24419
+ favouredPolicyMark = _React$useState20[0],
24420
+ setFavouredPolicyMark = _React$useState20[1]; // 确定
24304
24421
 
24305
24422
 
24306
24423
  var onSubmit = React__default['default'].useCallback(function (values) {
24307
24424
  controller.pipeline( /*#__PURE__*/function () {
24308
- var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
24425
+ var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(s) {
24309
24426
  var endowCodeGood;
24310
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
24427
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
24311
24428
  while (1) {
24312
- switch (_context14.prev = _context14.next) {
24429
+ switch (_context15.prev = _context15.next) {
24313
24430
  case 0:
24314
24431
  endowCodeGood = s.goodsListState.endowCode.endowcodeGoodIndex.map(function (e) {
24315
24432
  return s.goodsListState.goodsMap.get(e);
@@ -24332,46 +24449,49 @@ var DrawerBody$3 = function DrawerBody(props) {
24332
24449
 
24333
24450
  if (good.lineAmountExcludeTax && good.quantity) {
24334
24451
  good.priceExcludeTax = countPrice(good.lineAmountExcludeTax, good.quantity, controller.state.calculatingDigits);
24335
- }
24452
+ } //赋值商品的可用税率
24453
+
24454
+
24455
+ good.goodsTaxRateList = goodsTaxRateList;
24336
24456
  });
24337
24457
  s.goodsListState.goodsList = s.goodsListState.goodsList.slice();
24338
24458
  s.goodsListState.endowCode.endowcodeGoodIndex = [];
24339
24459
 
24340
24460
  case 4:
24341
24461
  case "end":
24342
- return _context14.stop();
24462
+ return _context15.stop();
24343
24463
  }
24344
24464
  }
24345
- }, _callee14);
24465
+ }, _callee15);
24346
24466
  }));
24347
24467
 
24348
- return function (_x10) {
24349
- return _ref14.apply(this, arguments);
24468
+ return function (_x11) {
24469
+ return _ref15.apply(this, arguments);
24350
24470
  };
24351
24471
  }())();
24352
- }, [controller]);
24472
+ }, [controller, goodsTaxRateList]);
24353
24473
  var effects = React__default['default'].useCallback(function () {
24354
24474
  // 税率变化
24355
24475
  antd.FormEffectHooks.onFieldValueChange$('taxRate').subscribe(function (e) {
24356
24476
  setTaxRate(e.value);
24357
24477
  actions.setFieldState('taxFreeType', /*#__PURE__*/function () {
24358
- var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(s) {
24359
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
24478
+ var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(s) {
24479
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
24360
24480
  while (1) {
24361
- switch (_context15.prev = _context15.next) {
24481
+ switch (_context16.prev = _context16.next) {
24362
24482
  case 0:
24363
24483
  if (e.value !== 0) s.value = undefined;
24364
24484
 
24365
24485
  case 1:
24366
24486
  case "end":
24367
- return _context15.stop();
24487
+ return _context16.stop();
24368
24488
  }
24369
24489
  }
24370
- }, _callee15);
24490
+ }, _callee16);
24371
24491
  }));
24372
24492
 
24373
- return function (_x11) {
24374
- return _ref15.apply(this, arguments);
24493
+ return function (_x12) {
24494
+ return _ref16.apply(this, arguments);
24375
24495
  };
24376
24496
  }());
24377
24497
  }); // 是否享受优惠政策
@@ -24379,23 +24499,23 @@ var DrawerBody$3 = function DrawerBody(props) {
24379
24499
  antd.FormEffectHooks.onFieldValueChange$('favouredPolicyMark').subscribe(function (e) {
24380
24500
  setFavouredPolicyMark(e.value);
24381
24501
  actions.setFieldState('favouredPolicyName', /*#__PURE__*/function () {
24382
- var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(s) {
24383
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
24502
+ var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(s) {
24503
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
24384
24504
  while (1) {
24385
- switch (_context16.prev = _context16.next) {
24505
+ switch (_context17.prev = _context17.next) {
24386
24506
  case 0:
24387
24507
  if (e.value === 0) s.value = undefined;
24388
24508
 
24389
24509
  case 1:
24390
24510
  case "end":
24391
- return _context16.stop();
24511
+ return _context17.stop();
24392
24512
  }
24393
24513
  }
24394
- }, _callee16);
24514
+ }, _callee17);
24395
24515
  }));
24396
24516
 
24397
- return function (_x12) {
24398
- return _ref16.apply(this, arguments);
24517
+ return function (_x13) {
24518
+ return _ref17.apply(this, arguments);
24399
24519
  };
24400
24520
  }());
24401
24521
  });
@@ -24435,7 +24555,7 @@ var DrawerBody$3 = function DrawerBody(props) {
24435
24555
  disabled: readOnlyTaxRate
24436
24556
  },
24437
24557
  default: (_defaultValue$taxRate = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.taxRate) !== null && _defaultValue$taxRate !== void 0 ? _defaultValue$taxRate : 0,
24438
- enum: taxRateList,
24558
+ enum: formattedTaxRateList,
24439
24559
  "x-rules": [{
24440
24560
  message: '请选择税率',
24441
24561
  required: true
@@ -24495,23 +24615,23 @@ var DrawerBody$3 = function DrawerBody(props) {
24495
24615
  }, "\u786E\u5B9A"), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Button, {
24496
24616
  onClick: function onClick() {
24497
24617
  controller.pipeline( /*#__PURE__*/function () {
24498
- var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(s) {
24499
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
24618
+ var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(s) {
24619
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
24500
24620
  while (1) {
24501
- switch (_context17.prev = _context17.next) {
24621
+ switch (_context18.prev = _context18.next) {
24502
24622
  case 0:
24503
- return _context17.abrupt("return", s.goodsListState.endowCode.endowcodeGoodIndex = []);
24623
+ return _context18.abrupt("return", s.goodsListState.endowCode.endowcodeGoodIndex = []);
24504
24624
 
24505
24625
  case 1:
24506
24626
  case "end":
24507
- return _context17.stop();
24627
+ return _context18.stop();
24508
24628
  }
24509
24629
  }
24510
- }, _callee17);
24630
+ }, _callee18);
24511
24631
  }));
24512
24632
 
24513
- return function (_x13) {
24514
- return _ref17.apply(this, arguments);
24633
+ return function (_x14) {
24634
+ return _ref18.apply(this, arguments);
24515
24635
  };
24516
24636
  }())();
24517
24637
  }