修改bug

This commit is contained in:
‘937886381’
2024-03-05 09:48:16 +08:00
parent f685a65a1f
commit a027c4ca63
13 changed files with 414 additions and 777 deletions

View File

@@ -59,7 +59,8 @@ export default {
all: {}
};
},
created() {
created() {
this.getCurrentMonthFirst()
this.getDict()
},
methods: {
@@ -67,7 +68,15 @@ export default {
// 产线列表
const res = await getCorePLList();
this.proLineList = res.data;
},
},
getCurrentMonthFirst() {
const date = new Date();
date.setDate(1);
this.reportTime = date
// console.log(date)
this.changeTime(date)
// console.log(date.valueOf());
},
// 获取数据列表
async getDataList() {
this.dataListLoading = true;
@@ -90,24 +99,35 @@ export default {
this.dataListLoading = false;
});
},
changeTime(val) {
changeTime(val) {
console.log(val)
if(val) {
const timeStamp = val.getMonth(); //标准时间转为时间戳,毫秒级别
const fullyear = val.getFullYear()
let days = 0
switch (timeStamp) {
case 0, 2, 4, 6, 7, 9, 11:
case 0:
case 2:
case 4:
case 6:
case 7:
case 9:
case 11:
days = 31
break
case 3, 4, 8, 10:
case 3:
case 4:
case 8:
case 10:
days = 30
break
case 1:
if ((fullyear % 400 === 0) || (fullyear() % 4 === 0 && fullyear() % 100 !== 0)) {
if ((fullyear % 400 === 0) || (fullyear % 4 === 0 && fullyear % 100 !== 0)) {
days = 29
} else {
days = 28
}
}
break
}
this.startTimeStamp = this.timeFun(new Date(fullyear, timeStamp, 1).getTime()); //开始时间
this.endTimeStamp = this.timeFun(new Date(fullyear, timeStamp, days, 23, 59, 59).getTime()); //结束时间