kts-component-invoice-operate 3.1.11 → 3.1.13

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.esm.js CHANGED
@@ -820,7 +820,7 @@ var EndowCode = /*#__PURE__*/_createClass(function EndowCode() {
820
820
  label: '出口免税和其他免税优惠政策(免税)',
821
821
  value: 1
822
822
  }, {
823
- label: '不征增值税(不征税))',
823
+ label: '不征增值税(不征税)',
824
824
  value: 2
825
825
  }, {
826
826
  label: '普通零税率(0%)',
@@ -1287,7 +1287,7 @@ var saveEditGood = /*#__PURE__*/(function () {
1287
1287
  case 0:
1288
1288
  editGood = state.goodsListState.editGood;
1289
1289
  form = state.goodsListState.form;
1290
- if (!(!editGood || !form || state.goodsListState.importGoods.isVisibleDrawer)) {
1290
+ if (!(!editGood || !form || state.goodsListState.importGoods.isVisibleDrawer || state.calculating)) {
1291
1291
  _context.next = 4;
1292
1292
  break;
1293
1293
  }
@@ -8069,49 +8069,87 @@ var promptErr = function promptErr(err) {
8069
8069
  }
8070
8070
  return true;
8071
8071
  };
8072
+ /** 清除计算中启动字段 */
8073
+ var clearCalculatingField = /*#__PURE__*/function () {
8074
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(controller) {
8075
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
8076
+ while (1) switch (_context2.prev = _context2.next) {
8077
+ case 0:
8078
+ return _context2.abrupt("return", controller.run( /*#__PURE__*/function () {
8079
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
8080
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
8081
+ while (1) switch (_context.prev = _context.next) {
8082
+ case 0:
8083
+ return _context.abrupt("return", s.calculating = '');
8084
+ case 1:
8085
+ case "end":
8086
+ return _context.stop();
8087
+ }
8088
+ }, _callee);
8089
+ }));
8090
+ return function (_x2) {
8091
+ return _ref2.apply(this, arguments);
8092
+ };
8093
+ }()));
8094
+ case 1:
8095
+ case "end":
8096
+ return _context2.stop();
8097
+ }
8098
+ }, _callee2);
8099
+ }));
8100
+ return function clearCalculatingField(_x) {
8101
+ return _ref.apply(this, arguments);
8102
+ };
8103
+ }();
8072
8104
  /** 数量改变了 */
