kts-component-invoice-operate 3.2.191 → 3.2.193

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.
@@ -21,6 +21,8 @@ export declare const onChangeLineAmountIncludeTax: (...par: any[]) => void;
21
21
  export declare const onChangeLineAmountExcludeTax: (...par: any[]) => void;
22
22
  /** 税率 */
23
23
  export declare const onChangeTaxRate: (...par: any[]) => void;
24
+ /** 税额 */
25
+ export declare const onChangeTaxAmount: (...par: any[]) => void;
24
26
  /** 小规模纳税人 1% 和 3% 自动赋码免税 */
25
27
  export declare function dutyFree(controller: InvoiceController, taxRate: number, form: WrappedFormUtils<any>, record: IGood): number | undefined;
26
28
  /** 含税 => 更新(不含税) */
package/dist/index.esm.js CHANGED
@@ -13935,7 +13935,7 @@ var useColumns = (function (form) {
13935
13935
  style: {
13936
13936
  textAlign: 'right'
13937
13937
  },
13938
- maxLength: 16,
13938
+ maxLength: 25,
13939
13939
  loading: isCipher(changeField, "quantity"),
13940
13940
  onChange: function () {
13941
13941
  var _onChange4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
@@ -14030,7 +14030,7 @@ var useColumns = (function (form) {
14030
14030
  style: {
14031
14031
  textAlign: 'right'
14032
14032
  },
14033
- maxLength: 16,
14033
+ maxLength: 25,
14034
14034
  loading: isCipher(changeField, 'priceIncludeTax'),
14035
14035
  onChange: function onChange() {
14036
14036
  setChangeField('priceIncludeTax');
@@ -14105,7 +14105,7 @@ var useColumns = (function (form) {
14105
14105
  style: {
14106
14106
  textAlign: 'right'
14107
14107
  },
14108
- maxLength: 16,
14108
+ maxLength: 25,
14109
14109
  loading: isCipher(changeField, 'priceExcludeTax'),
14110
14110
  onChange: function onChange() {
14111
14111
  setChangeField('priceExcludeTax');
@@ -19956,21 +19956,82 @@ var onChangeTaxRate$1 = lazyFn$2(function (controller, form, record) {
19956
19956
  };
19957
19957
  }());
19958
19958
  }, 1000);
19959
+ /** 税额 */
19960
+
19961
+ var onChangeTaxAmount = lazyFn$2(function (controller, form, record) {
19962
+ /** 金额(不含税) */
19963
+ var lineAmountExcludeTax;
19964
+ form.validateFields( /*#__PURE__*/function () {
19965
+ var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(err, values) {
19966
+ var record, priceExcludeTax;
19967
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
19968
+ while (1) {
19969
+ switch (_context9.prev = _context9.next) {
19970
+ case 0:
19971
+ err = err || {};
19972
+ record = controller.state.goodsListState.editGood; // 校验是否有含税金额
19973
+
19974
+ if (!(err.lineAmountIncludeTax && !(record === null || record === void 0 ? void 0 : record.lineAmountIncludeTax) && (record === null || record === void 0 ? void 0 : record.lineAmountIncludeTax) !== 0)) {
19975
+ _context9.next = 6;
19976
+ break;
19977
+ }
19978
+
19979
+ _context9.next = 5;
19980
+ return clearCalculatingField$1(controller);
19981
+
19982
+ case 5:
19983
+ return _context9.abrupt("return");
19984
+
19985
+ case 6:
19986
+ // 计数不含税金额
19987
+ lineAmountExcludeTax = countAmountExcludeTax((record === null || record === void 0 ? void 0 : record.lineAmountIncludeTax) || 0, values.taxAmount);
19988
+ form.setFieldsValue({
19989
+ lineAmountExcludeTax: lineAmountExcludeTax
19990
+ });
19991
+ priceExcludeTax = countPrice(lineAmountExcludeTax || '', (record === null || record === void 0 ? void 0 : record.quantity) || '', controller.state.calculatingDigits);
19992
+ _context9.next = 11;
19993
+ return controller.setEditGood({
19994
+ lineAmountExcludeTax: lineAmountExcludeTax,
19995
+ taxAmount: values.taxAmount,
19996
+ priceExcludeTax: priceExcludeTax
19997
+ });
19998
+
19999
+ case 11:
20000
+ form.setFieldsValue({
20001
+ priceExcludeTax: priceExcludeTax
20002
+ }); // 清楚 计算中启动字段
20003
+
20004
+ _context9.next = 14;
20005
+ return clearCalculatingField$1(controller);
20006
+
20007
+ case 14:
20008
+ case "end":
20009
+ return _context9.stop();
20010
+ }
20011
+ }
20012
+ }, _callee9);
20013
+ }));
20014
+
20015
+ return function (_x15, _x16) {
20016
+ return _ref9.apply(this, arguments);
20017
+ };
20018
+ }());
20019
+ }, 1000);
19959
20020
  /** 含税 => 更新(不含税) */
19960
20021
 
19961
20022
  var updateUnitPriceExcludingTax$1 = /*#__PURE__*/function () {
19962
- var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(controller, form, record) {
19963
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
20023
+ var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(controller, form, record) {
20024
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
19964
20025
  while (1) {
19965
- switch (_context10.prev = _context10.next) {
20026
+ switch (_context11.prev = _context11.next) {
19966
20027
  case 0:
19967
- return _context10.abrupt("return", new Promise(function (resolve) {
20028
+ return _context11.abrupt("return", new Promise(function (resolve) {
19968
20029
  form.validateFields( /*#__PURE__*/function () {
19969
- var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(err, values) {
20030
+ var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(err, values) {
19970
20031
  var taxAmount, lineAmountExcludeTax, priceExcludeTax, deduction, editGood;
19971
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
20032
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
19972
20033
  while (1) {
19973
- switch (_context9.prev = _context9.next) {
20034
+ switch (_context10.prev = _context10.next) {
19974
20035
  case 0:
19975
20036
  console.log('含税 => 更新(不含税');
19976
20037
  err = err || {};
@@ -19987,7 +20048,7 @@ var updateUnitPriceExcludingTax$1 = /*#__PURE__*/function () {
19987
20048
  form.setFieldsValue({
19988
20049
  taxAmount: taxAmount
19989
20050
  });
19990
- _context9.next = 8;
20051
+ _context10.next = 8;
19991
20052
  return controller.setEditGood({
19992
20053
  taxAmount: taxAmount
19993
20054
  });
@@ -20001,7 +20062,7 @@ var updateUnitPriceExcludingTax$1 = /*#__PURE__*/function () {
20001
20062
  form.setFieldsValue({
20002
20063
  lineAmountExcludeTax: lineAmountExcludeTax
20003
20064
  });
20004
- _context9.next = 12;
20065
+ _context10.next = 12;
20005
20066
  return controller.setEditGood({
20006
20067
  lineAmountExcludeTax: lineAmountExcludeTax
20007
20068
  });
@@ -20015,21 +20076,21 @@ var updateUnitPriceExcludingTax$1 = /*#__PURE__*/function () {
20015
20076
  form.setFieldsValue({
20016
20077
  priceExcludeTax: priceExcludeTax
20017
20078
  });
20018
- _context9.next = 16;
20079
+ _context10.next = 16;
20019
20080
  return controller.setEditGood({
20020
20081
  priceExcludeTax: priceExcludeTax
20021
20082
  });
20022
20083
 
20023
20084
  case 16:
20024
20085
  case "end":
20025
- return _context9.stop();
20086
+ return _context10.stop();
20026
20087
  }
20027
20088
  }
20028
- }, _callee9);
20089
+ }, _callee10);
20029
20090
  }));
20030
20091
 
20031
- return function (_x18, _x19) {
20032
- return _ref10.apply(this, arguments);
20092
+ return function (_x20, _x21) {
20093
+ return _ref11.apply(this, arguments);
20033
20094
  };
20034
20095
  }());
20035
20096
  resolve(undefined);
@@ -20037,37 +20098,37 @@ var updateUnitPriceExcludingTax$1 = /*#__PURE__*/function () {
20037
20098
 
20038
20099
  case 1:
20039
20100
  case "end":
20040
- return _context10.stop();
20101
+ return _context11.stop();
20041
20102
  }
20042
20103
  }
20043
- }, _callee10);
20104
+ }, _callee11);
20044
20105
  }));
20045
20106
 
20046
- return function updateUnitPriceExcludingTax(_x15, _x16, _x17) {
20047
- return _ref9.apply(this, arguments);
20107
+ return function updateUnitPriceExcludingTax(_x17, _x18, _x19) {
20108
+ return _ref10.apply(this, arguments);
20048
20109
  };
20049
20110
  }();
20050
20111
  /** 不含税 => 更新(含税) */
20051
20112
 
20052
20113
  var updateUnitPriceTax$1 = /*#__PURE__*/function () {
20053
- var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(controller, form, record) {
20054
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
20114
+ var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(controller, form, record) {
20115
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
20055
20116
  while (1) {
20056
- switch (_context12.prev = _context12.next) {
20117
+ switch (_context13.prev = _context13.next) {
20057
20118
  case 0:
20058
- return _context12.abrupt("return", new Promise(function (resolve) {
20119
+ return _context13.abrupt("return", new Promise(function (resolve) {
20059
20120
  form.validateFields( /*#__PURE__*/function () {
20060
- var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(err, values) {
20121
+ var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(err, values) {
20061
20122
  var calculatingDigits, lineAmountExcludeTax, lineAmountIncludeTax, priceIncludeTax, taxAmount;
20062
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
20123
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
20063
20124
  while (1) {
20064
- switch (_context11.prev = _context11.next) {
20125
+ switch (_context12.prev = _context12.next) {
20065
20126
  case 0:
20066
20127
  console.log('不含税 => 更新(含税)');
20067
20128
  err = err || {};
20068
20129
 
20069
20130
  if (!(!err.taxRat && (values.taxRate || values.taxRate === 0) && !promptErr$1(err.lineAmountExcludeTax) && (values.lineAmountExcludeTax || values.lineAmountExcludeTax === 0))) {
20070
- _context11.next = 18;
20131
+ _context12.next = 18;
20071
20132
  break;
20072
20133
  }
20073
20134
 
@@ -20075,19 +20136,19 @@ var updateUnitPriceTax$1 = /*#__PURE__*/function () {
20075
20136
 
20076
20137
  lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
20077
20138
  lineAmountIncludeTax = format2(evaluate("".concat(lineAmountExcludeTax, " * (1+(").concat(values.taxRate, "/100))")));
20078
- _context11.next = 8;
20139
+ _context12.next = 8;
20079
20140
  return controller.setEditGood({
20080
20141
  lineAmountIncludeTax: lineAmountIncludeTax
20081
20142
  });
20082
20143
 
20083
20144
  case 8:
20084
20145
  if (!(!err.quantity && values.quantity)) {
20085
- _context11.next = 12;
20146
+ _context12.next = 12;
20086
20147
  break;
20087
20148
  }
20088
20149
 
20089
20150
  priceIncludeTax = format15(evaluate("".concat(lineAmountIncludeTax, " / ").concat(values.quantity)), calculatingDigits);
20090
- _context11.next = 12;
20151
+ _context12.next = 12;
20091
20152
  return controller.setEditGood({
20092
20153
  priceIncludeTax: priceIncludeTax
20093
20154
  });
@@ -20098,20 +20159,20 @@ var updateUnitPriceTax$1 = /*#__PURE__*/function () {
20098
20159
  form.setFieldsValue({
20099
20160
  taxAmount: taxAmount
20100
20161
  });
20101
- _context11.next = 16;
20162
+ _context12.next = 16;
20102
20163
  return controller.setEditGood({
20103
20164
  taxAmount: taxAmount
20104
20165
  });
20105
20166
 
20106
20167
  case 16:
20107
- _context11.next = 21;
20168
+ _context12.next = 21;
20108
20169
  break;
20109
20170
 
20110
20171
  case 18:
20111
20172
  form.setFieldsValue({
20112
20173
  taxAmount: undefined
20113
20174
  });
20114
- _context11.next = 21;
20175
+ _context12.next = 21;
20115
20176
  return controller.setEditGood({
20116
20177
  taxAmount: undefined
20117
20178
  });
@@ -20132,137 +20193,137 @@ var updateUnitPriceTax$1 = /*#__PURE__*/function () {
20132
20193
 
20133
20194
  case 22:
20134
20195
  case "end":
20135
- return _context11.stop();
20196
+ return _context12.stop();
20136
20197
  }
20137
20198
  }
20138
- }, _callee11);
20199
+ }, _callee12);
20139
20200
  }));
20140
20201
 
20141
- return function (_x23, _x24) {
20142
- return _ref12.apply(this, arguments);
20202
+ return function (_x25, _x26) {
20203
+ return _ref13.apply(this, arguments);
20143
20204
  };
20144
20205
  }());
20145
20206
  }));
20146
20207
 
20147
20208
  case 1:
20148
20209
  case "end":
20149
- return _context12.stop();
20210
+ return _context13.stop();
20150
20211
  }
20151
20212
  }
20152
- }, _callee12);
20213
+ }, _callee13);
20153
20214
  }));
20154
20215
 
20155
- return function updateUnitPriceTax(_x20, _x21, _x22) {
20156
- return _ref11.apply(this, arguments);
20216
+ return function updateUnitPriceTax(_x22, _x23, _x24) {
20217
+ return _ref12.apply(this, arguments);
20157
20218
  };
20158
20219
  }();
20159
20220
  /** 修改了 项目名称 */
20160
20221
 
20161
20222
  var onChangeItemName$1 = /*#__PURE__*/function () {
20162
- var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(controller, form, record) {
20163
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
20223
+ var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(controller, form, record) {
20224
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
20164
20225
  while (1) {
20165
- switch (_context17.prev = _context17.next) {
20226
+ switch (_context18.prev = _context18.next) {
20166
20227
  case 0:
20167
20228
  controller.run( /*#__PURE__*/function () {
20168
- var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(s) {
20229
+ var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(s) {
20169
20230
  var value;
20170
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
20231
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
20171
20232
  while (1) {
20172
- switch (_context16.prev = _context16.next) {
20233
+ switch (_context17.prev = _context17.next) {
20173
20234
  case 0:
20174
20235
  value = form.getFieldsValue().itemName;
20175
20236
 
20176
20237
  if (!s.goodsListState.isMyShow) {
20177
- _context16.next = 10;
20238
+ _context17.next = 10;
20178
20239
  break;
20179
20240
  }
20180
20241
 
20181
- _context16.next = 4;
20242
+ _context17.next = 4;
20182
20243
  return controller.setEditGood({
20183
20244
  itemNameSelf: value
20184
20245
  });
20185
20246
 
20186
20247
  case 4:
20187
- _context16.t0 = record.itemName;
20248
+ _context17.t0 = record.itemName;
20188
20249
 
20189
- if (!_context16.t0) {
20190
- _context16.next = 8;
20250
+ if (!_context17.t0) {
20251
+ _context17.next = 8;
20191
20252
  break;
20192
20253
  }
20193
20254
 
20194
- _context16.next = 8;
20255
+ _context17.next = 8;
20195
20256
  return controller.setEditGood({
20196
20257
  itemName: record.itemName
20197
20258
  });
20198
20259
 
20199
20260
  case 8:
20200
- _context16.next = 16;
20261
+ _context17.next = 16;
20201
20262
  break;
20202
20263
 
20203
20264
  case 10:
20204
- _context16.next = 12;
20265
+ _context17.next = 12;
20205
20266
  return controller.setEditGood({
20206
20267
  itemName: value
20207
20268
  });
20208
20269
 
20209
20270
  case 12:
20210
- _context16.t1 = record.itemNameSelf;
20271
+ _context17.t1 = record.itemNameSelf;
20211
20272
 
20212
- if (!_context16.t1) {
20213
- _context16.next = 16;
20273
+ if (!_context17.t1) {
20274
+ _context17.next = 16;
20214
20275
  break;
20215
20276
  }
20216
20277
 
20217
- _context16.next = 16;
20278
+ _context17.next = 16;
20218
20279
  return controller.setEditGood({
20219
20280
  itemNameSelf: record.itemNameSelf
20220
20281
  });
20221
20282
 
20222
20283
  case 16:
20223
20284
  case "end":
20224
- return _context16.stop();
20285
+ return _context17.stop();
20225
20286
  }
20226
20287
  }
20227
- }, _callee16);
20288
+ }, _callee17);
20228
20289
  }));
20229
20290
 
20230
- return function (_x33) {
20231
- return _ref17.apply(this, arguments);
20291
+ return function (_x35) {
20292
+ return _ref18.apply(this, arguments);
20232
20293
  };
20233
20294
  }());
20234
20295
 
20235
20296
  case 1:
20236
20297
  case "end":
20237
- return _context17.stop();
20298
+ return _context18.stop();
20238
20299
  }
20239
20300
  }
20240
- }, _callee17);
20301
+ }, _callee18);
20241
20302
  }));
20242
20303
 
20243
- return function onChangeItemName(_x30, _x31, _x32) {
20244
- return _ref16.apply(this, arguments);
20304
+ return function onChangeItemName(_x32, _x33, _x34) {
20305
+ return _ref17.apply(this, arguments);
20245
20306
  };
20246
20307
  }();
20247
20308
  /** 修改了含税开关 重新计算 */
20248
20309
 
20249
20310
  var onChangeSwitchTax$1 = /*#__PURE__*/function () {
20250
- var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(controller, isTaxIncluded) {
20311
+ var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(controller, isTaxIncluded) {
20251
20312
  var calculatingDigits;
20252
- return _regeneratorRuntime().wrap(function _callee20$(_context20) {
20313
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
20253
20314
  while (1) {
20254
- switch (_context20.prev = _context20.next) {
20315
+ switch (_context21.prev = _context21.next) {
20255
20316
  case 0:
20256
20317
  if (controller.state.goodsListState.isRecalculateWhenSwitchTax) {
20257
- _context20.next = 3;
20318
+ _context21.next = 3;
20258
20319
  break;
20259
20320
  }
20260
20321
 
20261
20322
  controller.pipeline( /*#__PURE__*/function () {
20262
- var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(s) {
20263
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
20323
+ var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(s) {
20324
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
20264
20325
  while (1) {
20265
- switch (_context18.prev = _context18.next) {
20326
+ switch (_context19.prev = _context19.next) {
20266
20327
  case 0:
20267
20328
  s.goodsListState = _objectSpread2(_objectSpread2({}, s.goodsListState), {}, {
20268
20329
  isTaxIncluded: isTaxIncluded
@@ -20270,39 +20331,39 @@ var onChangeSwitchTax$1 = /*#__PURE__*/function () {
20270
20331
 
20271
20332
  case 1:
20272
20333
  case "end":
20273
- return _context18.stop();
20334
+ return _context19.stop();
20274
20335
  }
20275
20336
  }
20276
- }, _callee18);
20337
+ }, _callee19);
20277
20338
  }));
20278
20339
 
20279
- return function (_x36) {
20280
- return _ref19.apply(this, arguments);
20340
+ return function (_x38) {
20341
+ return _ref20.apply(this, arguments);
20281
20342
  };
20282
20343
  }())();
20283
- return _context20.abrupt("return");
20344
+ return _context21.abrupt("return");
20284
20345
 
20285
20346
  case 3:
20286
20347
  calculatingDigits = controller.state.calculatingDigits;
20287
- _context20.next = 6;
20348
+ _context21.next = 6;
20288
20349
  return controller.saveEditGood();
20289
20350
 
20290
20351
  case 6:
20291
- _context20.next = 8;
20352
+ _context21.next = 8;
20292
20353
  return controller.wait();
20293
20354
 
20294
20355
  case 8:
20295
- _context20.next = 10;
20356
+ _context21.next = 10;
20296
20357
  return controller.run( /*#__PURE__*/function () {
20297
- var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(s) {
20358
+ var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(s) {
20298
20359
  var _s$goodsListState, needRefresh, newGoodsList;
20299
20360
 
20300
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
20361
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
20301
20362
  while (1) {
20302
- switch (_context19.prev = _context19.next) {
20363
+ switch (_context20.prev = _context20.next) {
20303
20364
  case 0:
20304
20365
  if (!s.goodsListState.editGood) {
20305
- _context19.next = 3;
20366
+ _context20.next = 3;
20306
20367
  break;
20307
20368
  }
20308
20369
 
@@ -20310,7 +20371,7 @@ var onChangeSwitchTax$1 = /*#__PURE__*/function () {
20310
20371
  content: '你正在编辑一个货物',
20311
20372
  key: '你正在编辑一个货物'
20312
20373
  });
20313
- return _context19.abrupt("return");
20374
+ return _context20.abrupt("return");
20314
20375
 
20315
20376
  case 3:
20316
20377
  s.goodsListState.isTaxIncluded = isTaxIncluded;
@@ -20392,27 +20453,27 @@ var onChangeSwitchTax$1 = /*#__PURE__*/function () {
20392
20453
 
20393
20454
  case 5:
20394
20455
  case "end":
20395
- return _context19.stop();
20456
+ return _context20.stop();
20396
20457
  }
20397
20458
  }
20398
- }, _callee19);
20459
+ }, _callee20);
20399
20460
  }));
20400
20461
 
20401
- return function (_x37) {
20402
- return _ref20.apply(this, arguments);
20462
+ return function (_x39) {
20463
+ return _ref21.apply(this, arguments);
20403
20464
  };
20404
20465
  }());
20405
20466
 
20406
20467
  case 10:
20407
20468
  case "end":
20408
- return _context20.stop();
20469
+ return _context21.stop();
20409
20470
  }
20410
20471
  }
20411
- }, _callee20);
20472
+ }, _callee21);
20412
20473
  }));
