账单功能财务列表90%

release
赵鹏 2 years ago
parent b9938d2c19
commit a319519f4d

@ -1,6 +1,6 @@
import { makeAutoObservable,runInAction } from "mobx";
import { fetchJSON } from "@/utils/request";
import { prepareUrl } from '@/utils/commons';
import { prepareUrl,isNotEmpty } from '@/utils/commons';
import { HT_HOST } from "@/config";
class Invoice {
@ -13,21 +13,21 @@ class Invoice {
fetchInvoiceList(PageIndex,OrderType,GroupNo,DateStart,DateEnd,Orderbytype,TimeType,limitmarket,mddgroup,SecuryGroup){
this.invoicePage.current=PageIndex;
const totalNum = PageIndex == 1 ? 0 : this.invoicePage.total;
fetchInvoiceList(current,OrderType,GroupNo,DateStart,DateEnd,Orderbytype){
this.invoicePage.current=current;
const totalNum = current == 1 ? 0 : this.invoicePage.total;
//组合param
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('GroupNo',GroupNo)
.append('DateStart',DateStart)
.append('DateEnd',DateEnd)
.append('Orderbytype',Orderbytype)
.append('TimeType',TimeType)
.append('limitmarket',limitmarket)
.append('mddgroup',mddgroup)
.append('SecuryGroup',SecuryGroup)
.append('TimeType',0)
.append('limitmarket',"")
.append('mddgroup',"")
.append('SecuryGroup',"")
.append('TotalNum', totalNum)
.append('PageSize', this.invoicePage.size)
.append('PageIndex', this.invoicePage.current)
@ -37,27 +37,30 @@ class Invoice {
.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;
if (isNotEmpty(json.Result)){
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,
GetGDate : data.GetGDate,
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);
}

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

@ -2,19 +2,146 @@ 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 { Row, Col, Space, Button, Table, Input, DatePicker,Typography,App } from "antd";
import { useStore } from "@/stores/StoreContext.js";
import * as config from "@/config";
import { formatDate,isNotEmpty } from "@/utils/commons";
const { Title } = Typography;
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 (
<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);

Loading…
Cancel
Save