kts-component-invoice-operate 3.2.214 → 3.3.2

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.
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  import './index.less';
3
+ import InvoiceController from "../../../InvoiceController";
3
4
  export interface RealEstateInfoProps {
4
5
  /**
5
6
  * 建筑服务地址数据
@@ -9,6 +10,11 @@ export interface RealEstateInfoProps {
9
10
  * 建筑服务地址数据字段名
10
11
  */
11
12
  fieldNames?: any;
13
+ onRegionalSelect?: (value: boolean) => void;
14
+ /** 点击了 */
15
+ onClickImportButton?: (e: InvoiceController) => void;
16
+ demo?: boolean;
17
+ region?: boolean;
12
18
  }
13
19
  /** 特殊信息-建筑服务 */
14
20
  declare const _default: React.FunctionComponent<RealEstateInfoProps>;
package/dist/index.esm.js CHANGED
@@ -8,7 +8,7 @@ import { message as message$1, TableManual, Switch, AutoComplete as AutoComplete
8
8
  import classnames from 'classnames';
9
9
  import { Table } from 'kts-components-antd-x4-v4';
10
10
  import { render } from 'react-dom';
11
- import { DatePicker, Row as Row$1, Col as Col$1, Cascader, Input as Input$2, Select as Select$2 } from 'kts-components-antd-x4';
11
+ import { DatePicker, Row as Row$1, Col as Col$1, Cascader, Input as Input$2, Select as Select$2, Button as Button$2 } from 'kts-components-antd-x4';
12
12
  import { Input as Input$3, NumberPicker } from '@formily/antd-components';
13
13
  import { createAsyncFormActions, FormEffectHooks, SchemaForm, FormButtonGroup, SchemaMarkupField } from '@formily/antd';
14
14
 
@@ -24529,21 +24529,59 @@ var MyNY = /*#__PURE__*/function (_React$Component4) {
24529
24529
  var css_248z$s = ".kts-invoice-operate-real-estate-info-digtal {\n padding: 20px;\n border-bottom: 2px solid #9F613E;\n border-left: 2px solid #9F613E;\n border-right: 2px solid #9F613E;\n}\n.kts-invoice-operate-real-estate-info-digtal .real-estate-info-digtal-label {\n color: #9F613E;\n font-weight: bold;\n}\n.kts-invoice-operate-real-estate-info-digtal .ktsAnt3x-row.ktsAnt3x-form-item {\n margin-bottom: 0;\n}\n.kts-invoice-operate-real-estate-info-digtal .break-word {\n word-break: break-word;\n}\n";
24530
24530
  styleInject(css_248z$s);
24531
24531
 
24532
+ var _g$4, _defs$6;
24533
+
24534
+ function _extends$e() { _extends$e = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$e.apply(this, arguments); }
24535
+
24536
+ function SvgPlus$3(props) {
24537
+ return /*#__PURE__*/createElement("svg", _extends$e({
24538
+ xmlns: "http://www.w3.org/2000/svg",
24539
+ width: 16,
24540
+ height: 15,
24541
+ fill: "none"
24542
+ }, props), _g$4 || (_g$4 = /*#__PURE__*/createElement("g", {
24543
+ clipPath: "url(#plus_svg__clip0_715_360)"
24544
+ }, /*#__PURE__*/createElement("path", {
24545
+ d: "M8 14.531A7.031 7.031 0 118 .468a7.031 7.031 0 010 14.063zm0-.937A6.094 6.094 0 108 1.406a6.094 6.094 0 000 12.188z"
24546
+ }), /*#__PURE__*/createElement("path", {
24547
+ d: "M4.25 7.969a.469.469 0 010-.938h7.5a.47.47 0 010 .938h-7.5z"
24548
+ }), /*#__PURE__*/createElement("path", {
24549
+ d: "M7.531 3.75a.469.469 0 01.938 0v7.5a.47.47 0 01-.938 0v-7.5z"
24550
+ }))), _defs$6 || (_defs$6 = /*#__PURE__*/createElement("defs", null, /*#__PURE__*/createElement("clipPath", {
24551
+ id: "plus_svg__clip0_715_360"
24552
+ }, /*#__PURE__*/createElement("path", {
24553
+ transform: "translate(.5)",
24554
+ d: "M0 0h15v15H0z"
24555
+ })))));
24556
+ }
24557
+
24532
24558
  /** 特殊信息-建筑服务 */
24533
24559
 
24534
24560
  var Architecture = decorator(Form.create())(function (props) {
24535
24561
  /** 控制器 */
24536
24562
  var controller = Invoice.useInvoiceController();
24537
- var form = props.form;
24563
+ var form = props.form,
24564
+ onClickImportButton = props.onClickImportButton;
24538
24565
  var getFieldDecorator = form.getFieldDecorator;
24539
24566
  var model = controller.useMemo(function (s) {
24540
24567
  return s.model;
24541
24568
  }, []);
24542
24569
  var readOnly = React.useMemo(function () {
24543
24570
  return model === 'readOnly';
24544
- }, [model]); // 注册 form
24571
+ }, [model]);
24572
+
24573
+ var _React$useState = React.useState( props.region),
24574
+ _React$useState2 = _slicedToArray(_React$useState, 2),
24575
+ region = _React$useState2[0],
24576
+ setRegion = _React$useState2[1]; // 注册 form
24577
+
24545
24578
 
24546
24579
  controller.useForm('serviceDataDtoInfo', form);
24580
+
24581
+ var onSelectChange = function onSelectChange(value) {
24582
+ setRegion(value === 'Y' ? true : false); // props.onRegionalSelect && props.onRegionalSelect(value);
24583
+ };
24584
+
24547
24585
  return /*#__PURE__*/React.createElement("div", {
24548
24586
  className: "kts-invoice-operate-real-estate-info-digtal"
24549
24587
  }, /*#__PURE__*/React.createElement("div", {
@@ -24610,6 +24648,7 @@ var Architecture = decorator(Form.create())(function (props) {
24610
24648
  message: '请选择跨地(市)标志'
24611
24649
  }]
24612
24650
  })(readOnly ? /*#__PURE__*/React.createElement(MyNY$1, null) : /*#__PURE__*/React.createElement(Select$2, {
24651
+ onChange: onSelectChange,
24613
24652
  placeholder: "\u8BF7\u9009\u62E9",
24614
24653
  style: {
24615
24654
  width: '100%'
@@ -24618,7 +24657,58 @@ var Architecture = decorator(Form.create())(function (props) {
24618
24657
  value: 'Y'
24619
24658
  }, "\u662F"), /*#__PURE__*/React.createElement(Select$2.Option, {
24620
24659
  value: 'N'
24621
- }, "\u5426"))))), /*#__PURE__*/React.createElement(Col$1, {
24660
+ }, "\u5426"))))), props.demo && region && /*#__PURE__*/React.createElement(Col$1, {
24661
+ span: 6
24662
+ }, /*#__PURE__*/React.createElement(Form.Item, {
24663
+ label: "\u6D89\u7A0E\u4E8B\u9879\u7F16\u53F7",
24664
+ colon: false
24665
+ }, getFieldDecorator('taxMatterNo', {
24666
+ rules: readOnly ? [] : [{
24667
+ required: true,
24668
+ message: '请选择'
24669
+ }, {
24670
+ validator: function validator(_, value, callback) {
24671
+ var constructAddress = form.getFieldValue('constructAddress');
24672
+ var region = form.getFieldValue('division');
24673
+ console.log(constructAddress.join(''), region);
24674
+
24675
+ if (constructAddress.join('') === region) {
24676
+ callback();
24677
+ } else {
24678
+ callback('建筑服务发生地与税务事项地址不一致');
24679
+ }
24680
+ }
24681
+ }]
24682
+ })(readOnly ? /*#__PURE__*/React.createElement(MyDiv$4, null) : /*#__PURE__*/React.createElement(Input$2, {
24683
+ autoComplete: "off",
24684
+ disabled: true,
24685
+ suffix: /*#__PURE__*/React.createElement(Button$2, {
24686
+ type: 'link',
24687
+ style: {
24688
+ padding: 0,
24689
+ width: 20,
24690
+ height: '100%'
24691
+ },
24692
+ icon: /*#__PURE__*/React.createElement(Icon, {
24693
+ component: SvgPlus$3
24694
+ }),
24695
+ onClick: function onClick() {
24696
+ onClickImportButton && onClickImportButton(controller);
24697
+ }
24698
+ })
24699
+ })))), props.demo && region && /*#__PURE__*/React.createElement(Col$1, {
24700
+ span: 6,
24701
+ style: {
24702
+ display: 'none'
24703
+ }
24704
+ }, /*#__PURE__*/React.createElement(Form.Item, {
24705
+ label: 'division',
24706
+ colon: false
24707
+ }, getFieldDecorator('division', {
24708
+ rules: []
24709
+ })(readOnly ? /*#__PURE__*/React.createElement(MyDiv$4, null) : /*#__PURE__*/React.createElement(Input$2, {
24710
+ autoComplete: "off"
24711
+ })))), /*#__PURE__*/React.createElement(Col$1, {
24622
24712
  span: 6
24623
24713
  }, /*#__PURE__*/React.createElement(Form.Item, {
24624
24714
  label: "\u5EFA\u7B51\u9879\u76EE\u540D\u79F0"
@@ -24737,7 +24827,13 @@ var MyNY$1 = /*#__PURE__*/function (_React$Component4) {
24737
24827
  }]);
24738
24828
 
24739
24829
  return MyNY;
24740
- }(React.Component);
24830
+ }(React.Component); // function BuyerNameInput(props: InputProps & { fieldName: string; myform: WrappedFormUtils<any> }) {
24831
+ // const { fieldName, myform: form } = props;
24832
+ // if (props.readOnly) return <span className='digtal-stakeholder-form-text'>{props.value}</span>;
24833
+ // return (
24834
+ // <Input disabled={true} {...props} style={{ width: '100%', ...props.style }} />
24835
+ // )
24836
+ // }
24741
24837
 
