kts-component-invoice-operate 3.1.13 → 3.1.15

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
@@ -945,7 +945,7 @@ var InvoiceControllerState = /*#__PURE__*/_createClass(function InvoiceControlle
945
945
  this.invoiceType = '08';
946
946
  this.buyerState = new BuyerState();
947
947
  this.goodsListState = new GoodsListState();
948
- this.calculating = void 0;
948
+ this.calculatingField = void 0;
949
949
  this.calculatingDigits = void 0;
950
950
  this.priceIntegerDigit = void 0;
951
951
  this.rootElement = null;
@@ -1297,7 +1297,7 @@ var saveEditGood = /*#__PURE__*/(function () {
1297
1297
  case 0:
1298
1298
  editGood = state.goodsListState.editGood;
1299
1299
  form = state.goodsListState.form;
1300
- if (!(!editGood || !form || state.goodsListState.importGoods.isVisibleDrawer || state.calculating)) {
1300
+ if (!(!editGood || !form || state.goodsListState.importGoods.isVisibleDrawer || state.calculatingField)) {
1301
1301
  _context.next = 4;
1302
1302
  break;
1303
1303
  }
@@ -2337,39 +2337,6 @@ var evaluate = (function (expr) {
2337
2337
  return parseFloat(math.evaluate(expr).toFixed(fractionDigits));
2338
2338
  });
2339
2339
 
2340
- /** 拆分全称加简称 */
2341
- var getSN = function getSN(value) {
2342
- if (!value) return undefined;
2343
- var arr = value.match(/\*[^*]+\*/);
2344
- if (arr && arr[0]) {
2345
- return {
2346
- shorthand: arr[0].split('*')[1],
2347
- full: value.replace(arr[0], '')
2348
- };
2349
- } else {
2350
- return {
2351
- shorthand: undefined,
2352
- full: value
2353
- };
2354
- }
2355
- };
2356
- /** 组合全称加简称 */
2357
- var getItemName = function getItemName(value) {
2358
- if (value.shorthand) {
2359
- return "*".concat(value.shorthand, "*").concat(value.full);
2360
- } else {
2361
- return value.full;
2362
- }
2363
- };
2364
- /** 设置简称 */
2365
- var setShorthand = function setShorthand(name, shorthand) {
2366
- if (!name) return undefined;
2367
- var sn = getSN(name);
2368
- if (!sn) return undefined;
2369
- sn.shorthand = shorthand || '';
2370
- return getItemName(sn);
2371
- };
2372
-
2373
2340
  //! moment.js
2374
2341
  //! version : 2.29.4
2375
2342
  //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
@@ -8090,7 +8057,7 @@ var clearCalculatingField = /*#__PURE__*/function () {
8090
8057
  return _regeneratorRuntime().wrap(function _callee$(_context) {
8091
8058
  while (1) switch (_context.prev = _context.next) {
8092
8059
  case 0:
8093
- return _context.abrupt("return", s.calculating = '');
8060
+ return _context.abrupt("return", s.calculatingField = '');
8094
8061
  case 1:
8095
8062
  case "end":
8096
8063
  return _context.stop();
@@ -8155,7 +8122,7 @@ var onChangeQuantity = lazyFn(function (controller, form, record) {
8155
8122
  });
8156
8123
  // 是否含税
8157
8124
  if (!controller.state.goodsListState.isTaxIncluded) {
8158
- _context3.next = 35;
8125
+ _context3.next = 36;
8159
8126
  break;
8160
8127
  }
8161
8128
  if (!(!err.priceIncludeTax && values.priceIncludeTax)) {
@@ -8191,13 +8158,14 @@ var onChangeQuantity = lazyFn(function (controller, form, record) {
8191
8158
  priceIncludeTax: _priceIncludeTax
8192
8159
  });
8193
8160
  case 32:
8194
- // 更新不含税
8195
- updateUnitPriceExcludingTax(controller, form);
8196
- _context3.next = 50;
8161
+ _context3.next = 34;
8162
+ return updateUnitPriceExcludingTax(controller, form, record);
8163
+ case 34:
8164
+ _context3.next = 52;
8197
8165
  break;
8198
- case 35:
8166
+ case 36:
8199
8167
  if (!(!err.priceExcludeTax && values.priceExcludeTax)) {
8200
- _context3.next = 43;
8168
+ _context3.next = 44;
8201
8169
  break;
8202
8170
  }
8203
8171
  priceExcludeTax = format15(values.priceExcludeTax, calculatingDigits);
@@ -8205,17 +8173,17 @@ var onChangeQuantity = lazyFn(function (controller, form, record) {
8205
8173
  form.setFieldsValue({
8206
8174
  lineAmountExcludeTax: lineAmountExcludeTax
8207
8175
  });
8208
- _context3.next = 41;
8176
+ _context3.next = 42;
8209
8177
  return controller.setEditGood({
8210
8178
  lineAmountExcludeTax: lineAmountExcludeTax,
8211
8179
  quantity: quantity
8212
8180
  });
8213
- case 41:
8214
- _context3.next = 49;
8181
+ case 42:
8182
+ _context3.next = 50;
8215
8183
  break;
8216
- case 43:
8184
+ case 44:
8217
8185
  if (!(!err.lineAmountExcludeTax && values.lineAmountExcludeTax)) {
8218
- _context3.next = 49;
8186
+ _context3.next = 50;
8219
8187
  break;
8220
8188
  }
8221
8189
  _lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
@@ -8223,18 +8191,18 @@ var onChangeQuantity = lazyFn(function (controller, form, record) {
8223
8191
  form.setFieldsValue({
8224
8192
  priceExcludeTax: _priceExcludeTax
8225
8193
  });
8226
- _context3.next = 49;
8194
+ _context3.next = 50;
8227
8195
  return controller.setEditGood({
8228
8196
  priceExcludeTax: _priceExcludeTax,
8229
8197
  quantity: quantity
8230
8198
  });
8231
- case 49:
8232
- // 更新含税
8233
- updateUnitPriceTax(controller, form);
8234
8199
  case 50:
8235
8200
  _context3.next = 52;
8236
- return clearCalculatingField(controller);
8201
+ return updateUnitPriceTax(controller, form, record);
8237
8202
  case 52:
8203
+ _context3.next = 54;
8204
+ return clearCalculatingField(controller);
8205
+ case 54:
8238
8206
  case "end":
8239
8207
  return _context3.stop();
8240
8208
  }
@@ -8320,12 +8288,12 @@ var onChangePriceIncludeTax = lazyFn(function (controller, form, record) {
8320
8288
  quantity: _quantity
8321
8289
  });
8322
8290
  case 30:
8323
- // 更新不含税
8324
- updateUnitPriceExcludingTax(controller, form);
8325
- // 清楚 计算中启动字段
8326
- _context4.next = 33;
8291
+ _context4.next = 32;
8292
+ return updateUnitPriceExcludingTax(controller, form, record);
8293
+ case 32:
8294
+ _context4.next = 34;
8327
8295
  return clearCalculatingField(controller);
8328
- case 33:
8296
+ case 34:
8329
8297
  case "end":
8330
8298
  return _context4.stop();
8331
8299
  }
@@ -8411,12 +8379,12 @@ var onChangePriceExcludeTax = lazyFn(function (controller, form, record) {
8411
8379
  quantity: _quantity2
8412
8380
  });
8413
8381
  case 30:
8414
- // 更新含税
8415
- updateUnitPriceTax(controller, form);
8416
- // 清楚 计算中启动字段
8417
- _context5.next = 33;
8382
+ _context5.next = 32;
8383
+ return updateUnitPriceTax(controller, form, record);
8384
+ case 32:
8385
+ _context5.next = 34;
8418
8386
  return clearCalculatingField(controller);
8419
- case 33:
8387
+ case 34:
8420
8388
  case "end":
8421
8389
  return _context5.stop();
8422
8390
  }
@@ -8437,7 +8405,7 @@ var onChangeLineAmountIncludeTax = lazyFn(function (controller, form, record) {
8437
8405
  case 0:
8438
8406
  err = err || {};
8439
8407
  if (!(promptErr(err.lineAmountIncludeTax) || !values.lineAmountIncludeTax)) {
8440
- _context6.next = 8;
8408
+ _context6.next = 9;
8441
8409
  break;
8442
8410
  }
8443
8411
  _context6.next = 4;
@@ -8446,25 +8414,27 @@ var onChangeLineAmountIncludeTax = lazyFn(function (controller, form, record) {
8446
8414
  lineAmountExcludeTax: undefined
8447
8415
  });
8448
8416
  case 4:
8449
- updateUnitPriceExcludingTax(controller, form);
8450
- _context6.next = 7;
8417
+ _context6.next = 6;
8418
+ return updateUnitPriceExcludingTax(controller, form, record);
8419
+ case 6:
8420
+ _context6.next = 8;
8451
8421
  return clearCalculatingField(controller);
8452
- case 7:
8453
- return _context6.abrupt("return");
8454
8422
  case 8:
8423
+ return _context6.abrupt("return");
8424
+ case 9:
8455
8425
  calculatingDigits = controller.state.calculatingDigits;
8456
8426
  lineAmountIncludeTax = format2(values.lineAmountIncludeTax);
8457
- _context6.next = 12;
8427
+ _context6.next = 13;
8458
8428
  return controller.setEditGood({
8459
8429
  lineAmountIncludeTax: lineAmountIncludeTax
8460
8430
  });
8461
- case 12:
8431
+ case 13:
8462
8432
  form.setFieldsValue({
8463
8433
  lineAmountIncludeTax: lineAmountIncludeTax
8464
8434
  });
8465
8435
  // 是否有数量
8466
8436
  if (!(!err.quantity && values.quantity)) {
8467
- _context6.next = 21;
8437
+ _context6.next = 22;
8468
8438
  break;
8469
8439
  }
8470
8440
  quantity = format15(values.quantity, calculatingDigits);
@@ -8472,16 +8442,16 @@ var onChangeLineAmountIncludeTax = lazyFn(function (controller, form, record) {
8472
8442
  form.setFieldsValue({
8473
8443
  priceIncludeTax: priceIncludeTax
8474
8444
  });
8475
- _context6.next = 19;
8445
+ _context6.next = 20;
8476
8446
  return controller.setEditGood({
8477
8447
  priceIncludeTax: priceIncludeTax
8478
8448
  });
8479
- case 19:
8480
- _context6.next = 27;
8449
+ case 20:
8450
+ _context6.next = 28;
8481
8451
  break;
8482
- case 21:
8452
+ case 22:
8483
8453
  if (!(!err.priceIncludeTax && (values.priceIncludeTax || values.priceIncludeTax === 0))) {
8484
- _context6.next = 27;
8454
+ _context6.next = 28;
8485
8455
  break;
8486
8456
  }
8487
8457
  _priceIncludeTax2 = format15(values.priceIncludeTax, calculatingDigits);
@@ -8489,17 +8459,17 @@ var onChangeLineAmountIncludeTax = lazyFn(function (controller, form, record) {
8489
8459
  form.setFieldsValue({
8490
8460
  quantity: _quantity3
8491
8461
  });
8492
- _context6.next = 27;
8462
+ _context6.next = 28;
8493
8463
  return controller.setEditGood({
8494
8464
  quantity: _quantity3
8495
8465
  });
8496
- case 27:
8497
- // 更新不含税
8498
- updateUnitPriceExcludingTax(controller, form);
8499
- // 清楚 计算中启动字段
8466
+ case 28:
8500
8467
  _context6.next = 30;
8501
- return clearCalculatingField(controller);
8468
+ return updateUnitPriceExcludingTax(controller, form, record);
8502
8469
  case 30:
8470
+ _context6.next = 32;
8471
+ return clearCalculatingField(controller);
8472
+ case 32:
8503
8473
  case "end":
8504
8474
  return _context6.stop();
8505
8475
  }
@@ -8520,7 +8490,7 @@ var onChangeLineAmountExcludeTax = lazyFn(function (controller, form, record) {
8520
8490
  case 0:
8521
8491
  err = err || {};
8522
8492
  if (!(promptErr(err.lineAmountExcludeTax) || !values.lineAmountExcludeTax)) {
8523
- _context7.next = 8;
8493
+ _context7.next = 9;
8524
8494
  break;
8525
8495
  }
8526
8496
  _context7.next = 4;
@@ -8529,25 +8499,27 @@ var onChangeLineAmountExcludeTax = lazyFn(function (controller, form, record) {
8529
8499
  lineAmountExcludeTax: undefined
8530
8500
  });
8531
8501
  case 4:
8532
- updateUnitPriceTax(controller, form);
8533
- _context7.next = 7;
8502
+ _context7.next = 6;
8503
+ return updateUnitPriceTax(controller, form, record);
8504
+ case 6:
8505
+ _context7.next = 8;
8534
8506
  return clearCalculatingField(controller);
8535
- case 7:
8536
- return _context7.abrupt("return");
8537
8507
  case 8:
8508
+ return _context7.abrupt("return");
8509
+ case 9:
8538
8510
  calculatingDigits = controller.state.calculatingDigits;
8539
8511
  lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
8540
- _context7.next = 12;
8512
+ _context7.next = 13;
8541
8513
  return controller.setEditGood({
8542
8514
  lineAmountExcludeTax: lineAmountExcludeTax
8543
8515
  });
8544
- case 12:
8516
+ case 13:
8545
8517
  form.setFieldsValue({
8546
8518
  lineAmountExcludeTax: lineAmountExcludeTax
8547
8519
  });
8548
8520
  // 是否有数量
8549
8521
  if (!(!err.quantity && values.quantity)) {
8550
- _context7.next = 21;
8522
+ _context7.next = 22;
8551
8523
  break;
8552
8524
  }
8553
8525
  quantity = format15(values.quantity, calculatingDigits);
@@ -8555,16 +8527,16 @@ var onChangeLineAmountExcludeTax = lazyFn(function (controller, form, record) {
8555
8527
  form.setFieldsValue({
8556
8528
  priceExcludeTax: priceExcludeTax
8557
8529
  });
8558
- _context7.next = 19;
8530
+ _context7.next = 20;
8559
8531
  return controller.setEditGood({
8560
8532
  priceExcludeTax: priceExcludeTax
8561
8533
  });
8562
- case 19:
8563
- _context7.next = 27;
8534
+ case 20:
8535
+ _context7.next = 28;
8564
8536
  break;
8565
- case 21:
8537
+ case 22:
8566
8538
  if (!(!err.priceExcludeTax && values.priceExcludeTax)) {
8567
- _context7.next = 27;
8539
+ _context7.next = 28;
8568
8540
  break;
8569
8541
  }
8570
8542
  _priceExcludeTax2 = format15(values.priceExcludeTax, calculatingDigits);
@@ -8572,17 +8544,17 @@ var onChangeLineAmountExcludeTax = lazyFn(function (controller, form, record) {
8572
8544
  form.setFieldsValue({
8573
8545
  quantity: _quantity4
8574
8546
  });
8575
- _context7.next = 27;
8547
+ _context7.next = 28;
8576
8548
  return controller.setEditGood({
8577
8549
  quantity: _quantity4
8578
8550
  });
8579
- case 27:
8580
- // 更新含税
8581
- updateUnitPriceTax(controller, form);
8582
- // 清楚 计算中启动字段
8551
+ case 28:
8583
8552
  _context7.next = 30;
8584
- return clearCalculatingField(controller);
8553
+ return updateUnitPriceTax(controller, form, record);
8585
8554
  case 30:
8555
+ _context7.next = 32;
8556
+ return clearCalculatingField(controller);
8557
+ case 32:
8586
8558
  case "end":
8587
8559
  return _context7.stop();
8588
8560
  }
@@ -8626,15 +8598,22 @@ var onChangeTaxRate = lazyFn(function (controller, form, record) {
8626
8598
  }
8627
8599
  })();
8628
8600
  // 是否含税
8629
- if (controller.state.goodsListState.isTaxIncluded) {
8630
- updateUnitPriceExcludingTax(controller, form);
8631
- } else {
8632
- updateUnitPriceTax(controller, form);
8601
+ if (!controller.state.goodsListState.isTaxIncluded) {
8602
+ _context8.next = 12;
8603
+ break;
8633
8604
  }
8634
- // 清楚 计算中启动字段
8635
8605
  _context8.next = 10;
8636
- return clearCalculatingField(controller);
8606
+ return updateUnitPriceExcludingTax(controller, form, record);
8637
8607
  case 10:
8608
+ _context8.next = 14;
8609
+ break;
8610
+ case 12:
8611
+ _context8.next = 14;
8612
+ return updateUnitPriceTax(controller, form, record);
8613
+ case 14:
8614
+ _context8.next = 16;
8615
+ return clearCalculatingField(controller);
8616
+ case 16:
8638
8617
  case "end":
8639
8618
  return _context8.stop();
8640
8619
  }
@@ -8675,265 +8654,307 @@ function dutyFree(controller, taxRate, form, record) {
8675
8654
  }
8676
8655
  }
8677
8656
  /** 含税 => 更新(不含税) */
8678
- var updateUnitPriceExcludingTax = function updateUnitPriceExcludingTax(controller, form, record) {
8679
- form.validateFields( /*#__PURE__*/function () {
8680
- var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(err, values) {
8681
- var taxAmount, lineAmountExcludeTax, priceExcludeTax, deduction;
8682
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
8683
- while (1) switch (_context9.prev = _context9.next) {
8684
- case 0:
8685
- err = err || {};
8686
- /** 税额 */
8687
- /** 扣除额 */
8688
- deduction = controller.state.goodsListState.deduction; // 计算税额
8689
- if (!promptErr(err.lineAmountIncludeTax) && !promptErr(err.taxRate)) {
8690
- taxAmount = countTaxAmount(values.lineAmountIncludeTax, deduction, values.taxRate);
8691
- }
8692
- _context9.next = 5;
8693
- return controller.setEditGood({
8694
- taxAmount: taxAmount
8695
- });
8696
- case 5:
8697
- // 计算 金额(不含税)
8698
- if ((taxAmount || taxAmount === 0) && !promptErr(err.lineAmountIncludeTax)) {
8699
- lineAmountExcludeTax = countAmountExcludeTax(values.lineAmountIncludeTax, taxAmount);
8700
- }
8701
- form.setFieldsValue({
8702
- lineAmountExcludeTax: lineAmountExcludeTax
8703
- });
8704
- _context9.next = 9;
8705
- return controller.setEditGood({
8706
- lineAmountExcludeTax: lineAmountExcludeTax
8707
- });
8708
- case 9:
8709
- // 单价(不含税)
8710
- if (lineAmountExcludeTax && !promptErr(err.quantity)) {
8711
- priceExcludeTax = countPrice(lineAmountExcludeTax, values.quantity, controller.state.calculatingDigits);
8712
- }
8713
- form.setFieldsValue({
8714
- priceExcludeTax: priceExcludeTax
8715
- });
8716
- _context9.next = 13;
8717
- return controller.setEditGood({
8718
- priceExcludeTax: priceExcludeTax
8719
- });
8720
- case 13:
8721
- case "end":
8722
- return _context9.stop();
8723
- }
8724
- }, _callee9);
8725
- }));
8726
- return function (_x15, _x16) {
8727
- return _ref9.apply(this, arguments);
8728
- };
8729
- }());
8730
- };
8657
+ var updateUnitPriceExcludingTax = /*#__PURE__*/function () {
8658
+ var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(controller, form, record) {
8659
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
8660
+ while (1) switch (_context10.prev = _context10.next) {
8661
+ case 0:
8662
+ return _context10.abrupt("return", new Promise(function (resolve) {
8663
+ form.validateFields( /*#__PURE__*/function () {
8664
+ var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(err, values) {
8665
+ var taxAmount, lineAmountExcludeTax, priceExcludeTax, deduction;
8666
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
8667
+ while (1) switch (_context9.prev = _context9.next) {
8668
+ case 0:
8669
+ err = err || {};
8670
+ /** 税额 */
8671
+ /** 扣除额 */
8672
+ deduction = controller.state.goodsListState.deduction; // 计算税额
8673
+ if (!promptErr(err.lineAmountIncludeTax) && !promptErr(err.taxRate)) {
8674
+ taxAmount = countTaxAmount(values.lineAmountIncludeTax, deduction, values.taxRate);
8675
+ }
8676
+ _context9.next = 5;
8677
+ return controller.setEditGood({
8678
+ taxAmount: taxAmount
8679
+ });
8680
+ case 5:
8681
+ // 计算 金额(不含税)
8682
+ if ((taxAmount || taxAmount === 0) && !promptErr(err.lineAmountIncludeTax)) {
8683
+ lineAmountExcludeTax = countAmountExcludeTax(values.lineAmountIncludeTax, taxAmount);
8684
+ }
8685
+ form.setFieldsValue({
8686
+ lineAmountExcludeTax: lineAmountExcludeTax
8687
+ });
8688
+ _context9.next = 9;
8689
+ return controller.setEditGood({
8690
+ lineAmountExcludeTax: lineAmountExcludeTax
8691
+ });
8692
+ case 9:
8693
+ // 单价(不含税)
8694
+ if (lineAmountExcludeTax && !promptErr(err.quantity)) {
8695
+ priceExcludeTax = countPrice(lineAmountExcludeTax, values.quantity, controller.state.calculatingDigits);
8696
+ }
8697
+ form.setFieldsValue({
8698
+ priceExcludeTax: priceExcludeTax
8699
+ });
8700
+ _context9.next = 13;
8701
+ return controller.setEditGood({
8702
+ priceExcludeTax: priceExcludeTax
8703
+ });
8704
+ case 13:
8705
+ case "end":
8706
+ return _context9.stop();
8707
+ }
8708
+ }, _callee9);
8709
+ }));
8710
+ return function (_x18, _x19) {
8711
+ return _ref10.apply(this, arguments);
8712
+ };
8713
+ }());
8714
+ resolve(undefined);
8715
+ }));
8716
+ case 1:
8717
+ case "end":
8718
+ return _context10.stop();
8719
+ }
8720
+ }, _callee10);
8721
+ }));
8722
+ return function updateUnitPriceExcludingTax(_x15, _x16, _x17) {
8723
+ return _ref9.apply(this, arguments);
8724
+ };
8725
+ }();
8731
8726
  /** 不含税 => 更新(含税) */
8732
- var updateUnitPriceTax = function updateUnitPriceTax(controller, form, record) {
8733
- form.validateFields( /*#__PURE__*/function () {
8734
- var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(err, values) {
8735
- var calculatingDigits, lineAmountExcludeTax, lineAmountIncludeTax, priceIncludeTax, taxAmount;
8736
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
8737
- while (1) switch (_context10.prev = _context10.next) {
8738
- case 0:
8739
- err = err || {};
8740
- if (!(!err.taxRat && (values.taxRate || values.taxRate === 0) && !promptErr(err.lineAmountExcludeTax) && (values.lineAmountExcludeTax || values.lineAmountExcludeTax === 0))) {
8741
- _context10.next = 17;
8742
- break;
8743
- }
8744
- calculatingDigits = controller.state.calculatingDigits; // 金额(含税)= 金额(不含税)* (1+ 税率)
8745
- lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
8746
- lineAmountIncludeTax = format2(evaluate("".concat(lineAmountExcludeTax, " * (1+(").concat(values.taxRate, "/100))")));
8747
- _context10.next = 7;
8748
- return controller.setEditGood({
8749
- lineAmountIncludeTax: lineAmountIncludeTax
8750
- });
8751
- case 7:
8752
- if (!(!err.quantity && values.quantity)) {
8753
- _context10.next = 11;
8754
- break;
8755
- }
8756
- priceIncludeTax = format15(evaluate("".concat(lineAmountIncludeTax, " / ").concat(values.quantity)), calculatingDigits);
8757
- _context10.next = 11;
8758
- return controller.setEditGood({
8759
- priceIncludeTax: priceIncludeTax
8760
- });
8761
- case 11:
8762
- // 税额 = 金额(含税)-金额(不含税)
8763
- taxAmount = evaluate("".concat(lineAmountIncludeTax, " - ").concat(lineAmountExcludeTax));
8764
- form.setFieldsValue({
8765
- taxAmount: taxAmount
8766
- });
8767
- _context10.next = 15;
8768
- return controller.setEditGood({
8769
- taxAmount: taxAmount
8770
- });
8771
- case 15:
8772
- _context10.next = 20;
8773
- break;
8774
- case 17:
8775
- form.setFieldsValue({
8776
- taxAmount: undefined
8777
- });
8778
- _context10.next = 20;
8779
- return controller.setEditGood({
8780
- taxAmount: undefined
8781
- });
8782
- case 20:
8783
- case "end":
8784
- return _context10.stop();
8785
- }
8786
- }, _callee10);
8787
- }));
8788
- return function (_x17, _x18) {
8789
- return _ref10.apply(this, arguments);
8790
- };
8791
- }());
8792
- };
8727
+ var updateUnitPriceTax = /*#__PURE__*/function () {
8728
+ var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(controller, form, record) {
8729
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
8730
+ while (1) switch (_context12.prev = _context12.next) {
8731
+ case 0:
8732
+ return _context12.abrupt("return", new Promise(function (resolve) {
8733
+ form.validateFields( /*#__PURE__*/function () {
8734
+ var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(err, values) {
8735
+ var calculatingDigits, lineAmountExcludeTax, lineAmountIncludeTax, priceIncludeTax, taxAmount;
8736
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
8737
+ while (1) switch (_context11.prev = _context11.next) {
8738
+ case 0:
8739
+ err = err || {};
8740
+ if (!(!err.taxRat && (values.taxRate || values.taxRate === 0) && !promptErr(err.lineAmountExcludeTax) && (values.lineAmountExcludeTax || values.lineAmountExcludeTax === 0))) {
8741
+ _context11.next = 17;
8742
+ break;
8743
+ }
8744
+ calculatingDigits = controller.state.calculatingDigits; // 金额(含税)= 金额(不含税)* (1+ 税率)
8745
+ lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
8746
+ lineAmountIncludeTax = format2(evaluate("".concat(lineAmountExcludeTax, " * (1+(").concat(values.taxRate, "/100))")));
8747
+ _context11.next = 7;
8748
+ return controller.setEditGood({
8749
+ lineAmountIncludeTax: lineAmountIncludeTax
8750
+ });
8751
+ case 7:
8752
+ if (!(!err.quantity && values.quantity)) {
8753
+ _context11.next = 11;
8754
+ break;
8755
+ }
8756
+ priceIncludeTax = format15(evaluate("".concat(lineAmountIncludeTax, " / ").concat(values.quantity)), calculatingDigits);
8757
+ _context11.next = 11;
8758
+ return controller.setEditGood({
8759
+ priceIncludeTax: priceIncludeTax
8760
+ });
8761
+ case 11:
8762
+ // 税额 = 金额(含税)-金额(不含税)
8763
+ taxAmount = evaluate("".concat(lineAmountIncludeTax, " - ").concat(lineAmountExcludeTax));
8764
+ form.setFieldsValue({
8765
+ taxAmount: taxAmount
8766
+ });
8767
+ _context11.next = 15;
8768
+ return controller.setEditGood({
8769
+ taxAmount: taxAmount
8770
+ });
8771
+ case 15:
8772
+ _context11.next = 20;
8773
+ break;
8774
+ case 17:
8775
+ form.setFieldsValue({
8776
+ taxAmount: undefined
8777
+ });
8778
+ _context11.next = 20;
8779
+ return controller.setEditGood({
8780
+ taxAmount: undefined
8781
+ });
8782
+ case 20:
8783
+ // 单价(含税) = 单价(不含税) * (1+税率)
8784
+ // if (
8785
+ // !err.taxRat &&
8786
+ // (values.taxRate || values.taxRate === 0) &&
8787
+ // !promptErr(err.priceExcludeTax) &&
8788
+ // (values.priceExcludeTax || values.priceExcludeTax === 0)
8789
+ // ) {
8790
+ // const priceExcludeTax = format15(values.priceExcludeTax);
8791
+ // const priceIncludeTax = format15(evaluate(`${priceExcludeTax} * (1+(${values.taxRate}/100))`));
8792
+ // await controller.setEditGood({ priceIncludeTax });
8793
+ // }
8794
+ resolve(undefined);
8795
+ case 21:
8796
+ case "end":
8797
+ return _context11.stop();
8798
+ }
8799
+ }, _callee11);
8800
+ }));
8801
+ return function (_x23, _x24) {
8802
+ return _ref12.apply(this, arguments);
8803
+ };
8804
+ }());
8805
+ }));
8806
+ case 1:
8807
+ case "end":
8808
+ return _context12.stop();
8809
+ }
8810
+ }, _callee12);
8811
+ }));
8812
+ return function updateUnitPriceTax(_x20, _x21, _x22) {
8813
+ return _ref11.apply(this, arguments);
8814
+ };
8815
+ }();
8793
8816
  /** 单调赋码 */
