From bddb182b732024511ac60c16d1c6e5ccc2b10cc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98937886381=E2=80=99?= <‘937886381@qq.com’> Date: Mon, 11 Mar 2024 17:06:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/report/glass/day.vue | 8 +- src/views/report/glass/inputTable.vue | 2 +- src/views/report/glass/month.vue | 6 +- src/views/report/glass/weekly.vue | 74 +++++++++-- src/views/report/glass/year.vue | 6 +- .../report/productionDayReport/index.vue | 10 +- .../report/productionMonthReport/index.vue | 11 +- .../report/productionWeekReport/index.vue | 122 ++++++++++++++---- .../report/productionYearReport/index.vue | 12 +- 9 files changed, 192 insertions(+), 59 deletions(-) diff --git a/src/views/report/glass/day.vue b/src/views/report/glass/day.vue index e509315b..82513e1e 100644 --- a/src/views/report/glass/day.vue +++ b/src/views/report/glass/day.vue @@ -1,7 +1,7 @@ @@ -102,9 +102,9 @@ export default { this.proLineList.forEach(it => { if (item.lineId === it.id) { item.lineName = it.name - item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? this.multipliedByHundred(item.originalGlassStatisticsTrend) + '%' : null - item.actualProductTrend = item.actualProductTrend ? this.multipliedByHundred(item.actualProductTrend) + '%' : null - item.originalGlassPassTrend = item.originalGlassPassTrend ? this.multipliedByHundred(item.originalGlassPassTrend) * 100 + '%' : null + item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? item.originalGlassStatisticsTrend + '%' : null + item.actualProductTrend = item.actualProductTrend ? item.actualProductTrend + '%' : null + item.originalGlassPassTrend = item.originalGlassPassTrend ? item.originalGlassPassTrend * 100 + '%' : null } }) if (item.det === false) { diff --git a/src/views/report/glass/inputTable.vue b/src/views/report/glass/inputTable.vue index 11358799..26dc8b13 100644 --- a/src/views/report/glass/inputTable.vue +++ b/src/views/report/glass/inputTable.vue @@ -1,7 +1,7 @@ diff --git a/src/views/report/glass/month.vue b/src/views/report/glass/month.vue index be544162..7e892aba 100644 --- a/src/views/report/glass/month.vue +++ b/src/views/report/glass/month.vue @@ -81,9 +81,9 @@ export default { this.proLineList.forEach(it => { if (item.lineId === it.id) { item.lineName = it.name - item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? this.multipliedByHundred(item.originalGlassStatisticsTrend) + '%' : null - item.actualProductTrend = item.actualProductTrend ? this.multipliedByHundred(item.actualProductTrend) + '%' : null - item.originalGlassPassTrend = item.originalGlassPassTrend ? this.multipliedByHundred(item.originalGlassPassTrend) * 100 + '%' : null + item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? item.originalGlassStatisticsTrend + '%' : null + item.actualProductTrend = item.actualProductTrend ? item.actualProductTrend + '%' : null + item.originalGlassPassTrend = item.originalGlassPassTrend ? item.originalGlassPassTrend * 100 + '%' : null } }) if (item.det === false) { diff --git a/src/views/report/glass/weekly.vue b/src/views/report/glass/weekly.vue index 0ad4c820..c7909045 100644 --- a/src/views/report/glass/weekly.vue +++ b/src/views/report/glass/weekly.vue @@ -8,7 +8,7 @@ @@ -104,7 +104,65 @@ export default { }, getCurrentWeekStartTimeAndEndTime() { this.reportTime = new Date() - this.changeTime(this.reportTime) + var weekday = new Array(7); + weekday[0] = "Sunday"; + weekday[1] = "Monday"; + weekday[2] = "Tuesday"; + weekday[3] = "Wednesday"; + weekday[4] = "Thursday"; + weekday[5] = "Friday"; + weekday[6] = "Saturday"; + // console.log(weekday[this.reportTime.getDay()]); + if (weekday[this.reportTime.getDay()] === 'Monday') { + this.startTimeStamp = this.timeFun(new Date().getTime() - 4 * 24 * 60 * 60 * 1000) + this.endTimeStamp = this.timeFun(new Date().getTime() + 3 * 24 * 60 * 60 * 1000) + this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 + this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 + // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间 + // this.changeTime(reportTime) + } else if (weekday[this.reportTime.getDay()] === 'Tuesday') { + this.startTimeStamp = this.timeFun(new Date().getTime() - 5 * 24 * 60 * 60 * 1000) + this.endTimeStamp = this.timeFun(new Date().getTime() + 2 * 24 * 60 * 60 * 1000) + this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 + this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 + // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间 + // this.changeTime(reportTime) + } else if (weekday[this.reportTime.getDay()] === 'Wednesday') { + this.startTimeStamp = this.timeFun(new Date().getTime() - 6 * 24 * 60 * 60 * 1000) + this.endTimeStamp = this.timeFun(new Date().getTime() + 1 * 24 * 60 * 60 * 1000) + this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 + this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 + // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间 + // this.changeTime(reportTime) + } else if (weekday[this.reportTime.getDay()] === 'Thursday') { + this.startTimeStamp = this.timeFun(new Date().getTime() - 7 * 24 * 60 * 60 * 1000) + this.endTimeStamp = this.timeFun(new Date().getTime()) + this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 + this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 + // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间 + // this.changeTime(reportTime) + } else if (weekday[this.reportTime.getDay()] === 'Friday') { + this.startTimeStamp = this.timeFun(new Date().getTime() - 8 * 24 * 60 * 60 * 1000) + this.endTimeStamp = this.timeFun(new Date().getTime() - 1 * 24 * 60 * 60 * 1000) + this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 + this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 + // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间 + // this.changeTime(reportTime) + } else if (weekday[this.reportTime.getDay()] === 'Saturday') { + this.startTimeStamp = this.timeFun(new Date().getTime() - 9 * 24 * 60 * 60 * 1000) + this.endTimeStamp = this.timeFun(new Date().getTime() - 2 * 24 * 60 * 60 * 1000) + this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 + this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 + // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间 + // this.changeTime(reportTime) + } else if (weekday[this.reportTime.getDay()] === 'Sunday') { + this.startTimeStamp = this.timeFun(new Date().getTime() - 10 * 24 * 60 * 60 * 1000) + this.endTimeStamp = this.timeFun(new Date().getTime() + 3 * 24 * 60 * 60 * 1000) + this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 + this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 + // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间 + // this.changeTime(reportTime) + } }, // 获取数据列表 async getDataList() { @@ -114,9 +172,9 @@ export default { this.proLineList.forEach(it => { if (item.lineId === it.id) { item.lineName = it.name - item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? this.multipliedByHundred(item.originalGlassStatisticsTrend) + '%' : null - item.actualProductTrend = item.actualProductTrend ? this.multipliedByHundred(item.actualProductTrend) + '%' : null - item.originalGlassPassTrend = item.originalGlassPassTrend ? this.multipliedByHundred(item.originalGlassPassTrend) * 100 + '%' : null + item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? item.originalGlassStatisticsTrend + '%' : null + item.actualProductTrend = item.actualProductTrend ? item.actualProductTrend + '%' : null + item.originalGlassPassTrend = item.originalGlassPassTrend ? item.originalGlassPassTrend * 100 + '%' : null } }) if (item.det === false) { @@ -136,10 +194,10 @@ export default { if(val) { let timeStamp = val.getTime(); //标准时间转为时间戳,毫秒级别 this.startTimeStamp = this.timeFun(timeStamp - 24 * 60 * 60 * 1000); //开始时间 - this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间 + this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 6); //结束时间 console.log(this.startTimeStamp, this.endTimeStamp) - this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 - this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:01').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 + this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 + this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 } else { this.listQuery.reportTime = [] } diff --git a/src/views/report/glass/year.vue b/src/views/report/glass/year.vue index 66959702..681b1932 100644 --- a/src/views/report/glass/year.vue +++ b/src/views/report/glass/year.vue @@ -82,9 +82,9 @@ export default { this.tableData = response.data.filter(item => { this.proLineList.forEach(it => { if (item.lineId === it.id) { - item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? this.multipliedByHundred(item.originalGlassStatisticsTrend) + '%' : null - item.actualProductTrend = item.actualProductTrend ? this.multipliedByHundred(item.actualProductTrend) + '%' : null - item.originalGlassPassTrend = item.originalGlassPassTrend ? this.multipliedByHundred(item.originalGlassPassTrend) * 100 + '%' : null + item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? item.originalGlassStatisticsTrend + '%' : null + item.actualProductTrend = item.actualProductTrend ? item.actualProductTrend + '%' : null + item.originalGlassPassTrend = item.originalGlassPassTrend ? item.originalGlassPassTrend * 100 + '%' : null item.lineName = it.name } }) diff --git a/src/views/report/productionDayReport/index.vue b/src/views/report/productionDayReport/index.vue index 17164401..0934f3f6 100644 --- a/src/views/report/productionDayReport/index.vue +++ b/src/views/report/productionDayReport/index.vue @@ -1,7 +1,7 @@ @@ -47,7 +47,7 @@ @@ -70,7 +70,7 @@ @@ -91,7 +91,7 @@ @@ -114,7 +114,7 @@ diff --git a/src/views/report/productionMonthReport/index.vue b/src/views/report/productionMonthReport/index.vue index 14c6d8fa..6c0fc658 100644 --- a/src/views/report/productionMonthReport/index.vue +++ b/src/views/report/productionMonthReport/index.vue @@ -1,7 +1,7 @@ @@ -49,7 +49,7 @@ @@ -72,7 +72,7 @@ @@ -93,7 +93,7 @@ @@ -116,7 +116,8 @@ diff --git a/src/views/report/productionWeekReport/index.vue b/src/views/report/productionWeekReport/index.vue index 79cacedf..a435e514 100644 --- a/src/views/report/productionWeekReport/index.vue +++ b/src/views/report/productionWeekReport/index.vue @@ -1,7 +1,7 @@ @@ -9,11 +9,9 @@
- - - - + 查询 @@ -52,7 +50,7 @@ @@ -75,7 +73,7 @@ @@ -96,7 +94,7 @@ @@ -119,7 +117,8 @@ @@ -158,6 +157,7 @@ import { import moment from 'moment'; // import DialogForm from './dialogForm.vue'; import { getCorePLList } from '@/api/base/coreProductionLine' +import { parseTime } from '../../core/mixins/code-filter'; // import basicPageMixin from '@/mixins/lb/basicPageMixin'; const tableProps = [ @@ -262,7 +262,9 @@ export default { urlOptions: { exportURL: exportProductExcel }, - timeTips:'', + timeTips: '', + startTimeStamp: '', + endTimeStamp: '', // dataForm: { // reportTime:undefined // }, @@ -327,7 +329,8 @@ export default { // plain: true, // color: 'success', // }, - ], + ], + reportTime:'', pickerOptionsWeek: { disabledDate(time) { let day = Date.now() @@ -376,19 +379,66 @@ export default { this.proLineList = res.data; }, getCurrentWeekStartTimeAndEndTime() { - const current = new Date(); - // current是本周的第几天 - let nowDayOfWeek = current.getDay(); - if (nowDayOfWeek === 0) nowDayOfWeek = 7; - const dayNum = 1 * 24 * 60 * 60 * 1000; - // 获取本周星期一的时间,星期一作为一周的第一天 - const firstDate = new Date(current.valueOf() - (nowDayOfWeek - 1) * dayNum); - // 获取本周星期天的时间,星期天作为一周的最后一天 - const lastDate = new Date(new Date(firstDate).valueOf() + 6 * dayNum); - // return { - this.weekValue1 = new Date(firstDate) - this.weekValue2 = new Date(lastDate) - // }; + this.reportTime = new Date() + var weekday = new Array(7); + weekday[0] = "Sunday"; + weekday[1] = "Monday"; + weekday[2] = "Tuesday"; + weekday[3] = "Wednesday"; + weekday[4] = "Thursday"; + weekday[5] = "Friday"; + weekday[6] = "Saturday"; + // console.log(weekday[this.reportTime.getDay()]); + if (weekday[this.reportTime.getDay()] === 'Monday') { + this.startTimeStamp = this.timeFun(new Date().getTime() - 4 * 24 * 60 * 60 * 1000) + this.endTimeStamp = this.timeFun(new Date().getTime() + 3 * 24 * 60 * 60 * 1000) + this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 + this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 + // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间 + // this.changeTime(reportTime) + } else if (weekday[this.reportTime.getDay()] === 'Tuesday') { + this.startTimeStamp = this.timeFun(new Date().getTime() - 5 * 24 * 60 * 60 * 1000) + this.endTimeStamp = this.timeFun(new Date().getTime() + 2 * 24 * 60 * 60 * 1000) + this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 + this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 + // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间 + // this.changeTime(reportTime) + } else if (weekday[this.reportTime.getDay()] === 'Wednesday') { + this.startTimeStamp = this.timeFun(new Date().getTime() - 6 * 24 * 60 * 60 * 1000) + this.endTimeStamp = this.timeFun(new Date().getTime() + 1 * 24 * 60 * 60 * 1000) + this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 + this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 + // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间 + // this.changeTime(reportTime) + } else if (weekday[this.reportTime.getDay()] === 'Thursday') { + this.startTimeStamp = this.timeFun(new Date().getTime() - 7 * 24 * 60 * 60 * 1000) + this.endTimeStamp = this.timeFun(new Date().getTime()) + this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 + this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 + // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间 + // this.changeTime(reportTime) + } else if (weekday[this.reportTime.getDay()] === 'Friday') { + this.startTimeStamp = this.timeFun(new Date().getTime() - 8 * 24 * 60 * 60 * 1000) + this.endTimeStamp = this.timeFun(new Date().getTime() - 1 * 24 * 60 * 60 * 1000) + this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 + this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 + // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间 + // this.changeTime(reportTime) + } else if (weekday[this.reportTime.getDay()] === 'Saturday') { + this.startTimeStamp = this.timeFun(new Date().getTime() - 9 * 24 * 60 * 60 * 1000) + this.endTimeStamp = this.timeFun(new Date().getTime() - 2 * 24 * 60 * 60 * 1000) + this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 + this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 + // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间 + // this.changeTime(reportTime) + } else if (weekday[this.reportTime.getDay()] === 'Sunday') { + this.startTimeStamp = this.timeFun(new Date().getTime() - 10 * 24 * 60 * 60 * 1000) + this.endTimeStamp = this.timeFun(new Date().getTime() + 3 * 24 * 60 * 60 * 1000) + this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 + this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 + // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间 + // this.changeTime(reportTime) + } }, handleExport() { // 处理查询参数 @@ -465,6 +515,28 @@ export default { this.$modal.msgError('更新失败'); } }, + changeTime(val) { + console.log(val); + if (val) { + let timeStamp = val.getTime(); //标准时间转为时间戳,毫秒级别 + this.startTimeStamp = this.timeFun(timeStamp - 24 * 60 * 60 * 1000); //开始时间 + this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 6); //结束时间 + console.log(this.startTimeStamp, this.endTimeStamp) + this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 + this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 + } else { + this.dataForm.reportTime = [] + } + }, + + //时间戳转为yy-mm-dd hh:mm:ss + timeFun(unixtimestamp) { + var unixtimestamp = new Date(unixtimestamp); + var year = 1900 + unixtimestamp.getYear(); + var month = "0" + (unixtimestamp.getMonth() + 1); + var date = "0" + unixtimestamp.getDate(); + return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length) + }, async getDataList() { if (this.weekValue1 && this.weekValue2) { this.dataForm.reportTime[0] = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' 07:00:01' diff --git a/src/views/report/productionYearReport/index.vue b/src/views/report/productionYearReport/index.vue index c0d6a206..ea966d2b 100644 --- a/src/views/report/productionYearReport/index.vue +++ b/src/views/report/productionYearReport/index.vue @@ -1,7 +1,7 @@ @@ -52,7 +52,7 @@ @@ -75,7 +75,7 @@ @@ -96,7 +96,8 @@ @@ -119,7 +120,8 @@