24742
24838
  var css_248z$t = ".kts-invoice-operate-goods-table-virtual .ktsAntX-table-body {\n height: 280px;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table.ktsAntX-table-bordered > .ktsAntX-table-container > .ktsAntX-table-header > table > thead > tr > th {\n padding: 0 10px;\n height: 32px;\n background: #f4f4f4;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table.ktsAntX-table-bordered > .ktsAntX-table-container > .ktsAntX-table-body > table > tbody > tr > td {\n padding: 0;\n height: 32px;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table .ktsAntX-table-body {\n position: relative;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table .ktsAntX-table-body > table {\n position: absolute;\n left: 0;\n top: 0;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table .ktsAntX-table-tbody {\n position: relative;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-checkbox-wrapper .ktsAntX-checkbox-inner {\n width: 16px;\n height: 16px;\n border: 1px solid #d9d9d9;\n border-radius: 2px;\n top: 1px;\n}\n";
24743
24839
  styleInject(css_248z$t);
package/dist/index.js CHANGED
@@ -24539,21 +24539,59 @@ var MyNY = /*#__PURE__*/function (_React$Component4) {
24539
24539
  var css_248z$s = ".kts-invoice-operate-real-estate-info-digtal {\n padding: 20px;\n border-bottom: 2px solid #9F613E;\n border-left: 2px solid #9F613E;\n border-right: 2px solid #9F613E;\n}\n.kts-invoice-operate-real-estate-info-digtal .real-estate-info-digtal-label {\n color: #9F613E;\n font-weight: bold;\n}\n.kts-invoice-operate-real-estate-info-digtal .ktsAnt3x-row.ktsAnt3x-form-item {\n margin-bottom: 0;\n}\n.kts-invoice-operate-real-estate-info-digtal .break-word {\n word-break: break-word;\n}\n";
24540
24540
  styleInject(css_248z$s);
24541
24541
 
24542
+ var _g$4, _defs$6;
24543
+
24544
+ function _extends$e() { _extends$e = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$e.apply(this, arguments); }
24545
+
24546
+ function SvgPlus$3(props) {
24547
+ return /*#__PURE__*/React.createElement("svg", _extends$e({
24548
+ xmlns: "http://www.w3.org/2000/svg",
24549
+ width: 16,
24550
+ height: 15,
24551
+ fill: "none"
24552
+ }, props), _g$4 || (_g$4 = /*#__PURE__*/React.createElement("g", {
24553
+ clipPath: "url(#plus_svg__clip0_715_360)"
24554
+ }, /*#__PURE__*/React.createElement("path", {
24555
+ d: "M8 14.531A7.031 7.031 0 118 .468a7.031 7.031 0 010 14.063zm0-.937A6.094 6.094 0 108 1.406a6.094 6.094 0 000 12.188z"
24556
+ }), /*#__PURE__*/React.createElement("path", {
24557
+ d: "M4.25 7.969a.469.469 0 010-.938h7.5a.47.47 0 010 .938h-7.5z"
24558
+ }), /*#__PURE__*/React.createElement("path", {
24559
+ d: "M7.531 3.75a.469.469 0 01.938 0v7.5a.47.47 0 01-.938 0v-7.5z"
24560
+ }))), _defs$6 || (_defs$6 = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
24561
+ id: "plus_svg__clip0_715_360"
24562
+ }, /*#__PURE__*/React.createElement("path", {
24563
+ transform: "translate(.5)",
24564
+ d: "M0 0h15v15H0z"
24565
+ })))));
24566
+ }
24567
+
24542
24568
  /** 特殊信息-建筑服务 */
