kts-component-invoice-operate 3.2.153 → 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.
Files changed (31) hide show
  1. package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood/index.d.ts +6 -0
  2. package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/index.d.ts +4 -0
  3. package/dist/Invoice/InvoiceController/index.d.ts +2 -0
  4. package/dist/Invoice/_test/children/index.d.ts +4 -0
  5. package/dist/Invoice/ui/default/GoodsList/hook/useColumns/ui/Expand/index.d.ts +6 -0
  6. package/dist/Invoice/ui/default/GoodsList/hook/useRowSelection/index.d.ts +6 -0
  7. package/dist/index.esm.js +498 -185
  8. package/dist/index.js +497 -184
  9. package/docs-dist/static/I001.4ff48f20.svg +1 -0
  10. package/docs-dist/static/I002.38b94da1.svg +1 -0
  11. package/docs-dist/umi.css +1 -1
  12. package/docs-dist/umi.js +1 -1
  13. package/package.json +1 -1
  14. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood/index.ts +9 -0
  15. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/index.ts +6 -0
  16. package/src/Invoice/InvoiceController/fns/saveEditGood.ts +1 -1
  17. package/src/Invoice/InvoiceController/index.ts +4 -0
  18. package/src/Invoice/_test/children/index.tsx +203 -0
  19. package/src/Invoice/index.md +3 -0
  20. package/src/Invoice/ui/default/EndowCodeDrawer/index.tsx +39 -3
  21. package/src/Invoice/ui/default/GoodsList/hook/useColumns/index.tsx +15 -2
  22. package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/Expand/index.tsx +53 -0
  23. package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/Expand/svg/I001.svg +1 -0
  24. package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/Expand/svg/I002.svg +1 -0
  25. package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/RowMenu/index.tsx +1 -0
  26. package/src/Invoice/ui/default/GoodsList/hook/useOnRow/index.tsx +13 -0
  27. package/src/Invoice/ui/default/GoodsList/hook/useRowSelection/index.tsx +8 -2
  28. package/src/Invoice/ui/default/GoodsList/index.less +8 -1
  29. package/src/Invoice/ui/default/GoodsList/ui/TableVirtual/index.tsx +35 -12
  30. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/index.tsx +14 -11
  31. package/src/Invoice/ui/digtal/GoodsList/hook/useOnRow/index.tsx +13 -1
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;
@@ -1120,6 +1121,7 @@ var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
1120
1121
  this.searchValue = '';
1121
1122
  this.goodsList = [];
1122
1123
  this.goodsMap = new Map();
1124
+ this.expandedRowKeys = [];
1123
1125
  this.goodsMenuExpand = [];
1124
1126
  this.amountIncludeTax = void 0;
1125
1127
  this.amountExcludeTax = void 0;
@@ -9748,6 +9750,7 @@ var InvoiceController = /*#__PURE__*/function (_InvoiceControllerFor) {
9748
9750
  _this.getGoodsList = void 0;
9749
9751
  _this.getTaxCategoryCodeList = void 0;
9750
9752
  _this.getGoodsSearch = getGoodsSearch;
9753
+ _this.getGoodsTaxRateList = void 0;
9751
9754
  return _this;
9752
9755
  } // ----------------- 发票头 模块相关 -----------------
9753
9756
 
@@ -10057,7 +10060,12 @@ var css_248z$2 = ".kts-invoice-operate-goods-table-virtual .ktsAntX-table-body {
10057
10060
  styleInject(css_248z$2);
10058
10061
 
10059
10062
  function TableVirtual (props) {
10060
- var _props$dataSource2;
10063
+ var _props$dataSource;
10064
+
10065
+ var controller = Invoice.useInvoiceController();
10066
+ var expandedRowKeys = controller.useMemo(function (s) {
10067
+ return s.goodsListState.expandedRowKeys;
10068
+ }, []);
10061
10069
 
10062
10070
  var _React$useState = React__default['default'].useState(null),
10063
10071
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -10096,14 +10104,39 @@ function TableVirtual (props) {
10096
10104
  }
10097
10105
 
10098
10106
  return placeholder;
10099
- }, [self, tableBody]); // 设置占位dom的搞
10107
+ }, [self, tableBody]);
10108
+ /** 处理扩展行 */
10109
+
10110
+ var goodsList = React__default['default'].useMemo(function () {
10111
+ if (!props.dataSource) return [];
10112
+ var gl = props.dataSource.map(function (e) {
10113
+ return _objectSpread2(_objectSpread2({}, e), {}, {
10114
+ level: 0
10115
+ });
10116
+ });
10117
+
10118
+ for (var i = 0; i < gl.length; i++) {
10119
+ var e = gl[i];
10120
+
10121
+ if (expandedRowKeys.includes(e.$index) && e.children) {
10122
+ var c = e.children.map(function (t) {
10123
+ return _objectSpread2(_objectSpread2({}, t), {}, {
10124
+ level: 1
10125
+ });
10126
+ });
10127
+ gl.splice.apply(gl, [i + 1, 0].concat(_toConsumableArray(c)));
10128
+ }
10129
+ }
10130
+
10131
+ return gl;
10132
+ }, [props.dataSource, expandedRowKeys]); // 设置占位dom的搞
10100
10133
 
10101
10134
  var placeholderHeight = React__default['default'].useMemo(function () {
10102
- if (!self || !rowHeight || !props.dataSource || !placeholder) return;
10103
- var placeholderHeight = rowHeight * props.dataSource.length;
10135
+ if (!self || !rowHeight || !goodsList || !placeholder) return;
10136
+ var placeholderHeight = rowHeight * goodsList.length;
10104
10137
  placeholder.style.height = "".concat(placeholderHeight, "px");
10105
10138
  return placeholderHeight;
10106
- }, [self, rowHeight, props.dataSource, placeholder]);
10139
+ }, [self, rowHeight, goodsList, placeholder]);
10107
10140
  /** 可以容纳的行数 */
10108
10141
 
10109
10142
  var rowSize = React__default['default'].useMemo(function () {
@@ -10112,20 +10145,17 @@ function TableVirtual (props) {
10112
10145
  }, [tableBody, rowHeight, placeholderHeight]); // 计算渲染的行
10113
10146
 
10114
10147
  var dataSource = React__default['default'].useMemo(function () {
10115
- var _props$dataSource;
10116
-
10117
- if (!props.dataSource) return [];
10118
- if (props.dataSource.length < 10) return props.dataSource;
10119
- if (!rowSize) return [props.dataSource[0]];
10120
- return (_props$dataSource = props.dataSource) === null || _props$dataSource === void 0 ? void 0 : _props$dataSource.slice(pointer, pointer + 2 * rowSize);
10121
- }, [props.dataSource, pointer, rowSize]); // 监听滚动
10148
+ if (goodsList.length < 10) return goodsList;
10149
+ if (!rowSize) return [goodsList[0]];
10150
+ return goodsList === null || goodsList === void 0 ? void 0 : goodsList.slice(pointer, pointer + 2 * rowSize);
10151
+ }, [pointer, rowSize, goodsList]); // 监听滚动
10122
10152
 
