Merge pull request 'projects/mesxc-zhp' (#244) from projects/mesxc-zhp into projects/mesxc-test

Reviewed-on: #244
This commit is contained in:
朱菊兰 2024-03-14 14:57:12 +08:00
commit efdf1f5b54

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-12-12 13:45:25 * @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-03-12 11:17:14 * @LastEditTime: 2024-03-14 13:46:39
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -9,9 +9,7 @@
<div class="app-container"> <div class="app-container">
<el-form :inline="true" :model="dataForm" class="demo-form-inline"> <el-form :inline="true" :model="dataForm" class="demo-form-inline">
<el-form-item> <el-form-item>
<el-date-picker clearable v-model="monthValue" type="monthrange" range-separator="" start-placeholder="开始日期" <el-date-picker clearable v-model="reportTime" @change="changeTime" type="date" placeholder="选择日期">
end-placeholder="结束日期" value-format="timestamp" :clearable="false" :picker-options="pickerOptions"
size="small" style='width:350px;' @change="timeSelect">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-button type="primary" @click="getDataList()">查询</el-button> <el-button type="primary" @click="getDataList()">查询</el-button>
@ -431,7 +429,8 @@ export default {
// explainText: undefined, // explainText: undefined,
// remark: undefined, // remark: undefined,
// }, // },
// //
reportTime:'',
dataForm: { dataForm: {
// pageSize: 100, // pageSize: 100,
// pageNo:1, // pageNo:1,
@ -449,10 +448,41 @@ export default {
// this.getProductLineList(); // this.getProductLineList();
}, },
mounted() { mounted() {
this.getTodayStartTimeAndEndTime()
this.getDataList() this.getDataList()
this.getDict() this.getDict()
}, },
methods: { methods: {
format(shijianchuo) {
//shijianchuoparseInt
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() { async getDict() {
// 线 // 线
const res = await getCorePLList() const res = await getCorePLList()
@ -530,18 +560,7 @@ export default {
} }
}, },
async getDataList() { async getDataList() {
if (this.monthValue.length > 0) { 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.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
}
console.log(this.dataForm); console.log(this.dataForm);
const res = await this.$axios({ const res = await this.$axios({
url: 'base/report-auto-delive/listPlus', url: 'base/report-auto-delive/listPlus',