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

release
Jimmy Liow 2 years ago
commit 42e05c62f6

@ -4,27 +4,27 @@ import dayjs from "dayjs";
export const DATE_FORMAT = "YYYY-MM-DD";
export const DATE_PRESETS = [
{
label: "本周",
label: "This Week",
value: [dayjs().startOf("w"), dayjs().endOf("w")],
},
{
label: "上周",
label: "Last Week",
value: [dayjs().startOf("w").subtract(7, "days"), dayjs().endOf("w").subtract(7, "days")],
},
{
label: "本月",
label: "This Month",
value: [dayjs().startOf("M"), dayjs().endOf("M")],
},
{
label: "上个月",
label: "Last Month",
value: [dayjs().subtract(1, "M").startOf("M"), dayjs().subtract(1, "M").endOf("M")],
},
{
label: "近三月",
label: "Last Three Month",
value: [dayjs().subtract(2, "M").startOf("M"), dayjs().endOf("M")],
},
{
label: "今年",
label: "This Year",
value: [dayjs().startOf("y"), dayjs().endOf("y")],
},
// 本月: [dayjs().startOf("month"), moment().endOf("month")],

@ -1,5 +1,5 @@
import { makeAutoObservable, runInAction } from "mobx";
import * as req from "@/utils/request";
import { fetchJSON, postForm } from "@/utils/request";
import { prepareUrl } from "@/utils/commons";
import * as config from "@/config";
import dayjs from "dayjs";
@ -34,18 +34,15 @@ class Feedback {
this.loading = true;
let url = `/service-Cooperate/Cooperate/SearchFeedbackList`;
url += `?PageSize=2000&PageIndex=1&PageTotal=0&veisn=${veisn}&GruopNo=${EOI_Group_Name}&TimeStart=${TimeStart}&TimeEnd=${TimeEnd}`;
fetch(config.HT_HOST + url)
.then(response => response.json())
.then(json => {
console.log(json);
url += `&token=${this.root.authStore.login.token}`;
return fetchJSON(config.HT_HOST + url).then(json => {
runInAction(() => {
this.feedbackList = json.Result;
this.loading = false;
});
})
.catch(error => {
this.loading = false;
console.log("fetch data failed", error);
if (json.errcode !== 0) {
throw new Error(json.errmsg + ": " + json.errcode);
}
});
}
@ -56,6 +53,7 @@ class Feedback {
getFeedbackDetail(VEI_SN, GRI_SN) {
let url = `/service-Cooperate/Cooperate/getFeedbackDetail`;
url += `?GRI_SN=${GRI_SN}&VEI_SN=${VEI_SN}`;
url += `&token=${this.root.authStore.login.token}`;
fetch(config.HT_HOST + url)
.then(response => response.json())
.then(json => {
@ -74,6 +72,7 @@ class Feedback {
getFeedbackImages(VEI_SN, GRI_SN) {
let url = `/service-fileServer/ListFile`;
url += `?GRI_SN=${GRI_SN}&VEI_SN=${VEI_SN}`;
url += `&token=${this.root.authStore.login.token}`;
fetch(config.HT_HOST + url)
.then(response => response.json())
.then(json => {
@ -98,6 +97,7 @@ class Feedback {
getFeedbackInfo(VEI_SN, GRI_SN) {
let url = `/service-Cooperate/Cooperate/getVEIFeedbackInfo`;
url += `?GRI_SN=${GRI_SN}&VEI_SN=${VEI_SN}`;
url += `&token=${this.root.authStore.login.token}`;
return fetch(config.HT_HOST + url)
.then(response => response.json())
.then(json => {
@ -115,6 +115,7 @@ class Feedback {
removeFeedbackImages(fileurl) {
let url = `/service-fileServer/FileDelete`;
url += `?fileurl=${fileurl}`;
url += `&token=${this.root.authStore.login.token}`;
return fetch(config.HT_HOST + url)
.then(response => response.json())
.then(json => {
@ -134,6 +135,7 @@ class Feedback {
formData.append("GRI_SN", GRI_SN);
formData.append("EOI_SN", EOI_SN);
formData.append("FeedbackInfo", info_content);
formData.append("token", this.root.authStore.login.token);
return fetch(config.HT_HOST + url, {
method: "POST",
body: formData,

@ -18,7 +18,7 @@ class Invoice {
invoiceProductList=[];//账单细项
invoiceZDDetail = []; //报账信息
invoiceCurrencyList=[];//币种
invoicePicList = []; //多账单图片列表数组
invoicePicList = [] //多账单图片列表数组
invoiceFormData = {'info_money':0,'info_Currency':'','info_date':''}; //存储form数据
@ -106,13 +106,11 @@ class Invoice {
this.invoiceProductList = json.ProductList;
this.invoiceCurrencyList = json.CurrencyList;
this.invoiceZDDetail = json.ZDDetail;
//循环获取图片列表
this.getInvoicekImages_fromData(json.ZDDetail);
this.getFormData(json.ZDDetail);
}else{
throw new Error(json.errmsg + ': ' + json.errcode);
}
})
return json;
});
}
@ -145,7 +143,7 @@ class Invoice {
//从数据库获取图片列表
getInvoicekImages_fromData(jsonData){
let arrLen = jsonData.length;
const arrPicList = jsonData.map((data,index)=>{
let arrPicList = jsonData.map((data,index)=>{
const GMD_Pic = data.GMD_Pic;
let picList = [];
if (isNotEmpty(GMD_Pic)){
@ -160,12 +158,17 @@ class Invoice {
});
}
if (data.GMD_Dealed == false && arrLen == (index+1)){
this.invoicekImages = picList;
}
return picList;
})
runInAction(()=>{
this.invoicePicList = arrPicList;
});
}
//获取数据库的表单默认数据回填。
@ -173,7 +176,9 @@ class Invoice {
let arrLen = jsonData.length;
return jsonData.map((data,index)=>{
if (data.GMD_Dealed == false && arrLen == (index+1)){ //只有最后一条账单未审核通过才显示
runInAction(() => {
this.invoiceFormData = {'info_money':data.GMD_Cost,'info_Currency':data.GMD_Currency,'info_date':isNotEmpty(data.GMD_PayDate)?dayjs(data.GMD_PayDate):''};
});
}
});
}
@ -212,6 +217,24 @@ class Invoice {
});
}
postAddInvoice(GRI_SN,Currency,Cost,PayDate,Pic,Memo){
let postUrl = HT_HOST + '/service-cusservice/AddSupplierFK';
let formData = new FormData();
formData.append('LMI_SN', this.root.authStore.login.userId);
formData.append('VEI_SN', this.root.authStore.login.travelAgencyId);
formData.append('GRI_SN', GRI_SN);
formData.append('Currency', Currency);
formData.append('Cost', Cost);
formData.append('PayDate', isNotEmpty(PayDate)?PayDate:'' );
formData.append('Pic', Pic);
formData.append('Memo', Memo);
return postForm(postUrl,formData)
.then(json=>{
console.info(json);
return json;
});
}
invoicePage = {
current:1,

@ -17,6 +17,7 @@ class Notice {
getBulletinList(LMI_SN) {
let url = `/service-Cooperate/Cooperate/GetBulletinList`;
url += `?LMI_SN=${LMI_SN}`;
url+=`&token=${this.root.authStore.login.token}`;
fetch(config.HT_HOST + url)
.then(response => response.json())
.then(json => {
@ -37,6 +38,7 @@ class Notice {
getNoticeDetail(LMI_SN, CCP_BLID) {
let url = `/service-Cooperate/Cooperate/GetBulletinDetail`;
url += `?LMI_SN=${LMI_SN}&CCP_BLID=${CCP_BLID}`;
url+=`&token=${this.root.authStore.login.token}`;
fetch(config.HT_HOST + url)
.then(response => response.json())
.then(json => {
@ -54,6 +56,7 @@ class Notice {
getBulletinUnReadCount(LMI_SN) {
let url = `/service-Cooperate/Cooperate/GetBulletinUnReadCount`;
url += `?LMI_SN=${LMI_SN}`;
url+=`&token=${this.root.authStore.login.token}`;
fetch(config.HT_HOST + url)
.then(response => response.json())
.then(json => {

@ -60,7 +60,7 @@ function Detail() {
feedbackStore.postFeedbackInfo(feedbackInfo.EEF_VEI_SN, feedbackInfo.EEF_GRI_SN, feedbackInfo.EEF_EOI_SN, values.info_content).then(() => {
notification.success({
message: `Notification`,
description: "提交成功",
description: "Submit Successful",
placement: "top",
duration: 4,
});
@ -141,7 +141,7 @@ function Detail() {
<Row gutter={16}>
<Col span={20}>
<Title level={4}>站外好评</Title>
<Title level={4}>External Reviews</Title>
</Col>
<Col span={4}></Col>
</Row>
@ -155,7 +155,7 @@ function Detail() {
<Row gutter={16}>
<Col span={20}>
<Title level={4}>地接社的反馈</Title>
<Title level={4}>Send Feedback</Title>
</Col>
<Col span={4}></Col>
</Row>
@ -164,7 +164,7 @@ function Detail() {
<Col span={4}></Col>
<Col span={18}>
<Form name="feedback_detail_from" onFinish={onFinish} labelCol={{ span: 5 }} form={form}>
<Divider orientation="left">上传照片</Divider>
<Divider orientation="left">Upload photos</Divider>
<Form.Item>
<Upload
name="ghhfile"
@ -181,7 +181,6 @@ function Detail() {
</div>
</Upload>
</Form.Item>
<Divider orientation="left">地接社反馈信息</Divider>
<Form.Item
name="info_content"
rules={[
@ -190,7 +189,7 @@ function Detail() {
message: "Please input your messages!",
},
]}>
<Input.TextArea rows={6}></Input.TextArea>
<Input.TextArea rows={6} placeholder="Any feedback for this group you would like to send to Asia Highlights"></Input.TextArea>
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit">

@ -2,81 +2,94 @@ import { NavLink } from "react-router-dom";
import { useEffect, useState } from "react";
import { observer } from "mobx-react";
import { toJS } from "mobx";
import { Row, Col, Space, Button, Table, Input, Typography, DatePicker, Radio } from "antd";
import { Row, Col, Space, Button, Table, Input, Typography, DatePicker, App } from "antd";
import { useStore } from "@/stores/StoreContext.js";
import * as config from "@/config";
const { Title } = Typography;
const feedbackListColumns = [
{
title: "团名",
title: "Ref.No",
dataIndex: "EOI_Group_Name",
render: (text, record) => <NavLink to={`/feedback/${record.EOI_GRI_SN}`}>{text}</NavLink>,
},
{
title: "离团日期",
title: "Arrival Date",
dataIndex: "EOI_Date",
render: (text, record) => text,
sorter: (a, b) => b.EOI_Date - a.EOI_Date,
},
{
title: "城市",
title: "Cities",
key: "City",
dataIndex: "City",
},
{
title: "评分",
dataIndex: "Average",
sorter: (a, b) => b.Average - a.Average,
title: "Guides",
dataIndex: "GriName",
},
{
title: "图片数",
dataIndex: "PicNum",
sorter: (a, b) => b.PicNum - a.PicNum,
title: "Post Survey",
dataIndex: "Average",
sorter: (a, b) => b.Average - a.Average,
},
{
title: "导游",
title: "External Reviews",
dataIndex: "GriName",
},
{
title: "表状态",
dataIndex: "FState",
sorter: (a, b) => b.FState - a.FState,
},
];
function Index() {
const { notification } = App.useApp();
const { feedbackStore, authStore } = useStore();
const { feedbackList, search_date_start, search_date_end } = feedbackStore;
const [referenceNo, onNumberChange] = useState("");
const showTotal = total => `Total ${feedbackList.length} items`;
useEffect(() => {
feedbackStore.searchFeedbackList(authStore.login.travelAgencyId, referenceNo, search_date_start.format(config.DATE_FORMAT), search_date_end.format(config.DATE_FORMAT) + " 23:59");
feedbackStore.searchFeedbackList(authStore.login.travelAgencyId, referenceNo, search_date_start.format(config.DATE_FORMAT), search_date_end.format(config.DATE_FORMAT) + " 23:59")
.catch(ex => {
notification.error({
message: `Error`,
description: ex.message,
placement: 'top',
duration: 4,
});
});
}, []);
return (
<Space direction="vertical" style={{ width: "100%" }}>
<Title level={3}>反馈表</Title>
<Title level={3}></Title>
<Row gutter={16}>
<Col md={24} lg={6} xxl={4}>
<Input
placeholder="团号"
placeholder="Reference Number"
onChange={e => {
onNumberChange(e.target.value);
}}
/>
</Col>
<Col md={24} lg={6} xxl={4}>
<DatePicker.RangePicker format={config.DATE_FORMAT} allowClear={false} style={{ width: "100%" }} value={[search_date_start, search_date_end]} presets={config.DATE_PRESETS} onChange={feedbackStore.onDateRangeChange} />
<Col md={24} lg={8} xxl={6}>
<Space direction="horizontal">
Arrival Date
<DatePicker.RangePicker
format={config.DATE_FORMAT}
allowClear={false}
style={{ width: "100%" }}
value={[search_date_start, search_date_end]}
presets={config.DATE_PRESETS}
onChange={feedbackStore.onDateRangeChange}
/>
</Space>
</Col>
<Col md={24} lg={4} xxl={4}>
<Button
type="primary"
loading={feedbackStore.loading}
onClick={() => feedbackStore.searchFeedbackList(authStore.login.travelAgencyId, referenceNo, search_date_start.format(config.DATE_FORMAT), search_date_end.format(config.DATE_FORMAT) + " 23:59")}>
搜索
Search
</Button>
</Col>
</Row>

@ -1,5 +1,5 @@
import { useParams, useNavigate } from "react-router-dom";
import { useEffect, useState } from "react";
import { useEffect, useState ,useRef } from "react";
import { observer } from "mobx-react";
import { toJS, runInAction } from "mobx";
import { Row, Col, Space, Button, Typography, Card, Form, Upload, Input, Divider, DatePicker, Select, App, Modal } from "antd";
@ -16,7 +16,7 @@ function Detail() {
const navigate = useNavigate();
const { GMDSN, GSN } = useParams();
const { invoiceStore, authStore } = useStore();
const { invoicekImages, invoiceGroupInfo, invoiceProductList, invoiceCurrencyList, invoiceZDDetail, invoicePicList } = invoiceStore;
const { invoicekImages, invoiceGroupInfo, invoiceProductList, invoiceCurrencyList, invoiceZDDetail } = invoiceStore;
const [form] = Form.useForm();
const [dataLoading, setDataLoading] = useState(false);
const { formCurrency, onCurrencyChange } = useState();
@ -25,13 +25,51 @@ function Detail() {
const [isModalOpen, setIsModalOpen] = useState(false);
const [confirmLoading, setConfirmLoading] = useState(false);
const [invoicePicList,setInvoicePicList] = useState([]);
useEffect(() => {
console.info("Detail.useEffect: " + GMDSN + "/" + GSN);
setDataLoading(true);
invoiceStore.fetchInvoiceDetail(GMDSN, GSN)
.then(() => {
form.setFieldsValue(invoiceStore.invoiceFormData); //{'info_money':'111','info_Currency':'THB','info_date':''}
.then((json) => {
let ZDDetail = json.ZDDetail;
let arrLen = ZDDetail.length;
const formData = ZDDetail.map((data,index)=>{
if (data.GMD_Dealed == false && arrLen == (index+1)){ //
runInAction(() => {
invoiceStore.invoiceFormData = {'info_money':data.GMD_Cost,'info_Currency':data.GMD_Currency,'info_date':isNotEmpty(data.GMD_PayDate)?dayjs(data.GMD_PayDate):'','info_gmdsn':data.GMD_SN};
});
return {'info_money':data.GMD_Cost,'info_Currency':data.GMD_Currency,'info_date':isNotEmpty(data.GMD_PayDate)?dayjs(data.GMD_PayDate):'','info_gmdsn':data.GMD_SN};
}
});
form.setFieldsValue(formData[arrLen-1]); //{'info_money':'111','info_Currency':'THB','info_date':''}
//
let arrPicList = ZDDetail.map((data,index)=>{
const GMD_Pic = data.GMD_Pic;
let picList = [];
if (isNotEmpty(GMD_Pic)){
let js_Pic = JSON.parse(GMD_Pic)
picList = js_Pic.map((picData,pic_Index)=>{
return {
uid: -pic_Index, //
name: '',
status: "done",
url: picData.url,
}
});
}
if (data.GMD_Dealed == false && arrLen == (index+1)){
runInAction(() => {
invoiceStore.invoicekImages = picList;
});
}
return picList;
})
setInvoicePicList(arrPicList);
})
.catch(ex => {
notification.error({
@ -45,6 +83,10 @@ function Detail() {
setDataLoading(false);
});
// if (invoiceStore.invoiceFormData){
// form.setFieldsValue(invoiceStore.invoiceFormData);
// }
}, [GMDSN, GSN]);
const fileList = toJS(invoicekImages);
@ -66,17 +108,57 @@ function Detail() {
console.log("Success:", fieldVaule);
//
if (fieldVaule) {
invoiceStore.postEditInvoiceDetail(GMDSN, fieldVaule.info_Currency, fieldVaule.info_money, fieldVaule.info_date, fieldVaule.info_images, "").then((data) => {
invoiceStore.postEditInvoiceDetail(fieldVaule.info_gmdsn, fieldVaule.info_Currency, fieldVaule.info_money, fieldVaule.info_date, fieldVaule.info_images, "").then((data) => {
console.log(data);
runInAction(() => {
let param = { 'info_money': fieldVaule.info_money, 'info_Currency': fieldVaule.info_Currency, 'info_date': fieldVaule.info_date };
invoiceStore.invoiceFormData = param;
})
if (data.errcode == 0 ){
notification.success({
message: `Notification`,
description: "Success Submit!",
placement: "top",
duration: 4,
});
}
});
}
};
const onAddFinish = values => {
const fieldVaule = {
...values,
'info_date': isNotEmpty(values['info_date']) ? values['info_date'].format('YYYY-MM-DD') : null,
'info_images': JSON.stringify(arrimg),
}
console.log("Success:", fieldVaule);
//
if (fieldVaule) {
invoiceStore.postAddInvoice(GSN, fieldVaule.info_Currency, fieldVaule.info_money, fieldVaule.info_date, fieldVaule.info_images, "").then((data) => {
console.log("return:",data);
runInAction(() => {
let param = { 'info_money': fieldVaule.info_money, 'info_Currency': fieldVaule.info_Currency, 'info_date': fieldVaule.info_date };
invoiceStore.invoiceFormData = param;
})
if (data.errcode == 0 ){
// notification.success({
// message: `Notification`,
// description: "Success Submit!",
// placement: "top",
// duration: 4,
// });
setIsModalOpen(false);
}
});
}
};
const handleChange = info => {
console.log(info);
let newFileList = [...info.fileList];
@ -140,7 +222,7 @@ function Detail() {
accept="image/*"
multiple={true}
action={config.HT_HOST + `/service-fileServer/FileUpload?GRI_SN=${GSN}&VEI_SN=${authStore.login.travelAgencyId}&FilePathName=invoice`}
fileList={invoiceStore.invoicePicList[index]}
fileList={invoicePicList[index]}
listType="picture-card"
>
<div>
@ -186,7 +268,7 @@ function Detail() {
name="ghhfile"
accept="image/*"
multiple={true}
action={config.HT_HOST + `/service-fileServer/FileUpload?GRI_SN=${GSN}&VEI_SN=${authStore.login.travelAgencyId}&FilePathName=invoice`}
action={config.HT_HOST + `/service-fileServer/FileUpload?GRI_SN=${GSN}&VEI_SN=${authStore.login.travelAgencyId}&FilePathName=invoice&token=${authStore.login.token}`}
fileList={fileList}
listType="picture-card"
onChange={handleChange}
@ -239,6 +321,12 @@ function Detail() {
</Form.Item></Col>
</Row>
<Form.Item
name="info_gmdsn"
hidden={true}
>
<input />
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit">
Submit
@ -252,9 +340,6 @@ function Detail() {
}
})
// console.info(invoiceStore.invoiceFormData)
return submitForm;
}
@ -262,17 +347,20 @@ function Detail() {
//#region Modal
const showConfirmModal = (confirm) => {
setIsModalOpen(true);
// setConfirmText(confirm.PCI_ConfirmText);
//reservationStore.editConfirmation(confirm);
};
const fromRef = useRef()
const handleOk = () => {
setConfirmLoading(true);
// reservationStore.submitConfirmation(confirmText)
// .finally(() => {
try{
fromRef.current?.submit();
//onAddFinish;
//setIsModalOpen(false);
// setConfirmLoading(false);
// });
} finally{
setConfirmLoading(false);
navigate("/invoice/detail/"+GMDSN+"/"+GSN)
}
};
const handleCancel = () => {
setIsModalOpen(false);
@ -291,7 +379,7 @@ function Detail() {
width={1000}
>
<Title level={4}>Add New Invoice</Title>
<Form name="invoice_submit" onFinish={onFinish} labelCol={{ span: 5 }} form={form}>
<Form name="invoice_add" onFinish={onAddFinish} labelCol={{ span: 5 }} form={form} ref={fromRef}>
<Divider orientation="left">上传照片</Divider>
<Form.Item
labelCol={{
@ -305,7 +393,7 @@ function Detail() {
name="ghhfile"
accept="image/*"
multiple={true}
action={config.HT_HOST + `/service-fileServer/FileUpload?GRI_SN=${GSN}&VEI_SN=${authStore.login.travelAgencyId}&FilePathName=invoice`}
action={config.HT_HOST + `/service-fileServer/FileUpload?GRI_SN=${GSN}&VEI_SN=${authStore.login.travelAgencyId}&FilePathName=invoice&token=${authStore.login.token}`}
fileList={fileList}
listType="picture-card"
onChange={handleChange}
@ -318,7 +406,6 @@ function Detail() {
</Form.Item>
<Divider orientation="left">提交信息</Divider>
<Form.Item
name="info_money"
label="报账总额:"

@ -191,10 +191,10 @@ function Newest() {
</Space>
</Modal>
<Space direction="vertical" style={{ width: '100%' }}>
<Title level={3}>Newest Reservations</Title>
<Title level={3}></Title>
<Row gutter={{ md: 24 }}>
<Col span={6}>
<Input placeholder="Reference number" value={referenceNo} onChange={(e) => { reservationStore.updatePropertyValue('referenceNo', e.target.value)} } />
<Input placeholder="Reference Number" value={referenceNo} onChange={(e) => { reservationStore.updatePropertyValue('referenceNo', e.target.value)} } />
</Col>
<Col span={18}>
<Space direction="horizontal">

Loading…
Cancel
Save