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

release
赵鹏 2 years ago
commit f792b1075a

@ -11,6 +11,7 @@ class Feedback {
loading = false;
feedbackList = []; //反馈列表
feedbackImages = []; //图片列表
feedbackRate = []; //反馈评分
feedbackReview = []; //站外好评
@ -50,8 +51,58 @@ class Feedback {
.then(json => {
console.log(json);
runInAction(() => {
this.feedbackRate = json.Result[0];
this.feedbackReview = json.Result1[0];
this.feedbackRate = json.Result;
this.feedbackReview = json.Result1;
});
})
.catch(error => {
console.log("fetch data failed", error);
});
}
//获取供应商提交的图片
getFeedbackImages(VEI_SN, GRI_SN) {
let url = `/service-fileServer/ListFile`;
url += `?GRI_SN=${GRI_SN}&VEI_SN=${VEI_SN}`;
fetch(config.HT_HOST + url)
.then(response => response.json())
.then(json => {
console.log(json);
runInAction(() => {
this.feedbackImages = json.result.map((data, index) => {
return {
uid: -index, //用负数,防止添加删除的时候错误
name: data.file_name,
status: "done",
url: data.file_url,
};
});
});
})
.catch(error => {
console.log("fetch data failed", error);
});
}
//提交供应商反馈信息
postFeedbackInfo(VEI_SN, GRI_SN, EOI_SN, info_content) {
let url = `/service-fileServer/FeedbackInfo`;
let formData = new FormData();
formData.append("VEI_SN", VEI_SN);
formData.append("GRI_SN", GRI_SN);
formData.append("EOI_SN", EOI_SN);
formData.append("FeedbackInfo", info_content);
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(() => {
});
})
.catch(error => {

@ -99,6 +99,8 @@ class Reservation {
cityName: data.CityName,
tourGuideId: data.TGI_SN,
tourGuide: data.GuideName,
reservationId: reservationId,
travelAgencyId: this.root.authStore.login.travelAgencyId,
}
});
} else {
@ -108,6 +110,22 @@ class Reservation {
});
}
setupCityGuide() {
let formData = new FormData();
formData.append('GRI_SN', 1);
formData.append('VEI_SN', 1);
formData.append('TGI_SN', 1);
formData.append('CII_SN', 1);
formData.append('GetDate', '2023-06-01');
formData.append('LMI_SN', 1);
const postUrl = HT_HOST + '/service-cusservice/PTAddGuide';
return req.postForm(postUrl, formData)
.then(json => {
console.info(json);
});
}
fetchGuideList() {
const fetchUrl = prepareUrl(HT_HOST + '/service-cusservice/PTGetGuideList')
.append('VEI_SN', 628)//this.root.authStore.login.travelAgencyId)
@ -119,6 +137,7 @@ class Reservation {
if (json.errcode == 0) {
this.guideList = json.Result.map((data, index) => {
return {
guideId: data.TGI_SN,
guideName: data.TGI2_Name,
mobileNo: data.TGI_Mobile
}

@ -1,7 +1,7 @@
import { useParams, useNavigate } from "react-router-dom";
import { useEffect, useState } from "react";
import { observer } from "mobx-react";
import { toJS } from "mobx";
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 { useStore } from "../../stores/StoreContext.js";
@ -13,13 +13,14 @@ function Detail() {
const navigate = useNavigate();
const { GRI_SN } = useParams();
const { feedbackStore, authStore } = useStore();
const { feedbackRate, feedbackReview } = feedbackStore;
const { feedbackRate, feedbackReview, feedbackImages } = feedbackStore;
const [value, setValue] = useState(3);
const desc = ["none", "Unacceptable", "Poor", "Fair", "Very Good", "Excellent"];
useEffect(() => {
console.info("Detail.useEffect: " + GRI_SN);
feedbackStore.getFeedbackDetail(authStore.login.travelAgencyId, GRI_SN);
feedbackStore.getFeedbackImages(authStore.login.travelAgencyId, GRI_SN);
}, [GRI_SN]);
const HWO_Guide = feedbackRate && feedbackRate.HWO_Guide ? feedbackRate.HWO_Guide : 0;
@ -30,49 +31,25 @@ 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 [fileList, setFileList] = useState([
{
uid: "-1",
name: "image.png",
status: "done",
url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png",
},
{
uid: "-2",
name: "image.png",
status: "done",
url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png",
},
{
uid: "-3",
name: "image.png",
status: "done",
url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png",
},
{
uid: "-4",
name: "image.png",
status: "done",
url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png",
},
]);
const fileList = toJS(feedbackImages);
const handleChange = info => {
console.log(info);
// ({ fileList: newFileList }) => setFileList(newFileList)
let newFileList = [...info.fileList];
newFileList = newFileList.map(file => {
if (file.response) {
file.url = file.response;
if (file.response && file.response.result) {
file.url = file.response.result.file_url;
}
return file;
});
setFileList(newFileList);
runInAction(() => {
feedbackStore.feedbackImages = newFileList;
});
};
const handRemove = info => {
console.log(info);
feedbackStore.removeFeedbackImages(info.url);
return true;
};
@ -171,7 +148,7 @@ function Detail() {
<Row gutter={16}>
<Col span={4}></Col>
<Col span={18}>
<Form labelCol={{ span: 5 }}>
<Form name="feedback_detail_from" labelCol={{ span: 5 }}>
<Divider orientation="left">上传照片</Divider>
<Form.Item>
<Upload
@ -191,11 +168,17 @@ function Detail() {
</Form.Item>
<Divider orientation="left">地接社反馈信息</Divider>
<Form.Item>
<Input.TextArea rows={6}></Input.TextArea>
<Form.Item
rules={[
{
required: true,
message: 'Please input your messages!',
},
]}>
<Input.TextArea name="info_content" rows={6}></Input.TextArea>
</Form.Item>
<Form.Item>
<Button type="primary" onClick={() => console.info("submit")}>
<Button type="primary" onClick={() =>feedbackStore.postFeedbackInfo()}>
Submit
</Button>
</Form.Item>

@ -68,10 +68,14 @@ function Newest() {
width: 280,
}}
bordered={false}
allowClear
placeholder="Select a guide"
optionFilterProp="children"
onChange={(value) => {
console.log(`selected ${value}`);
console.log(`selected:`);
console.log(value);
console.log(`city:`);
console.log(city);
}}
onSearch={(value) => {
console.log('search:', value);
@ -93,7 +97,7 @@ function Newest() {
const guideSelectOptions = guideList.map((data, index) => {
return {
value: data.guideName,
value: data.guideId,
label: data.guideName
}
});

Loading…
Cancel
Save