20413
20474
 
20414
- return function onChangeSwitchTax(_x34, _x35) {
20415
- return _ref18.apply(this, arguments);
20475
+ return function onChangeSwitchTax(_x36, _x37) {
20476
+ return _ref19.apply(this, arguments);
20416
20477
  };
20417
20478
  }();
20418
20479
 
@@ -21277,6 +21338,11 @@ var useColumns$1 = (function (form) {
21277
21338
  var disableds = controller.useMemo(function (e) {
21278
21339
  return e.stakeholder.disableds || [];
21279
21340
  }, []);
21341
+ /** 启用字段 */
21342
+
21343
+ var enables = controller.useMemo(function (s) {
21344
+ return s.stakeholder.enables || [];
21345
+ }, []);
21280
21346
  /** 搜索条件 */
21281
21347
 
21282
21348
  var searchValue = controller.useMemo(function (e) {
@@ -21331,6 +21397,9 @@ var useColumns$1 = (function (form) {
21331
21397
  };
21332
21398
  }());
21333
21399
  }, []);
21400
+ var isEnables = React.useCallback(function (field) {
21401
+ return enables.indexOf(field) >= 0;
21402
+ }, [enables]);
21334
21403
  var onNumberValueChange = React.useCallback(function (e) {
21335
21404
  var _e$target;
21336
21405
 
@@ -21653,7 +21722,7 @@ var useColumns$1 = (function (form) {
21653
21722
  style: {
21654
21723
  textAlign: 'right'
21655
21724
  },
21656
- maxLength: 16,
21725
+ maxLength: 25,
21657
21726
  loading: isCipher$1(changeField, "quantity"),
21658
21727
  onChange: function () {
21659
21728
  var _onChange3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
@@ -21748,7 +21817,7 @@ var useColumns$1 = (function (form) {
21748
21817
  style: {
21749
21818
  textAlign: 'right'
21750
21819
  },
21751
- maxLength: 16,
21820
+ maxLength: 25,
21752
21821
  loading: isCipher$1(changeField, 'priceIncludeTax'),
21753
21822
  onChange: function onChange() {
21754
21823
  setChangeField('priceIncludeTax');
@@ -21823,7 +21892,7 @@ var useColumns$1 = (function (form) {
21823
21892
  style: {
21824
21893
  textAlign: 'right'
21825
21894
  },
21826
- maxLength: 16,
21895
+ maxLength: 25,
21827
21896
  loading: isCipher$1(changeField, 'priceExcludeTax'),
21828
21897
  onChange: function onChange() {
21829
21898
  setChangeField('priceExcludeTax');
@@ -22048,8 +22117,23 @@ var useColumns$1 = (function (form) {
22048
22117
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('taxAmount')) {
22049
22118
  return getFieldDecorator('taxAmount', {
22050
22119
  initialValue: editGood.taxAmount,
22051
- rules: getReplenishRules('taxAmount')
22052
- })( /*#__PURE__*/React.createElement(MyDiv$2, {
22120
+ rules: [].concat(_toConsumableArray(getReplenishRules('taxAmount')), [{
22121
+ required: true,
22122
+ message: '税额不能为空'
22123
+ }, {
22124
+ pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
22125
+ message: '税额必须为数字'
22126
+ }])
22127
+ })(isEnables('taxAmount') ? /*#__PURE__*/React.createElement(MyInput$3, {
22128
+ style: {
22129
+ textAlign: 'right'
22130
+ },
22131
+ loading: isCipher$1(changeField, 'taxAmount'),
22132
+ onChange: function onChange() {
22133
+ setChangeField('taxAmount');
22134
+ onChangeTaxAmount(controller, form, record);
22135
+ }
22136
+ }) : /*#__PURE__*/React.createElement(MyDiv$2, {
22053
22137
  loading: isCipher$1(changeField, 'taxAmount')
22054
22138
  }));
22055
22139
  } else {
@@ -22060,15 +22144,7 @@ var useColumns$1 = (function (form) {
22060
22144
  }, isDutyFree$1(record) ? '***' : parseFloat(value).toFixed(2));
22061
22145
  }
22062
22146
  }
22063
- } // {
22064
- // title: '操作',
22065
- // key: 'operating',
22066
- // align: 'right',
22067
- // width: 130,
22068
- // fixed: 'right',
22069
- // render: (_value: string, record: IGood) => <RowMenu key={record.lineAttribute} goods={record} />,
22070
- // },
22071
- ] // 含税不含税
22147
+ }] // 含税不含税
22072
22148
  .filter(function (e) {
22073
22149
  if (isTaxIncluded) {
22074
22150
  return !(e.key === 'priceExcludeTax' || e.key === 'lineAmountExcludeTax');