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/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood/index.d.ts +2 -0
- package/dist/Invoice/InvoiceController/InvoiceControllerState/index.d.ts +1 -1
- package/dist/Invoice/tools/itemName/index.d.ts +2 -0
- package/dist/Invoice/ui/GoodsList/hook/useColumns/autoFillFn/index.d.ts +2 -2
- package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/ItemNameInput/index.d.ts +1 -0
- package/dist/index.esm.js +377 -339
- package/dist/index.js +377 -339
- package/package.json +1 -1
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood/index.ts +3 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/index.ts +1 -1
- package/src/Invoice/InvoiceController/fns/saveEditGood.ts +1 -1
- package/src/Invoice/tools/itemName/index.ts +9 -0
- package/src/Invoice/ui/EndowCodeDrawer/index.tsx +3 -17
- package/src/Invoice/ui/GoodsList/hook/useColumns/autoFillFn/index.ts +90 -85
- package/src/Invoice/ui/GoodsList/hook/useColumns/index.tsx +6 -4
- package/src/Invoice/ui/GoodsList/hook/useColumns/ui/ItemNameInput/index.tsx +3 -18
- package/src/Invoice/ui/ImportGoodsDrawer/index.tsx +17 -19
package/dist/index.esm.js
CHANGED
|
@@ -935,7 +935,7 @@ var InvoiceControllerState = /*#__PURE__*/_createClass(function InvoiceControlle
|
|
|
935
935
|
this.invoiceType = '08';
|
|
936
936
|
this.buyerState = new BuyerState();
|
|
937
937
|
this.goodsListState = new GoodsListState();
|
|
938
|
-
this.
|
|
938
|
+
this.calculatingField = void 0;
|
|
939
939
|
this.calculatingDigits = void 0;
|
|
940
940
|
this.priceIntegerDigit = void 0;
|
|
941
941
|
this.rootElement = null;
|
|
@@ -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 || state.
|
|
1290
|
+
if (!(!editGood || !form || state.goodsListState.importGoods.isVisibleDrawer || state.calculatingField)) {
|
|
1291
1291
|
_context.next = 4;
|
|
1292
1292
|
break;
|
|
1293
1293
|
}
|
|
@@ -2327,39 +2327,6 @@ var evaluate = (function (expr) {
|
|
|
2327
2327
|
return parseFloat(math.evaluate(expr).toFixed(fractionDigits));
|
|
2328
2328
|
});
|
|
2329
2329
|
|
|
2330
|
-
/** 拆分全称加简称 */
|
|
2331
|
-
var getSN = function getSN(value) {
|
|
2332
|
-
if (!value) return undefined;
|
|
2333
|
-
var arr = value.match(/\*[^*]+\*/);
|
|
2334
|
-
if (arr && arr[0]) {
|
|
2335
|
-
return {
|
|
2336
|
-
shorthand: arr[0].split('*')[1],
|
|
2337
|
-
full: value.replace(arr[0], '')
|
|
2338
|
-
};
|
|
2339
|
-
} else {
|
|
2340
|
-
return {
|
|
2341
|
-
shorthand: undefined,
|
|
2342
|
-
full: value
|
|
2343
|
-
};
|
|
2344
|
-
}
|
|
2345
|
-
};
|
|
2346
|
-
/** 组合全称加简称 */
|
|
2347
|
-
var getItemName = function getItemName(value) {
|
|
2348
|
-
if (value.shorthand) {
|
|
2349
|
-
return "*".concat(value.shorthand, "*").concat(value.full);
|
|
2350
|
-
} else {
|
|
2351
|
-
return value.full;
|
|
2352
|
-
}
|
|
2353
|
-
};
|
|
2354
|
-
/** 设置简称 */
|
|
2355
|
-
var setShorthand = function setShorthand(name, shorthand) {
|
|
2356
|
-
if (!name) return undefined;
|
|
2357
|
-
var sn = getSN(name);
|
|
2358
|
-
if (!sn) return undefined;
|
|
2359
|
-
sn.shorthand = shorthand || '';
|
|
2360
|
-
return getItemName(sn);
|
|
2361
|
-
};
|
|
2362
|
-
|
|
2363
2330
|
//! moment.js
|
|
2364
2331
|
//! version : 2.29.4
|
|
2365
2332
|
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
@@ -8080,7 +8047,7 @@ var clearCalculatingField = /*#__PURE__*/function () {
|
|
|
8080
8047
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
8081
8048
|
while (1) switch (_context.prev = _context.next) {
|
|
8082
8049
|
case 0:
|
|
8083
|
-
return _context.abrupt("return", s.
|
|
8050
|
+
return _context.abrupt("return", s.calculatingField = '');
|
|
8084
8051
|
case 1:
|
|
8085
8052
|
case "end":
|
|
8086
8053
|
return _context.stop();
|
|
@@ -8145,7 +8112,7 @@ var onChangeQuantity = lazyFn(function (controller, form, record) {
|
|
|
8145
8112
|
});
|
|
8146
8113
|
// 是否含税
|
|
8147
8114
|
if (!controller.state.goodsListState.isTaxIncluded) {
|
|
8148
|
-
_context3.next =
|
|
8115
|
+
_context3.next = 36;
|
|
8149
8116
|
break;
|
|
8150
8117
|
}
|
|
8151
8118
|
if (!(!err.priceIncludeTax && values.priceIncludeTax)) {
|
|
@@ -8181,13 +8148,14 @@ var onChangeQuantity = lazyFn(function (controller, form, record) {
|
|
|
8181
8148
|
priceIncludeTax: _priceIncludeTax
|
|
8182
8149
|
});
|
|
8183
8150
|
case 32:
|
|
8184
|
-
|
|
8185
|
-
updateUnitPriceExcludingTax(controller, form);
|
|
8186
|
-
|
|
8151
|
+
_context3.next = 34;
|
|
8152
|
+
return updateUnitPriceExcludingTax(controller, form, record);
|
|
8153
|
+
case 34:
|
|
8154
|
+
_context3.next = 52;
|
|
8187
8155
|
break;
|
|
8188
|
-
case
|
|
8156
|
+
case 36:
|
|
8189
8157
|
if (!(!err.priceExcludeTax && values.priceExcludeTax)) {
|
|
8190
|
-
_context3.next =
|
|
8158
|
+
_context3.next = 44;
|
|
8191
8159
|
break;
|
|
8192
8160
|
}
|
|
8193
8161
|
priceExcludeTax = format15(values.priceExcludeTax, calculatingDigits);
|
|
@@ -8195,17 +8163,17 @@ var onChangeQuantity = lazyFn(function (controller, form, record) {
|
|
|
8195
8163
|
form.setFieldsValue({
|
|
8196
8164
|
lineAmountExcludeTax: lineAmountExcludeTax
|
|
8197
8165
|
});
|
|
8198
|
-
_context3.next =
|
|
8166
|
+
_context3.next = 42;
|
|
8199
8167
|
return controller.setEditGood({
|
|
8200
8168
|
lineAmountExcludeTax: lineAmountExcludeTax,
|
|
8201
8169
|
quantity: quantity
|
|
8202
8170
|
});
|
|
8203
|
-
case
|
|
8204
|
-
_context3.next =
|
|
8171
|
+
case 42:
|
|
8172
|
+
_context3.next = 50;
|
|
8205
8173
|
break;
|
|
8206
|
-
case
|
|
8174
|
+
case 44:
|
|
8207
8175
|
if (!(!err.lineAmountExcludeTax && values.lineAmountExcludeTax)) {
|
|
8208
|
-
_context3.next =
|
|
8176
|
+
_context3.next = 50;
|
|
8209
8177
|
break;
|
|
8210
8178
|
}
|
|
8211
8179
|
_lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
|
|
@@ -8213,18 +8181,18 @@ var onChangeQuantity = lazyFn(function (controller, form, record) {
|
|
|
8213
8181
|
form.setFieldsValue({
|
|
8214
8182
|
priceExcludeTax: _priceExcludeTax
|
|
8215
8183
|
});
|
|
8216
|
-
_context3.next =
|
|
8184
|
+
_context3.next = 50;
|
|
8217
8185
|
return controller.setEditGood({
|
|
8218
8186
|
priceExcludeTax: _priceExcludeTax,
|
|
8219
8187
|
quantity: quantity
|
|
8220
8188
|
});
|
|
8221
|
-
case 49:
|
|
8222
|
-
// 更新含税
|
|
8223
|
-
updateUnitPriceTax(controller, form);
|
|
8224
8189
|
case 50:
|
|
8225
8190
|
_context3.next = 52;
|
|
8226
|
-
return
|
|
8191
|
+
return updateUnitPriceTax(controller, form, record);
|
|
8227
8192
|
case 52:
|
|
8193
|
+
_context3.next = 54;
|
|
8194
|
+
return clearCalculatingField(controller);
|
|
8195
|
+
case 54:
|
|
8228
8196
|
case "end":
|
|
8229
8197
|
return _context3.stop();
|
|
8230
8198
|
}
|
|
@@ -8310,12 +8278,12 @@ var onChangePriceIncludeTax = lazyFn(function (controller, form, record) {
|
|
|
8310
8278
|
quantity: _quantity
|
|
8311
8279
|
});
|
|
8312
8280
|
case 30:
|
|
8313
|
-
|
|
8314
|
-
updateUnitPriceExcludingTax(controller, form);
|
|
8315
|
-
|
|
8316
|
-
_context4.next =
|
|
8281
|
+
_context4.next = 32;
|
|
8282
|
+
return updateUnitPriceExcludingTax(controller, form, record);
|
|
8283
|
+
case 32:
|
|
8284
|
+
_context4.next = 34;
|
|
8317
8285
|
return clearCalculatingField(controller);
|
|
8318
|
-
case
|
|
8286
|
+
case 34:
|
|
8319
8287
|
case "end":
|
|
8320
8288
|
return _context4.stop();
|
|
8321
8289
|
}
|
|
@@ -8401,12 +8369,12 @@ var onChangePriceExcludeTax = lazyFn(function (controller, form, record) {
|
|
|
8401
8369
|
quantity: _quantity2
|
|
8402
8370
|
});
|
|
8403
8371
|
case 30:
|
|
8404
|
-
|
|
8405
|
-
updateUnitPriceTax(controller, form);
|
|
8406
|
-
|
|
8407
|
-
_context5.next =
|
|
8372
|
+
_context5.next = 32;
|
|
8373
|
+
return updateUnitPriceTax(controller, form, record);
|
|
8374
|
+
case 32:
|
|
8375
|
+
_context5.next = 34;
|
|
8408
8376
|
return clearCalculatingField(controller);
|
|
8409
|
-
case
|
|
8377
|
+
case 34:
|
|
8410
8378
|
case "end":
|
|
8411
8379
|
return _context5.stop();
|
|
8412
8380
|
}
|
|
@@ -8427,7 +8395,7 @@ var onChangeLineAmountIncludeTax = lazyFn(function (controller, form, record) {
|
|
|
8427
8395
|
case 0:
|
|
8428
8396
|
err = err || {};
|
|
8429
8397
|
if (!(promptErr(err.lineAmountIncludeTax) || !values.lineAmountIncludeTax)) {
|
|
8430
|
-
_context6.next =
|
|
8398
|
+
_context6.next = 9;
|
|
8431
8399
|
break;
|
|
8432
8400
|
}
|
|
8433
8401
|
_context6.next = 4;
|
|
@@ -8436,25 +8404,27 @@ var onChangeLineAmountIncludeTax = lazyFn(function (controller, form, record) {
|
|
|
8436
8404
|
lineAmountExcludeTax: undefined
|
|
8437
8405
|
});
|
|
8438
8406
|
case 4:
|
|
8439
|
-
|
|
8440
|
-
|
|
8407
|
+
_context6.next = 6;
|
|
8408
|
+
return updateUnitPriceExcludingTax(controller, form, record);
|
|
8409
|
+
case 6:
|
|
8410
|
+
_context6.next = 8;
|
|
8441
8411
|
return clearCalculatingField(controller);
|
|
8442
|
-
case 7:
|
|
8443
|
-
return _context6.abrupt("return");
|
|
8444
8412
|
case 8:
|
|
8413
|
+
return _context6.abrupt("return");
|
|
8414
|
+
case 9:
|
|
8445
8415
|
calculatingDigits = controller.state.calculatingDigits;
|
|
8446
8416
|
lineAmountIncludeTax = format2(values.lineAmountIncludeTax);
|
|
8447
|
-
_context6.next =
|
|
8417
|
+
_context6.next = 13;
|
|
8448
8418
|
return controller.setEditGood({
|
|
8449
8419
|
lineAmountIncludeTax: lineAmountIncludeTax
|
|
8450
8420
|
});
|
|
8451
|
-
case
|
|
8421
|
+
case 13:
|
|
8452
8422
|
form.setFieldsValue({
|
|
8453
8423
|
lineAmountIncludeTax: lineAmountIncludeTax
|
|
8454
8424
|
});
|
|
8455
8425
|
// 是否有数量
|
|
8456
8426
|
if (!(!err.quantity && values.quantity)) {
|
|
8457
|
-
_context6.next =
|
|
8427
|
+
_context6.next = 22;
|
|
8458
8428
|
break;
|
|
8459
8429
|
}
|
|
8460
8430
|
quantity = format15(values.quantity, calculatingDigits);
|
|
@@ -8462,16 +8432,16 @@ var onChangeLineAmountIncludeTax = lazyFn(function (controller, form, record) {
|
|
|
8462
8432
|
form.setFieldsValue({
|
|
8463
8433
|
priceIncludeTax: priceIncludeTax
|
|
8464
8434
|
});
|
|
8465
|
-
_context6.next =
|
|
8435
|
+
_context6.next = 20;
|
|
8466
8436
|
return controller.setEditGood({
|
|
8467
8437
|
priceIncludeTax: priceIncludeTax
|
|
8468
8438
|
});
|
|
8469
|
-
case
|
|
8470
|
-
_context6.next =
|
|
8439
|
+
case 20:
|
|
8440
|
+
_context6.next = 28;
|
|
8471
8441
|
break;
|
|
8472
|
-
case
|
|
8442
|
+
case 22:
|
|
8473
8443
|
if (!(!err.priceIncludeTax && (values.priceIncludeTax || values.priceIncludeTax === 0))) {
|
|
8474
|
-
_context6.next =
|
|
8444
|
+
_context6.next = 28;
|
|
8475
8445
|
break;
|
|
8476
8446
|
}
|
|
8477
8447
|
_priceIncludeTax2 = format15(values.priceIncludeTax, calculatingDigits);
|
|
@@ -8479,17 +8449,17 @@ var onChangeLineAmountIncludeTax = lazyFn(function (controller, form, record) {
|
|
|
8479
8449
|
form.setFieldsValue({
|
|
8480
8450
|
quantity: _quantity3
|
|
8481
8451
|
});
|
|
8482
|
-
_context6.next =
|
|
8452
|
+
_context6.next = 28;
|
|
8483
8453
|
return controller.setEditGood({
|
|
8484
8454
|
quantity: _quantity3
|
|
8485
8455
|
});
|
|
8486
|
-
case
|
|
8487
|
-
// 更新不含税
|
|
8488
|
-
updateUnitPriceExcludingTax(controller, form);
|
|
8489
|
-
// 清楚 计算中启动字段
|
|
8456
|
+
case 28:
|
|
8490
8457
|
_context6.next = 30;
|
|
8491
|
-
return
|
|
8458
|
+
return updateUnitPriceExcludingTax(controller, form, record);
|
|
8492
8459
|
case 30:
|
|
8460
|
+
_context6.next = 32;
|
|
8461
|
+
return clearCalculatingField(controller);
|
|
8462
|
+
case 32:
|
|
8493
8463
|
case "end":
|
|
8494
8464
|
return _context6.stop();
|
|
8495
8465
|
}
|
|
@@ -8510,7 +8480,7 @@ var onChangeLineAmountExcludeTax = lazyFn(function (controller, form, record) {
|
|
|
8510
8480
|
case 0:
|
|
8511
8481
|
err = err || {};
|
|
8512
8482
|
if (!(promptErr(err.lineAmountExcludeTax) || !values.lineAmountExcludeTax)) {
|
|
8513
|
-
_context7.next =
|
|
8483
|
+
_context7.next = 9;
|
|
8514
8484
|
break;
|
|
8515
8485
|
}
|
|
8516
8486
|
_context7.next = 4;
|
|
@@ -8519,25 +8489,27 @@ var onChangeLineAmountExcludeTax = lazyFn(function (controller, form, record) {
|
|
|
8519
8489
|
lineAmountExcludeTax: undefined
|
|
8520
8490
|
});
|
|
8521
8491
|
case 4:
|
|
8522
|
-
|
|
8523
|
-
|
|
8492
|
+
_context7.next = 6;
|
|
8493
|
+
return updateUnitPriceTax(controller, form, record);
|
|
8494
|
+
case 6:
|
|
8495
|
+
_context7.next = 8;
|
|
8524
8496
|
return clearCalculatingField(controller);
|
|
8525
|
-
case 7:
|
|
8526
|
-
return _context7.abrupt("return");
|
|
8527
8497
|
case 8:
|
|
8498
|
+
return _context7.abrupt("return");
|
|
8499
|
+
case 9:
|
|
8528
8500
|
calculatingDigits = controller.state.calculatingDigits;
|
|
8529
8501
|
lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
|
|
8530
|
-
_context7.next =
|
|
8502
|
+
_context7.next = 13;
|
|
8531
8503
|
return controller.setEditGood({
|
|
8532
8504
|
lineAmountExcludeTax: lineAmountExcludeTax
|
|
8533
8505
|
});
|
|
8534
|
-
case
|
|
8506
|
+
case 13:
|
|
8535
8507
|
form.setFieldsValue({
|
|
8536
8508
|
lineAmountExcludeTax: lineAmountExcludeTax
|
|
8537
8509
|
});
|
|
8538
8510
|
// 是否有数量
|
|
8539
8511
|
if (!(!err.quantity && values.quantity)) {
|
|
8540
|
-
_context7.next =
|
|
8512
|
+
_context7.next = 22;
|
|
8541
8513
|
break;
|
|
8542
8514
|
}
|
|
8543
8515
|
quantity = format15(values.quantity, calculatingDigits);
|
|
@@ -8545,16 +8517,16 @@ var onChangeLineAmountExcludeTax = lazyFn(function (controller, form, record) {
|
|
|
8545
8517
|
form.setFieldsValue({
|
|
8546
8518
|
priceExcludeTax: priceExcludeTax
|
|
8547
8519
|
});
|
|
8548
|
-
_context7.next =
|
|
8520
|
+
_context7.next = 20;
|
|
8549
8521
|
return controller.setEditGood({
|
|
8550
8522
|
priceExcludeTax: priceExcludeTax
|
|
8551
8523
|
});
|
|
8552
|
-
case
|
|
8553
|
-
_context7.next =
|
|
8524
|
+
case 20:
|
|
8525
|
+
_context7.next = 28;
|
|
8554
8526
|
break;
|
|
8555
|
-
case
|
|
8527
|
+
case 22:
|
|
8556
8528
|
if (!(!err.priceExcludeTax && values.priceExcludeTax)) {
|
|
8557
|
-
_context7.next =
|
|
8529
|
+
_context7.next = 28;
|
|
8558
8530
|
break;
|
|
8559
8531
|
}
|
|
8560
8532
|
_priceExcludeTax2 = format15(values.priceExcludeTax, calculatingDigits);
|
|
@@ -8562,17 +8534,17 @@ var onChangeLineAmountExcludeTax = lazyFn(function (controller, form, record) {
|
|
|
8562
8534
|
form.setFieldsValue({
|
|
8563
8535
|
quantity: _quantity4
|
|
8564
8536
|
});
|
|
8565
|
-
_context7.next =
|
|
8537
|
+
_context7.next = 28;
|
|
8566
8538
|
return controller.setEditGood({
|
|
8567
8539
|
quantity: _quantity4
|
|
8568
8540
|
});
|
|
8569
|
-
case
|
|
8570
|
-
// 更新含税
|
|
8571
|
-
updateUnitPriceTax(controller, form);
|
|
8572
|
-
// 清楚 计算中启动字段
|
|
8541
|
+
case 28:
|
|
8573
8542
|
_context7.next = 30;
|
|
8574
|
-
return
|
|
8543
|
+
return updateUnitPriceTax(controller, form, record);
|
|
8575
8544
|
case 30:
|
|
8545
|
+
_context7.next = 32;
|
|
8546
|
+
return clearCalculatingField(controller);
|
|
8547
|
+
case 32:
|
|
8576
8548
|
case "end":
|
|
8577
8549
|
return _context7.stop();
|
|
8578
8550
|
}
|
|
@@ -8616,15 +8588,22 @@ var onChangeTaxRate = lazyFn(function (controller, form, record) {
|
|
|
8616
8588
|
}
|
|
8617
8589
|
})();
|
|
8618
8590
|
// 是否含税
|
|
8619
|
-
if (controller.state.goodsListState.isTaxIncluded) {
|
|
8620
|
-
|
|
8621
|
-
|
|
8622
|
-
updateUnitPriceTax(controller, form);
|
|
8591
|
+
if (!controller.state.goodsListState.isTaxIncluded) {
|
|
8592
|
+
_context8.next = 12;
|
|
8593
|
+
break;
|
|
8623
8594
|
}
|
|
8624
|
-
// 清楚 计算中启动字段
|
|
8625
8595
|
_context8.next = 10;
|
|
8626
|
-
return
|
|
8596
|
+
return updateUnitPriceExcludingTax(controller, form, record);
|
|
8627
8597
|
case 10:
|
|
8598
|
+
_context8.next = 14;
|
|
8599
|
+
break;
|
|
8600
|
+
case 12:
|
|
8601
|
+
_context8.next = 14;
|
|
8602
|
+
return updateUnitPriceTax(controller, form, record);
|
|
8603
|
+
case 14:
|
|
8604
|
+
_context8.next = 16;
|
|
8605
|
+
return clearCalculatingField(controller);
|
|
8606
|
+
case 16:
|
|
8628
8607
|
case "end":
|
|
8629
8608
|
return _context8.stop();
|
|
8630
8609
|
}
|
|
@@ -8665,265 +8644,307 @@ function dutyFree(controller, taxRate, form, record) {
|
|
|
8665
8644
|
}
|
|
8666
8645
|
}
|
|
8667
8646
|
/** 含税 => 更新(不含税) */
|
|
8668
|
-
var updateUnitPriceExcludingTax = function
|
|
8669
|
-
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
|
|
8673
|
-
|
|
8674
|
-
|
|
8675
|
-
|
|
8676
|
-
|
|
8677
|
-
|
|
8678
|
-
|
|
8679
|
-
|
|
8680
|
-
|
|
8681
|
-
|
|
8682
|
-
|
|
8683
|
-
|
|
8684
|
-
|
|
8685
|
-
|
|
8686
|
-
|
|
8687
|
-
|
|
8688
|
-
|
|
8689
|
-
|
|
8690
|
-
|
|
8691
|
-
|
|
8692
|
-
|
|
8693
|
-
|
|
8694
|
-
|
|
8695
|
-
|
|
8696
|
-
|
|
8697
|
-
|
|
8698
|
-
|
|
8699
|
-
|
|
8700
|
-
|
|
8701
|
-
|
|
8702
|
-
|
|
8703
|
-
|
|
8704
|
-
|
|
8705
|
-
|
|
8706
|
-
|
|
8707
|
-
|
|
8708
|
-
|
|
8709
|
-
|
|
8710
|
-
|
|
8711
|
-
|
|
8712
|
-
|
|
8713
|
-
|
|
8714
|
-
|
|
8715
|
-
|
|
8716
|
-
|
|
8717
|
-
|
|
8718
|
-
|
|
8719
|
-
|
|
8720
|
-
};
|
|
8647
|
+
var updateUnitPriceExcludingTax = /*#__PURE__*/function () {
|
|
8648
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(controller, form, record) {
|
|
8649
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
8650
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
8651
|
+
case 0:
|
|
8652
|
+
return _context10.abrupt("return", new Promise(function (resolve) {
|
|
8653
|
+
form.validateFields( /*#__PURE__*/function () {
|
|
8654
|
+
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(err, values) {
|
|
8655
|
+
var taxAmount, lineAmountExcludeTax, priceExcludeTax, deduction;
|
|
8656
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
8657
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
8658
|
+
case 0:
|
|
8659
|
+
err = err || {};
|
|
8660
|
+
/** 税额 */
|
|
8661
|
+
/** 扣除额 */
|
|
8662
|
+
deduction = controller.state.goodsListState.deduction; // 计算税额
|
|
8663
|
+
if (!promptErr(err.lineAmountIncludeTax) && !promptErr(err.taxRate)) {
|
|
8664
|
+
taxAmount = countTaxAmount(values.lineAmountIncludeTax, deduction, values.taxRate);
|
|
8665
|
+
}
|
|
8666
|
+
_context9.next = 5;
|
|
8667
|
+
return controller.setEditGood({
|
|
8668
|
+
taxAmount: taxAmount
|
|
8669
|
+
});
|
|
8670
|
+
case 5:
|
|
8671
|
+
// 计算 金额(不含税)
|
|
8672
|
+
if ((taxAmount || taxAmount === 0) && !promptErr(err.lineAmountIncludeTax)) {
|
|
8673
|
+
lineAmountExcludeTax = countAmountExcludeTax(values.lineAmountIncludeTax, taxAmount);
|
|
8674
|
+
}
|
|
8675
|
+
form.setFieldsValue({
|
|
8676
|
+
lineAmountExcludeTax: lineAmountExcludeTax
|
|
8677
|
+
});
|
|
8678
|
+
_context9.next = 9;
|
|
8679
|
+
return controller.setEditGood({
|
|
8680
|
+
lineAmountExcludeTax: lineAmountExcludeTax
|
|
8681
|
+
});
|
|
8682
|
+
case 9:
|
|
8683
|
+
// 单价(不含税)
|
|
8684
|
+
if (lineAmountExcludeTax && !promptErr(err.quantity)) {
|
|
8685
|
+
priceExcludeTax = countPrice(lineAmountExcludeTax, values.quantity, controller.state.calculatingDigits);
|
|
8686
|
+
}
|
|
8687
|
+
form.setFieldsValue({
|
|
8688
|
+
priceExcludeTax: priceExcludeTax
|
|
8689
|
+
});
|
|
8690
|
+
_context9.next = 13;
|
|
8691
|
+
return controller.setEditGood({
|
|
8692
|
+
priceExcludeTax: priceExcludeTax
|
|
8693
|
+
});
|
|
8694
|
+
case 13:
|
|
8695
|
+
case "end":
|
|
8696
|
+
return _context9.stop();
|
|
8697
|
+
}
|
|
8698
|
+
}, _callee9);
|
|
8699
|
+
}));
|
|
8700
|
+
return function (_x18, _x19) {
|
|
8701
|
+
return _ref10.apply(this, arguments);
|
|
8702
|
+
};
|
|
8703
|
+
}());
|
|
8704
|
+
resolve(undefined);
|
|
8705
|
+
}));
|
|
8706
|
+
case 1:
|
|
8707
|
+
case "end":
|
|
8708
|
+
return _context10.stop();
|
|
8709
|
+
}
|
|
8710
|
+
}, _callee10);
|
|
8711
|
+
}));
|
|
8712
|
+
return function updateUnitPriceExcludingTax(_x15, _x16, _x17) {
|
|
8713
|
+
return _ref9.apply(this, arguments);
|
|
8714
|
+
};
|
|
8715
|
+
}();
|
|
8721
8716
|
/** 不含税 => 更新(含税) */
|
|
8722
|
-
var updateUnitPriceTax = function
|
|
8723
|
-
|
|
8724
|
-
|
|
8725
|
-
|
|
8726
|
-
|
|
8727
|
-
|
|
8728
|
-
|
|
8729
|
-
|
|
8730
|
-
|
|
8731
|
-
|
|
8732
|
-
|
|
8733
|
-
|
|
8734
|
-
|
|
8735
|
-
|
|
8736
|
-
|
|
8737
|
-
|
|
8738
|
-
|
|
8739
|
-
|
|
8740
|
-
|
|
8741
|
-
|
|
8742
|
-
|
|
8743
|
-
|
|
8744
|
-
|
|
8745
|
-
|
|
8746
|
-
|
|
8747
|
-
|
|
8748
|
-
|
|
8749
|
-
|
|
8750
|
-
|
|
8751
|
-
|
|
8752
|
-
|
|
8753
|
-
|
|
8754
|
-
|
|
8755
|
-
|
|
8756
|
-
|
|
8757
|
-
|
|
8758
|
-
|
|
8759
|
-
|
|
8760
|
-
|
|
8761
|
-
|
|
8762
|
-
|
|
8763
|
-
|
|
8764
|
-
|
|
8765
|
-
|
|
8766
|
-
|
|
8767
|
-
|
|
8768
|
-
|
|
8769
|
-
|
|
8770
|
-
|
|
8771
|
-
|
|
8772
|
-
|
|
8773
|
-
|
|
8774
|
-
|
|
8775
|
-
|
|
8776
|
-
|
|
8777
|
-
|
|
8778
|
-
|
|
8779
|
-
|
|
8780
|
-
|
|
8781
|
-
|
|
8782
|
-
|
|
8717
|
+
var updateUnitPriceTax = /*#__PURE__*/function () {
|
|
8718
|
+
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(controller, form, record) {
|
|
8719
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
8720
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
8721
|
+
case 0:
|
|
8722
|
+
return _context12.abrupt("return", new Promise(function (resolve) {
|
|
8723
|
+
form.validateFields( /*#__PURE__*/function () {
|
|
8724
|
+
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(err, values) {
|
|
8725
|
+
var calculatingDigits, lineAmountExcludeTax, lineAmountIncludeTax, priceIncludeTax, taxAmount;
|
|
8726
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
8727
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
8728
|
+
case 0:
|
|
8729
|
+
err = err || {};
|
|
8730
|
+
if (!(!err.taxRat && (values.taxRate || values.taxRate === 0) && !promptErr(err.lineAmountExcludeTax) && (values.lineAmountExcludeTax || values.lineAmountExcludeTax === 0))) {
|
|
8731
|
+
_context11.next = 17;
|
|
8732
|
+
break;
|
|
8733
|
+
}
|
|
8734
|
+
calculatingDigits = controller.state.calculatingDigits; // 金额(含税)= 金额(不含税)* (1+ 税率)
|
|
8735
|
+
lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
|
|
8736
|
+
lineAmountIncludeTax = format2(evaluate("".concat(lineAmountExcludeTax, " * (1+(").concat(values.taxRate, "/100))")));
|
|
8737
|
+
_context11.next = 7;
|
|
8738
|
+
return controller.setEditGood({
|
|
8739
|
+
lineAmountIncludeTax: lineAmountIncludeTax
|
|
8740
|
+
});
|
|
8741
|
+
case 7:
|
|
8742
|
+
if (!(!err.quantity && values.quantity)) {
|
|
8743
|
+
_context11.next = 11;
|
|
8744
|
+
break;
|
|
8745
|
+
}
|
|
8746
|
+
priceIncludeTax = format15(evaluate("".concat(lineAmountIncludeTax, " / ").concat(values.quantity)), calculatingDigits);
|
|
8747
|
+
_context11.next = 11;
|
|
8748
|
+
return controller.setEditGood({
|
|
8749
|
+
priceIncludeTax: priceIncludeTax
|
|
8750
|
+
});
|
|
8751
|
+
case 11:
|
|
8752
|
+
// 税额 = 金额(含税)-金额(不含税)
|
|
8753
|
+
taxAmount = evaluate("".concat(lineAmountIncludeTax, " - ").concat(lineAmountExcludeTax));
|
|
8754
|
+
form.setFieldsValue({
|
|
8755
|
+
taxAmount: taxAmount
|
|
8756
|
+
});
|
|
8757
|
+
_context11.next = 15;
|
|
8758
|
+
return controller.setEditGood({
|
|
8759
|
+
taxAmount: taxAmount
|
|
8760
|
+
});
|
|
8761
|
+
case 15:
|
|
8762
|
+
_context11.next = 20;
|
|
8763
|
+
break;
|
|
8764
|
+
case 17:
|
|
8765
|
+
form.setFieldsValue({
|
|
8766
|
+
taxAmount: undefined
|
|
8767
|
+
});
|
|
8768
|
+
_context11.next = 20;
|
|
8769
|
+
return controller.setEditGood({
|
|
8770
|
+
taxAmount: undefined
|
|
8771
|
+
});
|
|
8772
|
+
case 20:
|
|
8773
|
+
// 单价(含税) = 单价(不含税) * (1+税率)
|
|
8774
|
+
// if (
|
|
8775
|
+
// !err.taxRat &&
|
|
8776
|
+
// (values.taxRate || values.taxRate === 0) &&
|
|
8777
|
+
// !promptErr(err.priceExcludeTax) &&
|
|
8778
|
+
// (values.priceExcludeTax || values.priceExcludeTax === 0)
|
|
8779
|
+
// ) {
|
|
8780
|
+
// const priceExcludeTax = format15(values.priceExcludeTax);
|
|
8781
|
+
// const priceIncludeTax = format15(evaluate(`${priceExcludeTax} * (1+(${values.taxRate}/100))`));
|
|
8782
|
+
// await controller.setEditGood({ priceIncludeTax });
|
|
8783
|
+
// }
|
|
8784
|
+
resolve(undefined);
|
|
8785
|
+
case 21:
|
|
8786
|
+
case "end":
|
|
8787
|
+
return _context11.stop();
|
|
8788
|
+
}
|
|
8789
|
+
}, _callee11);
|
|
8790
|
+
}));
|
|
8791
|
+
return function (_x23, _x24) {
|
|
8792
|
+
return _ref12.apply(this, arguments);
|
|
8793
|
+
};
|
|
8794
|
+
}());
|
|
8795
|
+
}));
|
|
8796
|
+
case 1:
|
|
8797
|
+
case "end":
|
|
8798
|
+
return _context12.stop();
|
|
8799
|
+
}
|
|
8800
|
+
}, _callee12);
|
|
8801
|
+
}));
|
|
8802
|
+
return function updateUnitPriceTax(_x20, _x21, _x22) {
|
|
8803
|
+
return _ref11.apply(this, arguments);
|
|
8804
|
+
};
|
|
8805
|
+
}();
|
|
8783
8806
|
/** 单调赋码 */
|
|
8784
8807
|
var endowCode = /*#__PURE__*/function () {
|
|
8785
|
-
var
|
|
8786
|
-
return _regeneratorRuntime().wrap(function
|
|
8787
|
-
while (1) switch (
|
|
8808
|
+
var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(controller, goods) {
|
|
8809
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
8810
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
8788
8811
|
case 0:
|
|
8789
|
-
|
|
8812
|
+
_context15.next = 2;
|
|
8790
8813
|
return controller.wait();
|
|
8791
8814
|
case 2:
|
|
8792
|
-
|
|
8815
|
+
_context15.next = 4;
|
|
8793
8816
|
return controller.saveEditGood();
|
|
8794
8817
|
case 4:
|
|
8795
|
-
|
|
8818
|
+
_context15.next = 6;
|
|
8796
8819
|
return controller.pipeline( /*#__PURE__*/function () {
|
|
8797
|
-
var
|
|
8820
|
+
var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
|
|
8798
8821
|
var _s$goodsListState$edi;
|
|
8799
8822
|
var err, key, g, i;
|
|
8800
|
-
return _regeneratorRuntime().wrap(function
|
|
8801
|
-
while (1) switch (
|
|
8823
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
8824
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
8802
8825
|
case 0:
|
|
8803
8826
|
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))) {
|
|
8804
|
-
|
|
8827
|
+
_context14.next = 11;
|
|
8805
8828
|
break;
|
|
8806
8829
|
}
|
|
8807
8830
|
err = s.goodsListState.form.getFieldsError();
|
|
8808
|
-
|
|
8831
|
+
_context14.t0 = _regeneratorRuntime().keys(err);
|
|
8809
8832
|
case 3:
|
|
8810
|
-
if ((
|
|
8811
|
-
|
|
8833
|
+
if ((_context14.t1 = _context14.t0()).done) {
|
|
8834
|
+
_context14.next = 11;
|
|
8812
8835
|
break;
|
|
8813
8836
|
}
|
|
8814
|
-
key =
|
|
8837
|
+
key = _context14.t1.value;
|
|
8815
8838
|
if (err[key]) {
|
|
8816
|
-
|
|
8839
|
+
_context14.next = 7;
|
|
8817
8840
|
break;
|
|
8818
8841
|
}
|
|
8819
|
-
return
|
|
8842
|
+
return _context14.abrupt("continue", 3);
|
|
8820
8843
|
case 7:
|
|
8821
8844
|
message.error(err[key][0]);
|
|
8822
|
-
return
|
|
8845
|
+
return _context14.abrupt("return");
|
|
8823
8846
|
case 11:
|
|
8824
8847
|
g = s.goodsListState.goodsMap.get(goods.$index);
|
|
8825
8848
|
i = s.goodsListState.goodsList.indexOf(g);
|
|
8826
|
-
|
|
8827
|
-
|
|
8849
|
+
_context14.t2 = goods.lineAttribute;
|
|
8850
|
+
_context14.next = _context14.t2 === LineAttributeType$1.正常 ? 16 : _context14.t2 === LineAttributeType$1.折扣行 ? 18 : _context14.t2 === LineAttributeType$1.被折扣行 ? 20 : 22;
|
|
8828
8851
|
break;
|
|
8829
8852
|
case 16:
|
|
8830
8853
|
s.goodsListState.endowCode.endowcodeGoodIndex = [goods.$index];
|
|
8831
|
-
return
|
|
8854
|
+
return _context14.abrupt("break", 22);
|
|
8832
8855
|
case 18:
|
|
8833
8856
|
s.goodsListState.endowCode.endowcodeGoodIndex = [goods.$index, s.goodsListState.goodsList[i - 1].$index];
|
|
8834
|
-
return
|
|
8857
|
+
return _context14.abrupt("break", 22);
|
|
8835
8858
|
case 20:
|
|
8836
8859
|
s.goodsListState.endowCode.endowcodeGoodIndex = [goods.$index, s.goodsListState.goodsList[i + 1].$index];
|
|
8837
|
-
return
|
|
8860
|
+
return _context14.abrupt("break", 22);
|
|
8838
8861
|
case 22:
|
|
8839
8862
|
case "end":
|
|
8840
|
-
return
|
|
8863
|
+
return _context14.stop();
|
|
8841
8864
|
}
|
|
8842
|
-
},
|
|
8865
|
+
}, _callee14);
|
|
8843
8866
|
}));
|
|
8844
|
-
return function (
|
|
8845
|
-
return
|
|
8867
|
+
return function (_x29) {
|
|
8868
|
+
return _ref15.apply(this, arguments);
|
|
8846
8869
|
};
|
|
8847
8870
|
}())();
|
|
8848
8871
|
case 6:
|
|
8849
8872
|
case "end":
|
|
8850
|
-
return
|
|
8873
|
+
return _context15.stop();
|
|
8851
8874
|
}
|
|
8852
|
-
},
|
|
8875
|
+
}, _callee15);
|
|
8853
8876
|
}));
|
|
8854
|
-
return function endowCode(
|
|
8855
|
-
return
|
|
8877
|
+
return function endowCode(_x27, _x28) {
|
|
8878
|
+
return _ref14.apply(this, arguments);
|
|
8856
8879
|
};
|
|
8857
8880
|
}();
|
|
8858
8881
|
/** 修改了 项目名称 */
|
|
8859
8882
|
var onChangeItemName = /*#__PURE__*/function () {
|
|
8860
|
-
var
|
|
8861
|
-
return _regeneratorRuntime().wrap(function
|
|
8862
|
-
while (1) switch (
|
|
8883
|
+
var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(controller, form, record) {
|
|
8884
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
8885
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
8863
8886
|
case 0:
|
|
8864
8887
|
controller.run( /*#__PURE__*/function () {
|
|
8865
|
-
var
|
|
8866
|
-
var
|
|
8867
|
-
|
|
8868
|
-
|
|
8869
|
-
while (1) switch (_context14.prev = _context14.next) {
|
|
8888
|
+
var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(s) {
|
|
8889
|
+
var value;
|
|
8890
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
8891
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
8870
8892
|
case 0:
|
|
8871
8893
|
value = form.getFieldsValue().itemName;
|
|
8872
|
-
shorthand = (_getSN$shorthand = (_getSN = getSN(value)) === null || _getSN === void 0 ? void 0 : _getSN.shorthand) !== null && _getSN$shorthand !== void 0 ? _getSN$shorthand : '';
|
|
8873
8894
|
if (!s.goodsListState.isMyShow) {
|
|
8874
|
-
|
|
8895
|
+
_context16.next = 10;
|
|
8875
8896
|
break;
|
|
8876
8897
|
}
|
|
8877
|
-
|
|
8898
|
+
_context16.next = 4;
|
|
8878
8899
|
return controller.setEditGood({
|
|
8879
8900
|
itemNameSelf: value
|
|
8880
8901
|
});
|
|
8881
|
-
case
|
|
8882
|
-
|
|
8883
|
-
if (!
|
|
8884
|
-
|
|
8902
|
+
case 4:
|
|
8903
|
+
_context16.t0 = record.itemName;
|
|
8904
|
+
if (!_context16.t0) {
|
|
8905
|
+
_context16.next = 8;
|
|
8885
8906
|
break;
|
|
8886
8907
|
}
|
|
8887
|
-
|
|
8908
|
+
_context16.next = 8;
|
|
8888
8909
|
return controller.setEditGood({
|
|
8889
|
-
itemName:
|
|
8910
|
+
itemName: record.itemName
|
|
8890
8911
|
});
|
|
8891
|
-
case
|
|
8892
|
-
|
|
8912
|
+
case 8:
|
|
8913
|
+
_context16.next = 16;
|
|
8893
8914
|
break;
|
|
8894
|
-
case
|
|
8895
|
-
|
|
8915
|
+
case 10:
|
|
8916
|
+
_context16.next = 12;
|
|
8896
8917
|
return controller.setEditGood({
|
|
8897
8918
|
itemName: value
|
|
8898
8919
|
});
|
|
8899
|
-
case
|
|
8900
|
-
|
|
8901
|
-
if (!
|
|
8902
|
-
|
|
8920
|
+
case 12:
|
|
8921
|
+
_context16.t1 = record.itemNameSelf;
|
|
8922
|
+
if (!_context16.t1) {
|
|
8923
|
+
_context16.next = 16;
|
|
8903
8924
|
break;
|
|
8904
8925
|
}
|
|
8905
|
-
|
|
8926
|
+
_context16.next = 16;
|
|
8906
8927
|
return controller.setEditGood({
|
|
8907
|
-
itemNameSelf:
|
|
8928
|
+
itemNameSelf: record.itemNameSelf
|
|
8908
8929
|
});
|
|
8909
|
-
case
|
|
8930
|
+
case 16:
|
|
8910
8931
|
case "end":
|
|
8911
|
-
return
|
|
8932
|
+
return _context16.stop();
|
|
8912
8933
|
}
|
|
8913
|
-
},
|
|
8934
|
+
}, _callee16);
|
|
8914
8935
|
}));
|
|
8915
|
-
return function (
|
|
8916
|
-
return
|
|
8936
|
+
return function (_x33) {
|
|
8937
|
+
return _ref17.apply(this, arguments);
|
|
8917
8938
|
};
|
|
8918
8939
|
}());
|
|
8919
8940
|
case 1:
|
|
8920
8941
|
case "end":
|
|
8921
|
-
return
|
|
8942
|
+
return _context17.stop();
|
|
8922
8943
|
}
|
|
8923
|
-
},
|
|
8944
|
+
}, _callee17);
|
|
8924
8945
|
}));
|
|
8925
|
-
return function onChangeItemName(
|
|
8926
|
-
return
|
|
8946
|
+
return function onChangeItemName(_x30, _x31, _x32) {
|
|
8947
|
+
return _ref16.apply(this, arguments);
|
|
8927
8948
|
};
|
|
8928
8949
|
}();
|
|
8929
8950
|
|
|
@@ -9063,40 +9084,50 @@ var css_248z$6 = ".kts-invoice-operate-goods-list-itemName-input {\n display: f
|
|
|
9063
9084
|
styleInject(css_248z$6);
|
|
9064
9085
|
|
|
9065
9086
|
function ItemNameInput(props) {
|
|
9066
|
-
var _getShorthand = getShorthand(props.value),
|
|
9067
|
-
shorthand = _getShorthand.shorthand,
|
|
9068
|
-
fullName = _getShorthand.fullName;
|
|
9069
9087
|
var onChange = React.useCallback(function (e) {
|
|
9070
9088
|
var event = _objectSpread2({}, e);
|
|
9071
|
-
event.target.value = shorthand ? "*".concat(shorthand, "*").concat(e.target.value) : e.target.value;
|
|
9072
9089
|
props.onChange && props.onChange(event);
|
|
9073
9090
|
}, []);
|
|
9074
9091
|
return /*#__PURE__*/React.createElement("div", {
|
|
9075
9092
|
className: 'kts-invoice-operate-goods-list-itemName-input'
|
|
9076
|
-
}, shorthand && /*#__PURE__*/React.createElement("span", {
|
|
9093
|
+
}, props.shorthand && /*#__PURE__*/React.createElement("span", {
|
|
9077
9094
|
style: {
|
|
9078
9095
|
alignSelf: 'center',
|
|
9079
9096
|
fontSize: 12
|
|
9080
9097
|
}
|
|
9081
|
-
}, "*", shorthand, "*"), /*#__PURE__*/React.createElement(Input, {
|
|
9098
|
+
}, "*", props.shorthand, "*"), /*#__PURE__*/React.createElement(Input, {
|
|
9082
9099
|
style: {
|
|
9083
9100
|
height: '100%',
|
|
9084
9101
|
border: 'none'
|
|
9085
9102
|
},
|
|
9086
|
-
value:
|
|
9103
|
+
value: props.value,
|
|
9087
9104
|
onChange: onChange
|
|
9088
9105
|
}));
|
|
9089
9106
|
}
|
|
9090
|
-
|
|
9091
|
-
|
|
9092
|
-
|
|
9107
|
+
|
|
9108
|
+
/** 拆分全称加简称 */
|
|
9109
|
+
var getSN = function getSN(value) {
|
|
9110
|
+
if (!value) return undefined;
|
|
9093
9111
|
var arr = value.match(/\*[^*]+\*/);
|
|
9094
|
-
|
|
9095
|
-
|
|
9096
|
-
|
|
9097
|
-
|
|
9098
|
-
|
|
9099
|
-
}
|
|
9112
|
+
if (arr && arr[0]) {
|
|
9113
|
+
return {
|
|
9114
|
+
shorthand: arr[0].split('*')[1],
|
|
9115
|
+
full: value.replace(arr[0], '')
|
|
9116
|
+
};
|
|
9117
|
+
} else {
|
|
9118
|
+
return {
|
|
9119
|
+
shorthand: undefined,
|
|
9120
|
+
full: value
|
|
9121
|
+
};
|
|
9122
|
+
}
|
|
9123
|
+
};
|
|
9124
|
+
/** 组合全称加简称 */
|
|
9125
|
+
var getItemNameWithShorthand = function getItemNameWithShorthand(value) {
|
|
9126
|
+
if (value.shorthand) {
|
|
9127
|
+
return "*".concat(value.shorthand, "*").concat(value.full);
|
|
9128
|
+
} else {
|
|
9129
|
+
return value.full;
|
|
9130
|
+
}
|
|
9100
9131
|
};
|
|
9101
9132
|
|
|
9102
9133
|
var useColumns = (function (form) {
|
|
@@ -9141,7 +9172,7 @@ var useColumns = (function (form) {
|
|
|
9141
9172
|
}, []);
|
|
9142
9173
|
/** 计算中启动字段 */
|
|
9143
9174
|
var changeField = controller.useMemo(function (e) {
|
|
9144
|
-
return e.
|
|
9175
|
+
return e.calculatingField;
|
|
9145
9176
|
}, []);
|
|
9146
9177
|
/** 计算中启动字段 */
|
|
9147
9178
|
var setChangeField = React.useCallback(function (value) {
|
|
@@ -9150,7 +9181,7 @@ var useColumns = (function (form) {
|
|
|
9150
9181
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9151
9182
|
while (1) switch (_context.prev = _context.next) {
|
|
9152
9183
|
case 0:
|
|
9153
|
-
s.
|
|
9184
|
+
s.calculatingField = value;
|
|
9154
9185
|
case 1:
|
|
9155
9186
|
case "end":
|
|
9156
9187
|
return _context.stop();
|
|
@@ -9238,6 +9269,7 @@ var useColumns = (function (form) {
|
|
|
9238
9269
|
}()
|
|
9239
9270
|
}])
|
|
9240
9271
|
})( /*#__PURE__*/React.createElement(ItemNameInput, {
|
|
9272
|
+
shorthand: editGood.shorthand,
|
|
9241
9273
|
onChange: function onChange() {
|
|
9242
9274
|
onChangeItemName(controller, form, record);
|
|
9243
9275
|
}
|
|
@@ -9267,8 +9299,14 @@ var useColumns = (function (form) {
|
|
|
9267
9299
|
})))));
|
|
9268
9300
|
} else {
|
|
9269
9301
|
return /*#__PURE__*/React.createElement(MyItemNameDiv, {
|
|
9270
|
-
valueT: formatSearch(
|
|
9271
|
-
|
|
9302
|
+
valueT: formatSearch(getItemNameWithShorthand({
|
|
9303
|
+
shorthand: record.shorthand,
|
|
9304
|
+
full: record.itemNameSelf || ''
|
|
9305
|
+
}), searchValue),
|
|
9306
|
+
valueF: formatSearch(getItemNameWithShorthand({
|
|
9307
|
+
shorthand: record.shorthand,
|
|
9308
|
+
full: record.itemName || ''
|
|
9309
|
+
}), searchValue),
|
|
9272
9310
|
isMyShow: isMyShow
|
|
9273
9311
|
});
|
|
9274
9312
|
}
|
|
@@ -11889,7 +11927,7 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
11889
11927
|
}
|
|
11890
11928
|
// 中间数据
|
|
11891
11929
|
between = _objectSpread2({}, record);
|
|
11892
|
-
between.itemName = getItemName
|
|
11930
|
+
between.itemName = getItemName(record, s.goodsListState.editGood);
|
|
11893
11931
|
between.itemNameOther = getItemNameOther(record, s.goodsListState.editGood);
|
|
11894
11932
|
// 设置编辑货物
|
|
11895
11933
|
editGood = s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), between);
|
|
@@ -11915,8 +11953,19 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
11915
11953
|
s.goodsListState.form.setFieldsValue(_objectSpread2({}, editGood));
|
|
11916
11954
|
}
|
|
11917
11955
|
s.goodsListState.importGoods.isVisibleDrawer = false;
|
|
11918
|
-
|
|
11919
|
-
|
|
11956
|
+
if (!s.goodsListState.isTaxIncluded) {
|
|
11957
|
+
_context2.next = 23;
|
|
11958
|
+
break;
|
|
11959
|
+
}
|
|
11960
|
+
_context2.next = 21;
|
|
11961
|
+
return updateUnitPriceExcludingTax(controller, s.goodsListState.form, record);
|
|
11962
|
+
case 21:
|
|
11963
|
+
_context2.next = 25;
|
|
11964
|
+
break;
|
|
11965
|
+
case 23:
|
|
11966
|
+
_context2.next = 25;
|
|
11967
|
+
return updateUnitPriceTax(controller, s.goodsListState.form, record);
|
|
11968
|
+
case 25:
|
|
11920
11969
|
case "end":
|
|
11921
11970
|
return _context2.stop();
|
|
11922
11971
|
}
|
|
@@ -11944,27 +11993,26 @@ var getPriceExcludeTax = function getPriceExcludeTax(s, record, calculatingDigit
|
|
|
11944
11993
|
return format15(evaluate("".concat(record.priceIncludeTax, " / (1+").concat(s.taxRate, "/100)")), calculatingDigits);
|
|
11945
11994
|
};
|
|
11946
11995
|
// 获取我方名称
|
|
11947
|
-
var getItemName
|
|
11948
|
-
|
|
11949
|
-
|
|
11950
|
-
|
|
11951
|
-
|
|
11952
|
-
|
|
11953
|
-
|
|
11954
|
-
|
|
11955
|
-
|
|
11956
|
-
|
|
11957
|
-
}
|
|
11996
|
+
var getItemName = function getItemName(record, editGood) {
|
|
11997
|
+
// let shorthand;
|
|
11998
|
+
// shorthand = record.shorthand;
|
|
11999
|
+
// if (shorthand) {
|
|
12000
|
+
// return `*${shorthand}*${record.itemName}`;
|
|
12001
|
+
// }
|
|
12002
|
+
// shorthand = getSN(editGood.itemName)?.shorthand;
|
|
12003
|
+
// if (shorthand) {
|
|
12004
|
+
// return `*${shorthand}*${record.itemNameSelf}`;
|
|
12005
|
+
// }
|
|
11958
12006
|
return record.itemName;
|
|
11959
12007
|
};
|
|
11960
12008
|
// 获取他方名称
|
|
11961
12009
|
var getItemNameOther = function getItemNameOther(record, editGood) {
|
|
11962
|
-
if (!editGood.itemName) return editGood.itemName;
|
|
11963
|
-
|
|
11964
|
-
shorthand = record.shorthand;
|
|
11965
|
-
if (shorthand) {
|
|
11966
|
-
|
|
11967
|
-
}
|
|
12010
|
+
// if (!editGood.itemName) return editGood.itemName;
|
|
12011
|
+
// let shorthand;
|
|
12012
|
+
// shorthand = record.shorthand;
|
|
12013
|
+
// if (shorthand) {
|
|
12014
|
+
// return `*${shorthand}*${record.itemNameSelf}`;
|
|
12015
|
+
// }
|
|
11968
12016
|
return record.itemName;
|
|
11969
12017
|
};
|
|
11970
12018
|
|
|
@@ -12414,8 +12462,7 @@ var DrawerBody$3 = function DrawerBody(props) {
|
|
|
12414
12462
|
}); // 赋码
|
|
12415
12463
|
endowCodeGood.forEach(function (good) {
|
|
12416
12464
|
if (!good) return;
|
|
12417
|
-
good.
|
|
12418
|
-
good.itemNameSelf = setShorthand(good.itemNameSelf, values.shorthand);
|
|
12465
|
+
good.shorthand = values.shorthand;
|
|
12419
12466
|
good.taxClassificationCode = values.taxClassificationCode;
|
|
12420
12467
|
good.taxRate = values.taxRate;
|
|
12421
12468
|
good.taxFreeType = values.taxFreeType;
|
|
@@ -12490,6 +12537,7 @@ var DrawerBody$3 = function DrawerBody(props) {
|
|
|
12490
12537
|
}, [controller]);
|
|
12491
12538
|
return /*#__PURE__*/React.createElement(SchemaForm, {
|
|
12492
12539
|
actions: actions,
|
|
12540
|
+
previewPlaceholder: " ",
|
|
12493
12541
|
components: _objectSpread2(_objectSpread2({}, components), {}, {
|
|
12494
12542
|
showSearch: !!controller.state.goodsListState.endowCode.getTaxCategoryCodeTree ? ShowSearch2 : ShowSearch
|
|
12495
12543
|
}),
|
|
@@ -12508,7 +12556,7 @@ var DrawerBody$3 = function DrawerBody(props) {
|
|
|
12508
12556
|
name: "shorthand",
|
|
12509
12557
|
type: "string",
|
|
12510
12558
|
readOnly: true,
|
|
12511
|
-
default:
|
|
12559
|
+
default: defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.shorthand,
|
|
12512
12560
|
title: "\u5546\u54C1\u548C\u670D\u52A1\u5206\u7C7B\u7B80\u79F0"
|
|
12513
12561
|
}), /*#__PURE__*/React.createElement(SchemaMarkupField, {
|
|
12514
12562
|
name: "taxRate",
|
|
@@ -12600,16 +12648,6 @@ var components = {
|
|
|
12600
12648
|
string: Input$1,
|
|
12601
12649
|
number: NumberPicker
|
|
12602
12650
|
};
|
|
12603
|
-
/** 提取简称 */
|
|
12604
|
-
var getShorthand$1 = function getShorthand(value) {
|
|
12605
|
-
if (!value) return ' ';
|
|
12606
|
-
var arr = value.match(/\*[^*]+\*/);
|
|
12607
|
-
if (arr) {
|
|
12608
|
-
return arr[0].split('*')[1];
|
|
12609
|
-
} else {
|
|
12610
|
-
return ' ';
|
|
12611
|
-
}
|
|
12612
|
-
};
|
|
12613
12651
|
|
|
12614
12652
|
function AddComparisonDrawer() {
|
|
12615
12653
|
var _Form$useForm = Form$1.useForm(),
|