|  |  |  | 
|---|
|  |  |  | <el-option label="进入" value="enter"></el-option> | 
|---|
|  |  |  | </el-select> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="起止时间" prop="startDate"> | 
|---|
|  |  |  | <el-date-picker @change="seleTime" v-model="time" type="datetimerange" format="yyyy-MM-dd HH:mm:ss" | 
|---|
|  |  |  | value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间"> | 
|---|
|  |  |  | </el-date-picker> | 
|---|
|  |  |  | <el-form-item label="" prop="startDate"> | 
|---|
|  |  |  | <el-date-picker @change="changeDate" v-model="searchForm.startDate" type="datetime" | 
|---|
|  |  |  | format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" placeholder="开始时间" /> | 
|---|
|  |  |  | <el-date-picker @change="changeDate" v-model="searchForm.endDate" type="datetime" format="yyyy-MM-dd HH:mm:ss" | 
|---|
|  |  |  | value-format="yyyy-MM-dd HH:mm:ss" placeholder="开始时间" /> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-radio-group v-model="searchForm.radio" size="small" @input="changeRadio"> | 
|---|
|  |  |  | <el-radio-button label="0">当天</el-radio-button> | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | changeDate(e) { | 
|---|
|  |  |  | if ((this.searchForm.startDate && this.searchForm.endDate) && this.searchForm.startDate > this.searchForm.endDate) { | 
|---|
|  |  |  | this.searchForm.endDate = this.searchForm.startDate | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | return this.$message.error('开始时间不能大于结束时间') | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | changeRadio(e) { | 
|---|
|  |  |  | if (e === '0') { | 
|---|
|  |  |  | this.searchForm.startDate = timeForMat(0)[0] | 
|---|
|  |  |  | this.searchForm.endDate = timeForMat(0)[1] | 
|---|
|  |  |  | this.time = timeForMat(0) | 
|---|
|  |  |  | // this.time = timeForMat(0) | 
|---|
|  |  |  | } else if (e === '1') { | 
|---|
|  |  |  | this.searchForm.startDate = timeForMat(6)[0] | 
|---|
|  |  |  | this.searchForm.endDate = timeForMat(6)[1] | 
|---|
|  |  |  | this.time = timeForMat(6) | 
|---|
|  |  |  | // this.time = timeForMat(6) | 
|---|
|  |  |  | } else if (e === '2') { | 
|---|
|  |  |  | this.searchForm.startDate = timeForMat(29)[0] | 
|---|
|  |  |  | this.searchForm.endDate = timeForMat(29)[1] | 
|---|
|  |  |  | this.time = timeForMat(29) | 
|---|
|  |  |  | // this.time = timeForMat(29) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | seleTime(e) { | 
|---|
|  |  |  | this.searchForm.startDate = e[0] | 
|---|
|  |  |  | this.searchForm.endDate = e[1] | 
|---|
|  |  |  | this.searchForm.radio = null | 
|---|
|  |  |  | if ((this.searchForm.startDate && this.searchForm.endDate) && this.searchForm.startDate > this.searchForm.endDate) { | 
|---|
|  |  |  | this.searchForm.startDate = this.searchForm.endDate | 
|---|
|  |  |  | return this.$message.error('开始时间不能大于结束时间') | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | reset() { | 
|---|
|  |  |  | 
|---|
|  |  |  | this.searchForm.startDate = '' | 
|---|
|  |  |  | this.searchForm.endDate = '' | 
|---|
|  |  |  | this.searchForm.radio = '' | 
|---|
|  |  |  | this.time = [] | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|