From 71011c49c969004e46bbb0a27a34d34c63005336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=B9=8F?= Date: Mon, 8 May 2023 15:13:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A6=E5=8D=95=E5=8A=9F=E8=83=BD=E6=96=B0?= =?UTF-8?q?=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/Invoice.js | 109 +++++++++++++++++++++++++++++++++++ src/views/invoice/Detail.jsx | 23 ++++++++ src/views/invoice/Index.jsx | 20 +++++++ 3 files changed, 152 insertions(+) create mode 100644 src/stores/Invoice.js create mode 100644 src/views/invoice/Detail.jsx create mode 100644 src/views/invoice/Index.jsx diff --git a/src/stores/Invoice.js b/src/stores/Invoice.js new file mode 100644 index 0000000..5f0526f --- /dev/null +++ b/src/stores/Invoice.js @@ -0,0 +1,109 @@ +import { makeAutoObservable,runInAction } from "mobx"; +import { fetchJSON } from "@/utils/request"; +import { prepareUrl } from '@/utils/commons'; +import { HT_HOST } from "@/config"; + +class Invoice { + constructor(root) { + makeAutoObservable(this, { rootStore: false }); + this.root = root; + } + + invoiceList = []; //账单列表 + + + + fetchInvoiceList(PageIndex,OrderType,GroupNo,DateStart,DateEnd,Orderbytype,TimeType,limitmarket,mddgroup,SecuryGroup){ + this.invoicePage.current=PageIndex; + const totalNum = PageIndex == 1 ? 0 : this.invoicePage.total; + //组合param + const fetchUrl = prepareUrl(HT_HOST + '/service-cusservice/PTSearchGMBPageList') + .append('VEI_SN', this.root.authStore.login.travelAgencyId) + .append('OrderType',OrderType) + .append('GroupNo',GroupNo) + .append('DateStart',DateStart) + .append('DateEnd',DateEnd) + .append('Orderbytype',Orderbytype) + .append('TimeType',TimeType) + .append('limitmarket',limitmarket) + .append('mddgroup',mddgroup) + .append('SecuryGroup',SecuryGroup) + .append('TotalNum', totalNum) + .append('PageSize', this.invoicePage.size) + .append('PageIndex', this.invoicePage.current) + .build(); + + return fetchJSON(fetchUrl) + .then(json => { + runInAction(()=>{ + if (json.errcode==0){ + this.invoiceList = json.result.map((data,index)=>{ + return{ + key:GSMSN, + gmd_gri_sn : data.gmd_gri_sn, + gmd_vei_sn : data.gmd_vei_sn, + GetDate : data.GetDate, + GMD_FillWorkers_SN : data.GMD_FillWorkers_SN, + GMD_FWks_LastEditTime : data.GMD_FWks_LastEditTime, + GMD_VerifyUser_SN : data.GMD_VerifyUser_SN, + GMD_Dealed : data.GMD_Dealed, + GMD_VRequestVerify : data.GMD_VRequestVerify, + LeftGDate : data.LeftGDate, + GMD_FillWorkers_Name : data.GMD_FillWorkers_Name, + GroupName : data.GroupName, + AllMoney : data.AllMoney, + PersonNum : data.PersonNum, + VName : data.VName + } + + }); + this.invoicePage.total = json.result[0].TotalCount; + }else{ + throw new Error(json.errmsg + ': ' + json.errcode); + } + + }); + + }); + + + } + + + invoicePage = { + current:1, + size:10, + total:0 + } + + /* 测试数据 */ + //账单列表范例数据 + testData= + [ + { + "GSMSN":449865, + "gmd_gri_sn":334233, + "gmd_vei_sn":628, + "GetDate":"2023-04-2 00:33:33", + "GMD_FillWorkers_SN":8617, + "GMD_FWks_LastEditTime":"2023-04-26 12:33:33", + "GMD_VerifyUser_SN":8928, + "GMD_Dealed":1, + "GMD_VRequestVerify":1, + "TotalCount":22, + "LeftGDate":"2023-03-30 00:00:00", + "GMD_FillWorkers_Name":"", + "GroupName":" 中华游230501-CA230402033", + "AllMoney":3539, + "PersonNum":"1大1小", + "VName":"" + } + ] + +} + +export default Invoice; + + + + diff --git a/src/views/invoice/Detail.jsx b/src/views/invoice/Detail.jsx new file mode 100644 index 0000000..c29c5e1 --- /dev/null +++ b/src/views/invoice/Detail.jsx @@ -0,0 +1,23 @@ +import { useParams, useNavigate } from "react-router-dom"; +import { useEffect, useState } from "react"; +import { observer } from "mobx-react"; + +function Detail() { + const navigate = useNavigate(); + const {GMDSN,GSN} = useParams(); + + + useEffect(() => { + setDataLoading(true); + + + },[GMDSN,GSN]); + + + + +} + + +export default observer(Detail); + diff --git a/src/views/invoice/Index.jsx b/src/views/invoice/Index.jsx new file mode 100644 index 0000000..8d53ea3 --- /dev/null +++ b/src/views/invoice/Index.jsx @@ -0,0 +1,20 @@ +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 } from "antd"; +import { useStore } from "@/stores/StoreContext.js"; +import * as config from "@/config"; + +function Index() { + + return ( + +

"账单列表!"

+ + ) + +} + + +export default observer(Index);