10123
10153
  React__default['default'].useEffect(function () {
10124
- if (!self || !placeholder || !props.dataSource || !rowHeight || !tableBody) return;
10154
+ if (!self || !placeholder || !goodsList || !rowHeight || !tableBody) return;
10125
10155
 
10126
10156
  var onScroll = function onScroll() {
10127
- if (!props.dataSource || !tableBody) return;
10128
- setPointer(Math.floor((props.dataSource.length - rowSize) * (tableBody.scrollTop / (placeholder.clientHeight - tableBody.clientHeight))));
10157
+ if (!goodsList || !tableBody) return;
10158
+ setPointer(Math.floor((goodsList.length - rowSize) * (tableBody.scrollTop / (placeholder.clientHeight - tableBody.clientHeight))));
10129
10159
  };
10130
10160
 
10131
10161
  onScroll();
@@ -10133,7 +10163,7 @@ function TableVirtual (props) {
10133
10163
  return function () {
10134
10164
  tableBody.removeEventListener('scroll', onScroll);
10135
10165
  };
10136
- }, [self, placeholder, props.dataSource, rowHeight, rowSize]); // 移动列表
10166
+ }, [self, placeholder, goodsList, rowHeight, rowSize]); // 移动列表
10137
10167
 
10138
10168
  React__default['default'].useEffect(function () {
10139
10169
  if (!self) return;
@@ -10146,7 +10176,8 @@ function TableVirtual (props) {
10146
10176
  var cont = self.querySelector('.kts-invoice-operate-goods-table-virtual .ktsAntX-table-body');
10147
10177
  if (!cont) return;
10148
10178
  cont.scrollTop = 0;
10149
- }, [(_props$dataSource2 = props.dataSource) === null || _props$dataSource2 === void 0 ? void 0 : _props$dataSource2.length]);
10179
+ }, [(_props$dataSource = props.dataSource) === null || _props$dataSource === void 0 ? void 0 : _props$dataSource.length]); // console.log('===> pointer', pointer, dataSource);
10180
+
10150
10181
  return /*#__PURE__*/React__default['default'].createElement("span", {
10151
10182
  className: "kts-invoice-operate-goods-table-virtual",
10152
10183
  ref: function ref(e) {
@@ -11161,6 +11192,10 @@ var RowMenu = (function (props) {
11161
11192
  }));
11162
11193
  }, [itemList]);
11163
11194
 
11195
+ if (props.goods.level && props.goods.level > 0) {
11196
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
11197
+ }
11198
+
11164
11199
  if (itemList.length === 0) {
11165
11200
  return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
11166
11201
  }
@@ -13019,6 +13054,129 @@ function DragDiv(props) {
13019
13054
  }, /*#__PURE__*/React__default['default'].createElement("span", null, props.itemName), /*#__PURE__*/React__default['default'].createElement("span", null, props.itemModelName), /*#__PURE__*/React__default['default'].createElement("span", null, props.unit));
13020
13055
  }
13021
13056
 
