加个加载
This commit is contained in:
@@ -52,6 +52,7 @@
|
||||
style="margin-top: 20px"
|
||||
size="small"
|
||||
border
|
||||
:loading="loading"
|
||||
:columns="columns"
|
||||
:data="pagedData"
|
||||
>
|
||||
@@ -81,13 +82,14 @@ import {
|
||||
dateFormatFull,
|
||||
dateFormat,
|
||||
sortByKey,
|
||||
getMonth
|
||||
getMonth,
|
||||
} from "@/libs/tools";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
PageSizeOpts: [10, 15, 20, 30],
|
||||
pageNo: 1,
|
||||
loading: false,
|
||||
strfilter: "",
|
||||
multiple: false,
|
||||
pageSize: 15,
|
||||
@@ -97,29 +99,25 @@ export default {
|
||||
inv_std: "",
|
||||
po_codes: "",
|
||||
app_codes: "",
|
||||
dates: [getMonth("s",-1),getMonth("e",0)],
|
||||
dates: [getMonth("s", -1), getMonth("e", 0)],
|
||||
dates2: [],
|
||||
},
|
||||
columns: [
|
||||
|
||||
{
|
||||
title: "采购订单号",
|
||||
align: "center",
|
||||
key: "cpoid",
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
title: "订单日期",
|
||||
align: "center",
|
||||
key: "dpodate",
|
||||
|
||||
},
|
||||
{
|
||||
title: "供应商",
|
||||
align: "center",
|
||||
key: "cvenabbname",
|
||||
|
||||
},
|
||||
{
|
||||
title: "存货编码",
|
||||
@@ -132,12 +130,11 @@ export default {
|
||||
key: "cinvname",
|
||||
className: "demo-table-info-new",
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
title: "规格型号",
|
||||
align: "center",
|
||||
key: "cinvstd",
|
||||
|
||||
},
|
||||
{
|
||||
title: "单位",
|
||||
@@ -153,7 +150,6 @@ export default {
|
||||
title: "订单数量",
|
||||
align: "center",
|
||||
key: "iquantity",
|
||||
|
||||
},
|
||||
{
|
||||
title: "合计在途",
|
||||
@@ -180,8 +176,6 @@ export default {
|
||||
align: "center",
|
||||
key: "drequirdate",
|
||||
},
|
||||
|
||||
|
||||
],
|
||||
};
|
||||
},
|
||||
@@ -205,49 +199,55 @@ export default {
|
||||
this.loadData();
|
||||
},
|
||||
async loadData() {
|
||||
let _beginDate = null;
|
||||
let _endDate = null;
|
||||
let _beginDate2 = null;
|
||||
let _endDate2 = null;
|
||||
if (
|
||||
this.filter.dates.length == 2 &&
|
||||
this.filter.dates[0] !== "" &&
|
||||
this.filter.dates[0] !== ""
|
||||
) {
|
||||
_beginDate = this.filter.dates[0];
|
||||
_endDate = this.filter.dates[1];
|
||||
try {
|
||||
let _beginDate = null;
|
||||
let _endDate = null;
|
||||
let _beginDate2 = null;
|
||||
let _endDate2 = null;
|
||||
if (
|
||||
this.filter.dates.length == 2 &&
|
||||
this.filter.dates[0] !== "" &&
|
||||
this.filter.dates[0] !== ""
|
||||
) {
|
||||
_beginDate = this.filter.dates[0];
|
||||
_endDate = this.filter.dates[1];
|
||||
}
|
||||
if (
|
||||
this.filter.dates2.length == 2 &&
|
||||
this.filter.dates2[0] !== "" &&
|
||||
this.filter.dates2[0] !== ""
|
||||
) {
|
||||
_beginDate2 = this.filter.dates2[0];
|
||||
_endDate2 = this.filter.dates2[1];
|
||||
}
|
||||
let _filert = {
|
||||
inv_codes:
|
||||
this.filter.inv_codes !== ""
|
||||
? this.filter.inv_codes.split(/[,\s\n,]/)
|
||||
: null,
|
||||
inv_std: this.filter.inv_std,
|
||||
po_codes:
|
||||
this.filter.po_codes !== ""
|
||||
? this.filter.po_codes.split(/[,\s\n,]/)
|
||||
: null,
|
||||
app_codes:
|
||||
this.filter.app_codes !== ""
|
||||
? this.filter.app_codes.split(/[,\s\n,]/)
|
||||
: null,
|
||||
begin_date: _beginDate,
|
||||
end_date: _endDate,
|
||||
begin_date2: _beginDate2,
|
||||
end_date2: _endDate2,
|
||||
};
|
||||
this.loading = true;
|
||||
let resp = await getInventorypo(_filert);
|
||||
this.pageNo = 1;
|
||||
this.datas = resp.data.data;
|
||||
this.datas = sortByKey(resp.data.data, "cpoid");
|
||||
} catch (error) {
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
if (
|
||||
this.filter.dates2.length == 2 &&
|
||||
this.filter.dates2[0] !== "" &&
|
||||
this.filter.dates2[0] !== ""
|
||||
) {
|
||||
_beginDate2 = this.filter.dates2[0];
|
||||
_endDate2 = this.filter.dates2[1];
|
||||
}
|
||||
let _filert = {
|
||||
inv_codes:
|
||||
this.filter.inv_codes !== ""
|
||||
? this.filter.inv_codes.split(/[,\s\n,]/)
|
||||
: null,
|
||||
inv_std: this.filter.inv_std,
|
||||
po_codes:
|
||||
this.filter.po_codes !== ""
|
||||
? this.filter.po_codes.split(/[,\s\n,]/)
|
||||
: null,
|
||||
app_codes:
|
||||
this.filter.app_codes !== ""
|
||||
? this.filter.app_codes.split(/[,\s\n,]/)
|
||||
: null,
|
||||
begin_date: _beginDate,
|
||||
end_date: _endDate,
|
||||
begin_date2: _beginDate2,
|
||||
end_date2: _endDate2,
|
||||
};
|
||||
let resp = await getInventorypo(_filert);
|
||||
this.pageNo = 1;
|
||||
this.datas = resp.data.data;
|
||||
this.datas = sortByKey(resp.data.data, "cpoid");
|
||||
},
|
||||
|
||||
handlePagechange(page) {
|
||||
|
||||
Reference in New Issue
Block a user