Merge remote-tracking branch 'origin/main'

perf/export-docx
Lei OT 10 months ago
commit c4d0ac4e4e

@ -51,6 +51,8 @@ const airTicketStore = create((set, get) => ({
for (const [key, value] of Object.entries(info_object)) {
formData.set(key, value); //再用新值覆盖
}
//是否出票的值true、false变为1或0
formData.set("TicketIssued", info_object.TicketIssued ? 1 : 0);
const postUrl = HT_HOST + "/Service_BaseInfoWeb/edit_or_new_flight_info";
return postForm(postUrl, formData).then(json => {
if (json.errcode == 0) {
@ -72,7 +74,8 @@ const airTicketStore = create((set, get) => ({
},
//获取账单列表
async getVEIFlightBill(VEI_SN, GRI_Name, CheckStatus, FlightDate1, FlightDate2) {
const { setVEIFlightBill } = get();
const { setLoading,setVEIFlightBill } = get();
setLoading(true);
const searchParams = {
VEI_SN: VEI_SN,
GRI_Name: GRI_Name,
@ -83,6 +86,7 @@ const airTicketStore = create((set, get) => ({
const { errcode, result } = await fetchJSON(`${HT_HOST}/Service_BaseInfoWeb/GetVEIFlightBill`, searchParams);
const _result = errcode !== 0 ? [] : result;
setVEIFlightBill(_result);
setLoading(false);
},
//保存费用
async postFlightCost(values) {
@ -136,8 +140,9 @@ const airTicketStore = create((set, get) => ({
});
},
//提交账单
async postVEIFlightBillSubmit(values) {
async postVEIFlightBillSubmit(VEI_SN,values) {
const formData = new FormData();
formData.append("vei_sn", VEI_SN);
formData.append("billdata", JSON.stringify(values));
const postUrl = HT_HOST + "/Service_BaseInfoWeb/VEIFlightBillSubmit";
return postForm(postUrl, formData).then(json => {
@ -148,6 +153,16 @@ const airTicketStore = create((set, get) => ({
}
});
},
//通知顾问查看机票信息
async ticketIssuedNotifications(CLF_SN, OPI_SN) {
const searchParams = {
CLF_SN: CLF_SN,
OPI_SN: OPI_SN,
};
const { errcode, result } = await fetchJSON(`${HT_HOST}/Service_BaseInfoWeb/TicketIssuedNotifications`, searchParams);
const _result = errcode !== 0 ? [] : result;
return _result;
},
}));
export default airTicketStore;

@ -65,9 +65,15 @@ const planListColumns = [
},
{
title: "是否出票",
key: "CLF_SN",
dataIndex: "CLF_SN",
render: (text, record) => "否",
key: "TicketIssued",
dataIndex: "TicketIssued",
render: (text, record) => record.TicketIssuedName,
},
{
title: "状态",
key: "FlightStatus",
dataIndex: "FlightStatus",
render: (text, record) => record.FlightStatusName,
},
{
title: "操作",

@ -18,8 +18,6 @@ const Invoice = props => {
const showTotal = total => `合计 ${total} `;
const [selectedValues, setSelectedValues] = useState([]);
//
const totalFee = vEIFlightBill && vEIFlightBill.reduce((acc, curr) => acc + curr.ServiceFee, 0);
const vEIFlightBillColumns = [
{
title: "团名",
@ -33,10 +31,10 @@ const Invoice = props => {
dataIndex: "CostType",
},
{
title: "手续费/费用",
title: "手续费",
children: [
{
title: totalFee,
title: vEIFlightBill && vEIFlightBill.reduce((acc, curr) => acc + curr.ServiceFee, 0),
dataIndex: "ServiceFee",
},
],
@ -83,9 +81,14 @@ const Invoice = props => {
},
{
title: "机票价格",
children: [
{
title: vEIFlightBill && vEIFlightBill.reduce((acc, curr) => acc + curr.Cost, 0),
dataIndex: "Cost",
render: (text, record) => (record.CostType == "出票" ? text : "-"),
},
],
key: "Cost",
dataIndex: "Cost",
render: (text, record) => (record.CostType == "出票" ? text : "-"),
},
{
title: "折扣",
@ -110,7 +113,7 @@ const Invoice = props => {
dataIndex: "CheckStatus", //2
render: (text, record) =>
record.CheckStatus < 2 ? (
<Checkbox onChange={event => handleCheckboxChange(event, record.CLC_SN, record.OPI_SN)} checked={checkboxStates(record.CLC_SN)}>
<Checkbox onChange={event => handleCheckboxChange(event, record)} checked={checkboxStates(record.CLC_SN)}>
待提交
</Checkbox>
) : (
@ -128,8 +131,8 @@ const Invoice = props => {
return selectedValues.some(v => v.CLC_SN === CLC_SN);
};
// checkbox
const handleCheckboxChange = (event, CLC_SN, OPI_SN) => {
const value = { CLC_SN: CLC_SN, OPI_SN: OPI_SN };
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 };
if (event.target.checked) {
setSelectedValues([...selectedValues, value]); //
} else {
@ -138,11 +141,11 @@ const Invoice = props => {
};
//
const postInvoice = () => {
postVEIFlightBillSubmit(selectedValues)
postVEIFlightBillSubmit(travelAgencyId, selectedValues)
.then(() => {
notification.success({
message: `成功`,
description: "保存成功!",
description: "账单提交成功!",
placement: "top",
duration: 4,
icon: <LikeTwoTone />,

@ -1,5 +1,5 @@
import { useState, useEffect } from "react";
import { Grid, Divider, Layout, Modal, Form, Input, Col, Row, Space, Collapse, Table, Button, Select, App, Popconfirm } from "antd";
import { Grid, Divider, Layout, Modal, Form, Input, Col, Row, Space, Collapse, Table, Button, Select, App, Popconfirm, Switch } from "antd";
import { PhoneOutlined, FrownTwoTone, LikeTwoTone, ArrowUpOutlined, ArrowDownOutlined } from "@ant-design/icons";
import { useParams, useHref, useNavigate, NavLink } from "react-router-dom";
import { isEmpty, formatColonTime } from "@/utils/commons";
@ -12,7 +12,7 @@ import BackBtn from "@/components/BackBtn";
const AirticketPlan = props => {
const { coli_sn, gri_sn } = useParams();
const { travelAgencyId, loginToken, userId } = usingStorage();
const [getPlanDetail, planDetail, getGuestList, guestList, loading, postFlightDetail, postFlightCost, deleteFlightCost, getVeiPlanChange, veiPlanChangeTxt, postVeiFlightPlanConfirm] = airTicketStore(state => [
const [getPlanDetail, planDetail, getGuestList, guestList, loading, postFlightDetail, postFlightCost, deleteFlightCost, getVeiPlanChange, veiPlanChangeTxt, postVeiFlightPlanConfirm, ticketIssuedNotifications] = airTicketStore(state => [
state.getPlanDetail,
state.planDetail,
state.getGuestList,
@ -24,6 +24,7 @@ const AirticketPlan = props => {
state.getVeiPlanChange,
state.veiPlanChangeTxt,
state.postVeiFlightPlanConfirm,
state.ticketIssuedNotifications,
]);
const reservationUrl = `https://p9axztuwd7x8a7.mycht.cn/Service_BaseInfoWeb/FlightPlanDocx?GRI_SN=${gri_sn}&VEI_SN=${travelAgencyId}&token=${loginToken}`;
const reservationPreviewUrl = OFFICEWEBVIEWERURL + encodeURIComponent(reservationUrl);
@ -42,7 +43,6 @@ const AirticketPlan = props => {
};
const guestList_OnChange = value => {
console.log(value);
ticket_form.setFieldsValue({ Memo: `${value}` });
};
@ -54,7 +54,7 @@ const AirticketPlan = props => {
dataIndex: "CostType",
},
{
title: "手续费/费用",
title: "手续费",
key: "ServiceFee",
dataIndex: "ServiceFee",
},
@ -97,8 +97,8 @@ const AirticketPlan = props => {
title: "编辑",
key: "CLC_SN",
dataIndex: "CLC_SN",
render: (text, record) => (
<>
render: (text, record) =>
record.CheckStatus <= 2 ? (
<Space>
<a onClick={() => showModal(record)}>编辑</a>
<Popconfirm title="删除" description="请确认是否删除?" onConfirm={() => handleDelete(record.CLC_SN)} okText="是" cancelText="否">
@ -107,8 +107,9 @@ const AirticketPlan = props => {
</Button>
</Popconfirm>
</Space>
</>
),
) : (
record.CheckStatusName
),
},
];
@ -215,18 +216,46 @@ const AirticketPlan = props => {
<Form.Item label="备注" name="FlightMemo">
<Input.TextArea rows={5} />
</Form.Item>
<Form.Item label="已出票" name="TicketIssued">
<Switch checkedChildren="是" unCheckedChildren="否" />
</Form.Item>
<Form.Item
wrapperCol={{
offset: 14,
offset: 10,
span: 16,
}}>
<Space>
<Button type="primary" htmlType="submit">
保存机票信息
1. 保存机票信息
</Button>
<Button type="primary" onClick={() => showModal(airInfo)}>
2. 添加出票信息或费用
</Button>
<Button type="dashed" onClick={() => showModal(airInfo)}>
添加出票信息或费用
<Button
type="primary"
onClick={() => {
ticketIssuedNotifications(airInfo.CLF_SN, airInfo.OPI_SN)
.then(() => {
notification.success({
message: `成功`,
description: "提醒信息已发出!",
placement: "top",
duration: 4,
icon: <LikeTwoTone />,
});
})
.catch(() => {
notification.error({
message: `错误`,
description: "提醒失败",
placement: "top",
duration: 4,
icon: <FrownTwoTone />,
});
});
}}>
3. 通知顾问
</Button>
</Space>
</Form.Item>
@ -250,6 +279,7 @@ const AirticketPlan = props => {
return {
key: item.id,
label: `${item.StartDate} ${item.FlightNo}(${item.FromAirport}${item.FlightStart}-${item.ToAirport}${item.FlightEnd})(${item.FlightCabin})`,
extra: `${item.GRI_No}-${item.WL}`,
children: <Airticket_form airInfo={item} />,
};
})
@ -534,7 +564,7 @@ const AirticketPlan = props => {
<Row>
<Col md={24} lg={24} xxl={24} style={{ height: "100%" }}>
{/* <iframe id="msdoc-iframe-reservation" title="msdoc-iframe-reservation" src={reservationPreviewUrl} style={{ width: "100%", height: "600px" }}></iframe> */}
<iframe id="msdoc-iframe-reservation" title="msdoc-iframe-reservation" src={reservationPreviewUrl} style={{ width: "100%", height: "600px" }}></iframe>
<Button type="link" target="_blank" href={reservationUrl}>
下载
</Button>
@ -557,7 +587,7 @@ const AirticketPlan = props => {
onClick={() => {
showModal_confirmInfo(veiPlanChangeTxt && veiPlanChangeTxt.ChangeText);
}}
disabled={veiPlanChangeTxt && (isEmpty(veiPlanChangeTxt.ChangeText) ? true : false)}>
disabled={isEmpty(veiPlanChangeTxt) || isEmpty(veiPlanChangeTxt.ChangeText)}>
确认变更
</Button>
</Space>

Loading…
Cancel
Save