|
|
|
@ -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>
|
|
|
|
|