Merge branch 'main' of github.com:hainatravel/GHHub

release
Jimmy Liow 2 years ago
commit 4182133790

@ -14,6 +14,7 @@ class Feedback {
feedbackImages = []; //图片列表 feedbackImages = []; //图片列表
feedbackRate = []; //反馈评分 feedbackRate = []; //反馈评分
feedbackReview = []; //站外好评 feedbackReview = []; //站外好评
feedbackInfo = []; //地接社反馈的信息
/* /*
地接社sn 地接社sn
@ -84,6 +85,24 @@ class Feedback {
}); });
} }
//获取供应商反馈信息
getFeedbackInfo(VEI_SN, GRI_SN) {
let url = `/service-Cooperate/Cooperate/getVEIFeedbackInfo`;
url += `?GRI_SN=${GRI_SN}&VEI_SN=${VEI_SN}`;
return fetch(config.HT_HOST + url)
.then(response => response.json())
.then(json => {
console.log(json);
runInAction(() => {
this.feedbackInfo = json.Result;
});
return json.Result;
})
.catch(error => {
console.log("fetch data failed", error);
});
}
//提交供应商反馈信息 //提交供应商反馈信息
postFeedbackInfo(VEI_SN, GRI_SN, EOI_SN, info_content) { postFeedbackInfo(VEI_SN, GRI_SN, EOI_SN, info_content) {
let url = `/service-fileServer/FeedbackInfo`; let url = `/service-fileServer/FeedbackInfo`;
@ -92,18 +111,14 @@ class Feedback {
formData.append("GRI_SN", GRI_SN); formData.append("GRI_SN", GRI_SN);
formData.append("EOI_SN", EOI_SN); formData.append("EOI_SN", EOI_SN);
formData.append("FeedbackInfo", info_content); formData.append("FeedbackInfo", info_content);
fetch(config.HT_HOST + url, { return fetch(config.HT_HOST + url, {
method: "POST", method: "POST",
body: formData, body: formData,
headers: new Headers({
"Content-Type": "application/x-www-form-urlencoded",
}),
}) })
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {
console.log(json); console.log(json);
runInAction(() => { runInAction(() => {});
});
}) })
.catch(error => { .catch(error => {
console.log("fetch data failed", error); console.log("fetch data failed", error);

@ -1,9 +1,8 @@
import { useParams, useNavigate } from "react-router-dom"; import { useParams, useNavigate } from "react-router-dom";
import { useEffect, useState } from "react"; import { useEffect } from "react";
import { observer } from "mobx-react"; import { observer } from "mobx-react";
import { toJS, runInAction } from "mobx"; import { toJS, runInAction } from "mobx";
import moment from "moment"; import { Row, Col, Space, Button, Divider, Form, Typography, Rate, Radio, Upload, Input, App } from "antd";
import { Row, Col, Space, Button, Divider, Form, Typography, Rate, Radio, Modal, Upload, Input } from "antd";
import { useStore } from "../../stores/StoreContext.js"; import { useStore } from "../../stores/StoreContext.js";
import { PlusOutlined } from "@ant-design/icons"; import { PlusOutlined } from "@ant-design/icons";
const { Title, Text, Paragraph } = Typography; const { Title, Text, Paragraph } = Typography;
@ -13,14 +12,18 @@ function Detail() {
const navigate = useNavigate(); const navigate = useNavigate();
const { GRI_SN } = useParams(); const { GRI_SN } = useParams();
const { feedbackStore, authStore } = useStore(); const { feedbackStore, authStore } = useStore();
const { feedbackRate, feedbackReview, feedbackImages } = feedbackStore; const { feedbackRate, feedbackReview, feedbackImages, feedbackInfo } = feedbackStore;
const [value, setValue] = useState(3);
const desc = ["none", "Unacceptable", "Poor", "Fair", "Very Good", "Excellent"]; const desc = ["none", "Unacceptable", "Poor", "Fair", "Very Good", "Excellent"];
const { notification } = App.useApp();
const [form] = Form.useForm();
useEffect(() => { useEffect(() => {
console.info("Detail.useEffect: " + GRI_SN); console.info("Detail.useEffect: " + GRI_SN);
feedbackStore.getFeedbackDetail(authStore.login.travelAgencyId, GRI_SN); feedbackStore.getFeedbackDetail(authStore.login.travelAgencyId, GRI_SN);
feedbackStore.getFeedbackImages(authStore.login.travelAgencyId, GRI_SN); feedbackStore.getFeedbackImages(authStore.login.travelAgencyId, GRI_SN);
feedbackStore.getFeedbackInfo(authStore.login.travelAgencyId, GRI_SN).then(v => {
form.setFieldsValue({ info_content: v.EEF_Content });
});
}, [GRI_SN]); }, [GRI_SN]);
const HWO_Guide = feedbackRate && feedbackRate.HWO_Guide ? feedbackRate.HWO_Guide : 0; const HWO_Guide = feedbackRate && feedbackRate.HWO_Guide ? feedbackRate.HWO_Guide : 0;
@ -53,6 +56,20 @@ function Detail() {
return true; return true;
}; };
const onFinish = values => {
console.log("Success:", values);
if (values) {
feedbackStore.postFeedbackInfo(feedbackInfo.EEF_VEI_SN, feedbackInfo.EEF_GRI_SN, feedbackInfo.EEF_EOI_SN, values.info_content).then(() => {
notification.success({
message: `Notification`,
description: "提交成功",
placement: "top",
duration: 4,
});
});
}
};
return ( return (
<Space direction="vertical" style={{ width: "100%" }}> <Space direction="vertical" style={{ width: "100%" }}>
<Row gutter={16}> <Row gutter={16}>
@ -148,7 +165,7 @@ function Detail() {
<Row gutter={16}> <Row gutter={16}>
<Col span={4}></Col> <Col span={4}></Col>
<Col span={18}> <Col span={18}>
<Form name="feedback_detail_from" labelCol={{ span: 5 }}> <Form name="feedback_detail_from" onFinish={onFinish} labelCol={{ span: 5 }} form={form}>
<Divider orientation="left">上传照片</Divider> <Divider orientation="left">上传照片</Divider>
<Form.Item> <Form.Item>
<Upload <Upload
@ -166,19 +183,19 @@ function Detail() {
</div> </div>
</Upload> </Upload>
</Form.Item> </Form.Item>
<Divider orientation="left">地接社反馈信息</Divider> <Divider orientation="left">地接社反馈信息</Divider>
<Form.Item <Form.Item
name="info_content"
rules={[ rules={[
{ {
required: true, required: true,
message: 'Please input your messages!', message: "Please input your messages!",
}, },
]}> ]}>
<Input.TextArea name="info_content" rows={6}></Input.TextArea> <Input.TextArea rows={6}></Input.TextArea>
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>
<Button type="primary" onClick={() =>feedbackStore.postFeedbackInfo()}> <Button type="primary" htmlType="submit">
Submit Submit
</Button> </Button>
</Form.Item> </Form.Item>

Loading…
Cancel
Save