传递车票图片到后端

perf/2025b
Ycc 3 months ago
parent fc8e42957d
commit d6320d700b

@ -95,6 +95,10 @@ const ImageUploader = props => {
setIsLoading(true);
const images = await getImageList(key);
setFileList(images);
if (props.onChange) {
//
props.onChange(images);
}
setIsLoading(false);
};
@ -107,7 +111,11 @@ const ImageUploader = props => {
const handleDelete = async file => {
const success = await deleteImage(file.encrypt_key);
if (success) {
setFileList(prevList => prevList.filter(item => item.key !== file.key));
const newImages = fileList.filter(item => item.encrypt_key !== file.encrypt_key);
if (props.onChange) {
props.onChange(newImages);
}
setFileList(newImages);
console.log("删除成功");
} else {
console.error("删除失败");
@ -125,6 +133,9 @@ const ImageUploader = props => {
key,
(response, file) => {
getImageList(key).then(newImages => {
if (props.onChange) {
props.onChange(newImages);
}
setFileList(prevList => {
//
const index = prevList.findIndex(item => item.status === "uploading");
@ -136,6 +147,7 @@ const ImageUploader = props => {
//
return [...newPrevList, ...newItems];
}
return prevList;
});
});

@ -172,13 +172,14 @@ const trainTicketStore = create((set, get) => ({
});
},
//通知顾问查看车票信息
async ticketIssuedNotifications(LMI_SN, CLF_SN, OPI_SN, FlightMemo_messages) {
async ticketIssuedNotifications(LMI_SN, CLF_SN, OPI_SN, FlightMemo_messages,ticketImages) {
const searchParams = {
CLF_SN: CLF_SN,
OPI_SN: OPI_SN,
LMI_SN: LMI_SN,
ServiceType: 2,
FlightMemo_messages: FlightMemo_messages,
ticketImages: JSON.stringify(ticketImages),
};
const { errcode, result } = await fetchJSON(`${HT_HOST}/Service_BaseInfoWeb/TicketIssuedNotifications`, searchParams);
const _result = errcode !== 0 ? [] : result;

@ -245,7 +245,9 @@ const TrainticketPlan = props => {
</Form.Item>
</Space>
</Form.Item>
<Form.Item name="ServiceType" hidden initialValue="2"><input type="hidden" /></Form.Item>
<Form.Item name="ServiceType" hidden initialValue="2">
<input type="hidden" />
</Form.Item>
</Col>
<Col md={24} lg={4} xxl={4}>
<Space direction="vertical">
@ -272,15 +274,6 @@ const TrainticketPlan = props => {
</Space>
</Col>
</Row>
<Divider orientation="left">车票图片</Divider>
<Row gutter={16}>
<Col md={24} lg={4} xxl={4}></Col>
<Col md={24} lg={16} xxl={16}>
<ImageUploader osskey={`ghh/${trainInfo.GRI_SN}-${trainInfo.GRI_No}/trainticket/ticketimage/${trainInfo.CLF_SN}`} />
</Col>
<Col md={24} lg={4} xxl={4}></Col>
</Row>
</Form>
<Form
@ -292,7 +285,7 @@ const TrainticketPlan = props => {
}}
initialValues={{ ...trainInfo }}
onFinish={values => {
ticketIssuedNotifications(userId, trainInfo.CLF_SN, trainInfo.OPI_SN, values.FlightMemo_messages)
ticketIssuedNotifications(userId, trainInfo.CLF_SN, trainInfo.OPI_SN, values.FlightMemo_messages,values.ticketImages)
.then(() => {
notification.success({
message: `成功`,
@ -314,6 +307,16 @@ const TrainticketPlan = props => {
});
}}
autoComplete="off">
<Divider orientation="left">车票图片</Divider>
<Row gutter={16}>
<Col md={24} lg={4} xxl={4}></Col>
<Col md={24} lg={16} xxl={16}>
<Form.Item name="ticketImages" valuePropName="fileList" getValueFromEvent={fileList => fileList}>
<ImageUploader osskey={`ghh/${trainInfo.GRI_SN}-${trainInfo.GRI_No}/trainticket/ticketimage/${trainInfo.CLF_SN}`} />
</Form.Item>
</Col>
<Col md={24} lg={4} xxl={4}></Col>
</Row>
<Divider orientation="left">出票完成通知</Divider>
<Row gutter={16}>
<Col md={24} lg={20} xxl={20}>

Loading…
Cancel
Save