|
@@ -1,24 +1,26 @@
|
|
|
<template>
|
|
|
<div class="height-100">
|
|
|
<el-card class="card-query margin-bottom-20">
|
|
|
- <el-form label-width="90px" :model="form" size="medium">
|
|
|
+ <el-form ref="form" label-width="90px" :model="form" size="medium">
|
|
|
<div class="form-input">
|
|
|
- <el-form-item label="组织机构:">
|
|
|
- <el-select v-model="form.departmentId" placeholder="全部">
|
|
|
- <el-option v-for="item in departmentArr" :key="item.id" :label="item.departmentname" :value="item.id"/>
|
|
|
+ <el-form-item label="组织机构:" prop="departmentId">
|
|
|
+ <el-select v-model="form.departmentId" filterable clearable placeholder="全部">
|
|
|
+ <el-option v-for="item in departmentArr" :key="item.id" :label="item.name" :value="item.id"/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="时间:" class="date-picker-left">
|
|
|
+ <el-form-item label="时间:" class="date-picker-left" prop="startTime">
|
|
|
<el-date-picker
|
|
|
v-model="form.startTime"
|
|
|
type="datetime"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
placeholder="开始时间">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="-" class="date-picker-right">
|
|
|
+ <el-form-item label="-" class="date-picker-right" prop="endTime">
|
|
|
<el-date-picker
|
|
|
v-model="form.endTime"
|
|
|
type="datetime"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
placeholder="截止时间">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
@@ -100,7 +102,21 @@
|
|
|
getdepartmentArr() {
|
|
|
GetDepartmentTree().then(res => {
|
|
|
if(res.code == 200) {
|
|
|
- this.departmentArr = res.data.Rows
|
|
|
+ let arr = []
|
|
|
+ res.data.data.forEach(level1 => {
|
|
|
+ arr.push({id: level1.id, name: level1.departmentname})
|
|
|
+ if(level1.children && level1.children.length > 0) {
|
|
|
+ level1.children.forEach(level2 => {
|
|
|
+ arr.push({id: level2.id, name: level1.departmentname+'-'+level2.departmentname})
|
|
|
+ if(level2.children && level2.children.length > 0) {
|
|
|
+ level2.children.forEach(level3 => {
|
|
|
+ arr.push({id: level3.id, name: level1.departmentname+'-'+level2.departmentname+'-'+level3.departmentname})
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.departmentArr = arr
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -109,7 +125,7 @@
|
|
|
this.getList()
|
|
|
},
|
|
|
handleReset() {
|
|
|
- this.form = { departmentId: "", startTime: "", endTime: "" }
|
|
|
+ this.$refs.form.resetFields()
|
|
|
this.getList()
|
|
|
},
|
|
|
timeFormatter(row) {
|