8794
8817
  var endowCode = /*#__PURE__*/function () {
8795
- var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(controller, goods) {
8796
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
8797
- while (1) switch (_context13.prev = _context13.next) {
8818
+ var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(controller, goods) {
8819
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
8820
+ while (1) switch (_context15.prev = _context15.next) {
8798
8821
  case 0:
8799
- _context13.next = 2;
8822
+ _context15.next = 2;
8800
8823
  return controller.wait();
8801
8824
  case 2:
8802
- _context13.next = 4;
8825
+ _context15.next = 4;
8803
8826
  return controller.saveEditGood();
8804
8827
  case 4:
8805
- _context13.next = 6;
8828
+ _context15.next = 6;
8806
8829
  return controller.pipeline( /*#__PURE__*/function () {
8807
- var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(s) {
8830
+ var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
8808
8831
  var _s$goodsListState$edi;
8809
8832
  var err, key, g, i;
8810
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
8811
- while (1) switch (_context12.prev = _context12.next) {
8833
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
8834
+ while (1) switch (_context14.prev = _context14.next) {
8812
8835
  case 0:
8813
8836
  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))) {
8814
- _context12.next = 11;
8837
+ _context14.next = 11;
8815
8838
  break;
8816
8839
  }
8817
8840
  err = s.goodsListState.form.getFieldsError();
8818
- _context12.t0 = _regeneratorRuntime().keys(err);
8841
+ _context14.t0 = _regeneratorRuntime().keys(err);
8819
8842
  case 3:
8820
- if ((_context12.t1 = _context12.t0()).done) {
8821
- _context12.next = 11;
8843
+ if ((_context14.t1 = _context14.t0()).done) {
8844
+ _context14.next = 11;
8822
8845
  break;
8823
8846
  }
8824
- key = _context12.t1.value;
8847
+ key = _context14.t1.value;
8825
8848
  if (err[key]) {
8826
- _context12.next = 7;
8849
+ _context14.next = 7;
8827
8850
  break;
8828
8851
  }
8829
- return _context12.abrupt("continue", 3);
8852
+ return _context14.abrupt("continue", 3);
8830
8853
  case 7:
8831
8854
  ktsComponentsAntdX3.message.error(err[key][0]);
8832
- return _context12.abrupt("return");
8855
+ return _context14.abrupt("return");
8833
8856
  case 11:
8834
8857
  g = s.goodsListState.goodsMap.get(goods.$index);
8835
8858
  i = s.goodsListState.goodsList.indexOf(g);
8836
- _context12.t2 = goods.lineAttribute;
8837
- _context12.next = _context12.t2 === LineAttributeType$1.正常 ? 16 : _context12.t2 === LineAttributeType$1.折扣行 ? 18 : _context12.t2 === LineAttributeType$1.被折扣行 ? 20 : 22;
8859
+ _context14.t2 = goods.lineAttribute;
8860
+ _context14.next = _context14.t2 === LineAttributeType$1.正常 ? 16 : _context14.t2 === LineAttributeType$1.折扣行 ? 18 : _context14.t2 === LineAttributeType$1.被折扣行 ? 20 : 22;
8838
8861
  break;
8839
8862
  case 16:
8840
8863
  s.goodsListState.endowCode.endowcodeGoodIndex = [goods.$index];
8841
- return _context12.abrupt("break", 22);
8864
+ return _context14.abrupt("break", 22);
8842
8865
  case 18:
8843
8866
  s.goodsListState.endowCode.endowcodeGoodIndex = [goods.$index, s.goodsListState.goodsList[i - 1].$index];
8844
- return _context12.abrupt("break", 22);
8867
+ return _context14.abrupt("break", 22);
8845
8868
  case 20:
8846
8869
  s.goodsListState.endowCode.endowcodeGoodIndex = [goods.$index, s.goodsListState.goodsList[i + 1].$index];
8847
- return _context12.abrupt("break", 22);
8870
+ return _context14.abrupt("break", 22);
8848
8871
  case 22:
8849
8872
  case "end":
8850
- return _context12.stop();
8873
+ return _context14.stop();
8851
8874
  }
8852
- }, _callee12);
8875
+ }, _callee14);
8853
8876
  }));
