|
|
|
@ -1,6 +1,17 @@
@@ -1,6 +1,17 @@
|
|
|
|
|
<template> |
|
|
|
|
<div class="app-container rtudatacls"> |
|
|
|
|
<el-tabs v-model="queryParams.itemCode" @tab-click="handleClick" type="border-card"> |
|
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px"> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-date-picker v-model="timeStage" type="datetimerange" range-separator="至" start-placeholder="开始日期" |
|
|
|
|
end-placeholder="结束日期" @change="chooseTimeRange" :picker-options="setDateRange"> |
|
|
|
|
</el-date-picker> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
|
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<el-tab-pane v-for="data in tabsList" :label="data.item" :name="data.itemCode"> |
|
|
|
|
<el-table v-loading="loading" :data="rtudataList" border> |
|
|
|
|
<el-table-column label="序号" align="center"> |
|
|
|
@ -40,6 +51,8 @@
@@ -40,6 +51,8 @@
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import {formatDate} from "@/utils/common"; |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
name: "Rtudata", |
|
|
|
|
data() { |
|
|
|
@ -59,6 +72,33 @@ export default {
@@ -59,6 +72,33 @@ export default {
|
|
|
|
|
// 数据列表表格数据 |
|
|
|
|
rtudataList: [], |
|
|
|
|
tabsList: [], |
|
|
|
|
//时间参数 |
|
|
|
|
timeStage: [], |
|
|
|
|
// 设置可选择的时间段,*** 必须在 data 返回数据 *** |
|
|
|
|
setDateRange: { |
|
|
|
|
// 设置不能选择的日期 |
|
|
|
|
onPick: ({ |
|
|
|
|
maxDate, |
|
|
|
|
minDate |
|
|
|
|
}) => { |
|
|
|
|
if (minDate) { //如果默认有最小日期 |
|
|
|
|
this.choiceDate0 = minDate.getTime(); |
|
|
|
|
} else { //如果最小日期被清空,则最小日期为当天 |
|
|
|
|
this.choiceDate0 = new Date(); |
|
|
|
|
} |
|
|
|
|
if (maxDate) { |
|
|
|
|
this.choiceDate0 = ''; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
disabledDate: (time) => { |
|
|
|
|
let choiceDateTime = new Date(this.choiceDate0).getTime(); //选中的第一个日期 |
|
|
|
|
if (this.choiceDate0) { |
|
|
|
|
//间隔15天,则加减14天---“这主要看需求” |
|
|
|
|
//14天的时间戳:14*24*3600*1000=1209600000 |
|
|
|
|
return (time.getTime() > (choiceDateTime + 7*24*3600*1000)) || (time.getTime() < (choiceDateTime - 7*24*3600*1000)); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
// 弹出层标题 |
|
|
|
|
title: "", |
|
|
|
|
// 是否显示弹出层 |
|
|
|
@ -68,6 +108,8 @@ export default {
@@ -68,6 +108,8 @@ export default {
|
|
|
|
|
page: 1, |
|
|
|
|
limit: 10, |
|
|
|
|
itemCode: null, |
|
|
|
|
startTime: null, |
|
|
|
|
endTime: null, |
|
|
|
|
}, |
|
|
|
|
// 表单参数 |
|
|
|
|
form: {}, |
|
|
|
@ -77,10 +119,16 @@ export default {
@@ -77,10 +119,16 @@ export default {
|
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
created() { |
|
|
|
|
this.getTime(); |
|
|
|
|
this.getTabsList(); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
handleClick() { |
|
|
|
|
if(this.timeStage == null || this.timeStage.length == 0 ){ |
|
|
|
|
this.$modal.msg("请选择时间"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.queryParams.page = 1; |
|
|
|
|
this.getList(); |
|
|
|
|
}, |
|
|
|
|
/** 查询标签列表 */ |
|
|
|
@ -95,6 +143,10 @@ export default {
@@ -95,6 +143,10 @@ export default {
|
|
|
|
|
|
|
|
|
|
/** 查询数据列表列表 */ |
|
|
|
|
async getList() { |
|
|
|
|
if(this.timeStage == null || this.timeStage.length == 0 ){ |
|
|
|
|
this.$modal.msg("请选择时间"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.loading = true; |
|
|
|
|
let res = await this.$axiosGet('/rtudata/rtudata/list',this.queryParams); |
|
|
|
|
if(res.code === 0){ |
|
|
|
@ -103,12 +155,41 @@ export default {
@@ -103,12 +155,41 @@ export default {
|
|
|
|
|
} |
|
|
|
|
this.loading = false; |
|
|
|
|
}, |
|
|
|
|
/** 设置初始时间*/ |
|
|
|
|
getTime() { |
|
|
|
|
var timestamp = new Date(); |
|
|
|
|
this.queryParams.endTime = formatDate(timestamp, 'yyyy-MM-dd hh:mm:ss') |
|
|
|
|
this.queryParams.startTime = formatDate(new Date(timestamp.getTime() - 86400 * 1000), ('yyyy-MM-dd hh:mm:ss')); |
|
|
|
|
this.timeStage[0]=this.queryParams.startTime |
|
|
|
|
this.timeStage[1]=this.queryParams.endTime |
|
|
|
|
}, |
|
|
|
|
chooseTimeRange() { |
|
|
|
|
if (this.timeStage != null && this.timeStage.length > 0) { |
|
|
|
|
this.queryParams.startTime = formatDate(this.timeStage[0], 'yyyy-MM-dd hh:mm:ss'); |
|
|
|
|
this.queryParams.endTime = formatDate(this.timeStage[1], 'yyyy-MM-dd hh:mm:ss'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
/** 重置按钮操作 */ |
|
|
|
|
resetQuery() { |
|
|
|
|
this.resetForm("queryForm"); |
|
|
|
|
var timestamp = new Date(); |
|
|
|
|
this.queryParams = { |
|
|
|
|
page: 1, |
|
|
|
|
limit: 10, |
|
|
|
|
endTime : formatDate(timestamp, 'yyyy-MM-dd hh:mm:ss'), |
|
|
|
|
startTime : formatDate(new Date(timestamp.getTime() - 86400 * 1000), ('yyyy-MM-dd hh:mm:ss')), |
|
|
|
|
itemCode : this.tabsList[0].itemCode |
|
|
|
|
}; |
|
|
|
|
this.timeStage[0]=this.queryParams.startTime |
|
|
|
|
this.timeStage[1]=this.queryParams.endTime |
|
|
|
|
console.log(this.timeStage) |
|
|
|
|
this.handleQuery(); |
|
|
|
|
}, |
|
|
|
|
/** 搜索按钮操作 */ |
|
|
|
|
handleQuery() { |
|
|
|
|
this.queryParams.page = 1; |
|
|
|
|
this.getList(); |
|
|
|
|
this.handleClick(); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
|
|