8073
8105
  var onChangeQuantity = lazyFn(function (controller, form, record) {
8074
8106
  form.validateFields( /*#__PURE__*/function () {
8075
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(err, values) {
8107
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(err, values) {
8076
8108
  var calculatingDigits, quantity, priceIncludeTax, lineAmountIncludeTax, _lineAmountIncludeTax, _priceIncludeTax, priceExcludeTax, lineAmountExcludeTax, _lineAmountExcludeTax, _priceExcludeTax;
8077
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
8078
- while (1) switch (_context2.prev = _context2.next) {
8109
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
8110
+ while (1) switch (_context3.prev = _context3.next) {
8079
8111
  case 0:
8080
8112
  err = err || {};
8081
8113
  if (!(!values.quantity && values.quantity !== 0)) {
8082
- _context2.next = 5;
8114
+ _context3.next = 7;
8083
8115
  break;
8084
8116
  }
8085
- _context2.next = 4;
8117
+ _context3.next = 4;
8086
8118
  return controller.setEditGood({
8087
8119
  quantity: undefined
8088
8120
  });
8089
8121
  case 4:
8090
- return _context2.abrupt("return");
8091
- case 5:
8122
+ _context3.next = 6;
8123
+ return clearCalculatingField(controller);
8124
+ case 6:
8125
+ return _context3.abrupt("return");
8126
+ case 7:
8092
8127
  if (!err.quantity) {
8093
- _context2.next = 7;
8128
+ _context3.next = 11;
8094
8129
  break;
8095
8130
  }
8096
- return _context2.abrupt("return");
8097
- case 7:
8131
+ _context3.next = 10;
8132
+ return clearCalculatingField(controller);
8133
+ case 10:
8134
+ return _context3.abrupt("return");
8135
+ case 11:
8098
8136
  calculatingDigits = controller.state.calculatingDigits;
8099
8137
  quantity = format15(values.quantity, calculatingDigits);
8100
- _context2.next = 11;
8138
+ _context3.next = 16;
8101
8139
  return controller.setEditGood({
8102
8140
  quantity: quantity
8103
8141
  });
8104
- case 11:
8142
+ case 16:
8105
8143
  form.setFieldsValue({
8106
8144
  quantity: quantity
8107
8145
  });
8108
8146
  // 是否含税
8109
8147
  if (!controller.state.goodsListState.isTaxIncluded) {
8110
- _context2.next = 30;
8148
+ _context3.next = 35;
8111
8149
  break;
8112
8150
  }
8113
8151
  if (!(!err.priceIncludeTax && values.priceIncludeTax)) {
8114
- _context2.next = 21;
8152
+ _context3.next = 26;
8115
8153
  break;
8116
8154
  }
8117
8155
  // 可以找到 单价(含税)
@@ -8120,16 +8158,16 @@ var onChangeQuantity = lazyFn(function (controller, form, record) {
8120
8158
  form.setFieldsValue({
8121
8159
  lineAmountIncludeTax: lineAmountIncludeTax
8122
8160
  });
8123
- _context2.next = 19;
8161
+ _context3.next = 24;
8124
8162
  return controller.setEditGood({
8125
8163
  lineAmountIncludeTax: lineAmountIncludeTax
8126
8164
  });
8127
- case 19:
8128
- _context2.next = 27;
8165
+ case 24:
8166
+ _context3.next = 32;
8129
8167
  break;
8130
- case 21:
8168
+ case 26:
8131
8169
  if (!(!err.lineAmountIncludeTax && values.lineAmountIncludeTax)) {
8132
- _context2.next = 27;
8170
+ _context3.next = 32;
8133
8171
  break;
8134
8172
  }
8135
8173
  // 可以找到 金额(含税)
@@ -8138,18 +8176,18 @@ var onChangeQuantity = lazyFn(function (controller, form, record) {
8138
8176
  form.setFieldsValue({
8139
8177
  priceIncludeTax: _priceIncludeTax
8140
8178
  });
8141
- _context2.next = 27;
8179
+ _context3.next = 32;
8142
8180
  return controller.setEditGood({
8143
8181
  priceIncludeTax: _priceIncludeTax
8144
8182
  });
8145
- case 27:
8183
+ case 32:
8146
8184
  // 更新不含税
8147
8185
  updateUnitPriceExcludingTax(controller, form);
8148
- _context2.next = 45;
8186
+ _context3.next = 50;
8149
8187
  break;
8150
- case 30:
8188
+ case 35:
8151
8189
  if (!(!err.priceExcludeTax && values.priceExcludeTax)) {
8152
- _context2.next = 38;
8190
+ _context3.next = 43;
8153
8191
  break;
8154
8192
  }
8155
8193
  priceExcludeTax = format15(values.priceExcludeTax, calculatingDigits);
@@ -8157,17 +8195,17 @@ var onChangeQuantity = lazyFn(function (controller, form, record) {
8157
8195
  form.setFieldsValue({
8158
8196
  lineAmountExcludeTax: lineAmountExcludeTax
8159
8197
  });
8160
- _context2.next = 36;
8198
+ _context3.next = 41;
8161
8199
  return controller.setEditGood({
8162
8200
  lineAmountExcludeTax: lineAmountExcludeTax,
8163
8201
  quantity: quantity
8164
8202
  });
8165
- case 36:
8166
- _context2.next = 44;
8203
+ case 41:
8204
+ _context3.next = 49;
8167
8205
  break;
8168
- case 38:
8206
+ case 43:
8169
8207
  if (!(!err.lineAmountExcludeTax && values.lineAmountExcludeTax)) {
8170
- _context2.next = 44;
8208
+ _context3.next = 49;
8171
8209
  break;
8172
8210
  }
8173
8211
  _lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
@@ -8175,54 +8213,39 @@ var onChangeQuantity = lazyFn(function (controller, form, record) {
8175
8213
  form.setFieldsValue({
8176
8214
  priceExcludeTax: _priceExcludeTax
8177
8215
  });
8178
- _context2.next = 44;
8216
+ _context3.next = 49;
8179
8217
  return controller.setEditGood({
8180
8218
  priceExcludeTax: _priceExcludeTax,
8181
8219
  quantity: quantity
8182
8220
  });
8183
- case 44:
8221
+ case 49:
8184
8222
  // 更新含税
8185
8223
  updateUnitPriceTax(controller, form);
8186
- case 45:
8187
- // 清楚 计算中启动字段
8188
- controller.run( /*#__PURE__*/function () {
8189
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
8190
- return _regeneratorRuntime().wrap(function _callee$(_context) {
8191
- while (1) switch (_context.prev = _context.next) {
8192
- case 0:
8193
- return _context.abrupt("return", s.calculating = '');
8194
- case 1:
8195
- case "end":
8196
- return _context.stop();
8197
- }
8198
- }, _callee);
8199
- }));
8200
- return function (_x3) {
8201
- return _ref2.apply(this, arguments);
8202
- };
8203
- }());
8204
- case 46:
8224
+ case 50:
8225
+ _context3.next = 52;
8226
+ return clearCalculatingField(controller);
8227
+ case 52:
8205
8228
  case "end":
8206
- return _context2.stop();
8229
+ return _context3.stop();
8207
8230
  }
8208
- }, _callee2);
8231
+ }, _callee3);
8209
8232
  }));
8210
- return function (_x, _x2) {
8211
- return _ref.apply(this, arguments);
8233
+ return function (_x3, _x4) {
8234
+ return _ref3.apply(this, arguments);
8212
8235
  };
8213
8236
  }());
8214
8237
  }, 1000);
8215
8238
  /** 单价(含税) */
8216
8239
  var onChangePriceIncludeTax = lazyFn(function (controller, form, record) {
8217
8240
  form.validateFields( /*#__PURE__*/function () {
8218
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(err, values) {
8241
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(err, values) {
8219
8242
  var calculatingDigits, priceIncludeTax, quantity, lineAmountIncludeTax, _lineAmountIncludeTax2, _quantity;
8220
8243
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
8221
8244
  while (1) switch (_context4.prev = _context4.next) {
8222
8245
  case 0:
8223
8246
  err = err || {};
8224
8247
  if (!(!values.priceIncludeTax && values.priceIncludeTax !== 0)) {
8225
- _context4.next = 5;
8248
+ _context4.next = 7;
8226
8249
  break;
8227
8250
  }
8228
8251
  _context4.next = 4;
@@ -8231,27 +8254,33 @@ var onChangePriceIncludeTax = lazyFn(function (controller, form, record) {
8231
8254
  priceExcludeTax: undefined
8232
8255
  });
8233
8256
  case 4:
8257
+ _context4.next = 6;
8258
+ return clearCalculatingField(controller);
8259
+ case 6:
8234
8260
  return _context4.abrupt("return");
8235
- case 5:
8261
+ case 7:
8236
8262
  if (!err.priceIncludeTax) {
8237
- _context4.next = 7;
8263
+ _context4.next = 11;
8238
8264
  break;
8239
8265
  }
8266
+ _context4.next = 10;
8267
+ return clearCalculatingField(controller);
8268
+ case 10:
8240
8269
  return _context4.abrupt("return");
8241
- case 7:
8270
+ case 11:
8242
8271
  calculatingDigits = controller.state.calculatingDigits;
8243
8272
  priceIncludeTax = format15(values.priceIncludeTax, calculatingDigits);
8244
- _context4.next = 11;
8273
+ _context4.next = 15;
8245
8274
  return controller.setEditGood({
8246
8275
  priceIncludeTax: priceIncludeTax
8247
8276
  });
8248
- case 11:
8277
+ case 15:
8249
8278
  form.setFieldsValue({
8250
8279
  priceIncludeTax: priceIncludeTax
8251
8280
  });
8252
8281
  // 是否有数量
8253
8282
  if (!(!err.quantity && values.quantity)) {
8254
- _context4.next = 20;
8283
+ _context4.next = 24;
8255
8284
  break;
8256
8285
  }
8257
8286
  quantity = format15(values.quantity, calculatingDigits);
@@ -8259,16 +8288,16 @@ var onChangePriceIncludeTax = lazyFn(function (controller, form, record) {
8259
8288
  form.setFieldsValue({
8260
8289
  lineAmountIncludeTax: lineAmountIncludeTax
8261
8290
  });
8262
- _context4.next = 18;
8291
+ _context4.next = 22;
8263
8292
  return controller.setEditGood({
8264
8293
  lineAmountIncludeTax: lineAmountIncludeTax
8265
8294
  });
8266
- case 18:
8267
- _context4.next = 26;
8295
+ case 22:
8296
+ _context4.next = 30;
8268
8297
  break;
8269
- case 20:
8298
+ case 24:
8270
8299
  if (!(!err.lineAmountIncludeTax && values.lineAmountIncludeTax)) {
8271
- _context4.next = 26;
8300
+ _context4.next = 30;
8272
8301
  break;
8273
8302
  }
8274
8303
  _lineAmountIncludeTax2 = format2(values.lineAmountIncludeTax);
@@ -8276,81 +8305,73 @@ var onChangePriceIncludeTax = lazyFn(function (controller, form, record) {
8276
8305
  form.setFieldsValue({
8277
8306
  quantity: _quantity
8278
8307
  });
8279
- _context4.next = 26;
8308
+ _context4.next = 30;
8280
8309
  return controller.setEditGood({
8281
8310
  quantity: _quantity
8282
8311
  });
8283
- case 26:
8312
+ case 30:
8284
8313
  // 更新不含税
8285
8314
  updateUnitPriceExcludingTax(controller, form);
8286
8315
  // 清楚 计算中启动字段
8287
- controller.run( /*#__PURE__*/function () {
8288
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
8289
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
8290
- while (1) switch (_context3.prev = _context3.next) {
8291
- case 0:
8292
- return _context3.abrupt("return", s.calculating = '');
8293
- case 1:
8294
- case "end":
8295
- return _context3.stop();
8296
- }
8297
- }, _callee3);
8298
- }));
8299
- return function (_x6) {
8300
- return _ref4.apply(this, arguments);
8301
- };
8302
- }());
8303
- case 28:
8316
+ _context4.next = 33;
8317
+ return clearCalculatingField(controller);
8318
+ case 33:
8304
8319
  case "end":
8305
8320
  return _context4.stop();
8306
8321
  }
8307
8322
  }, _callee4);
8308
8323
  }));
8309
- return function (_x4, _x5) {
8310
- return _ref3.apply(this, arguments);
8324
+ return function (_x5, _x6) {
8325
+ return _ref4.apply(this, arguments);
8311
8326
  };
8312
8327
  }());
8313
8328
  }, 1000);
