diff --git a/.env.dev b/.env.dev index a8a3e6c2..d0e92c5e 100644 --- a/.env.dev +++ b/.env.dev @@ -1,7 +1,7 @@ ### # @Author: Do not edit # @Date: 2023-08-29 09:40:39 - # @LastEditTime: 2024-03-01 15:27:52 + # @LastEditTime: 2024-03-01 16:13:32 # @LastEditors: zhp # @Description: ### diff --git a/src/views/quality/base/qualityHotMaterial/index.vue b/src/views/quality/base/qualityHotMaterial/index.vue index 554aaedb..9e97cbc7 100644 --- a/src/views/quality/base/qualityHotMaterial/index.vue +++ b/src/views/quality/base/qualityHotMaterial/index.vue @@ -188,8 +188,8 @@ export default { case 'search': this.listQuery.pageNo = 1; this.listQuery.pageSize = 10; - this.listQuery.content = val.content ? val.content : undefined; - this.listQuery.typeId = val.typeId ? val.typeId : undefined; + this.listQuery.materialId = val.materialId ? val.materialId : undefined; + // this.listQuery.typeId = val.typeId ? val.typeId : undefined; this.getDataList(); break; case 'reset': diff --git a/src/views/report/glass/day.vue b/src/views/report/glass/day.vue index 33621499..844b5c83 100644 --- a/src/views/report/glass/day.vue +++ b/src/views/report/glass/day.vue @@ -1,7 +1,7 @@ @@ -62,9 +62,14 @@ export default { }; }, created() { - this.getDict() + this.getDict() + this.getTodayStartTimeAndEndTime() }, - methods: { + methods: { + getTodayStartTimeAndEndTime() { + this.reportTime = new Date() + this.changeTime(this.reportTime) + }, async getDict() { // 产线列表 const res = await getCorePLList(); diff --git a/src/views/report/glass/month.vue b/src/views/report/glass/month.vue index caa0b23b..a1514fc1 100644 --- a/src/views/report/glass/month.vue +++ b/src/views/report/glass/month.vue @@ -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()); //结束时间 diff --git a/src/views/report/glass/weekly.vue b/src/views/report/glass/weekly.vue index cf36a70b..57993f21 100644 --- a/src/views/report/glass/weekly.vue +++ b/src/views/report/glass/weekly.vue @@ -93,7 +93,8 @@ export default { }, mounted() { // const day = new Date().getDay() - // console.log('周四', day) + // console.log('周四', day) + this.getCurrentWeekStartTimeAndEndTime() // this.changeTime(new Date(new Date().getTime() - day * 24 * 60 * 60 * 1000)) this.getDict() }, @@ -104,7 +105,11 @@ export default { this.proLineList = res.data; // this.getDataList() }); - }, + }, + getCurrentWeekStartTimeAndEndTime() { + this.reportTime = new Date() + this.changeTime(this.reportTime) + }, // 获取数据列表 async getDataList() { this.dataListLoading = true; @@ -127,7 +132,8 @@ export default { this.dataListLoading = false; }); }, - changeTime(val) { + changeTime(val) { + console.log(val); if(val) { let timeStamp = val.getTime(); //标准时间转为时间戳,毫秒级别 this.startTimeStamp = this.timeFun(timeStamp - 24 * 60 * 60 * 1000); //开始时间 diff --git a/src/views/report/glass/year.vue b/src/views/report/glass/year.vue index ff487c79..52954cc7 100644 --- a/src/views/report/glass/year.vue +++ b/src/views/report/glass/year.vue @@ -57,10 +57,24 @@ export default { all: {}, }; }, - created() { + created() { this.getDict() - }, - methods: { + }, + mounted () { + this.getCurrentYearFirst() + ; + }, + methods: { + getCurrentYearFirst() { + let date = new Date(); + date.setDate(1); + date.setMonth(0); + this.reportTime = date; + this.startTimeStamp = this.timeFun(new Date(new Date().getFullYear(), 0, 1).getTime()); //开始时间 + this.endTimeStamp = this.timeFun(new Date(new Date().getFullYear(), 11, 31, 23, 59, 59).getTime()); //结束时间 + this.listQuery.reportTime[0] = parseTime(new Date(new Date().getFullYear(), 0, 1).getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 + this.listQuery.reportTime[1] = parseTime(new Date(new Date().getFullYear(), 11, 31, 23, 59, 59).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 100 + }, async getDict() { // 产线列表 const res = await getCorePLList(); diff --git a/src/views/report/productionDayReport/index.vue b/src/views/report/productionDayReport/index.vue index 9b3a60ba..d3d5eacf 100644 --- a/src/views/report/productionDayReport/index.vue +++ b/src/views/report/productionDayReport/index.vue @@ -1,15 +1,15 @@