<el-descriptions-item>
<template slot="label">
<span v-if="xinghaoList.inHospitalDateTime" class="redStyle"
>*</span
>入院时间
</template>
<el-form-item prop="inHospitalDateTime">
<el-date-picker
@change="timeChange"
id="inHospitalDateTime"
v-model="formdata.inHospitalDateTime"
type="date"
value-format="timestamp"
placeholder="选择日期"
:picker-options="pickerOptionsStart"
>
</el-date-picker>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<span v-if="xinghaoList.outHospitalDateTime" class="redStyle"
>*</span
>出院时间
</template>
<div class="aaa">
<el-date-picker
@change="timeChange"
style="width: 130px !important"
id="outHospitalDateTime"
v-model="formdata.outHospitalDateTime"
type="date"
placeholder="选择日期"
value-format="timestamp"
:picker-options="pickerOptions"
>
</el-date-picker>
<span
style="
display: inline-block;
color: #333333;
margin-left: 4px;
"
>天数 {{ formdata.hospitalDays || "-" }}
</span>
</div>
</el-descriptions-item>
// 入院时间限制
pickerOptionsStart: {
disabledDate: (time) => {
let endDateVal = this.formdata.outHospitalDateTime;
if (endDateVal) {
return time.getTime() > endDateVal;
}
},
},
// 出院时间限制
pickerOptions: {
disabledDate: (time) => {
let endDateVal = this.formdata.inHospitalDateTime;
if (endDateVal) {
return time.getTime() <= this.formdata.inHospitalDateTime;
}
},
},