8314
8329
  /** 单价(不含税) */
8315
8330
  var onChangePriceExcludeTax = lazyFn(function (controller, form, record) {
8316
8331
  form.validateFields( /*#__PURE__*/function () {
8317
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(err, values) {
8332
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(err, values) {
8318
8333
  var calculatingDigits, priceExcludeTax, quantity, lineAmountExcludeTax, _lineAmountExcludeTax2, _quantity2;
8319
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
8320
- while (1) switch (_context6.prev = _context6.next) {
8334
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
8335
+ while (1) switch (_context5.prev = _context5.next) {
8321
8336
  case 0:
8322
8337
  err = err || {};
8323
8338
  if (!(!values.priceExcludeTax && values.priceExcludeTax !== 0)) {
8324
- _context6.next = 5;
8339
+ _context5.next = 7;
8325
8340
  break;
8326
8341
  }
8327
- _context6.next = 4;
8342
+ _context5.next = 4;
8328
8343
  return controller.setEditGood({
8329
8344
  priceIncludeTax: undefined,
8330
8345
  priceExcludeTax: undefined
8331
8346
  });
8332
8347
  case 4:
8333
- return _context6.abrupt("return");
8334
- case 5:
8348
+ _context5.next = 6;
8349
+ return clearCalculatingField(controller);
8350
+ case 6:
8351
+ return _context5.abrupt("return");
8352
+ case 7:
8335
8353
  if (!err.priceExcludeTax) {
8336
- _context6.next = 7;
8354
+ _context5.next = 11;
8337
8355
  break;
8338
8356
  }
8339
- return _context6.abrupt("return");
8340
- case 7:
8357
+ _context5.next = 10;
8358
+ return clearCalculatingField(controller);
8359
+ case 10:
8360
+ return _context5.abrupt("return");
8361
+ case 11:
8341
8362
  calculatingDigits = controller.state.calculatingDigits;
8342
8363
  priceExcludeTax = format15(values.priceExcludeTax, calculatingDigits);
8343
- _context6.next = 11;
8364
+ _context5.next = 15;
8344
8365
  return controller.setEditGood({
8345
8366
  priceExcludeTax: priceExcludeTax
8346
8367
  });
8347
- case 11:
8368
+ case 15:
8348
8369
  form.setFieldsValue({
8349
8370
  priceExcludeTax: priceExcludeTax
8350
8371
  });
8351
8372
  // 是否有数量
8352
8373
  if (!(!err.quantity && values.quantity)) {
8353
- _context6.next = 20;
8374
+ _context5.next = 24;
8354
8375
  break;
8355
8376
  }
8356
8377
  quantity = format15(values.quantity, calculatingDigits);
@@ -8358,16 +8379,16 @@ var onChangePriceExcludeTax = lazyFn(function (controller, form, record) {
8358
8379
  form.setFieldsValue({
8359
8380
  lineAmountExcludeTax: lineAmountExcludeTax
8360
8381
  });
8361
- _context6.next = 18;
8382
+ _context5.next = 22;
8362
8383
  return controller.setEditGood({
8363
8384
  lineAmountExcludeTax: lineAmountExcludeTax
8364
8385
  });
8365
- case 18:
8366
- _context6.next = 26;
8386
+ case 22:
8387
+ _context5.next = 30;
8367
8388
  break;
8368
- case 20:
8389
+ case 24:
8369
8390
  if (!(!err.lineAmountExcludeTax && values.lineAmountExcludeTax)) {
8370
- _context6.next = 26;
8391
+ _context5.next = 30;
8371
8392
  break;
8372
8393
  }
8373
8394
  _lineAmountExcludeTax2 = format2(values.lineAmountExcludeTax);
@@ -8375,35 +8396,21 @@ var onChangePriceExcludeTax = lazyFn(function (controller, form, record) {
8375
8396
  form.setFieldsValue({
8376
8397
  quantity: _quantity2
8377
8398
  });
8378
- _context6.next = 26;
8399
+ _context5.next = 30;
8379
8400
  return controller.setEditGood({
8380
8401
  quantity: _quantity2
8381
8402
  });
8382
- case 26:
8403
+ case 30:
8383
8404
  // 更新含税
8384
8405
  updateUnitPriceTax(controller, form);
8385
8406
  // 清楚 计算中启动字段
8386
- controller.run( /*#__PURE__*/function () {
8387
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(s) {
8388
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
8389
- while (1) switch (_context5.prev = _context5.next) {
8390
- case 0:
8391
- return _context5.abrupt("return", s.calculating = '');
8392
- case 1:
8393
- case "end":
8394
- return _context5.stop();
8395
- }
8396
- }, _callee5);
8397
- }));
8398
- return function (_x9) {
8399
- return _ref6.apply(this, arguments);
8400
- };
8401
- }());
8402
- case 28:
8407
+ _context5.next = 33;
8408
+ return clearCalculatingField(controller);
8409
+ case 33:
8403
8410
  case "end":
8404
- return _context6.stop();
8411
+ return _context5.stop();
8405
8412
  }
8406
- }, _callee6);
8413
+ }, _callee5);
8407
8414
  }));
