kts-component-invoice-operate 3.2.261 → 3.2.262

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.
@@ -9,4 +9,6 @@ export default class Stakeholder {
9
9
  rulesMap?: {
10
10
  [key: string]: ValidationRule[] | undefined;
11
11
  };
12
+ /** 自然人标志 */
13
+ naturalPersonFlag?: any;
12
14
  }
@@ -12,8 +12,6 @@ export interface IStakeholder {
12
12
  isVatNormal?: boolean;
13
13
  /** 是否可以选择自然人 */
14
14
  isNaturalPerson?: boolean;
15
- /** 是否是自然人标志 */
16
- naturalPersonFlag?: any;
17
15
  /** 是否展开 */
18
16
  isExpand?: boolean;
19
17
  /** 购方,销方银行信息 勾选按钮是否显示 **/
@@ -23,6 +21,7 @@ export interface IStakeholder {
23
21
  /** 购方,销方地址电话 勾选按钮是否显示 **/
24
22
  riskData?: boolean;
25
23
  invoiceMarkCallback?: (value: any) => void;
24
+ changeNaturalPersonFlag?: (value: any) => void;
26
25
  }
27
26
  /** 干系人 */
28
27
  declare const _default: React.FunctionComponent<IStakeholder>;
package/dist/index.esm.js CHANGED
@@ -1371,6 +1371,7 @@ var Stakeholder = /*#__PURE__*/_createClass(function Stakeholder() {
1371
1371
  this.disableds = void 0;
1372
1372
  this.enables = void 0;
1373
1373
  this.rulesMap = void 0;
1374
+ this.naturalPersonFlag = void 0;
1374
1375
  });
1375
1376
 
1376
1377
  /** 自动补全 */
@@ -19720,37 +19721,33 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
19720
19721
  allowEditFlag = props.allowEditFlag,
19721
19722
  onClickImportButton = props.onClickImportButton,
19722
19723
  _props$isVatNormal = props.isVatNormal,
19723
- isVatNormal = _props$isVatNormal === void 0 ? false : _props$isVatNormal;
19724
+ isVatNormal = _props$isVatNormal === void 0 ? false : _props$isVatNormal,
19725
+ changeNaturalPersonFlag = props.changeNaturalPersonFlag;
19724
19726
 
19725
19727
  var _React$useState = React.useState(typeof props.isExpand === 'boolean' ? props.isExpand : true),
19726
19728
  _React$useState2 = _slicedToArray(_React$useState, 2),
19727
19729
  isExpand = _React$useState2[0],
19728
19730
  setExpand = _React$useState2[1];
19729
19731
 
19730
- var _React$useState3 = React.useState(props.naturalPersonFlag ? props.naturalPersonFlag : 'COMPANY'),
19732
+ var _React$useState3 = React.useState(''),
19731
19733
  _React$useState4 = _slicedToArray(_React$useState3, 2),
19732
- naturalPersonFlag = _React$useState4[0],
19733
- setNaturalPersonFlag = _React$useState4[1];
19734
+ validateStatus = _React$useState4[0],
19735
+ setStatus = _React$useState4[1];
19734
19736
 
19735
19737
  var _React$useState5 = React.useState(''),
19736
19738
  _React$useState6 = _slicedToArray(_React$useState5, 2),
19737
- validateStatus = _React$useState6[0],
19738
- setStatus = _React$useState6[1];
19739
+ errorInfo = _React$useState6[0],
19740
+ setInfo = _React$useState6[1];
19739
19741
 
19740
19742
  var _React$useState7 = React.useState(''),
19741
19743
  _React$useState8 = _slicedToArray(_React$useState7, 2),
19742
- errorInfo = _React$useState8[0],
19743
- setInfo = _React$useState8[1];
19744
+ nation = _React$useState8[0],
19745
+ setNationStatue = _React$useState8[1];
19744
19746
 
19745
19747
  var _React$useState9 = React.useState(''),
19746
19748
  _React$useState10 = _slicedToArray(_React$useState9, 2),
19747
- nation = _React$useState10[0],
19748
- setNationStatue = _React$useState10[1];
19749
-
19750
- var _React$useState11 = React.useState(''),
19751
- _React$useState12 = _slicedToArray(_React$useState11, 2),
19752
- nationInfo = _React$useState12[0],
19753
- setNation = _React$useState12[1];
19749
+ nationInfo = _React$useState10[0],
19750
+ setNation = _React$useState10[1];
19754
19751
 
19755
19752
  var getFieldDecorator = form.getFieldDecorator;
19756
19753
  var controller = Invoice.useInvoiceController();
@@ -19763,6 +19760,9 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
19763
19760
  var rulesMap = controller.useMemo(function (s) {
19764
19761
  return s.stakeholder.rulesMap || {};
19765
19762
  }, []);
19763
+ var naturalPersonFlag = controller.useMemo(function (s) {
19764
+ return s.stakeholder.naturalPersonFlag || 'COMPANY';
19765
+ }, []);
19766
19766
  /** 乐企 */
19767
19767
 
19768
19768
  var leqispanW = React.useMemo(function () {
@@ -19806,9 +19806,6 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
19806
19806
  React.useEffect(function () {
19807
19807
  setExpand(typeof props.isExpand === 'boolean' ? props.isExpand : true);
19808
19808
  }, [props.isExpand]);
19809
- React.useEffect(function () {
19810
- setNaturalPersonFlag(props.naturalPersonFlag ? props.naturalPersonFlag : 'COMPANY');
19811
- }, [props.naturalPersonFlag]);
19812
19809
  var onChangeType = React.useCallback(function (value) {
19813
19810
  var buyerTaxId = form === null || form === void 0 ? void 0 : form.getFieldValue("buyerTaxId");
19814
19811
  var certificateNumber = form === null || form === void 0 ? void 0 : form.getFieldValue("certificateNumber");
@@ -20078,7 +20075,7 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
20078
20075
  colon: false
20079
20076
  }, getFieldDecorator('naturalPersonFlag', {})( /*#__PURE__*/React.createElement(NaturalPersonFlag, {
20080
20077
  readOnly: isReadOnly('naturalPersonFlag'),
20081
- onChange: setNaturalPersonFlag
20078
+ onChange: changeNaturalPersonFlag
20082
20079
  })))), /*#__PURE__*/React.createElement(Form, {
20083
20080
  className: "digtal-stakeholder-form"
20084
20081
  }, /*#__PURE__*/React.createElement(Row, {
@@ -20380,12 +20377,12 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
20380
20377
  }, getFieldDecorator('certificateType', {
20381
20378
  rules: [{
20382
20379
  required: true,
20383
- message: '数据必填'
20380
+ message: '证件类型必填'
20384
20381
  }]
20385
20382
  })( /*#__PURE__*/React.createElement(CardSelect, {
20386
20383
  onChange: onChangeType,
20387
20384
  readOnly: isReadOnly('certificateType'),
20388
- placeholder: "\u6570\u636E\u5FC5\u586B",
20385
+ placeholder: "\u8BC1\u4EF6\u7C7B\u578B\u5FC5\u586B",
20389
20386
  autoComplete: "off"
20390
20387
  })))), /*#__PURE__*/React.createElement(Col, {
20391
20388
  span: 7
@@ -20397,7 +20394,7 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
20397
20394
  }, getFieldDecorator('certificateNumber', {
20398
20395
  rules: [{
20399
20396
  required: true,
20400
- message: '数据必填'
20397
+ message: '证件号码必填'
20401
20398
  }, {
20402
20399
  max: 30,
20403
20400
  message: "\u5185\u5BB9\u8D85\u957F"
@@ -20406,7 +20403,7 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
20406
20403
  }]
20407
20404
  })( /*#__PURE__*/React.createElement(MyInput$1, {
20408
20405
  readOnly: isReadOnly('certificateNumber'),
20409
- placeholder: "\u6570\u636E\u5FC5\u586B",
20406
+ placeholder: "\u8BC1\u4EF6\u53F7\u7801\u5FC5\u586B",
20410
20407
  autoComplete: "off"
20411
20408
  })))), /*#__PURE__*/React.createElement(Col, {
20412
20409
  span: 6
@@ -20418,7 +20415,7 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
20418
20415
  }, getFieldDecorator('nationality', {
20419
20416
  rules: [{
20420
20417
  required: true,
20421
- message: '数据必填'
20418
+ message: '国籍必填'
20422
20419
  }, {
20423
20420
  validator: validateNationality
20424
20421
  }]
@@ -20435,21 +20432,44 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
20435
20432
  return false;
20436
20433
  },
20437
20434
  readOnly: isReadOnly('nationality'),
20438
- placeholder: "\u6570\u636E\u5FC5\u586B",
20435
+ placeholder: "\u56FD\u7C4D\u5FC5\u586B",
20439
20436
  autoComplete: "off"
20440
20437
  }))))))));