24543
24569
 
24544
24570
  var Architecture = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (props) {
24545
24571
  /** 控制器 */
24546
24572
  var controller = Invoice.useInvoiceController();
24547
- var form = props.form;
24573
+ var form = props.form,
24574
+ onClickImportButton = props.onClickImportButton;
24548
24575
  var getFieldDecorator = form.getFieldDecorator;
24549
24576
  var model = controller.useMemo(function (s) {
24550
24577
  return s.model;
24551
24578
  }, []);
24552
24579
  var readOnly = React__default['default'].useMemo(function () {
24553
24580
  return model === 'readOnly';
24554
- }, [model]); // 注册 form
24581
+ }, [model]);
24582
+
24583
+ var _React$useState = React__default['default'].useState( props.region),
24584
+ _React$useState2 = _slicedToArray(_React$useState, 2),
24585
+ region = _React$useState2[0],
24586
+ setRegion = _React$useState2[1]; // 注册 form
24587
+
24555
24588
 
24556
24589
  controller.useForm('serviceDataDtoInfo', form);
24590
+
24591
+ var onSelectChange = function onSelectChange(value) {
24592
+ setRegion(value === 'Y' ? true : false); // props.onRegionalSelect && props.onRegionalSelect(value);
24593
+ };
24594
+
24557
24595
  return /*#__PURE__*/React__default['default'].createElement("div", {
24558
24596
  className: "kts-invoice-operate-real-estate-info-digtal"
24559
24597
  }, /*#__PURE__*/React__default['default'].createElement("div", {
@@ -24620,6 +24658,7 @@ var Architecture = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fun
24620
24658
  message: '请选择跨地(市)标志'
24621
24659
  }]
24622
24660
  })(readOnly ? /*#__PURE__*/React__default['default'].createElement(MyNY$1, null) : /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Select, {
24661
+ onChange: onSelectChange,
24623
24662
  placeholder: "\u8BF7\u9009\u62E9",
24624
24663
  style: {
24625
24664
  width: '100%'
@@ -24628,7 +24667,58 @@ var Architecture = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fun
24628
24667
  value: 'Y'
24629
24668
  }, "\u662F"), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Select.Option, {
24630
24669
  value: 'N'
24631
- }, "\u5426"))))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
24670
+ }, "\u5426"))))), props.demo && region && /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
24671
+ span: 6
24672
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
24673
+ label: "\u6D89\u7A0E\u4E8B\u9879\u7F16\u53F7",
24674
+ colon: false
24675
+ }, getFieldDecorator('taxMatterNo', {
24676
+ rules: readOnly ? [] : [{
24677
+ required: true,
24678
+ message: '请选择'
24679
+ }, {
24680
+ validator: function validator(_, value, callback) {
24681
+ var constructAddress = form.getFieldValue('constructAddress');
24682
+ var region = form.getFieldValue('division');
24683
+ console.log(constructAddress.join(''), region);
24684
+
24685
+ if (constructAddress.join('') === region) {
24686
+ callback();
24687
+ } else {
24688
+ callback('建筑服务发生地与税务事项地址不一致');
24689
+ }
24690
+ }
24691
+ }]
24692
+ })(readOnly ? /*#__PURE__*/React__default['default'].createElement(MyDiv$4, null) : /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Input, {
24693
+ autoComplete: "off",
24694
+ disabled: true,
24695
+ suffix: /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Button, {
24696
+ type: 'link',
24697
+ style: {
24698
+ padding: 0,
24699
+ width: 20,
24700
+ height: '100%'
24701
+ },
24702
+ icon: /*#__PURE__*/React__default['default'].createElement(Icon, {
24703
+ component: SvgPlus$3
24704
+ }),
24705
+ onClick: function onClick() {
24706
+ onClickImportButton && onClickImportButton(controller);
24707
+ }
24708
+ })
24709
+ })))), props.demo && region && /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
24710
+ span: 6,
24711
+ style: {
24712
+ display: 'none'
24713
+ }
24714
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
24715
+ label: 'division',
24716
+ colon: false
24717
+ }, getFieldDecorator('division', {
24718
+ rules: []
24719
+ })(readOnly ? /*#__PURE__*/React__default['default'].createElement(MyDiv$4, null) : /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Input, {
24720
+ autoComplete: "off"
24721
+ })))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
24632
24722
  span: 6
