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.
package/dist/index.js CHANGED
@@ -13945,7 +13945,7 @@ var useColumns = (function (form) {
13945
13945
  style: {
13946
13946
  textAlign: 'right'
13947
13947
  },
13948
- maxLength: 16,
13948
+ maxLength: 25,
13949
13949
  loading: isCipher(changeField, "quantity"),
13950
13950
  onChange: function () {
13951
13951
  var _onChange4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
@@ -14040,7 +14040,7 @@ var useColumns = (function (form) {
14040
14040
  style: {
14041
14041
  textAlign: 'right'
14042
14042
  },
14043
- maxLength: 16,
14043
+ maxLength: 25,
14044
14044
  loading: isCipher(changeField, 'priceIncludeTax'),
14045
14045
  onChange: function onChange() {
14046
14046
  setChangeField('priceIncludeTax');
@@ -14115,7 +14115,7 @@ var useColumns = (function (form) {
14115
14115
  style: {
14116
14116
  textAlign: 'right'
14117
14117
  },
14118
- maxLength: 16,
14118
+ maxLength: 25,
14119
14119
  loading: isCipher(changeField, 'priceExcludeTax'),
14120
14120
  onChange: function onChange() {
14121
14121
  setChangeField('priceExcludeTax');
@@ -19966,21 +19966,82 @@ var onChangeTaxRate$1 = lazyFn$2(function (controller, form, record) {
19966
19966
  };
19967
19967
  }());
19968
19968
  }, 1000);
19969
+ /** 税额 */
19970
+
19971
+ var onChangeTaxAmount = lazyFn$2(function (controller, form, record) {
19972
+ /** 金额(不含税) */
19973
+ var lineAmountExcludeTax;
19974
+ form.validateFields( /*#__PURE__*/function () {
19975
+ var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(err, values) {
19976
+ var record, priceExcludeTax;
19977
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
19978
+ while (1) {
19979
+ switch (_context9.prev = _context9.next) {
19980
+ case 0:
19981
+ err = err || {};
19982
+ record = controller.state.goodsListState.editGood; // 校验是否有含税金额
19983
+
19984
+ if (!(err.lineAmountIncludeTax && !(record === null || record === void 0 ? void 0 : record.lineAmountIncludeTax) && (record === null || record === void 0 ? void 0 : record.lineAmountIncludeTax) !== 0)) {
19985
+ _context9.next = 6;
19986
+ break;
19987
+ }
19988
+
19989
+ _context9.next = 5;
19990
+ return clearCalculatingField$1(controller);
19991
+
19992
+ case 5:
19993
+ return _context9.abrupt("return");
19994
+
19995
+ case 6:
19996
+ // 计数不含税金额
19997
+ lineAmountExcludeTax = countAmountExcludeTax((record === null || record === void 0 ? void 0 : record.lineAmountIncludeTax) || 0, values.taxAmount);
19998
+ form.setFieldsValue({
19999
+ lineAmountExcludeTax: lineAmountExcludeTax
20000
+ });
20001
+ priceExcludeTax = countPrice(lineAmountExcludeTax || '', (record === null || record === void 0 ? void 0 : record.quantity) || '', controller.state.calculatingDigits);
20002
+ _context9.next = 11;
20003
+ return controller.setEditGood({
20004
+ lineAmountExcludeTax: lineAmountExcludeTax,
20005
+ taxAmount: values.taxAmount,
20006
+ priceExcludeTax: priceExcludeTax
20007
+ });
20008
+
20009
+ case 11:
20010
+ form.setFieldsValue({
20011
+ priceExcludeTax: priceExcludeTax
20012
+ }); // 清楚 计算中启动字段
20013
+
20014
+ _context9.next = 14;
20015
+ return clearCalculatingField$1(controller);
20016
+
20017
+ case 14:
20018
+ case "end":
20019
+ return _context9.stop();
20020
+ }
20021
+ }
20022
+ }, _callee9);
20023
+ }));
20024
+
20025
+ return function (_x15, _x16) {
20026
+ return _ref9.apply(this, arguments);
20027
+ };
20028
+ }());
20029
+ }, 1000);
19969
20030
  /** 含税 => 更新(不含税) */
19970
20031
 
19971
20032
  var updateUnitPriceExcludingTax$1 = /*#__PURE__*/function () {
19972
- var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(controller, form, record) {
19973
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
20033
+ var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(controller, form, record) {
20034
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
19974
20035
  while (1) {
19975
- switch (_context10.prev = _context10.next) {
20036
+ switch (_context11.prev = _context11.next) {
19976
20037
  case 0:
19977
- return _context10.abrupt("return", new Promise(function (resolve) {
20038
+ return _context11.abrupt("return", new Promise(function (resolve) {
19978
20039
  form.validateFields( /*#__PURE__*/function () {
19979
- var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(err, values) {
20040
+ var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(err, values) {
19980
20041
  var taxAmount, lineAmountExcludeTax, priceExcludeTax, deduction, editGood;
19981
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
20042
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
19982
20043
  while (1) {
19983
- switch (_context9.prev = _context9.next) {
20044
+ switch (_context10.prev = _context10.next) {
19984
20045
  case 0:
19985
20046
  console.log('含税 => 更新(不含税');
19986
20047
  err = err || {};
@@ -19997,7 +20058,7 @@ var updateUnitPriceExcludingTax$1 = /*#__PURE__*/function () {
19997
20058
  form.setFieldsValue({
19998
20059
  taxAmount: taxAmount
19999
20060
  });
20000
- _context9.next = 8;
20061
+ _context10.next = 8;
20001
20062
  return controller.setEditGood({
20002
20063
  taxAmount: taxAmount
20003
20064
  });
@@ -20011,7 +20072,7 @@ var updateUnitPriceExcludingTax$1 = /*#__PURE__*/function () {
20011
20072
  form.setFieldsValue({
20012
20073
  lineAmountExcludeTax: lineAmountExcludeTax
20013
20074
  });
20014
- _context9.next = 12;
20075
+ _context10.next = 12;
20015
20076
  return controller.setEditGood({
20016
20077
  lineAmountExcludeTax: lineAmountExcludeTax
20017
20078
  });
@@ -20025,21 +20086,21 @@ var updateUnitPriceExcludingTax$1 = /*#__PURE__*/function () {
20025
20086
  form.setFieldsValue({
20026
20087
  priceExcludeTax: priceExcludeTax
20027
20088
  });
20028
- _context9.next = 16;
20089
+ _context10.next = 16;
20029
20090
  return controller.setEditGood({
20030
20091
  priceExcludeTax: priceExcludeTax
20031
20092
  });
20032
20093
 
20033
20094
  case 16:
20034
20095
  case "end":
20035
- return _context9.stop();
20096
+ return _context10.stop();
20036
20097
  }
20037
20098
  }
20038
- }, _callee9);
20099
+ }, _callee10);
20039
20100
  }));
20040
20101
 
20041
- return function (_x18, _x19) {
20042
- return _ref10.apply(this, arguments);
20102
+ return function (_x20, _x21) {
20103
+ return _ref11.apply(this, arguments);
20043
20104
  };
20044
20105
  }());
20045
20106
  resolve(undefined);
@@ -20047,37 +20108,37 @@ var updateUnitPriceExcludingTax$1 = /*#__PURE__*/function () {
20047
20108
 
20048
20109
  case 1:
20049
20110
  case "end":
20050
- return _context10.stop();
20111
+ return _context11.stop();
20051
20112
  }
20052
20113
  }
20053
- }, _callee10);
20114
+ }, _callee11);
20054
20115
  }));
20055
20116
 
20056
- return function updateUnitPriceExcludingTax(_x15, _x16, _x17) {
20057
- return _ref9.apply(this, arguments);
20117
+ return function updateUnitPriceExcludingTax(_x17, _x18, _x19) {
20118
+ return _ref10.apply(this, arguments);
20058
20119
  };
20059
20120
  }();
20060
20121
  /** 不含税 => 更新(含税) */
20061
20122
 
20062
20123
  var updateUnitPriceTax$1 = /*#__PURE__*/function () {
20063
- var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(controller, form, record) {
20064
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
20124
+ var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(controller, form, record) {
20125
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
20065
20126
  while (1) {
20066
- switch (_context12.prev = _context12.next) {
20127
+ switch (_context13.prev = _context13.next) {
20067
20128
  case 0:
20068
- return _context12.abrupt("return", new Promise(function (resolve) {
20129
+ return _context13.abrupt("return", new Promise(function (resolve) {
20069
20130
  form.validateFields( /*#__PURE__*/function () {
20070
- var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(err, values) {
20131
+ var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(err, values) {
20071
20132
  var calculatingDigits, lineAmountExcludeTax, lineAmountIncludeTax, priceIncludeTax, taxAmount;
20072
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
20133
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
20073
20134
  while (1) {
20074
- switch (_context11.prev = _context11.next) {
20135
+ switch (_context12.prev = _context12.next) {
20075
20136
  case 0:
20076
20137
  console.log('不含税 => 更新(含税)');
20077
20138
  err = err || {};
20078
20139
 
20079
20140
  if (!(!err.taxRat && (values.taxRate || values.taxRate === 0) && !promptErr$1(err.lineAmountExcludeTax) && (values.lineAmountExcludeTax || values.lineAmountExcludeTax === 0))) {
20080
- _context11.next = 18;
20141
+ _context12.next = 18;
20081
20142
  break;
20082
20143
  }
20083
20144
 
@@ -20085,19 +20146,19 @@ var updateUnitPriceTax$1 = /*#__PURE__*/function () {
20085
20146
 
20086
20147
  lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
20087
20148
  lineAmountIncludeTax = format2(evaluate("".concat(lineAmountExcludeTax, " * (1+(").concat(values.taxRate, "/100))")));
20088
- _context11.next = 8;
20149
+ _context12.next = 8;
20089
20150
  return controller.setEditGood({
20090
20151
  lineAmountIncludeTax: lineAmountIncludeTax
20091
20152
  });
20092
20153
 
20093
20154
  case 8:
20094
20155
  if (!(!err.quantity && values.quantity)) {
20095
- _context11.next = 12;
20156
+ _context12.next = 12;
20096
20157
  break;
20097
20158
  }
20098
20159
 
20099
20160
  priceIncludeTax = format15(evaluate("".concat(lineAmountIncludeTax, " / ").concat(values.quantity)), calculatingDigits);
20100
- _context11.next = 12;
20161
+ _context12.next = 12;
20101
20162
  return controller.setEditGood({
20102
20163
  priceIncludeTax: priceIncludeTax
20103
20164
  });
@@ -20108,20 +20169,20 @@ var updateUnitPriceTax$1 = /*#__PURE__*/function () {
20108
20169
  form.setFieldsValue({
20109
20170
  taxAmount: taxAmount
20110
20171
  });
20111
- _context11.next = 16;
20172
+ _context12.next = 16;
20112
20173
  return controller.setEditGood({
20113
20174
  taxAmount: taxAmount
20114
20175
  });
20115
20176
 
20116
20177
  case 16:
20117
- _context11.next = 21;
20178
+ _context12.next = 21;
20118
20179
  break;
20119
20180
 
20120
20181
  case 18:
20121
20182
  form.setFieldsValue({
20122
20183
  taxAmount: undefined
20123
20184
  });
20124
- _context11.next = 21;
20185
+ _context12.next = 21;
20125
20186
  return controller.setEditGood({
20126
20187
  taxAmount: undefined
20127
20188
  });
@@ -20142,137 +20203,137 @@ var updateUnitPriceTax$1 = /*#__PURE__*/function () {
20142
20203
 
20143
20204
  case 22:
20144
20205
  case "end":
20145
- return _context11.stop();
20206
+ return _context12.stop();
20146
20207
  }
20147
20208
  }
20148
- }, _callee11);
20209
+ }, _callee12);
20149
20210
  }));
20150
20211
 
20151
- return function (_x23, _x24) {
20152
- return _ref12.apply(this, arguments);
20212
+ return function (_x25, _x26) {
20213
+ return _ref13.apply(this, arguments);
20153
20214
  };
20154
20215
  }());
20155
20216
  }));
20156
20217
 
20157
20218
  case 1:
20158
20219
  case "end":
20159
- return _context12.stop();
20220
+ return _context13.stop();
20160
20221
  }
20161
20222
  }
20162
- }, _callee12);
20223
+ }, _callee13);
20163
20224
  }));
20164
20225
 
20165
- return function updateUnitPriceTax(_x20, _x21, _x22) {
20166
- return _ref11.apply(this, arguments);
20226
+ return function updateUnitPriceTax(_x22, _x23, _x24) {
20227
+ return _ref12.apply(this, arguments);
20167
20228
  };
20168
20229
  }();
20169
20230
  /** 修改了 项目名称 */
20170
20231
 
20171
20232
  var onChangeItemName$1 = /*#__PURE__*/function () {
20172
- var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(controller, form, record) {
20173
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
20233
+ var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(controller, form, record) {
20234
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
20174
20235
  while (1) {
20175
- switch (_context17.prev = _context17.next) {
20236
+ switch (_context18.prev = _context18.next) {
20176
20237
  case 0:
20177
20238
  controller.run( /*#__PURE__*/function () {
20178
- var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(s) {
20239
+ var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(s) {
20179
20240
  var value;
20180
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
20241
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
20181
20242
  while (1) {
20182
- switch (_context16.prev = _context16.next) {
20243
+ switch (_context17.prev = _context17.next) {
20183
20244
  case 0:
20184
20245
  value = form.getFieldsValue().itemName;
20185
20246
 
20186
20247
  if (!s.goodsListState.isMyShow) {
20187
- _context16.next = 10;
20248
+ _context17.next = 10;
20188
20249
  break;
20189
20250
  }
20190
20251
 
20191
- _context16.next = 4;
20252
+ _context17.next = 4;
20192
20253
  return controller.setEditGood({
20193
20254
  itemNameSelf: value
20194
20255
  });
20195
20256
 
20196
20257
  case 4:
20197
- _context16.t0 = record.itemName;
20258
+ _context17.t0 = record.itemName;
20198
20259
 
20199
- if (!_context16.t0) {
20200
- _context16.next = 8;
20260
+ if (!_context17.t0) {
20261
+ _context17.next = 8;
20201
20262
  break;
20202
20263
  }
20203
20264
 
20204
- _context16.next = 8;
20265
+ _context17.next = 8;
20205
20266
  return controller.setEditGood({
20206
20267
  itemName: record.itemName
20207
20268
  });
20208
20269
 
20209
20270
  case 8:
20210
- _context16.next = 16;
20271
+ _context17.next = 16;
20211
20272
  break;
20212
20273
 
20213
20274
  case 10:
20214
- _context16.next = 12;
20275
+ _context17.next = 12;
20215
20276
  return controller.setEditGood({
20216
20277
  itemName: value
20217
20278
  });
20218
20279
 
20219
20280
  case 12:
20220
- _context16.t1 = record.itemNameSelf;
20281
+ _context17.t1 = record.itemNameSelf;
20221
20282
 
20222
- if (!_context16.t1) {
20223
- _context16.next = 16;
20283
+ if (!_context17.t1) {
20284
+ _context17.next = 16;
20224
20285
  break;
20225
20286
  }
20226
20287
 
20227
- _context16.next = 16;
20288
+ _context17.next = 16;
20228
20289
  return controller.setEditGood({
20229
20290
  itemNameSelf: record.itemNameSelf
20230
20291
  });
20231
20292
 
20232
20293
  case 16:
20233
20294
  case "end":
20234
- return _context16.stop();
20295
+ return _context17.stop();
20235
20296
  }
20236
20297
  }
20237
- }, _callee16);
20298
+ }, _callee17);
20238
20299
  }));
20239
20300
 
20240
- return function (_x33) {
20241
- return _ref17.apply(this, arguments);
20301
+ return function (_x35) {
20302
+ return _ref18.apply(this, arguments);
20242
20303
  };
20243
20304
  }());
20244
20305
 
20245
20306
  case 1:
20246
20307
  case "end":
20247
- return _context17.stop();
20308
+ return _context18.stop();
20248
20309
  }
20249
20310
  }
20250
- }, _callee17);
20311
+ }, _callee18);
20251
20312
  }));
20252
20313
 
20253
- return function onChangeItemName(_x30, _x31, _x32) {
20254
- return _ref16.apply(this, arguments);
20314
+ return function onChangeItemName(_x32, _x33, _x34) {
20315
+ return _ref17.apply(this, arguments);
20255
20316
  };
20256
20317
  }();
20257
20318
  /** 修改了含税开关 重新计算 */
20258
20319
 
20259
20320
  var onChangeSwitchTax$1 = /*#__PURE__*/function () {
20260
- var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(controller, isTaxIncluded) {
20321
+ var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(controller, isTaxIncluded) {
20261
20322
  var calculatingDigits;
20262
- return _regeneratorRuntime().wrap(function _callee20$(_context20) {
20323
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
20263
20324
  while (1) {
20264
- switch (_context20.prev = _context20.next) {
20325
+ switch (_context21.prev = _context21.next) {
20265
20326
  case 0:
20266
20327
  if (controller.state.goodsListState.isRecalculateWhenSwitchTax) {
20267
- _context20.next = 3;
20328
+ _context21.next = 3;
20268
20329
  break;
20269
20330
  }
20270
20331
 
20271
20332
  controller.pipeline( /*#__PURE__*/function () {
20272
- var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(s) {
20273
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
20333
+ var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(s) {
20334
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
20274
20335
  while (1) {
20275
- switch (_context18.prev = _context18.next) {
20336
+ switch (_context19.prev = _context19.next) {
20276
20337
  case 0:
20277
20338
  s.goodsListState = _objectSpread2(_objectSpread2({}, s.goodsListState), {}, {
20278
20339
  isTaxIncluded: isTaxIncluded
@@ -20280,39 +20341,39 @@ var onChangeSwitchTax$1 = /*#__PURE__*/function () {
20280
20341
 
20281
20342
  case 1:
20282
20343
  case "end":
20283
- return _context18.stop();
20344
+ return _context19.stop();
20284
20345
  }
20285
20346
  }
20286
- }, _callee18);
20347
+ }, _callee19);
20287
20348
  }));
20288
20349
 
20289
- return function (_x36) {
20290
- return _ref19.apply(this, arguments);
20350
+ return function (_x38) {
20351
+ return _ref20.apply(this, arguments);
20291
20352
  };
20292
20353
  }())();
20293
- return _context20.abrupt("return");
20354
+ return _context21.abrupt("return");
20294
20355
 
20295
20356
  case 3:
20296
20357
  calculatingDigits = controller.state.calculatingDigits;
20297
- _context20.next = 6;
20358
+ _context21.next = 6;
20298
20359
  return controller.saveEditGood();
20299
20360
 
20300
20361
  case 6:
20301
- _context20.next = 8;
20362
+ _context21.next = 8;
20302
20363
  return controller.wait();
20303
20364
 
20304
20365
  case 8:
20305
- _context20.next = 10;
20366
+ _context21.next = 10;
20306
20367
  return controller.run( /*#__PURE__*/function () {
20307
- var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(s) {
20368
+ var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(s) {
20308
20369
  var _s$goodsListState, needRefresh, newGoodsList;
20309
20370
 
20310
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
20371
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
20311
20372
  while (1) {
20312
- switch (_context19.prev = _context19.next) {
20373
+ switch (_context20.prev = _context20.next) {
20313
20374
  case 0:
20314
20375
  if (!s.goodsListState.editGood) {
20315
- _context19.next = 3;
20376
+ _context20.next = 3;
20316
20377
  break;
20317
20378
  }
20318
20379
 
@@ -20320,7 +20381,7 @@ var onChangeSwitchTax$1 = /*#__PURE__*/function () {
20320
20381
  content: '你正在编辑一个货物',
20321
20382
  key: '你正在编辑一个货物'
20322
20383
  });
20323
- return _context19.abrupt("return");
20384
+ return _context20.abrupt("return");
20324
20385
 
20325
20386
  case 3:
20326
20387
  s.goodsListState.isTaxIncluded = isTaxIncluded;
@@ -20402,27 +20463,27 @@ var onChangeSwitchTax$1 = /*#__PURE__*/function () {
20402
20463
 
20403
20464
  case 5:
20404
20465
  case "end":
20405
- return _context19.stop();
20466
+ return _context20.stop();
20406
20467
  }
20407
20468
  }
20408
- }, _callee19);
20469
+ }, _callee20);
20409
20470
  }));
20410
20471
 
20411
- return function (_x37) {
20412
- return _ref20.apply(this, arguments);
20472
+ return function (_x39) {
20473
+ return _ref21.apply(this, arguments);
20413
20474
  };
20414
20475
  }());
20415
20476
 
20416
20477
  case 10:
20417
20478
  case "end":
20418
- return _context20.stop();
20479
+ return _context21.stop();
20419
20480
  }
20420
20481
  }
20421
- }, _callee20);
20482
+ }, _callee21);
20422
20483
  }));