8854
- return function (_x23) {
8855
- return _ref13.apply(this, arguments);
8877
+ return function (_x29) {
8878
+ return _ref15.apply(this, arguments);
8856
8879
  };
8857
8880
  }())();
8858
8881
  case 6:
8859
8882
  case "end":
8860
- return _context13.stop();
8883
+ return _context15.stop();
8861
8884
  }
8862
- }, _callee13);
8885
+ }, _callee15);
8863
8886
  }));
8864
- return function endowCode(_x21, _x22) {
8865
- return _ref12.apply(this, arguments);
8887
+ return function endowCode(_x27, _x28) {
8888
+ return _ref14.apply(this, arguments);
8866
8889
  };
8867
8890
  }();
8868
8891
  /** 修改了 项目名称 */
8869
8892
  var onChangeItemName = /*#__PURE__*/function () {
8870
- var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(controller, form, record) {
8871
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
8872
- while (1) switch (_context15.prev = _context15.next) {
8893
+ var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(controller, form, record) {
8894
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
8895
+ while (1) switch (_context17.prev = _context17.next) {
8873
8896
  case 0:
8874
8897
  controller.run( /*#__PURE__*/function () {
8875
- var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
8876
- var _getSN$shorthand, _getSN;
8877
- var value, shorthand;
8878
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
8879
- while (1) switch (_context14.prev = _context14.next) {
8898
+ var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(s) {
8899
+ var value;
8900
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
8901
+ while (1) switch (_context16.prev = _context16.next) {
8880
8902
  case 0:
8881
8903
  value = form.getFieldsValue().itemName;
8882
- shorthand = (_getSN$shorthand = (_getSN = getSN(value)) === null || _getSN === void 0 ? void 0 : _getSN.shorthand) !== null && _getSN$shorthand !== void 0 ? _getSN$shorthand : '';
8883
8904
  if (!s.goodsListState.isMyShow) {
8884
- _context14.next = 11;
8905
+ _context16.next = 10;
8885
8906
  break;
8886
8907
  }
8887
- _context14.next = 5;
8908
+ _context16.next = 4;
8888
8909
  return controller.setEditGood({
8889
8910
  itemNameSelf: value
8890
8911
  });
8891
- case 5:
8892
- _context14.t0 = record.itemName;
8893
- if (!_context14.t0) {
8894
- _context14.next = 9;
8912
+ case 4:
8913
+ _context16.t0 = record.itemName;
8914
+ if (!_context16.t0) {
8915
+ _context16.next = 8;
8895
8916
  break;
8896
8917
  }
8897
- _context14.next = 9;
8918
+ _context16.next = 8;
8898
8919
  return controller.setEditGood({
8899
- itemName: setShorthand(record.itemName, shorthand)
8920
+ itemName: record.itemName
8900
8921
  });
8901
- case 9:
8902
- _context14.next = 17;
8922
+ case 8:
8923
+ _context16.next = 16;
8903
8924
  break;
8904
- case 11:
8905
- _context14.next = 13;
8925
+ case 10:
8926
+ _context16.next = 12;
8906
8927
  return controller.setEditGood({
8907
8928
  itemName: value
8908
8929
  });
8909
- case 13:
8910
- _context14.t1 = record.itemNameSelf;
8911
- if (!_context14.t1) {
8912
- _context14.next = 17;
8930
+ case 12:
8931
+ _context16.t1 = record.itemNameSelf;
8932
+ if (!_context16.t1) {
8933
+ _context16.next = 16;
8913
8934
  break;
8914
8935
  }
8915
- _context14.next = 17;
8936
+ _context16.next = 16;
8916
8937
  return controller.setEditGood({
8917
- itemNameSelf: setShorthand(record.itemNameSelf, shorthand)
8938
+ itemNameSelf: record.itemNameSelf
8918
8939
  });
8919
- case 17:
8940
+ case 16:
8920
8941
  case "end":
8921
- return _context14.stop();
8942
+ return _context16.stop();
8922
8943
  }
8923
- }, _callee14);
8944
+ }, _callee16);
8924
8945
  }));
8925
- return function (_x27) {
8926
- return _ref15.apply(this, arguments);
8946
+ return function (_x33) {
8947
+ return _ref17.apply(this, arguments);
8927
8948
  };
8928
8949
  }());
8929
8950
  case 1:
8930
8951
  case "end":
8931
- return _context15.stop();
8952
+ return _context17.stop();
8932
8953
  }
8933
- }, _callee15);
8954
+ }, _callee17);
8934
8955
  }));