20441
20438
  });
20442
20439
 
20443
20440
  function NaturalPersonFlag(props) {
20444
- var _React$useState13 = React.useState(props.value || 'COMPANY'),
20445
- _React$useState14 = _slicedToArray(_React$useState13, 2),
20446
- value = _React$useState14[0],
20447
- setValue = _React$useState14[1];
20441
+ var controller = Invoice.useInvoiceController();
20442
+
20443
+ var _React$useState11 = React.useState(props.value || 'COMPANY'),
20444
+ _React$useState12 = _slicedToArray(_React$useState11, 2),
20445
+ value = _React$useState12[0],
20446
+ setValue = _React$useState12[1];
20448
20447
 
20449
20448
  var onChange = React.useCallback(function (e) {
20450
20449
  if (props.readOnly) return;
20451
- setValue(e.target.checked ? 'NATURAL' : 'COMPANY');
20452
- props.onChange && props.onChange(e.target.checked ? 'NATURAL' : 'COMPANY');
20450
+ var naturalPersonFlag = e.target.checked ? 'NATURAL' : 'COMPANY';
20451
+ setValue(naturalPersonFlag);
20452
+ controller.pipeline( /*#__PURE__*/function () {
20453
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
20454
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
20455
+ while (1) {
20456
+ switch (_context.prev = _context.next) {
20457
+ case 0:
20458
+ s.stakeholder.naturalPersonFlag = naturalPersonFlag;
20459
+
20460
+ case 1:
20461
+ case "end":
20462
+ return _context.stop();
20463
+ }
20464
+ }
20465
+ }, _callee);
20466
+ }));
20467
+
20468
+ return function (_x) {
20469
+ return _ref.apply(this, arguments);
20470
+ };
20471
+ }())();
20472
+ props.onChange && props.onChange(naturalPersonFlag);
20453
20473
  }, [props.onChange, props.readOnly]);