20423
20484
 
20424
- return function onChangeSwitchTax(_x34, _x35) {
20425
- return _ref18.apply(this, arguments);
20485
+ return function onChangeSwitchTax(_x36, _x37) {
20486
+ return _ref19.apply(this, arguments);
20426
20487
  };
20427
20488
  }();
20428
20489
 
@@ -21287,6 +21348,11 @@ var useColumns$1 = (function (form) {
21287
21348
  var disableds = controller.useMemo(function (e) {
21288
21349
  return e.stakeholder.disableds || [];
21289
21350
  }, []);
21351
+ /** 启用字段 */
21352
+
21353
+ var enables = controller.useMemo(function (s) {
21354
+ return s.stakeholder.enables || [];
21355
+ }, []);
21290
21356
  /** 搜索条件 */
21291
21357
 
21292
21358
  var searchValue = controller.useMemo(function (e) {
@@ -21341,6 +21407,9 @@ var useColumns$1 = (function (form) {
21341
21407
  };
21342
21408
  }());
21343
21409
  }, []);
21410
+ var isEnables = React__default['default'].useCallback(function (field) {
21411
+ return enables.indexOf(field) >= 0;
21412
+ }, [enables]);
21344
21413
  var onNumberValueChange = React__default['default'].useCallback(function (e) {
21345
21414
  var _e$target;
21346
21415
 
@@ -21663,7 +21732,7 @@ var useColumns$1 = (function (form) {
21663
21732
  style: {
21664
21733
  textAlign: 'right'
21665
21734
  },
21666
- maxLength: 16,
21735
+ maxLength: 25,
21667
21736
  loading: isCipher$1(changeField, "quantity"),
21668
21737
  onChange: function () {
21669
21738
  var _onChange3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
@@ -21758,7 +21827,7 @@ var useColumns$1 = (function (form) {
21758
21827
  style: {
21759
21828
  textAlign: 'right'
21760
21829
  },
21761
- maxLength: 16,
21830
+ maxLength: 25,
21762
21831
  loading: isCipher$1(changeField, 'priceIncludeTax'),
21763
21832
  onChange: function onChange() {
21764
21833
  setChangeField('priceIncludeTax');
@@ -21833,7 +21902,7 @@ var useColumns$1 = (function (form) {
21833
21902
  style: {
21834
21903
  textAlign: 'right'
21835
21904
  },
21836
- maxLength: 16,
21905
+ maxLength: 25,
21837
21906
  loading: isCipher$1(changeField, 'priceExcludeTax'),
21838
21907
  onChange: function onChange() {
21839
21908
  setChangeField('priceExcludeTax');
@@ -22058,8 +22127,23 @@ var useColumns$1 = (function (form) {
22058
22127
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('taxAmount')) {
22059
22128
  return getFieldDecorator('taxAmount', {
22060
22129
  initialValue: editGood.taxAmount,
22061
- rules: getReplenishRules('taxAmount')
22062
- })( /*#__PURE__*/React__default['default'].createElement(MyDiv$2, {
22130
+ rules: [].concat(_toConsumableArray(getReplenishRules('taxAmount')), [{
22131
+ required: true,
22132
+ message: '税额不能为空'
22133
+ }, {
22134
+ pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
22135
+ message: '税额必须为数字'
22136
+ }])
22137
+ })(isEnables('taxAmount') ? /*#__PURE__*/React__default['default'].createElement(MyInput$3, {
22138
+ style: {
22139
+ textAlign: 'right'
22140
+ },
22141
+ loading: isCipher$1(changeField, 'taxAmount'),
22142
+ onChange: function onChange() {
22143
+ setChangeField('taxAmount');
22144
+ onChangeTaxAmount(controller, form, record);
22145
+ }
22146
+ }) : /*#__PURE__*/React__default['default'].createElement(MyDiv$2, {
22063
22147
  loading: isCipher$1(changeField, 'taxAmount')
22064
22148
  }));
22065
22149
  } else {
@@ -22070,15 +22154,7 @@ var useColumns$1 = (function (form) {
22070
22154
  }, isDutyFree$1(record) ? '***' : parseFloat(value).toFixed(2));
22071
22155
  }
22072
22156
  }
22073
- } // {
22074
- // title: '操作',
22075
- // key: 'operating',
22076
- // align: 'right',
22077
- // width: 130,
22078
- // fixed: 'right',
22079
- // render: (_value: string, record: IGood) => <RowMenu key={record.lineAttribute} goods={record} />,
22080
- // },
22081
- ] // 含税不含税
22157
+ }] // 含税不含税
22082
22158
  .filter(function (e) {
22083
22159
  if (isTaxIncluded) {
22084
22160
  return !(e.key === 'priceExcludeTax' || e.key === 'lineAmountExcludeTax');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.191",
3
+ "version": "3.2.193",
4
4
  "scripts": {
5
5
  "dev": "dumi dev --max-old-space-size=6096",
6
6
  "start": "dumi dev",
@@ -10,19 +10,9 @@ export default () => {
10
10
  const controller = React.useMemo(() => new Invoice.InvoiceController(), [])
11
11
 
12
12
  React.useEffect(() => {
13
- (async () => {
14
- window.setTimeout(async () => {
15
- await controller.formList.get('stakeholder')?.setFieldsValue({
16
- buyerName: '国能供应链内蒙古有限公司',
17
- buyerTaxId: '91150291552838725H',
18
- buyerAddress: '内蒙古自治区包头稀士高新区总部经济园区9号楼204号',
19
- buyerPhone: '0472-5368680',
20
- buyerBank: '11050167360000000932中国银行股份有限公司包头开发区支行',
21
- buyerBankAccountFlag: true,
22
- })
23
- }, 1000)
24
-
25
- })()
13
+ controller.run(async s=>{
14
+ s.stakeholder.enables = ['taxAmount']
15
+ })
26
16
  }, [controller])
27
17
  return (
28
18
  <Invoice