统一查询栏目。修改账单查询

release
YCC 2 years ago
parent e1c5245cb9
commit a57a874d86

@ -11,7 +11,7 @@ class Feedback {
} }
loading = false; loading = false;
search_date_start = dayjs().startOf("M"); search_date_start = dayjs().subtract(2, "M").startOf("M");
search_date_end = dayjs().endOf("M"); search_date_end = dayjs().endOf("M");
feedbackList = []; //反馈列表 feedbackList = []; //反馈列表
feedbackImages = []; //图片列表 feedbackImages = []; //图片列表

@ -1,6 +1,6 @@
import { makeAutoObservable, runInAction } from "mobx"; import { makeAutoObservable, runInAction } from "mobx";
import { fetchJSON, postForm } from "@/utils/request"; import { fetchJSON, postForm } from "@/utils/request";
import { prepareUrl,isNotEmpty } from '@/utils/commons'; import { prepareUrl, isNotEmpty } from "@/utils/commons";
import { HT_HOST } from "@/config"; import { HT_HOST } from "@/config";
import { json } from "react-router-dom"; import { json } from "react-router-dom";
import * as config from "@/config"; import * as config from "@/config";
@ -18,34 +18,40 @@ class Invoice {
invoiceProductList = []; //账单细项 invoiceProductList = []; //账单细项
invoiceZDDetail = []; //报账信息 invoiceZDDetail = []; //报账信息
invoiceCurrencyList = []; //币种 invoiceCurrencyList = []; //币种
invoicePicList = [] //多账单图片列表数组 invoicePicList = []; //多账单图片列表数组
invoiceFormData = {'info_money':0,'info_Currency':'','info_date':''}; //存储form数据 invoiceFormData = { info_money: 0, info_Currency: "", info_date: "" }; //存储form数据
loading = false;
search_date_start = dayjs().subtract(2, "M").startOf("M");
search_date_end = dayjs().endOf("M");
onDateRangeChange = dates => {
console.log(dates);
this.search_date_start = dates[0];
this.search_date_end = dates[1];
};
fetchInvoiceList(current,OrderType,GroupNo,DateStart,DateEnd,Orderbytype){ fetchInvoiceList(VEI_SN, GroupNo, DateStart, DateEnd) {
this.invoicePage.current=current; this.loading = true;
const totalNum = current == 1 ? 0 : this.invoicePage.total; const fetchUrl = prepareUrl(HT_HOST + "/service-cusservice/PTSearchGMBPageList")
//组合param .append("VEI_SN", VEI_SN)
const fetchUrl = prepareUrl(HT_HOST + '/service-cusservice/PTSearchGMBPageList') .append("OrderType", 0)
.append('VEI_SN', this.root.authStore.login.travelAgencyId) // .append("GroupNo", GroupNo)
.append('OrderType',OrderType) .append("DateStart", DateStart)
.append('GroupNo',GroupNo) .append("DateEnd", DateEnd)
.append('DateStart',DateStart) .append("Orderbytype", 1)
.append('DateEnd',DateEnd) .append("TimeType", 0)
.append('Orderbytype',Orderbytype) .append("limitmarket", "")
.append('TimeType',0) .append("mddgroup", "")
.append('limitmarket',"") .append("SecuryGroup", "")
.append('mddgroup',"") .append("TotalNum", 0)
.append('SecuryGroup',"") .append("PageSize", 2000)
.append('TotalNum', totalNum) .append("PageIndex", 1)
.append('PageSize', this.invoicePage.size)
.append('PageIndex', this.invoicePage.current)
.build(); .build();
return fetchJSON(fetchUrl) return fetchJSON(fetchUrl).then(json => {
.then(json => {
runInAction(() => { runInAction(() => {
this.loading = false;
if (json.errcode == 0) { if (json.errcode == 0) {
if (isNotEmpty(json.Result)) { if (isNotEmpty(json.Result)) {
this.invoiceList = json.Result.map((data, index) => { this.invoiceList = json.Result.map((data, index) => {
@ -65,9 +71,8 @@ class Invoice {
AllMoney: data.AllMoney, AllMoney: data.AllMoney,
PersonNum: data.PersonNum, PersonNum: data.PersonNum,
VName: data.VName, VName: data.VName,
FKState:data.FKState FKState: data.FKState,
} };
}); });
this.invoicePage.total = json.Result[0].TotalCount; this.invoicePage.total = json.Result[0].TotalCount;
} }
@ -76,30 +81,23 @@ class Invoice {
// this.invoiceList=[]; // this.invoiceList=[];
// this.invoicePage.total=0; // this.invoicePage.total=0;
// } // }
} else { } else {
throw new Error(json.errmsg + ': ' + json.errcode); throw new Error(json.errmsg + ": " + json.errcode);
} }
}); });
}); });
} }
fetchInvoiceDetail(GMDSN, GSN) { fetchInvoiceDetail(GMDSN, GSN) {
const fetchUrl = prepareUrl(HT_HOST + '/service-cusservice/PTGetZDDetail') const fetchUrl = prepareUrl(HT_HOST + "/service-cusservice/PTGetZDDetail")
.append('VEI_SN', this.root.authStore.login.travelAgencyId) // .append("VEI_SN", this.root.authStore.login.travelAgencyId)
.append('GRI_SN',GSN) .append("GRI_SN", GSN)
.append('GMD_SN',GMDSN) .append("GMD_SN", GMDSN)
.append('LGC',1) .append("LGC", 1)
.append('Bill',1) .append("Bill", 1)
.build(); .build();
return fetchJSON(fetchUrl) return fetchJSON(fetchUrl).then(json => {
.then(json=>{
runInAction(() => { runInAction(() => {
if (json.errcode == 0) { if (json.errcode == 0) {
this.invoiceGroupInfo = json.GroupInfo[0]; this.invoiceGroupInfo = json.GroupInfo[0];
@ -107,15 +105,13 @@ class Invoice {
this.invoiceCurrencyList = json.CurrencyList; this.invoiceCurrencyList = json.CurrencyList;
this.invoiceZDDetail = json.ZDDetail; this.invoiceZDDetail = json.ZDDetail;
} else { } else {
throw new Error(json.errmsg + ': ' + json.errcode); throw new Error(json.errmsg + ": " + json.errcode);
} }
}) });
return json; return json;
}); });
} }
//获取供应商提交的图片 //获取供应商提交的图片
getInvoicekImages(VEI_SN, GRI_SN) { getInvoicekImages(VEI_SN, GRI_SN) {
let url = `/service-fileServer/ListFile`; let url = `/service-fileServer/ListFile`;
@ -147,43 +143,40 @@ class Invoice {
const GMD_Pic = data.GMD_Pic; const GMD_Pic = data.GMD_Pic;
let picList = []; let picList = [];
if (isNotEmpty(GMD_Pic)) { if (isNotEmpty(GMD_Pic)) {
let js_Pic = JSON.parse(GMD_Pic) let js_Pic = JSON.parse(GMD_Pic);
picList = js_Pic.map((picData, pic_Index) => { picList = js_Pic.map((picData, pic_Index) => {
return { return {
uid: -pic_Index, //用负数,防止添加删除的时候错误 uid: -pic_Index, //用负数,防止添加删除的时候错误
name: '', name: "",
status: "done", status: "done",
url: picData.url, url: picData.url,
} };
}); });
} }
if (data.GMD_Dealed == false && arrLen == (index+1)){ if (data.GMD_Dealed == false && arrLen == index + 1) {
this.invoicekImages = picList; this.invoicekImages = picList;
} }
return picList; return picList;
});
})
runInAction(() => { runInAction(() => {
this.invoicePicList = arrPicList; this.invoicePicList = arrPicList;
}); });
} }
//获取数据库的表单默认数据回填。 //获取数据库的表单默认数据回填。
getFormData(jsonData) { getFormData(jsonData) {
let arrLen = jsonData.length; let arrLen = jsonData.length;
return jsonData.map((data, index) => { return jsonData.map((data, index) => {
if (data.GMD_Dealed == false && arrLen == (index+1)){ //只有最后一条账单未审核通过才显示 if (data.GMD_Dealed == false && arrLen == index + 1) {
//只有最后一条账单未审核通过才显示
runInAction(() => { runInAction(() => {
this.invoiceFormData = {'info_money':data.GMD_Cost,'info_Currency':data.GMD_Currency,'info_date':isNotEmpty(data.GMD_PayDate)?dayjs(data.GMD_PayDate):''}; this.invoiceFormData = { info_money: data.GMD_Cost, info_Currency: data.GMD_Currency, info_date: isNotEmpty(data.GMD_PayDate) ? dayjs(data.GMD_PayDate) : "" };
}); });
} }
}); });
} }
removeFeedbackImages(fileurl) { removeFeedbackImages(fileurl) {
let url = `/service-fileServer/FileDelete`; let url = `/service-fileServer/FileDelete`;
url += `?fileurl=${fileurl}`; url += `?fileurl=${fileurl}`;
@ -198,78 +191,68 @@ class Invoice {
}); });
} }
postEditInvoiceDetail(GMD_SN, Currency, Cost, PayDate, Pic, Memo) { postEditInvoiceDetail(GMD_SN, Currency, Cost, PayDate, Pic, Memo) {
let postUrl = HT_HOST + '/service-cusservice/EditSupplierFK'; let postUrl = HT_HOST + "/service-cusservice/EditSupplierFK";
let formData = new FormData(); let formData = new FormData();
formData.append('LMI_SN', this.root.authStore.login.userId); formData.append("LMI_SN", this.root.authStore.login.userId);
formData.append('GMD_SN', GMD_SN); formData.append("GMD_SN", GMD_SN);
formData.append('Currency', Currency); formData.append("Currency", Currency);
formData.append('Cost', Cost); formData.append("Cost", Cost);
formData.append('PayDate', isNotEmpty(PayDate)?PayDate:'' ); formData.append("PayDate", isNotEmpty(PayDate) ? PayDate : "");
formData.append('Pic', Pic); formData.append("Pic", Pic);
formData.append('Memo', Memo); formData.append("Memo", Memo);
return postForm(postUrl,formData) return postForm(postUrl, formData).then(json => {
.then(json=>{
console.info(json); console.info(json);
return json; return json;
}); });
} }
postAddInvoice(GRI_SN, Currency, Cost, PayDate, Pic, Memo) { postAddInvoice(GRI_SN, Currency, Cost, PayDate, Pic, Memo) {
let postUrl = HT_HOST + '/service-cusservice/AddSupplierFK'; let postUrl = HT_HOST + "/service-cusservice/AddSupplierFK";
let formData = new FormData(); let formData = new FormData();
formData.append('LMI_SN', this.root.authStore.login.userId); formData.append("LMI_SN", this.root.authStore.login.userId);
formData.append('VEI_SN', this.root.authStore.login.travelAgencyId); formData.append("VEI_SN", this.root.authStore.login.travelAgencyId);
formData.append('GRI_SN', GRI_SN); formData.append("GRI_SN", GRI_SN);
formData.append('Currency', Currency); formData.append("Currency", Currency);
formData.append('Cost', Cost); formData.append("Cost", Cost);
formData.append('PayDate', isNotEmpty(PayDate)?PayDate:'' ); formData.append("PayDate", isNotEmpty(PayDate) ? PayDate : "");
formData.append('Pic', Pic); formData.append("Pic", Pic);
formData.append('Memo', Memo); formData.append("Memo", Memo);
return postForm(postUrl,formData) return postForm(postUrl, formData).then(json => {
.then(json=>{
console.info(json); console.info(json);
return json; return json;
}); });
} }
invoicePage = { invoicePage = {
current: 1, current: 1,
size: 10, size: 10,
total:0 total: 0,
} };
/* 测试数据 */ /* 测试数据 */
//账单列表范例数据 //账单列表范例数据
testData= testData = [
[
{ {
"GSMSN":449865, GSMSN: 449865,
"gmd_gri_sn":334233, gmd_gri_sn: 334233,
"gmd_vei_sn":628, gmd_vei_sn: 628,
"GetDate":"2023-04-2 00:33:33", GetDate: "2023-04-2 00:33:33",
"GMD_FillWorkers_SN":8617, GMD_FillWorkers_SN: 8617,
"GMD_FWks_LastEditTime":"2023-04-26 12:33:33", GMD_FWks_LastEditTime: "2023-04-26 12:33:33",
"GMD_VerifyUser_SN":8928, GMD_VerifyUser_SN: 8928,
"GMD_Dealed":1, GMD_Dealed: 1,
"GMD_VRequestVerify":1, GMD_VRequestVerify: 1,
"TotalCount":22, TotalCount: 22,
"LeftGDate":"2023-03-30 00:00:00", LeftGDate: "2023-03-30 00:00:00",
"GMD_FillWorkers_Name":"", GMD_FillWorkers_Name: "",
"GroupName":" 中华游230501-CA230402033", GroupName: " 中华游230501-CA230402033",
"AllMoney":3539, AllMoney: 3539,
"PersonNum":"1大1小", PersonNum: "1大1小",
"VName":"" VName: "",
} },
] ];
} }
export default Invoice; export default Invoice;

