<el-form-item prop="year">
<!-- @change=changeYear -->
<el-date-picker
value-format="yyyy"
v-model="leftQuery.year"
:disabled="timeArr.length != 0"
type="year"
placeholder="选择年"
>
</el-date-picker>
</el-form-item>
<el-form-item prop="quarter">
<el-select
clearable
multiple
@change="onValue"
filterable
v-model="quarterArr"
:disabled="timeArr && timeArr.length != 0 ? true :false"
placeholder="请选择季度"
>
<el-option label="第一季度" :value="1" />
<el-option label="第二季度" :value="2" />
<el-option label="第三季度" :value="3" />
<el-option label="第四季度" :value="4" />
</el-select>
</el-form-item>
<el-form-item>
<el-date-picker
@change="zjmlist"
v-model="timeArr"
:disabled="leftQuery.year!=undefined || quarterArr.length != 0"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
></el-date-picker>
</el-form-item>
timeArr.length != 0 原来的写法直接判断length 当el-date-picker被清除时,timeArr已经变为null 读取不到length长度,代码出错不执行