|
|
@ -1,5 +1,5 @@
|
|
|
|
import { useState, useEffect } from "react";
|
|
|
|
import { useState, useEffect } from "react";
|
|
|
|
import { Grid, Divider, Layout, Steps, Input, Col, Row, Space, Checkbox, Table, Button, App, Typography } from "antd";
|
|
|
|
import { Grid, Divider, Layout, Steps, Statistic, Col, Row, Space, Checkbox, Table, Button, App, Typography } from "antd";
|
|
|
|
import { PhoneOutlined, CustomerServiceOutlined, FrownTwoTone, LikeTwoTone } from "@ant-design/icons";
|
|
|
|
import { PhoneOutlined, CustomerServiceOutlined, FrownTwoTone, LikeTwoTone } from "@ant-design/icons";
|
|
|
|
import { useParams, useHref, useNavigate, NavLink } from "react-router-dom";
|
|
|
|
import { useParams, useHref, useNavigate, NavLink } from "react-router-dom";
|
|
|
|
import { isEmpty, formatColonTime } from "@/utils/commons";
|
|
|
|
import { isEmpty, formatColonTime } from "@/utils/commons";
|
|
|
@ -46,10 +46,16 @@ const Invoice = props => {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
title: "城市",
|
|
|
|
title: "出发",
|
|
|
|
key: "FromCity",
|
|
|
|
key: "FromCity",
|
|
|
|
dataIndex: "FromCity",
|
|
|
|
dataIndex: "FromCity",
|
|
|
|
render: (text, record) => (record.CostType == "出票" ? `${record.FromCity} - ${record.ToCity}` : "-"),
|
|
|
|
render: (text, record) => (record.CostType == "出票" ? `${record.FromCity}` : "-"),
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
title: "抵达",
|
|
|
|
|
|
|
|
key: "ToCity",
|
|
|
|
|
|
|
|
dataIndex: "ToCity",
|
|
|
|
|
|
|
|
render: (text, record) => (record.CostType == "出票" ? `${record.ToCity}` : "-"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
title: "航班",
|
|
|
|
title: "航班",
|
|
|
@ -118,7 +124,6 @@ const Invoice = props => {
|
|
|
|
</Checkbox>
|
|
|
|
</Checkbox>
|
|
|
|
) : (
|
|
|
|
) : (
|
|
|
|
<Steps
|
|
|
|
<Steps
|
|
|
|
|
|
|
|
|
|
|
|
size="small"
|
|
|
|
size="small"
|
|
|
|
current={record.CheckStatus - 1}
|
|
|
|
current={record.CheckStatus - 1}
|
|
|
|
items={[
|
|
|
|
items={[
|
|
|
@ -139,6 +144,7 @@ const Invoice = props => {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
|
|
sorter: (a, b) => {
|
|
|
|
sorter: (a, b) => {
|
|
|
|
return b.CheckStatus - a.CheckStatus;
|
|
|
|
return b.CheckStatus - a.CheckStatus;
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -150,7 +156,7 @@ const Invoice = props => {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
// 处理checkbox改变事件
|
|
|
|
// 处理checkbox改变事件
|
|
|
|
const handleCheckboxChange = (event, data) => {
|
|
|
|
const handleCheckboxChange = (event, data) => {
|
|
|
|
const value = { CLC_SN: data.CLC_SN, WL: data.WL, OPI_SN: data.OPI_SN, OPI_Email: data.OPI_Email, GRI_SN: data.GRI_SN, GRI_Name: data.GRI_Name };
|
|
|
|
const value = { CLC_SN: data.CLC_SN, WL: data.WL, OPI_SN: data.OPI_SN, OPI_Email: data.OPI_Email, GRI_SN: data.GRI_SN, GRI_Name: data.GRI_Name, Cost: data.Cost, ServiceFee: data.ServiceFee };
|
|
|
|
if (event.target.checked) {
|
|
|
|
if (event.target.checked) {
|
|
|
|
setSelectedValues([...selectedValues, value]); // 如果被选中,则添加到数组
|
|
|
|
setSelectedValues([...selectedValues, value]); // 如果被选中,则添加到数组
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -185,7 +191,11 @@ const Invoice = props => {
|
|
|
|
if (isEmpty(vEIFlightBill)) return;
|
|
|
|
if (isEmpty(vEIFlightBill)) return;
|
|
|
|
const allChecked = selectedValues.length === vEIFlightBill.filter(item => item.CheckStatus < 2).length;
|
|
|
|
const allChecked = selectedValues.length === vEIFlightBill.filter(item => item.CheckStatus < 2).length;
|
|
|
|
setSelectedValues(
|
|
|
|
setSelectedValues(
|
|
|
|
allChecked ? [] : vEIFlightBill.filter(item => item.CheckStatus < 2).map(item => ({ CLC_SN: item.CLC_SN, WL: item.WL, OPI_SN: item.OPI_SN, OPI_Email: item.OPI_Email, GRI_SN: item.GRI_SN, GRI_Name: item.GRI_Name }))
|
|
|
|
allChecked
|
|
|
|
|
|
|
|
? []
|
|
|
|
|
|
|
|
: vEIFlightBill
|
|
|
|
|
|
|
|
.filter(item => item.CheckStatus < 2)
|
|
|
|
|
|
|
|
.map(item => ({ CLC_SN: item.CLC_SN, WL: item.WL, OPI_SN: item.OPI_SN, OPI_Email: item.OPI_Email, GRI_SN: item.GRI_SN, GRI_Name: item.GRI_Name, Cost: item.Cost, ServiceFee: item.ServiceFee }))
|
|
|
|
); // 如果全选,则清空数组,否则添加所有项
|
|
|
|
); // 如果全选,则清空数组,否则添加所有项
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -200,14 +210,14 @@ const Invoice = props => {
|
|
|
|
dates: [dayjs().startOf("M"), dayjs().endOf("M")],
|
|
|
|
dates: [dayjs().startOf("M"), dayjs().endOf("M")],
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
fieldsConfig={{
|
|
|
|
fieldsConfig={{
|
|
|
|
shows: ["referenceNo", "dates", "invoiceStatus"],
|
|
|
|
shows: ["referenceNo", "dates", "invoiceCheckStatus"],
|
|
|
|
fieldProps: {
|
|
|
|
fieldProps: {
|
|
|
|
referenceNo: { label: "搜索计划" },
|
|
|
|
referenceNo: { label: "搜索计划" },
|
|
|
|
dates: { label: "出发日期", col: 8 },
|
|
|
|
dates: { label: "出发日期", col: 8 },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
onSubmit={(err, formVal, filedsVal) => {
|
|
|
|
onSubmit={(err, formVal, filedsVal) => {
|
|
|
|
getVEIFlightBill(travelAgencyId, formVal.referenceNo, formVal.invoiceStatus, formVal.startdate, formVal.endtime);
|
|
|
|
getVEIFlightBill(travelAgencyId, formVal.referenceNo, formVal.invoiceCheckStatus, formVal.startdate, formVal.endtime);
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</Col>
|
|
|
|
</Col>
|
|
|
@ -219,14 +229,20 @@ const Invoice = props => {
|
|
|
|
<Row>
|
|
|
|
<Row>
|
|
|
|
<Col md={24} lg={24} xxl={24}>
|
|
|
|
<Col md={24} lg={24} xxl={24}>
|
|
|
|
<Table bordered={true} rowKey="CLC_SN" columns={vEIFlightBillColumns} dataSource={vEIFlightBill} loading={loading} pagination={{ defaultPageSize: 100, showTotal: showTotal }} />
|
|
|
|
<Table bordered={true} rowKey="CLC_SN" columns={vEIFlightBillColumns} dataSource={vEIFlightBill} loading={loading} pagination={{ defaultPageSize: 100, showTotal: showTotal }} />
|
|
|
|
|
|
|
|
|
|
|
|
<TableExportBtn btnTxt="导出账单" label={`机票账单`} {...{ columns: vEIFlightBillColumns, dataSource: vEIFlightBill }} />
|
|
|
|
<TableExportBtn btnTxt="导出账单" label={`机票账单`} {...{ columns: vEIFlightBillColumns, dataSource: vEIFlightBill }} />
|
|
|
|
</Col>
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
|
|
|
|
<Col md={24} lg={24} xxl={24}></Col>
|
|
|
|
<Col md={24} lg={24} xxl={24}></Col>
|
|
|
|
</Row>
|
|
|
|
</Row>
|
|
|
|
<Row>
|
|
|
|
<Row>
|
|
|
|
<Col md={24} lg={22} xxl={22}></Col>
|
|
|
|
<Col md={24} lg={18} xxl={18}></Col>
|
|
|
|
|
|
|
|
<Col md={24} lg={2} xxl={2}>
|
|
|
|
|
|
|
|
<Statistic title="已选机票价格" value={selectedValues.reduce((acc, curr) => acc + curr.Cost, 0)} />
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
<Col md={24} lg={2} xxl={2}>
|
|
|
|
|
|
|
|
<Statistic title="已选服务费" value={selectedValues.reduce((acc, curr) => acc + curr.ServiceFee, 0)} />
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
<Col md={24} lg={2} xxl={2}>
|
|
|
|
<Col md={24} lg={2} xxl={2}>
|
|
|
|
<Button type="primary" size="large" onClick={postInvoice} disabled={selectedValues.length == 0}>
|
|
|
|
<Button type="primary" size="large" onClick={postInvoice} disabled={selectedValues.length == 0}>
|
|
|
|
提交账单
|
|
|
|
提交账单
|
|
|
|