From f2463a049f5a1d114ebde6318aab9409362635af Mon Sep 17 00:00:00 2001 From: YCC Date: Wed, 31 May 2023 14:17:34 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9D=82=E9=A1=B9?= =?UTF-8?q?=E8=B4=A6=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config.js | 2 +- src/views/feedback/Detail.jsx | 2 +- src/views/feedback/Index.jsx | 4 ++-- src/views/invoice/Detail.jsx | 7 +------ src/views/invoice/Index.jsx | 10 ++++++++-- src/views/reservation/Newest.jsx | 4 +++- 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/config.js b/src/config.js index 8c7446c..0224ebf 100644 --- a/src/config.js +++ b/src/config.js @@ -1,6 +1,7 @@ import React from "react"; import dayjs from "dayjs"; +export const HT_HOST = process.env.NODE_ENV == "production" ? "https://p9axztuwd7x8a7.mycht.cn" : "http://202.103.68.100:890"; export const DATE_FORMAT = "YYYY-MM-DD"; export const DATE_PRESETS = [ { @@ -35,4 +36,3 @@ export const DATE_PRESETS = [ // 今年: [dayjs().startOf("year"), moment().endOf("year")], // 去年: [dayjs().subtract(1, "year").startOf("year"), moment().subtract(1, "year").endOf("year")], ]; -export const HT_HOST = process.env.NODE_ENV == "production" ? "https://p9axztuwd7x8a7.mycht.cn" : "http://202.103.68.100:890"; diff --git a/src/views/feedback/Detail.jsx b/src/views/feedback/Detail.jsx index 368cbf3..6fe5070 100644 --- a/src/views/feedback/Detail.jsx +++ b/src/views/feedback/Detail.jsx @@ -168,7 +168,7 @@ function Detail() { - + - + ); diff --git a/src/views/invoice/Detail.jsx b/src/views/invoice/Detail.jsx index e13fac9..b07ab0d 100644 --- a/src/views/invoice/Detail.jsx +++ b/src/views/invoice/Detail.jsx @@ -192,7 +192,7 @@ function Detail() { -

- Our Finance Dept makes payment during the last week in each month. So due date can only the last day of each month. If there's urgent payment, please contact the travel advisor and send invoice - separately. -

diff --git a/src/views/invoice/Index.jsx b/src/views/invoice/Index.jsx index b4e14f6..00e0238 100644 --- a/src/views/invoice/Index.jsx +++ b/src/views/invoice/Index.jsx @@ -1,4 +1,4 @@ -import { NavLink } from "react-router-dom"; +import { NavLink, useNavigate } from "react-router-dom"; import { useEffect, useState } from "react"; import { observer } from "mobx-react"; import { toJS } from "mobx"; @@ -14,6 +14,7 @@ function Index() { const { authStore, invoiceStore } = useStore(); const { invoiceList, search_date_start, search_date_end } = invoiceStore; const [groupNo, onGroupNoChange] = useState(""); + const navigate = useNavigate(); const { notification } = App.useApp(); const showTotal = total => `Total ${invoiceList.length} items`; @@ -97,10 +98,15 @@ function Index() { Search + + + - +
diff --git a/src/views/reservation/Newest.jsx b/src/views/reservation/Newest.jsx index 06468fd..2ab4143 100644 --- a/src/views/reservation/Newest.jsx +++ b/src/views/reservation/Newest.jsx @@ -5,6 +5,7 @@ import { toJS } from "mobx"; import { Row, Col, Space, Button, Table, Input, Typography, DatePicker, Radio, Modal, App, Select } from 'antd'; import { useStore } from '@/stores/StoreContext.js'; import { DATE_PRESETS } from "@/config"; +import { formatDate, isNotEmpty } from "@/utils/commons"; const { Title } = Typography; @@ -34,7 +35,8 @@ function Newest() { { title: 'Res. sending date', key: 'Reservation date', - dataIndex: 'reservationDate' + dataIndex: 'reservationDate', + render: (text, record) => (isNotEmpty(text) ? formatDate(new Date(text)) : ""), }, { title: 'Guide', From 9a7c10cba6844a55ab7c81a6881b094d66af0e21 Mon Sep 17 00:00:00 2001 From: YCC Date: Wed, 31 May 2023 14:19:53 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/reservation/Newest.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/views/reservation/Newest.jsx b/src/views/reservation/Newest.jsx index e669741..5e153c3 100644 --- a/src/views/reservation/Newest.jsx +++ b/src/views/reservation/Newest.jsx @@ -5,7 +5,6 @@ import { toJS } from "mobx"; import { Row, Col, Space, Button, Table, Input, Typography, DatePicker, Radio, Modal, App, Select } from 'antd'; import dayjs from "dayjs"; import { useStore } from '@/stores/StoreContext.js'; -import { formatDate, isEmpty } from "@/utils/commons"; import { DATE_PRESETS } from "@/config"; import { formatDate, isNotEmpty } from "@/utils/commons"; From 887c1e32eafb960bdca8d078f938563d17929e5f Mon Sep 17 00:00:00 2001 From: YCC Date: Wed, 31 May 2023 14:21:57 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/reservation/Newest.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/reservation/Newest.jsx b/src/views/reservation/Newest.jsx index 5e153c3..35ebb7e 100644 --- a/src/views/reservation/Newest.jsx +++ b/src/views/reservation/Newest.jsx @@ -6,7 +6,7 @@ import { Row, Col, Space, Button, Table, Input, Typography, DatePicker, Radio, M import dayjs from "dayjs"; import { useStore } from '@/stores/StoreContext.js'; import { DATE_PRESETS } from "@/config"; -import { formatDate, isNotEmpty } from "@/utils/commons"; +import { formatDate, isEmpty } from "@/utils/commons"; const { Title } = Typography; From d6d1495c02b6ece4dcf425b26930545aa97123a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=B9=8F?= Date: Wed, 31 May 2023 14:51:36 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E8=99=9A=E6=8B=9F=E5=9B=A2=E6=8A=A5?= =?UTF-8?q?=E8=B4=A6=E6=B7=BB=E5=8A=A0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/invoice/Detail.jsx | 282 ++++++++++++++++++----------------- 1 file changed, 148 insertions(+), 134 deletions(-) diff --git a/src/views/invoice/Detail.jsx b/src/views/invoice/Detail.jsx index b07ab0d..fe7b851 100644 --- a/src/views/invoice/Detail.jsx +++ b/src/views/invoice/Detail.jsx @@ -35,44 +35,47 @@ function Detail() { .fetchInvoiceDetail(GMDSN, GSN) .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 }; - } - }); - if (form) { - form.setFieldsValue(formData[arrLen - 1]); //{'info_money':'111','info_Currency':'THB','info_date':''} - } + if (isNotEmpty(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 }; + } + }); - //图片列表 - 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 (form) { + form.setFieldsValue(formData[arrLen - 1]); //{'info_money':'111','info_Currency':'THB','info_date':''} } - if (data.GMD_Dealed == false && arrLen == index + 1) { - runInAction(() => { - invoiceStore.invoicekImages = picList; - }); - } - return picList; - }); - setInvoicePicList(arrPicList); + + //图片列表 + 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({ @@ -181,107 +184,118 @@ function Detail() { //循环生成多次报账信息 function bindSubmitForm() { - let submitForm = invoiceZDDetail.map((data, index) => { - if (data.GMD_Dealed) { - //已审核的直接显示信息即可,无需表单 - return ( - - - - - - - - {data.GMD_Cost} - {data.GMD_Currency} - {data.GMD_PayDate} - {invoiceStore.invoiceStatus(data.FKState)} - + let submitForm =null; + if (isNotEmpty(invoiceZDDetail)){ + submitForm = invoiceZDDetail.map((data, index) => { + if (data.GMD_Dealed) { + //已审核的直接显示信息即可,无需表单 + return ( + + + + + + + + {data.GMD_Cost} + {data.GMD_Currency} + {data.GMD_PayDate} + {invoiceStore.invoiceStatus(data.FKState)} + - {addButton(index + 1 == invoiceZDDetail.length)} - - - - ); - } else { - // 一个团只能有一个未审核的账单记录 - return ( - - - - - Invoice {index + 1} - - -
- -
Click to Upload
-
-
-
- Details - - - {" "} - - - - - - - - - - - - - - - - - - - - - - - - ); + {addButton(index + 1 == invoiceZDDetail.length)} + + + + ); + } else { + // 一个团只能有一个未审核的账单记录 + return ( + + + + + Invoice {index + 1} + + +
+ +
Click to Upload
+
+
+
+ Details + + + {" "} + + + + + + + + + + + + + + + + + + + + + + + + ); + } + }); + }else{ + submitForm = ()=>{ + return( + <> + {addButton(1==1)} + + ); } - }); + } return submitForm; } From 9ec51c5025465573e92886829096446c6b92c6af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=B9=8F?= Date: Wed, 31 May 2023 15:12:09 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E8=99=9A=E6=8B=9F=E8=B4=A6=E5=8D=95?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/invoice/Detail.jsx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/views/invoice/Detail.jsx b/src/views/invoice/Detail.jsx index fe7b851..8beda1d 100644 --- a/src/views/invoice/Detail.jsx +++ b/src/views/invoice/Detail.jsx @@ -184,9 +184,8 @@ function Detail() { //循环生成多次报账信息 function bindSubmitForm() { - let submitForm =null; if (isNotEmpty(invoiceZDDetail)){ - submitForm = invoiceZDDetail.map((data, index) => { + let submitForm = invoiceZDDetail.map((data, index) => { if (data.GMD_Dealed) { //已审核的直接显示信息即可,无需表单 return ( @@ -287,16 +286,20 @@ function Detail() { ); } }); + return submitForm; }else{ - submitForm = ()=>{ return( - <> - {addButton(1==1)} - + + + + {addButton(1==1)} + + + ); - } + } - return submitForm; + } return (