查看账单付款记录功能
parent
acfac0775c
commit
661eb409f2
@ -0,0 +1,105 @@
|
|||||||
|
import { NavLink, useNavigate } 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, Image } from "antd";
|
||||||
|
import { useStore } from "@/stores/StoreContext.js";
|
||||||
|
import * as config from "@/config";
|
||||||
|
import { formatDate, isNotEmpty } from "@/utils/commons";
|
||||||
|
const { Title } = Typography;
|
||||||
|
|
||||||
|
function Paid(){
|
||||||
|
const { authStore, invoiceStore } = useStore();
|
||||||
|
const { invoicePaid, search_date_start, search_date_end } = invoiceStore;
|
||||||
|
const [groupNo, onGroupNoChange] = useState("");
|
||||||
|
const navigate = useNavigate();
|
||||||
|
const showTotal = total => `Total ${invoicePaid.length} items`;
|
||||||
|
|
||||||
|
|
||||||
|
useEffect (() => {
|
||||||
|
invoiceStore.fetchInvoicePaid(authStore.login.travelAgencyId,"","","");
|
||||||
|
|
||||||
|
},[]);
|
||||||
|
const invoicePaidColumns = [
|
||||||
|
{
|
||||||
|
title: "Payment ref.NO",
|
||||||
|
dataIndex: "fl_finaceNo",
|
||||||
|
key: "fl_finaceNo",
|
||||||
|
render: (text, record) => <NavLink to={`/invoice/paid/detail/${record.key}`}>{text}</NavLink>,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Payment date",
|
||||||
|
key: "fl_adddate",
|
||||||
|
dataIndex: "fl_adddate",
|
||||||
|
render: (text, record) => (isNotEmpty(text) ? formatDate(new Date(text)) : ""),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Number of bills",
|
||||||
|
key: "fcount",
|
||||||
|
dataIndex: "fcount",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Total amount",
|
||||||
|
key: "pSum",
|
||||||
|
dataIndex: "pSum",
|
||||||
|
//render: (text, record) => (isNotEmpty(record.GMD_Currency) ? record.GMD_Currency + " " + text : text),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Bank statement",
|
||||||
|
key: "fl_pic",
|
||||||
|
dataIndex: "fl_pic",
|
||||||
|
render: showPIc,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
function showPIc(text,record) {
|
||||||
|
let strPic = record.fl_pic;
|
||||||
|
//console.log(JSON.parse(strPic));
|
||||||
|
return (
|
||||||
|
|
||||||
|
JSON.parse(strPic).map((item,index) => {
|
||||||
|
return <Image key={index} width={90} src={item.url} />;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Space direction="vertical" style={{ width: "100%" }}>
|
||||||
|
<Title level={3}></Title>
|
||||||
|
<Row gutter={16}>
|
||||||
|
<Col md={24} lg={6} xxl={4}>
|
||||||
|
<Input
|
||||||
|
placeholder="Reference Number"
|
||||||
|
onChange={e => {
|
||||||
|
onGroupNoChange(e.target.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col md={24} lg={8} xxl={6}>
|
||||||
|
<Space direction="horizontal">
|
||||||
|
Date
|
||||||
|
<DatePicker.RangePicker format={config.DATE_FORMAT} allowClear={false} style={{ width: "100%" }} value={[search_date_start, search_date_end]} presets={config.DATE_PRESETS} onChange={invoiceStore.onDateRangeChange} />
|
||||||
|
</Space>
|
||||||
|
</Col>
|
||||||
|
<Col md={24} lg={4} xxl={4}>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
loading={invoiceStore.loading}
|
||||||
|
onClick={() => invoiceStore.fetchInvoicePaid(authStore.login.travelAgencyId, groupNo, search_date_start.format(config.DATE_FORMAT), search_date_end.format(config.DATE_FORMAT))}>
|
||||||
|
Search
|
||||||
|
</Button>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<Title level={3}></Title>
|
||||||
|
<Row>
|
||||||
|
<Col md={24} lg={24} xxl={24}>
|
||||||
|
<Table bordered pagination={{ defaultPageSize: 20, showTotal: showTotal }} columns={invoicePaidColumns} dataSource={toJS(invoicePaid)} />
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</Space>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default observer(Paid);
|
@ -0,0 +1,67 @@
|
|||||||
|
import { NavLink, useNavigate ,useParams} from "react-router-dom";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import { observer } from "mobx-react";
|
||||||
|
import { toJS } from "mobx";
|
||||||
|
import { Row, Col, Space, Button, Table, Typography } from "antd";
|
||||||
|
import { useStore } from "@/stores/StoreContext.js";
|
||||||
|
import * as config from "@/config";
|
||||||
|
import { formatDate, isNotEmpty } from "@/utils/commons";
|
||||||
|
const { Title } = Typography;
|
||||||
|
|
||||||
|
function PaidDetail(){
|
||||||
|
const navigate = useNavigate();
|
||||||
|
const { authStore, invoiceStore } = useStore();
|
||||||
|
const { invoicePaidDetail } = invoiceStore;
|
||||||
|
const { flid } = useParams();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
invoiceStore.fetchInvoicePaidDetail(authStore.login.travelAgencyId,flid);
|
||||||
|
|
||||||
|
},[flid]);
|
||||||
|
|
||||||
|
const invoicePaidColumns = [
|
||||||
|
{
|
||||||
|
title: "Ref.NO",
|
||||||
|
dataIndex: "fl2_GroupName",
|
||||||
|
key: "fl2_GroupName",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Arrival date",
|
||||||
|
key: "fl2_ArriveDate",
|
||||||
|
dataIndex: "fl2_ArriveDate",
|
||||||
|
render: (text, record) => (isNotEmpty(text) ? formatDate(new Date(text)) : ""),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Payment amount",
|
||||||
|
key: "fl2_price",
|
||||||
|
dataIndex: "fl2_price",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Currency",
|
||||||
|
key: "fl2_memo",
|
||||||
|
dataIndex: "fl2_memo",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Space direction="vertical" style={{ width: "100%" }}>
|
||||||
|
<Row gutter={16}>
|
||||||
|
<Col span={20}>
|
||||||
|
</Col>
|
||||||
|
<Col span={4}>
|
||||||
|
<Button type="link" onClick={() => navigate("/invoice/paid")}>
|
||||||
|
Back
|
||||||
|
</Button>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<Title level={3}></Title>
|
||||||
|
<Row>
|
||||||
|
<Col md={24} lg={24} xxl={24}>
|
||||||
|
<Table bordered columns={invoicePaidColumns} dataSource={toJS(invoicePaidDetail)} />
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</Space>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default observer(PaidDetail);
|
Loading…
Reference in New Issue