24633
24723
  }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
24634
24724
  label: "\u5EFA\u7B51\u9879\u76EE\u540D\u79F0"
@@ -24747,7 +24837,13 @@ var MyNY$1 = /*#__PURE__*/function (_React$Component4) {
24747
24837
  }]);
24748
24838
 
24749
24839
  return MyNY;
24750
- }(React__default['default'].Component);
24840
+ }(React__default['default'].Component); // function BuyerNameInput(props: InputProps & { fieldName: string; myform: WrappedFormUtils<any> }) {
24841
+ // const { fieldName, myform: form } = props;
24842
+ // if (props.readOnly) return <span className='digtal-stakeholder-form-text'>{props.value}</span>;
24843
+ // return (
24844
+ // <Input disabled={true} {...props} style={{ width: '100%', ...props.style }} />
24845
+ // )
24846
+ // }
24751
24847
 
24752
24848
  var css_248z$t = ".kts-invoice-operate-goods-table-virtual .ktsAntX-table-body {\n height: 280px;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table.ktsAntX-table-bordered > .ktsAntX-table-container > .ktsAntX-table-header > table > thead > tr > th {\n padding: 0 10px;\n height: 32px;\n background: #f4f4f4;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table.ktsAntX-table-bordered > .ktsAntX-table-container > .ktsAntX-table-body > table > tbody > tr > td {\n padding: 0;\n height: 32px;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table .ktsAntX-table-body {\n position: relative;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table .ktsAntX-table-body > table {\n position: absolute;\n left: 0;\n top: 0;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table .ktsAntX-table-tbody {\n position: relative;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-checkbox-wrapper .ktsAntX-checkbox-inner {\n width: 16px;\n height: 16px;\n border: 1px solid #d9d9d9;\n border-radius: 2px;\n top: 1px;\n}\n";
