总结统计-日期改变时调用接口

init
zhusiyu 3 years ago
parent db7b353880
commit 1bcd17b23c

@ -181,7 +181,7 @@
this.spinning = false this.spinning = false
if (result[0].data.code === 2000) { if (result[0].data.code === 2000) {
this.chartsOption = result[0].data.data.option this.chartsOption = result[0].data.data.option
console.log('每日领用对比数据', result[0]) //console.log('', result[0])
this.buildEcharts() this.buildEcharts()
} }
}) })

@ -62,6 +62,7 @@
totalRecordJson: {}, totalRecordJson: {},
spinning: true, spinning: true,
selectTabIndexChild: 1, selectTabIndexChild: 1,
searchTimeData: '',
} }
}, },
watch: { watch: {
@ -81,7 +82,7 @@
searchTime: { searchTime: {
handler(time) { handler(time) {
if (time !== "") { if (time !== "") {
this.searchTime = time; this.searchTimeData = time;
this.getNowTime(); this.getNowTime();
} }
}, },
@ -94,7 +95,10 @@
methods: { methods: {
//- //-
workSummaryDeptOverview() { workSummaryDeptOverview() {
let timeStr = this.searchTime; if (this.searchTimeData == '') {
this.searchTimeData = this.searchTime
}
let timeStr = this.searchTimeData;
if (timeStr !== "") { if (timeStr !== "") {
let startDate = timeStr.split("|")[0]; let startDate = timeStr.split("|")[0];
let endDate = timeStr.split("|")[1]; let endDate = timeStr.split("|")[1];
@ -147,6 +151,9 @@
}, },
//- //-
workSummaryOrgOverview() { workSummaryOrgOverview() {
if (this.searchTimeData == '') {
this.searchTimeData = this.searchTime
}
let timeStr = this.searchTime; let timeStr = this.searchTime;
if (timeStr !== "") { if (timeStr !== "") {
let startDate = timeStr.split("|")[0]; let startDate = timeStr.split("|")[0];
@ -213,7 +220,7 @@
let day = resData.data.day; let day = resData.data.day;
this.begin_date = moment(year + "-" + month + "-01"); this.begin_date = moment(year + "-" + month + "-01");
this.end_date = moment(year + "-" + month + "-" + day); this.end_date = moment(year + "-" + month + "-" + day);
this.searchTime = this.begin_date + "|" + this.end_date; this.searchTimeData = this.begin_date + "|" + this.end_date;
this.workSummaryDeptOverview() this.workSummaryDeptOverview()
this.workSummaryOrgOverview() this.workSummaryOrgOverview()
} }

@ -100,7 +100,7 @@
end_date: "", end_date: "",
totalRecordJson: {}, totalRecordJson: {},
spinning: true, spinning: true,
dataSearchTime: this.searchTime, dataSearchTime: '',
} }
}, },
mounted() { mounted() {
@ -123,6 +123,9 @@
methods: { methods: {
//- //-
workSummaryPersonOverview() { workSummaryPersonOverview() {
if (this.dataSearchTime === '') {
this.dataSearchTime = this.searchTime
}
let timeStr = this.dataSearchTime; let timeStr = this.dataSearchTime;
if (timeStr !== "") { if (timeStr !== "") {
let startDate = timeStr.split("|")[0]; let startDate = timeStr.split("|")[0];

@ -476,12 +476,12 @@
}, },
selected_data: { selected_data: {
handler(select_data) { handler(select_data) {
if (select_data.length == 0) { if (select_data[select_data.length - 1].id) {
this.deptId = this.BaseConfig.person_info_my.dep_id;
} else {
this.deptId = select_data[select_data.length - 1].id this.deptId = select_data[select_data.length - 1].id
this.workSummaryDeptPersonOverview() this.workSummaryDeptPersonOverview()
this.workSummaryDeptCycleStatistics() this.workSummaryDeptCycleStatistics()
} else {
this.deptId = this.BaseConfig.person_info_my.dep_id;
} }
}, },
immediate: true immediate: true
@ -583,7 +583,7 @@
// //
endDate(end_date) { endDate(end_date) {
this.end_date = end_date; this.end_date = end_date;
this.searchTime = this.begin_date + "|" + this.end_date; // this.searchTime = this.begin_date + "|" + this.end_date;
this.workSummaryDeptPersonOverview() this.workSummaryDeptPersonOverview()
this.workSummaryOrgDeptOverview() this.workSummaryOrgDeptOverview()
this.workSummaryDeptCycleStatistics() this.workSummaryDeptCycleStatistics()
@ -592,7 +592,7 @@
// //
startDate(begin_date) { startDate(begin_date) {
this.begin_date = begin_date this.begin_date = begin_date
this.searchTime = this.begin_date + "|" + this.end_date; // this.searchTime = this.begin_date + "|" + this.end_date;
this.workSummaryDeptPersonOverview() this.workSummaryDeptPersonOverview()
this.workSummaryOrgDeptOverview() this.workSummaryOrgDeptOverview()
this.workSummaryDeptCycleStatistics() this.workSummaryDeptCycleStatistics()
@ -611,8 +611,8 @@
let year = resData.data.year; let year = resData.data.year;
let month = resData.data.month; let month = resData.data.month;
let day = resData.data.day; let day = resData.data.day;
this.begin_date = moment(year + "-" + month + "-01"); this.begin_date = moment(year + "-" + month + "-01")._i;
this.end_date = moment(year + "-" + month + "-" + day); this.end_date = moment(year + "-" + month + "-" + day)._i;
this.searchTime = this.begin_date + "|" + this.end_date; this.searchTime = this.begin_date + "|" + this.end_date;
this.workSummaryDeptPersonOverview() this.workSummaryDeptPersonOverview()
this.workSummaryOrgDeptOverview() this.workSummaryOrgDeptOverview()

Loading…
Cancel
Save