release
赵鹏 2 years ago
parent 3ee240a08e
commit 1e8b61fd1c

@ -22,9 +22,6 @@ function Detail() {
const { formCurrency, onCurrencyChange } = useState();
const { notification } = App.useApp();
const [isModalOpen, setIsModalOpen] = useState(false);
const [confirmLoading, setConfirmLoading] = useState(false);
const [invoicePicList,setInvoicePicList] = useState([]);
@ -132,36 +129,6 @@ function Detail() {
};
const onAddFinish = values => {
const fieldVaule = {
...values,
'info_date': isNotEmpty(values['info_date']) ? values['info_date'].format('YYYY-MM-DD') : null,
'info_images': JSON.stringify(arrimg),
}
console.log("Success:", fieldVaule);
//
if (fieldVaule) {
invoiceStore.postAddInvoice(GSN, fieldVaule.info_Currency, fieldVaule.info_money, fieldVaule.info_date, fieldVaule.info_images, "").then((data) => {
console.log("return:",data);
runInAction(() => {
let param = { 'info_money': fieldVaule.info_money, 'info_Currency': fieldVaule.info_Currency, 'info_date': fieldVaule.info_date };
invoiceStore.invoiceFormData = param;
})
if (data.errcode == 0 ){
// notification.success({
// message: `Notification`,
// description: "Success Submit!",
// placement: "top",
// duration: 4,
// });
setIsModalOpen(false);
}
});
}
};
const handleChange = info => {
console.log(info);
@ -198,9 +165,6 @@ function Detail() {
function addInvoice(){
invoiceStore.postAddInvoice(GSN, "", 0, "", "[]", "").then((data) => {
runInAction(() => {
invoiceStore.invoiceFormData = {'info_money':0,'info_Currency':'','info_date':'','info_gmdsn':GMDSN};
});
}).finally(()=>{
defaultShow();
})
@ -244,13 +208,13 @@ function Detail() {
<div style={{ marginTop: 8 }}>Click to Upload</div>
</div>
</Upload>
<Divider orientation="left">提交信息</Divider>
<Divider orientation="left">Details</Divider>
<Row gutter={16}>
<Col span={8}>
<Input addonBefore="报账总额" value={data.GMD_Cost} />
<Input addonBefore="Amount" value={data.GMD_Cost} />
</Col>
<Col span={8}>
金额币种 <Select
Currency <Select
placeholder="Select Currency type"
allowClear
options={bindCurrency()}
@ -259,7 +223,7 @@ function Detail() {
</Select>
</Col>
<Col span={8}>
<Input addonBefore="最迟付款日期:" value={data.GMD_PayDate} />
<Input addonBefore="Due Dat:" value={data.GMD_PayDate} />
</Col>
</Row>
{addButton(index + 1 == invoiceZDDetail.length)}
@ -276,7 +240,7 @@ function Detail() {
<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">上传照片</Divider>
<Divider orientation="left">Upload Invoice</Divider>
<Form.Item>
<Upload
name="ghhfile"
@ -293,12 +257,12 @@ function Detail() {
</div>
</Upload>
</Form.Item>
<Divider orientation="left">提交信息</Divider>
<Divider orientation="left">Details</Divider>
<Row gutter={16}>
<Col span={8}> <Form.Item
name="info_money"
label="报账总额"
label="Amount"
rules={[
{
required: true,
@ -310,7 +274,7 @@ function Detail() {
</Form.Item></Col>
<Col span={8}><Form.Item
name="info_Currency"
label="金额币种"
label="Currency"
rules={[
{
required: true,
@ -329,7 +293,7 @@ function Detail() {
<Col span={8}>
<Form.Item
name="info_date"
label="最迟付款日期: "
label="Due Date: "
>
<DatePicker />
</Form.Item></Col>
@ -358,108 +322,10 @@ function Detail() {
}
//#region Modal
const showConfirmModal = (confirm) => {
setIsModalOpen(true);
};
const fromRef = useRef()
const handleOk = () => {
setConfirmLoading(true);
try{
fromRef.current?.submit();
//onAddFinish;
//setIsModalOpen(false);
} finally{
setConfirmLoading(false);
navigate("/invoice/detail/"+GMDSN+"/"+GSN)
}
};
const handleCancel = () => {
setIsModalOpen(false);
};
//#endregion
return (
<>
{/* <Modal
centered
confirmLoading={confirmLoading}
open={isModalOpen} onOk={handleOk} onCancel={handleCancel}
width={1000}
>
<Title level={4}>Add New Invoice</Title>
<Form name="invoice_add" onFinish={onAddFinish} labelCol={{ span: 5 }} form={form} ref={fromRef}>
<Divider orientation="left">上传照片</Divider>
<Form.Item
labelCol={{
span: 8,
}}
wrapperCol={{
span: 16,
}}
>
<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">提交信息</Divider>
<Form.Item
name="info_money"
label="报账总额:"
rules={[
{
required: true,
message: "Please input your money!",
},
]}
>
<Input />
</Form.Item>
<Form.Item
name="info_Currency"
label="金额币种:"
rules={[
{
required: true,
message: "Please select Currency type!",
},
]}
>
<Select
placeholder="Select Currency type"
onChange={onCurrencyChange}
allowClear
options={bindCurrency()}
>
</Select>
</Form.Item>
<Form.Item
name="info_date"
label="最迟付款日期: "
>
<DatePicker />
</Form.Item>
</Form>
</Modal> */}
<Space direction="vertical" style={{ width: "100%" }}>
<Row gutter={16}>
<Col span={20}>
@ -471,24 +337,6 @@ function Detail() {
</Button>
</Col>
</Row>
<Title level={5}>基础信息</Title>
<Row gutter={16} style={{ backgroundColor: "#f6f7f9", width: "100%", padding: "20px 40px" }} >
<Col span={8}>
<Card title="组 团" bordered={false}>
<p>CHINA HIGHLIGHTS</p>
</Card>
</Col>
<Col span={8}>
<Card title="组团人" bordered={false}>
<p>{invoiceGroupInfo.WLFirstName} {invoiceGroupInfo.WLLastName} &nbsp;&nbsp; Email: {invoiceGroupInfo.WLEmail}</p>
</Card>
</Col>
<Col span={8}>
<Card title="客人国籍" bordered={false}>
<p>{invoiceGroupInfo.County}</p>
</Card>
</Col>
</Row>
<Title level={5}>报账信息</Title>
{bindSubmitForm()}
</Space>

Loading…
Cancel
Save