@ -35,7 +35,7 @@ const feedbackListColumns = [
}, },
{ {
title: "External Reviews", title: "External Reviews",
dataIndex: "GriName", dataIndex: "TAGood",
}, },
]; ];
@ -49,12 +49,13 @@ function Index() {
useEffect(() => { useEffect(() => {
feedbackStore.searchFeedbackList(authStore.login.travelAgencyId, referenceNo, search_date_start.format(config.DATE_FORMAT), search_date_end.format(config.DATE_FORMAT) + " 23:59") feedbackStore.searchFeedbackList(authStore.login.travelAgencyId, referenceNo, search_date_start.format(config.DATE_FORMAT), search_date_end.format(config.DATE_FORMAT) + " 23:59")
.catch(ex => { .catch(ex => {
notification.error({ // notification.error({
message: `Error`, // message: `Error`,
description: ex.message, // description: ex.message,
placement: 'top', // placement: 'top',
duration: 4, // duration: 4,
}); // });
console.log(ex.message);
}); });
}, []); }, []);
@ -93,6 +94,7 @@ function Index() {
</Button> </Button>
</Col> </Col>
</Row> </Row>
<Title level={3}></Title>
<Row> <Row>
<Col md={24} lg={24} xxl={12}> <Col md={24} lg={24} xxl={12}>
<Table bordered={true} columns={feedbackListColumns} dataSource={toJS(feedbackList)} pagination={{ defaultPageSize: 20, showTotal: showTotal }} /> <Table bordered={true} columns={feedbackListColumns} dataSource={toJS(feedbackList)} pagination={{ defaultPageSize: 20, showTotal: showTotal }} />

@ -6,69 +6,64 @@ import { Row, Col, Space, Button, Table, Input, DatePicker,Typography,App,Steps
import { useStore } from "@/stores/StoreContext.js"; import { useStore } from "@/stores/StoreContext.js";
import * as config from "@/config"; import * as config from "@/config";
import { formatDate, isNotEmpty } from "@/utils/commons"; import { formatDate, isNotEmpty } from "@/utils/commons";
import { AuditOutlined, SmileOutlined, SolutionOutlined, EditOutlined } from '@ant-design/icons'; import { AuditOutlined, SmileOutlined, SolutionOutlined, EditOutlined } from "@ant-design/icons";
const { Title } = Typography; const { Title } = Typography;
function Index() { function Index() {
const { authStore, invoiceStore } = useStore();
const { invoiceStore } = useStore(); const { invoiceList, invoicePage, search_date_start, search_date_end } = invoiceStore;
const { invoiceList ,invoicePage } = invoiceStore; const [groupNo, onGroupNoChange] = useState("");
const [groupNo, onGroupNoChange] = useState('');
const [arrivalDateRange, onDateRangeChange] = useState([]); const [arrivalDateRange, onDateRangeChange] = useState([]);
const [dataLoading, setDataLoading] = useState(false); const [dataLoading, setDataLoading] = useState(false);
const { notification } = App.useApp(); const { notification } = App.useApp();
const showTotal = total => `Total ${invoiceList.length} items`;
const invoiceListColumns = [ const invoiceListColumns = [
{ {
title: '团名', title: "Ref.No",
dataIndex: 'GroupName', dataIndex: "GroupName",
key: 'GroupName', key: "GroupName",
render: (text, record) => <NavLink to={`/invoice/detail/${record.key}/${record.gmd_gri_sn}`}>{text}</NavLink>,
}, },
{ {
title: '离团时间', title: "离团时间",
dataIndex: 'GetGDate', dataIndex: "GetGDate",
key: 'GetGDate', key: "GetGDate",
render:(text,record) =>formatDate(new Date(text)) render: (text, record) => formatDate(new Date(text)),
}, },
{ {
title: '接团时间', title: "接团时间",
key: 'LeftGDate', key: "LeftGDate",
dataIndex: 'LeftGDate', dataIndex: "LeftGDate",
render:(text,record) => isNotEmpty(text)?formatDate(new Date(text)):"" render: (text, record) => (isNotEmpty(text) ? formatDate(new Date(text)) : ""),
}, },
{ {
title: '人数', title: "人数",
key: 'PersonNum', key: "PersonNum",
dataIndex: 'PersonNum' dataIndex: "PersonNum",
}, },
{ {
title: '团总额', title: "团总额",
key: 'AllMoney', key: "AllMoney",
dataIndex: 'AllMoney' dataIndex: "AllMoney",
}, },
{ {
title: '填表时间', title: "填表时间",
key: 'GMD_FWks_LastEditTime', key: "GMD_FWks_LastEditTime",
dataIndex: 'GMD_FWks_LastEditTime', dataIndex: "GMD_FWks_LastEditTime",
render:(text,record) => isNotEmpty(text)?formatDate(new Date(text)):"" render: (text, record) => (isNotEmpty(text) ? formatDate(new Date(text)) : ""),
}, },
{ {
title: '填表人', title: "填表人",
key: 'GMD_FillWorkers_Name', key: "GMD_FillWorkers_Name",
dataIndex: 'GMD_FillWorkers_Name' dataIndex: "GMD_FillWorkers_Name",
}, },
{ {
title: '账单状态', title: "账单状态",
key: 'status', key: "status",
render:BillStatus render: BillStatus,
}, },
{
title: 'Action',
key: 'action',
render:(text, record) => <NavLink to={`/invoice/detail/${record.key}/${record.gmd_gri_sn}`}>Details</NavLink>,
}
]; ];
function BillStatus(text, record) { function BillStatus(text, record) {
@ -81,96 +76,72 @@ function Index() {
// }else{ // }else{
// return ""; // return "";
// } // }
let FKState = record.FKState-1 let FKState = record.FKState - 1;
return <Steps return (
<Steps
current={FKState} current={FKState}
initial={1} initial={1}
items={[ items={[
{ {
title: '提交', title: "提交",
//status: 'finish', //status: 'finish',
icon: <EditOutlined />, icon: <EditOutlined />,
}, },
{ {
title: '顾问', title: "顾问",
// status: 'finish', // status: 'finish',
icon: <SolutionOutlined />, icon: <SolutionOutlined />,
}, },
{ {
title: '财务', title: "财务",
//status: 'process', //status: 'process',
icon: <AuditOutlined />, icon: <AuditOutlined />,
}, },
{ {
title: 'Done', title: "Done",
//status: 'wait', //status: 'wait',
icon: <SmileOutlined />, icon: <SmileOutlined />,
}, },
]} ]}
/> />
);
}
const onSearchClick = (current = 1) => {
setDataLoading(true);
invoiceStore.fetchInvoiceList(current, 0, groupNo, arrivalDateRange[0], arrivalDateRange[1], 1)
.catch(ex => {
notification.error({
message: `Notification`,
description: ex.message,
placement: 'top',
duration: 4,
});
})
.finally(() => {
setDataLoading(false);
});
} }
return ( return (
<Space direction="vertical" style={{ width: "100%" }}>
<Space direction="vertical" style={{ width: '100%' }}> <Title level={3}></Title>
<Title level={3}>账单管理</Title> <Row gutter={16}>
<Row gutter={{ md: 24 }}> <Col md={24} lg={6} xxl={4}>
<Col span={4}> <Input
<Input placeholder="团名" onChange={(e) => { onGroupNoChange(e.target.value) }} /> placeholder="Reference Number"
onChange={e => {
onGroupNoChange(e.target.value);
}}
/>
</Col> </Col>
<Col span={6}> <Col md={24} lg={8} xxl={6}>
<Space direction="horizontal"> <Space direction="horizontal">
Date Arrival Date
<DatePicker.RangePicker <DatePicker.RangePicker format={config.DATE_FORMAT} allowClear={false} style={{ width: "100%" }} value={[search_date_start, search_date_end]} presets={config.DATE_PRESETS} onChange={invoiceStore.onDateRangeChange} />
allowClear={false}
inputReadOnly={true}
placeholder={['Start', 'End']}
onChange={(date, dateRange) => { onDateRangeChange(dateRange) }}
/>
</Space> </Space>
</Col> </Col>
<Col span={14}> <Col md={24} lg={4} xxl={4}>
<Button type='primary' onClick={() => onSearchClick()} loading={dataLoading}>Search</Button> <Button
type="primary"
loading={invoiceStore.loading}
onClick={() => invoiceStore.fetchInvoiceList(authStore.login.travelAgencyId, groupNo, search_date_start.format(config.DATE_FORMAT), search_date_end.format(config.DATE_FORMAT))}>
Search
</Button>
</Col> </Col>
</Row> </Row>
<Title level={3}></Title>
<Row> <Row>
<Col span={24}> <Col span={24}>
<Table <Table bordered loading={dataLoading} pagination={{ defaultPageSize: 20, showTotal: showTotal }} columns={invoiceListColumns} dataSource={toJS(invoiceList)} />
bordered
loading={dataLoading}
pagination={{
position: ['bottomCenter'],
current: invoicePage.current,
pageSize: invoicePage.size,
total: invoicePage.total,
simple: true
}}
onChange={(pagination, filters, sorter, extra) => {onSearchClick(pagination.current);}}
columns={invoiceListColumns} dataSource={toJS(invoiceList)}
/>
</Col> </Col>
</Row> </Row>
</Space> </Space>
);
)
} }
export default observer(Index); export default observer(Index);

@ -211,6 +211,7 @@ function Newest() {
</Space> </Space>
</Col> </Col>
</Row> </Row>
<Title level={3}></Title>
<Row> <Row>
<Col span={24}> <Col span={24}>
<Table <Table

Loading…
Cancel
Save