8935
- return function onChangeItemName(_x24, _x25, _x26) {
8936
- return _ref14.apply(this, arguments);
8956
+ return function onChangeItemName(_x30, _x31, _x32) {
8957
+ return _ref16.apply(this, arguments);
8937
8958
  };
8938
8959
  }();
8939
8960
 
@@ -9073,40 +9094,50 @@ var css_248z$6 = ".kts-invoice-operate-goods-list-itemName-input {\n display: f
9073
9094
  styleInject(css_248z$6);
9074
9095
 
9075
9096
  function ItemNameInput(props) {
9076
- var _getShorthand = getShorthand(props.value),
9077
- shorthand = _getShorthand.shorthand,
9078
- fullName = _getShorthand.fullName;
9079
9097
  var onChange = React__default['default'].useCallback(function (e) {
9080
9098
  var event = _objectSpread2({}, e);
9081
- event.target.value = shorthand ? "*".concat(shorthand, "*").concat(e.target.value) : e.target.value;
9082
9099
  props.onChange && props.onChange(event);
9083
9100
  }, []);
9084
9101
  return /*#__PURE__*/React__default['default'].createElement("div", {
9085
9102
  className: 'kts-invoice-operate-goods-list-itemName-input'
9086
- }, shorthand && /*#__PURE__*/React__default['default'].createElement("span", {
9103
+ }, props.shorthand && /*#__PURE__*/React__default['default'].createElement("span", {
9087
9104
  style: {
9088
9105
  alignSelf: 'center',
9089
9106
  fontSize: 12
9090
9107
  }
9091
- }, "*", shorthand, "*"), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Input, {
9108
+ }, "*", props.shorthand, "*"), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Input, {
9092
9109
  style: {
9093
9110
  height: '100%',
9094
9111
  border: 'none'
9095
9112
  },
9096
- value: fullName,
9113
+ value: props.value,
9097
9114
  onChange: onChange
9098
9115
  }));