8408
8415
  return function (_x7, _x8) {
8409
8416
  return _ref5.apply(this, arguments);
@@ -8413,38 +8420,41 @@ var onChangePriceExcludeTax = lazyFn(function (controller, form, record) {
8413
8420
  /** 金额(含税) */
8414
8421
  var onChangeLineAmountIncludeTax = lazyFn(function (controller, form, record) {
8415
8422
  form.validateFields( /*#__PURE__*/function () {
8416
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(err, values) {
8423
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(err, values) {
8417
8424
  var calculatingDigits, lineAmountIncludeTax, quantity, priceIncludeTax, _priceIncludeTax2, _quantity3;
8418
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
8419
- while (1) switch (_context8.prev = _context8.next) {
8425
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
8426
+ while (1) switch (_context6.prev = _context6.next) {
8420
8427
  case 0:
8421
8428
  err = err || {};
8422
8429
  if (!(promptErr(err.lineAmountIncludeTax) || !values.lineAmountIncludeTax)) {
8423
- _context8.next = 6;
8430
+ _context6.next = 8;
8424
8431
  break;
8425
8432
  }
8426
- _context8.next = 4;
8433
+ _context6.next = 4;
8427
8434
  return controller.setEditGood({
8428
8435
  lineAmountIncludeTax: undefined,
8429
8436
  lineAmountExcludeTax: undefined
8430
8437
  });
8431
8438
  case 4:
8432
8439
  updateUnitPriceExcludingTax(controller, form);
8433
- return _context8.abrupt("return");
8434
- case 6:
8440
+ _context6.next = 7;
8441
+ return clearCalculatingField(controller);
8442
+ case 7:
8443
+ return _context6.abrupt("return");
8444
+ case 8:
8435
8445
  calculatingDigits = controller.state.calculatingDigits;
8436
8446
  lineAmountIncludeTax = format2(values.lineAmountIncludeTax);
8437
- _context8.next = 10;
8447
+ _context6.next = 12;
8438
8448
  return controller.setEditGood({
8439
8449
  lineAmountIncludeTax: lineAmountIncludeTax
8440
8450
  });
8441
- case 10:
8451
+ case 12:
8442
8452
  form.setFieldsValue({
8443
8453
  lineAmountIncludeTax: lineAmountIncludeTax
8444
8454
  });
8445
8455
  // 是否有数量
8446
8456
  if (!(!err.quantity && values.quantity)) {
8447
- _context8.next = 19;
8457
+ _context6.next = 21;
8448
8458
  break;
8449
8459
  }
8450
8460
  quantity = format15(values.quantity, calculatingDigits);
@@ -8452,16 +8462,16 @@ var onChangeLineAmountIncludeTax = lazyFn(function (controller, form, record) {
8452
8462
  form.setFieldsValue({
8453
8463
  priceIncludeTax: priceIncludeTax
8454
8464
  });
8455
- _context8.next = 17;
8465
+ _context6.next = 19;
8456
8466
  return controller.setEditGood({
8457
8467
  priceIncludeTax: priceIncludeTax
8458
8468
  });
8459
- case 17:
8460
- _context8.next = 25;
8461
- break;
8462
8469
  case 19:
8470
+ _context6.next = 27;
8471
+ break;
8472
+ case 21:
8463
8473
  if (!(!err.priceIncludeTax && (values.priceIncludeTax || values.priceIncludeTax === 0))) {
8464
- _context8.next = 25;
8474
+ _context6.next = 27;
8465
8475
  break;
8466
8476
  }
8467
8477
  _priceIncludeTax2 = format15(values.priceIncludeTax, calculatingDigits);
@@ -8469,76 +8479,65 @@ var onChangeLineAmountIncludeTax = lazyFn(function (controller, form, record) {
8469
8479
  form.setFieldsValue({
8470
8480
  quantity: _quantity3
8471
8481
  });
8472
- _context8.next = 25;
8482
+ _context6.next = 27;
8473
8483
  return controller.setEditGood({
8474
8484
  quantity: _quantity3
8475
8485
  });
8476
- case 25:
8486
+ case 27:
8477
8487
  // 更新不含税
8478
8488
  updateUnitPriceExcludingTax(controller, form);
8479
8489
  // 清楚 计算中启动字段
8480
- controller.run( /*#__PURE__*/function () {
8481
- var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(s) {
8482
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
8483
- while (1) switch (_context7.prev = _context7.next) {
8484
- case 0:
8485
- return _context7.abrupt("return", s.calculating = '');
8486
- case 1:
8487
- case "end":
8488
- return _context7.stop();
8489
- }
8490
- }, _callee7);
8491
- }));
8492
- return function (_x12) {
8493
- return _ref8.apply(this, arguments);
8494
- };
8495
- }());
8496
- case 27:
8490
+ _context6.next = 30;
8491
+ return clearCalculatingField(controller);
8492
+ case 30:
8497
8493
  case "end":
8498
- return _context8.stop();
8494
+ return _context6.stop();
8499
8495
  }
8500
- }, _callee8);
8496
+ }, _callee6);
8501
8497
  }));
8502
- return function (_x10, _x11) {
8503
- return _ref7.apply(this, arguments);
8498
+ return function (_x9, _x10) {
8499
+ return _ref6.apply(this, arguments);
8504
8500
  };
8505
8501
  }());
8506
8502
  }, 1000);
8507
8503
  /** 金额(不含税) */