13057
+ var _path$4, _path2$1, _path3$1;
13058
+
13059
+ function _extends$4() { _extends$4 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$4.apply(this, arguments); }
13060
+
13061
+ function SvgI001$1(props) {
13062
+ return /*#__PURE__*/React.createElement("svg", _extends$4({
13063
+ className: "I001_svg__icon",
13064
+ viewBox: "0 0 1024 1024",
13065
+ xmlns: "http://www.w3.org/2000/svg",
13066
+ width: 200,
13067
+ height: 200
13068
+ }, props), _path$4 || (_path$4 = /*#__PURE__*/React.createElement("path", {
13069
+ d: "M879.973 997.088H146.455c-67.235 0-122.213-54.978-122.213-122.213V141.236c0-67.235 54.978-122.212 122.213-122.212h733.639c67.235 0 122.212 54.977 122.212 122.212v733.64c0 67.113-54.977 122.212-122.333 122.212zM146.455 80.069c-36.652 0-61.167 24.394-61.167 61.167v733.64c0 36.65 24.394 61.166 61.167 61.166h733.639c36.651 0 61.167-24.394 61.167-61.167V141.236c0-36.651-24.394-61.167-61.167-61.167h-733.64zm0 0"
13070
+ })), _path2$1 || (_path2$1 = /*#__PURE__*/React.createElement("path", {
13071
+ d: "M757.76 538.578H268.667c-18.326 0-30.583-12.257-30.583-30.583s12.257-30.583 30.583-30.583H757.76c18.326 0 30.583 12.257 30.583 30.583s-12.257 30.583-30.583 30.583zm0 0"
13072
+ })), _path3$1 || (_path3$1 = /*#__PURE__*/React.createElement("path", {
13073
+ d: "M513.214 783.125c-18.326 0-30.584-12.258-30.584-30.584V263.45c0-18.326 12.258-30.584 30.584-30.584s30.583 12.258 30.583 30.584V752.54c0 18.326-12.258 30.584-30.583 30.584zm0 0"
13074
+ })));
13075
+ }
13076
+
13077
+ var _path$5, _path2$2;
13078
+
13079
+ function _extends$5() { _extends$5 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$5.apply(this, arguments); }
13080
+
13081
+ function SvgI002(props) {
13082
+ return /*#__PURE__*/React.createElement("svg", _extends$5({
13083
+ className: "I002_svg__icon",
13084
+ viewBox: "0 0 1024 1024",
13085
+ xmlns: "http://www.w3.org/2000/svg",
13086
+ width: 200,
13087
+ height: 200
13088
+ }, props), _path$5 || (_path$5 = /*#__PURE__*/React.createElement("path", {
13089
+ d: "M879.973 997.088H146.455c-67.235 0-122.213-54.978-122.213-122.213V141.236c0-67.235 54.978-122.212 122.213-122.212h733.639c67.235 0 122.212 54.977 122.212 122.212v733.64c0 67.113-54.977 122.212-122.333 122.212zM146.455 80.069c-36.652 0-61.167 24.394-61.167 61.167v733.64c0 36.65 24.394 61.166 61.167 61.166h733.639c36.651 0 61.167-24.394 61.167-61.167V141.236c0-36.651-24.394-61.167-61.167-61.167h-733.64zm0 0"
13090
+ })), _path2$2 || (_path2$2 = /*#__PURE__*/React.createElement("path", {
13091
+ d: "M757.76 538.578H268.667c-18.326 0-30.583-12.257-30.583-30.583s12.257-30.583 30.583-30.583H757.76c18.326 0 30.583 12.257 30.583 30.583s-12.257 30.583-30.583 30.583zm0 0"
13092
+ })));
13093
+ }
13094
+
13095
+ function Expand(props) {
13096
+ var _goodsMap$get;
13097
+
13098
+ var record = props.record;
13099
+ var controller = Invoice.useInvoiceController();
13100
+ var goodsMap = controller.useMemo(function (s) {
13101
+ return s.goodsListState.goodsMap;
13102
+ }, []);
13103
+ var expandedRowKeys = controller.useMemo(function (s) {
13104
+ return s.goodsListState.expandedRowKeys;
13105
+ }, []);
13106
+
13107
+ if ((_goodsMap$get = goodsMap.get(record.$index)) === null || _goodsMap$get === void 0 ? void 0 : _goodsMap$get.children) {
13108
+ if (expandedRowKeys.includes(record.$index)) {
13109
+ return /*#__PURE__*/React__default['default'].createElement(ktsXui.Button, {
13110
+ type: 'text',
13111
+ style: {
13112
+ width: 'auto',
13113
+ color: "#0074ff"
13114
+ },
13115
+ icon: /*#__PURE__*/React__default['default'].createElement(Icon, {
13116
+ component: SvgI002
13117
+ }),
13118
+ onClick: controller.pipeline( /*#__PURE__*/function () {
13119
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s, e) {
13120
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
13121
+ while (1) {
13122
+ switch (_context.prev = _context.next) {
13123
+ case 0:
13124
+ e === null || e === void 0 ? void 0 : e.stopPropagation();
13125
+ s.goodsListState.expandedRowKeys = s.goodsListState.expandedRowKeys.filter(function (e) {
13126
+ return e !== record.$index;
13127
+ });
13128
+
13129
+ case 2:
13130
+ case "end":
13131
+ return _context.stop();
13132
+ }
13133
+ }
13134
+ }, _callee);
13135
+ }));
13136
+
13137
+ return function (_x, _x2) {
13138
+ return _ref.apply(this, arguments);
13139
+ };
13140
+ }())
13141
+ });
13142
+ } else {
13143
+ return /*#__PURE__*/React__default['default'].createElement(ktsXui.Button, {
13144
+ type: 'text',
13145
+ style: {
13146
+ width: 'auto',
13147
+ color: "#0074ff"
13148
+ },
13149
+ icon: /*#__PURE__*/React__default['default'].createElement(Icon, {
13150
+ component: SvgI001$1
13151
+ }),
13152
+ onClick: controller.pipeline( /*#__PURE__*/function () {
13153
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s, e) {
13154
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
13155
+ while (1) {
13156
+ switch (_context2.prev = _context2.next) {
13157
+ case 0:
13158
+ e === null || e === void 0 ? void 0 : e.stopPropagation();
13159
+ s.goodsListState.expandedRowKeys = [].concat(_toConsumableArray(s.goodsListState.expandedRowKeys), [record.$index]);
13160
+
13161
+ case 2:
13162
+ case "end":
13163
+ return _context2.stop();
13164
+ }
13165
+ }
13166
+ }, _callee2);
13167
+ }));
13168
+
13169
+ return function (_x3, _x4) {
13170
+ return _ref2.apply(this, arguments);
13171
+ };
13172
+ }())
13173
+ });
13174
+ }
13175
+ } else {
13176
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
13177
+ }
13178
+ }
13179
+
13022
13180
  var useColumns = (function (form) {
13023
13181
  var getFieldDecorator = form.getFieldDecorator,
13024
13182
  getFieldValue = form.getFieldValue;
@@ -13056,6 +13214,11 @@ var useColumns = (function (form) {
13056
13214
  var editGood = controller.useMemo(function (e) {
13057
13215
  return e.goodsListState.editGood;
13058
13216
  }, []);
13217
+ /** 正在编辑的货物 */
13218
+
13219
+ var goodsList = controller.useMemo(function (e) {
13220
+ return e.goodsListState.goodsList;
13221
+ }, []);
13059
13222
  /** 商品表格隐藏列 */
13060
13223
 
13061
13224
  var columnshide = controller.useMemo(function (e) {
@@ -13149,6 +13312,16 @@ var useColumns = (function (form) {
13149
13312
  record: record
13150
13313
  });
13151
13314
  }
13315
+ }, {
13316
+ title: ' ',
13317
+ key: 'expand',
13318
+ width: 40,
13319
+ align: 'center',
13320
+ render: function render(_, record) {
13321
+ return /*#__PURE__*/React__default['default'].createElement(Expand, {
13322
+ record: record
13323
+ });
13324
+ }
13152
13325
  }, {
13153
13326
  title: '序号',
13154
13327
  key: 'serialNo',
@@ -13846,7 +14019,7 @@ var useColumns = (function (form) {
13846
14019
  setChangeField('taxRate');
13847
14020
  onChangeTaxRate(controller, form, record);
13848
14021
  }
13849
- }, taxRateList.map(function (e, i) {
14022
+ }, (record.goodsTaxRateList || taxRateList).map(function (e, i) {
13850
14023
  return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Select.Option, {
13851
14024
  key: i,
13852
14025
  value: e
@@ -13959,6 +14132,11 @@ var useColumns = (function (form) {
13959
14132
  }) // 是否启动拖拽
13960
14133
  .filter(function (e) {
13961
14134
  return e.key !== 'drag' || isStart;
14135
+ }) // 是否启动展开
14136
+ .filter(function (e) {
14137
+ return e.key === 'expand' ? goodsList.some(function (e) {
14138
+ return !!e.children;
14139
+ }) : true;
13962
14140
  }) // 只读
13963
14141
  .filter(function (e) {
13964
14142
  if (model === 'readOnly') {
@@ -13971,7 +14149,7 @@ var useColumns = (function (form) {
13971
14149
  ellipsis: true
13972
14150
  });
13973
14151
  });
13974
- }, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow, searchValue, model, columnsReplenish, columnshide, isStart]);
14152
+ }, [isTaxIncluded, editGood, goodsList, controller, changeField, deduction, isMyShow, searchValue, model, columnsReplenish, columnshide, isStart]);
13975
14153
  return columns;
13976
14154
  });
13977
14155
  /** 字段 */
@@ -14178,7 +14356,7 @@ var useOnRow = (function () {
14178
14356
  while (1) {
14179
14357
  switch (_context2.prev = _context2.next) {
14180
14358
  case 0:
14181
- if (!(model === 'readOnly')) {
14359
+ if (!(record.level && record.level > 0)) {
14182
14360
  _context2.next = 2;
14183
14361
  break;
14184
14362
  }
@@ -14186,38 +14364,58 @@ var useOnRow = (function () {
14186
14364
  return _context2.abrupt("return");
14187
14365
 
14188
14366
  case 2:
14367
+ if (!(model === 'readOnly')) {
14368
+ _context2.next = 4;
14369
+ break;
14370
+ }
14371
+
14372
+ return _context2.abrupt("return");
14373
+
14374
+ case 4:
14189
14375
  editGood = controller.state.goodsListState.editGood;
14190
14376
 
14191
14377
  if (!(record.lineAttribute !== LineAttributeType$1.正常)) {
14192
- _context2.next = 5;
14378
+ _context2.next = 7;
14193
14379
  break;
14194
14380
  }
14195
14381
 
14196
14382
  return _context2.abrupt("return");
14197
14383
 
14198
- case 5:
14384
+ case 7:
14199
14385
  if (!editGood) {
14200
- _context2.next = 16;
14386
+ _context2.next = 22;
14201
14387
  break;
14202
14388
  }
14203
14389
 
14204
14390
  if (!(editGood.$index === record.$index)) {
14205
- _context2.next = 8;
14391
+ _context2.next = 10;
14206
14392
  break;
14207
14393
  }
14208
14394
 
14209
14395
  return _context2.abrupt("return");
14210
14396
 
14211
- case 8:
14212
- _context2.next = 10;
14213
- return controller.saveEditGood();
14214
-
14215
14397
  case 10:
14216
14398
  _context2.next = 12;
14217
- return controller.wait();
14399
+ return controller.saveEditGood();
14218
14400
 
14219
14401
  case 12:
14220
14402
  _context2.next = 14;
14403
+ return controller.wait();
14404
+
14405
+ case 14:
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;
14221
14419
  return controller.pipeline( /*#__PURE__*/function () {
14222
14420
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
14223
14421
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -14247,15 +14445,27 @@ var useOnRow = (function () {
14247
14445
  };
14248
14446
  }())();
14249
14447
 
14250
- case 14:
14251
- _context2.next = 18;
14448
+ case 20:
14449
+ _context2.next = 28;
14252
14450
  break;
14253
14451
 
14254
- case 16:
14255
- _context2.next = 18;
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;
14256
14466
  return controller.setEditGood(record);
14257
14467
 
14258
- case 18:
14468
+ case 28:
14259
14469
  case "end":
14260
14470
  return _context2.stop();
14261
14471
  }
@@ -14633,11 +14843,20 @@ var useRowSelection = (function () {
14633
14843
  columnWidth: 45,
14634
14844
  columnTitle: columnTitle,
14635
14845
  onSelect: onSelect,
14636
- selectedRowKeys: selectedRowKeys
14846
+ selectedRowKeys: selectedRowKeys,
14847
+ getCheckboxProps: function getCheckboxProps(record) {
14848
+ // console.log('===> getCheckboxProps', record, record.level)
14849
+ return {
14850
+ disabled: record.level > 0,
14851
+ style: record.level > 0 ? {
14852
+ display: 'none'
14853
+ } : undefined
14854
+ };
14855
+ }
14637
14856
  };
14638
14857
  });
14639
14858
 
14640
- var css_248z$a = ".kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-table-tax-rate .ktsAnt3x-select-selection-selected-value {\n float: right;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able {\n display: flex;\n padding: 10px;\n border-bottom: 1px solid #dcdcdc;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list {\n flex: 1;\n display: flex;\n gap: 10px;\n padding-right: 10px;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list button {\n padding-left: 10px;\n padding-right: 10px;\n border-radius: 12px;\n color: #0074ff;\n border: 1px solid #0074ff;\n height: 24px;\n line-height: 22px;\n cursor: pointer;\n font-size: 12px;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list button[disabled] {\n color: rgba(0, 0, 0, 0.25);\n border: 1px solid;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-extend {\n flex: none;\n display: flex;\n gap: 5px;\n}\n.kts-invoice-operate-goods-list .ktsAntX-table .ktsAntX-table-row.kts-invoice-operate-goods-be-discount .ktsAntX-table-cell,\n.kts-invoice-operate-goods-list .ktsAntX-table .ktsAntX-table-row.kts-invoice-operate-goods-discount .ktsAntX-table-cell {\n background: #f5f5f5;\n}\n.kts-invoice-operate-goods-list-table.kts-invoice-operate-prefab .ktsAnt3x-table-row {\n color: rgba(0, 0, 0, 0.25);\n background: #f5f5f5;\n}\n.kts-invoice-operate-goods-list-table-search-protrude {\n background: #ff0;\n color: #000;\n font-weight: bold;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table .ktsAntX-table-tbody .ktsAnt3x-form-item {\n margin: 0;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table .ktsAntX-table-tbody .ktsAnt3x-form-item-control {\n line-height: 1;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table .ktsAntX-table-tbody .ktsAnt3x-input:focus {\n box-shadow: none;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table .ktsAntX-table-tbody .ktsAnt3x-input,\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table .ktsAntX-table-tbody .ktsAnt3x-select-selection--single {\n border: none;\n border-radius: 0;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table .ktsAntX-table-tbody .ktsAnt3x-form-explain {\n display: none;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table .ktsAntX-table-tbody .ktsAntX-checkbox-wrapper .ktsAntX-checkbox-checked .ktsAntX-checkbox-inner::after {\n width: 5px;\n height: 10px;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-form-item-control.has-error {\n border: 1px solid #f00;\n}\n";
14859
+ var css_248z$a = ".kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-table-tax-rate .ktsAnt3x-select-selection-selected-value {\n float: right;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able {\n display: flex;\n padding: 10px;\n border-bottom: 1px solid #dcdcdc;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list {\n flex: 1;\n display: flex;\n gap: 10px;\n padding-right: 10px;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list button {\n padding-left: 10px;\n padding-right: 10px;\n border-radius: 12px;\n color: #0074ff;\n border: 1px solid #0074ff;\n height: 24px;\n line-height: 22px;\n cursor: pointer;\n font-size: 12px;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list button[disabled] {\n color: rgba(0, 0, 0, 0.25);\n border: 1px solid;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-extend {\n flex: none;\n display: flex;\n gap: 5px;\n}\n.kts-invoice-operate-goods-list .ktsAntX-table .ktsAntX-table-row.kts-invoice-operate-goods-be-discount .ktsAntX-table-cell,\n.kts-invoice-operate-goods-list .ktsAntX-table .ktsAntX-table-row.kts-invoice-operate-goods-discount .ktsAntX-table-cell {\n background: #f5f5f5;\n}\n.kts-invoice-operate-goods-list-table.kts-invoice-operate-prefab .ktsAnt3x-table-row {\n color: rgba(0, 0, 0, 0.25);\n background: #f5f5f5;\n}\n.kts-invoice-operate-goods-list-table-search-protrude {\n background: #ff0;\n color: #000;\n font-weight: bold;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table .ktsAntX-table-tbody .ktsAnt3x-form-item {\n margin: 0;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table .ktsAntX-table-tbody .ktsAnt3x-form-item-control {\n line-height: 1;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table .ktsAntX-table-tbody .ktsAnt3x-input:focus {\n box-shadow: none;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table .ktsAntX-table-tbody .ktsAnt3x-input,\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table .ktsAntX-table-tbody .ktsAnt3x-select-selection--single {\n border: none;\n border-radius: 0;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table .ktsAntX-table-tbody .ktsAnt3x-form-explain {\n display: none;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table .ktsAntX-table-tbody .ktsAntX-checkbox-wrapper .ktsAntX-checkbox-checked .ktsAntX-checkbox-inner::after {\n width: 5px;\n height: 10px;\n}\n.kts-invoice-operate-goods-list-table .ktsAntX-table-row-indent + .ktsAntX-table-row-expand-icon {\n display: none;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-form-item-control.has-error {\n border: 1px solid #f00;\n}\n";
14641
14860
  styleInject(css_248z$a);
14642
14861
 
14643
14862
  var keys$1 = {};
@@ -16828,42 +17047,42 @@ var Tag = /*#__PURE__*/function (_React$Component2) {
16828
17047
  return Tag;
16829
17048
  }(React__default['default'].Component);
16830
17049
 
16831
- var _path$4;
17050
+ var _path$6;
16832
17051
 
16833
- function _extends$4() { _extends$4 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$4.apply(this, arguments); }
17052
+ function _extends$6() { _extends$6 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$6.apply(this, arguments); }
16834
17053
 
16835
17054
  function SvgArrowUp(props) {
16836
- return /*#__PURE__*/React.createElement("svg", _extends$4({
17055
+ return /*#__PURE__*/React.createElement("svg", _extends$6({
16837
17056
  xmlns: "http://www.w3.org/2000/svg",
16838
17057
  width: 13,
16839
17058
  height: 13,
16840
17059
  fill: "none"
16841
- }, props), _path$4 || (_path$4 = /*#__PURE__*/React.createElement("path", {
17060
+ }, props), _path$6 || (_path$6 = /*#__PURE__*/React.createElement("path", {
16842
17061
  d: "M9.557 8.573a.338.338 0 01-.252-.114L6.508 5.367 3.711 8.46a.333.333 0 01-.497.005.404.404 0 01-.005-.538l3.048-3.37a.339.339 0 01.251-.114c.095 0 .185.041.252.114l3.048 3.37a.404.404 0 01-.005.538.337.337 0 01-.246.11z"
16843
17062
  })));
16844
17063
  }
16845
17064
 
16846
- var _path$5;
17065
+ var _path$7;
16847
17066
 
16848
- function _extends$5() { _extends$5 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$5.apply(this, arguments); }
17067
+ function _extends$7() { _extends$7 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$7.apply(this, arguments); }
16849
17068
 
16850
17069
  function SvgArrowDown(props) {
16851
- return /*#__PURE__*/React.createElement("svg", _extends$5({
17070
+ return /*#__PURE__*/React.createElement("svg", _extends$7({
16852
17071
  xmlns: "http://www.w3.org/2000/svg",
16853
17072
  width: 12,
16854
17073
  height: 13,
16855
17074
  fill: "none"
16856
- }, props), _path$5 || (_path$5 = /*#__PURE__*/React.createElement("path", {
17075
+ }, props), _path$7 || (_path$7 = /*#__PURE__*/React.createElement("path", {
16857
17076
  d: "M2.943 4.427c.092 0 .183.038.252.114l2.797 3.092L8.789 4.54a.333.333 0 01.497-.005.404.404 0 01.005.538l-3.048 3.37a.339.339 0 01-.251.114.339.339 0 01-.252-.114l-3.048-3.37a.404.404 0 01.005-.538.337.337 0 01.246-.11z"
16858
17077
  })));
16859
17078
  }
16860
17079
 
16861
17080
  var _g, _defs$2;
16862
17081
 
16863
- function _extends$6() { _extends$6 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$6.apply(this, arguments); }
17082
+ function _extends$8() { _extends$8 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$8.apply(this, arguments); }
16864
17083
 
16865
17084
  function SvgPlus(props) {
16866
- return /*#__PURE__*/React.createElement("svg", _extends$6({
17085
+ return /*#__PURE__*/React.createElement("svg", _extends$8({
16867
17086
  xmlns: "http://www.w3.org/2000/svg",
16868
17087
  width: 16,
16869
17088
  height: 15,
@@ -17643,10 +17862,10 @@ function TableVirtual$1 (props) {
17643
17862
 
17644
17863
  var _g$1, _defs$3;
17645
17864
 
17646
- function _extends$7() { _extends$7 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$7.apply(this, arguments); }
17865
+ function _extends$9() { _extends$9 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$9.apply(this, arguments); }
17647
17866
 
17648
17867
  function SvgFork(props) {
17649
- return /*#__PURE__*/React.createElement("svg", _extends$7({
17868
+ return /*#__PURE__*/React.createElement("svg", _extends$9({
17650
17869
  xmlns: "http://www.w3.org/2000/svg",
17651
17870
  width: 16,
17652
17871
  height: 16,
@@ -19250,18 +19469,18 @@ var TaxIncludedSwitch$1 = (function () {
19250
19469
  }));
19251
19470
  });
19252
19471
 
19253
- var _path$6;
19472
+ var _path$8;
19254
19473
 
19255
- function _extends$8() { _extends$8 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$8.apply(this, arguments); }
19474
+ function _extends$a() { _extends$a = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$a.apply(this, arguments); }
19256
19475
 
19257
19476
  function SvgMagnifier$1(props) {
19258
- return /*#__PURE__*/React.createElement("svg", _extends$8({
19477
+ return /*#__PURE__*/React.createElement("svg", _extends$a({
19259
19478
  className: "magnifier_svg__icon",
19260
19479
  viewBox: "0 0 1024 1024",
19261
19480
  xmlns: "http://www.w3.org/2000/svg",
19262
19481
  width: 200,
19263
19482
  height: 200
19264
- }, props), _path$6 || (_path$6 = /*#__PURE__*/React.createElement("path", {
19483
+ }, props), _path$8 || (_path$8 = /*#__PURE__*/React.createElement("path", {
19265
19484
  d: "M985.781 918.594L820.773 765.526c27.373-32.973 49.655-69.577 66.437-109.258 22.933-54.219 34.56-111.795 34.56-171.13 0-59.333-11.627-116.91-34.56-171.13-22.143-52.354-53.838-99.365-94.2-139.729s-87.377-72.056-139.73-94.199c-54.219-22.933-111.795-34.561-171.13-34.561S365.24 57.148 311.022 80.08c-52.354 22.143-99.365 53.837-139.73 94.2s-72.057 87.375-94.2 139.73c-22.932 54.218-34.56 111.795-34.56 171.13 0 59.334 11.628 116.91 34.56 171.129 22.144 52.354 53.838 99.365 94.2 139.729s87.376 72.057 139.73 94.2c54.219 22.933 111.795 34.56 171.13 34.56s116.91-11.627 171.13-34.56c45.352-19.181 86.686-45.543 123.171-78.487l165.803 153.804a31.886 31.886 0 0021.756 8.54c8.593 0 17.163-3.442 23.467-10.238 12.019-12.956 11.26-33.205-1.698-45.223zm-503.63-57.836c-207.117 0-375.62-168.502-375.62-375.62 0-207.117 168.503-375.62 375.62-375.62s375.62 168.503 375.62 375.62c0 207.118-168.503 375.62-375.62 375.62z"
19266
19485
  })));
19267
19486
  }
@@ -19411,10 +19630,10 @@ function TableRow$1(props) {
19411
19630
 
19412
19631
  var _g$2, _defs$4;
19413
19632
 
19414
- function _extends$9() { _extends$9 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$9.apply(this, arguments); }
19633
+ function _extends$b() { _extends$b = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$b.apply(this, arguments); }
19415
19634
 
19416
19635
  function SvgPlus$1(props) {
19417
- return /*#__PURE__*/React.createElement("svg", _extends$9({
19636
+ return /*#__PURE__*/React.createElement("svg", _extends$b({
19418
19637
  xmlns: "http://www.w3.org/2000/svg",
19419
19638
  width: 16,
19420
19639
  height: 15
@@ -19659,18 +19878,18 @@ function ItemNameInput$1(props) {
19659
19878
  })));
19660
19879
  }
19661
19880
 
19662
- var _path$7;
19881
+ var _path$9;
19663
19882
 
19664
- function _extends$a() { _extends$a = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$a.apply(this, arguments); }
19883
+ function _extends$c() { _extends$c = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$c.apply(this, arguments); }
19665
19884
 
19666
- function SvgI001$1(props) {
19667
- return /*#__PURE__*/React.createElement("svg", _extends$a({
19885
+ function SvgI001$2(props) {
19886
+ return /*#__PURE__*/React.createElement("svg", _extends$c({
19668
19887
  className: "I001_svg__icon",
19669
19888
  viewBox: "0 0 1024 1024",
19670
19889
  xmlns: "http://www.w3.org/2000/svg",
19671
19890
  width: 200,
19672
19891
  height: 200
19673
- }, props), _path$7 || (_path$7 = /*#__PURE__*/React.createElement("path", {
19892
+ }, props), _path$9 || (_path$9 = /*#__PURE__*/React.createElement("path", {
19674
19893
  d: "M304.874-5.815h123.758v123.758H304.874V-5.815zm281.277 0H709.91v123.758H586.151V-5.815zM304.874 286.75h123.758v123.758H304.874V286.75zm281.277 0H709.91v123.758H586.151V286.75zM304.874 579.212h123.758V702.97H304.874V579.212zm281.277 0H709.91V702.97H586.151V579.212zM304.874 871.83h123.758v123.758H304.874V871.83zm281.277 0H709.91v123.758H586.151V871.83z"
19675
19894
  })));
19676
19895
  }
@@ -19971,7 +20190,7 @@ function Drag$2(props) {
19971
20190
  className: "kts-invoice-operate-goods-list-itemName-drag",
19972
20191
  onMouseOver: controller.saveEditGood
19973
20192
  }, /*#__PURE__*/React__default['default'].createElement(Icon, {
19974
- component: SvgI001$1
20193
+ component: SvgI001$2
19975
20194
  }));
19976
20195
  }, [onMouseDown, controller]);
19977
20196
 
@@ -20042,6 +20261,11 @@ var useColumns$1 = (function (form) {
20042
20261
  var model = controller.useMemo(function (e) {
20043
20262
  return e.model;
20044
20263
  }, []);
20264
+ /** 计算类型 */
20265
+
20266
+ var calculateType = controller.useMemo(function (e) {
20267
+ return e.goodsListState.calculateType;
20268
+ }, []);
20045
20269
  /** 是否显示我方 */
20046
20270
 
20047
20271
  var isMyShow = controller.useMemo(function (e) {
@@ -20168,7 +20392,7 @@ var useColumns$1 = (function (form) {
20168
20392
  }, "\u9879\u76EE\u540D\u79F0"),
20169
20393
  key: 'itemName',
20170
20394
  render: function render(_, record) {
20171
- 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') {
20172
20396
  return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, /*#__PURE__*/React__default['default'].createElement("div", {
20173
20397
  style: {
20174
20398
  display: 'flex'
@@ -20278,7 +20502,7 @@ var useColumns$1 = (function (form) {
20278
20502
  key: 'itemModelName',
20279
20503
  width: 119,
20280
20504
  render: function render(_, record) {
20281
- 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') {
20282
20506
  return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('itemModelName', {
20283
20507
  initialValue: isMyShow ? editGood.itemModelNameSelf : editGood.itemModelName,
20284
20508
  rules: getReplenishRules('itemModelName')
@@ -20329,7 +20553,7 @@ var useColumns$1 = (function (form) {
20329
20553
  key: 'unit',
20330
20554
  width: 70,
20331
20555
  render: function render(_, record) {
20332
- 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') {
20333
20557
  return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('unit', {
20334
20558
  initialValue: editGood.unit,
20335
20559
  rules: getReplenishRules('unit')
@@ -20387,7 +20611,7 @@ var useColumns$1 = (function (form) {
20387
20611
  align: 'right',
20388
20612
  width: 149,
20389
20613
  render: function render(value, record) {
20390
- 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') {
20391
20615
  return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('quantity', {
20392
20616
  initialValue: nonScientificNotation(editGood.quantity),
20393
20617
  getValueFromEvent: onNumberValueChange,
@@ -20482,7 +20706,7 @@ var useColumns$1 = (function (form) {
20482
20706
  align: 'right',
20483
20707
  width: 149,
20484
20708
  render: function render(value, record) {
20485
- 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') {
20486
20710
  return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('priceIncludeTax', {
20487
20711
  initialValue: nonScientificNotation(editGood.priceIncludeTax),
20488
20712
  getValueFromEvent: onNumberValueChange,
@@ -20557,7 +20781,7 @@ var useColumns$1 = (function (form) {
20557
20781
  align: 'right',
20558
20782
  width: 149,
20559
20783
  render: function render(value, record) {
20560
- 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') {
20561
20785
  return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('priceExcludeTax', {
20562
20786
  initialValue: nonScientificNotation(editGood.priceExcludeTax),
20563
20787
  getValueFromEvent: onNumberValueChange,
@@ -20632,7 +20856,7 @@ var useColumns$1 = (function (form) {
20632
20856
  width: 119,
20633
20857
  align: 'right',
20634
20858
  render: function render(value, record) {
20635
- 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') {
20636
20860
  return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('lineAmountIncludeTax', {
20637
20861
  initialValue: editGood.lineAmountIncludeTax,
20638
20862
  getValueFromEvent: onNumberValueChange,
@@ -20720,7 +20944,7 @@ var useColumns$1 = (function (form) {
20720
20944
  align: 'right',
20721
20945
  width: 119,
20722
20946
  render: function render(value, record) {
20723
- 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') {
20724
20948
  return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('lineAmountExcludeTax', {
20725
20949
  initialValue: editGood.lineAmountExcludeTax,
20726
20950
  getValueFromEvent: onNumberValueChange,
@@ -20783,7 +21007,7 @@ var useColumns$1 = (function (form) {
20783
21007
  align: 'right',
20784
21008
  width: 70,
20785
21009
  render: function render(value, record) {
20786
- 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')) {
20787
21011
  return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('taxRate', {
20788
21012
  initialValue: editGood.taxRate,
20789
21013
  rules: [].concat(_toConsumableArray(getReplenishRules('taxRate')), [{
@@ -20807,7 +21031,7 @@ var useColumns$1 = (function (form) {
20807
21031
  setChangeField('taxRate');
20808
21032
  onChangeTaxRate$1(controller, form, record);
20809
21033
  }
20810
- }, taxRateList.map(function (e, i) {
21034
+ }, (record.goodsTaxRateList || taxRateList).map(function (e, i) {
20811
21035
  return /*#__PURE__*/React__default['default'].createElement(ktsXui.Select.Option, {
20812
21036
  key: i,
20813
21037
  value: e
@@ -20875,7 +21099,7 @@ var useColumns$1 = (function (form) {
20875
21099
  ellipsis: true
20876
21100
  });
20877
21101
  });
20878
- }, [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(() => {
20879
21103
  // clearTimeout(t)
20880
21104
  // const t = setTimeout(() => { setChangeField('') }, 1000);
20881
21105
  // return () => { clearTimeout(t) }
@@ -21075,7 +21299,7 @@ var useOnRow$1 = (function () {
21075
21299
  while (1) {
21076
21300
  switch (_context2.prev = _context2.next) {
21077
21301
  case 0:
21078
- if (!(model === 'prefab')) {
21302
+ if (!(model === 'readOnly')) {
21079
21303
  _context2.next = 2;
21080
21304
  break;
21081
21305
  }
@@ -21083,46 +21307,50 @@ var useOnRow$1 = (function () {
21083
21307
  return _context2.abrupt("return");
21084
21308
 
21085
21309
  case 2:
21086
- if (!(model === 'readOnly')) {
21087
- _context2.next = 4;
21088
- break;
21089
- }
21090
-
21091
- return _context2.abrupt("return");
21092
-
21093
- case 4:
21094
21310
  editGood = controller.state.goodsListState.editGood;
21095
21311
 
21096
21312
  if (!(record.lineAttribute !== LineAttributeType$1.正常)) {
21097
- _context2.next = 7;
21313
+ _context2.next = 5;
21098
21314
  break;
21099
21315
  }
21100
21316
 
21101
21317
  return _context2.abrupt("return");
21102
21318
 
21103
- case 7:
21319
+ case 5:
21104
21320
  if (!editGood) {
21105
- _context2.next = 18;
21321
+ _context2.next = 20;
21106
21322
  break;
21107
21323
  }
21108
21324
 
21109
21325
  if (!(editGood.$index === record.$index)) {
21110
- _context2.next = 10;
21326
+ _context2.next = 8;
21111
21327
  break;
21112
21328
  }
21113
21329
 
21114
21330
  return _context2.abrupt("return");
21115
21331
 
21332
+ case 8:
21333
+ _context2.next = 10;
21334
+ return controller.saveEditGood();
21335
+
21116
21336
  case 10:
21117
21337
  _context2.next = 12;
21118
- return controller.saveEditGood();
21338
+ return controller.wait();
21119
21339
 
21120
21340
  case 12:
21121
- _context2.next = 14;
21122
- return controller.wait();
21341
+ if (!(controller.getGoodsTaxRateList && record.taxClassificationCode && !record.goodsTaxRateList)) {
21342
+ _context2.next = 16;
21343
+ break;
21344
+ }
21123
21345
 
21124
- case 14:
21125
- _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;
21126
21354
  return controller.pipeline( /*#__PURE__*/function () {
21127
21355
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
21128
21356
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -21152,15 +21380,27 @@ var useOnRow$1 = (function () {
21152
21380
  };
21153
21381
  }())();
21154
21382
 
21155
- case 16:
21156
- _context2.next = 20;
21383
+ case 18:
21384
+ _context2.next = 26;
21157
21385
  break;
21158
21386
 
21159
- case 18:
21160
- _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;
21161
21401
  return controller.setEditGood(record);
21162
21402
 
21163
- case 20:
21403
+ case 26:
21164
21404
  case "end":
21165
21405
  return _context2.stop();
21166
21406
  }
@@ -23462,7 +23702,7 @@ var EndowCodeDrawer = (function () {
23462
23702
  if (visible) {
23463
23703
  controller.pipeline( /*#__PURE__*/function () {
23464
23704
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
23465
- var endowcodeGoodIndex, good, getDefaultValue;
23705
+ var endowcodeGoodIndex, good, getDefaultValue, goodsTaxRateList;
23466
23706
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
23467
23707
  while (1) {
23468
23708
  switch (_context2.prev = _context2.next) {
@@ -23496,19 +23736,40 @@ var EndowCodeDrawer = (function () {
23496
23736
  case 9:
23497
23737
  _context2.t1 = _context2.sent;
23498
23738
  (0, _context2.t0)(_context2.t1);
23499
- _context2.next = 14;
23739
+ _context2.next = 23;
23500
23740
  break;
23501
23741
 
23502
23742
  case 13:
23503
- if (endowcodeGoodIndex.length === 1) {
23504
- setDefaultValue(good);
23505
- } else {
23506
- setDefaultValue({
23507
- taxRate: good.taxRate
23508
- });
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;
23509
23751
  }
23510
23752
 
23511
- 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:
23512
23773
  case "end":
23513
23774
  return _context2.stop();
23514
23775
  }
@@ -23574,12 +23835,7 @@ var DrawerBody$3 = function DrawerBody(props) {
23574
23835
  /** 税率列表 */
23575
23836
 
23576
23837
  var taxRateList = controller.useMemo(function (s) {
23577
- return s.goodsListState.taxRateList.map(function (e) {
23578
- return {
23579
- label: "".concat(e, "%"),
23580
- value: e
23581
- };
23582
- });
23838
+ return s.goodsListState.taxRateList;
23583
23839
  }, []);
23584
23840
  /** 免税类型 列表 */
23585
23841
 
@@ -23600,14 +23856,29 @@ var DrawerBody$3 = function DrawerBody(props) {
23600
23856
  _React$useState4 = _slicedToArray(_React$useState3, 2),
23601
23857
  taxRate = _React$useState4[0],
23602
23858
  setTaxRate = _React$useState4[1];
23603
- /** 税收分类编码 选择组件 */
23859
+ /** 商品可用税率 */
23604
23860
 
23605
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
+ /** 税收分类编码 选择组件 */
23876
+
23606
23877
  var ShowSearch = React__default['default'].useCallback(function (props) {
23607
- var _React$useState5 = React__default['default'].useState([]),
23608
- _React$useState6 = _slicedToArray(_React$useState5, 2),
23609
- dataSource = _React$useState6[0],
23610
- 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];
23611
23882
 
23612
23883
  var onSearch = React__default['default'].useCallback( /*#__PURE__*/function () {
23613
23884
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(e) {
@@ -23690,22 +23961,22 @@ var DrawerBody$3 = function DrawerBody(props) {
23690
23961
 
23691
23962
  var ShowSearch2 = React__default['default'].useCallback(function (props) {
23692
23963
  // 是否显示
23693
- var _React$useState7 = React__default['default'].useState(false),
23694
- _React$useState8 = _slicedToArray(_React$useState7, 2),
23695
- visible = _React$useState8[0],
23696
- setVisible = _React$useState8[1]; // 税收分类编码树
23697
-
23698
-
23699
- var _React$useState9 = React__default['default'].useState(),
23964
+ var _React$useState9 = React__default['default'].useState(false),
23700
23965
  _React$useState10 = _slicedToArray(_React$useState9, 2),
23701
- list = _React$useState10[0],
23702
- setList = _React$useState10[1]; // 搜索条件
23966
+ visible = _React$useState10[0],
23967
+ setVisible = _React$useState10[1]; // 税收分类编码树
23703
23968
 
23704
23969
 
23705
23970
  var _React$useState11 = React__default['default'].useState(),
23706
23971
  _React$useState12 = _slicedToArray(_React$useState11, 2),
23707
- filter = _React$useState12[0],
23708
- 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];
23709
23980
  /** 创建 树节点 */
23710
23981
 
23711
23982
 
@@ -23891,15 +24162,15 @@ var DrawerBody$3 = function DrawerBody(props) {
23891
24162
  /** 税收分类编码 选择组件3 */
23892
24163
 
23893
24164
  var ShowSearch3 = React__default['default'].useCallback(function (props) {
23894
- var _React$useState13 = React__default['default'].useState(false),
23895
- _React$useState14 = _slicedToArray(_React$useState13, 2),
23896
- open = _React$useState14[0],
23897
- setOpen = _React$useState14[1];
23898
-
23899
- var _React$useState15 = React__default['default'].useState([]),
24165
+ var _React$useState15 = React__default['default'].useState(false),
23900
24166
  _React$useState16 = _slicedToArray(_React$useState15, 2),
23901
- list = _React$useState16[0],
23902
- 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];
23903
24174
 
23904
24175
  var onSearch = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
23905
24176
  var _value$target;
@@ -24007,16 +24278,55 @@ var DrawerBody$3 = function DrawerBody(props) {
24007
24278
  }, _callee11);
24008
24279
  })), []);
24009
24280
  var onSelect = React__default['default'].useCallback(function (key, info) {
24010
- // !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 => {
24011
24319
  // if (info.node.taxRate || info.taxRate === 0) {
24012
24320
  // s.value = info.node.taxRate
24013
24321
  // }
24014
24322
  // });
24323
+
24324
+
24015
24325
  actions.setFieldState('taxClassificationCode', /*#__PURE__*/function () {
24016
- var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(s) {
24017
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
24326
+ var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(s) {
24327
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
24018
24328
  while (1) {
24019
- switch (_context12.prev = _context12.next) {
24329
+ switch (_context13.prev = _context13.next) {
24020
24330
  case 0:
24021
24331
  if (info.node.taxCategoryCode) {
24022
24332
  s.value = info.node.taxCategoryCode;
@@ -24024,21 +24334,21 @@ var DrawerBody$3 = function DrawerBody(props) {
24024
24334
 
24025
24335
  case 1:
24026
24336
  case "end":
24027
- return _context12.stop();
24337
+ return _context13.stop();
24028
24338
  }
24029
24339
  }
24030
- }, _callee12);
24340
+ }, _callee13);
24031
24341
  }));
24032
24342
 
24033
- return function (_x8) {
24034
- return _ref12.apply(this, arguments);
24343
+ return function (_x9) {
24344
+ return _ref13.apply(this, arguments);
24035
24345
  };
24036
24346
  }());
24037
24347
  actions.setFieldState('shorthand', /*#__PURE__*/function () {
24038
- var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(s) {
24039
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
24348
+ var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
24349
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
24040
24350
  while (1) {
24041
- switch (_context13.prev = _context13.next) {
24351
+ switch (_context14.prev = _context14.next) {
24042
24352
  case 0:
24043
24353
  if (info.node.shorthand) {
24044
24354
  s.value = info.node.shorthand;
@@ -24046,14 +24356,14 @@ var DrawerBody$3 = function DrawerBody(props) {
24046
24356
 
24047
24357
  case 1:
24048
24358
  case "end":
24049
- return _context13.stop();
24359
+ return _context14.stop();
24050
24360
  }
24051
24361
  }
24052
- }, _callee13);
24362
+ }, _callee14);
24053
24363
  }));
24054
24364
 
24055
- return function (_x9) {
24056
- return _ref13.apply(this, arguments);
24365
+ return function (_x10) {
24366
+ return _ref14.apply(this, arguments);
24057
24367
  };
24058
24368
  }());
24059
24369
  setOpen(false);
@@ -24104,19 +24414,19 @@ var DrawerBody$3 = function DrawerBody(props) {
24104
24414
  }));
24105
24415
  }, [controller, actions]); // 是否享受优惠政策
24106
24416
 
24107
- var _React$useState17 = React__default['default'].useState(0),
24108
- _React$useState18 = _slicedToArray(_React$useState17, 2),
24109
- favouredPolicyMark = _React$useState18[0],
24110
- 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]; // 确定
24111
24421
 
24112
24422
 
24113
24423
  var onSubmit = React__default['default'].useCallback(function (values) {
24114
24424
  controller.pipeline( /*#__PURE__*/function () {
24115
- var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
24425
+ var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(s) {
24116
24426
  var endowCodeGood;
24117
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
24427
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
24118
24428
  while (1) {
24119
- switch (_context14.prev = _context14.next) {
24429
+ switch (_context15.prev = _context15.next) {
24120
24430
  case 0:
24121
24431
  endowCodeGood = s.goodsListState.endowCode.endowcodeGoodIndex.map(function (e) {
24122
24432
  return s.goodsListState.goodsMap.get(e);
@@ -24139,46 +24449,49 @@ var DrawerBody$3 = function DrawerBody(props) {
24139
24449
 
24140
24450
  if (good.lineAmountExcludeTax && good.quantity) {
24141
24451
  good.priceExcludeTax = countPrice(good.lineAmountExcludeTax, good.quantity, controller.state.calculatingDigits);
24142
- }
24452
+ } //赋值商品的可用税率
24453
+
24454
+
24455
+ good.goodsTaxRateList = goodsTaxRateList;
24143
24456
  });
24144
24457
  s.goodsListState.goodsList = s.goodsListState.goodsList.slice();
24145
24458
  s.goodsListState.endowCode.endowcodeGoodIndex = [];
24146
24459
 
24147
24460
  case 4:
24148
24461
  case "end":
24149
- return _context14.stop();
24462
+ return _context15.stop();
24150
24463
  }
24151
24464
  }
24152
- }, _callee14);
24465
+ }, _callee15);
24153
24466
  }));
24154
24467
 
24155
- return function (_x10) {
24156
- return _ref14.apply(this, arguments);
24468
+ return function (_x11) {
24469
+ return _ref15.apply(this, arguments);
24157
24470
  };
24158
24471
  }())();
24159
- }, [controller]);
24472
+ }, [controller, goodsTaxRateList]);
24160
24473
  var effects = React__default['default'].useCallback(function () {
24161
24474
  // 税率变化
24162
24475
  antd.FormEffectHooks.onFieldValueChange$('taxRate').subscribe(function (e) {
24163
24476
  setTaxRate(e.value);
24164
24477
  actions.setFieldState('taxFreeType', /*#__PURE__*/function () {
24165
- var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(s) {
24166
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
24478
+ var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(s) {
24479
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
24167
24480
  while (1) {
24168
- switch (_context15.prev = _context15.next) {
24481
+ switch (_context16.prev = _context16.next) {
24169
24482
  case 0:
24170
24483
  if (e.value !== 0) s.value = undefined;
24171
24484
 
24172
24485
  case 1:
24173
24486
  case "end":
24174
- return _context15.stop();
24487
+ return _context16.stop();
24175
24488
  }
24176
24489
  }
24177
- }, _callee15);
24490
+ }, _callee16);
24178
24491
  }));
24179
24492
 
24180
- return function (_x11) {
24181
- return _ref15.apply(this, arguments);
24493
+ return function (_x12) {
24494
+ return _ref16.apply(this, arguments);
24182
24495
  };
24183
24496
  }());
24184
24497
  }); // 是否享受优惠政策
@@ -24186,23 +24499,23 @@ var DrawerBody$3 = function DrawerBody(props) {
24186
24499
  antd.FormEffectHooks.onFieldValueChange$('favouredPolicyMark').subscribe(function (e) {
24187
24500
  setFavouredPolicyMark(e.value);
24188
24501
  actions.setFieldState('favouredPolicyName', /*#__PURE__*/function () {
24189
- var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(s) {
24190
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
24502
+ var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(s) {
24503
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
24191
24504
  while (1) {
24192
- switch (_context16.prev = _context16.next) {
24505
+ switch (_context17.prev = _context17.next) {
24193
24506
  case 0:
24194
24507
  if (e.value === 0) s.value = undefined;
24195
24508
 
24196
24509
  case 1:
24197
24510
  case "end":
24198
- return _context16.stop();
24511
+ return _context17.stop();
24199
24512
  }
24200
24513
  }
24201
- }, _callee16);
24514
+ }, _callee17);
24202
24515
  }));
24203
24516
 
24204
- return function (_x12) {
24205
- return _ref16.apply(this, arguments);
24517
+ return function (_x13) {
24518
+ return _ref17.apply(this, arguments);
24206
24519
  };
24207
24520
  }());
24208
24521
  });
@@ -24242,7 +24555,7 @@ var DrawerBody$3 = function DrawerBody(props) {
24242
24555
  disabled: readOnlyTaxRate
24243
24556
  },
24244
24557
  default: (_defaultValue$taxRate = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.taxRate) !== null && _defaultValue$taxRate !== void 0 ? _defaultValue$taxRate : 0,
24245
- enum: taxRateList,
24558
+ enum: formattedTaxRateList,
24246
24559
  "x-rules": [{
24247
24560
  message: '请选择税率',
24248
24561
  required: true
@@ -24302,23 +24615,23 @@ var DrawerBody$3 = function DrawerBody(props) {
24302
24615
  }, "\u786E\u5B9A"), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Button, {
24303
24616
  onClick: function onClick() {
24304
24617
  controller.pipeline( /*#__PURE__*/function () {
24305
- var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(s) {
24306
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
24618
+ var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(s) {
24619
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
24307
24620
  while (1) {
24308
- switch (_context17.prev = _context17.next) {
24621
+ switch (_context18.prev = _context18.next) {
24309
24622
  case 0:
24310
- return _context17.abrupt("return", s.goodsListState.endowCode.endowcodeGoodIndex = []);
24623
+ return _context18.abrupt("return", s.goodsListState.endowCode.endowcodeGoodIndex = []);
24311
24624
 
24312
24625
  case 1:
24313
24626
  case "end":
24314
- return _context17.stop();
24627
+ return _context18.stop();
24315
24628
  }
24316
24629
  }
24317
- }, _callee17);
24630
+ }, _callee18);
24318
24631
  }));
24319
24632
 
24320
- return function (_x13) {
24321
- return _ref17.apply(this, arguments);
24633
+ return function (_x14) {
24634
+ return _ref18.apply(this, arguments);
24322
24635
  };
24323
24636
  }())();
24324
24637
  }