24753
24849
  styleInject(css_248z$t);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.214",
3
+ "version": "3.3.2",
4
4
  "scripts": {
5
5
  "dev": "dumi dev --max-old-space-size=6096",
6
6
  "start": "dumi dev",
@@ -2,21 +2,47 @@ import React from 'react';
2
2
  import Invoice from '../../..';
3
3
  import moment from 'moment';
4
4
  import 'antd/dist/antd.css';
5
-
5
+ import { Button } from 'antd'
6
6
  export default () => {
7
7
 
8
8
  const controller = React.useMemo(() => new Invoice.InvoiceController(), []);
9
+ const [showDrawer, setShowDrawer] = React.useState(false);
9
10
 
10
11
  React.useEffect(() => {
11
12
  controller.run(async s => {
13
+ if (showDrawer) {
14
+ window.setTimeout(() => {
15
+ controller.formList.get('serviceDataDtoInfo')?.setFieldsValue({
16
+ taxMatterNo: ['北京','上海'][Math.round(Math.random())],
17
+ })
18
+ setShowDrawer(false)
19
+ }, 1000)
20
+ }
12
21
  })
13
- }, [])
22
+ }, [showDrawer])
23
+ const onSave = async () => {
24
+ const formValues = await controller.validateFields();
25
+ console.log(formValues)
26
+ }
14
27
 
15
28
  return (
16
- <Invoice
17
- invoiceType='digtal'
18
- controller={controller}
19
- specialInfor={<Invoice.Architecture />}
20
- />
29
+ <>
30
+ <Button onClick={onSave}>输出表单内容</Button>
31
+ <Invoice
32
+ invoiceType='digtal'
33
+ controller={controller}
34
+
35
+ specialInfor={
36
+ <Invoice.Architecture
37
+ addressOptions={[{ name: '北京' }]}
38
+ demo={true}
39
+ fieldNames={{
40
+ label: 'name',
41
+ value: 'name',
42
+ children: 'children'
43
+ }} onClickImportButton={() => setShowDrawer(true)} />
44
+ }
45
+ />
46
+ </>
21
47
  )
