kts-component-invoice-operate 3.2.173 → 3.2.175

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.
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import 'antd/dist/antd.css';
3
+ declare const _default: () => JSX.Element;
4
+ export default _default;
@@ -54,6 +54,8 @@ export default class Invoice extends React.PureComponent<IInvoiceProps> {
54
54
  static readonly SignDigtal: React.FunctionComponent<import("./ui/digtal/Sign").IBuyerProps>;
55
55
  /** 特殊信息-不动产经营租赁服务(数电) */
56
56
  static readonly RealEstateInfo: React.FunctionComponent<import("./ui/digtal/RealEstateInfo").RealEstateInfoProps>;
57
+ /** 特殊信息-建筑服务(数电) */
58
+ static readonly Architecture: React.FunctionComponent<import("./ui/digtal/Architecture").RealEstateInfoProps>;
57
59
  /** 货物列表(数电) */
58
60
  static readonly GoodsListDigtal: typeof GoodsListDigtal;
59
61
  /** 货物索引生成器 */
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import './index.less';
3
+ export interface RealEstateInfoProps {
4
+ /**
5
+ * 建筑服务地址数据
6
+ */
7
+ addressOptions?: any[];
8
+ /**
9
+ * 建筑服务地址数据字段名
10
+ */
11
+ fieldNames?: any;
12
+ }
13
+ /** 特殊信息-建筑服务 */
14
+ declare const _default: React.FunctionComponent<RealEstateInfoProps>;
15
+ export default _default;
package/dist/index.esm.js CHANGED
@@ -23914,6 +23914,204 @@ var MyNY = /*#__PURE__*/function (_React$Component4) {
23914
23914
  return MyNY;
23915
23915
  }(React.Component);
23916
23916
 
23917
+ 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";
23918
+ styleInject(css_248z$s);
23919
+
23920
+ /** 特殊信息-建筑服务 */
23921
+
23922
+ var Architecture = decorator(Form.create())(function (props) {
23923
+ /** 控制器 */
23924
+ var controller = Invoice.useInvoiceController();
23925
+ var form = props.form;
23926
+ var getFieldDecorator = form.getFieldDecorator;
23927
+ var model = controller.useMemo(function (s) {
23928
+ return s.model;
23929
+ }, []);
23930
+ var readOnly = React.useMemo(function () {
23931
+ return model === 'readOnly';
23932
+ }, [model]); // 注册 form
23933
+
23934
+ controller.useForm('realEstateInfo', form);
23935
+ return /*#__PURE__*/React.createElement("div", {
23936
+ className: "kts-invoice-operate-real-estate-info-digtal"
23937
+ }, /*#__PURE__*/React.createElement("div", {
23938
+ className: 'real-estate-info-digtal-label'
23939
+ }, "\u7279\u6B8A\u4FE1\u606F-\u5EFA\u7B51\u670D\u52A1"), /*#__PURE__*/React.createElement(Row$1, {
23940
+ gutter: [17, 0]
23941
+ }, /*#__PURE__*/React.createElement(Col$1, {
23942
+ span: 6
23943
+ }, /*#__PURE__*/React.createElement(Form.Item, {
23944
+ label: "\u571F\u5730\u589E\u503C\u7A0E\u9879\u76EE\u7F16\u53F7"
23945
+ }, getFieldDecorator('landNumber', {})(readOnly ? /*#__PURE__*/React.createElement(MyDiv$4, null) : /*#__PURE__*/React.createElement(Input$2, {
23946
+ autoComplete: 'off',
23947
+ placeholder: "\u8BF7\u8F93\u5165"
23948
+ })))), /*#__PURE__*/React.createElement(Col$1, {
23949
+ span: 6
23950
+ }, /*#__PURE__*/React.createElement(Form.Item, {
23951
+ label: "\u8DE8\u5730\uFF08\u5E02\uFF09\u6807\u5FD7"
23952
+ }, getFieldDecorator('crossCitiesSign', {
23953
+ rules: readOnly ? [] : [{
23954
+ required: true,
23955
+ message: '请选择跨地(市)标志'
23956
+ }]
23957
+ })(readOnly ? /*#__PURE__*/React.createElement(MyNY$1, null) : /*#__PURE__*/React.createElement(Select$2, {
23958
+ placeholder: "\u8BF7\u9009\u62E9",
23959
+ style: {
23960
+ width: '100%'
23961
+ }
23962
+ }, /*#__PURE__*/React.createElement(Select$2.Option, {
23963
+ value: 'Y'
23964
+ }, "\u662F"), /*#__PURE__*/React.createElement(Select$2.Option, {
23965
+ value: 'N'
23966
+ }, "\u5426"))))), /*#__PURE__*/React.createElement(Col$1, {
23967
+ span: 6
23968
+ }, /*#__PURE__*/React.createElement(Form.Item, {
23969
+ label: "\u5EFA\u7B51\u670D\u52A1\u53D1\u751F\u5730"
23970
+ }, getFieldDecorator('constructAddress', {
23971
+ rules: readOnly ? [] : [{
23972
+ required: true,
23973
+ message: '请选择省市区县'
23974
+ }]
23975
+ })(readOnly ? /*#__PURE__*/React.createElement(MyArrString$1, null) : /*#__PURE__*/React.createElement(Cascader, {
23976
+ style: {
23977
+ width: '100%'
23978
+ },
23979
+ options: props.addressOptions,
23980
+ fieldNames: props.fieldNames,
23981
+ placeholder: "\u8BF7\u9009\u62E9\u7701\u5E02\u533A\u53BF"
23982
+ })))), /*#__PURE__*/React.createElement(Col$1, {
23983
+ span: 6
23984
+ }, /*#__PURE__*/React.createElement(Form.Item, {
23985
+ label: "\u8BE6\u7EC6\u5730\u5740"
23986
+ }, getFieldDecorator('constructDetailAddress', {
23987
+ rules: readOnly ? [] : [{
23988
+ max: 200,
23989
+ message: '详细地址最多200个字符'
23990
+ }]
23991
+ })(readOnly ? /*#__PURE__*/React.createElement(MyDiv$4, null) : /*#__PURE__*/React.createElement(Input$2, {
23992
+ autoComplete: 'off',
23993
+ placeholder: "\u8BF7\u8F93\u5165\u8BE6\u7EC6\u5730\u5740"
23994
+ })))), /*#__PURE__*/React.createElement(Col$1, {
23995
+ span: 6
23996
+ }, /*#__PURE__*/React.createElement(Form.Item, {
23997
+ label: "\u5EFA\u7B51\u9879\u76EE\u540D\u79F0"
23998
+ }, getFieldDecorator('constructName', {
23999
+ rules: readOnly ? [] : [{
24000
+ required: true,
24001
+ message: '请输入建筑项目名称'
24002
+ }, {
24003
+ max: 200,
24004
+ message: '建筑项目名称最多200个字符'
24005
+ }]
24006
+ })(readOnly ? /*#__PURE__*/React.createElement(MyDiv$4, null) : /*#__PURE__*/React.createElement(Input$2, {
24007
+ autoComplete: 'off',
24008
+ placeholder: "\u8BF7\u8F93\u5165"
24009
+ }))))));
24010
+ });
24011
+
24012
+ var MyDiv$4 = /*#__PURE__*/function (_React$Component) {
24013
+ _inherits(MyDiv, _React$Component);
24014
+
24015
+ var _super = _createSuper(MyDiv);
24016
+
24017
+ function MyDiv() {
24018
+ _classCallCheck(this, MyDiv);
24019
+
24020
+ return _super.apply(this, arguments);
24021
+ }
24022
+
24023
+ _createClass(MyDiv, [{
24024
+ key: "render",
24025
+ value: function render() {
24026
+ return /*#__PURE__*/React.createElement("div", {
24027
+ style: this.props.style
24028
+ }, this.props.value);
24029
+ }
24030
+ }]);
24031
+
24032
+ return MyDiv;
24033
+ }(React.Component);
24034
+
24035
+ var MyArrString$1 = /*#__PURE__*/function (_React$Component2) {
24036
+ _inherits(MyArrString, _React$Component2);
24037
+
24038
+ var _super2 = _createSuper(MyArrString);
24039
+
24040
+ function MyArrString() {
24041
+ _classCallCheck(this, MyArrString);
24042
+
24043
+ return _super2.apply(this, arguments);
24044
+ }
24045
+
24046
+ _createClass(MyArrString, [{
24047
+ key: "render",
24048
+ value: function render() {
24049
+ var _this$props$value;
24050
+
24051
+ return /*#__PURE__*/React.createElement("div", {
24052
+ style: this.props.style
24053
+ }, (_this$props$value = this.props.value) === null || _this$props$value === void 0 ? void 0 : _this$props$value.filter(function (e) {
24054
+ return !!e;
24055
+ }).join(','));
24056
+ }
24057
+ }]);
24058
+
24059
+ return MyArrString;
24060
+ }(React.Component);
24061
+
24062
+ var MyArrMoment$1 = /*#__PURE__*/function (_React$Component3) {
24063
+ _inherits(MyArrMoment, _React$Component3);
24064
+
24065
+ var _super3 = _createSuper(MyArrMoment);
24066
+
24067
+ function MyArrMoment() {
24068
+ _classCallCheck(this, MyArrMoment);
24069
+
24070
+ return _super3.apply(this, arguments);
24071
+ }
24072
+
24073
+ _createClass(MyArrMoment, [{
24074
+ key: "render",
24075
+ value: function render() {
24076
+ var _this$props$value2 = this.props.value,
24077
+ value = _this$props$value2 === void 0 ? [] : _this$props$value2;
24078
+ return /*#__PURE__*/React.createElement("div", {
24079
+ style: this.props.style
24080
+ }, /*#__PURE__*/React.createElement("span", null, hooks.isMoment(value[0]) && value[0].format('YYYY-MM-DD')), /*#__PURE__*/React.createElement("span", {
24081
+ style: {
24082
+ color: '#9F603D',
24083
+ fontWeight: 600
24084
+ }
24085
+ }, " - "), /*#__PURE__*/React.createElement("span", null, hooks.isMoment(value[1]) && value[0].format('YYYY-MM-DD')));
24086
+ }
24087
+ }]);
24088
+
24089
+ return MyArrMoment;
24090
+ }(React.Component);
24091
+
24092
+ var MyNY$1 = /*#__PURE__*/function (_React$Component4) {
24093
+ _inherits(MyNY, _React$Component4);
24094
+
24095
+ var _super4 = _createSuper(MyNY);
24096
+
24097
+ function MyNY() {
24098
+ _classCallCheck(this, MyNY);
24099
+
24100
+ return _super4.apply(this, arguments);
24101
+ }
24102
+
24103
+ _createClass(MyNY, [{
24104
+ key: "render",
24105
+ value: function render() {
24106
+ return /*#__PURE__*/React.createElement("div", {
24107
+ style: this.props.style
24108
+ }, this.props.value === 'Y' ? '是' : '否');
24109
+ }
24110
+ }]);
24111
+
24112
+ return MyNY;
24113
+ }(React.Component);
24114
+
23917
24115
  var ImportBuyerDrawer = (function () {
23918
24116
  var controller = Invoice.useInvoiceController();
23919
24117
  var visible = controller.useMemo(function (s) {
@@ -24290,8 +24488,8 @@ var getItemCode = function getItemCode(record, editGood) {
24290
24488
  return record.productCode;
24291
24489
  };
24292
24490
 
24293
- var css_248z$s = ".kts-invoice-operate-goods-endow-code-button-list {\n display: flex;\n flex-direction: column;\n}\n.kts-invoice-operate-goods-endow-code-button-list > button {\n margin-bottom: 10px;\n}\n";
24294
- styleInject(css_248z$s);
24491
+ var css_248z$t = ".kts-invoice-operate-goods-endow-code-button-list {\n display: flex;\n flex-direction: column;\n}\n.kts-invoice-operate-goods-endow-code-button-list > button {\n margin-bottom: 10px;\n}\n";
24492
+ styleInject(css_248z$t);
24295
24493
 
24296
24494
  var TreeNode = Tree.TreeNode;
24297
24495
  var confirm = Modal$1.confirm;
@@ -24931,15 +25129,14 @@ var DrawerBody$3 = function DrawerBody(props) {
24931
25129
  // s.value = info.node.taxRate
24932
25130
  // }
24933
25131
  // });
24934
- var node = info.node || info;
24935
25132
  actions.setFieldState('taxClassificationCode', /*#__PURE__*/function () {
24936
25133
  var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(s) {
24937
25134
  return _regeneratorRuntime().wrap(function _callee12$(_context12) {
24938
25135
  while (1) {
24939
25136
  switch (_context12.prev = _context12.next) {
24940
25137
  case 0:
24941
- if (node.taxCategoryCode) {
24942
- s.value = node.taxCategoryCode;
25138
+ if (info.taxCategoryCode) {
25139
+ s.value = info.taxCategoryCode;
24943
25140
  }
24944
25141
 
24945
25142
  case 1:
@@ -24960,8 +25157,8 @@ var DrawerBody$3 = function DrawerBody(props) {
24960
25157
  while (1) {
24961
25158
  switch (_context13.prev = _context13.next) {
24962
25159
  case 0:
24963
- if (node.shorthand) {
24964
- s.value = node.shorthand;
25160
+ if (info.shorthand) {
25161
+ s.value = info.shorthand;
24965
25162
  }
24966
25163
 
24967
25164
  case 1:
@@ -24979,26 +25176,24 @@ var DrawerBody$3 = function DrawerBody(props) {
24979
25176
  setOpen(false);
24980
25177
  }, [controller, actions]);
24981
25178
  var onSelect = React.useCallback(function (key, info) {
24982
- var node = info.node || info;
24983
-
24984
25179
  if (controller.state.goodsListState.isUpdateGoodsTaxRateList) {
24985
- var _node$taxRateList;
25180
+ var _info$node$taxRateLis;
24986
25181
 
24987
- if ((_node$taxRateList = node.taxRateList) === null || _node$taxRateList === void 0 ? void 0 : _node$taxRateList.length) {
24988
- setGoodsTaxRateList(node.taxRateList);
25182
+ if ((_info$node$taxRateLis = info.node.taxRateList) === null || _info$node$taxRateLis === void 0 ? void 0 : _info$node$taxRateLis.length) {
25183
+ setGoodsTaxRateList(info.node.taxRateList);
24989
25184
  }
24990
25185
 
24991
25186
  if (!readOnlyTaxRate) {
24992
25187
  actions.setFieldState('taxRate', /*#__PURE__*/function () {
24993
25188
  var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
24994
- var _node$taxRateList2;
25189
+ var _info$node$taxRateLis2;
24995
25190
 
24996
25191
  return _regeneratorRuntime().wrap(function _callee14$(_context14) {
24997
25192
  while (1) {
24998
25193
  switch (_context14.prev = _context14.next) {
24999
25194
  case 0:
25000
- if (node.taxRateList && ((_node$taxRateList2 = node.taxRateList) === null || _node$taxRateList2 === void 0 ? void 0 : _node$taxRateList2.length) === 1) {
25001
- s.value = node.taxRateList[0];
25195
+ if (info.node.taxRateList && ((_info$node$taxRateLis2 = info.node.taxRateList) === null || _info$node$taxRateLis2 === void 0 ? void 0 : _info$node$taxRateLis2.length) === 1) {
25196
+ s.value = info.node.taxRateList[0];
25002
25197
  } else {
25003
25198
  s.value = undefined;
25004
25199
  }
@@ -25526,6 +25721,8 @@ var Invoice = /*#__PURE__*/function (_React$PureComponent) {
25526
25721
 
25527
25722
  /** 特殊信息-不动产经营租赁服务(数电) */
25528
25723
 
25724
+ /** 特殊信息-建筑服务(数电) */
25725
+
25529
25726
  /** 货物列表(数电) */
25530
25727
 
25531
25728
  /** 货物索引生成器 */
@@ -25560,6 +25757,7 @@ Invoice.Stakeholder = Stakeholder$1;
25560
25757
  Invoice.StakeFarmerholder = StakeFarmerholder;
25561
25758
  Invoice.SignDigtal = SignDigtal;
25562
25759
  Invoice.RealEstateInfo = RealEstateInfo;
25760
+ Invoice.Architecture = Architecture;
25563
25761
  Invoice.GoodsListDigtal = GoodsList$1;
25564
25762
  Invoice.idGenerator = idGenerator;
25565
25763
  Invoice.calculator = calculator;
@@ -25677,11 +25875,11 @@ var Digtal = function Digtal(props) {
25677
25875
  ), /*#__PURE__*/React.createElement(ImportGoodsDrawer, null), /*#__PURE__*/React.createElement(EndowCodeDrawer, null));
25678
25876
  };
25679
25877
 
25680
- var css_248z$t = ".taxdetailsbox {\n display: flex;\n justify-content: flex-start;\n flex-direction: row;\n}\n.taxdetailsbox .taxrightbox {\n width: 340px;\n position: absolute;\n right: 30px;\n top: 79px;\n bottom: 50px;\n min-height: 300px;\n}\n.taxdetailsbox .taxrightbox .taxdesc {\n height: calc(100vh - 323px);\n min-height: 105px;\n overflow: auto;\n}\n";
25681
- styleInject(css_248z$t);
25878
+ var css_248z$u = ".taxdetailsbox {\n display: flex;\n justify-content: flex-start;\n flex-direction: row;\n}\n.taxdetailsbox .taxrightbox {\n width: 340px;\n position: absolute;\n right: 30px;\n}\n";
25879
+ styleInject(css_248z$u);
25682
25880
 
25683
25881
  function TaxClassificationModal(props) {
25684
- var _props$info6;
25882
+ var _props$info2, _props$info3;
25685
25883
 
25686
25884
  var _Form$useForm = Form$1.useForm(),
25687
25885
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
@@ -25761,16 +25959,6 @@ function TaxClassificationModal(props) {
25761
25959
  });
25762
25960
  };
25763
25961
 
25764
- React.useEffect(function () {
25765
- var _props$info2, _props$info3, _props$info4, _props$info5;
25766
-
25767
- form.setFieldsValue(_objectSpread2(_objectSpread2({}, form.getFieldsValue()), {}, {
25768
- taxCategoryCode: props === null || props === void 0 ? void 0 : (_props$info2 = props.info) === null || _props$info2 === void 0 ? void 0 : _props$info2.taxCategoryCode,
25769
- productName: props === null || props === void 0 ? void 0 : (_props$info3 = props.info) === null || _props$info3 === void 0 ? void 0 : _props$info3.productName,
25770
- shorthand: props === null || props === void 0 ? void 0 : (_props$info4 = props.info) === null || _props$info4 === void 0 ? void 0 : _props$info4.shorthand,
25771
- taxDesc: props === null || props === void 0 ? void 0 : (_props$info5 = props.info) === null || _props$info5 === void 0 ? void 0 : _props$info5.taxDesc
25772
- }));
25773
- }, [props === null || props === void 0 ? void 0 : (_props$info6 = props.info) === null || _props$info6 === void 0 ? void 0 : _props$info6.key]);
25774
25962
  return /*#__PURE__*/React.createElement(Drawer$1, {
25775
25963
  title: "\u5546\u54C1\u548C\u670D\u52A1\u7A0E\u6536\u5206\u7C7B\u7F16\u7801",
25776
25964
  placement: "right",
@@ -25816,10 +26004,16 @@ function TaxClassificationModal(props) {
25816
26004
  }))), /*#__PURE__*/React.createElement(Card, {
25817
26005
  className: "taxrightbox"
25818
26006
  }, /*#__PURE__*/React.createElement(Form$1, _objectSpread2(_objectSpread2({
25819
- form: form
26007
+ form: form,
26008
+ key: props === null || props === void 0 ? void 0 : (_props$info2 = props.info) === null || _props$info2 === void 0 ? void 0 : _props$info2.key
25820
26009
  }, layout), {}, {
25821
26010
  initialValues: props.info
25822
26011
  }), /*#__PURE__*/React.createElement(Form$1.Item, {
26012
+ rules: [{
26013
+ required: true,
26014
+ message: '请勾选税收分类编码'
26015
+ }],
26016
+ initialValue: (_props$info3 = props.info) === null || _props$info3 === void 0 ? void 0 : _props$info3.taxCategoryCode,
25823
26017
  name: "taxCategoryCode",
25824
26018
  label: "\u7F16\u7801"
25825
26019
  }, /*#__PURE__*/React.createElement(FormReadOnly, null)), /*#__PURE__*/React.createElement(Form$1.Item, {
@@ -25829,8 +26023,7 @@ function TaxClassificationModal(props) {
25829
26023
  name: "shorthand",
25830
26024
  label: "\u7B80\u79F0"
25831
26025
  }, /*#__PURE__*/React.createElement(FormReadOnly, null)), /*#__PURE__*/React.createElement(Form$1.Item, {
25832
- name: "taxDesc",
25833
- className: "taxdesc",
26026
+ name: "desc",
25834
26027
  label: "\u8BF4\u660E"
25835
26028
  }, /*#__PURE__*/React.createElement(FormReadOnly, null))))));
25836
26029
  }
package/dist/index.js CHANGED
@@ -23924,6 +23924,204 @@ var MyNY = /*#__PURE__*/function (_React$Component4) {
23924
23924
  return MyNY;
23925
23925
  }(React__default['default'].Component);
23926
23926
 
23927
+ 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";
23928
+ styleInject(css_248z$s);
23929
+
23930
+ /** 特殊信息-建筑服务 */
23931
+
23932
+ var Architecture = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (props) {
23933
+ /** 控制器 */
23934
+ var controller = Invoice.useInvoiceController();
23935
+ var form = props.form;
23936
+ var getFieldDecorator = form.getFieldDecorator;
23937
+ var model = controller.useMemo(function (s) {
23938
+ return s.model;
23939
+ }, []);
23940
+ var readOnly = React__default['default'].useMemo(function () {
23941
+ return model === 'readOnly';
23942
+ }, [model]); // 注册 form
23943
+
23944
+ controller.useForm('realEstateInfo', form);
23945
+ return /*#__PURE__*/React__default['default'].createElement("div", {
23946
+ className: "kts-invoice-operate-real-estate-info-digtal"
23947
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
23948
+ className: 'real-estate-info-digtal-label'
23949
+ }, "\u7279\u6B8A\u4FE1\u606F-\u5EFA\u7B51\u670D\u52A1"), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Row, {
23950
+ gutter: [17, 0]
23951
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
23952
+ span: 6
23953
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
23954
+ label: "\u571F\u5730\u589E\u503C\u7A0E\u9879\u76EE\u7F16\u53F7"
23955
+ }, getFieldDecorator('landNumber', {})(readOnly ? /*#__PURE__*/React__default['default'].createElement(MyDiv$4, null) : /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Input, {
23956
+ autoComplete: 'off',
23957
+ placeholder: "\u8BF7\u8F93\u5165"
23958
+ })))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
23959
+ span: 6
23960
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
23961
+ label: "\u8DE8\u5730\uFF08\u5E02\uFF09\u6807\u5FD7"
23962
+ }, getFieldDecorator('crossCitiesSign', {
23963
+ rules: readOnly ? [] : [{
23964
+ required: true,
23965
+ message: '请选择跨地(市)标志'
23966
+ }]
23967
+ })(readOnly ? /*#__PURE__*/React__default['default'].createElement(MyNY$1, null) : /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Select, {
23968
+ placeholder: "\u8BF7\u9009\u62E9",
23969
+ style: {
23970
+ width: '100%'
23971
+ }
23972
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Select.Option, {
23973
+ value: 'Y'
23974
+ }, "\u662F"), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Select.Option, {
23975
+ value: 'N'
23976
+ }, "\u5426"))))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
23977
+ span: 6
23978
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
23979
+ label: "\u5EFA\u7B51\u670D\u52A1\u53D1\u751F\u5730"
23980
+ }, getFieldDecorator('constructAddress', {
23981
+ rules: readOnly ? [] : [{
23982
+ required: true,
23983
+ message: '请选择省市区县'
23984
+ }]
23985
+ })(readOnly ? /*#__PURE__*/React__default['default'].createElement(MyArrString$1, null) : /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Cascader, {
23986
+ style: {
23987
+ width: '100%'
23988
+ },
23989
+ options: props.addressOptions,
23990
+ fieldNames: props.fieldNames,
23991
+ placeholder: "\u8BF7\u9009\u62E9\u7701\u5E02\u533A\u53BF"
23992
+ })))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
23993
+ span: 6
23994
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
23995
+ label: "\u8BE6\u7EC6\u5730\u5740"
23996
+ }, getFieldDecorator('constructDetailAddress', {
23997
+ rules: readOnly ? [] : [{
23998
+ max: 200,
23999
+ message: '详细地址最多200个字符'
24000
+ }]
24001
+ })(readOnly ? /*#__PURE__*/React__default['default'].createElement(MyDiv$4, null) : /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Input, {
24002
+ autoComplete: 'off',
24003
+ placeholder: "\u8BF7\u8F93\u5165\u8BE6\u7EC6\u5730\u5740"
24004
+ })))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
24005
+ span: 6
24006
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
24007
+ label: "\u5EFA\u7B51\u9879\u76EE\u540D\u79F0"
24008
+ }, getFieldDecorator('constructName', {
24009
+ rules: readOnly ? [] : [{
24010
+ required: true,
24011
+ message: '请输入建筑项目名称'
24012
+ }, {
24013
+ max: 200,
24014
+ message: '建筑项目名称最多200个字符'
24015
+ }]
24016
+ })(readOnly ? /*#__PURE__*/React__default['default'].createElement(MyDiv$4, null) : /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Input, {
24017
+ autoComplete: 'off',
24018
+ placeholder: "\u8BF7\u8F93\u5165"
24019
+ }))))));
24020
+ });
24021
+
24022
+ var MyDiv$4 = /*#__PURE__*/function (_React$Component) {
24023
+ _inherits(MyDiv, _React$Component);
24024
+
24025
+ var _super = _createSuper(MyDiv);
24026
+
24027
+ function MyDiv() {
24028
+ _classCallCheck(this, MyDiv);
24029
+
24030
+ return _super.apply(this, arguments);
24031
+ }
24032
+
24033
+ _createClass(MyDiv, [{
24034
+ key: "render",
24035
+ value: function render() {
24036
+ return /*#__PURE__*/React__default['default'].createElement("div", {
24037
+ style: this.props.style
24038
+ }, this.props.value);
24039
+ }
24040
+ }]);
24041
+
24042
+ return MyDiv;
24043
+ }(React__default['default'].Component);
24044
+
24045
+ var MyArrString$1 = /*#__PURE__*/function (_React$Component2) {
24046
+ _inherits(MyArrString, _React$Component2);
24047
+
24048
+ var _super2 = _createSuper(MyArrString);
24049
+
24050
+ function MyArrString() {
24051
+ _classCallCheck(this, MyArrString);
24052
+
24053
+ return _super2.apply(this, arguments);
24054
+ }
24055
+
24056
+ _createClass(MyArrString, [{
24057
+ key: "render",
24058
+ value: function render() {
24059
+ var _this$props$value;
24060
+
24061
+ return /*#__PURE__*/React__default['default'].createElement("div", {
24062
+ style: this.props.style
24063
+ }, (_this$props$value = this.props.value) === null || _this$props$value === void 0 ? void 0 : _this$props$value.filter(function (e) {
24064
+ return !!e;
24065
+ }).join(','));
24066
+ }
24067
+ }]);
24068
+
24069
+ return MyArrString;
24070
+ }(React__default['default'].Component);
24071
+
24072
+ var MyArrMoment$1 = /*#__PURE__*/function (_React$Component3) {
24073
+ _inherits(MyArrMoment, _React$Component3);
24074
+
24075
+ var _super3 = _createSuper(MyArrMoment);
24076
+
24077
+ function MyArrMoment() {
24078
+ _classCallCheck(this, MyArrMoment);
24079
+
24080
+ return _super3.apply(this, arguments);
24081
+ }
24082
+
24083
+ _createClass(MyArrMoment, [{
24084
+ key: "render",
24085
+ value: function render() {
24086
+ var _this$props$value2 = this.props.value,
24087
+ value = _this$props$value2 === void 0 ? [] : _this$props$value2;
24088
+ return /*#__PURE__*/React__default['default'].createElement("div", {
24089
+ style: this.props.style
24090
+ }, /*#__PURE__*/React__default['default'].createElement("span", null, hooks.isMoment(value[0]) && value[0].format('YYYY-MM-DD')), /*#__PURE__*/React__default['default'].createElement("span", {
24091
+ style: {
24092
+ color: '#9F603D',
24093
+ fontWeight: 600
24094
+ }
24095
+ }, " - "), /*#__PURE__*/React__default['default'].createElement("span", null, hooks.isMoment(value[1]) && value[0].format('YYYY-MM-DD')));
24096
+ }
24097
+ }]);
24098
+
24099
+ return MyArrMoment;
24100
+ }(React__default['default'].Component);
24101
+
24102
+ var MyNY$1 = /*#__PURE__*/function (_React$Component4) {
24103
+ _inherits(MyNY, _React$Component4);
24104
+
24105
+ var _super4 = _createSuper(MyNY);
24106
+
24107
+ function MyNY() {
24108
+ _classCallCheck(this, MyNY);
24109
+
24110
+ return _super4.apply(this, arguments);
24111
+ }
24112
+
24113
+ _createClass(MyNY, [{
24114
+ key: "render",
24115
+ value: function render() {
24116
+ return /*#__PURE__*/React__default['default'].createElement("div", {
24117
+ style: this.props.style
24118
+ }, this.props.value === 'Y' ? '是' : '否');
24119
+ }
24120
+ }]);
24121
+
24122
+ return MyNY;
24123
+ }(React__default['default'].Component);
24124
+
23927
24125
  var ImportBuyerDrawer = (function () {
23928
24126
  var controller = Invoice.useInvoiceController();
23929
24127
  var visible = controller.useMemo(function (s) {
@@ -24300,8 +24498,8 @@ var getItemCode = function getItemCode(record, editGood) {
24300
24498
  return record.productCode;
24301
24499
  };
24302
24500
 
24303
- var css_248z$s = ".kts-invoice-operate-goods-endow-code-button-list {\n display: flex;\n flex-direction: column;\n}\n.kts-invoice-operate-goods-endow-code-button-list > button {\n margin-bottom: 10px;\n}\n";
24304
- styleInject(css_248z$s);
24501
+ var css_248z$t = ".kts-invoice-operate-goods-endow-code-button-list {\n display: flex;\n flex-direction: column;\n}\n.kts-invoice-operate-goods-endow-code-button-list > button {\n margin-bottom: 10px;\n}\n";
24502
+ styleInject(css_248z$t);
24305
24503
 
24306
24504
  var TreeNode = ktsComponentsAntdX3.Tree.TreeNode;
24307
24505
  var confirm = ktsComponentsAntdX3.Modal.confirm;
@@ -24941,15 +25139,14 @@ var DrawerBody$3 = function DrawerBody(props) {
24941
25139
  // s.value = info.node.taxRate
24942
25140
  // }
24943
25141
  // });
24944
- var node = info.node || info;
24945
25142
  actions.setFieldState('taxClassificationCode', /*#__PURE__*/function () {
24946
25143
  var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(s) {
24947
25144
  return _regeneratorRuntime().wrap(function _callee12$(_context12) {
24948
25145
  while (1) {
24949
25146
  switch (_context12.prev = _context12.next) {
24950
25147
  case 0:
24951
- if (node.taxCategoryCode) {
24952
- s.value = node.taxCategoryCode;
25148
+ if (info.taxCategoryCode) {
25149
+ s.value = info.taxCategoryCode;
24953
25150
  }
24954
25151
 
24955
25152
  case 1:
@@ -24970,8 +25167,8 @@ var DrawerBody$3 = function DrawerBody(props) {
24970
25167
  while (1) {
24971
25168
  switch (_context13.prev = _context13.next) {
24972
25169
  case 0:
24973
- if (node.shorthand) {
24974
- s.value = node.shorthand;
25170
+ if (info.shorthand) {
25171
+ s.value = info.shorthand;
24975
25172
  }
24976
25173
 
24977
25174
  case 1:
@@ -24989,26 +25186,24 @@ var DrawerBody$3 = function DrawerBody(props) {
24989
25186
  setOpen(false);
24990
25187
  }, [controller, actions]);
24991
25188
  var onSelect = React__default['default'].useCallback(function (key, info) {
24992
- var node = info.node || info;
24993
-
24994
25189
  if (controller.state.goodsListState.isUpdateGoodsTaxRateList) {
24995
- var _node$taxRateList;
25190
+ var _info$node$taxRateLis;
24996
25191
 
24997
- if ((_node$taxRateList = node.taxRateList) === null || _node$taxRateList === void 0 ? void 0 : _node$taxRateList.length) {
24998
- setGoodsTaxRateList(node.taxRateList);
25192
+ if ((_info$node$taxRateLis = info.node.taxRateList) === null || _info$node$taxRateLis === void 0 ? void 0 : _info$node$taxRateLis.length) {
25193
+ setGoodsTaxRateList(info.node.taxRateList);
24999
25194
  }
25000
25195
 
25001
25196
  if (!readOnlyTaxRate) {
25002
25197
  actions.setFieldState('taxRate', /*#__PURE__*/function () {
25003
25198
  var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
25004
- var _node$taxRateList2;
25199
+ var _info$node$taxRateLis2;
25005
25200
 
25006
25201
  return _regeneratorRuntime().wrap(function _callee14$(_context14) {
25007
25202
  while (1) {
25008
25203
  switch (_context14.prev = _context14.next) {
25009
25204
  case 0:
25010
- if (node.taxRateList && ((_node$taxRateList2 = node.taxRateList) === null || _node$taxRateList2 === void 0 ? void 0 : _node$taxRateList2.length) === 1) {
25011
- s.value = node.taxRateList[0];
25205
+ if (info.node.taxRateList && ((_info$node$taxRateLis2 = info.node.taxRateList) === null || _info$node$taxRateLis2 === void 0 ? void 0 : _info$node$taxRateLis2.length) === 1) {
25206
+ s.value = info.node.taxRateList[0];
25012
25207
  } else {
25013
25208
  s.value = undefined;
25014
25209
  }
@@ -25536,6 +25731,8 @@ var Invoice = /*#__PURE__*/function (_React$PureComponent) {
25536
25731
 
25537
25732
  /** 特殊信息-不动产经营租赁服务(数电) */
25538
25733
 
25734
+ /** 特殊信息-建筑服务(数电) */
25735
+
25539
25736
  /** 货物列表(数电) */
25540
25737
 
25541
25738
  /** 货物索引生成器 */
@@ -25570,6 +25767,7 @@ Invoice.Stakeholder = Stakeholder$1;
25570
25767
  Invoice.StakeFarmerholder = StakeFarmerholder;
25571
25768
  Invoice.SignDigtal = SignDigtal;
25572
25769
  Invoice.RealEstateInfo = RealEstateInfo;
25770
+ Invoice.Architecture = Architecture;
25573
25771
  Invoice.GoodsListDigtal = GoodsList$1;
25574
25772
  Invoice.idGenerator = idGenerator;
25575
25773
  Invoice.calculator = calculator;
@@ -25687,11 +25885,11 @@ var Digtal = function Digtal(props) {
25687
25885
  ), /*#__PURE__*/React__default['default'].createElement(ImportGoodsDrawer, null), /*#__PURE__*/React__default['default'].createElement(EndowCodeDrawer, null));
25688
25886
  };
25689
25887
 
25690
- var css_248z$t = ".taxdetailsbox {\n display: flex;\n justify-content: flex-start;\n flex-direction: row;\n}\n.taxdetailsbox .taxrightbox {\n width: 340px;\n position: absolute;\n right: 30px;\n top: 79px;\n bottom: 50px;\n min-height: 300px;\n}\n.taxdetailsbox .taxrightbox .taxdesc {\n height: calc(100vh - 323px);\n min-height: 105px;\n overflow: auto;\n}\n";
25691
- styleInject(css_248z$t);
25888
+ var css_248z$u = ".taxdetailsbox {\n display: flex;\n justify-content: flex-start;\n flex-direction: row;\n}\n.taxdetailsbox .taxrightbox {\n width: 340px;\n position: absolute;\n right: 30px;\n}\n";
25889
+ styleInject(css_248z$u);
25692
25890
 
25693
25891
  function TaxClassificationModal(props) {
25694
- var _props$info6;
25892
+ var _props$info2, _props$info3;
25695
25893
 
25696
25894
  var _Form$useForm = ktsXui.Form.useForm(),
25697
25895
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
@@ -25771,16 +25969,6 @@ function TaxClassificationModal(props) {
25771
25969
  });
25772
25970
  };
25773
25971
 
25774
- React__default['default'].useEffect(function () {
25775
- var _props$info2, _props$info3, _props$info4, _props$info5;
25776
-
25777
- form.setFieldsValue(_objectSpread2(_objectSpread2({}, form.getFieldsValue()), {}, {
25778
- taxCategoryCode: props === null || props === void 0 ? void 0 : (_props$info2 = props.info) === null || _props$info2 === void 0 ? void 0 : _props$info2.taxCategoryCode,
25779
- productName: props === null || props === void 0 ? void 0 : (_props$info3 = props.info) === null || _props$info3 === void 0 ? void 0 : _props$info3.productName,
25780
- shorthand: props === null || props === void 0 ? void 0 : (_props$info4 = props.info) === null || _props$info4 === void 0 ? void 0 : _props$info4.shorthand,
25781
- taxDesc: props === null || props === void 0 ? void 0 : (_props$info5 = props.info) === null || _props$info5 === void 0 ? void 0 : _props$info5.taxDesc
25782
- }));
25783
- }, [props === null || props === void 0 ? void 0 : (_props$info6 = props.info) === null || _props$info6 === void 0 ? void 0 : _props$info6.key]);
25784
25972
  return /*#__PURE__*/React__default['default'].createElement(ktsXui.Drawer, {
25785
25973
  title: "\u5546\u54C1\u548C\u670D\u52A1\u7A0E\u6536\u5206\u7C7B\u7F16\u7801",
25786
25974
  placement: "right",
@@ -25826,10 +26014,16 @@ function TaxClassificationModal(props) {
25826
26014
  }))), /*#__PURE__*/React__default['default'].createElement(ktsXui.Card, {
25827
26015
  className: "taxrightbox"
25828
26016
  }, /*#__PURE__*/React__default['default'].createElement(ktsXui.Form, _objectSpread2(_objectSpread2({
25829
- form: form
26017
+ form: form,
26018
+ key: props === null || props === void 0 ? void 0 : (_props$info2 = props.info) === null || _props$info2 === void 0 ? void 0 : _props$info2.key
25830
26019
  }, layout), {}, {
25831
26020
  initialValues: props.info
25832
26021
  }), /*#__PURE__*/React__default['default'].createElement(ktsXui.Form.Item, {
26022
+ rules: [{
26023
+ required: true,
26024
+ message: '请勾选税收分类编码'
26025
+ }],
26026
+ initialValue: (_props$info3 = props.info) === null || _props$info3 === void 0 ? void 0 : _props$info3.taxCategoryCode,
25833
26027
  name: "taxCategoryCode",
25834
26028
  label: "\u7F16\u7801"
25835
26029
  }, /*#__PURE__*/React__default['default'].createElement(ktsXui.FormReadOnly, null)), /*#__PURE__*/React__default['default'].createElement(ktsXui.Form.Item, {
@@ -25839,8 +26033,7 @@ function TaxClassificationModal(props) {
25839
26033
  name: "shorthand",
25840
26034
  label: "\u7B80\u79F0"
25841
26035
  }, /*#__PURE__*/React__default['default'].createElement(ktsXui.FormReadOnly, null)), /*#__PURE__*/React__default['default'].createElement(ktsXui.Form.Item, {
25842
- name: "taxDesc",
25843
- className: "taxdesc",
26036
+ name: "desc",
25844
26037
  label: "\u8BF4\u660E"
25845
26038
  }, /*#__PURE__*/React__default['default'].createElement(ktsXui.FormReadOnly, null))))));
25846
26039
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "name": "kts-component-invoice-operate",
3
- "version": "3.2.173",
2
+ "name": "kts-component-invoice-operate",
3
+ "version": "3.2.175",
4
4
  "scripts": {
5
5
  "dev": "dumi dev --max-old-space-size=6096",
6
6
  "start": "dumi dev",
@@ -34,7 +34,7 @@
34
34
  "kts-components-antd-x3": "^3.26.20-5",
35
35
  "kts-components-antd-x4": "5.0.0",
36
36
  "kts-components-antd-x4-v4": "npm:kts-components-antd-x4@^4.0.3",
37
- "kts-xui": "^2.1.76",
37
+ "kts-xui": "^2.1.79",
38
38
  "mathjs": "^9.4.2",
39
39
  "next": "^11.0.1",
40
40
  "nzh": "^1.0.4",
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import Invoice from '../../..';
3
+ import moment from 'moment';
4
+ import 'antd/dist/antd.css';
5
+
6
+ export default () => {
7
+
8
+ const controller = React.useMemo(() => new Invoice.InvoiceController(), []);
9
+
10
+ React.useEffect(() => {
11
+ controller.run(async s => {
12
+ })
13
+ }, [])
14
+
15
+ return (
16
+ <Invoice
17
+ invoiceType='digtal'
18
+ controller={controller}
19
+ specialInfor={<Invoice.Architecture />}
20
+ />
21
+ )
22
+ };
@@ -32,3 +32,6 @@
32
32
 
33
33
  ## 不动产经营租赁服务
34
34
  <code src="./_test/realEstateInfo/index.tsx"></code>
35
+
36
+ ## 建筑服务
37
+ <code src="./_test/architecture/index.tsx"></code>
@@ -19,6 +19,7 @@ import StakeFarmerholder from './ui/digtal/StakeFarmerholder';
19
19
  import SignDigtal from './ui/digtal/Sign';
20
20
  import GoodsListDigtal from './ui/digtal/GoodsList';
21
21
  import RealEstateInfo from './ui/digtal/RealEstateInfo';
22
+ import Architecture from './ui/digtal/Architecture';
22
23
 
23
24
  import ImportBuyerDrawer from './ui/default/ImportBuyerDrawer';
24
25
  import ImportGoodsDrawer from './ui/default/ImportGoodsDrawer';
@@ -86,7 +87,7 @@ export default class Invoice extends React.PureComponent<IInvoiceProps> {
86
87
 
87
88
  /** 干系人(数电) */
88
89
  static readonly Stakeholder = Stakeholder;
89
-
90
+
90
91
  /** 农产品干系人(数电) */
91
92
  static readonly StakeFarmerholder = StakeFarmerholder;
92
93
 
@@ -95,6 +96,9 @@ export default class Invoice extends React.PureComponent<IInvoiceProps> {
95
96
 
96
97
  /** 特殊信息-不动产经营租赁服务(数电) */
97
98
  static readonly RealEstateInfo = RealEstateInfo;
99
+
100
+ /** 特殊信息-建筑服务(数电) */
101
+ static readonly Architecture = Architecture;
98
102
 
99
103
  /** 货物列表(数电) */
100
104
  static readonly GoodsListDigtal = GoodsListDigtal;
@@ -379,31 +379,30 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
379
379
  // s.value = info.node.taxRate
380
380
  // }
381
381
  // });
382
- let node = info.node || info;
382
+
383
383
  actions.setFieldState('taxClassificationCode', async s => {
384
- if(node.taxCategoryCode) {
385
- s.value = node.taxCategoryCode
384
+ if(info.taxCategoryCode) {
385
+ s.value = info.taxCategoryCode
386
386
  }
387
387
  });
388
388
 
389
389
  actions.setFieldState('shorthand', async (s) => {
390
- if (node.shorthand){
391
- s.value = node.shorthand
390
+ if (info.shorthand){
391
+ s.value = info.shorthand
392
392
  }
393
393
  });
394
394
  setOpen(false);
395
395
  }, [controller, actions]);
396
396
 
397
397
  const onSelect = React.useCallback((key: any, info: any) => {
398
- let node = info.node || info;
399
398
  if (controller.state.goodsListState.isUpdateGoodsTaxRateList) {
400
- if (node.taxRateList?.length) {
401
- setGoodsTaxRateList(node.taxRateList);
399
+ if (info.node.taxRateList?.length) {
400
+ setGoodsTaxRateList(info.node.taxRateList);
402
401
  }
403
402
  if (!readOnlyTaxRate) {
404
403
  actions.setFieldState('taxRate', async s => {
405
- if (node.taxRateList && node.taxRateList?.length === 1) {
406
- s.value = node.taxRateList[0]
404
+ if (info.node.taxRateList && info.node.taxRateList?.length === 1) {
405
+ s.value = info.node.taxRateList[0]
407
406
  } else {
408
407
  s.value = undefined
409
408
  }
@@ -0,0 +1,15 @@
1
+ .kts-invoice-operate-real-estate-info-digtal {
2
+ padding : 20px;
3
+ border-bottom: 2px solid #9F613E;
4
+ border-left : 2px solid #9F613E;
5
+ border-right : 2px solid #9F613E;
6
+
7
+ .real-estate-info-digtal-label {
8
+ color : #9F613E;
9
+ font-weight: bold;
10
+ }
11
+
12
+ .ktsAnt3x-row.ktsAnt3x-form-item {
13
+ margin-bottom: 0;
14
+ }
15
+ }
@@ -0,0 +1,166 @@
1
+
2
+ import React from "react";
3
+ import { decorator } from 'grey-react-box';
4
+ import { Form } from 'kts-components-antd-x3';
5
+ import { FormComponentProps } from 'kts-components-antd-x3/lib/form';
6
+ import Invoice from '../../..';
7
+ import './index.less';
8
+ import { Cascader, Col, Input, Row, Select } from "kts-components-antd-x4";
9
+ import moment from "moment";
10
+
11
+
12
+ export interface RealEstateInfoProps {
13
+ /**
14
+ * 建筑服务地址数据
15
+ */
16
+ addressOptions?: any[];
17
+
18
+ /**
19
+ * 建筑服务地址数据字段名
20
+ */
21
+ fieldNames?: any;
22
+ }
23
+
24
+ /** 特殊信息-建筑服务 */
25
+ export default decorator<RealEstateInfoProps, FormComponentProps & RealEstateInfoProps>(Form.create())(props => {
26
+
27
+ /** 控制器 */
28
+ const controller = Invoice.useInvoiceController();
29
+
30
+ const { form } = props;
31
+
32
+ const { getFieldDecorator } = form;
33
+
34
+ const model = controller.useMemo(s => s.model, []);
35
+
36
+ const readOnly = React.useMemo(() => model === 'readOnly', [model]);
37
+
38
+ // 注册 form
39
+ controller.useForm('realEstateInfo', form);
40
+
41
+ return (
42
+ <div className="kts-invoice-operate-real-estate-info-digtal">
43
+ <div className='real-estate-info-digtal-label' >特殊信息-建筑服务</div>
44
+ <Row gutter={[17, 0]}>
45
+ <Col span={6} >
46
+ <Form.Item label='土地增值税项目编号' >
47
+ {getFieldDecorator('landNumber', {
48
+ })(
49
+ readOnly
50
+ ? <MyDiv />
51
+ : <Input autoComplete='off' placeholder="请输入" />
52
+ )}
53
+ </Form.Item>
54
+ </Col>
55
+ <Col span={6} >
56
+ <Form.Item label='跨地(市)标志' >
57
+ {getFieldDecorator('crossCitiesSign', {
58
+ rules: readOnly ? [] : [
59
+ { required: true, message: '请选择跨地(市)标志' }
60
+ ]
61
+ })(
62
+ readOnly
63
+ ? <MyNY />
64
+ : <Select placeholder='请选择' style={{ width: '100%' }} >
65
+ <Select.Option value='Y'>是</Select.Option>
66
+ <Select.Option value='N'>否</Select.Option>
67
+ </Select>
68
+ )}
69
+ </Form.Item>
70
+ </Col>
71
+
72
+ <Col span={6} >
73
+ <Form.Item label='建筑服务发生地' >
74
+ {getFieldDecorator('constructAddress', {
75
+ rules: readOnly ? [] : [{ required: true, message: '请选择省市区县' }]
76
+ })(
77
+ readOnly
78
+ ? (<MyArrString />)
79
+ : (<Cascader
80
+ style={{ width: '100%' }}
81
+ options={props.addressOptions}
82
+ fieldNames={props.fieldNames}
83
+ placeholder="请选择省市区县"
84
+ />)
85
+ )}
86
+ </Form.Item>
87
+ </Col>
88
+ <Col span={6} >
89
+ <Form.Item label='详细地址' >
90
+ {getFieldDecorator('constructDetailAddress', {
91
+ rules: readOnly ? [] : [
92
+ { max: 200, message: '详细地址最多200个字符' },
93
+ ]
94
+ })(
95
+ readOnly
96
+ ? <MyDiv />
97
+ : <Input autoComplete='off' placeholder="请输入详细地址" />
98
+ )}
99
+ </Form.Item>
100
+ </Col>
101
+ <Col span={6} >
102
+ <Form.Item label='建筑项目名称' >
103
+ {getFieldDecorator('constructName', { rules: readOnly ? [] : [
104
+ { required: true, message: '请输入建筑项目名称' },
105
+ { max: 200, message: '建筑项目名称最多200个字符' },
106
+
107
+ ]
108
+ })(
109
+ readOnly
110
+ ? <MyDiv />
111
+ : <Input autoComplete='off' placeholder="请输入" />
112
+ )}
113
+ </Form.Item>
114
+ </Col>
115
+
116
+ </Row>
117
+ </div>
118
+ )
119
+ })
120
+
121
+ class MyDiv extends React.Component<{ value?: string, style?: React.CSSProperties }> {
122
+ render(): React.ReactNode {
123
+ return (
124
+ <div style={this.props.style}>{this.props.value}</div>
125
+ )
126
+ }
127
+ }
128
+
129
+ class MyArrString extends React.Component<{ value?: string[], style?: React.CSSProperties }> {
130
+ render(): React.ReactNode {
131
+ return (
132
+ <div style={this.props.style}>
133
+ {
134
+ this.props.value?.filter(e => !!e)
135
+ .join(',')
136
+ }
137
+ </div>
138
+ )
139
+ }
140
+ }
141
+
142
+ class MyArrMoment extends React.Component<{ value?: moment.Moment[], style?: React.CSSProperties }> {
143
+ render(): React.ReactNode {
144
+ const { value = [] } = this.props
145
+ return (
146
+ <div style={this.props.style}>
147
+ <span>{moment.isMoment(value[0]) && value[0].format('YYYY-MM-DD')}</span>
148
+ <span style={{ color: '#9F603D', fontWeight: 600 }} > - </span>
149
+ <span>{moment.isMoment(value[1]) && value[0].format('YYYY-MM-DD')}</span>
150
+ </div>
151
+ )
152
+ }
153
+ }
154
+
155
+ class MyNY extends React.Component<{ value?: 'Y' | 'N', style?: React.CSSProperties }> {
156
+ render(): React.ReactNode {
157
+ return (
158
+ <div style={this.props.style}>
159
+ {
160
+ this.props.value === 'Y' ? '是' : '否'
161
+ }
162
+ </div>
163
+ )
164
+ }
165
+ }
166
+
@@ -6,13 +6,5 @@
6
6
  width: 340px;
7
7
  position: absolute;
8
8
  right: 30px;
9
- top: 79px;
10
- bottom: 50px;
11
- min-height: 300px;
12
- .taxdesc{
13
- height: calc(100vh - 323px);
14
- min-height: 105px;
15
- overflow:auto
16
- }
17
9
  }
18
10
  }
@@ -79,16 +79,7 @@ export default function TaxClassificationModal(props: TaxClassificationProps) {
79
79
  }).catch(errorInfo => {
80
80
  console.log('errorInfo', errorInfo);
81
81
  });
82
- }
83
- React.useEffect(() => {
84
- form.setFieldsValue({
85
- ...form.getFieldsValue(),
86
- taxCategoryCode: props?.info?.taxCategoryCode,
87
- productName: props?.info?.productName,
88
- shorthand: props?.info?.shorthand,
89
- taxDesc: props?.info?.taxDesc,
90
- })
91
- },[props?.info?.key])
82
+ }
92
83
  return (
93
84
  <Drawer
94
85
  title="商品和服务税收分类编码"
@@ -132,8 +123,8 @@ export default function TaxClassificationModal(props: TaxClassificationProps) {
132
123
  </Form.Item>
133
124
  </Form>
134
125
  <Card className="taxrightbox">
135
- <Form form={form} {...layout} initialValues={props.info} >
136
- <Form.Item name={"taxCategoryCode"} label="编码">
126
+ <Form form={form} key={props?.info?.key} {...layout} initialValues={props.info} >
127
+ <Form.Item rules={[{ required: true, message: '请勾选税收分类编码' }, ]} initialValue={props.info?.taxCategoryCode} name={"taxCategoryCode"} label="编码">
137
128
  <FormReadOnly />
138
129
  </Form.Item>
139
130
  <Form.Item name={"productName"} label="货物和劳务名称">
@@ -142,7 +133,7 @@ export default function TaxClassificationModal(props: TaxClassificationProps) {
142
133
  <Form.Item name={"shorthand"} label="简称">
143
134
  <FormReadOnly />
144
135
  </Form.Item>
145
- <Form.Item name={"taxDesc"} className="taxdesc" label="说明">
136
+ <Form.Item name={"desc"} label="说明">
146
137
  <FormReadOnly />
147
138
  </Form.Item>
148
139
  </Form>