|
|
|
@ -7,13 +7,19 @@ 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";
|
|
|
|
|
import useAuthStore from '@/stores/Auth';
|
|
|
|
|
import usePresets from '@/hooks/usePresets';
|
|
|
|
|
import SearchForm from '@/components/SearchForm';
|
|
|
|
|
import dayjs from 'dayjs';
|
|
|
|
|
|
|
|
|
|
const { Title } = Typography;
|
|
|
|
|
|
|
|
|
|
function Index() {
|
|
|
|
|
const { authStore, invoiceStore } = useStore();
|
|
|
|
|
const { invoiceList, search_date_start, search_date_end } = invoiceStore;
|
|
|
|
|
|
|
|
|
|
const [travelAgencyId ] = useAuthStore((state) => [state.loginUser.travelAgencyId]);
|
|
|
|
|
|
|
|
|
|
const [groupNo, onGroupNoChange] = useState("");
|
|
|
|
|
const [OrderType, onOrderTypeChange] = useState(0); //订单状态搜索
|
|
|
|
|
const navigate = useNavigate();
|
|
|
|
@ -76,76 +82,36 @@ function Index() {
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Space direction="vertical" style={{ width: "100%" }}>
|
|
|
|
|
<Title level={3}></Title>
|
|
|
|
|
<Row gutter={16}>
|
|
|
|
|
<Col md={24} lg={4} xxl={4}>
|
|
|
|
|
<Input
|
|
|
|
|
placeholder="Reference Number"
|
|
|
|
|
onChange={e => {
|
|
|
|
|
onGroupNoChange(e.target.value);
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col md={24} lg={4} xxl={3}>
|
|
|
|
|
<Row gutter={16}>
|
|
|
|
|
<Col flex="auto">
|
|
|
|
|
<SearchForm
|
|
|
|
|
initialValue={{
|
|
|
|
|
dates: [dayjs().subtract(2, 'M').startOf('M'), dayjs().endOf('M')],
|
|
|
|
|
}}
|
|
|
|
|
defaultValue={{
|
|
|
|
|
shows: ['referenceNo', 'invoiceStatus', 'dates'],
|
|
|
|
|
fieldProps: {
|
|
|
|
|
referenceNo: { col: 5},
|
|
|
|
|
invoiceStatus: { col: 4},
|
|
|
|
|
dates: { col: 10 },
|
|
|
|
|
},
|
|
|
|
|
}}
|
|
|
|
|
onSubmit={(err, formVal, filedsVal) => {
|
|
|
|
|
// fetchInvoiceList(travelAgencyId, formVal.referenceNo, formVal.startdate, formVal.enddate, formVal.invoiceStatus);
|
|
|
|
|
invoiceStore.fetchInvoiceList(travelAgencyId, formVal.referenceNo, formVal.startdate, formVal.enddate, formVal.invoiceStatus)
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col md={24} lg={4} xxl={4}>
|
|
|
|
|
<Button icon={<AuditOutlined />} onClick={() => navigate(`/invoice/detail/0/338787`)}>
|
|
|
|
|
Misc. Invoice
|
|
|
|
|
</Button>
|
|
|
|
|
<Button icon={<AuditOutlined />} onClick={() => navigate(`/invoice/paid`)}>
|
|
|
|
|
Bank statement
|
|
|
|
|
</Button>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
|
|
<Select
|
|
|
|
|
defaultValue="Status"
|
|
|
|
|
style={{
|
|
|
|
|
width: 220,
|
|
|
|
|
}}
|
|
|
|
|
onChange={ value => {onOrderTypeChange(value);}}
|
|
|
|
|
options={[
|
|
|
|
|
{
|
|
|
|
|
value: '0',
|
|
|
|
|
label: 'Status',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: '1',
|
|
|
|
|
label: 'Not submitted',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: '2',
|
|
|
|
|
label: 'Submitted',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: '3',
|
|
|
|
|
label: 'Travel advisor approved',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: '4',
|
|
|
|
|
label: 'Finance Dept arrproved',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: '5',
|
|
|
|
|
label: 'Paid',
|
|
|
|
|
},
|
|
|
|
|
]}
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col md={24} lg={8} xxl={6}>
|
|
|
|
|
<Space direction="horizontal">
|
|
|
|
|
Arrival Date
|
|
|
|
|
<DatePicker.RangePicker format={config.DATE_FORMAT} allowClear={true} style={{ width: "100%" }} defaultValue={[search_date_start, search_date_end]} presets={usePresets()} onChange={invoiceStore.onDateRangeChange} allowEmpty={true} />
|
|
|
|
|
</Space>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col md={24} lg={4} xxl={4}>
|
|
|
|
|
<Button
|
|
|
|
|
type="primary"
|
|
|
|
|
loading={invoiceStore.loading}
|
|
|
|
|
onClick={() => invoiceStore.fetchInvoiceList(authStore.login.travelAgencyId, groupNo, search_date_start==null?null:search_date_start.format(config.DATE_FORMAT), search_date_end==null?null:search_date_end.format(config.DATE_FORMAT),OrderType)}>
|
|
|
|
|
Search
|
|
|
|
|
</Button>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col md={24} lg={4} xxl={4}>
|
|
|
|
|
<Button icon={<AuditOutlined />} onClick={() => navigate(`/invoice/detail/0/338787`)}>
|
|
|
|
|
Misc. Invoice
|
|
|
|
|
</Button>
|
|
|
|
|
<Button icon={<AuditOutlined />} onClick={() => navigate(`/invoice/paid`)}>
|
|
|
|
|
Bank statement
|
|
|
|
|
</Button>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
<Title level={3}></Title>
|
|
|
|
|
<Row>
|
|
|
|
|
<Col md={24} lg={24} xxl={24}>
|
|
|
|
|
<Table bordered pagination={{ defaultPageSize: 20, showTotal: showTotal }} columns={invoiceListColumns} dataSource={toJS(invoiceList)} />
|
|
|
|
|