22
48
  };
@@ -122,14 +122,16 @@ export default () => {
122
122
  }
123
123
  React.useEffect(() => {
124
124
  controller.run(async s => {
125
- s.stakeholder.enables = ['taxAmount'];
126
- s.priceIntegerDigit = 25;
127
- s.calculatingDigits = 25;
125
+ s.goodsListState.isRecalculateWhenSwitchTax = true;
128
126
  s.goodsListState.isTaxIncluded = false;
129
- s.goodsListState.amountExcludeTax = parseFloat(data?.invoiceAmount) || undefined;
130
- s.goodsListState.amountIncludeTax = parseFloat(data?.totalAmount) || undefined;
131
- s.goodsListState.amountTax = parseFloat(data?.taxAmount) || undefined;
132
- s.goodsListState.goodsList = data?.detailList?.map(e => sToCi(e)) ?? [];
127
+ // s.stakeholder.enables = ['taxAmount'];
128
+ // s.priceIntegerDigit = 25;
129
+ // s.calculatingDigits = 25;
130
+ // s.goodsListState.isTaxIncluded = false;
131
+ // s.goodsListState.amountExcludeTax = parseFloat(data?.invoiceAmount) || undefined;
132
+ // s.goodsListState.amountIncludeTax = parseFloat(data?.totalAmount) || undefined;
133
+ // s.goodsListState.amountTax = parseFloat(data?.taxAmount) || undefined;
134
+ // s.goodsListState.goodsList = data?.detailList?.map(e => sToCi(e)) ?? [];
133
135
  })
134
136
  }, [controller])
135
137
  return (
@@ -1,7 +1,7 @@
1
1
  # 数电
2
2
 
3
- ## 简单用法
4
- <code src="./_test/easiest/index.tsx"></code>
3
+ <!-- ## 简单用法
4
+ <code src="./_test/easiest/index.tsx"></code> -->
5
5
 
6
6
  ## 建筑服务
7
7
  <code src="./_test/architecture/index.tsx"></code>
@@ -38,5 +38,5 @@
38
38
 
39
39
  -->
40
40
 
41
- ## 货物运输服务
42
- <code src="./_test/freight/index.tsx"></code>
41
+ <!-- ## 货物运输服务
42
+ <code src="./_test/freight/index.tsx"></code> -->
@@ -1,13 +1,16 @@
1
1
 
2
2
  import React from "react";
3
3
  import { decorator } from 'grey-react-box';
4
- import { Form } from 'kts-components-antd-x3';
4
+ import { Form, } from 'kts-components-antd-x3';
5
5
  import { FormComponentProps } from 'kts-components-antd-x3/lib/form';
6
6
  import Invoice from '../../..';
7
7
  import './index.less';
8
- import { Cascader, Col, Input, Row, Select } from "kts-components-antd-x4";
8
+ import { ReactComponent as PlusSvg } from './svg/plus.svg'
9
+ import { Cascader, Col, Input, Row, Select, Button, } from "kts-components-antd-x4";
9
10
  import moment from "moment";
10
-
11
+ import Icon from '@ant-design/icons';
12
+ // import { WrappedFormUtils } from 'kts-components-antd-x3/lib/form/Form';
13
+ import InvoiceController from "../../../InvoiceController";
11
14
 
12
15
  export interface RealEstateInfoProps {
13
16
  /**
@@ -19,6 +22,14 @@ export interface RealEstateInfoProps {
19
22
  * 建筑服务地址数据字段名
20
23
  */
21
24
  fieldNames?: any;
25
+
26
+ onRegionalSelect?: (value: boolean) => void;
27
+
28
+ /** 点击了 */
29
+ onClickImportButton?: (e: InvoiceController) => void;
30
+ //专门针对poc增加的参数,防止项目自动升级导致问题
31
+ demo?: boolean;
32
+ region?: boolean
22
33
  }
23
34
 
24
35
  /** 特殊信息-建筑服务 */
@@ -27,17 +38,20 @@ export default decorator<RealEstateInfoProps, FormComponentProps & RealEstateInf
27
38
  /** 控制器 */
28
39
  const controller = Invoice.useInvoiceController();
29
40
 
30
- const { form } = props;
41
+ const { form, onClickImportButton } = props;
31
42
 
32
43
  const { getFieldDecorator } = form;
33
44
 
34
45
  const model = controller.useMemo(s => s.model, []);
35
46
 
36
47
  const readOnly = React.useMemo(() => model === 'readOnly', [model]);
37
-
48
+ const [region, setRegion] = React.useState(false || props.region);
38
49
  // 注册 form
39
50
  controller.useForm('serviceDataDtoInfo', form);
40
-
51
+ const onSelectChange = (value: string) => {
52
+ setRegion(value === 'Y' ? true : false);
53
+ // props.onRegionalSelect && props.onRegionalSelect(value);
54
+ }
41
55
  return (
42
56
  <div className="kts-invoice-operate-real-estate-info-digtal">
43
57
  <div className='real-estate-info-digtal-label' >特殊信息-建筑服务</div>
@@ -45,7 +59,7 @@ export default decorator<RealEstateInfoProps, FormComponentProps & RealEstateInf
45
59
  <Col span={6} >
46
60
  <Form.Item label='土地增值税项目编号' >
47
61
  {getFieldDecorator('landNumber', {
48
- rules: [
62
+ rules: [
49
63
  { max: 16, message: '最多16个字符' },
50
64
  ]
51
65
  })(
@@ -55,7 +69,7 @@ export default decorator<RealEstateInfoProps, FormComponentProps & RealEstateInf
55
69
  )}
56
70
  </Form.Item>
57
71
  </Col>
58
-
72
+
59
73
 
60
74
  <Col span={6} >
61
75
  <Form.Item label='建筑服务发生地' >
@@ -102,19 +116,75 @@ export default decorator<RealEstateInfoProps, FormComponentProps & RealEstateInf
102
116
  })(
103
117
  readOnly
104
118
  ? <MyNY />
105
- : <Select placeholder='请选择' style={{ width: '100%' }} >
119
+ : <Select onChange={onSelectChange} placeholder='请选择' style={{ width: '100%' }} >
106
120
  <Select.Option value='Y'>是</Select.Option>
107
121
  <Select.Option value='N'>否</Select.Option>
108
122
  </Select>
109
123
  )}