20454
20474
  React.useEffect(function () {
20455
20475
  setValue(props.value || 'COMPANY');
@@ -20472,10 +20492,10 @@ function BuyerNameInput$1(props) {
20472
20492
  return s.autoComplete;
20473
20493
  }, []);
20474
20494
 
20475
- var _React$useState15 = React.useState([]),
20476
- _React$useState16 = _slicedToArray(_React$useState15, 2),
20477
- options = _React$useState16[0],
20478
- setOptions = _React$useState16[1];
20495
+ var _React$useState13 = React.useState([]),
20496
+ _React$useState14 = _slicedToArray(_React$useState13, 2),
20497
+ options = _React$useState14[0],
20498
+ setOptions = _React$useState14[1];
20479
20499
 
20480
20500
  var onChangeAutoComplete = React.useCallback(function (value) {
20481
20501
  var record = options.filter(function (e) {
@@ -20486,78 +20506,78 @@ function BuyerNameInput$1(props) {
20486
20506
  setOptions([]);
20487
20507
  }, [options, fieldName, form]);
20488
20508
  var onSearch = React.useCallback( /*#__PURE__*/function () {
20489
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(searchText) {
20490
- return _regeneratorRuntime().wrap(function _callee$(_context) {
20509
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(searchText) {
20510
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
20491
20511
  while (1) {
20492
- switch (_context.prev = _context.next) {
20512
+ switch (_context2.prev = _context2.next) {
20493
20513
  case 0:
20494
- _context.next = 2;
20514
+ _context2.next = 2;
20495
20515
  return Discontinue.start();
20496
20516
 
20497
20517
  case 2:
20498
- _context.prev = 2;
20518
+ _context2.prev = 2;
20499
20519
 
20500
20520
  if (!(fieldName === 'buyerName')) {
20501
- _context.next = 12;
20521
+ _context2.next = 12;
20502
20522
  break;
20503
20523
  }
20504
20524
 
20505
20525
  if (!autoComplete.onBuyerNameSearch) {
20506
- _context.next = 10;
20526
+ _context2.next = 10;
20507
20527
  break;
20508
20528
  }
20509
20529
 
20510
- _context.t0 = setOptions;
20511
- _context.next = 8;
20530
+ _context2.t0 = setOptions;
20531
+ _context2.next = 8;
20512
20532
  return autoComplete.onBuyerNameSearch(searchText);
20513
20533
 
20514
20534
  case 8:
20515
- _context.t1 = _context.sent;
20516
- (0, _context.t0)(_context.t1);
20535
+ _context2.t1 = _context2.sent;
20536
+ (0, _context2.t0)(_context2.t1);
20517
20537
 
20518
20538
  case 10:
20519
- _context.next = 19;
20539
+ _context2.next = 19;
20520
20540
  break;
20521
20541
 
20522
20542
  case 12:
20523
20543
  if (!(fieldName === 'buyerTaxId')) {
20524
- _context.next = 19;
20544
+ _context2.next = 19;
20525
20545
  break;
20526
20546
  }
20527
20547
 
20528
20548
  if (!autoComplete.onBuyerTaxIdSearch) {
20529
- _context.next = 19;
20549
+ _context2.next = 19;
20530
20550
  break;
20531
20551
  }
20532
20552
 
20533
- _context.t2 = setOptions;
20534
- _context.next = 17;
20553
+ _context2.t2 = setOptions;
20554
+ _context2.next = 17;
20535
20555
  return autoComplete.onBuyerTaxIdSearch(searchText);
20536
20556
 
20537
20557
  case 17:
20538
- _context.t3 = _context.sent;
20539
- (0, _context.t2)(_context.t3);
20558
+ _context2.t3 = _context2.sent;
20559
+ (0, _context2.t2)(_context2.t3);
20540
20560
 
20541
20561
  case 19:
20542
- _context.next = 25;
20562
+ _context2.next = 25;
20543
20563
  break;
20544
20564
 
20545
20565
  case 21:
20546
- _context.prev = 21;
20547
- _context.t4 = _context["catch"](2);
20566
+ _context2.prev = 21;
20567
+ _context2.t4 = _context2["catch"](2);
20548
20568
  setOptions([]);
20549
- throw _context.t4;
20569
+ throw _context2.t4;
20550
20570
 
20551
20571
  case 25:
20552
20572
  case "end":
20553
- return _context.stop();
20573
+ return _context2.stop();
20554
20574
  }
20555
20575
  }
20556
- }, _callee, null, [[2, 21]]);
20576
+ }, _callee2, null, [[2, 21]]);
20557
20577
  }));
20558
20578
 
20559
- return function (_x) {
20560
- return _ref.apply(this, arguments);
20579
+ return function (_x2) {
20580
+ return _ref2.apply(this, arguments);
20561
20581
  };
20562
20582
  }(), [autoComplete.onBuyerNameSearch, fieldName]);
20563
20583
  if (props.readOnly) return /*#__PURE__*/React.createElement("span", {
package/dist/index.js CHANGED
@@ -1381,6 +1381,7 @@ var Stakeholder = /*#__PURE__*/_createClass(function Stakeholder() {
1381
1381
  this.disableds = void 0;
1382
1382
  this.enables = void 0;
1383
1383
  this.rulesMap = void 0;
1384
+ this.naturalPersonFlag = void 0;
1384
1385
  });
1385
1386
 
1386
1387
  /** 自动补全 */
@@ -19730,37 +19731,33 @@ var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
19730
19731
  allowEditFlag = props.allowEditFlag,
19731
19732
  onClickImportButton = props.onClickImportButton,
19732
19733
  _props$isVatNormal = props.isVatNormal,
19733
- isVatNormal = _props$isVatNormal === void 0 ? false : _props$isVatNormal;
19734
+ isVatNormal = _props$isVatNormal === void 0 ? false : _props$isVatNormal,
19735
+ changeNaturalPersonFlag = props.changeNaturalPersonFlag;
19734
19736
 
19735
19737
  var _React$useState = React__default['default'].useState(typeof props.isExpand === 'boolean' ? props.isExpand : true),
19736
19738
  _React$useState2 = _slicedToArray(_React$useState, 2),
19737
19739
  isExpand = _React$useState2[0],
19738
19740
  setExpand = _React$useState2[1];
19739
19741
 
19740
- var _React$useState3 = React__default['default'].useState(props.naturalPersonFlag ? props.naturalPersonFlag : 'COMPANY'),
19742
+ var _React$useState3 = React__default['default'].useState(''),
19741
19743
  _React$useState4 = _slicedToArray(_React$useState3, 2),
19742
- naturalPersonFlag = _React$useState4[0],
19743
- setNaturalPersonFlag = _React$useState4[1];
19744
+ validateStatus = _React$useState4[0],
19745
+ setStatus = _React$useState4[1];
19744
19746
 
19745
19747
  var _React$useState5 = React__default['default'].useState(''),
19746
19748
  _React$useState6 = _slicedToArray(_React$useState5, 2),
19747
- validateStatus = _React$useState6[0],
19748
- setStatus = _React$useState6[1];
19749
+ errorInfo = _React$useState6[0],
19750
+ setInfo = _React$useState6[1];
19749
19751
 
19750
19752
  var _React$useState7 = React__default['default'].useState(''),
19751
19753
  _React$useState8 = _slicedToArray(_React$useState7, 2),
19752
- errorInfo = _React$useState8[0],
19753
- setInfo = _React$useState8[1];
19754
+ nation = _React$useState8[0],
19755
+ setNationStatue = _React$useState8[1];
19754
19756
 
19755
19757
  var _React$useState9 = React__default['default'].useState(''),
19756
19758
  _React$useState10 = _slicedToArray(_React$useState9, 2),
19757
- nation = _React$useState10[0],
19758
- setNationStatue = _React$useState10[1];
19759
-
19760
- var _React$useState11 = React__default['default'].useState(''),
19761
- _React$useState12 = _slicedToArray(_React$useState11, 2),
19762
- nationInfo = _React$useState12[0],
19763
- setNation = _React$useState12[1];
19759
+ nationInfo = _React$useState10[0],
19760
+ setNation = _React$useState10[1];
19764
19761
 
19765
19762
  var getFieldDecorator = form.getFieldDecorator;
19766
19763
  var controller = Invoice.useInvoiceController();
@@ -19773,6 +19770,9 @@ var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
19773
19770
  var rulesMap = controller.useMemo(function (s) {
19774
19771
  return s.stakeholder.rulesMap || {};
19775
19772
  }, []);
19773
+ var naturalPersonFlag = controller.useMemo(function (s) {
19774
+ return s.stakeholder.naturalPersonFlag || 'COMPANY';
19775
+ }, []);
19776
19776
  /** 乐企 */
19777
19777
 
19778
19778
  var leqispanW = React__default['default'].useMemo(function () {
@@ -19816,9 +19816,6 @@ var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
19816
19816
  React__default['default'].useEffect(function () {
19817
19817
  setExpand(typeof props.isExpand === 'boolean' ? props.isExpand : true);
19818
19818
  }, [props.isExpand]);
19819
- React__default['default'].useEffect(function () {
19820
- setNaturalPersonFlag(props.naturalPersonFlag ? props.naturalPersonFlag : 'COMPANY');
19821
- }, [props.naturalPersonFlag]);
19822
19819
  var onChangeType = React__default['default'].useCallback(function (value) {
19823
19820
  var buyerTaxId = form === null || form === void 0 ? void 0 : form.getFieldValue("buyerTaxId");
19824
19821
  var certificateNumber = form === null || form === void 0 ? void 0 : form.getFieldValue("certificateNumber");
@@ -20088,7 +20085,7 @@ var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
20088
20085
  colon: false
20089
20086
  }, getFieldDecorator('naturalPersonFlag', {})( /*#__PURE__*/React__default['default'].createElement(NaturalPersonFlag, {
20090
20087
  readOnly: isReadOnly('naturalPersonFlag'),
20091
- onChange: setNaturalPersonFlag
20088
+ onChange: changeNaturalPersonFlag
20092
20089
  })))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form, {
20093
20090
  className: "digtal-stakeholder-form"
20094
20091
  }, /*#__PURE__*/React__default['default'].createElement(ktsXui.Row, {
@@ -20390,12 +20387,12 @@ var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
20390
20387
  }, getFieldDecorator('certificateType', {
20391
20388
  rules: [{
20392
20389
  required: true,
20393
- message: '数据必填'
20390
+ message: '证件类型必填'
20394
20391
  }]
20395
20392
  })( /*#__PURE__*/React__default['default'].createElement(CardSelect, {
20396
20393
  onChange: onChangeType,
20397
20394
  readOnly: isReadOnly('certificateType'),
20398
- placeholder: "\u6570\u636E\u5FC5\u586B",
20395
+ placeholder: "\u8BC1\u4EF6\u7C7B\u578B\u5FC5\u586B",
20399
20396
  autoComplete: "off"
20400
20397
  })))), /*#__PURE__*/React__default['default'].createElement(ktsXui.Col, {
20401
20398
  span: 7
@@ -20407,7 +20404,7 @@ var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
20407
20404
  }, getFieldDecorator('certificateNumber', {
20408
20405
  rules: [{
20409
20406
  required: true,
20410
- message: '数据必填'
20407
+ message: '证件号码必填'
20411
20408
  }, {
20412
20409
  max: 30,
20413
20410
  message: "\u5185\u5BB9\u8D85\u957F"
@@ -20416,7 +20413,7 @@ var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
20416
20413
  }]
20417
20414
  })( /*#__PURE__*/React__default['default'].createElement(MyInput$1, {
20418
20415
  readOnly: isReadOnly('certificateNumber'),
20419
- placeholder: "\u6570\u636E\u5FC5\u586B",
20416
+ placeholder: "\u8BC1\u4EF6\u53F7\u7801\u5FC5\u586B",
20420
20417
  autoComplete: "off"
20421
20418
  })))), /*#__PURE__*/React__default['default'].createElement(ktsXui.Col, {
20422
20419
  span: 6
@@ -20428,7 +20425,7 @@ var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
20428
20425
  }, getFieldDecorator('nationality', {
20429
20426
  rules: [{
20430
20427
  required: true,
20431
- message: '数据必填'
20428
+ message: '国籍必填'
20432
20429
  }, {
20433
20430
  validator: validateNationality
20434
20431
  }]
@@ -20445,21 +20442,44 @@ var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
20445
20442
  return false;
20446
20443
  },
20447
20444
  readOnly: isReadOnly('nationality'),
20448
- placeholder: "\u6570\u636E\u5FC5\u586B",
20445
+ placeholder: "\u56FD\u7C4D\u5FC5\u586B",
20449
20446
  autoComplete: "off"
20450
20447
  }))))))));
