kts-component-invoice-operate 1.0.82 → 1.0.83

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
@@ -1218,7 +1218,7 @@ var InvoiceHeader = decorator(Form.create())(function (props) {
1218
1218
  }, isInvoiceNo ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "\u53D1\u7968\u5355\u636E\u7F16\u53F7 :"), getFieldDecorator('id', {
1219
1219
  initialValue: props.defaultId
1220
1220
  })( /*#__PURE__*/React.createElement(Input, {
1221
- readOnly: readOnlyInvoiceNo,
1221
+ disabled: readOnlyInvoiceNo,
1222
1222
  style: {
1223
1223
  width: 230
1224
1224
  },
@@ -1315,7 +1315,12 @@ var FormSpanString = /*#__PURE__*/function (_React$Component) {
1315
1315
  _createClass(FormSpanString, [{
1316
1316
  key: "render",
1317
1317
  value: function render() {
1318
- return /*#__PURE__*/React.createElement("span", null, this.props.value);
1318
+ // return <span>{this.props.value}</span>;
1319
+ return /*#__PURE__*/React.createElement(Input, {
1320
+ size: "small",
1321
+ disabled: true,
1322
+ value: this.props.value
1323
+ });
1319
1324
  }
1320
1325
  }]);
1321
1326
 
@@ -1439,12 +1444,17 @@ var Statistics = (function () {
1439
1444
  /** 金额(含税) */
1440
1445
 
1441
1446
  var lineAmountIncludeTax = controller.useMemo(function (s) {
1447
+ var _s$goodsListState$for, _s$goodsListState$for2;
1448
+
1442
1449
  var sum = chain$1(bignumber(0));
1443
1450
  var editGood = s.goodsListState.editGood; // 正在编辑的货物
1444
1451
 
1452
+ var err = (_s$goodsListState$for = (_s$goodsListState$for2 = s.goodsListState.form) === null || _s$goodsListState$for2 === void 0 ? void 0 : _s$goodsListState$for2.getFieldsError()) !== null && _s$goodsListState$for !== void 0 ? _s$goodsListState$for : {};
1445
1453
  s.goodsListState.goodsList.forEach(function (e) {
1446
1454
  if (e.$index === (editGood === null || editGood === void 0 ? void 0 : editGood.$index)) {
1447
- sum = sum.add(bignumber(editGood.lineAmountIncludeTax || 0));
1455
+ if (!err.lineAmountIncludeTax) {
1456
+ sum = sum.add(bignumber(editGood.lineAmountIncludeTax || 0));
1457
+ }
1448
1458
  } else {
1449
1459
  sum = sum.add(bignumber(e.lineAmountIncludeTax || 0));
1450
1460
  }
@@ -1454,12 +1464,17 @@ var Statistics = (function () {
1454
1464
  /** 金额(不含税) */
1455
1465
 
1456
1466
  var lineAmountExcludeTax = controller.useMemo(function (s) {
1467
+ var _s$goodsListState$for3, _s$goodsListState$for4;
1468
+
1457
1469
  var sum = chain$1(bignumber(0));
1458
1470
  var editGood = s.goodsListState.editGood; // 正在编辑的货物
1459
1471
 
1472
+ var err = (_s$goodsListState$for3 = (_s$goodsListState$for4 = s.goodsListState.form) === null || _s$goodsListState$for4 === void 0 ? void 0 : _s$goodsListState$for4.getFieldsError()) !== null && _s$goodsListState$for3 !== void 0 ? _s$goodsListState$for3 : {};
1460
1473
  s.goodsListState.goodsList.forEach(function (e) {
1461
1474
  if (e.$index === (editGood === null || editGood === void 0 ? void 0 : editGood.$index)) {
1462
- sum = sum.add(bignumber(editGood.lineAmountExcludeTax || 0));
1475
+ if (!err.lineAmountExcludeTax) {
1476
+ sum = sum.add(bignumber(editGood.lineAmountExcludeTax || 0));
1477
+ }
1463
1478
  } else {
1464
1479
  sum = sum.add(bignumber(e.lineAmountExcludeTax || 0));
1465
1480
  }
@@ -2373,7 +2388,7 @@ var format15 = function format15(value) {
2373
2388
  if (value === Infinity) return '';
2374
2389
  if ("".concat(value) === 'NaN') return '';
2375
2390
  if (typeof value === 'string') value = parseFloat(value);
2376
- var fractionDigits = 15 - value.toString().indexOf('.');
2391
+ var fractionDigits = 15 - "".concat(value || 0).indexOf('.');
2377
2392
  return parseFloat(value.toFixed(fractionDigits > 8 ? 8 : fractionDigits));
2378
2393
  }; // 数量 + 单价(含税) => 金额(含税)
2379
2394
 
@@ -2441,7 +2456,7 @@ var onChangeQuantity = lazyFn$1(function (controller, form, record) {
2441
2456
  return _context.abrupt("return");
2442
2457
 
2443
2458
  case 5:
2444
- if (!promptErr(err.quantity)) {
2459
+ if (!err.quantity) {
2445
2460
  _context.next = 7;
2446
2461
  break;
2447
2462
  }
@@ -2591,7 +2606,7 @@ var onChangePriceIncludeTax = lazyFn$1(function (controller, form, record) {
2591
2606
  return _context2.abrupt("return");
2592
2607
 
2593
2608
  case 5:
2594
- if (!promptErr(err.priceIncludeTax)) {
2609
+ if (!err.priceIncludeTax) {
2595
2610
  _context2.next = 7;
2596
2611
  break;
2597
2612
  }
@@ -2690,7 +2705,7 @@ var onChangePriceExcludeTax = lazyFn$1(function (controller, form, record) {
2690
2705
  return _context3.abrupt("return");
2691
2706
 
2692
2707
  case 5:
2693
- if (!promptErr(err.priceExcludeTax)) {
2708
+ if (!err.priceExcludeTax) {
2694
2709
  _context3.next = 7;
2695
2710
  break;
2696
2711
  }
@@ -3077,7 +3092,7 @@ var updateUnitPriceTax = function updateUnitPriceTax(controller, form, record) {
3077
3092
  case 0:
3078
3093
  err = err || {};
3079
3094
 
3080
- if (!(!promptErr(err.taxRat) && (values.taxRate || values.taxRate === 0) && !promptErr(err.lineAmountExcludeTax) && (values.lineAmountExcludeTax || values.lineAmountExcludeTax === 0))) {
3095
+ if (!(!err.taxRat && (values.taxRate || values.taxRate === 0) && !promptErr(err.lineAmountExcludeTax) && (values.lineAmountExcludeTax || values.lineAmountExcludeTax === 0))) {
3081
3096
  _context8.next = 12;
3082
3097
  break;
3083
3098
  }
@@ -3115,7 +3130,7 @@ var updateUnitPriceTax = function updateUnitPriceTax(controller, form, record) {
3115
3130
  });
3116
3131
 
3117
3132
  case 15:
3118
- if (!(!promptErr(err.taxRat) && (values.taxRate || values.taxRate === 0) && !promptErr(err.priceExcludeTax) && (values.priceExcludeTax || values.priceExcludeTax === 0))) {
3133
+ if (!(!err.taxRat && (values.taxRate || values.taxRate === 0) && !promptErr(err.priceExcludeTax) && (values.priceExcludeTax || values.priceExcludeTax === 0))) {
3119
3134
  _context8.next = 20;
3120
3135
  break;
3121
3136
  }
@@ -4621,9 +4636,7 @@ var Main$1 = decorator(Form.create())(function (props) {
4621
4636
  className: "kts-invoice-operate-seller-remarks-value"
4622
4637
  }, getFieldDecorator('remarks', {
4623
4638
  initialValue: props.defaultsellerRemarks
4624
- })( /*#__PURE__*/React.createElement(TextArea, {
4625
- readOnly: model === 'prefab'
4626
- }))))));
4639
+ })( /*#__PURE__*/React.createElement(TextArea, null))))));
4627
4640
  });
4628
4641
 
4629
4642
  var css_248z$8 = ".kts-invoice-operate-sign form {\n display: flex;\n}\n.kts-invoice-operate-sign form .ktsAnt3x-row.ktsAnt3x-form-item {\n margin: 0;\n}\n.kts-invoice-operate-sign form > div {\n flex: 1;\n text-align: center;\n}\n";
@@ -4647,14 +4660,12 @@ var Sign = decorator(Form.create())(function (props) {
4647
4660
  }, getFieldDecorator('payee', {
4648
4661
  initialValue: props.defaultPayee
4649
4662
  })( /*#__PURE__*/React.createElement(Input, {
4650
- readOnly: model === 'prefab',
4651
4663
  size: "small"
4652
4664
  })))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form.Item, {
4653
4665
  label: "\u590D\u6838\u4EBA"
4654
4666
  }, getFieldDecorator('reviewer', {
4655
4667
  initialValue: props.defaultReviewer
4656
4668
  })( /*#__PURE__*/React.createElement(Input, {
4657
- readOnly: model === 'prefab',
4658
4669
  size: "small"
4659
4670
  })))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form.Item, {
4660
4671
  label: "\u5F00\u7968\u4EBA"
@@ -4665,7 +4676,6 @@ var Sign = decorator(Form.create())(function (props) {
4665
4676
  message: '请输入开票人'
4666
4677
  }]
4667
4678
  })( /*#__PURE__*/React.createElement(Input, {
4668
- readOnly: model === 'prefab',
4669
4679
  size: "small"
4670
4680
  }))))));
4671
4681
  });
package/dist/index.js CHANGED
@@ -1227,7 +1227,7 @@ var InvoiceHeader = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
1227
1227
  }, isInvoiceNo ? /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("label", null, "\u53D1\u7968\u5355\u636E\u7F16\u53F7 :"), getFieldDecorator('id', {
1228
1228
  initialValue: props.defaultId
1229
1229
  })( /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Input, {
1230
- readOnly: readOnlyInvoiceNo,
1230
+ disabled: readOnlyInvoiceNo,
1231
1231
  style: {
1232
1232
  width: 230
1233
1233
  },
@@ -1324,7 +1324,12 @@ var FormSpanString = /*#__PURE__*/function (_React$Component) {
1324
1324
  _createClass(FormSpanString, [{
1325
1325
  key: "render",
1326
1326
  value: function render() {
1327
- return /*#__PURE__*/React__default['default'].createElement("span", null, this.props.value);
1327
+ // return <span>{this.props.value}</span>;
1328
+ return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Input, {
1329
+ size: "small",
1330
+ disabled: true,
1331
+ value: this.props.value
1332
+ });
1328
1333
  }
1329
1334
  }]);
1330
1335
 
@@ -1448,12 +1453,17 @@ var Statistics = (function () {
1448
1453
  /** 金额(含税) */
1449
1454
 
1450
1455
  var lineAmountIncludeTax = controller.useMemo(function (s) {
1456
+ var _s$goodsListState$for, _s$goodsListState$for2;
1457
+
1451
1458
  var sum = mathjs.chain(mathjs.bignumber(0));
1452
1459
  var editGood = s.goodsListState.editGood; // 正在编辑的货物
1453
1460
 
1461
+ var err = (_s$goodsListState$for = (_s$goodsListState$for2 = s.goodsListState.form) === null || _s$goodsListState$for2 === void 0 ? void 0 : _s$goodsListState$for2.getFieldsError()) !== null && _s$goodsListState$for !== void 0 ? _s$goodsListState$for : {};
1454
1462
  s.goodsListState.goodsList.forEach(function (e) {
1455
1463
  if (e.$index === (editGood === null || editGood === void 0 ? void 0 : editGood.$index)) {
1456
- sum = sum.add(mathjs.bignumber(editGood.lineAmountIncludeTax || 0));
1464
+ if (!err.lineAmountIncludeTax) {
1465
+ sum = sum.add(mathjs.bignumber(editGood.lineAmountIncludeTax || 0));
1466
+ }
1457
1467
  } else {
1458
1468
  sum = sum.add(mathjs.bignumber(e.lineAmountIncludeTax || 0));
1459
1469
  }
@@ -1463,12 +1473,17 @@ var Statistics = (function () {
1463
1473
  /** 金额(不含税) */
1464
1474
 
1465
1475
  var lineAmountExcludeTax = controller.useMemo(function (s) {
1476
+ var _s$goodsListState$for3, _s$goodsListState$for4;
1477
+
1466
1478
  var sum = mathjs.chain(mathjs.bignumber(0));
1467
1479
  var editGood = s.goodsListState.editGood; // 正在编辑的货物
1468
1480
 
1481
+ var err = (_s$goodsListState$for3 = (_s$goodsListState$for4 = s.goodsListState.form) === null || _s$goodsListState$for4 === void 0 ? void 0 : _s$goodsListState$for4.getFieldsError()) !== null && _s$goodsListState$for3 !== void 0 ? _s$goodsListState$for3 : {};
1469
1482
  s.goodsListState.goodsList.forEach(function (e) {
1470
1483
  if (e.$index === (editGood === null || editGood === void 0 ? void 0 : editGood.$index)) {
1471
- sum = sum.add(mathjs.bignumber(editGood.lineAmountExcludeTax || 0));
1484
+ if (!err.lineAmountExcludeTax) {
1485
+ sum = sum.add(mathjs.bignumber(editGood.lineAmountExcludeTax || 0));
1486
+ }
1472
1487
  } else {
1473
1488
  sum = sum.add(mathjs.bignumber(e.lineAmountExcludeTax || 0));
1474
1489
  }
@@ -2382,7 +2397,7 @@ var format15 = function format15(value) {
2382
2397
  if (value === Infinity) return '';
2383
2398
  if ("".concat(value) === 'NaN') return '';
2384
2399
  if (typeof value === 'string') value = parseFloat(value);
2385
- var fractionDigits = 15 - value.toString().indexOf('.');
2400
+ var fractionDigits = 15 - "".concat(value || 0).indexOf('.');
2386
2401
  return parseFloat(value.toFixed(fractionDigits > 8 ? 8 : fractionDigits));
2387
2402
  }; // 数量 + 单价(含税) => 金额(含税)
2388
2403
 
@@ -2450,7 +2465,7 @@ var onChangeQuantity = lazyFn$1(function (controller, form, record) {
2450
2465
  return _context.abrupt("return");
2451
2466
 
2452
2467
  case 5:
2453
- if (!promptErr(err.quantity)) {
2468
+ if (!err.quantity) {
2454
2469
  _context.next = 7;
2455
2470
  break;
2456
2471
  }
@@ -2600,7 +2615,7 @@ var onChangePriceIncludeTax = lazyFn$1(function (controller, form, record) {
2600
2615
  return _context2.abrupt("return");
2601
2616
 
2602
2617
  case 5:
2603
- if (!promptErr(err.priceIncludeTax)) {
2618
+ if (!err.priceIncludeTax) {
2604
2619
  _context2.next = 7;
2605
2620
  break;
2606
2621
  }
@@ -2699,7 +2714,7 @@ var onChangePriceExcludeTax = lazyFn$1(function (controller, form, record) {
2699
2714
  return _context3.abrupt("return");
2700
2715
 
2701
2716
  case 5:
2702
- if (!promptErr(err.priceExcludeTax)) {
2717
+ if (!err.priceExcludeTax) {
2703
2718
  _context3.next = 7;
2704
2719
  break;
2705
2720
  }
@@ -3086,7 +3101,7 @@ var updateUnitPriceTax = function updateUnitPriceTax(controller, form, record) {
3086
3101
  case 0:
3087
3102
  err = err || {};
3088
3103
 
3089
- if (!(!promptErr(err.taxRat) && (values.taxRate || values.taxRate === 0) && !promptErr(err.lineAmountExcludeTax) && (values.lineAmountExcludeTax || values.lineAmountExcludeTax === 0))) {
3104
+ if (!(!err.taxRat && (values.taxRate || values.taxRate === 0) && !promptErr(err.lineAmountExcludeTax) && (values.lineAmountExcludeTax || values.lineAmountExcludeTax === 0))) {
3090
3105
  _context8.next = 12;
3091
3106
  break;
3092
3107
  }
@@ -3124,7 +3139,7 @@ var updateUnitPriceTax = function updateUnitPriceTax(controller, form, record) {
3124
3139
  });
3125
3140
 
3126
3141
  case 15:
3127
- if (!(!promptErr(err.taxRat) && (values.taxRate || values.taxRate === 0) && !promptErr(err.priceExcludeTax) && (values.priceExcludeTax || values.priceExcludeTax === 0))) {
3142
+ if (!(!err.taxRat && (values.taxRate || values.taxRate === 0) && !promptErr(err.priceExcludeTax) && (values.priceExcludeTax || values.priceExcludeTax === 0))) {
3128
3143
  _context8.next = 20;
3129
3144
  break;
3130
3145
  }
@@ -4630,9 +4645,7 @@ var Main$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function
4630
4645
  className: "kts-invoice-operate-seller-remarks-value"
4631
4646
  }, getFieldDecorator('remarks', {
4632
4647
  initialValue: props.defaultsellerRemarks
4633
- })( /*#__PURE__*/React__default['default'].createElement(TextArea, {
4634
- readOnly: model === 'prefab'
4635
- }))))));
4648
+ })( /*#__PURE__*/React__default['default'].createElement(TextArea, null))))));
4636
4649
  });
4637
4650
 
4638
4651
  var css_248z$8 = ".kts-invoice-operate-sign form {\n display: flex;\n}\n.kts-invoice-operate-sign form .ktsAnt3x-row.ktsAnt3x-form-item {\n margin: 0;\n}\n.kts-invoice-operate-sign form > div {\n flex: 1;\n text-align: center;\n}\n";
@@ -4656,14 +4669,12 @@ var Sign = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
4656
4669
  }, getFieldDecorator('payee', {
4657
4670
  initialValue: props.defaultPayee
4658
4671
  })( /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Input, {
4659
- readOnly: model === 'prefab',
4660
4672
  size: "small"
4661
4673
  })))), /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
4662
4674
  label: "\u590D\u6838\u4EBA"
4663
4675
  }, getFieldDecorator('reviewer', {
4664
4676
  initialValue: props.defaultReviewer
4665
4677
  })( /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Input, {
4666
- readOnly: model === 'prefab',
4667
4678
  size: "small"
4668
4679
  })))), /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
4669
4680
  label: "\u5F00\u7968\u4EBA"
@@ -4674,7 +4685,6 @@ var Sign = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
4674
4685
  message: '请输入开票人'
4675
4686
  }]
4676
4687
  })( /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Input, {
4677
- readOnly: model === 'prefab',
4678
4688
  size: "small"
4679
4689
  }))))));
4680
4690
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "1.0.82",
3
+ "version": "1.0.83",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -53,9 +53,6 @@ export default () => {
53
53
  class MyController extends Invoice.InvoiceController {
54
54
  getTaxCategoryCodeList = this.pipeline(async (s) => {
55
55
  console.log('===> 准备赋码的货物索引列表', s.goodsListState.endowCode.endowcodeGoodIndex);
56
- s.goodsListState.endowCode.getDefaultValue = async () => {
57
- return
58
- }
59
56
 
60
57
  s.goodsListState.endowCode.getTaxCategoryCodeList = async (value) => {
61
58
  console.log('===>搜索条件', value);
@@ -15,7 +15,7 @@ export const format15 = (value: number | string) => {
15
15
  if (`${value}` === 'NaN') return '';
16
16
  if (typeof value === 'string') value = parseFloat(value);
17
17
 
18
- const fractionDigits = 15 - value.toString().indexOf('.');
18
+ const fractionDigits = 15 - `${value || 0}`.indexOf('.');
19
19
  return parseFloat(value.toFixed(fractionDigits > 8 ? 8 : fractionDigits));
20
20
  };
21
21
 
@@ -45,7 +45,7 @@ export default () => {
45
45
  if (endowcodeGoodIndex.length === 1) {
46
46
  const getDefaultValue = s.goodsListState.endowCode.getDefaultValue;
47
47
  if (getDefaultValue) {
48
- setDefaultValue(await getDefaultValue({...good}))
48
+ setDefaultValue(await getDefaultValue({ ...good }))
49
49
  } else {
50
50
  setDefaultValue(good);
51
51
  }
@@ -77,7 +77,7 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
77
77
 
78
78
  const controller = Invoice.useInvoiceController();
79
79
 
80
- const {defaultValue} = props;
80
+ const { defaultValue } = props;
81
81
 
82
82
  const actions = React.useMemo(() => createAsyncFormActions(), []);
83
83
 
@@ -278,19 +278,10 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
278
278
  </FormButtonGroup>
279
279
 
280
280
  <span className="kts-invoice-operate-goods-endow-code-button-list">
281
- <Button
282
- onClick={() => {
283
- actions.submit(onSubmit);
284
- }}
285
- type="primary"
286
- >
281
+ <Button onClick={() => { actions.submit(onSubmit) }} type="primary">
287
282
  确定
288
283
  </Button>
289
- <Button
290
- onClick={() => {
291
- controller.pipeline(async s => (s.goodsListState.endowCode.endowcodeGoodIndex = []))();
292
- }}
293
- >
284
+ <Button onClick={() => { controller.pipeline(async s => (s.goodsListState.endowCode.endowcodeGoodIndex = []))() }}>
294
285
  取消
295
286
  </Button>
296
287
  </span>
@@ -45,7 +45,7 @@ export const onChangeQuantity = lazyFn(
45
45
  await controller.setEditGood({ quantity: undefined });
46
46
  return;
47
47
  }
48
- if (promptErr(err.quantity)) return;
48
+ if (err.quantity) return;
49
49
 
50
50
  const quantity = format15(values.quantity);
51
51
  await controller.setEditGood({ quantity });
@@ -106,7 +106,7 @@ export const onChangePriceIncludeTax = lazyFn(
106
106
  await controller.setEditGood({ priceIncludeTax: undefined, priceExcludeTax: undefined });
107
107
  return;
108
108
  }
109
- if (promptErr(err.priceIncludeTax)) return;
109
+ if (err.priceIncludeTax) return;
110
110
 
111
111
  const priceIncludeTax = format15(values.priceIncludeTax);
112
112
  await controller.setEditGood({ priceIncludeTax });
@@ -142,7 +142,7 @@ export const onChangePriceExcludeTax = lazyFn(
142
142
  await controller.setEditGood({ priceIncludeTax: undefined, priceExcludeTax: undefined });
143
143
  return;
144
144
  }
145
- if (promptErr(err.priceExcludeTax)) return;
145
+ if (err.priceExcludeTax) return;
146
146
 
147
147
  const priceExcludeTax = format15(values.priceExcludeTax);
148
148
  await controller.setEditGood({ priceExcludeTax });
@@ -227,16 +227,12 @@ export const onChangeLineAmountExcludeTax = lazyFn(
227
227
  // 是否有数量
228
228
  if (!err.quantity && values.quantity) {
229
229
  const quantity = format15(values.quantity);
230
- const priceExcludeTax = format15(
231
- evaluate(`${lineAmountExcludeTax} / ${quantity}`),
232
- );
230
+ const priceExcludeTax = format15(evaluate(`${lineAmountExcludeTax} / ${quantity}`));
233
231
  form.setFieldsValue({ priceExcludeTax });
234
232
  await controller.setEditGood({ priceExcludeTax });
235
233
  } else if (!err.priceExcludeTax && values.priceExcludeTax) {
236
234
  const priceExcludeTax = format15(values.priceExcludeTax);
237
- const quantity = format15(
238
- evaluate(`${lineAmountExcludeTax} / ${priceExcludeTax}`),
239
- );
235
+ const quantity = format15(evaluate(`${lineAmountExcludeTax} / ${priceExcludeTax}`));
240
236
  form.setFieldsValue({ quantity });
241
237
  await controller.setEditGood({ quantity });
242
238
  }
@@ -319,7 +315,7 @@ export const updateUnitPriceTax = (
319
315
  err = err || {};
320
316
 
321
317
  if (
322
- !promptErr(err.taxRat) &&
318
+ !err.taxRat &&
323
319
  (values.taxRate || values.taxRate === 0) &&
324
320
  !promptErr(err.lineAmountExcludeTax) &&
325
321
  (values.lineAmountExcludeTax || values.lineAmountExcludeTax === 0)
@@ -343,7 +339,7 @@ export const updateUnitPriceTax = (
343
339
 
344
340
  // 单价(含税) = 单价(不含税) * (1+税率)
345
341
  if (
346
- !promptErr(err.taxRat) &&
342
+ !err.taxRat &&
347
343
  (values.taxRate || values.taxRate === 0) &&
348
344
  !promptErr(err.priceExcludeTax) &&
349
345
  (values.priceExcludeTax || values.priceExcludeTax === 0)
@@ -16,9 +16,13 @@ export default () => {
16
16
  const lineAmountIncludeTax = controller.useMemo((s) => {
17
17
  let sum = chain(bignumber(0));
18
18
  const editGood = s.goodsListState.editGood; // 正在编辑的货物
19
+ const err = s.goodsListState.form?.getFieldsError() ?? {};
20
+
19
21
  s.goodsListState.goodsList.forEach((e) => {
20
22
  if (e.$index === editGood?.$index) {
21
- sum = sum.add(bignumber(editGood.lineAmountIncludeTax || 0));
23
+ if (!err.lineAmountIncludeTax) {
24
+ sum = sum.add(bignumber(editGood.lineAmountIncludeTax || 0));
25
+ }
22
26
  } else {
23
27
  sum = sum.add(bignumber(e.lineAmountIncludeTax || 0));
24
28
  }
@@ -30,9 +34,13 @@ export default () => {
30
34
  const lineAmountExcludeTax = controller.useMemo((s) => {
31
35
  let sum = chain(bignumber(0));
32
36
  const editGood = s.goodsListState.editGood; // 正在编辑的货物
37
+ const err = s.goodsListState.form?.getFieldsError() ?? {};
38
+
33
39
  s.goodsListState.goodsList.forEach((e) => {
34
40
  if (e.$index === editGood?.$index) {
35
- sum = sum.add(bignumber(editGood.lineAmountExcludeTax || 0));
41
+ if (!err.lineAmountExcludeTax) {
42
+ sum = sum.add(bignumber(editGood.lineAmountExcludeTax || 0));
43
+ }
36
44
  } else {
37
45
  sum = sum.add(bignumber(e.lineAmountExcludeTax || 0));
38
46
  }
@@ -147,7 +147,7 @@ export default decorator<IInvoiceHeader, IInvoiceHeader & FormComponentProps>(Fo
147
147
  initialValue: props.defaultId,
148
148
  })(
149
149
  <Input
150
- readOnly={readOnlyInvoiceNo}
150
+ disabled={readOnlyInvoiceNo}
151
151
  style={{ width: 230 }}
152
152
  size="small"
153
153
  suffix={
@@ -215,7 +215,8 @@ export default decorator<IInvoiceHeader, IInvoiceHeader & FormComponentProps>(Fo
215
215
 
216
216
  class FormSpanString extends React.Component<{ value?: any }> {
217
217
  render() {
218
- return <span>{this.props.value}</span>;
218
+ // return <span>{this.props.value}</span>;
219
+ return <Input size="small" disabled value={this.props.value} />
219
220
  }
220
221
  }
221
222
 
@@ -90,7 +90,7 @@ const Main = decorator<ISellerProps, ISellerProps & FormComponentProps>(Form.cre
90
90
  <div className="kts-invoice-operate-seller-remarks-value">
91
91
  {getFieldDecorator('remarks', {
92
92
  initialValue: props.defaultsellerRemarks,
93
- })(<TextArea readOnly={model === 'prefab'} />)}
93
+ })(<TextArea />)}
94
94
  </div>
95
95
  </div>
96
96
  </div>
@@ -38,14 +38,14 @@ export default decorator<IBuyerProps, IBuyerProps & FormComponentProps>(Form.cre
38
38
  <Form.Item label="收款人">
39
39
  {getFieldDecorator('payee', {
40
40
  initialValue: props.defaultPayee,
41
- })(<Input readOnly={model === 'prefab'} size="small" />)}
41
+ })(<Input size="small" />)}
42
42
  </Form.Item>
43
43
  </div>
44
44
  <div>
45
45
  <Form.Item label="复核人">
46
46
  {getFieldDecorator('reviewer', {
47
47
  initialValue: props.defaultReviewer,
48
- })(<Input readOnly={model === 'prefab'} size="small" />)}
48
+ })(<Input size="small" />)}
49
49
  </Form.Item>
50
50
  </div>
51
51
  <div>
@@ -53,7 +53,7 @@ export default decorator<IBuyerProps, IBuyerProps & FormComponentProps>(Form.cre
53
53
  {getFieldDecorator('issuer', {
54
54
  initialValue: props.defaultIssuer,
55
55
  rules: [{ required: true, message: '请输入开票人' }],
56
- })(<Input readOnly={model === 'prefab'} size="small" />)}
56
+ })(<Input size="small" />)}
57
57
  </Form.Item>
58
58
  </div>
59
59
  </Form>