Merge branch 'main' of github.com:hainatravel/GHHub

release
Jimmy Liow 2 years ago
commit 58e6500d12

@ -14,6 +14,7 @@ class Invoice {
invoicekImages = []; //图片列表 invoicekImages = []; //图片列表
invoiceGroupInfo= {}; //账单详细 invoiceGroupInfo= {}; //账单详细
invocieProductList=[];//账单细项 invocieProductList=[];//账单细项
invocieCurrencyList=[];//币种
@ -64,11 +65,13 @@ class Invoice {
}); });
this.invoicePage.total = json.Result[0].TotalCount; this.invoicePage.total = json.Result[0].TotalCount;
}else{
this.invoiceList=[];
this.invoicePage.total=0;
} }
// else{
// this.invoiceList=[];
// this.invoicePage.total=0;
// }
}else{ }else{
throw new Error(json.errmsg + ': ' + json.errcode); throw new Error(json.errmsg + ': ' + json.errcode);
} }
@ -96,6 +99,7 @@ class Invoice {
if(json.errcode==0){ if(json.errcode==0){
this.invoiceGroupInfo = json.GroupInfo[0]; this.invoiceGroupInfo = json.GroupInfo[0];
this.invocieProductList = json.ProductList; this.invocieProductList = json.ProductList;
this.invocieCurrencyList = json.CurrencyList;
}else{ }else{
throw new Error(json.errmsg + ': ' + json.errcode); throw new Error(json.errmsg + ': ' + json.errcode);
} }
@ -114,7 +118,7 @@ class Invoice {
.then(json => { .then(json => {
console.log(json); console.log(json);
runInAction(() => { runInAction(() => {
this.feedbackImages = json.result.map((data, index) => { this.invoicekImages = json.result.map((data, index) => {
return { return {
uid: -index, //用负数,防止添加删除的时候错误 uid: -index, //用负数,防止添加删除的时候错误
name: data.file_name, name: data.file_name,
@ -130,6 +134,21 @@ class Invoice {
} }
removeFeedbackImages(fileurl) {
let url = `/service-fileServer/FileDelete`;
url += `?fileurl=${fileurl}`;
return fetch(config.HT_HOST + url)
.then(response => response.json())
.then(json => {
console.log(json);
return json.Result;
})
.catch(error => {
console.log("fetch data failed", error);
});
}
invoicePage = { invoicePage = {
current:1, current:1,
size:10, size:10,

@ -2,7 +2,7 @@ import { useParams, useNavigate } from "react-router-dom";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { observer } from "mobx-react"; import { observer } from "mobx-react";
import { toJS, runInAction } from "mobx"; import { toJS, runInAction } from "mobx";
import { Row, Col, Space, Button, Typography,Card,Form,Upload ,Input,Divider} from "antd"; import { Row, Col, Space, Button, Typography, Card, Form, Upload, Input, Divider, DatePicker, Select } from "antd";
import { useStore } from "@/stores/StoreContext.js"; import { useStore } from "@/stores/StoreContext.js";
import { PlusOutlined } from "@ant-design/icons"; import { PlusOutlined } from "@ant-design/icons";
import * as config from "@/config"; import * as config from "@/config";
@ -12,9 +12,11 @@ function Detail() {
const navigate = useNavigate(); const navigate = useNavigate();
const { GMDSN, GSN } = useParams(); const { GMDSN, GSN } = useParams();
const { invoiceStore, authStore } = useStore(); const { invoiceStore, authStore } = useStore();
const { invoicekImages ,invoiceGroupInfo,invocieProductList} = invoiceStore; const { invoicekImages, invoiceGroupInfo, invocieProductList, invocieCurrencyList } = invoiceStore;
const [form] = Form.useForm(); const [form] = Form.useForm();
const [dataLoading, setDataLoading] = useState(false); const [dataLoading, setDataLoading] = useState(false);
const { formDate, onDateChange } = useState();
const { formCurrency, onCurrencyChange } = useState();
useEffect(() => { useEffect(() => {
@ -37,10 +39,12 @@ function Detail() {
const fileList = toJS(invoicekImages); const fileList = toJS(invoicekImages);
const onFinish = values => { const onFinish = values => {
console.log("Success:", values); const fieldVaule = {
if (values) { ...values,
alert(values); 'info_date': values['info_date'].format('YYYY-MM-DD'),
'info_images': fileList,
} }
console.log("Success:", fieldVaule);
}; };
const handleChange = info => { const handleChange = info => {
console.log(info); console.log(info);
@ -62,6 +66,20 @@ function Detail() {
return true; return true;
}; };
function bindCurrency() {
let arr = [];
arr = invocieCurrencyList.map((data, index) => {
return {
value: data.CRI_Code,
label: data.CRI_Name
};
// (<Option value="data.CRI_Code">data.CRI_Name</Option>);
});
return arr;
}
return ( return (
<Space direction="vertical" style={{ width: "100%" }}> <Space direction="vertical" style={{ width: "100%" }}>
@ -116,24 +134,47 @@ function Detail() {
</Upload> </Upload>
</Form.Item> </Form.Item>
<Divider orientation="left">提交信息</Divider> <Divider orientation="left">提交信息</Divider>
<Form.Item> <Row gutter={16}>
<Input addonBefore="报账总额:" defaultValue="0.00" />
</Form.Item> <Col span={8}> <Form.Item
<Form.Item> name="info_money"
<Input addonBefore="币种选择:" defaultValue="0.00" /> label="报账总额:"
</Form.Item>
<Form.Item
name="info_content"
rules={[ rules={[
{ {
required: true, required: true,
message: "Please input your messages!", message: "Please input your money!",
}, },
]} ]}
> >
<Input defaultValue="0.00" />
</Form.Item></Col>
<Col span={8}><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></Col>
<Col span={8}>
<Form.Item
name="info_date"
label="最迟付款日期: "
>
<DatePicker />
</Form.Item></Col>
<Input addonBefore="付款日期:" defaultValue="0.00" /> </Row>
</Form.Item>
<Form.Item> <Form.Item>
<Button type="primary" htmlType="submit"> <Button type="primary" htmlType="submit">
Submit Submit

Loading…
Cancel
Save