20451
20448
  });
20452
20449
 
20453
20450
  function NaturalPersonFlag(props) {
20454
- var _React$useState13 = React__default['default'].useState(props.value || 'COMPANY'),
20455
- _React$useState14 = _slicedToArray(_React$useState13, 2),
20456
- value = _React$useState14[0],
20457
- setValue = _React$useState14[1];
20451
+ var controller = Invoice.useInvoiceController();
20452
+
20453
+ var _React$useState11 = React__default['default'].useState(props.value || 'COMPANY'),
20454
+ _React$useState12 = _slicedToArray(_React$useState11, 2),
20455
+ value = _React$useState12[0],
20456
+ setValue = _React$useState12[1];
20458
20457
 
20459
20458
  var onChange = React__default['default'].useCallback(function (e) {
20460
20459
  if (props.readOnly) return;
20461
- setValue(e.target.checked ? 'NATURAL' : 'COMPANY');
20462
- props.onChange && props.onChange(e.target.checked ? 'NATURAL' : 'COMPANY');
20460
+ var naturalPersonFlag = e.target.checked ? 'NATURAL' : 'COMPANY';
20461
+ setValue(naturalPersonFlag);
20462
+ controller.pipeline( /*#__PURE__*/function () {
20463
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
20464
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
20465
+ while (1) {
20466
+ switch (_context.prev = _context.next) {
20467
+ case 0:
20468
+ s.stakeholder.naturalPersonFlag = naturalPersonFlag;
20469
+
20470
+ case 1:
20471
+ case "end":
20472
+ return _context.stop();
20473
+ }
20474
+ }
20475
+ }, _callee);
20476
+ }));
20477
+
20478
+ return function (_x) {
20479
+ return _ref.apply(this, arguments);
20480
+ };
20481
+ }())();
20482
+ props.onChange && props.onChange(naturalPersonFlag);
20463
20483
  }, [props.onChange, props.readOnly]);