8508
8504
  var onChangeLineAmountExcludeTax = lazyFn(function (controller, form, record) {
8509
8505
  form.validateFields( /*#__PURE__*/function () {
8510
- var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(err, values) {
8506
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(err, values) {
8511
8507
  var calculatingDigits, lineAmountExcludeTax, quantity, priceExcludeTax, _priceExcludeTax2, _quantity4;
8512
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
8513
- while (1) switch (_context10.prev = _context10.next) {
8508
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
8509
+ while (1) switch (_context7.prev = _context7.next) {
8514
8510
  case 0:
8515
8511
  err = err || {};
8516
8512
  if (!(promptErr(err.lineAmountExcludeTax) || !values.lineAmountExcludeTax)) {
8517
- _context10.next = 6;
8513
+ _context7.next = 8;
8518
8514
  break;
8519
8515
  }
8520
- _context10.next = 4;
8516
+ _context7.next = 4;
8521
8517
  return controller.setEditGood({
8522
8518
  lineAmountIncludeTax: undefined,
8523
8519
  lineAmountExcludeTax: undefined
8524
8520
  });
8525
8521
  case 4:
8526
8522
  updateUnitPriceTax(controller, form);
8527
- return _context10.abrupt("return");
8528
- case 6:
8523
+ _context7.next = 7;
8524
+ return clearCalculatingField(controller);
8525
+ case 7:
8526
+ return _context7.abrupt("return");
8527
+ case 8:
8529
8528
  calculatingDigits = controller.state.calculatingDigits;
8530
8529
  lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
8531
- _context10.next = 10;
8530
+ _context7.next = 12;
8532
8531
  return controller.setEditGood({
8533
8532
  lineAmountExcludeTax: lineAmountExcludeTax
8534
8533
  });
8535
- case 10:
8534
+ case 12:
8536
8535
  form.setFieldsValue({
8537
8536
  lineAmountExcludeTax: lineAmountExcludeTax
8538
8537
  });
8539
8538
  // 是否有数量
8540
8539
  if (!(!err.quantity && values.quantity)) {
8541
- _context10.next = 19;
8540
+ _context7.next = 21;
8542
8541
  break;
8543
8542
  }
8544
8543
  quantity = format15(values.quantity, calculatingDigits);
@@ -8546,16 +8545,16 @@ var onChangeLineAmountExcludeTax = lazyFn(function (controller, form, record) {
8546
8545
  form.setFieldsValue({
8547
8546
  priceExcludeTax: priceExcludeTax
8548
8547
  });
8549
- _context10.next = 17;
8548
+ _context7.next = 19;
8550
8549
  return controller.setEditGood({
8551
8550
  priceExcludeTax: priceExcludeTax
8552
8551
  });
8553
- case 17:
8554
- _context10.next = 25;
8555
- break;
8556
8552
  case 19:
8553
+ _context7.next = 27;
8554
+ break;
8555
+ case 21:
8557
8556
  if (!(!err.priceExcludeTax && values.priceExcludeTax)) {
8558
- _context10.next = 25;
8557
+ _context7.next = 27;
8559
8558
  break;
8560
8559
  }
8561
8560
  _priceExcludeTax2 = format15(values.priceExcludeTax, calculatingDigits);
@@ -8563,58 +8562,44 @@ var onChangeLineAmountExcludeTax = lazyFn(function (controller, form, record) {
8563
8562
  form.setFieldsValue({
8564
8563
  quantity: _quantity4
8565
8564
  });
8566
- _context10.next = 25;
8565
+ _context7.next = 27;
8567
8566
  return controller.setEditGood({
8568
8567
  quantity: _quantity4
8569
8568
  });
8570
- case 25:
8569
+ case 27:
8571
8570
  // 更新含税
8572
8571
  updateUnitPriceTax(controller, form);
8573
8572
  // 清楚 计算中启动字段
8574
- controller.run( /*#__PURE__*/function () {
8575
- var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(s) {
8576
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
8577
- while (1) switch (_context9.prev = _context9.next) {
8578
- case 0:
8579
- return _context9.abrupt("return", s.calculating = '');
8580
- case 1:
8581
- case "end":
8582
- return _context9.stop();
8583
- }
8584
- }, _callee9);
8585
- }));
8586
- return function (_x15) {
8587
- return _ref10.apply(this, arguments);
8588
- };
8589
- }());
8590
- case 27:
8573
+ _context7.next = 30;
8574
+ return clearCalculatingField(controller);
8575
+ case 30:
8591
8576
  case "end":
8592
- return _context10.stop();
8577
+ return _context7.stop();
8593
8578
  }
8594
- }, _callee10);
8579
+ }, _callee7);
8595
8580
  }));
8596
- return function (_x13, _x14) {
8597
- return _ref9.apply(this, arguments);
8581
+ return function (_x11, _x12) {
8582
+ return _ref7.apply(this, arguments);
8598
8583
  };
8599
8584
  }());
8600
8585
  }, 1000);
8601
8586
  /** 税率 */
8602
8587
  var onChangeTaxRate = lazyFn(function (controller, form, record) {
8603
8588
  form.validateFields( /*#__PURE__*/function () {
8604
- var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(err, values) {
8589
+ var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(err, values) {
8605
8590
  var taxRate;
8606
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
8607
- while (1) switch (_context12.prev = _context12.next) {
8591
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
8592
+ while (1) switch (_context8.prev = _context8.next) {
8608
8593
  case 0:
8609
8594
  err = err || {};
8610
8595
  if (!(promptErr(err.taxRate) || !values.taxRate && values.taxRate !== 0)) {
8611
- _context12.next = 3;
8596
+ _context8.next = 3;
8612
8597
  break;
8613
8598
  }
8614
- return _context12.abrupt("return");
8599
+ return _context8.abrupt("return");
8615
8600
  case 3:
8616
8601
  taxRate = parseFloat(values.taxRate);
8617
- _context12.next = 6;
8602
+ _context8.next = 6;
8618
8603
  return controller.setEditGood({
8619
8604
  taxRate: taxRate
8620
8605
  });
@@ -8637,30 +8622,16 @@ var onChangeTaxRate = lazyFn(function (controller, form, record) {
8637
8622
  updateUnitPriceTax(controller, form);
8638
8623
  }
8639
8624
  // 清楚 计算中启动字段
8640
- controller.run( /*#__PURE__*/function () {
8641
- var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(s) {
8642
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
8643
- while (1) switch (_context11.prev = _context11.next) {
8644
- case 0:
8645
- return _context11.abrupt("return", s.calculating = '');
8646
- case 1:
8647
- case "end":
8648
- return _context11.stop();
8649
- }
8650
- }, _callee11);
8651
- }));
8652
- return function (_x18) {
8653
- return _ref12.apply(this, arguments);
8654
- };
8655
- }());
8656
- case 9:
8625
+ _context8.next = 10;
8626
+ return clearCalculatingField(controller);
8627
+ case 10:
8657
8628
  case "end":
8658
- return _context12.stop();
8629
+ return _context8.stop();
8659
8630
  }
8660
- }, _callee12);
8631
+ }, _callee8);
8661
8632
  }));
