账单审核状态查询,统计勾选记录的价格,修复城市不完整问题

main
Ycc 8 months ago
parent b2df11beb3
commit fc494b57fc

@ -44,6 +44,7 @@ const SearchForm = ({ initialValue, onSubmit, onReset, onMounted, confirmText, f
{ key: "endtime", transform: arrVal => (arrVal ? arrVal[1].format(SMALL_DATETIME_FORMAT) : "") }, { key: "endtime", transform: arrVal => (arrVal ? arrVal[1].format(SMALL_DATETIME_FORMAT) : "") },
], ],
invoiceStatus: { key: "invoiceStatus", transform: value => value?.value || value?.key || "", default: "" }, invoiceStatus: { key: "invoiceStatus", transform: value => value?.value || value?.key || "", default: "" },
invoiceCheckStatus: { key: "invoiceCheckStatus", transform: value => value?.value || value?.key || "", default: "" },
audit_state: { key: "audit_state", transform: value => value?.value || value?.key || "", default: "" }, audit_state: { key: "audit_state", transform: value => value?.value || value?.key || "", default: "" },
agency: { agency: {
key: "agency", key: "agency",
@ -222,6 +223,22 @@ function getFields(props) {
</Form.Item>, </Form.Item>,
fieldProps?.invoiceStatus?.col || 3 fieldProps?.invoiceStatus?.col || 3
), ),
item(
"invoiceCheckStatus", //
99,
<Form.Item name={`invoiceCheckStatus`} initialValue={at(props, "initialValue.invoiceCheckStatus")[0] || { value: "0", label: "全部"}}>
<Select
labelInValue
options={[
{ value: "0", label: "全部" },
{ value: "1", label: "待提交" },
{ value: "2", label: "已提交待审核" },
{ value: "3", label: "已完成" },
]}
/>
</Form.Item>,
fieldProps?.invoiceCheckStatus?.col || 3
),
item( item(
"dates", // "dates", //
99, 99,

@ -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,9 +124,8 @@ const Invoice = props => {
</Checkbox> </Checkbox>
) : ( ) : (
<Steps <Steps
size="small" size="small"
current={record.CheckStatus-1} current={record.CheckStatus - 1}
items={[ items={[
{ {
title: "提交账单", title: "提交账单",
@ -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}>
提交账单 提交账单

Loading…
Cancel
Save