20464
20484
  React__default['default'].useEffect(function () {
20465
20485
  setValue(props.value || 'COMPANY');
@@ -20482,10 +20502,10 @@ function BuyerNameInput$1(props) {
20482
20502
  return s.autoComplete;
20483
20503
  }, []);
20484
20504
 
20485
- var _React$useState15 = React__default['default'].useState([]),
20486
- _React$useState16 = _slicedToArray(_React$useState15, 2),
20487
- options = _React$useState16[0],
20488
- setOptions = _React$useState16[1];
20505
+ var _React$useState13 = React__default['default'].useState([]),
20506
+ _React$useState14 = _slicedToArray(_React$useState13, 2),
20507
+ options = _React$useState14[0],
20508
+ setOptions = _React$useState14[1];
20489
20509
 
20490
20510
  var onChangeAutoComplete = React__default['default'].useCallback(function (value) {
20491
20511
  var record = options.filter(function (e) {
@@ -20496,78 +20516,78 @@ function BuyerNameInput$1(props) {
20496
20516
  setOptions([]);
20497
20517
  }, [options, fieldName, form]);
20498
20518
  var onSearch = React__default['default'].useCallback( /*#__PURE__*/function () {
20499
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(searchText) {
20500
- return _regeneratorRuntime().wrap(function _callee$(_context) {
20519
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(searchText) {
20520
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
20501
20521
  while (1) {
20502
- switch (_context.prev = _context.next) {
20522
+ switch (_context2.prev = _context2.next) {
20503
20523
  case 0:
20504
- _context.next = 2;
20524
+ _context2.next = 2;
20505
20525
  return Discontinue.start();
20506
20526
 
20507
20527
  case 2:
20508
- _context.prev = 2;
20528
+ _context2.prev = 2;
20509
20529
 
20510
20530
  if (!(fieldName === 'buyerName')) {
20511
- _context.next = 12;
20531
+ _context2.next = 12;
20512
20532
  break;
20513
20533
  }
20514
20534
 
20515
20535
  if (!autoComplete.onBuyerNameSearch) {
20516
- _context.next = 10;
20536
+ _context2.next = 10;
20517
20537
  break;
20518
20538
  }
20519
20539
 
20520
- _context.t0 = setOptions;
20521
- _context.next = 8;
20540
+ _context2.t0 = setOptions;
20541
+ _context2.next = 8;
20522
20542
  return autoComplete.onBuyerNameSearch(searchText);
20523
20543
 
20524
20544
  case 8:
20525
- _context.t1 = _context.sent;
20526
- (0, _context.t0)(_context.t1);
20545
+ _context2.t1 = _context2.sent;
20546
+ (0, _context2.t0)(_context2.t1);
20527
20547
 
20528
20548
  case 10:
20529
- _context.next = 19;
20549
+ _context2.next = 19;
20530
20550
  break;
20531
20551
 
20532
20552
  case 12:
20533
20553
  if (!(fieldName === 'buyerTaxId')) {
20534
- _context.next = 19;
20554
+ _context2.next = 19;
20535
20555
  break;
20536
20556
  }
20537
20557
 
20538
20558
  if (!autoComplete.onBuyerTaxIdSearch) {
20539
- _context.next = 19;
20559
+ _context2.next = 19;
20540
20560
  break;
20541
20561
  }
20542
20562
 
20543
- _context.t2 = setOptions;
20544
- _context.next = 17;
20563
+ _context2.t2 = setOptions;
20564
+ _context2.next = 17;
20545
20565
  return autoComplete.onBuyerTaxIdSearch(searchText);
20546
20566
 
20547
20567
  case 17:
20548
- _context.t3 = _context.sent;
20549
- (0, _context.t2)(_context.t3);
20568
+ _context2.t3 = _context2.sent;
20569
+ (0, _context2.t2)(_context2.t3);
20550
20570
 
20551
20571
  case 19:
20552
- _context.next = 25;
20572
+ _context2.next = 25;
20553
20573
  break;
20554
20574
 
20555
20575
  case 21:
20556
- _context.prev = 21;
20557
- _context.t4 = _context["catch"](2);
20576
+ _context2.prev = 21;
20577
+ _context2.t4 = _context2["catch"](2);
20558
20578
  setOptions([]);
20559
- throw _context.t4;
20579
+ throw _context2.t4;
20560
20580
 
20561
20581
  case 25:
20562
20582
  case "end":
20563
- return _context.stop();
20583
+ return _context2.stop();
20564
20584
  }
20565
20585
  }
20566
- }, _callee, null, [[2, 21]]);
20586
+ }, _callee2, null, [[2, 21]]);
20567
20587
  }));
20568
20588
 
20569
- return function (_x) {
20570
- return _ref.apply(this, arguments);
20589
+ return function (_x2) {
20590
+ return _ref2.apply(this, arguments);
20571
20591
  };
20572
20592
  }(), [autoComplete.onBuyerNameSearch, fieldName]);
20573
20593
  if (props.readOnly) return /*#__PURE__*/React__default['default'].createElement("span", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.261",
3
+ "version": "3.2.262",
4
4
  "scripts": {
5
5
  "dev": "dumi dev --max-old-space-size=6096",
6
6
  "start": "dumi dev",
@@ -11,4 +11,8 @@ export default class Stakeholder {
11
11
 
12
12
  /** 字段字段规则 */
13
13
  rulesMap?: { [key: string]: ValidationRule[] | undefined }
14
+
15
+ /** 自然人标志 */
16
+ naturalPersonFlag?: any;
17
+
14
18
  }
@@ -68,9 +68,6 @@ export interface IStakeholder {
68
68
  /** 是否可以选择自然人 */
69
69
  isNaturalPerson?: boolean;
70
70
 
71
- /** 是否是自然人标志 */
72
- naturalPersonFlag?: any;
73
-
74
71
  /** 是否展开 */
75
72
  isExpand?: boolean;
76
73
 
@@ -84,17 +81,17 @@ export interface IStakeholder {
84
81
  riskData?: boolean;
85
82
 
86
83
  invoiceMarkCallback?: (value: any) => void;
84
+
85
+ changeNaturalPersonFlag?: (value: any) => void;
87
86
  }
88
87
 
89
88
  /** 干系人 */
90
89
  export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.create())(props => {
91
90
 
92
- const { form, isShowImportButton, allowEditFlag, onClickImportButton, isVatNormal = false } = props;
91
+ const { form, isShowImportButton, allowEditFlag, onClickImportButton, isVatNormal = false, changeNaturalPersonFlag } = props;
93
92
 
94
93
  const [isExpand, setExpand] = React.useState(typeof props.isExpand === 'boolean' ? props.isExpand : true);
95
94
 
96
- const [naturalPersonFlag, setNaturalPersonFlag] = React.useState(props.naturalPersonFlag ? props.naturalPersonFlag : 'COMPANY');
97
-
98
95
  const [validateStatus, setStatus] = React.useState<any>('');
99
96
  const [errorInfo, setInfo] = React.useState('');
100
97
  const [nation, setNationStatue] = React.useState<any>('');
@@ -109,6 +106,9 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
109
106
  const disableds = controller.useMemo(s => s.stakeholder.disableds || [], []);
110
107
 
111
108
  const rulesMap = controller.useMemo(s => s.stakeholder.rulesMap || {}, []);
109
+
110
+ const naturalPersonFlag = controller.useMemo(s => s.stakeholder.naturalPersonFlag || 'COMPANY', []);
111
+
112
112
  /** 乐企 */
113
113
  const leqispanW = React.useMemo(() => {
114
114
  if (props.leqi) {
@@ -149,10 +149,6 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
149
149
  setExpand(typeof props.isExpand === 'boolean' ? props.isExpand : true);
150
150
  }, [props.isExpand])
151
151
 
152
- React.useEffect(() => {
153
- setNaturalPersonFlag(props.naturalPersonFlag ? props.naturalPersonFlag : 'COMPANY');
154
- }, [props.naturalPersonFlag])
155
-
156
152
  const onChangeType = React.useCallback(
157
153
  (value: string) => {
158
154
  const buyerTaxId = form?.getFieldValue("buyerTaxId");
@@ -429,7 +425,7 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
429
425
  <Form.Item colon={false}>
430
426
  {getFieldDecorator('naturalPersonFlag', {
431
427
  })(
432
- <NaturalPersonFlag readOnly={isReadOnly('naturalPersonFlag')} onChange={setNaturalPersonFlag} />
428
+ <NaturalPersonFlag readOnly={isReadOnly('naturalPersonFlag')} onChange={changeNaturalPersonFlag} />
433
429
  )}
434
430
  </Form.Item>
435
431
  }
@@ -634,21 +630,21 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
634
630
  <Col span={6} >
635
631
  <Form.Item label='证件类型' colon={false} >
636
632
  {getFieldDecorator('certificateType', {
637
- rules: [{ required: true, message: '数据必填' }]
638
- })(<CardSelect onChange={onChangeType} readOnly={isReadOnly('certificateType')} placeholder="数据必填" autoComplete="off" />)}
633
+ rules: [{ required: true, message: '证件类型必填' }]
634
+ })(<CardSelect onChange={onChangeType} readOnly={isReadOnly('certificateType')} placeholder="证件类型必填" autoComplete="off" />)}
639
635
  </Form.Item>
640
636
  </Col>
641
637
  <Col span={7} >
642
638
  <Form.Item label='证件号码' colon={false} validateStatus={validateStatus} help={errorInfo}>
643
639
  {getFieldDecorator('certificateNumber', {
644
- rules: [{ required: true, message: '数据必填' }, { max: 30, message: `内容超长` }, { validator: validateIDCode },]
645
- })(<MyInput readOnly={isReadOnly('certificateNumber')} placeholder="数据必填" autoComplete="off" />)}
640
+ rules: [{ required: true, message: '证件号码必填' }, { max: 30, message: `内容超长` }, { validator: validateIDCode },]
641
+ })(<MyInput readOnly={isReadOnly('certificateNumber')} placeholder="证件号码必填" autoComplete="off" />)}
646
642
  </Form.Item>
647
643
  </Col>
648
644
  <Col span={6} >
649
645
  <Form.Item label='国籍(或地区)' colon={false} validateStatus={nation} help={nationInfo}>
650
646
  {getFieldDecorator('nationality', {
651
- rules: [{ required: true, message: '数据必填' }, { validator: validateNationality }]
647
+ rules: [{ required: true, message: '国籍必填' }, { validator: validateNationality }]
652
648
  })(<NationalSelect showSearch={true}
653
649
  optionFilterProp="children"
654
650
  filterOption={(input: any, option: any) => {
@@ -656,7 +652,7 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
656
652
  return option.label?.indexOf(input) >= 0;
657
653
  }
658
654
  return false;
659
- }} readOnly={isReadOnly('nationality')} placeholder="数据必填" autoComplete="off" />)}
655
+ }} readOnly={isReadOnly('nationality')} placeholder="国籍必填" autoComplete="off" />)}
660
656
  </Form.Item>
661
657
  </Col>
662
658
  </Row>
@@ -674,12 +670,18 @@ function NaturalPersonFlag(props: {
674
670
  readOnly?: boolean;
675
671
  }) {
676
672
 
673
+ const controller = Invoice.useInvoiceController();
674
+
677
675
  const [value, setValue] = React.useState(props.value || 'COMPANY');
678
676
 
679
677
  const onChange = React.useCallback((e: CheckboxChangeEvent) => {
680
678
  if (props.readOnly) return;
681
- setValue(e.target.checked ? 'NATURAL' : 'COMPANY');
682
- props.onChange && props.onChange(e.target.checked ? 'NATURAL' : 'COMPANY');
679
+ const naturalPersonFlag = e.target.checked ? 'NATURAL' : 'COMPANY'
680
+ setValue(naturalPersonFlag);
681
+ controller.pipeline(async (s) => {
682
+ s.stakeholder.naturalPersonFlag = naturalPersonFlag
683
+ })();
684
+ props.onChange && props.onChange(naturalPersonFlag);
683
685
  }, [props.onChange, props.readOnly])
684
686
 
685
687
  React.useEffect(() => {