8662
- return function (_x16, _x17) {
8663
- return _ref11.apply(this, arguments);
8633
+ return function (_x13, _x14) {
8634
+ return _ref8.apply(this, arguments);
8664
8635
  };
8665
8636
  }());
8666
8637
  }, 1000);
@@ -8696,10 +8667,10 @@ function dutyFree(controller, taxRate, form, record) {
8696
8667
  /** 含税 => 更新(不含税) */
8697
8668
  var updateUnitPriceExcludingTax = function updateUnitPriceExcludingTax(controller, form, record) {
8698
8669
  form.validateFields( /*#__PURE__*/function () {
8699
- var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(err, values) {
8670
+ var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(err, values) {
8700
8671
  var taxAmount, lineAmountExcludeTax, priceExcludeTax, deduction;
8701
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
8702
- while (1) switch (_context13.prev = _context13.next) {
8672
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
8673
+ while (1) switch (_context9.prev = _context9.next) {
8703
8674
  case 0:
8704
8675
  err = err || {};
8705
8676
  /** 税额 */
@@ -8708,7 +8679,7 @@ var updateUnitPriceExcludingTax = function updateUnitPriceExcludingTax(controlle
8708
8679
  if (!promptErr(err.lineAmountIncludeTax) && !promptErr(err.taxRate)) {
8709
8680
  taxAmount = countTaxAmount(values.lineAmountIncludeTax, deduction, values.taxRate);
8710
8681
  }
8711
- _context13.next = 5;
8682
+ _context9.next = 5;
8712
8683
  return controller.setEditGood({
8713
8684
  taxAmount: taxAmount
8714
8685
  });
@@ -8720,7 +8691,7 @@ var updateUnitPriceExcludingTax = function updateUnitPriceExcludingTax(controlle
8720
8691
  form.setFieldsValue({
8721
8692
  lineAmountExcludeTax: lineAmountExcludeTax
8722
8693
  });
8723
- _context13.next = 9;
8694
+ _context9.next = 9;
8724
8695
  return controller.setEditGood({
8725
8696
  lineAmountExcludeTax: lineAmountExcludeTax
8726
8697
  });
@@ -8732,48 +8703,48 @@ var updateUnitPriceExcludingTax = function updateUnitPriceExcludingTax(controlle
8732
8703
  form.setFieldsValue({
8733
8704
  priceExcludeTax: priceExcludeTax
8734
8705
  });
8735
- _context13.next = 13;
8706
+ _context9.next = 13;
8736
8707
  return controller.setEditGood({
8737
8708
  priceExcludeTax: priceExcludeTax
8738
8709
  });
8739
8710
  case 13:
8740
8711
  case "end":
8741
- return _context13.stop();
8712
+ return _context9.stop();
8742
8713
  }
8743
- }, _callee13);
8714
+ }, _callee9);
8744
8715
  }));
8745
- return function (_x19, _x20) {
8746
- return _ref13.apply(this, arguments);
8716
+ return function (_x15, _x16) {
8717
+ return _ref9.apply(this, arguments);
8747
8718
  };
8748
8719
  }());
8749
8720
  };
8750
8721
  /** 不含税 => 更新(含税) */
8751
8722
  var updateUnitPriceTax = function updateUnitPriceTax(controller, form, record) {
8752
8723
  form.validateFields( /*#__PURE__*/function () {
8753
- var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(err, values) {
8724
+ var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(err, values) {
8754
8725
  var calculatingDigits, lineAmountExcludeTax, lineAmountIncludeTax, priceIncludeTax, taxAmount;
8755
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
8756
- while (1) switch (_context14.prev = _context14.next) {
8726
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
8727
+ while (1) switch (_context10.prev = _context10.next) {
8757
8728
  case 0:
8758
8729
  err = err || {};
8759
8730
  if (!(!err.taxRat && (values.taxRate || values.taxRate === 0) && !promptErr(err.lineAmountExcludeTax) && (values.lineAmountExcludeTax || values.lineAmountExcludeTax === 0))) {
8760
- _context14.next = 17;
8731
+ _context10.next = 17;
8761
8732
  break;
8762
8733
  }
8763
8734
  calculatingDigits = controller.state.calculatingDigits; // 金额(含税)= 金额(不含税)* (1+ 税率)
8764
8735
  lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
8765
8736
  lineAmountIncludeTax = format2(evaluate("".concat(lineAmountExcludeTax, " * (1+(").concat(values.taxRate, "/100))")));
8766
- _context14.next = 7;
8737
+ _context10.next = 7;
8767
8738
  return controller.setEditGood({
8768
8739
  lineAmountIncludeTax: lineAmountIncludeTax
8769
8740
  });
8770
8741
  case 7:
8771
8742
  if (!(!err.quantity && values.quantity)) {
8772
- _context14.next = 11;
8743
+ _context10.next = 11;
8773
8744
  break;
8774
8745
  }
8775
8746
  priceIncludeTax = format15(evaluate("".concat(lineAmountIncludeTax, " / ").concat(values.quantity)), calculatingDigits);
8776
- _context14.next = 11;
8747
+ _context10.next = 11;
8777
8748
  return controller.setEditGood({
8778
8749
  priceIncludeTax: priceIncludeTax
8779
8750
  });
@@ -8783,176 +8754,176 @@ var updateUnitPriceTax = function updateUnitPriceTax(controller, form, record) {
8783
8754
  form.setFieldsValue({
8784
8755
  taxAmount: taxAmount
8785
8756
  });
8786
- _context14.next = 15;
8757
+ _context10.next = 15;
8787
8758
  return controller.setEditGood({
8788
8759
  taxAmount: taxAmount
8789
8760
  });
8790
8761
  case 15:
8791
- _context14.next = 20;
8762
+ _context10.next = 20;
8792
8763
  break;
8793
8764
  case 17:
8794
8765
  form.setFieldsValue({
8795
8766
  taxAmount: undefined
8796
8767
  });
8797
- _context14.next = 20;
8768
+ _context10.next = 20;
8798
8769
  return controller.setEditGood({
8799
8770
  taxAmount: undefined
8800
8771
  });
8801
8772
  case 20:
8802
8773
  case "end":
8803
- return _context14.stop();
8774
+ return _context10.stop();
8804
8775
  }
8805
- }, _callee14);
8776
+ }, _callee10);
8806
8777
  }));
8807
- return function (_x21, _x22) {
8808
- return _ref14.apply(this, arguments);
8778
+ return function (_x17, _x18) {
8779
+ return _ref10.apply(this, arguments);
8809
8780
  };
8810
8781
  }());
