From d8786c9eca3b4b27abf9be83f75424fab91125c5 Mon Sep 17 00:00:00 2001 From: chenqiang Date: Fri, 29 Dec 2023 16:23:03 +0800 Subject: [PATCH] =?UTF-8?q?fix():=20=E8=A7=A3=E5=86=B3=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E5=BC=80=E7=A5=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FinancialMgm/Invoice/CreateInvoice/index.scss | 5 + .../Invoice/CreateInvoice/loadable.jsx | 103 ++++++++++++++++++++- 2 files changed, 106 insertions(+), 2 deletions(-) diff --git a/src/pages/FinancialMgm/Invoice/CreateInvoice/index.scss b/src/pages/FinancialMgm/Invoice/CreateInvoice/index.scss index 2e50ae1..a686873 100644 --- a/src/pages/FinancialMgm/Invoice/CreateInvoice/index.scss +++ b/src/pages/FinancialMgm/Invoice/CreateInvoice/index.scss @@ -150,6 +150,11 @@ $color-primary : var(--color-primary); } .modal-invoicerepeat { + .ant-form-item { + height: 54px; + margin-bottom: 0; + } + .ant-form-item-label>label { position: relative; display: inline-flex; diff --git a/src/pages/FinancialMgm/Invoice/CreateInvoice/loadable.jsx b/src/pages/FinancialMgm/Invoice/CreateInvoice/loadable.jsx index 8f09c68..28d5dc3 100644 --- a/src/pages/FinancialMgm/Invoice/CreateInvoice/loadable.jsx +++ b/src/pages/FinancialMgm/Invoice/CreateInvoice/loadable.jsx @@ -109,7 +109,99 @@ function CreateInvoice() { { text: "纳税人识别号", value: "duty_paragraph", + type: 34, rules: "", + // [ + // { + // required: true, + // message: "纳税人识别号不能为空", + // }, + // ], + }, + { + text: "地址", + value: "address", + rules: "", + }, + { + text: "电话", + value: "tel", + rules: [ + { + pattern: /^1[3|4|5|7|8|9]\d{9}$/, + message: "电话格式错误,请重新输入", + }, + ], + }, + { + text: "开户行", + value: "bank", + rules: "", + }, + { + text: "账号", + value: "account", + rules: "", + }, + ]; + const pushreds = [ + { + text: "电子邮箱", + value: "email", + type: 1, + rules: [ + { + required: true, + message: "电子邮箱不能为空", + }, + { + pattern: + /^[A-Za-z0-9-_\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/, + message: "邮箱格式错误,请重新输入", + }, + ], + }, + { + text: "发票类型", + value: "header_type", + type: 2, + data: [ + { + value: 1, + label: "个人", + }, + { + value: 2, + label: "企业", + }, + ], + rules: [ + { + required: true, + message: "发票类型不能为空", + }, + ], + }, + { + text: "发票抬头", + value: "header_name", + rules: [ + { + required: true, + message: "发票抬头不能为空", + }, + ], + }, + { + text: "纳税人识别号", + value: "duty_paragraph", + type: 34, + rules: [ + { + required: true, + message: "纳税人识别号不能为空", + }, + ], }, { text: "地址", @@ -148,6 +240,7 @@ function CreateInvoice() { ); //页面状态 const [loading, setLoading] = useState(false); + const [lo, setLo] = useState(); //页面数据 const [Data, setData] = useState({ data: [], @@ -352,11 +445,16 @@ function CreateInvoice() { }); }; //表单输出 - const FormTable = (data, disabledcol) => { + const FormTable = (data, disabledcol, tmd) => { return (
{ + if (Object.keys(changedValues)[0] == "header_type") { + setLo(changedValues.header_type); + } + }} style={{ width: 760, }} @@ -694,13 +792,14 @@ function CreateInvoice() { open={Open} footer={null} onCancel={() => { + form.resetFields(); setOpen(false); }} width={800} className="modal-invoicerepeat" title={"开具电子发票"} > - {FormTable(pushred, [])} + {lo == 2 ? FormTable(pushreds, []) : FormTable(pushred, [])}

发票内容