|
|
|
@ -2,7 +2,7 @@ import { useParams, useNavigate, NavLink } from "react-router-dom";
|
|
|
|
|
import { useEffect, useState, useRef } from "react";
|
|
|
|
|
import { observer } from "mobx-react";
|
|
|
|
|
import { toJS, runInAction } from "mobx";
|
|
|
|
|
import { Row, Col, Space, Button, Typography, Card, Form, Upload, Input, Divider, DatePicker, Select, App, Modal } from "antd";
|
|
|
|
|
import { Row, Col, Space, Button, Typography, Card, Form, Upload, Input, Divider, DatePicker, Select, App, Descriptions } from "antd";
|
|
|
|
|
import { useStore } from "@/stores/StoreContext.js";
|
|
|
|
|
import { PlusOutlined } from "@ant-design/icons";
|
|
|
|
|
import { isNotEmpty } from "@/utils/commons";
|
|
|
|
@ -179,167 +179,133 @@ function Detail() {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//循环生成多次报账信息
|
|
|
|
|
function bindSubmitForm() {
|
|
|
|
|
let submitForm = invoiceZDDetail.map((data, index) => {
|
|
|
|
|
if (data.GMD_Dealed) { //已审核的直接显示信息即可,无需表单
|
|
|
|
|
return (
|
|
|
|
|
<Row key={data.GMD_SN} gutter={16} style={{ backgroundColor: "#f6f7f9", width: "100%", padding: "20px 40px" }} >
|
|
|
|
|
<Col span={4}></Col>
|
|
|
|
|
<Col span={18} >
|
|
|
|
|
<Divider orientation="left">Invoice {index + 1}</Divider>
|
|
|
|
|
<Upload
|
|
|
|
|
name="ghhfile"
|
|
|
|
|
accept="image/*"
|
|
|
|
|
multiple={true}
|
|
|
|
|
action={config.HT_HOST + `/service-fileServer/FileUpload?GRI_SN=${GSN}&VEI_SN=${authStore.login.travelAgencyId}&FilePathName=invoice&token=${authStore.login.token}`}
|
|
|
|
|
fileList={invoicePicList[index]}
|
|
|
|
|
listType="picture-card"
|
|
|
|
|
>
|
|
|
|
|
<div>
|
|
|
|
|
<PlusOutlined />
|
|
|
|
|
<div style={{ marginTop: 8 }}>Click to Upload</div>
|
|
|
|
|
</div>
|
|
|
|
|
</Upload>
|
|
|
|
|
<Divider orientation="left">Details</Divider>
|
|
|
|
|
<Row gutter={16}>
|
|
|
|
|
<Col span={8}>
|
|
|
|
|
<Input addonBefore="Amount:" value={data.GMD_Cost} />
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={8}>
|
|
|
|
|
Currency: <Select
|
|
|
|
|
placeholder="Select Currency type"
|
|
|
|
|
allowClear
|
|
|
|
|
options={bindCurrency()}
|
|
|
|
|
value={data.GMD_Currency}
|
|
|
|
|
>
|
|
|
|
|
</Select>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={8}>
|
|
|
|
|
<Input addonBefore="Due Dat:" value={data.GMD_PayDate} />
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
{addButton(index + 1 == invoiceZDDetail.length)}
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={4}></Col>
|
|
|
|
|
|
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
|
|
)
|
|
|
|
|
} else {
|
|
|
|
|
// 一个团只能有一个未审核的账单记录
|
|
|
|
|
return (
|
|
|
|
|
<Row key={data.GMD_SN} gutter={16} style={{ backgroundColor: "#f6f7f9", width: "100%", padding: "20px 40px" }} >
|
|
|
|
|
<Col span={4}></Col>
|
|
|
|
|
<Col span={18} >
|
|
|
|
|
<Form name="invoice_submit" onFinish={onFinish} labelCol={{ span: 5 }} form={form} style={{backgroundColor:"#fff" , padding:"20px"}}>
|
|
|
|
|
<Divider orientation="left">Invoice {index + 1}</Divider>
|
|
|
|
|
<Form.Item>
|
|
|
|
|
<Upload
|
|
|
|
|
name="ghhfile"
|
|
|
|
|
accept="image/*"
|
|
|
|
|
multiple={true}
|
|
|
|
|
action={config.HT_HOST + `/service-fileServer/FileUpload?GRI_SN=${GSN}&VEI_SN=${authStore.login.travelAgencyId}&FilePathName=invoice&token=${authStore.login.token}`}
|
|
|
|
|
fileList={fileList}
|
|
|
|
|
listType="picture-card"
|
|
|
|
|
onChange={handleChange}
|
|
|
|
|
onRemove={handRemove}>
|
|
|
|
|
<div>
|
|
|
|
|
<PlusOutlined />
|
|
|
|
|
<div style={{ marginTop: 8 }}>Click to Upload</div>
|
|
|
|
|
</div>
|
|
|
|
|
</Upload>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Divider orientation="left">Details</Divider>
|
|
|
|
|
<Row gutter={16}>
|
|
|
|
|
|
|
|
|
|
<Col span={8}> <Form.Item
|
|
|
|
|
name="info_money"
|
|
|
|
|
label="Amount:"
|
|
|
|
|
rules={[
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: "Please input your money!",
|
|
|
|
|
},
|
|
|
|
|
]}
|
|
|
|
|
>
|
|
|
|
|
<Input />
|
|
|
|
|
</Form.Item></Col>
|
|
|
|
|
<Col span={8}><Form.Item
|
|
|
|
|
name="info_Currency"
|
|
|
|
|
label="Currency:"
|
|
|
|
|
rules={[
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: "Please select Currency type!",
|
|
|
|
|
},
|
|
|
|
|
]}
|
|
|
|
|
>
|
|
|
|
|
<Select
|
|
|
|
|
placeholder="Select Currency type"
|
|
|
|
|
onChange={onCurrencyChange}
|
|
|
|
|
allowClear
|
|
|
|
|
options={bindCurrency()}
|
|
|
|
|
>
|
|
|
|
|
</Select>
|
|
|
|
|
</Form.Item></Col>
|
|
|
|
|
<Col span={8}>
|
|
|
|
|
<Form.Item
|
|
|
|
|
name="info_date"
|
|
|
|
|
label="Due Date: "
|
|
|
|
|
>
|
|
|
|
|
<DatePicker />
|
|
|
|
|
</Form.Item></Col>
|
|
|
|
|
|
|
|
|
|
</Row>
|
|
|
|
|
<Form.Item
|
|
|
|
|
name="info_gmdsn"
|
|
|
|
|
hidden={true}
|
|
|
|
|
>
|
|
|
|
|
<input />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item>
|
|
|
|
|
<Button type="primary" htmlType="submit">
|
|
|
|
|
Submit
|
|
|
|
|
</Button>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<p>Our Finance Dept makes payment during the last week in each month. So due date can only the last day of each month. If there's urgent payment, please contact the travel advisor and send invoice separately.</p>
|
|
|
|
|
</Form>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={4}></Col>
|
|
|
|
|
</Row>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
return submitForm;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
|
|
|
|
|
<Space direction="vertical" style={{ width: "100%" }}>
|
|
|
|
|
<Row gutter={16}>
|
|
|
|
|
<Col span={20}>
|
|
|
|
|
<Title level={4}>Reference Number: {invoiceGroupInfo.VGroupInfo}</Title>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={4}>
|
|
|
|
|
<Button type="link" onClick={() => navigate("/invoice")}>
|
|
|
|
|
Back
|
|
|
|
|
</Button>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
<Title level={5}></Title>
|
|
|
|
|
{bindSubmitForm()}
|
|
|
|
|
</Space>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//循环生成多次报账信息
|
|
|
|
|
function bindSubmitForm() {
|
|
|
|
|
let submitForm = invoiceZDDetail.map((data, index) => {
|
|
|
|
|
if (data.GMD_Dealed) {
|
|
|
|
|
//已审核的直接显示信息即可,无需表单
|
|
|
|
|
return (
|
|
|
|
|
<Row key={data.GMD_SN} gutter={16} style={{ backgroundColor: "#f6f7f9", width: "100%", padding: "20px 40px" }}>
|
|
|
|
|
<Col span={4}></Col>
|
|
|
|
|
<Col span={18}>
|
|
|
|
|
<Divider orientation="left">Invoice {index + 1}</Divider>
|
|
|
|
|
<Upload
|
|
|
|
|
name="ghhfile"
|
|
|
|
|
accept="image/*"
|
|
|
|
|
multiple={true}
|
|
|
|
|
action={config.HT_HOST + `/service-fileServer/FileUpload?GRI_SN=${GSN}&VEI_SN=${authStore.login.travelAgencyId}&FilePathName=invoice&token=${authStore.login.token}`}
|
|
|
|
|
fileList={invoicePicList[index]}
|
|
|
|
|
listType="picture-card"></Upload>
|
|
|
|
|
<Descriptions title={"Detail"}>
|
|
|
|
|
<Descriptions.Item label="Amount">{data.GMD_Cost}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="Currency">{data.GMD_Currency}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="Due Dat">{data.GMD_PayDate}</Descriptions.Item>
|
|
|
|
|
</Descriptions>
|
|
|
|
|
|
|
|
|
|
{addButton(index + 1 == invoiceZDDetail.length)}
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={4}></Col>
|
|
|
|
|
</Row>
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
// 一个团只能有一个未审核的账单记录
|
|
|
|
|
return (
|
|
|
|
|
<Row key={data.GMD_SN} gutter={16} style={{ backgroundColor: "#f6f7f9", width: "100%", padding: "20px 40px" }}>
|
|
|
|
|
<Col span={4}></Col>
|
|
|
|
|
<Col span={18}>
|
|
|
|
|
<Form name="invoice_submit" onFinish={onFinish} labelCol={{ span: 5 }} form={form} style={{ backgroundColor: "#fff", padding: "20px" }}>
|
|
|
|
|
<Divider orientation="left">Invoice {index + 1}</Divider>
|
|
|
|
|
<Form.Item>
|
|
|
|
|
<Upload
|
|
|
|
|
name="ghhfile"
|
|
|
|
|
accept="image/*"
|
|
|
|
|
multiple={true}
|
|
|
|
|
action={config.HT_HOST + `/service-fileServer/FileUpload?GRI_SN=${GSN}&VEI_SN=${authStore.login.travelAgencyId}&FilePathName=invoice&token=${authStore.login.token}`}
|
|
|
|
|
fileList={fileList}
|
|
|
|
|
listType="picture-card"
|
|
|
|
|
onChange={handleChange}
|
|
|
|
|
onRemove={handRemove}>
|
|
|
|
|
<div>
|
|
|
|
|
<PlusOutlined />
|
|
|
|
|
<div style={{ marginTop: 8 }}>Click to Upload</div>
|
|
|
|
|
</div>
|
|
|
|
|
</Upload>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Divider orientation="left">Details</Divider>
|
|
|
|
|
<Row gutter={16}>
|
|
|
|
|
<Col span={8}>
|
|
|
|
|
{" "}
|
|
|
|
|
<Form.Item
|
|
|
|
|
name="info_money"
|
|
|
|
|
label="Amount:"
|
|
|
|
|
rules={[
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: "Please input your money!",
|
|
|
|
|
},
|
|
|
|
|
]}>
|
|
|
|
|
<Input />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={8}>
|
|
|
|
|
<Form.Item
|
|
|
|
|
name="info_Currency"
|
|
|
|
|
label="Currency:"
|
|
|
|
|
rules={[
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: "Please select Currency type!",
|
|
|
|
|
},
|
|
|
|
|
]}>
|
|
|
|
|
<Select placeholder="Select Currency type" onChange={onCurrencyChange} options={bindCurrency()}></Select>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={8}>
|
|
|
|
|
<Form.Item name="info_date" label="Due Date: ">
|
|
|
|
|
<DatePicker />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
<Form.Item name="info_gmdsn" hidden={true}>
|
|
|
|
|
<input />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item>
|
|
|
|
|
<Button type="primary" htmlType="submit">
|
|
|
|
|
Submit
|
|
|
|
|
</Button>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<p>
|
|
|
|
|
Our Finance Dept makes payment during the last week in each month. So due date can only the last day of each month. If there's urgent payment, please contact the travel advisor and send invoice
|
|
|
|
|
separately.
|
|
|
|
|
</p>
|
|
|
|
|
</Form>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={4}></Col>
|
|
|
|
|
</Row>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return submitForm;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<Space direction="vertical" style={{ width: "100%" }}>
|
|
|
|
|
<Row gutter={16}>
|
|
|
|
|
<Col span={20}>
|
|
|
|
|
<Title level={4}>Reference Number: {invoiceGroupInfo.VGroupInfo}</Title>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={4}>
|
|
|
|
|
<Button type="link" onClick={() => navigate("/invoice")}>
|
|
|
|
|
Back
|
|
|
|
|
</Button>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
<Title level={5}></Title>
|
|
|
|
|
{bindSubmitForm()}
|
|
|
|
|
</Space>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default observer(Detail);
|
|
|
|
|