数据列表修改时间之后查询不改变

newCac1.0
fanluyan 5 months ago
parent b5d7610e9b
commit 15b52f9fed

@ -283,6 +283,10 @@ export default {
//
chartDataArr: [], //
chartLoading: false,
//
allStartTime: "",
allEndTime: "",
};
},
@ -315,11 +319,15 @@ export default {
"starttime",
new Date(thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30))
);
this.allStartTime = new Date(
thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30)
);
console.log(this.formdata.starttime);
const currentDate = new Date(); //
currentDate.setHours(23); // 23
currentDate.setMinutes(59); // 59
currentDate.setSeconds(59); // 59
this.allEndTime = currentDate;
this.$set(this.formdata, "endtime", currentDate);
console.log("我是开始时间", this.formdata.starttime);
console.log("我是结束时间", currentDate);
@ -421,7 +429,8 @@ export default {
startDate.setSeconds(0); // 59
this.formdata.starttime = startDate;
} else {
this.formdata.starttime = val;
this.allStartTime = val;
this.formdata.starttime = this.allStartTime;
}
},
//
@ -438,7 +447,8 @@ export default {
val.setHours(23); // 23
val.setMinutes(59); // 59
val.setSeconds(59); // 59
this.formdata.endtime = val;
this.allEndTime = val;
this.formdata.endtime = this.allEndTime;
console.log(val);
}
},
@ -459,6 +469,12 @@ export default {
// "starttime",
// new Date(thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30))
// );
console.log(
"全局开始时间和结束时间为0",
this.allStartTime,
this.allEndTime
);
if (this.allStartTime == "" && this.allEndTime == "") {
const thirtyDaysAgo = new Date();
this.$set(
this.formdata,
@ -475,6 +491,16 @@ export default {
console.log("我是开始时间", this.formdata.starttime);
console.log("我是结束时间", currentDate);
} else {
this.$set(this.formdata, "starttime", this.allStartTime);
this.$set(this.formdata, "endtime", this.allEndTime);
}
} else {
console.log(
"全局开始时间和结束时间不为0",
this.allStartTime,
this.allEndTime
);
if (this.allStartTime == "" && this.allEndTime == "") {
console.log(res.data.content[0].acquisitionTime);
this.formdata.endtime = res.data.content[0].acquisitionTime;
const qet = new Date(this.formdata.endtime);
@ -492,6 +518,10 @@ export default {
"starttime",
new Date(thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30))
);
} else {
this.$set(this.formdata, "starttime", this.allStartTime);
this.$set(this.formdata, "endtime", this.allEndTime);
}
}
this.handleSearch();

@ -128,7 +128,7 @@
</span>
</template>
</el-table-column>
<el-table-column label="操作" min-width="95" fixed="right">
<el-table-column label="操作" min-width="95">
<template slot-scope="scope">
<span
v-if="scope.row.state == 1"

Loading…
Cancel
Save