8811
8782
  };
8812
8783
  /** 单调赋码 */
8813
8784
  var endowCode = /*#__PURE__*/function () {
8814
- var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(controller, goods) {
8815
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
8816
- while (1) switch (_context17.prev = _context17.next) {
8785
+ var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(controller, goods) {
8786
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
8787
+ while (1) switch (_context13.prev = _context13.next) {
8817
8788
  case 0:
8818
- _context17.next = 2;
8789
+ _context13.next = 2;
8819
8790
  return controller.wait();
8820
8791
  case 2:
8821
- _context17.next = 4;
8792
+ _context13.next = 4;
8822
8793
  return controller.saveEditGood();
8823
8794
  case 4:
8824
- _context17.next = 6;
8795
+ _context13.next = 6;
8825
8796
  return controller.pipeline( /*#__PURE__*/function () {
8826
- var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(s) {
8797
+ var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(s) {
8827
8798
  var _s$goodsListState$edi;
8828
8799
  var err, key, g, i;
8829
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
8830
- while (1) switch (_context16.prev = _context16.next) {
8800
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
8801
+ while (1) switch (_context12.prev = _context12.next) {
8831
8802
  case 0:
8832
8803
  if (!(s.goodsListState.form && ((_s$goodsListState$edi = s.goodsListState.editGood) === null || _s$goodsListState$edi === void 0 ? void 0 : _s$goodsListState$edi.$index) === (goods === null || goods === void 0 ? void 0 : goods.$index))) {
8833
- _context16.next = 11;
8804
+ _context12.next = 11;
8834
8805
  break;
8835
8806
  }
8836
8807
  err = s.goodsListState.form.getFieldsError();
8837
- _context16.t0 = _regeneratorRuntime().keys(err);
8808
+ _context12.t0 = _regeneratorRuntime().keys(err);
8838
8809
  case 3:
8839
- if ((_context16.t1 = _context16.t0()).done) {
8840
- _context16.next = 11;
8810
+ if ((_context12.t1 = _context12.t0()).done) {
8811
+ _context12.next = 11;
8841
8812
  break;
8842
8813
  }
8843
- key = _context16.t1.value;
8814
+ key = _context12.t1.value;
8844
8815
  if (err[key]) {
8845
- _context16.next = 7;
8816
+ _context12.next = 7;
8846
8817
  break;
8847
8818
  }
8848
- return _context16.abrupt("continue", 3);
8819
+ return _context12.abrupt("continue", 3);
8849
8820
  case 7:
8850
8821
  message.error(err[key][0]);
8851
- return _context16.abrupt("return");
8822
+ return _context12.abrupt("return");
8852
8823
  case 11:
8853
8824
  g = s.goodsListState.goodsMap.get(goods.$index);
8854
8825
  i = s.goodsListState.goodsList.indexOf(g);
8855
- _context16.t2 = goods.lineAttribute;
8856
- _context16.next = _context16.t2 === LineAttributeType$1.正常 ? 16 : _context16.t2 === LineAttributeType$1.折扣行 ? 18 : _context16.t2 === LineAttributeType$1.被折扣行 ? 20 : 22;
8826
+ _context12.t2 = goods.lineAttribute;
8827
+ _context12.next = _context12.t2 === LineAttributeType$1.正常 ? 16 : _context12.t2 === LineAttributeType$1.折扣行 ? 18 : _context12.t2 === LineAttributeType$1.被折扣行 ? 20 : 22;
8857
8828
  break;
8858
8829
  case 16:
8859
8830
  s.goodsListState.endowCode.endowcodeGoodIndex = [goods.$index];
8860
- return _context16.abrupt("break", 22);
8831
+ return _context12.abrupt("break", 22);
8861
8832
  case 18:
8862
8833
  s.goodsListState.endowCode.endowcodeGoodIndex = [goods.$index, s.goodsListState.goodsList[i - 1].$index];
8863
- return _context16.abrupt("break", 22);
8834
+ return _context12.abrupt("break", 22);
8864
8835
  case 20:
8865
8836
  s.goodsListState.endowCode.endowcodeGoodIndex = [goods.$index, s.goodsListState.goodsList[i + 1].$index];
8866
- return _context16.abrupt("break", 22);
8837
+ return _context12.abrupt("break", 22);
8867
8838
  case 22:
8868
8839
  case "end":
8869
- return _context16.stop();
8840
+ return _context12.stop();
8870
8841
  }
8871
- }, _callee16);
8842
+ }, _callee12);
8872
8843
  }));
8873
- return function (_x27) {
8874
- return _ref17.apply(this, arguments);
8844
+ return function (_x23) {
8845
+ return _ref13.apply(this, arguments);
8875
8846
  };
8876
8847
  }())();
8877
8848
  case 6:
8878
8849
  case "end":
8879
- return _context17.stop();
8850
+ return _context13.stop();
8880
8851
  }
8881
- }, _callee17);
8852
+ }, _callee13);
8882
8853
  }));
8883
- return function endowCode(_x25, _x26) {
8884
- return _ref16.apply(this, arguments);
8854
+ return function endowCode(_x21, _x22) {
8855
+ return _ref12.apply(this, arguments);
8885
8856
  };
8886
8857
  }();
8887
8858
  /** 修改了 项目名称 */
