d1ddb010 by zhangmeng

车辆下单

1 parent 7a02ddee
......@@ -28,10 +28,12 @@
</el-form-item>
<el-form-item :label="language==0?'用车日期':'Date'" prop="date1">
<el-date-picker
v-model="form.date1" :disabled-date="disabledDate"
v-model="form.date1"
:disabled-date="disabledDate"
:placeholder="language==0?'选择日期':'Select date'"
format="YYYY-MM-DD" type="date"
value-format="YYYY-MM-DD"
@focus="handelTime"
/>
</el-form-item>
<el-form-item :label="language==0?'用车时间':'Time'" prop="lvcId">
......@@ -220,12 +222,16 @@ function initDays() {
getBaseInfoByActiveId(route.params.cptId).then(res => {
lform.value = res.data
form.value.date1 = dayjs(lform.value.carStart).format('YYYY-MM-DD')
// form.value.date1 = dayjs(lform.value.carStart).format('YYYY-MM-DD')
}).catch(err => {
console.log(err)
})
}
function handelTime() {
if (!form.value.date1) form.value.date1 = dayjs(lform.value.carStart).format('YYYY-MM-DD')
}
function disabledDate(date) {
if (lform.value.carStart) {
return (date.getTime() < dayjs(lform.value.carStart).valueOf()) || (date.getTime() > dayjs(lform.value.carEnd).valueOf())
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!