diff --git a/src/stores/Feedback.js b/src/stores/Feedback.js index a8c2653..505c4a8 100644 --- a/src/stores/Feedback.js +++ b/src/stores/Feedback.js @@ -14,6 +14,7 @@ class Feedback { feedbackImages = []; //图片列表 feedbackRate = []; //反馈评分 feedbackReview = []; //站外好评 + feedbackInfo = []; //地接社反馈的信息 /* 查询地接社的团列表 地接社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) { let url = `/service-fileServer/FeedbackInfo`; @@ -92,18 +111,14 @@ class Feedback { formData.append("GRI_SN", GRI_SN); formData.append("EOI_SN", EOI_SN); formData.append("FeedbackInfo", info_content); - fetch(config.HT_HOST + url, { + return fetch(config.HT_HOST + url, { method: "POST", body: formData, - headers: new Headers({ - "Content-Type": "application/x-www-form-urlencoded", - }), }) .then(response => response.json()) .then(json => { console.log(json); - runInAction(() => { - }); + runInAction(() => {}); }) .catch(error => { console.log("fetch data failed", error); diff --git a/src/views/feedback/Detail.jsx b/src/views/feedback/Detail.jsx index 01870aa..4a60ad1 100644 --- a/src/views/feedback/Detail.jsx +++ b/src/views/feedback/Detail.jsx @@ -1,9 +1,8 @@ import { useParams, useNavigate } from "react-router-dom"; -import { useEffect, useState } from "react"; +import { useEffect } from "react"; import { observer } from "mobx-react"; import { toJS, runInAction } from "mobx"; -import moment from "moment"; -import { Row, Col, Space, Button, Divider, Form, Typography, Rate, Radio, Modal, Upload, Input } from "antd"; +import { Row, Col, Space, Button, Divider, Form, Typography, Rate, Radio, Upload, Input, App } from "antd"; import { useStore } from "../../stores/StoreContext.js"; import { PlusOutlined } from "@ant-design/icons"; const { Title, Text, Paragraph } = Typography; @@ -13,14 +12,18 @@ function Detail() { const navigate = useNavigate(); const { GRI_SN } = useParams(); const { feedbackStore, authStore } = useStore(); - const { feedbackRate, feedbackReview, feedbackImages } = feedbackStore; - const [value, setValue] = useState(3); + const { feedbackRate, feedbackReview, feedbackImages, feedbackInfo } = feedbackStore; const desc = ["none", "Unacceptable", "Poor", "Fair", "Very Good", "Excellent"]; + const { notification } = App.useApp(); + const [form] = Form.useForm(); useEffect(() => { console.info("Detail.useEffect: " + GRI_SN); feedbackStore.getFeedbackDetail(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]); const HWO_Guide = feedbackRate && feedbackRate.HWO_Guide ? feedbackRate.HWO_Guide : 0; @@ -53,6 +56,20 @@ function Detail() { 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 ( @@ -148,7 +165,7 @@ function Detail() { -
+ 上传照片 - 地接社反馈信息 - + -