110
124
  </Form.Item>
111
125
  </Col>
126
+ {props.demo && region && <Col span={6} >
127
+ <Form.Item label='涉税事项编号' colon={false}>
128
+ {getFieldDecorator('taxMatterNo', {
129
+ rules: readOnly ? [] : [
130
+ { required: true, message: '请选择' },
131
+ {
132
+ validator: (_, value, callback) => {
133
+ const constructAddress: string[] = form.getFieldValue('constructAddress');
134
+ const region = form.getFieldValue('division');
135
+ console.log(constructAddress.join(''), region)
136
+ if (constructAddress.join('') === region) {
137
+ callback();
138
+ } else {
139
+ callback('建筑服务发生地与税务事项地址不一致')
140
+ }
141
+ }
142
+ }
143
+ ]
144
+
145
+ })(
146
+ readOnly
147
+ ? <MyDiv />
148
+ : <Input
149
+ autoComplete="off"
150
+ disabled={true}
151
+ suffix={
152
+ <Button
153
+ type='link'
154
+ style={{ padding: 0, width: 20, height: '100%' }}
155
+ icon={<Icon component={PlusSvg} />}
156
+ onClick={() => { onClickImportButton && onClickImportButton(controller) }}
157
+ />
158
+ }
159
+ />
160
+
161
+ )}
162
+ </Form.Item>
163
+ </Col>
164
+ }
165
+ {props.demo && region && <Col span={6} style={{ display: 'none' }}>
166
+ <Form.Item label='division' colon={false}>
167
+ {getFieldDecorator('division', {
168
+ rules: []
169
+
170
+ })(
171
+ readOnly
172
+ ? <MyDiv />
173
+ : <Input
174
+ autoComplete="off"
175
+ />
176
+
177
+ )}
178
+ </Form.Item>
179
+ </Col>
180
+ }
112
181
  <Col span={6} >
113
182
  <Form.Item label='建筑项目名称' >
