账单功能财务列表90%

release
赵鹏 2 years ago
parent b9938d2c19
commit a319519f4d

@ -1,6 +1,6 @@
import { makeAutoObservable,runInAction } from "mobx"; import { makeAutoObservable,runInAction } from "mobx";
import { fetchJSON } from "@/utils/request"; import { fetchJSON } from "@/utils/request";
import { prepareUrl } from '@/utils/commons'; import { prepareUrl,isNotEmpty } from '@/utils/commons';
import { HT_HOST } from "@/config"; import { HT_HOST } from "@/config";
class Invoice { class Invoice {
@ -13,21 +13,21 @@ class Invoice {
fetchInvoiceList(PageIndex,OrderType,GroupNo,DateStart,DateEnd,Orderbytype,TimeType,limitmarket,mddgroup,SecuryGroup){ fetchInvoiceList(current,OrderType,GroupNo,DateStart,DateEnd,Orderbytype){
this.invoicePage.current=PageIndex; this.invoicePage.current=current;
const totalNum = PageIndex == 1 ? 0 : this.invoicePage.total; const totalNum = current == 1 ? 0 : this.invoicePage.total;
//组合param //组合param
const fetchUrl = prepareUrl(HT_HOST + '/service-cusservice/PTSearchGMBPageList') const fetchUrl = prepareUrl(HT_HOST + '/service-cusservice/PTSearchGMBPageList')
.append('VEI_SN', this.root.authStore.login.travelAgencyId) .append('VEI_SN', '628') //this.root.authStore.login.travelAgencyId
.append('OrderType',OrderType) .append('OrderType',OrderType)
.append('GroupNo',GroupNo) .append('GroupNo',GroupNo)
.append('DateStart',DateStart) .append('DateStart',DateStart)
.append('DateEnd',DateEnd) .append('DateEnd',DateEnd)
.append('Orderbytype',Orderbytype) .append('Orderbytype',Orderbytype)
.append('TimeType',TimeType) .append('TimeType',0)
.append('limitmarket',limitmarket) .append('limitmarket',"")
.append('mddgroup',mddgroup) .append('mddgroup',"")
.append('SecuryGroup',SecuryGroup) .append('SecuryGroup',"")
.append('TotalNum', totalNum) .append('TotalNum', totalNum)
.append('PageSize', this.invoicePage.size) .append('PageSize', this.invoicePage.size)
.append('PageIndex', this.invoicePage.current) .append('PageIndex', this.invoicePage.current)
@ -37,27 +37,30 @@ class Invoice {
.then(json => { .then(json => {
runInAction(()=>{ runInAction(()=>{
if (json.errcode==0){ if (json.errcode==0){
this.invoiceList = json.result.map((data,index)=>{ if (isNotEmpty(json.Result)){
return{ this.invoiceList = json.Result.map((data,index)=>{
key:GSMSN, return{
gmd_gri_sn : data.gmd_gri_sn, key:data.GMDSN,
gmd_vei_sn : data.gmd_vei_sn, gmd_gri_sn : data.gmd_gri_sn,
GetDate : data.GetDate, gmd_vei_sn : data.gmd_vei_sn,
GMD_FillWorkers_SN : data.GMD_FillWorkers_SN, GetGDate : data.GetGDate,
GMD_FWks_LastEditTime : data.GMD_FWks_LastEditTime, GMD_FillWorkers_SN : data.GMD_FillWorkers_SN,
GMD_VerifyUser_SN : data.GMD_VerifyUser_SN, GMD_FWks_LastEditTime : data.GMD_FWks_LastEditTime,
GMD_Dealed : data.GMD_Dealed, GMD_VerifyUser_SN : data.GMD_VerifyUser_SN,
GMD_VRequestVerify : data.GMD_VRequestVerify, GMD_Dealed : data.GMD_Dealed,
LeftGDate : data.LeftGDate, GMD_VRequestVerify : data.GMD_VRequestVerify,
GMD_FillWorkers_Name : data.GMD_FillWorkers_Name, LeftGDate : data.LeftGDate,
GroupName : data.GroupName, GMD_FillWorkers_Name : data.GMD_FillWorkers_Name,
AllMoney : data.AllMoney, GroupName : data.GroupName,
PersonNum : data.PersonNum, AllMoney : data.AllMoney,
VName : data.VName PersonNum : data.PersonNum,
} VName : data.VName
}
});
this.invoicePage.total = json.result[0].TotalCount; });
this.invoicePage.total = json.Result[0].TotalCount;
}
}else{ }else{
throw new Error(json.errmsg + ': ' + json.errcode); throw new Error(json.errmsg + ': ' + json.errcode);
} }

@ -9,7 +9,7 @@ class Root {
this.reservationStore = new Reservation(this); this.reservationStore = new Reservation(this);
this.feedbackStore = new Feedback(this); this.feedbackStore = new Feedback(this);
this.authStore = new Auth(this); this.authStore = new Auth(this);
//this.invoice = new Invoice(this); this.invoiceStore = new Invoice(this);
makeAutoObservable(this); makeAutoObservable(this);
} }
} }

@ -2,19 +2,146 @@ import { NavLink } from "react-router-dom";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { observer } from "mobx-react"; import { observer } from "mobx-react";
import { toJS } from "mobx"; import { toJS } from "mobx";
import { Row, Col, Space, Button, Table, Input, DatePicker } from "antd"; import { Row, Col, Space, Button, Table, Input, DatePicker,Typography,App } from "antd";
import { useStore } from "@/stores/StoreContext.js"; import { useStore } from "@/stores/StoreContext.js";
import * as config from "@/config"; import * as config from "@/config";
import { formatDate,isNotEmpty } from "@/utils/commons";
const { Title } = Typography;
function Index() { function Index() {
const { invoiceStore } = useStore();
const { invoiceList ,invoicePage } = invoiceStore;
const [groupNo, onGroupNoChange] = useState('');
const [arrivalDateRange, onDateRangeChange] = useState([]);
const [dataLoading, setDataLoading] = useState(false);
const { notification } = App.useApp();
const invoiceListColumns = [
{
title: '团名',
dataIndex: 'GroupName',
key: 'GroupName',
//render: (text, record) => <NavLink to={`/reservation/${record.reservationId}`}>{text}</NavLink>,
},
{
title: '离团时间',
dataIndex: 'GetGDate',
key: 'GetGDate',
render:(text,record) =>formatDate(new Date(text))
},
{
title: '接团时间',
key: 'LeftGDate',
dataIndex: 'LeftGDate'
},
{
title: '人数',
key: 'PersonNum',
dataIndex: 'PersonNum'
},
{
title: '团总额',
key: 'AllMoney',
dataIndex: 'AllMoney'
},
{
title: '填表时间',
key: 'GMD_FWks_LastEditTime',
dataIndex: 'GMD_FWks_LastEditTime',
render:(text,record) => isNotEmpty(text)?formatDate(new Date(text)):""
},
{
title: '填表人',
key: 'GMD_FillWorkers_Name',
dataIndex: 'GMD_FillWorkers_Name'
},
{
title: '账单状态',
key: 'status',
render:BillStatus
},
{
title: 'Action',
// key: 'action',
// render: actionRender
}
];
function BillStatus(text,record){
if (record.GMD_Dealed){
return "已审核";
}else if (record.GMDFillworkers_SN<1){
return "未填写";
}else if (record.VRequestVerify){
return "未审核";
}else{
return "未提交";
}
}
const onSearchClick = (current = 1) => {
setDataLoading(true);
invoiceStore.fetchInvoiceList(current, 0, groupNo, arrivalDateRange[0], arrivalDateRange[1], 1)
.catch(ex => {
notification.error({
message: `Notification`,
description: ex.message,
placement: 'top',
duration: 4,
});
})
.finally(() => {
setDataLoading(false);
});
}
return ( return (
<Space><h1>"账单列表!"</h1></Space> <Space direction="vertical" style={{ width: '100%' }}>
<Title level={3}>账单管理</Title>
<Row gutter={{ md: 24 }}>
<Col span={4}>
<Input placeholder="团名" onChange={(e) => { onGroupNoChange(e.target.value) }} />
</Col>
<Col span={6}>
<Space direction="horizontal">
Date
<DatePicker.RangePicker
allowClear={true}
inputReadOnly={true}
placeholder={['Start', 'End']}
onChange={(date, dateRange) => { onDateRangeChange(dateRange) }}
/>
</Space>
</Col>
<Col span={14}>
<Button type='primary' onClick={() => onSearchClick()} loading={dataLoading}>Search</Button>
</Col>
</Row>
<Row>
<Col span={24}>
<Table
bordered
loading={dataLoading}
pagination={{
position: ['bottomCenter'],
current: invoicePage.current,
pageSize: invoicePage.size,
total: invoicePage.total,
simple: true
}}
onChange={(pagination, filters, sorter, extra) => {onSearchClick(pagination.current);}}
columns={invoiceListColumns} dataSource={toJS(invoiceList)}
/>
</Col>
</Row>
</Space>
) )
} }
export default observer(Index); export default observer(Index);

Loading…
Cancel
Save