9099
9116
  }
9100
- /** 提取简称 */
9101
- var getShorthand = function getShorthand(value) {
9102
- if (!value) return {};
9117
+
9118
+ /** 拆分全称加简称 */
9119
+ var getSN = function getSN(value) {
9120
+ if (!value) return undefined;
9103
9121
  var arr = value.match(/\*[^*]+\*/);
9104
- var shorthand = arr ? arr[0].split('*')[1] : '';
9105
- var fullName = shorthand ? value.replace("*".concat(shorthand, "*"), '') : value;
9106
- return {
9107
- shorthand: shorthand,
9108
- fullName: fullName
9109
- };
9122
+ if (arr && arr[0]) {
9123
+ return {
9124
+ shorthand: arr[0].split('*')[1],
9125
+ full: value.replace(arr[0], '')
9126
+ };
9127
+ } else {
9128
+ return {
9129
+ shorthand: undefined,
9130
+ full: value
9131
+ };
9132
+ }
9133
+ };
9134
+ /** 组合全称加简称 */
9135
+ var getItemNameWithShorthand = function getItemNameWithShorthand(value) {
9136
+ if (value.shorthand) {
9137
+ return "*".concat(value.shorthand, "*").concat(value.full);
9138
+ } else {
9139
+ return value.full;
9140
+ }
9110
9141
  };
9111
9142
 
9112
9143
  var useColumns = (function (form) {
@@ -9151,7 +9182,7 @@ var useColumns = (function (form) {
9151
9182
  }, []);
9152
9183
  /** 计算中启动字段 */
9153
9184
  var changeField = controller.useMemo(function (e) {
9154
- return e.calculating;
9185
+ return e.calculatingField;
9155
9186
  }, []);
9156
9187
  /** 计算中启动字段 */
9157
9188
  var setChangeField = React__default['default'].useCallback(function (value) {
@@ -9160,7 +9191,7 @@ var useColumns = (function (form) {
9160
9191
  return _regeneratorRuntime().wrap(function _callee$(_context) {
9161
9192
  while (1) switch (_context.prev = _context.next) {
9162
9193
  case 0:
9163
- s.calculating = value;
9194
+ s.calculatingField = value;
9164
9195
  case 1:
9165
9196
  case "end":
9166
9197
  return _context.stop();
@@ -9248,6 +9279,7 @@ var useColumns = (function (form) {
9248
9279
  }()
9249
9280
  }])
9250
9281
  })( /*#__PURE__*/React__default['default'].createElement(ItemNameInput, {
9282
+ shorthand: editGood.shorthand,
9251
9283
  onChange: function onChange() {
9252
9284
  onChangeItemName(controller, form, record);
9253
9285
  }
@@ -9277,8 +9309,14 @@ var useColumns = (function (form) {
9277
9309
  })))));
9278
9310
  } else {
9279
9311
  return /*#__PURE__*/React__default['default'].createElement(MyItemNameDiv, {
9280
- valueT: formatSearch(record.itemNameSelf, searchValue),
9281
- valueF: formatSearch(record.itemName, searchValue),
9312
+ valueT: formatSearch(getItemNameWithShorthand({
9313
+ shorthand: record.shorthand,
9314
+ full: record.itemNameSelf || ''
9315
+ }), searchValue),
9316
+ valueF: formatSearch(getItemNameWithShorthand({
9317
+ shorthand: record.shorthand,
9318
+ full: record.itemName || ''
9319
+ }), searchValue),
9282
9320
  isMyShow: isMyShow
9283
9321
  });
9284
9322
  }
@@ -11899,7 +11937,7 @@ var DrawerBody$2 = function DrawerBody() {
11899
11937
  }
11900
11938
  // 中间数据
11901
11939
  between = _objectSpread2({}, record);
11902
- between.itemName = getItemName$1(record, s.goodsListState.editGood);
11940
+ between.itemName = getItemName(record, s.goodsListState.editGood);
11903
11941
  between.itemNameOther = getItemNameOther(record, s.goodsListState.editGood);
11904
11942
  // 设置编辑货物
11905
11943
  editGood = s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), between);
@@ -11925,8 +11963,19 @@ var DrawerBody$2 = function DrawerBody() {
11925
11963
  s.goodsListState.form.setFieldsValue(_objectSpread2({}, editGood));
11926
11964
  }
11927
11965
  s.goodsListState.importGoods.isVisibleDrawer = false;
11928
- s.goodsListState.isTaxIncluded ? updateUnitPriceExcludingTax(controller, s.goodsListState.form) : updateUnitPriceTax(controller, s.goodsListState.form);
11929
- case 19:
11966
+ if (!s.goodsListState.isTaxIncluded) {
11967
+ _context2.next = 23;
11968
+ break;
11969
+ }
11970
+ _context2.next = 21;
11971
+ return updateUnitPriceExcludingTax(controller, s.goodsListState.form, record);
11972
+ case 21:
11973
+ _context2.next = 25;
11974
+ break;
11975
+ case 23:
11976
+ _context2.next = 25;
11977
+ return updateUnitPriceTax(controller, s.goodsListState.form, record);
11978
+ case 25:
11930
11979
  case "end":
11931
11980
  return _context2.stop();
11932
11981
  }
@@ -11954,27 +12003,26 @@ var getPriceExcludeTax = function getPriceExcludeTax(s, record, calculatingDigit
11954
12003
  return format15(evaluate("".concat(record.priceIncludeTax, " / (1+").concat(s.taxRate, "/100)")), calculatingDigits);
11955
12004
  };
11956
12005
  // 获取我方名称
11957
- var getItemName$1 = function getItemName(record, editGood) {
11958
- var _getSN;
11959
- var shorthand;
11960
- shorthand = record.shorthand;
11961
- if (shorthand) {
11962
- return "*".concat(shorthand, "*").concat(record.itemName);
11963
- }
11964
- shorthand = (_getSN = getSN(editGood.itemName)) === null || _getSN === void 0 ? void 0 : _getSN.shorthand;
11965
- if (shorthand) {
11966
- return "*".concat(shorthand, "*").concat(record.itemNameSelf);
11967
- }
12006
+ var getItemName = function getItemName(record, editGood) {
12007
+ // let shorthand;
12008
+ // shorthand = record.shorthand;
12009
+ // if (shorthand) {
12010
+ // return `*${shorthand}*${record.itemName}`;
12011
+ // }
12012
+ // shorthand = getSN(editGood.itemName)?.shorthand;
12013
+ // if (shorthand) {
12014
+ // return `*${shorthand}*${record.itemNameSelf}`;
12015
+ // }
11968
12016
  return record.itemName;
11969
12017
  };
11970
12018
  // 获取他方名称
11971
12019
  var getItemNameOther = function getItemNameOther(record, editGood) {
11972
- if (!editGood.itemName) return editGood.itemName;
11973
- var shorthand;
11974
- shorthand = record.shorthand;
11975
- if (shorthand) {
11976
- return "*".concat(shorthand, "*").concat(record.itemNameSelf);
11977
- }
12020
+ // if (!editGood.itemName) return editGood.itemName;
12021
+ // let shorthand;
12022
+ // shorthand = record.shorthand;
12023
+ // if (shorthand) {
12024
+ // return `*${shorthand}*${record.itemNameSelf}`;
12025
+ // }
11978
12026
  return record.itemName;
11979
12027
  };
11980
12028
 
@@ -12424,8 +12472,7 @@ var DrawerBody$3 = function DrawerBody(props) {
12424
12472
  }); // 赋码
12425
12473
  endowCodeGood.forEach(function (good) {
12426
12474
  if (!good) return;
12427
- good.itemName = setShorthand(good.itemName, values.shorthand);
12428
- good.itemNameSelf = setShorthand(good.itemNameSelf, values.shorthand);
12475
+ good.shorthand = values.shorthand;
12429
12476
  good.taxClassificationCode = values.taxClassificationCode;
12430
12477
  good.taxRate = values.taxRate;
12431
12478
  good.taxFreeType = values.taxFreeType;
@@ -12500,6 +12547,7 @@ var DrawerBody$3 = function DrawerBody(props) {
12500
12547
  }, [controller]);
12501
12548
  return /*#__PURE__*/React__default['default'].createElement(antd.SchemaForm, {
12502
12549
  actions: actions,
12550
+ previewPlaceholder: " ",
12503
12551
  components: _objectSpread2(_objectSpread2({}, components), {}, {
12504
12552
  showSearch: !!controller.state.goodsListState.endowCode.getTaxCategoryCodeTree ? ShowSearch2 : ShowSearch
12505
12553
  }),
@@ -12518,7 +12566,7 @@ var DrawerBody$3 = function DrawerBody(props) {
12518
12566
  name: "shorthand",
12519
12567
  type: "string",
12520
12568
  readOnly: true,
12521
- default: getShorthand$1(defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.itemName),
12569
+ default: defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.shorthand,
12522
12570
  title: "\u5546\u54C1\u548C\u670D\u52A1\u5206\u7C7B\u7B80\u79F0"
12523
12571
  }), /*#__PURE__*/React__default['default'].createElement(antd.SchemaMarkupField, {
12524
12572
  name: "taxRate",
@@ -12610,16 +12658,6 @@ var components = {
12610
12658
  string: antdComponents.Input,
12611
12659
  number: antdComponents.NumberPicker
12612
12660
  };
12613
- /** 提取简称 */
12614
- var getShorthand$1 = function getShorthand(value) {
12615
- if (!value) return ' ';
12616
- var arr = value.match(/\*[^*]+\*/);
12617
- if (arr) {
12618
- return arr[0].split('*')[1];
12619
- } else {
12620
- return ' ';
12621
- }
12622
- };
12623
12661
 
12624
12662
  function AddComparisonDrawer() {
12625
12663
  var _Form$useForm = ktsXui.Form.useForm(),