kts-component-invoice-operate 1.2.17 → 1.2.20
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/EndowCode.d.ts +3 -1
- package/dist/Invoice/InvoiceController/InvoiceControllerState/index.d.ts +8 -0
- package/dist/Invoice/ui/GoodsList/hook/useColumns/autoFillFn/index.d.ts +2 -0
- package/dist/index.esm.js +88 -56
- package/dist/index.js +88 -56
- package/docs/index.md +1 -1
- package/docs-dist/umi.css +1 -1
- package/docs-dist/umi.js +1 -1
- package/package.json +1 -1
- package/src/Invoice/InvoiceController/InvoiceControllerForm/index.ts +3 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/EndowCode.tsx +3 -1
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/ImportGoods.ts +5 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/index.ts +10 -1
- package/src/Invoice/_test/importGoods/index.tsx +4 -7
- package/src/Invoice/ui/GoodsList/hook/useColumns/autoFillFn/index.ts +48 -24
- package/src/Invoice/ui/ImportGoodsDrawer/index.tsx +7 -4
|
@@ -11,6 +11,14 @@ export default class InvoiceControllerState {
|
|
|
11
11
|
* 08 小规模纳税人
|
|
12
12
|
* */
|
|
13
13
|
en: '01' | '05' | '04' | '08';
|
|
14
|
+
/**
|
|
15
|
+
* 发票类型
|
|
16
|
+
* 08 - 增值税电子专用发票
|
|
17
|
+
* 10 - 增值税电子普通发票
|
|
18
|
+
* 01 - 增值税纸质专用发票
|
|
19
|
+
* 04 - 增值税纸质普通发票
|
|
20
|
+
*/
|
|
21
|
+
invoiceType: '08' | '10' | '01' | '04';
|
|
14
22
|
/** 购买方 */
|
|
15
23
|
buyerState: BuyerState;
|
|
16
24
|
/** 货物信息 */
|
|
@@ -19,6 +19,8 @@ export declare const onChangeLineAmountIncludeTax: (...par: any[]) => void;
|
|
|
19
19
|
export declare const onChangeLineAmountExcludeTax: (...par: any[]) => void;
|
|
20
20
|
/** 税率 */
|
|
21
21
|
export declare const onChangeTaxRate: (...par: any[]) => void;
|
|
22
|
+
/** 小规模纳税人 1% 和 3% 自动赋码免税 */
|
|
23
|
+
export declare function dutyFree(controller: InvoiceController, taxRate: number, form: WrappedFormUtils<any>, record: IGood): number | undefined;
|
|
22
24
|
/** 含税 => 更新(不含税) */
|
|
23
25
|
export declare const updateUnitPriceExcludingTax: (controller: InvoiceController, form: WrappedFormUtils, record: IGood) => void;
|
|
24
26
|
/** 不含税 => 更新(含税) */
|
package/dist/index.esm.js
CHANGED
|
@@ -354,54 +354,58 @@ var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
|
|
|
354
354
|
while (1) {
|
|
355
355
|
switch (_context.prev = _context.next) {
|
|
356
356
|
case 0:
|
|
357
|
+
_context.next = 2;
|
|
358
|
+
return this.wait();
|
|
359
|
+
|
|
360
|
+
case 2:
|
|
357
361
|
_errors = new Map();
|
|
358
362
|
_values = new Map();
|
|
359
363
|
arr = Array.from(this.formList);
|
|
360
364
|
i = 0;
|
|
361
365
|
|
|
362
|
-
case
|
|
366
|
+
case 6:
|
|
363
367
|
if (!(i < arr.length)) {
|
|
364
|
-
_context.next =
|
|
368
|
+
_context.next = 18;
|
|
365
369
|
break;
|
|
366
370
|
}
|
|
367
371
|
|
|
368
372
|
key = arr[i][0];
|
|
369
|
-
_context.next =
|
|
373
|
+
_context.next = 10;
|
|
370
374
|
return _validateFields(arr[i][1]);
|
|
371
375
|
|
|
372
|
-
case
|
|
376
|
+
case 10:
|
|
373
377
|
_yield$_validateField = _context.sent;
|
|
374
378
|
errors = _yield$_validateField.errors;
|
|
375
379
|
values = _yield$_validateField.values;
|
|
376
380
|
errors && _errors.set(key, errors);
|
|
377
381
|
_values && _values.set(key, values);
|
|
378
382
|
|
|
379
|
-
case
|
|
383
|
+
case 15:
|
|
380
384
|
i++;
|
|
381
|
-
_context.next =
|
|
385
|
+
_context.next = 6;
|
|
382
386
|
break;
|
|
383
387
|
|
|
384
|
-
case
|
|
388
|
+
case 18:
|
|
385
389
|
if (!this.state.goodsListState.form) {
|
|
386
|
-
_context.next =
|
|
390
|
+
_context.next = 27;
|
|
387
391
|
break;
|
|
388
392
|
}
|
|
389
393
|
|
|
390
|
-
_context.prev =
|
|
391
|
-
_context.next =
|
|
394
|
+
_context.prev = 19;
|
|
395
|
+
_context.next = 22;
|
|
392
396
|
return (_this$state$goodsList = this.state.goodsListState.form) === null || _this$state$goodsList === void 0 ? void 0 : _this$state$goodsList.validateFields();
|
|
393
397
|
|
|
394
|
-
case
|
|
395
|
-
_context.next =
|
|
398
|
+
case 22:
|
|
399
|
+
_context.next = 27;
|
|
396
400
|
break;
|
|
397
401
|
|
|
398
|
-
case
|
|
399
|
-
_context.prev =
|
|
400
|
-
_context.t0 = _context["catch"](
|
|
402
|
+
case 24:
|
|
403
|
+
_context.prev = 24;
|
|
404
|
+
_context.t0 = _context["catch"](19);
|
|
401
405
|
|
|
402
406
|
_errors.set('goodsList', _context.t0.errors);
|
|
403
407
|
|
|
404
|
-
case
|
|
408
|
+
case 27:
|
|
405
409
|
_values.set('goodsList', this.state.goodsListState.goodsList.slice()); // 金额(含税)
|
|
406
410
|
|
|
407
411
|
|
|
@@ -445,12 +449,12 @@ var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
|
|
|
445
449
|
values: _values
|
|
446
450
|
});
|
|
447
451
|
|
|
448
|
-
case
|
|
452
|
+
case 32:
|
|
449
453
|
case "end":
|
|
450
454
|
return _context.stop();
|
|
451
455
|
}
|
|
452
456
|
}
|
|
453
|
-
}, _callee, this, [[
|
|
457
|
+
}, _callee, this, [[19, 24]]);
|
|
454
458
|
}));
|
|
455
459
|
|
|
456
460
|
function validateFields() {
|
|
@@ -498,6 +502,10 @@ var ImportGoods = function ImportGoods() {
|
|
|
498
502
|
title: '计量单位',
|
|
499
503
|
dataIndex: 'unit',
|
|
500
504
|
key: 'unit'
|
|
505
|
+
}, {
|
|
506
|
+
title: '税率(%)',
|
|
507
|
+
dataIndex: 'taxRate',
|
|
508
|
+
key: 'taxRate'
|
|
501
509
|
}, {
|
|
502
510
|
title: '单价(含税)',
|
|
503
511
|
dataIndex: 'priceIncludeTax',
|
|
@@ -707,6 +715,7 @@ var InvoiceControllerState = function InvoiceControllerState() {
|
|
|
707
715
|
|
|
708
716
|
this.model = 'default';
|
|
709
717
|
this.en = '01';
|
|
718
|
+
this.invoiceType = '08';
|
|
710
719
|
this.buyerState = new BuyerState();
|
|
711
720
|
this.goodsListState = new GoodsListState();
|
|
712
721
|
};
|
|
@@ -8786,15 +8795,26 @@ var onChangeTaxRate = lazyFn$1(function (controller, form, record) {
|
|
|
8786
8795
|
|
|
8787
8796
|
case 3:
|
|
8788
8797
|
taxRate = parseFloat(values.taxRate);
|
|
8789
|
-
|
|
8790
|
-
|
|
8791
|
-
_context6.next = 7;
|
|
8798
|
+
_context6.next = 6;
|
|
8792
8799
|
return controller.setEditGood({
|
|
8793
8800
|
taxRate: taxRate
|
|
8794
8801
|
});
|
|
8795
8802
|
|
|
8796
|
-
case
|
|
8797
|
-
//
|
|
8803
|
+
case 6:
|
|
8804
|
+
// 去掉赋码
|
|
8805
|
+
(function () {
|
|
8806
|
+
var cache = controller.state.goodsListState.endowCode.cache;
|
|
8807
|
+
var record = controller.state.goodsListState.editGood;
|
|
8808
|
+
|
|
8809
|
+
if (record && cache[record.$index]) {
|
|
8810
|
+
record.favouredPolicyName = cache[record.$index].favouredPolicyName;
|
|
8811
|
+
record.favouredPolicyMark = cache[record.$index].favouredPolicyMark;
|
|
8812
|
+
record.taxFreeType = cache[record.$index].taxFreeType;
|
|
8813
|
+
cache[record.$index] = undefined;
|
|
8814
|
+
}
|
|
8815
|
+
})(); // 是否含税
|
|
8816
|
+
|
|
8817
|
+
|
|
8798
8818
|
if (controller.state.goodsListState.isTaxIncluded) {
|
|
8799
8819
|
updateUnitPriceExcludingTax(controller, form);
|
|
8800
8820
|
} else {
|
|
@@ -8817,44 +8837,54 @@ var onChangeTaxRate = lazyFn$1(function (controller, form, record) {
|
|
|
8817
8837
|
/** 小规模纳税人 1% 和 3% 自动赋码免税 */
|
|
8818
8838
|
|
|
8819
8839
|
function dutyFree(controller, taxRate, form, record) {
|
|
8820
|
-
var cache = controller.state.goodsListState.endowCode.cache;
|
|
8840
|
+
var cache = controller.state.goodsListState.endowCode.cache;
|
|
8841
|
+
var invoiceType = controller.state.invoiceType; // 4月1日至12月31日
|
|
8821
8842
|
|
|
8822
8843
|
if (hooks().valueOf() > hooks('2022-12-31 23:59').valueOf()) return taxRate;
|
|
8823
|
-
if (controller.state.en !== '08') return taxRate;
|
|
8844
|
+
if (controller.state.en !== '08') return taxRate;
|
|
8845
|
+
if (invoiceType !== '10' && invoiceType !== '04') return taxRate;
|
|
8824
8846
|
|
|
8825
8847
|
if (taxRate === 1 || taxRate === 3) {
|
|
8826
|
-
|
|
8827
|
-
|
|
8828
|
-
|
|
8829
|
-
|
|
8830
|
-
|
|
8831
|
-
|
|
8832
|
-
|
|
8833
|
-
|
|
8834
|
-
|
|
8835
|
-
|
|
8836
|
-
|
|
8837
|
-
|
|
8838
|
-
|
|
8839
|
-
|
|
8840
|
-
|
|
8841
|
-
|
|
8842
|
-
|
|
8843
|
-
|
|
8844
|
-
} else {
|
|
8845
|
-
|
|
8846
|
-
|
|
8847
|
-
|
|
8848
|
-
|
|
8849
|
-
|
|
8850
|
-
|
|
8848
|
+
cache[record.$index] = {
|
|
8849
|
+
favouredPolicyName: record.favouredPolicyName,
|
|
8850
|
+
favouredPolicyMark: record.favouredPolicyMark,
|
|
8851
|
+
taxFreeType: record.taxFreeType
|
|
8852
|
+
};
|
|
8853
|
+
record.favouredPolicyName = '免税';
|
|
8854
|
+
record.taxRate = 0;
|
|
8855
|
+
record.favouredPolicyMark = 1;
|
|
8856
|
+
record.taxFreeType = 1;
|
|
8857
|
+
form.setFieldsValue({
|
|
8858
|
+
taxRate: 0
|
|
8859
|
+
});
|
|
8860
|
+
return 0;
|
|
8861
|
+
} // 选择的 1或者3
|
|
8862
|
+
// if (taxRate === 1 || taxRate === 3) {
|
|
8863
|
+
// 是否处理过
|
|
8864
|
+
// if (cache[record.$index]) {
|
|
8865
|
+
// return taxRate;
|
|
8866
|
+
// } else {
|
|
8867
|
+
// cache[record.$index] = { favouredPolicyName: record.favouredPolicyName, favouredPolicyMark: record.favouredPolicyMark,taxFreeType:record.taxFreeType }
|
|
8868
|
+
// record.favouredPolicyName = '免税';
|
|
8869
|
+
// record.taxRate = 0;
|
|
8870
|
+
// record.favouredPolicyMark = 1;
|
|
8871
|
+
// record.taxFreeType = 1 as any;
|
|
8872
|
+
// form.setFieldsValue({ taxRate: 0 });
|
|
8873
|
+
// return 0;
|
|
8874
|
+
// }
|
|
8875
|
+
// } else {
|
|
8876
|
+
// if (cache[record.$index] && cache[record.$index] !== true) {
|
|
8877
|
+
// record.favouredPolicyName = cache[record.$index].favouredPolicyName;
|
|
8878
|
+
// record.favouredPolicyMark = cache[record.$index].favouredPolicyMark;
|
|
8879
|
+
// record.taxFreeType = cache[record.$index].taxFreeType;
|
|
8880
|
+
// cache[record.$index] = true;
|
|
8881
|
+
// }
|
|
8882
|
+
// return taxRate;
|
|
8883
|
+
// }
|
|
8851
8884
|
|
|
8852
|
-
return taxRate;
|
|
8853
|
-
}
|
|
8854
8885
|
}
|
|
8855
8886
|
/** 含税 => 更新(不含税) */
|
|
8856
8887
|
|
|
8857
|
-
|
|
8858
8888
|
var updateUnitPriceExcludingTax = function updateUnitPriceExcludingTax(controller, form, record) {
|
|
8859
8889
|
form.validateFields( /*#__PURE__*/function () {
|
|
8860
8890
|
var _ref7 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(err, values) {
|
|
@@ -11362,7 +11392,7 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
11362
11392
|
onRow: function onRow(record) {
|
|
11363
11393
|
return {
|
|
11364
11394
|
onClick: function onClick() {
|
|
11365
|
-
controller.
|
|
11395
|
+
controller.run( /*#__PURE__*/function () {
|
|
11366
11396
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(s) {
|
|
11367
11397
|
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
11368
11398
|
while (1) {
|
|
@@ -11412,6 +11442,8 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
11412
11442
|
return _context2.abrupt("return");
|
|
11413
11443
|
|
|
11414
11444
|
case 12:
|
|
11445
|
+
if (s.goodsListState.editGood.taxRate) s.goodsListState.editGood.taxRate = dutyFree(controller, s.goodsListState.editGood.taxRate, s.goodsListState.form, s.goodsListState.editGood);
|
|
11446
|
+
|
|
11415
11447
|
if ("".concat(s.goodsListState.editGood.priceIncludeTax) === '0') {
|
|
11416
11448
|
s.goodsListState.editGood.priceIncludeTax = undefined;
|
|
11417
11449
|
s.goodsListState.editGood.priceExcludeTax = undefined;
|
|
@@ -11425,7 +11457,7 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
11425
11457
|
s.goodsListState.importGoods.isVisibleDrawer = false;
|
|
11426
11458
|
s.goodsListState.isTaxIncluded ? updateUnitPriceExcludingTax(controller, s.goodsListState.form) : updateUnitPriceTax(controller, s.goodsListState.form);
|
|
11427
11459
|
|
|
11428
|
-
case
|
|
11460
|
+
case 19:
|
|
11429
11461
|
case "end":
|
|
11430
11462
|
return _context2.stop();
|
|
11431
11463
|
}
|
|
@@ -11436,7 +11468,7 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
11436
11468
|
return function (_x2) {
|
|
11437
11469
|
return _ref2.apply(this, arguments);
|
|
11438
11470
|
};
|
|
11439
|
-
}())
|
|
11471
|
+
}());
|
|
11440
11472
|
}
|
|
11441
11473
|
};
|
|
11442
11474
|
}
|
package/dist/index.js
CHANGED
|
@@ -364,54 +364,58 @@ var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
|
|
|
364
364
|
while (1) {
|
|
365
365
|
switch (_context.prev = _context.next) {
|
|
366
366
|
case 0:
|
|
367
|
+
_context.next = 2;
|
|
368
|
+
return this.wait();
|
|
369
|
+
|
|
370
|
+
case 2:
|
|
367
371
|
_errors = new Map();
|
|
368
372
|
_values = new Map();
|
|
369
373
|
arr = Array.from(this.formList);
|
|
370
374
|
i = 0;
|
|
371
375
|
|
|
372
|
-
case
|
|
376
|
+
case 6:
|
|
373
377
|
if (!(i < arr.length)) {
|
|
374
|
-
_context.next =
|
|
378
|
+
_context.next = 18;
|
|
375
379
|
break;
|
|
376
380
|
}
|
|
377
381
|
|
|
378
382
|
key = arr[i][0];
|
|
379
|
-
_context.next =
|
|
383
|
+
_context.next = 10;
|
|
380
384
|
return _validateFields(arr[i][1]);
|
|
381
385
|
|
|
382
|
-
case
|
|
386
|
+
case 10:
|
|
383
387
|
_yield$_validateField = _context.sent;
|
|
384
388
|
errors = _yield$_validateField.errors;
|
|
385
389
|
values = _yield$_validateField.values;
|
|
386
390
|
errors && _errors.set(key, errors);
|
|
387
391
|
_values && _values.set(key, values);
|
|
388
392
|
|
|
389
|
-
case
|
|
393
|
+
case 15:
|
|
390
394
|
i++;
|
|
391
|
-
_context.next =
|
|
395
|
+
_context.next = 6;
|
|
392
396
|
break;
|
|
393
397
|
|
|
394
|
-
case
|
|
398
|
+
case 18:
|
|
395
399
|
if (!this.state.goodsListState.form) {
|
|
396
|
-
_context.next =
|
|
400
|
+
_context.next = 27;
|
|
397
401
|
break;
|
|
398
402
|
}
|
|
399
403
|
|
|
400
|
-
_context.prev =
|
|
401
|
-
_context.next =
|
|
404
|
+
_context.prev = 19;
|
|
405
|
+
_context.next = 22;
|
|
402
406
|
return (_this$state$goodsList = this.state.goodsListState.form) === null || _this$state$goodsList === void 0 ? void 0 : _this$state$goodsList.validateFields();
|
|
403
407
|
|
|
404
|
-
case
|
|
405
|
-
_context.next =
|
|
408
|
+
case 22:
|
|
409
|
+
_context.next = 27;
|
|
406
410
|
break;
|
|
407
411
|
|
|
408
|
-
case
|
|
409
|
-
_context.prev =
|
|
410
|
-
_context.t0 = _context["catch"](
|
|
412
|
+
case 24:
|
|
413
|
+
_context.prev = 24;
|
|
414
|
+
_context.t0 = _context["catch"](19);
|
|
411
415
|
|
|
412
416
|
_errors.set('goodsList', _context.t0.errors);
|
|
413
417
|
|
|
414
|
-
case
|
|
418
|
+
case 27:
|
|
415
419
|
_values.set('goodsList', this.state.goodsListState.goodsList.slice()); // 金额(含税)
|
|
416
420
|
|
|
417
421
|
|
|
@@ -455,12 +459,12 @@ var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
|
|
|
455
459
|
values: _values
|
|
456
460
|
});
|
|
457
461
|
|
|
458
|
-
case
|
|
462
|
+
case 32:
|
|
459
463
|
case "end":
|
|
460
464
|
return _context.stop();
|
|
461
465
|
}
|
|
462
466
|
}
|
|
463
|
-
}, _callee, this, [[
|
|
467
|
+
}, _callee, this, [[19, 24]]);
|
|
464
468
|
}));
|
|
465
469
|
|
|
466
470
|
function validateFields() {
|
|
@@ -508,6 +512,10 @@ var ImportGoods = function ImportGoods() {
|
|
|
508
512
|
title: '计量单位',
|
|
509
513
|
dataIndex: 'unit',
|
|
510
514
|
key: 'unit'
|
|
515
|
+
}, {
|
|
516
|
+
title: '税率(%)',
|
|
517
|
+
dataIndex: 'taxRate',
|
|
518
|
+
key: 'taxRate'
|
|
511
519
|
}, {
|
|
512
520
|
title: '单价(含税)',
|
|
513
521
|
dataIndex: 'priceIncludeTax',
|
|
@@ -717,6 +725,7 @@ var InvoiceControllerState = function InvoiceControllerState() {
|
|
|
717
725
|
|
|
718
726
|
this.model = 'default';
|
|
719
727
|
this.en = '01';
|
|
728
|
+
this.invoiceType = '08';
|
|
720
729
|
this.buyerState = new BuyerState();
|
|
721
730
|
this.goodsListState = new GoodsListState();
|
|
722
731
|
};
|
|
@@ -8796,15 +8805,26 @@ var onChangeTaxRate = lazyFn$1(function (controller, form, record) {
|
|
|
8796
8805
|
|
|
8797
8806
|
case 3:
|
|
8798
8807
|
taxRate = parseFloat(values.taxRate);
|
|
8799
|
-
|
|
8800
|
-
|
|
8801
|
-
_context6.next = 7;
|
|
8808
|
+
_context6.next = 6;
|
|
8802
8809
|
return controller.setEditGood({
|
|
8803
8810
|
taxRate: taxRate
|
|
8804
8811
|
});
|
|
8805
8812
|
|
|
8806
|
-
case
|
|
8807
|
-
//
|
|
8813
|
+
case 6:
|
|
8814
|
+
// 去掉赋码
|
|
8815
|
+
(function () {
|
|
8816
|
+
var cache = controller.state.goodsListState.endowCode.cache;
|
|
8817
|
+
var record = controller.state.goodsListState.editGood;
|
|
8818
|
+
|
|
8819
|
+
if (record && cache[record.$index]) {
|
|
8820
|
+
record.favouredPolicyName = cache[record.$index].favouredPolicyName;
|
|
8821
|
+
record.favouredPolicyMark = cache[record.$index].favouredPolicyMark;
|
|
8822
|
+
record.taxFreeType = cache[record.$index].taxFreeType;
|
|
8823
|
+
cache[record.$index] = undefined;
|
|
8824
|
+
}
|
|
8825
|
+
})(); // 是否含税
|
|
8826
|
+
|
|
8827
|
+
|
|
8808
8828
|
if (controller.state.goodsListState.isTaxIncluded) {
|
|
8809
8829
|
updateUnitPriceExcludingTax(controller, form);
|
|
8810
8830
|
} else {
|
|
@@ -8827,44 +8847,54 @@ var onChangeTaxRate = lazyFn$1(function (controller, form, record) {
|
|
|
8827
8847
|
/** 小规模纳税人 1% 和 3% 自动赋码免税 */
|
|
8828
8848
|
|
|
8829
8849
|
function dutyFree(controller, taxRate, form, record) {
|
|
8830
|
-
var cache = controller.state.goodsListState.endowCode.cache;
|
|
8850
|
+
var cache = controller.state.goodsListState.endowCode.cache;
|
|
8851
|
+
var invoiceType = controller.state.invoiceType; // 4月1日至12月31日
|
|
8831
8852
|
|
|
8832
8853
|
if (hooks().valueOf() > hooks('2022-12-31 23:59').valueOf()) return taxRate;
|
|
8833
|
-
if (controller.state.en !== '08') return taxRate;
|
|
8854
|
+
if (controller.state.en !== '08') return taxRate;
|
|
8855
|
+
if (invoiceType !== '10' && invoiceType !== '04') return taxRate;
|
|
8834
8856
|
|
|
8835
8857
|
if (taxRate === 1 || taxRate === 3) {
|
|
8836
|
-
|
|
8837
|
-
|
|
8838
|
-
|
|
8839
|
-
|
|
8840
|
-
|
|
8841
|
-
|
|
8842
|
-
|
|
8843
|
-
|
|
8844
|
-
|
|
8845
|
-
|
|
8846
|
-
|
|
8847
|
-
|
|
8848
|
-
|
|
8849
|
-
|
|
8850
|
-
|
|
8851
|
-
|
|
8852
|
-
|
|
8853
|
-
|
|
8854
|
-
} else {
|
|
8855
|
-
|
|
8856
|
-
|
|
8857
|
-
|
|
8858
|
-
|
|
8859
|
-
|
|
8860
|
-
|
|
8858
|
+
cache[record.$index] = {
|
|
8859
|
+
favouredPolicyName: record.favouredPolicyName,
|
|
8860
|
+
favouredPolicyMark: record.favouredPolicyMark,
|
|
8861
|
+
taxFreeType: record.taxFreeType
|
|
8862
|
+
};
|
|
8863
|
+
record.favouredPolicyName = '免税';
|
|
8864
|
+
record.taxRate = 0;
|
|
8865
|
+
record.favouredPolicyMark = 1;
|
|
8866
|
+
record.taxFreeType = 1;
|
|
8867
|
+
form.setFieldsValue({
|
|
8868
|
+
taxRate: 0
|
|
8869
|
+
});
|
|
8870
|
+
return 0;
|
|
8871
|
+
} // 选择的 1或者3
|
|
8872
|
+
// if (taxRate === 1 || taxRate === 3) {
|
|
8873
|
+
// 是否处理过
|
|
8874
|
+
// if (cache[record.$index]) {
|
|
8875
|
+
// return taxRate;
|
|
8876
|
+
// } else {
|
|
8877
|
+
// cache[record.$index] = { favouredPolicyName: record.favouredPolicyName, favouredPolicyMark: record.favouredPolicyMark,taxFreeType:record.taxFreeType }
|
|
8878
|
+
// record.favouredPolicyName = '免税';
|
|
8879
|
+
// record.taxRate = 0;
|
|
8880
|
+
// record.favouredPolicyMark = 1;
|
|
8881
|
+
// record.taxFreeType = 1 as any;
|
|
8882
|
+
// form.setFieldsValue({ taxRate: 0 });
|
|
8883
|
+
// return 0;
|
|
8884
|
+
// }
|
|
8885
|
+
// } else {
|
|
8886
|
+
// if (cache[record.$index] && cache[record.$index] !== true) {
|
|
8887
|
+
// record.favouredPolicyName = cache[record.$index].favouredPolicyName;
|
|
8888
|
+
// record.favouredPolicyMark = cache[record.$index].favouredPolicyMark;
|
|
8889
|
+
// record.taxFreeType = cache[record.$index].taxFreeType;
|
|
8890
|
+
// cache[record.$index] = true;
|
|
8891
|
+
// }
|
|
8892
|
+
// return taxRate;
|
|
8893
|
+
// }
|
|
8861
8894
|
|
|
8862
|
-
return taxRate;
|
|
8863
|
-
}
|
|
8864
8895
|
}
|
|
8865
8896
|
/** 含税 => 更新(不含税) */
|
|
8866
8897
|
|
|
8867
|
-
|
|
8868
8898
|
var updateUnitPriceExcludingTax = function updateUnitPriceExcludingTax(controller, form, record) {
|
|
8869
8899
|
form.validateFields( /*#__PURE__*/function () {
|
|
8870
8900
|
var _ref7 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(err, values) {
|
|
@@ -11372,7 +11402,7 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
11372
11402
|
onRow: function onRow(record) {
|
|
11373
11403
|
return {
|
|
11374
11404
|
onClick: function onClick() {
|
|
11375
|
-
controller.
|
|
11405
|
+
controller.run( /*#__PURE__*/function () {
|
|
11376
11406
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(s) {
|
|
11377
11407
|
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
11378
11408
|
while (1) {
|
|
@@ -11422,6 +11452,8 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
11422
11452
|
return _context2.abrupt("return");
|
|
11423
11453
|
|
|
11424
11454
|
case 12:
|
|
11455
|
+
if (s.goodsListState.editGood.taxRate) s.goodsListState.editGood.taxRate = dutyFree(controller, s.goodsListState.editGood.taxRate, s.goodsListState.form, s.goodsListState.editGood);
|
|
11456
|
+
|
|
11425
11457
|
if ("".concat(s.goodsListState.editGood.priceIncludeTax) === '0') {
|
|
11426
11458
|
s.goodsListState.editGood.priceIncludeTax = undefined;
|
|
11427
11459
|
s.goodsListState.editGood.priceExcludeTax = undefined;
|
|
@@ -11435,7 +11467,7 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
11435
11467
|
s.goodsListState.importGoods.isVisibleDrawer = false;
|
|
11436
11468
|
s.goodsListState.isTaxIncluded ? updateUnitPriceExcludingTax(controller, s.goodsListState.form) : updateUnitPriceTax(controller, s.goodsListState.form);
|
|
11437
11469
|
|
|
11438
|
-
case
|
|
11470
|
+
case 19:
|
|
11439
11471
|
case "end":
|
|
11440
11472
|
return _context2.stop();
|
|
11441
11473
|
}
|
|
@@ -11446,7 +11478,7 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
11446
11478
|
return function (_x2) {
|
|
11447
11479
|
return _ref2.apply(this, arguments);
|
|
11448
11480
|
};
|
|
11449
|
-
}())
|
|
11481
|
+
}());
|
|
11450
11482
|
}
|
|
11451
11483
|
};
|
|
11452
11484
|
}
|
package/docs/index.md
CHANGED