From 6b96f841503500ef115cb0ca32789c9c463d98a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98937886381=E2=80=99?= <‘937886381@qq.com’> Date: Thu, 14 Mar 2024 14:54:03 +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 --- .../productionShipmentsReport/index.vue | 53 +++++++++++++------ 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/src/views/report/productionShipmentsReport/index.vue b/src/views/report/productionShipmentsReport/index.vue index c818c7be..7b21b008 100644 --- a/src/views/report/productionShipmentsReport/index.vue +++ b/src/views/report/productionShipmentsReport/index.vue @@ -1,7 +1,7 @@ @@ -9,9 +9,7 @@
- + 查询 @@ -431,7 +429,8 @@ export default { // explainText: undefined, // remark: undefined, // }, - // 查询参数 + // 查询参数 + reportTime:'', dataForm: { // pageSize: 100, // pageNo:1, @@ -449,10 +448,41 @@ export default { // this.getProductLineList(); }, mounted() { + this.getTodayStartTimeAndEndTime() this.getDataList() this.getDict() }, methods: { + format(shijianchuo) { + //shijianchuo是整数,否则要parseInt转换 + var time = moment(new Date(shijianchuo)).format('YYYY-MM-DD HH:mm:ss') + // console.log(time) + // var y = time.getFullYear(); + // var m = time.getMonth() + 1; + // var d = time.getDate(); + // var h = time.getHours(); + // var mm = time.getMinutes(); + // var s = time.getSeconds(); + return time + }, + getTodayStartTimeAndEndTime() { + this.reportTime = new Date() + this.changeTime(this.reportTime) + }, + changeTime(val) { + console.log(val) + if (val) { + // console.log(val) + // console.log(val.setHours(7, 0, 0)) + // console.log(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) + // let time = this.format(val.setHours(7, 0, 0)) + this.dataForm.reportTime[0] = this.format(val.setHours(7, 0, 1)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 + this.dataForm.reportTime[1] = this.format(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 + console.log(this.dataForm.reportTime); + } else { + this.dataForm.reportTime = [] + } + }, async getDict() { // 产线列表 const res = await getCorePLList() @@ -530,18 +560,7 @@ export default { } }, async getDataList() { - if (this.monthValue.length > 0) { - console.log(this.monthValue) - this.dataForm.reportTime[0] = this.transformTime(this.monthValue[0]) - // this.queryParams.startTime = this.monthValue[0] - this.dataForm.reportTime[1] = this.transformTime(this.monthValue[1]) - this.timeTips = moment(this.monthValue[0]).format('YYYY-MM-DD') + ' - ' + moment(this.monthValue[1]).format('YYYY-MM-DD') - console.log(this.timeTips); - } else { - // this.$modal.msgError('月范围不能为空') - // return false - } - + this.timeTips = moment(new Date()).format('YYYY-MM-DD') + ' - ' + moment(new Date().setHours(7, 0, 0) + 24 * 60 * 60 * 1000).format('YYYY-MM-DD') console.log(this.dataForm); const res = await this.$axios({ url: 'base/report-auto-delive/listPlus', -- 2.45.2