8888
8859
  var onChangeItemName = /*#__PURE__*/function () {
8889
- var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(controller, form, record) {
8890
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
8891
- while (1) switch (_context19.prev = _context19.next) {
8860
+ var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(controller, form, record) {
8861
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
8862
+ while (1) switch (_context15.prev = _context15.next) {
8892
8863
  case 0:
8893
8864
  controller.run( /*#__PURE__*/function () {
8894
- var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(s) {
8865
+ var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
8895
8866
  var _getSN$shorthand, _getSN;
8896
8867
  var value, shorthand;
8897
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
8898
- while (1) switch (_context18.prev = _context18.next) {
8868
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
8869
+ while (1) switch (_context14.prev = _context14.next) {
8899
8870
  case 0:
8900
8871
  value = form.getFieldsValue().itemName;
8901
8872
  shorthand = (_getSN$shorthand = (_getSN = getSN(value)) === null || _getSN === void 0 ? void 0 : _getSN.shorthand) !== null && _getSN$shorthand !== void 0 ? _getSN$shorthand : '';
8902
8873
  if (!s.goodsListState.isMyShow) {
8903
- _context18.next = 11;
8874
+ _context14.next = 11;
8904
8875
  break;
8905
8876
  }
8906
- _context18.next = 5;
8877
+ _context14.next = 5;
8907
8878
  return controller.setEditGood({
8908
8879
  itemNameSelf: value
8909
8880
  });
8910
8881
  case 5:
8911
- _context18.t0 = record.itemName;
8912
- if (!_context18.t0) {
8913
- _context18.next = 9;
8882
+ _context14.t0 = record.itemName;
8883
+ if (!_context14.t0) {
8884
+ _context14.next = 9;
8914
8885
  break;
8915
8886
  }
8916
- _context18.next = 9;
8887
+ _context14.next = 9;
8917
8888
  return controller.setEditGood({
8918
8889
  itemName: setShorthand(record.itemName, shorthand)
8919
8890
  });
8920
8891
  case 9:
8921
- _context18.next = 17;
8892
+ _context14.next = 17;
8922
8893
  break;
8923
8894
  case 11:
8924
- _context18.next = 13;
8895
+ _context14.next = 13;
8925
8896
  return controller.setEditGood({
8926
8897
  itemName: value
8927
8898
  });
8928
8899
  case 13:
8929
- _context18.t1 = record.itemNameSelf;
8930
- if (!_context18.t1) {
8931
- _context18.next = 17;
8900
+ _context14.t1 = record.itemNameSelf;
8901
+ if (!_context14.t1) {
8902
+ _context14.next = 17;
8932
8903
  break;
8933
8904
  }
8934
- _context18.next = 17;
8905
+ _context14.next = 17;
8935
8906
  return controller.setEditGood({
8936
8907
  itemNameSelf: setShorthand(record.itemNameSelf, shorthand)
8937
8908
  });
8938
8909
  case 17:
8939
8910
  case "end":
8940
- return _context18.stop();
8911
+ return _context14.stop();
8941
8912
  }
8942
- }, _callee18);
8913
+ }, _callee14);
8943
8914
  }));
8944
- return function (_x31) {
8945
- return _ref19.apply(this, arguments);
8915
+ return function (_x27) {
8916
+ return _ref15.apply(this, arguments);
8946
8917
  };
8947
8918
  }());
8948
8919
  case 1:
8949
8920
  case "end":
8950
- return _context19.stop();
8921
+ return _context15.stop();
8951
8922
  }
8952
- }, _callee19);
8923
+ }, _callee15);
8953
8924
  }));
8954
- return function onChangeItemName(_x28, _x29, _x30) {
8955
- return _ref18.apply(this, arguments);
8925
+ return function onChangeItemName(_x24, _x25, _x26) {
8926
+ return _ref14.apply(this, arguments);
8956
8927
  };
8957
8928
  }();
8958
8929
 
@@ -9191,6 +9162,13 @@ var useColumns = (function (form) {
9191
9162
  };
9192
9163
  }());
9193
9164
  }, []);
9165
+ var onNumberValueChange = React.useCallback(function (e) {
9166
+ var _e$target;
9167
+ var value = e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value;
9168
+ if (value) {
9169
+ return value.replace(/[^0-9-\.]/g, '');
9170
+ }
9171
+ }, []);
9194
9172
  /** 获取补充校验规则 */
9195
9173
  var getReplenishRules = React.useCallback(function (id) {
9196
9174
  return columnsReplenish[id] ? columnsReplenish[id].rules || [] : [];
@@ -9402,6 +9380,7 @@ var useColumns = (function (form) {
9402
9380
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
9403
9381
  return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('quantity', {
9404
9382
  initialValue: editGood.quantity,
9383
+ getValueFromEvent: onNumberValueChange,
9405
9384
  rules: [].concat(_toConsumableArray(getReplenishRules('quantity')), [{
9406
9385
  pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
9407
9386
  message: '数量必须为数字'
@@ -9482,6 +9461,7 @@ var useColumns = (function (form) {
9482
9461
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
9483
9462
  return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('priceIncludeTax', {
9484
9463
  initialValue: editGood.priceIncludeTax,
9464
+ getValueFromEvent: onNumberValueChange,
9485
9465
  rules: [].concat(_toConsumableArray(getReplenishRules('priceIncludeTax')), [{
9486
9466
  pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
9487
9467
  message: '单价必须为数字'
@@ -9547,6 +9527,7 @@ var useColumns = (function (form) {
9547
9527
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
9548
9528
  return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('priceExcludeTax', {
9549
9529
  initialValue: editGood.priceExcludeTax,
9530
+ getValueFromEvent: onNumberValueChange,
9550
9531
  rules: [].concat(_toConsumableArray(getReplenishRules('priceExcludeTax')), [{
9551
9532
  pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
9552
9533
  message: '单价必须为数字'
@@ -9612,6 +9593,7 @@ var useColumns = (function (form) {
9612
9593
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
9613
9594
  return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('lineAmountIncludeTax', {
9614
9595
  initialValue: editGood.lineAmountIncludeTax,
9596
+ getValueFromEvent: onNumberValueChange,
9615
9597
  rules: [].concat(_toConsumableArray(getReplenishRules('lineAmountIncludeTax')), [{
9616
9598
  required: true,
9617
9599
  message: '金额不能为空'
@@ -9689,6 +9671,7 @@ var useColumns = (function (form) {
9689
9671
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
9690
9672
  return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('lineAmountExcludeTax', {
9691
9673
  initialValue: editGood.lineAmountExcludeTax,
9674
+ getValueFromEvent: onNumberValueChange,
9692
9675
  rules: [].concat(_toConsumableArray(getReplenishRules('lineAmountExcludeTax')), [{
9693
9676
  required: true,
9694
9677
  message: '金额不能为空'