|
@@ -9,6 +9,16 @@
|
|
|
@userSelected="userChanged"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="时间" v-if="dataForm.state === '3'">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="daterange"
|
|
|
+ type="daterange"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ value-format="yyyy-MM-dd">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button @click="queryData()" v-reClick>查询</el-button>
|
|
|
<el-button @click="batchStart()" v-reClick v-if="dataForm.state === '1'">批量开始</el-button>
|
|
@@ -726,7 +736,8 @@ export default {
|
|
|
maxNumber: 0,
|
|
|
number: 0
|
|
|
},
|
|
|
- devices: [{}] // 设备列表
|
|
|
+ devices: [{}], // 设备列表
|
|
|
+ daterange: []
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
@@ -734,6 +745,14 @@ export default {
|
|
|
if (state) {
|
|
|
this.dataForm.state = state
|
|
|
}
|
|
|
+
|
|
|
+ // 初始化
|
|
|
+ const currentDate = new Date()
|
|
|
+ const year = currentDate.getFullYear()
|
|
|
+ const month = currentDate.getMonth() + 1 // 月份是从 0 开始计数的,因此要加1
|
|
|
+ const day = currentDate.getDate()
|
|
|
+ this.daterange = [`${year}-${month}-01`, `${year}-${month}-${day}`]
|
|
|
+
|
|
|
this.getDataList()
|
|
|
},
|
|
|
methods: {
|
|
@@ -745,6 +764,8 @@ export default {
|
|
|
},
|
|
|
// 获取数据列表
|
|
|
getDataList () {
|
|
|
+ console.log(this.daterange)
|
|
|
+
|
|
|
this.dataListLoading = true
|
|
|
let params = {
|
|
|
current: this.pageIndex,
|
|
@@ -752,6 +773,10 @@ export default {
|
|
|
state: this.dataForm.state,
|
|
|
userId: this.dataForm.userId ? this.dataForm.userId : null
|
|
|
}
|
|
|
+ if (this.dataForm.state === '3') {
|
|
|
+ params.startTime = this.daterange.length === 0 ? '' : this.daterange[0] + ' 00:00:00'
|
|
|
+ params.endTime = this.daterange.length === 0 ? '' : this.daterange[1] + ' 23:59:59'
|
|
|
+ }
|
|
|
getMyTaskList(params).then(({ data }) => {
|
|
|
if (data && data.code === '200') {
|
|
|
this.dataList = data.data.records
|