|
|
|
@ -242,17 +242,25 @@
|
|
|
|
return null; // 无符合条件的数组时返回null
|
|
|
|
return null; // 无符合条件的数组时返回null
|
|
|
|
},
|
|
|
|
},
|
|
|
|
async getPerson(){
|
|
|
|
async getPerson(){
|
|
|
|
const res = await fillChart({
|
|
|
|
let currentYear = parseInt(this.monthSelect.year);
|
|
|
|
business_id: 20,
|
|
|
|
let currentMonthData = null;
|
|
|
|
year: this.monthSelect.year,
|
|
|
|
|
|
|
|
business_type_id: 88,
|
|
|
|
// 从当前年份开始,往前查找直到找到有数据的年份
|
|
|
|
area_id: 13
|
|
|
|
while (currentYear >= 2020 && !currentMonthData) {
|
|
|
|
})
|
|
|
|
const res = await fillChart({
|
|
|
|
const monthNum = (new Date()).getMonth()
|
|
|
|
business_id: 20,
|
|
|
|
const currentMonth = monthNum===0?'01':String(new Date().getMonth()).padStart(2, '0');
|
|
|
|
year: String(currentYear),
|
|
|
|
// const currentMonth = monthNum<10?'0'+monthNum:monthNum
|
|
|
|
business_type_id: 88,
|
|
|
|
console.log("currentMonth",currentMonth)
|
|
|
|
area_id: 13
|
|
|
|
const currentMonthData = this.findLastNonZeroTotal(res.list);
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
currentMonthData = this.findLastNonZeroTotal(res.list);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 如果当前年份没有数据,尝试前一年
|
|
|
|
|
|
|
|
if (!currentMonthData) {
|
|
|
|
|
|
|
|
currentYear--;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
console.log("currentMonthData",currentMonthData)
|
|
|
|
console.log("currentMonthData",currentMonthData)
|
|
|
|
if(currentMonthData){
|
|
|
|
if(currentMonthData){
|
|
|
|
|