kts-component-invoice-operate 1.2.19 → 1.2.20-b1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -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 4:
366
+ case 6:
363
367
  if (!(i < arr.length)) {
364
- _context.next = 16;
368
+ _context.next = 18;
365
369
  break;
366
370
  }
367
371
 
368
372
  key = arr[i][0];
369
- _context.next = 8;
373
+ _context.next = 10;
370
374
  return _validateFields(arr[i][1]);
371
375
 
372
- case 8:
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 13:
383
+ case 15:
380
384
  i++;
381
- _context.next = 4;
385
+ _context.next = 6;
382
386
  break;
383
387
 
384
- case 16:
388
+ case 18:
385
389
  if (!this.state.goodsListState.form) {
386
- _context.next = 25;
390
+ _context.next = 27;
387
391
  break;
388
392
  }
389
393
 
390
- _context.prev = 17;
391
- _context.next = 20;
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 20:
395
- _context.next = 25;
398
+ case 22:
399
+ _context.next = 27;
396
400
  break;
397
401
 
398
- case 22:
399
- _context.prev = 22;
400
- _context.t0 = _context["catch"](17);
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 25:
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 30:
452
+ case 32:
449
453
  case "end":
450
454
  return _context.stop();
451
455
  }
452
456
  }
453
- }, _callee, this, [[17, 22]]);
457
+ }, _callee, this, [[19, 24]]);
454
458
  }));
455
459
 
456
460
  function validateFields() {
@@ -8836,6 +8840,11 @@ function dutyFree(controller, taxRate, form, record) {
8836
8840
  var cache = controller.state.goodsListState.endowCode.cache;
8837
8841
  var invoiceType = controller.state.invoiceType; // 4月1日至12月31日
8838
8842
 
8843
+ console.log('===> 小规模纳税人免税逻辑');
8844
+ console.log('===> invoiceType', invoiceType);
8845
+ console.log('===> en', controller.state.en);
8846
+ console.log('===> taxRate', taxRate);
8847
+ console.log('===> state', controller.state);
8839
8848
  if (hooks().valueOf() > hooks('2022-12-31 23:59').valueOf()) return taxRate;
8840
8849
  if (controller.state.en !== '08') return taxRate;
8841
8850
  if (invoiceType !== '10' && invoiceType !== '04') return taxRate;
@@ -8854,30 +8863,7 @@ function dutyFree(controller, taxRate, form, record) {
8854
8863
  taxRate: 0
8855
8864
  });
8856
8865
  return 0;
8857
- } // 选择的 1或者3
8858
- // if (taxRate === 1 || taxRate === 3) {
8859
- // 是否处理过
8860
- // if (cache[record.$index]) {
8861
- // return taxRate;
8862
- // } else {
8863
- // cache[record.$index] = { favouredPolicyName: record.favouredPolicyName, favouredPolicyMark: record.favouredPolicyMark,taxFreeType:record.taxFreeType }
8864
- // record.favouredPolicyName = '免税';
8865
- // record.taxRate = 0;
8866
- // record.favouredPolicyMark = 1;
8867
- // record.taxFreeType = 1 as any;
8868
- // form.setFieldsValue({ taxRate: 0 });
8869
- // return 0;
8870
- // }
8871
- // } else {
8872
- // if (cache[record.$index] && cache[record.$index] !== true) {
8873
- // record.favouredPolicyName = cache[record.$index].favouredPolicyName;
8874
- // record.favouredPolicyMark = cache[record.$index].favouredPolicyMark;
8875
- // record.taxFreeType = cache[record.$index].taxFreeType;
8876
- // cache[record.$index] = true;
8877
- // }
8878
- // return taxRate;
8879
- // }
8880
-
8866
+ }
8881
8867
  }
8882
8868
  /** 含税 => 更新(不含税) */
8883
8869
 
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 4:
376
+ case 6:
373
377
  if (!(i < arr.length)) {
374
- _context.next = 16;
378
+ _context.next = 18;
375
379
  break;
376
380
  }
