projects/mesxc-zhp #244
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:45:25
|
||||
* @LastEditTime: 2024-03-12 11:17:14
|
||||
* @LastEditTime: 2024-03-14 13:46:39
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -9,9 +9,7 @@
|
||||
<div class="app-container">
|
||||
<el-form :inline="true" :model="dataForm" class="demo-form-inline">
|
||||
<el-form-item>
|
||||
<el-date-picker clearable v-model="monthValue" type="monthrange" range-separator="至" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" value-format="timestamp" :clearable="false" :picker-options="pickerOptions"
|
||||
size="small" style='width:350px;' @change="timeSelect">
|
||||
<el-date-picker clearable v-model="reportTime" @change="changeTime" type="date" placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-button type="primary" @click="getDataList()">查询</el-button>
|
||||
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user