kts-component-invoice-operate 3.1.6 → 3.1.8

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.
@@ -37,6 +37,8 @@ export default class EndowCode {
37
37
  };
38
38
  /** 优惠政策类型列表 */
39
39
  favouredPolicyNameList: string[];
40
+ /** 免税类型 是否需要 */
41
+ isTaxFreeTypeNeeded: boolean;
40
42
  /** 免税类型 列表 */
41
43
  taxFreeTypeList: any[];
42
44
  /**
package/dist/index.esm.js CHANGED
@@ -815,6 +815,7 @@ var EndowCode = /*#__PURE__*/_createClass(function EndowCode() {
815
815
  DRAFT: draft
816
816
  };
817
817
  this.favouredPolicyNameList = ['100%先征后退', '即征即退30%', '即征即退50%', '即征即退70%', '按3%简易征收', '按5%简易征收', '按3%简易征收减按1.5%计征', '稀土产品', '简易征收', '50%先征后退', '不征税', '先征后退', '免税', '即征即退100%', '超税负3%即征即退', '超税负8%即征即退', '超税负12%即征即退'];
818
+ this.isTaxFreeTypeNeeded = true;
818
819
  this.taxFreeTypeList = [{
819
820
  label: '出口免税和其他免税优惠政策(免税)',
820
821
  value: 1
@@ -2221,11 +2222,12 @@ var useAddDiscount = (function (goods) {
2221
2222
  _context2.next = 7;
2222
2223
  return controller.run( /*#__PURE__*/function () {
2223
2224
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
2225
+ var _s$goodsListState$edi, _goods;
2224
2226
  var err, key;
2225
2227
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2226
2228
  while (1) switch (_context.prev = _context.next) {
2227
2229
  case 0:
2228
- if (!s.goodsListState.form) {
2230
+ if (!(s.goodsListState.form && ((_s$goodsListState$edi = s.goodsListState.editGood) === null || _s$goodsListState$edi === void 0 ? void 0 : _s$goodsListState$edi.$index) === ((_goods = goods) === null || _goods === void 0 ? void 0 : _goods.$index))) {
2229
2231
  _context.next = 11;
2230
2232
  break;
2231
2233
  }
@@ -2247,7 +2249,7 @@ var useAddDiscount = (function (goods) {
2247
2249
  return _context.abrupt("return");
2248
2250
  case 11:
2249
2251
  goods = s.goodsListState.goodsMap.get(goods.$index);
2250
- if (!(goods.taxRate === 0 && !goods.taxFreeType)) {
2252
+ if (!(goods.taxRate === 0 && s.goodsListState.endowCode.isTaxFreeTypeNeeded && !goods.taxFreeType)) {
2251
2253
  _context.next = 15;
2252
2254
  break;
2253
2255
  }
@@ -8821,11 +8823,12 @@ var endowCode = /*#__PURE__*/function () {
8821
8823
  _context17.next = 6;
8822
8824
  return controller.pipeline( /*#__PURE__*/function () {
8823
8825
  var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(s) {
8826
+ var _s$goodsListState$edi;
8824
8827
  var err, key, g, i;
8825
8828
  return _regeneratorRuntime().wrap(function _callee16$(_context16) {
8826
8829
  while (1) switch (_context16.prev = _context16.next) {
8827
8830
  case 0:
8828
- if (!s.goodsListState.form) {
8831
+ 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))) {
8829
8832
  _context16.next = 11;
8830
8833
  break;
8831
8834
  }
@@ -10667,7 +10670,7 @@ var useAddDiscountRowButton = (function () {
10667
10670
  case 4:
10668
10671
  isOk = s.goodsListState.selectedGoodIndex.some(function ($index) {
10669
10672
  var good = s.goodsListState.goodsMap.get($index);
10670
- return !good || good.taxRate === 0 && !good.taxFreeType;
10673
+ return !good || good.taxRate === 0 && s.goodsListState.endowCode.isTaxFreeTypeNeeded && !good.taxFreeType;
10671
10674
  });
10672
10675
  if (!isOk) {
10673
10676
  _context2.next = 8;
@@ -12088,6 +12091,10 @@ var DrawerBody$3 = function DrawerBody(props) {
12088
12091
  var actions = React.useMemo(function () {
12089
12092
  return createAsyncFormActions();
12090
12093
  }, []);
12094
+ /** 免税类型 是否需要 */
12095
+ var isTaxFreeTypeNeeded = controller.useMemo(function (s) {
12096
+ return s.goodsListState.endowCode.isTaxFreeTypeNeeded;
12097
+ }, []);
12091
12098
  /** 税率 是否禁用 */
12092
12099
  var readOnlyTaxRate = controller.useMemo(function (s) {
12093
12100
  if (s.goodsListState.endowCode.getReadOnlyTaxRate) {
@@ -12532,7 +12539,7 @@ var DrawerBody$3 = function DrawerBody(props) {
12532
12539
  message: '请选择税率',
12533
12540
  required: true
12534
12541
  }]
12535
- }), taxRate === 0 && /*#__PURE__*/React.createElement(SchemaMarkupField, {
12542
+ }), taxRate === 0 && isTaxFreeTypeNeeded && /*#__PURE__*/React.createElement(SchemaMarkupField, {
12536
12543
  name: "taxFreeType",
12537
12544
  type: "string",
12538
12545
  title: "\u514D\u7A0E\u7C7B\u578B",
package/dist/index.js CHANGED
@@ -825,6 +825,7 @@ var EndowCode = /*#__PURE__*/_createClass(function EndowCode() {
825
825
  DRAFT: draft
826
826
  };
827
827
  this.favouredPolicyNameList = ['100%先征后退', '即征即退30%', '即征即退50%', '即征即退70%', '按3%简易征收', '按5%简易征收', '按3%简易征收减按1.5%计征', '稀土产品', '简易征收', '50%先征后退', '不征税', '先征后退', '免税', '即征即退100%', '超税负3%即征即退', '超税负8%即征即退', '超税负12%即征即退'];
828
+ this.isTaxFreeTypeNeeded = true;
828
829
  this.taxFreeTypeList = [{
829
830
  label: '出口免税和其他免税优惠政策(免税)',
830
831
  value: 1
@@ -2231,11 +2232,12 @@ var useAddDiscount = (function (goods) {
2231
2232
  _context2.next = 7;
2232
2233
  return controller.run( /*#__PURE__*/function () {
2233
2234
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
2235
+ var _s$goodsListState$edi, _goods;
2234
2236
  var err, key;
2235
2237
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2236
2238
  while (1) switch (_context.prev = _context.next) {
2237
2239
  case 0:
2238
- if (!s.goodsListState.form) {
2240
+ if (!(s.goodsListState.form && ((_s$goodsListState$edi = s.goodsListState.editGood) === null || _s$goodsListState$edi === void 0 ? void 0 : _s$goodsListState$edi.$index) === ((_goods = goods) === null || _goods === void 0 ? void 0 : _goods.$index))) {
2239
2241
  _context.next = 11;
2240
2242
  break;
2241
2243
  }
@@ -2257,7 +2259,7 @@ var useAddDiscount = (function (goods) {
2257
2259
  return _context.abrupt("return");
2258
2260
  case 11:
2259
2261
  goods = s.goodsListState.goodsMap.get(goods.$index);
2260
- if (!(goods.taxRate === 0 && !goods.taxFreeType)) {
2262
+ if (!(goods.taxRate === 0 && s.goodsListState.endowCode.isTaxFreeTypeNeeded && !goods.taxFreeType)) {
2261
2263
  _context.next = 15;
2262
2264
  break;
2263
2265
  }
@@ -8831,11 +8833,12 @@ var endowCode = /*#__PURE__*/function () {
8831
8833
  _context17.next = 6;
8832
8834
  return controller.pipeline( /*#__PURE__*/function () {
8833
8835
  var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(s) {
8836
+ var _s$goodsListState$edi;
8834
8837
  var err, key, g, i;
8835
8838
  return _regeneratorRuntime().wrap(function _callee16$(_context16) {
8836
8839
  while (1) switch (_context16.prev = _context16.next) {
8837
8840
  case 0:
8838
- if (!s.goodsListState.form) {
8841
+ 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))) {
8839
8842
  _context16.next = 11;
8840
8843
  break;
8841
8844
  }
@@ -10677,7 +10680,7 @@ var useAddDiscountRowButton = (function () {
10677
10680
  case 4:
10678
10681
  isOk = s.goodsListState.selectedGoodIndex.some(function ($index) {
10679
10682
  var good = s.goodsListState.goodsMap.get($index);
10680
- return !good || good.taxRate === 0 && !good.taxFreeType;
10683
+ return !good || good.taxRate === 0 && s.goodsListState.endowCode.isTaxFreeTypeNeeded && !good.taxFreeType;
10681
10684
  });
10682
10685
  if (!isOk) {
10683
10686
  _context2.next = 8;
@@ -12098,6 +12101,10 @@ var DrawerBody$3 = function DrawerBody(props) {
12098
12101
  var actions = React__default['default'].useMemo(function () {
12099
12102
  return antd.createAsyncFormActions();
12100
12103
  }, []);
12104
+ /** 免税类型 是否需要 */
12105
+ var isTaxFreeTypeNeeded = controller.useMemo(function (s) {
12106
+ return s.goodsListState.endowCode.isTaxFreeTypeNeeded;
12107
+ }, []);
12101
12108
  /** 税率 是否禁用 */
12102
12109
  var readOnlyTaxRate = controller.useMemo(function (s) {
12103
12110
  if (s.goodsListState.endowCode.getReadOnlyTaxRate) {
@@ -12542,7 +12549,7 @@ var DrawerBody$3 = function DrawerBody(props) {
12542
12549
  message: '请选择税率',
12543
12550
  required: true
12544
12551
  }]
12545
- }), taxRate === 0 && /*#__PURE__*/React__default['default'].createElement(antd.SchemaMarkupField, {
12552
+ }), taxRate === 0 && isTaxFreeTypeNeeded && /*#__PURE__*/React__default['default'].createElement(antd.SchemaMarkupField, {
12546
12553
  name: "taxFreeType",
12547
12554
  type: "string",
12548
12555
  title: "\u514D\u7A0E\u7C7B\u578B",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.1.6",
3
+ "version": "3.1.8",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -61,6 +61,9 @@ export default class EndowCode {
61
61
  '超税负12%即征即退',
62
62
  ];
63
63
 
64
+ /** 免税类型 是否需要 */
65
+ isTaxFreeTypeNeeded: boolean = true;
66
+
64
67
  /** 免税类型 列表 */
65
68
  taxFreeTypeList: any[] = [
66
69
  { label: '出口免税和其他免税优惠政策(免税)', value: 1 },
@@ -87,6 +87,9 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
87
87
 
88
88
  const actions = React.useMemo(() => createAsyncFormActions(), []);
89
89
 
90
+ /** 免税类型 是否需要 */
91
+ const isTaxFreeTypeNeeded = controller.useMemo(s => s.goodsListState.endowCode.isTaxFreeTypeNeeded, []);
92
+
90
93
  /** 税率 是否禁用 */
91
94
  const readOnlyTaxRate = controller.useMemo(s => {
92
95
  if (s.goodsListState.endowCode.getReadOnlyTaxRate) {
@@ -377,7 +380,7 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
377
380
  enum={taxRateList}
378
381
  x-rules={[{ message: '请选择税率', required: true }]}
379
382
  />
380
- {taxRate === 0 &&
383
+ {taxRate === 0 && isTaxFreeTypeNeeded &&
381
384
  <Field
382
385
  name="taxFreeType"
383
386
  type="string"
@@ -451,7 +451,7 @@ export const endowCode = async (controller: InvoiceController, goods: IGood) =>
451
451
  await controller.wait();
452
452
  await controller.saveEditGood();
453
453
  await controller.pipeline(async (s) => {
454
- if (s.goodsListState.form) {
454
+ if (s.goodsListState.form && s.goodsListState.editGood?.$index === goods?.$index) {
455
455
  const err: any = s.goodsListState.form.getFieldsError();
456
456
  for (let key in err) {
457
457
  if (!err[key]) continue;
@@ -21,7 +21,7 @@ export default (goods: IGood) => {
21
21
  await controller.wait();
22
22
  await controller.saveEditGood();
23
23
  await controller.run(async s => {
24
- if (s.goodsListState.form) {
24
+ if (s.goodsListState.form && s.goodsListState.editGood?.$index === goods?.$index) {
25
25
  const err: any = s.goodsListState.form.getFieldsError();
26
26
  for (let key in err) {
27
27
  if (!err[key]) continue;
@@ -30,7 +30,7 @@ export default (goods: IGood) => {
30
30
  }
31
31
  }
32
32
  goods = s.goodsListState.goodsMap.get(goods.$index) as any;
33
- if (goods.taxRate === 0 && !goods.taxFreeType) {
33
+ if (goods.taxRate === 0 && s.goodsListState.endowCode.isTaxFreeTypeNeeded && !goods.taxFreeType) {
34
34
  message.error({ content: '零税率需要设置免税类型,请在赋码中设置!', key: '零税率需要设置免税类型,请在赋码中设置!' });
35
35
  return;
36
36
  }
@@ -66,7 +66,7 @@ export default () => {
66
66
 
67
67
  isOk = s.goodsListState.selectedGoodIndex.some($index => {
68
68
  const good = s.goodsListState.goodsMap.get($index);
69
- return !good || (good.taxRate === 0 && !good.taxFreeType)
69
+ return !good || (good.taxRate === 0 && s.goodsListState.endowCode.isTaxFreeTypeNeeded && !good.taxFreeType)
70
70
  })
71
71
  if (isOk) {
72
72
  message.error({ content: '零税率需要设置免税类型,请在赋码中设置!', key: '零税率需要设置免税类型,请在赋码中设置!' });