377
381
 
378
382
  key = arr[i][0];
379
- _context.next = 8;
383
+ _context.next = 10;
380
384
  return _validateFields(arr[i][1]);
381
385
 
382
- case 8:
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 13:
393
+ case 15:
390
394
  i++;
391
- _context.next = 4;
395
+ _context.next = 6;
392
396
  break;
393
397
 
394
- case 16:
398
+ case 18:
395
399
  if (!this.state.goodsListState.form) {
396
- _context.next = 25;
400
+ _context.next = 27;
397
401
  break;
398
402
  }
399
403
 
400
- _context.prev = 17;
401
- _context.next = 20;
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 20:
405
- _context.next = 25;
408
+ case 22:
409
+ _context.next = 27;
406
410
  break;
407
411
 
408
- case 22:
409
- _context.prev = 22;
410
- _context.t0 = _context["catch"](17);
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 25:
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 30:
462
+ case 32:
459
463
  case "end":
460
464
  return _context.stop();
461
465
  }
462
466
  }
463
- }, _callee, this, [[17, 22]]);
467
+ }, _callee, this, [[19, 24]]);
464
468
  }));
465
469
 
466
470
  function validateFields() {
@@ -8846,6 +8850,11 @@ function dutyFree(controller, taxRate, form, record) {
8846
8850
  var cache = controller.state.goodsListState.endowCode.cache;
8847
8851
  var invoiceType = controller.state.invoiceType; // 4月1日至12月31日
8848
8852
 
8853
+ console.log('===> 小规模纳税人免税逻辑');
8854
+ console.log('===> invoiceType', invoiceType);
8855
+ console.log('===> en', controller.state.en);
8856
+ console.log('===> taxRate', taxRate);
8857
+ console.log('===> state', controller.state);
8849
8858
  if (hooks().valueOf() > hooks('2022-12-31 23:59').valueOf()) return taxRate;
8850
8859
  if (controller.state.en !== '08') return taxRate;
8851
8860
  if (invoiceType !== '10' && invoiceType !== '04') return taxRate;
@@ -8864,30 +8873,7 @@ function dutyFree(controller, taxRate, form, record) {
8864
8873
  taxRate: 0
8865
8874
  });
8866
8875
  return 0;
8867
- } // 选择的 1或者3
8868
- // if (taxRate === 1 || taxRate === 3) {
8869
- // 是否处理过
8870
- // if (cache[record.$index]) {
8871
- // return taxRate;
8872
- // } else {
8873
- // cache[record.$index] = { favouredPolicyName: record.favouredPolicyName, favouredPolicyMark: record.favouredPolicyMark,taxFreeType:record.taxFreeType }
8874
- // record.favouredPolicyName = '免税';
8875
- // record.taxRate = 0;
8876
- // record.favouredPolicyMark = 1;
8877
- // record.taxFreeType = 1 as any;
8878
- // form.setFieldsValue({ taxRate: 0 });
8879
- // return 0;
8880
- // }
8881
- // } else {
8882
- // if (cache[record.$index] && cache[record.$index] !== true) {
8883
- // record.favouredPolicyName = cache[record.$index].favouredPolicyName;
8884
- // record.favouredPolicyMark = cache[record.$index].favouredPolicyMark;
8885
- // record.taxFreeType = cache[record.$index].taxFreeType;
8886
- // cache[record.$index] = true;
8887
- // }
8888
- // return taxRate;
8889
- // }
8890
-
8876
+ }
8891
8877
  }
8892
8878
  /** 含税 => 更新(不含税) */
8893
8879
 
package/docs/index.md CHANGED
@@ -1,5 +1,5 @@
1
- # 发票编辑组件
1
+ # 发票编辑组件-
2
2
 
3
3
  npm 地址:https://www.npmjs.com/package/kts-component-invoice-operate
4
4
 
5
- ### 版本 1.2.19
5
+ ### 版本 1.2.20