From 8184bffd926a883cd623f1542fe16095ec542f69 Mon Sep 17 00:00:00 2001 From: YCC Date: Mon, 8 May 2023 16:32:41 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E5=8F=8D?= =?UTF-8?q?=E9=A6=88=E5=86=85=E5=AE=B9=E7=9A=84=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/Feedback.js | 27 +++++++++++++++++++++------ src/views/feedback/Detail.jsx | 34 +++++++++++++++++++++++++++------- 2 files changed, 48 insertions(+), 13 deletions(-) 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..1643c90 100644 --- a/src/views/feedback/Detail.jsx +++ b/src/views/feedback/Detail.jsx @@ -3,7 +3,7 @@ import { useEffect, useState } 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, Modal, Upload, Input, App } from "antd"; import { useStore } from "../../stores/StoreContext.js"; import { PlusOutlined } from "@ant-design/icons"; const { Title, Text, Paragraph } = Typography; @@ -13,14 +13,19 @@ function Detail() { const navigate = useNavigate(); const { GRI_SN } = useParams(); 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 { 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: vvvv.EEF_Content }); + }); }, [GRI_SN]); const HWO_Guide = feedbackRate && feedbackRate.HWO_Guide ? feedbackRate.HWO_Guide : 0; @@ -31,6 +36,7 @@ function Detail() { const OtherThoughts = feedbackRate && feedbackRate.OtherThoughts ? feedbackRate.OtherThoughts : ""; const PhotoPermission = feedbackRate && feedbackRate.PhotoPermission && feedbackRate.PhotoPermission == "YES" ? true : false; const ECI_Content = feedbackReview && feedbackReview.ECI_Content ? feedbackReview.ECI_Content : "None"; + const feedbackInfo_content = feedbackInfo && feedbackInfo.EEF_Content ? feedbackInfo.EEF_Content : ""; const fileList = toJS(feedbackImages); const handleChange = info => { @@ -53,6 +59,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 +168,7 @@ function Detail() { -
+ 上传照片 - 地接社反馈信息 - + - From 92be4b6ab1bafd440535c04ab497148e47026188 Mon Sep 17 00:00:00 2001 From: YCC Date: Mon, 8 May 2023 16:34:09 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/feedback/Detail.jsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/views/feedback/Detail.jsx b/src/views/feedback/Detail.jsx index 1643c90..1ddd7a8 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, App } 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; @@ -14,7 +13,6 @@ function Detail() { const { GRI_SN } = useParams(); const { feedbackStore, authStore } = useStore(); const { feedbackRate, feedbackReview, feedbackImages, feedbackInfo } = feedbackStore; - const [value, setValue] = useState(3); const desc = ["none", "Unacceptable", "Poor", "Fair", "Very Good", "Excellent"]; const { notification } = App.useApp(); const [form] = Form.useForm(); @@ -36,7 +34,6 @@ function Detail() { const OtherThoughts = feedbackRate && feedbackRate.OtherThoughts ? feedbackRate.OtherThoughts : ""; const PhotoPermission = feedbackRate && feedbackRate.PhotoPermission && feedbackRate.PhotoPermission == "YES" ? true : false; const ECI_Content = feedbackReview && feedbackReview.ECI_Content ? feedbackReview.ECI_Content : "None"; - const feedbackInfo_content = feedbackInfo && feedbackInfo.EEF_Content ? feedbackInfo.EEF_Content : ""; const fileList = toJS(feedbackImages); const handleChange = info => { From c6c1f43d0284381bf7e1a7486e125a940216659b Mon Sep 17 00:00:00 2001 From: YCC Date: Mon, 8 May 2023 16:34:54 +0800 Subject: [PATCH 3/3] --- src/views/feedback/Detail.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/feedback/Detail.jsx b/src/views/feedback/Detail.jsx index 1ddd7a8..4a60ad1 100644 --- a/src/views/feedback/Detail.jsx +++ b/src/views/feedback/Detail.jsx @@ -22,7 +22,7 @@ function Detail() { 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: vvvv.EEF_Content }); + form.setFieldsValue({ info_content: v.EEF_Content }); }); }, [GRI_SN]);