From 1e8b61fd1cb02aa64db746febe3af347f9ca8b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=B9=8F?= Date: Thu, 25 May 2023 11:48:51 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=B1=89=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/invoice/Detail.jsx | 172 ++--------------------------------- 1 file changed, 10 insertions(+), 162 deletions(-) diff --git a/src/views/invoice/Detail.jsx b/src/views/invoice/Detail.jsx index 4755e0b..e7259dd 100644 --- a/src/views/invoice/Detail.jsx +++ b/src/views/invoice/Detail.jsx @@ -22,9 +22,6 @@ function Detail() { const { formCurrency, onCurrencyChange } = useState(); const { notification } = App.useApp(); - const [isModalOpen, setIsModalOpen] = useState(false); - const [confirmLoading, setConfirmLoading] = useState(false); - const [invoicePicList,setInvoicePicList] = useState([]); @@ -132,36 +129,6 @@ function Detail() { }; - 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); @@ -197,10 +164,7 @@ function Detail() { } function addInvoice(){ - invoiceStore.postAddInvoice(GSN, "", 0, "", "[]", "").then((data) => { - runInAction(() => { - invoiceStore.invoiceFormData = {'info_money':0,'info_Currency':'','info_date':'','info_gmdsn':GMDSN}; - }); + invoiceStore.postAddInvoice(GSN, "", 0, "", "[]", "").then((data) => { }).finally(()=>{ defaultShow(); }) @@ -244,13 +208,13 @@ function Detail() {
Click to Upload
- 提交信息 + Details - + - 金额币种: + {addButton(index + 1 == invoiceZDDetail.length)} @@ -276,7 +240,7 @@ function Detail() {
- 上传照片 + Upload Invoice - 提交信息 + Details @@ -358,108 +322,10 @@ function Detail() { } - //#region Modal - const showConfirmModal = (confirm) => { - setIsModalOpen(true); - }; - - const fromRef = useRef() - const handleOk = () => { - setConfirmLoading(true); - try{ - fromRef.current?.submit(); - //onAddFinish; - //setIsModalOpen(false); - } finally{ - - setConfirmLoading(false); - navigate("/invoice/detail/"+GMDSN+"/"+GSN) - } - }; - const handleCancel = () => { - setIsModalOpen(false); - }; - - //#endregion - - return ( <> - {/* - Add New Invoice - - 上传照片 - - -
- -
Click to Upload
-
-
-
- 提交信息 - - - - - - - - - - - - -
*/} @@ -471,24 +337,6 @@ function Detail() { - 基础信息 - - - -

CHINA HIGHLIGHTS

-
- - - -

{invoiceGroupInfo.WLFirstName} {invoiceGroupInfo.WLLastName}    Email: {invoiceGroupInfo.WLEmail}

-
- - - -

{invoiceGroupInfo.County}

-
- -
报账信息 {bindSubmitForm()}
From 0e2200a4ba9d069e0fea0c268e622e0ceab0dc2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=B9=8F?= Date: Thu, 25 May 2023 14:20:39 +0800 Subject: [PATCH 2/6] fix --- src/stores/Invoice.js | 4 ++-- src/views/invoice/Detail.jsx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/stores/Invoice.js b/src/stores/Invoice.js index 97ddd23..05680fc 100644 --- a/src/stores/Invoice.js +++ b/src/stores/Invoice.js @@ -57,8 +57,8 @@ class Invoice { this.invoiceList = json.Result.map((data, index) => { return { key: data.GMDSN, - gmd_gri_sn: data.gmd_gri_sn, - gmd_vei_sn: data.gmd_vei_sn, + gmd_gri_sn: data.GMD_GRI_SN, + gmd_vei_sn: data.GMD_VEI_SN, GetGDate: data.GetGDate, GMD_FillWorkers_SN: data.GMD_FillWorkers_SN, GMD_FWks_LastEditTime: data.GMD_FWks_LastEditTime, diff --git a/src/views/invoice/Detail.jsx b/src/views/invoice/Detail.jsx index e7259dd..6423deb 100644 --- a/src/views/invoice/Detail.jsx +++ b/src/views/invoice/Detail.jsx @@ -194,7 +194,7 @@ function Detail() { - 第 {index + 1} 次报账 + Invoice {index + 1}
- Upload Invoice + Invoice {index + 1} - 报账信息 + {bindSubmitForm()} From 2983dceab1d94e291d7ddb50dda709b468b9b90f Mon Sep 17 00:00:00 2001 From: YCC Date: Thu, 25 May 2023 14:28:27 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=BD=AC=E4=B9=89?= =?UTF-8?q?=E5=90=8E=E7=9A=84html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/Invoice.js | 7 ------- src/utils/commons.js | 10 +++++++++- src/views/feedback/Index.jsx | 6 +++--- src/views/invoice/Index.jsx | 25 +++++++++---------------- src/views/notice/Detail.jsx | 4 +++- 5 files changed, 24 insertions(+), 28 deletions(-) diff --git a/src/stores/Invoice.js b/src/stores/Invoice.js index 97ddd23..885a9b9 100644 --- a/src/stores/Invoice.js +++ b/src/stores/Invoice.js @@ -74,7 +74,6 @@ class Invoice { FKState: data.FKState, }; }); - this.invoicePage.total = json.Result[0].TotalCount; } else { this.invoiceList = []; } @@ -222,12 +221,6 @@ class Invoice { }); } - invoicePage = { - current: 1, - size: 10, - total: 0, - }; - /* 测试数据 */ //账单列表范例数据 testData = [ diff --git a/src/utils/commons.js b/src/utils/commons.js index 82bfc79..2dd6b0d 100644 --- a/src/utils/commons.js +++ b/src/utils/commons.js @@ -121,4 +121,12 @@ export function clickUrl(url) { httpLink.href = url; httpLink.target = "_blank"; httpLink.click(); -} \ No newline at end of file +} + +export function escape2Html(str) { + var temp = document.createElement("div"); + temp.innerHTML = str; + var output = temp.innerText || temp.textContent; + temp = null; + return output; + } \ No newline at end of file diff --git a/src/views/feedback/Index.jsx b/src/views/feedback/Index.jsx index 2bba0b2..7e96d9f 100644 --- a/src/views/feedback/Index.jsx +++ b/src/views/feedback/Index.jsx @@ -31,6 +31,7 @@ const feedbackListColumns = [ { title: "Post Survey", dataIndex: "Average", + render: (text, record) => (text ? text : ""),//为0显示为空 sorter: (a, b) => b.Average - a.Average, }, { @@ -47,8 +48,7 @@ function Index() { 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") - .catch(ex => { + 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, @@ -56,7 +56,7 @@ function Index() { // duration: 4, // }); console.log(ex.message); - }); + }); }, []); return ( diff --git a/src/views/invoice/Index.jsx b/src/views/invoice/Index.jsx index d4c927e..4f6bccf 100644 --- a/src/views/invoice/Index.jsx +++ b/src/views/invoice/Index.jsx @@ -12,10 +12,8 @@ const { Title } = Typography; function Index() { const { authStore, invoiceStore } = useStore(); - const { invoiceList, invoicePage, search_date_start, search_date_end } = invoiceStore; + const { invoiceList, search_date_start, search_date_end } = invoiceStore; const [groupNo, onGroupNoChange] = useState(""); - const [arrivalDateRange, onDateRangeChange] = useState([]); - const [dataLoading, setDataLoading] = useState(false); const { notification } = App.useApp(); const showTotal = total => `Total ${invoiceList.length} items`; @@ -26,24 +24,19 @@ function Index() { key: "GroupName", render: (text, record) => {text}, }, - { + { title: "Arrival Date", key: "LeftGDate", dataIndex: "LeftGDate", render: (text, record) => (isNotEmpty(text) ? formatDate(new Date(text)) : ""), }, { - title: "人数", - key: "PersonNum", - dataIndex: "PersonNum", - }, - { - title: "团总额", + title: "Total Amount", key: "AllMoney", dataIndex: "AllMoney", }, { - title: "账单状态", + title: "Status", key: "status", render: BillStatus, }, @@ -66,22 +59,22 @@ function Index() { initial={1} items={[ { - title: "提交", + title: "Submitted", //status: 'finish', icon: , }, { - title: "顾问", + title: "Travel Advisor", // status: 'finish', icon: , }, { - title: "财务", + title: "Finance Dept", //status: 'process', icon: , }, { - title: "Done", + title: "Paid", //status: 'wait', icon: , }, @@ -120,7 +113,7 @@ function Index() { - +
diff --git a/src/views/notice/Detail.jsx b/src/views/notice/Detail.jsx index 5c98f8c..2006a07 100644 --- a/src/views/notice/Detail.jsx +++ b/src/views/notice/Detail.jsx @@ -27,7 +27,9 @@ function Detail() { {noticeInfo.CCP_BLTitle}{noticeInfo.CCP_LastEditTime} - {noticeInfo.CCP_BLContent} + +
+
Back From 12e21f3e0735dd50f927cd4a8114138771e360e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=B9=8F?= Date: Thu, 25 May 2023 15:01:30 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=9C=80=E4=BD=8E=E4=BB=98=E6=AC=BE?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/invoice/Detail.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/views/invoice/Detail.jsx b/src/views/invoice/Detail.jsx index 6423deb..294b212 100644 --- a/src/views/invoice/Detail.jsx +++ b/src/views/invoice/Detail.jsx @@ -310,6 +310,7 @@ function Detail() { Submit +

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.

@@ -338,7 +339,7 @@ function Detail() { - {bindSubmitForm()} + {bindSubmitForm()} ); From 948b12ad33c4d51980de8c46cca7220d21e1e7e9 Mon Sep 17 00:00:00 2001 From: YCC Date: Thu, 25 May 2023 15:01:57 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E8=B4=A6=E5=8D=95=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E9=A1=B5=E6=98=BE=E7=A4=BA=E9=87=91=E9=A2=9D=E5=92=8C=E5=B8=81?= =?UTF-8?q?=E7=A7=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/Invoice.js | 2 + src/views/invoice/Detail.jsx | 637 +++++++++++++++++------------------ src/views/invoice/Index.jsx | 18 +- 3 files changed, 305 insertions(+), 352 deletions(-) diff --git a/src/stores/Invoice.js b/src/stores/Invoice.js index a426288..7ed600b 100644 --- a/src/stores/Invoice.js +++ b/src/stores/Invoice.js @@ -70,6 +70,7 @@ class Invoice { GroupName: data.GroupName, AllMoney: data.AllMoney, PersonNum: data.PersonNum, + GMD_Currency: data.GMD_Currency, VName: data.VName, FKState: data.FKState, }; @@ -239,6 +240,7 @@ class Invoice { GMD_FillWorkers_Name: "", GroupName: " 中华游230501-CA230402033", AllMoney: 3539, + GMD_Currency: "", PersonNum: "1大1小", VName: "", }, diff --git a/src/views/invoice/Detail.jsx b/src/views/invoice/Detail.jsx index 6423deb..fdf9db8 100644 --- a/src/views/invoice/Detail.jsx +++ b/src/views/invoice/Detail.jsx @@ -1,5 +1,5 @@ -import { useParams, useNavigate } from "react-router-dom"; -import { useEffect, useState ,useRef } from "react"; +import { useParams, useNavigate, NavLink } from "react-router-dom"; +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"; @@ -13,341 +13,304 @@ const { Title } = Typography; const { TextArea } = Input; function Detail() { - const navigate = useNavigate(); - const { GMDSN, GSN } = useParams(); - const { invoiceStore, authStore } = useStore(); - const { invoicekImages, invoiceGroupInfo, invoiceProductList, invoiceCurrencyList, invoiceZDDetail } = invoiceStore; - const [form] = Form.useForm(); - const [dataLoading, setDataLoading] = useState(false); - const { formCurrency, onCurrencyChange } = useState(); - const { notification } = App.useApp(); - - const [invoicePicList,setInvoicePicList] = useState([]); - - - useEffect(() => { - console.info("Detail.useEffect: " + GMDSN + "/" + GSN); - defaultShow(); - - }, [GMDSN, GSN]); - - - function defaultShow(){ - setDataLoading(true); - invoiceStore.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':''} - } - - - //图片列表 - 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({ - message: `Notification`, - description: ex.message, - placement: 'top', - duration: 4, - }); - }) - .finally(() => { - setDataLoading(false); - }); - } - - const fileList = toJS(invoicekImages); - //图片列表 - let arrimg = []; - if (isNotEmpty(fileList)) { - arrimg = fileList.map((data, index) => { - return { - url: data.url - } - }); - } - const onFinish = 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.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 handleChange = info => { - console.log(info); - let newFileList = [...info.fileList]; - newFileList = newFileList.map(file => { - if (file.response && file.response.result) { - file.url = file.response.result.file_url; - } - return file; - }); - runInAction(() => { - invoiceStore.invoicekImages = newFileList; - }); - }; - - const handRemove = info => { - console.log(info); - invoiceStore.removeFeedbackImages(info.url); - return true; - }; - - //币种 - function bindCurrency() { - let arr = []; - arr = invoiceCurrencyList.map((data, index) => { - return { - value: data.CRI_Code, - label: data.CRI_Name - }; - }); - - return arr; - } - - function addInvoice(){ - invoiceStore.postAddInvoice(GSN, "", 0, "", "[]", "").then((data) => { - }).finally(()=>{ - defaultShow(); - }) - } - - function addButton(check) { - if (check) { - return ( - - - - - - - - ) - } - } - - //循环生成多次报账信息 - function bindSubmitForm() { - let submitForm = invoiceZDDetail.map((data, index) => { - if (data.GMD_Dealed) { //已审核的直接显示信息即可,无需表单 - return ( - - - - Invoice {index + 1} - -
- -
Click to Upload
-
-
- Details - - - - - - Currency: - - - - - - {addButton(index + 1 == invoiceZDDetail.length)} - - - - - - ) - } else { - // 一个团只能有一个未审核的账单记录 - return ( - - - - - Invoice {index + 1} - - -
- -
Click to Upload
-
-
-
- Details - - - - - - - - - - - - - - - - - - - - - - - ) - } - - }) - return submitForm; - } - - - - return ( - <> - - - - - Reference Number: {invoiceGroupInfo.VGroupInfo} - - - - - - - {bindSubmitForm()} - - - ); - - - - + const navigate = useNavigate(); + const { GMDSN, GSN } = useParams(); + const { invoiceStore, authStore } = useStore(); + const { invoicekImages, invoiceGroupInfo, invoiceProductList, invoiceCurrencyList, invoiceZDDetail } = invoiceStore; + const [form] = Form.useForm(); + const [dataLoading, setDataLoading] = useState(false); + const { formCurrency, onCurrencyChange } = useState(); + const { notification } = App.useApp(); + + const [invoicePicList, setInvoicePicList] = useState([]); + + useEffect(() => { + console.info("Detail.useEffect: " + GMDSN + "/" + GSN); + defaultShow(); + }, [GMDSN, GSN]); + + function defaultShow() { + setDataLoading(true); + invoiceStore + .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':''} + } + + //图片列表 + 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({ + message: `Notification`, + description: ex.message, + placement: "top", + duration: 4, + }); + }) + .finally(() => { + setDataLoading(false); + }); + } + + const fileList = toJS(invoicekImages); + //图片列表 + let arrimg = []; + if (isNotEmpty(fileList)) { + arrimg = fileList.map((data, index) => { + return { + url: data.url, + }; + }); + } + const onFinish = 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.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 handleChange = info => { + console.log(info); + let newFileList = [...info.fileList]; + newFileList = newFileList.map(file => { + if (file.response && file.response.result) { + file.url = file.response.result.file_url; + } + return file; + }); + runInAction(() => { + invoiceStore.invoicekImages = newFileList; + }); + }; + + const handRemove = info => { + console.log(info); + invoiceStore.removeFeedbackImages(info.url); + return true; + }; + + //币种 + function bindCurrency() { + let arr = []; + arr = invoiceCurrencyList.map((data, index) => { + return { + value: data.CRI_Code, + label: data.CRI_Name, + }; + }); + + return arr; + } + + function addInvoice() { + invoiceStore + .postAddInvoice(GSN, "", 0, "", "[]", "") + .then(data => {}) + .finally(() => { + defaultShow(); + }); + } + + function addButton(check) { + if (check) { + return ( + + + + + ); + } + } + + //循环生成多次报账信息 + function bindSubmitForm() { + let submitForm = invoiceZDDetail.map((data, index) => { + if (data.GMD_Dealed) { + //已审核的直接显示信息即可,无需表单 + return ( + + + + Invoice {index + 1} + +
+ +
Click to Upload
+
+
+ Details + + + + + + Currency: + + + + + + {addButton(index + 1 == invoiceZDDetail.length)} + + + + ); + } else { + // 一个团只能有一个未审核的账单记录 + return ( + + + + + Invoice {index + 1} + + +
+ +
Click to Upload
+
+
+
+ Details + + + {" "} + + + + + + + + + + + + + + + + + + + + + + + + ); + } + }); + return submitForm; + } + + return ( + <> + + + + Reference Number: {invoiceGroupInfo.VGroupInfo} + + + Back + + + + {bindSubmitForm()} + + + ); } - export default observer(Detail); - diff --git a/src/views/invoice/Index.jsx b/src/views/invoice/Index.jsx index 4f6bccf..a5b4097 100644 --- a/src/views/invoice/Index.jsx +++ b/src/views/invoice/Index.jsx @@ -26,14 +26,15 @@ function Index() { }, { title: "Arrival Date", - key: "LeftGDate", - dataIndex: "LeftGDate", + key: "GetGDate", + dataIndex: "GetGDate", render: (text, record) => (isNotEmpty(text) ? formatDate(new Date(text)) : ""), }, { title: "Total Amount", key: "AllMoney", dataIndex: "AllMoney", + render: (text, record) => (isNotEmpty(record.GMD_Currency) ? record.GMD_Currency + " " + text : text), }, { title: "Status", @@ -43,15 +44,6 @@ function Index() { ]; function BillStatus(text, record) { - // if (record.GMD_Dealed){ - // return "已审核"; - // }else if (record.GMDFillworkers_SN<1){ - // return "未填写"; - // }else if (record.VRequestVerify){ - // return "未审核"; - // }else{ - // return "未提交"; - // } let FKState = record.FKState - 1; return ( , }, { title: "Travel Advisor", - // status: 'finish', icon: , }, { title: "Finance Dept", - //status: 'process', icon: , }, { title: "Paid", - //status: 'wait', icon: , }, ]} From b4ebb06c88d21be9d9e41d44b93c89b8c78157ce Mon Sep 17 00:00:00 2001 From: YCC Date: Thu, 25 May 2023 15:34:59 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/Invoice.js | 1 + src/views/invoice/Detail.jsx | 286 +++++++++++++++-------------------- src/views/invoice/Index.jsx | 2 +- 3 files changed, 128 insertions(+), 161 deletions(-) diff --git a/src/stores/Invoice.js b/src/stores/Invoice.js index 7ed600b..e599be0 100644 --- a/src/stores/Invoice.js +++ b/src/stores/Invoice.js @@ -177,6 +177,7 @@ class Invoice { 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 => { diff --git a/src/views/invoice/Detail.jsx b/src/views/invoice/Detail.jsx index 7d9435f..be49724 100644 --- a/src/views/invoice/Detail.jsx +++ b/src/views/invoice/Detail.jsx @@ -2,7 +2,7 @@ import { useParams, useNavigate, NavLink } from "react-router-dom"; 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"; +import { Row, Col, Space, Button, Typography, Card, Form, Upload, Input, Divider, DatePicker, Select, App, Descriptions } from "antd"; import { useStore } from "@/stores/StoreContext.js"; import { PlusOutlined } from "@ant-design/icons"; import { isNotEmpty } from "@/utils/commons"; @@ -179,167 +179,133 @@ function Detail() { } } - //循环生成多次报账信息 - function bindSubmitForm() { - let submitForm = invoiceZDDetail.map((data, index) => { - if (data.GMD_Dealed) { //已审核的直接显示信息即可,无需表单 - return ( - - - - Invoice {index + 1} - -
- -
Click to Upload
-
-
- Details - - - - - - Currency: - - - - - - {addButton(index + 1 == invoiceZDDetail.length)} - - - - - - ) - } else { - // 一个团只能有一个未审核的账单记录 - return ( - - - - - Invoice {index + 1} - - -
- -
Click to Upload
-
-
-
- Details - - - - - - - - - - - - - - - - - - -

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.

- - - - - ) - } - - }) - return submitForm; - } - - - - return ( - <> - - - - - Reference Number: {invoiceGroupInfo.VGroupInfo} - - - - - - - {bindSubmitForm()} - - - ); - - + //循环生成多次报账信息 + function bindSubmitForm() { + let submitForm = invoiceZDDetail.map((data, index) => { + if (data.GMD_Dealed) { + //已审核的直接显示信息即可,无需表单 + return ( + + + + Invoice {index + 1} + + + {data.GMD_Cost} + {data.GMD_Currency} + {data.GMD_PayDate} + + {addButton(index + 1 == invoiceZDDetail.length)} + + + + ); + } else { + // 一个团只能有一个未审核的账单记录 + return ( + + + + + Invoice {index + 1} + + +
+ +
Click to Upload
+
+
+
+ Details + + + {" "} + + + + + + + + + + + + + + + + + + + +

+ 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. +

+ + + + + ); + } + }); + return submitForm; + } + return ( + <> + + + + Reference Number: {invoiceGroupInfo.VGroupInfo} + + + + + + + {bindSubmitForm()} + + + ); } export default observer(Detail); diff --git a/src/views/invoice/Index.jsx b/src/views/invoice/Index.jsx index a5b4097..b4e14f6 100644 --- a/src/views/invoice/Index.jsx +++ b/src/views/invoice/Index.jsx @@ -100,7 +100,7 @@ function Index() { - +