|
|
@ -35,44 +35,47 @@ function Detail() {
|
|
|
|
.fetchInvoiceDetail(GMDSN, GSN)
|
|
|
|
.fetchInvoiceDetail(GMDSN, GSN)
|
|
|
|
.then(json => {
|
|
|
|
.then(json => {
|
|
|
|
let ZDDetail = json.ZDDetail;
|
|
|
|
let ZDDetail = json.ZDDetail;
|
|
|
|
let arrLen = ZDDetail.length;
|
|
|
|
|
|
|
|
const formData = ZDDetail.map((data, index) => {
|
|
|
|
|
|
|
|
if (data.GMD_Dealed == false && arrLen == index + 1) {
|
|
|
|
|
|
|
|
//只有最后一条账单未审核通过才显示
|
|
|
|
|
|
|
|
runInAction(() => {
|
|
|
|
|
|
|
|
invoiceStore.invoiceFormData = { info_money: data.GMD_Cost, info_Currency: data.GMD_Currency, info_date: isNotEmpty(data.GMD_PayDate) ? dayjs(data.GMD_PayDate) : "", info_gmdsn: data.GMD_SN };
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
return { info_money: data.GMD_Cost, info_Currency: data.GMD_Currency, info_date: isNotEmpty(data.GMD_PayDate) ? dayjs(data.GMD_PayDate) : "", info_gmdsn: data.GMD_SN };
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (form) {
|
|
|
|
if (isNotEmpty(ZDDetail)){
|
|
|
|
form.setFieldsValue(formData[arrLen - 1]); //{'info_money':'111','info_Currency':'THB','info_date':''}
|
|
|
|
let arrLen = ZDDetail.length;
|
|
|
|
}
|
|
|
|
const formData = ZDDetail.map((data, index) => {
|
|
|
|
|
|
|
|
if (data.GMD_Dealed == false && arrLen == index + 1) {
|
|
|
|
|
|
|
|
//只有最后一条账单未审核通过才显示
|
|
|
|
|
|
|
|
runInAction(() => {
|
|
|
|
|
|
|
|
invoiceStore.invoiceFormData = { info_money: data.GMD_Cost, info_Currency: data.GMD_Currency, info_date: isNotEmpty(data.GMD_PayDate) ? dayjs(data.GMD_PayDate) : "", info_gmdsn: data.GMD_SN };
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
return { info_money: data.GMD_Cost, info_Currency: data.GMD_Currency, info_date: isNotEmpty(data.GMD_PayDate) ? dayjs(data.GMD_PayDate) : "", info_gmdsn: data.GMD_SN };
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
//图片列表
|
|
|
|
if (form) {
|
|
|
|
let arrPicList = ZDDetail.map((data, index) => {
|
|
|
|
form.setFieldsValue(formData[arrLen - 1]); //{'info_money':'111','info_Currency':'THB','info_date':''}
|
|
|
|
const GMD_Pic = data.GMD_Pic;
|
|
|
|
|
|
|
|
let picList = [];
|
|
|
|
|
|
|
|
if (isNotEmpty(GMD_Pic)) {
|
|
|
|
|
|
|
|
let js_Pic = JSON.parse(GMD_Pic);
|
|
|
|
|
|
|
|
picList = js_Pic.map((picData, pic_Index) => {
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
uid: -pic_Index, //用负数,防止添加删除的时候错误
|
|
|
|
|
|
|
|
name: "",
|
|
|
|
|
|
|
|
status: "done",
|
|
|
|
|
|
|
|
url: picData.url,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (data.GMD_Dealed == false && arrLen == index + 1) {
|
|
|
|
|
|
|
|
runInAction(() => {
|
|
|
|
|
|
|
|
invoiceStore.invoicekImages = picList;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return picList;
|
|
|
|
|
|
|
|
});
|
|
|
|
//图片列表
|
|
|
|
setInvoicePicList(arrPicList);
|
|
|
|
let arrPicList = ZDDetail.map((data, index) => {
|
|
|
|
|
|
|
|
const GMD_Pic = data.GMD_Pic;
|
|
|
|
|
|
|
|
let picList = [];
|
|
|
|
|
|
|
|
if (isNotEmpty(GMD_Pic)) {
|
|
|
|
|
|
|
|
let js_Pic = JSON.parse(GMD_Pic);
|
|
|
|
|
|
|
|
picList = js_Pic.map((picData, pic_Index) => {
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
uid: -pic_Index, //用负数,防止添加删除的时候错误
|
|
|
|
|
|
|
|
name: "",
|
|
|
|
|
|
|
|
status: "done",
|
|
|
|
|
|
|
|
url: picData.url,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (data.GMD_Dealed == false && arrLen == index + 1) {
|
|
|
|
|
|
|
|
runInAction(() => {
|
|
|
|
|
|
|
|
invoiceStore.invoicekImages = picList;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return picList;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
setInvoicePicList(arrPicList);
|
|
|
|
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.catch(ex => {
|
|
|
|
.catch(ex => {
|
|
|
|
notification.error({
|
|
|
|
notification.error({
|
|
|
@ -181,113 +184,122 @@ function Detail() {
|
|
|
|
|
|
|
|
|
|
|
|
//循环生成多次报账信息
|
|
|
|
//循环生成多次报账信息
|
|
|
|
function bindSubmitForm() {
|
|
|
|
function bindSubmitForm() {
|
|
|
|
let submitForm = invoiceZDDetail.map((data, index) => {
|
|
|
|
if (isNotEmpty(invoiceZDDetail)){
|
|
|
|
if (data.GMD_Dealed) {
|
|
|
|
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" }}>
|
|
|
|
return (
|
|
|
|
<Col span={4}></Col>
|
|
|
|
<Row key={data.GMD_SN} gutter={16} style={{ backgroundColor: "#f6f7f9", width: "100%", padding: "20px 40px" }}>
|
|
|
|
<Col span={18}>
|
|
|
|
<Col span={4}></Col>
|
|
|
|
<Descriptions column={4} title={"Invoice " + index + 1}>
|
|
|
|
<Col span={18}>
|
|
|
|
<Descriptions.Item span={4}>
|
|
|
|
<Descriptions column={4} title={"Invoice " + index + 1}>
|
|
|
|
<Upload
|
|
|
|
<Descriptions.Item span={4}>
|
|
|
|
name="ghhfile"
|
|
|
|
<Upload
|
|
|
|
accept="image/*"
|
|
|
|
name="ghhfile"
|
|
|
|
multiple={true}
|
|
|
|
// accept="image/*" 不限制类型
|
|
|
|
action={config.HT_HOST + `/service-fileServer/FileUpload?GRI_SN=${GSN}&VEI_SN=${authStore.login.travelAgencyId}&FilePathName=invoice&token=${authStore.login.token}`}
|
|
|
|
multiple={true}
|
|
|
|
fileList={invoicePicList[index]}
|
|
|
|
action={config.HT_HOST + `/service-fileServer/FileUpload?GRI_SN=${GSN}&VEI_SN=${authStore.login.travelAgencyId}&FilePathName=invoice&token=${authStore.login.token}`}
|
|
|
|
listType="picture-card"></Upload>
|
|
|
|
fileList={invoicePicList[index]}
|
|
|
|
</Descriptions.Item>
|
|
|
|
listType="picture-card"></Upload>
|
|
|
|
<Descriptions.Item label="Amount">{data.GMD_Cost}</Descriptions.Item>
|
|
|
|
</Descriptions.Item>
|
|
|
|
<Descriptions.Item label="Currency">{data.GMD_Currency}</Descriptions.Item>
|
|
|
|
<Descriptions.Item label="Amount">{data.GMD_Cost}</Descriptions.Item>
|
|
|
|
<Descriptions.Item label="Due Dat">{data.GMD_PayDate}</Descriptions.Item>
|
|
|
|
<Descriptions.Item label="Currency">{data.GMD_Currency}</Descriptions.Item>
|
|
|
|
<Descriptions.Item label="Status">{invoiceStore.invoiceStatus(data.FKState)}</Descriptions.Item>
|
|
|
|
<Descriptions.Item label="Due Dat">{data.GMD_PayDate}</Descriptions.Item>
|
|
|
|
</Descriptions>
|
|
|
|
<Descriptions.Item label="Status">{invoiceStore.invoiceStatus(data.FKState)}</Descriptions.Item>
|
|
|
|
|
|
|
|
</Descriptions>
|
|
|
|
|
|
|
|
|
|
|
|
{addButton(index + 1 == invoiceZDDetail.length)}
|
|
|
|
{addButton(index + 1 == invoiceZDDetail.length)}
|
|
|
|
</Col>
|
|
|
|
</Col>
|
|
|
|
<Col span={4}></Col>
|
|
|
|
<Col span={4}></Col>
|
|
|
|
</Row>
|
|
|
|
</Row>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// 一个团只能有一个未审核的账单记录
|
|
|
|
// 一个团只能有一个未审核的账单记录
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<Row key={data.GMD_SN} gutter={16} style={{ backgroundColor: "#f6f7f9", width: "100%", padding: "20px 40px" }}>
|
|
|
|
<Row key={data.GMD_SN} gutter={16} style={{ backgroundColor: "#f6f7f9", width: "100%", padding: "20px 40px" }}>
|
|
|
|
<Col span={4}></Col>
|
|
|
|
<Col span={4}></Col>
|
|
|
|
<Col span={18}>
|
|
|
|
<Col span={18}>
|
|
|
|
<Form name="invoice_submit" onFinish={onFinish} labelCol={{ span: 5 }} form={form} style={{ backgroundColor: "#fff", padding: "20px" }}>
|
|
|
|
<Form name="invoice_submit" onFinish={onFinish} labelCol={{ span: 5 }} form={form} style={{ backgroundColor: "#fff", padding: "20px" }}>
|
|
|
|
<Divider orientation="left">Invoice {index + 1}</Divider>
|
|
|
|
<Divider orientation="left">Invoice {index + 1}</Divider>
|
|
|
|
<Form.Item>
|
|
|
|
<Form.Item>
|
|
|
|
<Upload
|
|
|
|
<Upload
|
|
|
|
name="ghhfile"
|
|
|
|
name="ghhfile"
|
|
|
|
accept="image/*"
|
|
|
|
multiple={true}
|
|
|
|
multiple={true}
|
|
|
|
action={config.HT_HOST + `/service-fileServer/FileUpload?GRI_SN=${GSN}&VEI_SN=${authStore.login.travelAgencyId}&FilePathName=invoice&token=${authStore.login.token}`}
|
|
|
|
action={config.HT_HOST + `/service-fileServer/FileUpload?GRI_SN=${GSN}&VEI_SN=${authStore.login.travelAgencyId}&FilePathName=invoice&token=${authStore.login.token}`}
|
|
|
|
fileList={fileList}
|
|
|
|
fileList={fileList}
|
|
|
|
listType="picture-card"
|
|
|
|
listType="picture-card"
|
|
|
|
onChange={handleChange}
|
|
|
|
onChange={handleChange}
|
|
|
|
onRemove={handRemove}>
|
|
|
|
onRemove={handRemove}>
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<PlusOutlined />
|
|
|
|
<PlusOutlined />
|
|
|
|
<div style={{ marginTop: 8 }}>Click to Upload</div>
|
|
|
|
<div style={{ marginTop: 8 }}>Click to Upload</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</Upload>
|
|
|
|
</Upload>
|
|
|
|
</Form.Item>
|
|
|
|
</Form.Item>
|
|
|
|
<Divider orientation="left">Details</Divider>
|
|
|
|
<Divider orientation="left">Details</Divider>
|
|
|
|
<Row gutter={16}>
|
|
|
|
<Row gutter={16}>
|
|
|
|
<Col span={8}>
|
|
|
|
<Col span={8}>
|
|
|
|
{" "}
|
|
|
|
{" "}
|
|
|
|
<Form.Item
|
|
|
|
<Form.Item
|
|
|
|
name="info_money"
|
|
|
|
name="info_money"
|
|
|
|
label="Amount:"
|
|
|
|
label="Amount:"
|
|
|
|
rules={[
|
|
|
|
rules={[
|
|
|
|
{
|
|
|
|
{
|
|
|
|
required: true,
|
|
|
|
required: true,
|
|
|
|
message: "Please input your money!",
|
|
|
|
message: "Please input your money!",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]}>
|
|
|
|
]}>
|
|
|
|
<Input />
|
|
|
|
<Input />
|
|
|
|
</Form.Item>
|
|
|
|
</Form.Item>
|
|
|
|
</Col>
|
|
|
|
</Col>
|
|
|
|
<Col span={8}>
|
|
|
|
<Col span={8}>
|
|
|
|
<Form.Item
|
|
|
|
<Form.Item
|
|
|
|
name="info_Currency"
|
|
|
|
name="info_Currency"
|
|
|
|
label="Currency:"
|
|
|
|
label="Currency:"
|
|
|
|
rules={[
|
|
|
|
rules={[
|
|
|
|
{
|
|
|
|
{
|
|
|
|
required: true,
|
|
|
|
required: true,
|
|
|
|
message: "Please select Currency type!",
|
|
|
|
message: "Please select Currency type!",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]}>
|
|
|
|
]}>
|
|
|
|
<Select placeholder="Select Currency type" onChange={onCurrencyChange} options={bindCurrency()}></Select>
|
|
|
|
<Select placeholder="Select Currency type" onChange={onCurrencyChange} options={bindCurrency()}></Select>
|
|
|
|
</Form.Item>
|
|
|
|
</Form.Item>
|
|
|
|
</Col>
|
|
|
|
</Col>
|
|
|
|
<Col span={8}>
|
|
|
|
<Col span={8}>
|
|
|
|
<Form.Item name="info_date" label="Due Date: ">
|
|
|
|
<Form.Item name="info_date" label="Due Date: ">
|
|
|
|
<DatePicker />
|
|
|
|
<DatePicker />
|
|
|
|
</Form.Item>
|
|
|
|
</Form.Item>
|
|
|
|
</Col>
|
|
|
|
</Col>
|
|
|
|
</Row>
|
|
|
|
</Row>
|
|
|
|
<Form.Item name="info_gmdsn" hidden={true}>
|
|
|
|
<Form.Item name="info_gmdsn" hidden={true}>
|
|
|
|
<input />
|
|
|
|
<input />
|
|
|
|
</Form.Item>
|
|
|
|
</Form.Item>
|
|
|
|
<Form.Item>
|
|
|
|
<Form.Item>
|
|
|
|
<Button type="primary" htmlType="submit">
|
|
|
|
<Button type="primary" htmlType="submit">
|
|
|
|
Submit
|
|
|
|
Submit
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
</Form.Item>
|
|
|
|
</Form.Item>
|
|
|
|
</Form>
|
|
|
|
<p>
|
|
|
|
</Col>
|
|
|
|
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
|
|
|
|
<Col span={4}></Col>
|
|
|
|
separately.
|
|
|
|
</Row>
|
|
|
|
</p>
|
|
|
|
);
|
|
|
|
</Form>
|
|
|
|
}
|
|
|
|
</Col>
|
|
|
|
});
|
|
|
|
|
|
|
|
return submitForm;
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
return(
|
|
|
|
|
|
|
|
<Row gutter={16} style={{ backgroundColor: "#f6f7f9", width: "100%", padding: "20px 40px" }}>
|
|
|
|
<Col span={4}></Col>
|
|
|
|
<Col span={4}></Col>
|
|
|
|
|
|
|
|
<Col span={18}>
|
|
|
|
|
|
|
|
{addButton(1==1)}
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
<Col span={4}></Col>
|
|
|
|
</Row>
|
|
|
|
</Row>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
return submitForm;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|