114
- {getFieldDecorator('constructName', { rules: readOnly ? [] : [
183
+ {getFieldDecorator('constructName', {
184
+ rules: readOnly ? [] : [
115
185
  { required: true, message: '请输入建筑项目名称' },
116
186
  { max: 200, message: '建筑项目名称最多200个字符' },
117
-
187
+
118
188
  ]
119
189
  })(
120
190
  readOnly
@@ -175,3 +245,15 @@ class MyNY extends React.Component<{ value?: 'Y' | 'N', style?: React.CSSPropert
175
245
  }
176
246
  }
177
247
 
248
+ // function BuyerNameInput(props: InputProps & { fieldName: string; myform: WrappedFormUtils<any> }) {
249
+
250
+ // const { fieldName, myform: form } = props;
251
+
252
+
253
+ // if (props.readOnly) return <span className='digtal-stakeholder-form-text'>{props.value}</span>;
254
+
255
+ // return (
256
+
257
+ // <Input disabled={true} {...props} style={{ width: '100%', ...props.style }} />
258
+ // )
259
+ // }
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="12" height="13" viewBox="0 0 12 13" fill="none">
2
+ <path d="M2.94338 4.42663C3.03458 4.42662 3.12571 4.46481 3.19459 4.54096L5.99164 7.6327L8.78868 4.54096C8.92463 4.39067 9.14733 4.38824 9.28606 4.53554C9.4248 4.68285 9.42705 4.92408 9.29107 5.07437L6.24283 8.44378C6.17667 8.5169 6.08613 8.55811 5.99164 8.55811C5.89714 8.55811 5.80659 8.5169 5.74044 8.44378L2.69221 5.07437C2.55623 4.92408 2.55849 4.68285 2.69722 4.53554C2.76567 4.46287 2.85455 4.42665 2.94338 4.42663Z"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 13 13" fill="none">
2
+ <path d="M9.55662 8.57337C9.46542 8.57338 9.37429 8.53519 9.30541 8.45904L6.50836 5.3673L3.71132 8.45904C3.57537 8.60933 3.35267 8.61176 3.21394 8.46446C3.0752 8.31715 3.07295 8.07592 3.20893 7.92563L6.25717 4.55622C6.32333 4.4831 6.41387 4.44189 6.50836 4.44189C6.60286 4.44189 6.69341 4.4831 6.75956 4.55622L9.80779 7.92563C9.94377 8.07592 9.94151 8.31715 9.80278 8.46446C9.73433 8.53713 9.64545 8.57335 9.55662 8.57337Z"/>
3
+ </svg>
@@ -0,0 +1,12 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="15" viewBox="0 0 16 15" fill="none">
2
+ <g clip-path="url(#clip0_715_360)">
3
+ <path d="M8 14.5312C4.11687 14.5312 0.96875 11.3831 0.96875 7.5C0.96875 3.61687 4.11687 0.46875 8 0.46875C11.8831 0.46875 15.0312 3.61687 15.0312 7.5C15.0312 11.3831 11.8831 14.5312 8 14.5312ZM8 13.5938C11.3656 13.5938 14.0938 10.8656 14.0938 7.5C14.0938 4.13438 11.3656 1.40625 8 1.40625C4.63438 1.40625 1.90625 4.13438 1.90625 7.5C1.90625 10.8656 4.63438 13.5938 8 13.5938Z"/>
4
+ <path d="M4.25 7.96875C4.12568 7.96875 4.00645 7.91936 3.91854 7.83146C3.83064 7.74355 3.78125 7.62432 3.78125 7.5C3.78125 7.37568 3.83064 7.25645 3.91854 7.16854C4.00645 7.08064 4.12568 7.03125 4.25 7.03125H11.75C11.8743 7.03125 11.9935 7.08064 12.0815 7.16854C12.1694 7.25645 12.2188 7.37568 12.2188 7.5C12.2188 7.62432 12.1694 7.74355 12.0815 7.83146C11.9935 7.91936 11.8743 7.96875 11.75 7.96875H4.25Z"/>
5
+ <path d="M7.53125 3.75C7.53125 3.62568 7.58064 3.50645 7.66854 3.41854C7.75645 3.33064 7.87568 3.28125 8 3.28125C8.12432 3.28125 8.24355 3.33064 8.33146 3.41854C8.41936 3.50645 8.46875 3.62568 8.46875 3.75V11.25C8.46875 11.3743 8.41936 11.4935 8.33146 11.5815C8.24355 11.6694 8.12432 11.7188 8 11.7188C7.87568 11.7188 7.75645 11.6694 7.66854 11.5815C7.58064 11.4935 7.53125 11.3743 7.53125 11.25V3.75Z"/>
6
+ </g>
7
+ <defs>
8
+ <clipPath id="clip0_715_360">
9
+ <rect width="15" height="15" transform="translate(0.5)"/>
10
+ </clipPath>
11
+ </defs>
12
+ </svg>