Browse Source

fix(): 解决企业开票问题

master
chenqiang 1 year ago
parent
commit
d8786c9eca
  1. 5
      src/pages/FinancialMgm/Invoice/CreateInvoice/index.scss
  2. 103
      src/pages/FinancialMgm/Invoice/CreateInvoice/loadable.jsx

5
src/pages/FinancialMgm/Invoice/CreateInvoice/index.scss

@ -150,6 +150,11 @@ $color-primary : var(--color-primary);
} }
.modal-invoicerepeat { .modal-invoicerepeat {
.ant-form-item {
height: 54px;
margin-bottom: 0;
}
.ant-form-item-label>label { .ant-form-item-label>label {
position: relative; position: relative;
display: inline-flex; display: inline-flex;

103
src/pages/FinancialMgm/Invoice/CreateInvoice/loadable.jsx

@ -109,7 +109,99 @@ function CreateInvoice() {
{ {
text: "纳税人识别号", text: "纳税人识别号",
value: "duty_paragraph", value: "duty_paragraph",
type: 34,
rules: "", 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: "地址", text: "地址",
@ -148,6 +240,7 @@ function CreateInvoice() {
); );
// //
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [lo, setLo] = useState();
// //
const [Data, setData] = useState({ const [Data, setData] = useState({
data: [], data: [],
@ -352,11 +445,16 @@ function CreateInvoice() {
}); });
}; };
// //
const FormTable = (data, disabledcol) => {
const FormTable = (data, disabledcol, tmd) => {
return ( return (
<Form <Form
form={form} form={form}
name="dyamic_rule" name="dyamic_rule"
onValuesChange={(changedValues, allValues) => {
if (Object.keys(changedValues)[0] == "header_type") {
setLo(changedValues.header_type);
}
}}
style={{ style={{
width: 760, width: 760,
}} }}
@ -694,13 +792,14 @@ function CreateInvoice() {
open={Open} open={Open}
footer={null} footer={null}
onCancel={() => { onCancel={() => {
form.resetFields();
setOpen(false); setOpen(false);
}} }}
width={800} width={800}
className="modal-invoicerepeat" className="modal-invoicerepeat"
title={"开具电子发票"} title={"开具电子发票"}
> >
{FormTable(pushred, [])}
{lo == 2 ? FormTable(pushreds, []) : FormTable(pushred, [])}
<div className="fptext"> <div className="fptext">
<p className="fpo"> <p className="fpo">
<span>发票内容</span> <span>发票内容</span>

Loading…
Cancel
Save