From 8a75f1b4a0782ae2417fad3e77cff88a69776a4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=B9=8F?= Date: Thu, 11 May 2023 16:46:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A6=E5=8D=95=E5=88=97=E8=A1=A890%?= =?UTF-8?q?=EF=BC=8C=E8=B4=A6=E5=8D=95=E8=AF=A6=E7=BB=86=E9=A1=B550%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.jsx | 2 +- src/stores/Invoice.js | 59 ++++++++++++++- src/views/invoice/Detail.jsx | 136 ++++++++++++++++++++++++++++++++++- src/views/invoice/Index.jsx | 56 +++++++++++---- 4 files changed, 236 insertions(+), 17 deletions(-) diff --git a/src/main.jsx b/src/main.jsx index 286cc6d..8931bb9 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -53,7 +53,7 @@ const router = createBrowserRouter([ { path: "feedback/:GRI_SN", element: }, { path: "notice", element: }, { path: "invoice",element:}, - { path: "invoice/detial/:GMDSN/:GSN",element:}, + { path: "invoice/detail/:GMDSN/:GSN",element:}, ] }, { diff --git a/src/stores/Invoice.js b/src/stores/Invoice.js index c8b0872..ef0a956 100644 --- a/src/stores/Invoice.js +++ b/src/stores/Invoice.js @@ -2,6 +2,7 @@ import { makeAutoObservable,runInAction } from "mobx"; import { fetchJSON } from "@/utils/request"; import { prepareUrl,isNotEmpty } from '@/utils/commons'; import { HT_HOST } from "@/config"; +import { json } from "react-router-dom"; class Invoice { constructor(root) { @@ -10,6 +11,9 @@ class Invoice { } invoiceList = []; //账单列表 + invoicekImages = []; //图片列表 + invoiceGroupInfo= {}; //账单详细 + invocieProductList=[];//账单细项 @@ -54,11 +58,15 @@ class Invoice { GroupName : data.GroupName, AllMoney : data.AllMoney, PersonNum : data.PersonNum, - VName : data.VName + VName : data.VName, + FKState:data.FKState } }); this.invoicePage.total = json.Result[0].TotalCount; + }else{ + this.invoiceList=[]; + this.invoicePage.total=0; } }else{ @@ -73,6 +81,55 @@ class Invoice { } + fetchInvoiceDetail(GMDSN,GSN){ + const fetchUrl = prepareUrl(HT_HOST + '/service-cusservice/PTGetZDDetail') + .append('VEI_SN', '628') //this.root.authStore.login.travelAgencyId + .append('GRI_SN',GSN) + .append('GMD_SN',GMDSN) + .append('LGC',1) + .append('Bill',1) + .build(); + + return fetchJSON(fetchUrl) + .then(json=>{ + runInAction(()=>{ + if(json.errcode==0){ + this.invoiceGroupInfo = json.GroupInfo[0]; + this.invocieProductList = json.ProductList; + }else{ + throw new Error(json.errmsg + ': ' + json.errcode); + } + }) + }); + + } + + + //获取供应商提交的图片 + getInvoicekImages(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); + }); + } + + invoicePage = { current:1, size:10, diff --git a/src/views/invoice/Detail.jsx b/src/views/invoice/Detail.jsx index c29c5e1..d487922 100644 --- a/src/views/invoice/Detail.jsx +++ b/src/views/invoice/Detail.jsx @@ -1,18 +1,152 @@ import { useParams, useNavigate } from "react-router-dom"; import { useEffect, useState } from "react"; import { observer } from "mobx-react"; +import { toJS, runInAction } from "mobx"; +import { Row, Col, Space, Button, Typography,Card,Form,Upload ,Input,Divider} from "antd"; +import { useStore } from "@/stores/StoreContext.js"; +import { PlusOutlined } from "@ant-design/icons"; +import * as config from "@/config"; +const { Title } = Typography; function Detail() { const navigate = useNavigate(); const {GMDSN,GSN} = useParams(); + const { invoiceStore, authStore } = useStore(); + const { invoicekImages ,invoiceGroupInfo,invocieProductList} = invoiceStore; + const [form] = Form.useForm(); + const [dataLoading, setDataLoading] = useState(false); useEffect(() => { + console.info("Detail.useEffect: " + GMDSN+"/"+GSN); setDataLoading(true); - + invoiceStore.fetchInvoiceDetail(GMDSN,GSN) + .catch(ex => { + notification.error({ + message: `Notification`, + description: ex.message, + placement: 'top', + duration: 4, + }); + }) + .finally(() => { + setDataLoading(false); + }); },[GMDSN,GSN]); + const fileList = toJS(invoicekImages); + const onFinish = values => { + console.log("Success:", values); + if (values) { + alert(values); + } + }; + 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; + }; + + + return ( + + + + Reference Number: {invoiceGroupInfo.VGroupInfo} + + + + + + 基础信息 + + + +

CHINA HIGHLIGHTS

+
+ + + +

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

+
+ + + +

{invoiceGroupInfo.County}

+
+ +
+ 报账信息 + + + +
+ 上传照片 + + +
+ +
Click to Upload
+
+
+
+ 提交信息 + + + + + + + + + + + + + +
+ + +
+ +
+ ); + diff --git a/src/views/invoice/Index.jsx b/src/views/invoice/Index.jsx index a243c74..6be1c18 100644 --- a/src/views/invoice/Index.jsx +++ b/src/views/invoice/Index.jsx @@ -2,10 +2,11 @@ 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, DatePicker,Typography,App } from "antd"; +import { Row, Col, Space, Button, Table, Input, DatePicker,Typography,App,Steps } from "antd"; import { useStore } from "@/stores/StoreContext.js"; import * as config from "@/config"; import { formatDate,isNotEmpty } from "@/utils/commons"; +import { AuditOutlined, SmileOutlined, SolutionOutlined, EditOutlined } from '@ant-design/icons'; const { Title } = Typography; @@ -24,7 +25,6 @@ function Index() { title: '团名', dataIndex: 'GroupName', key: 'GroupName', - //render: (text, record) => {text}, }, { title: '离团时间', @@ -65,21 +65,49 @@ function Index() { }, { title: 'Action', - // key: 'action', - // render: actionRender + key: 'action', + render:(text, record) => Details, } ]; function BillStatus(text,record){ - if (record.GMD_Dealed){ - return "已审核"; - }else if (record.GMDFillworkers_SN<1){ - return "未填写"; - }else if (record.VRequestVerify){ - return "未审核"; - }else{ - return "未提交"; - } + // 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: '顾问', + // status: 'finish', + icon: , + }, + { + title: '财务', + //status: 'process', + icon: , + }, + { + title: 'Done', + //status: 'wait', + icon: , + }, + ]} + /> + } const onSearchClick = (current = 1) => { @@ -110,7 +138,7 @@ function Index() { Date { onDateRangeChange(dateRange) }}