<el-col :span="12">
<el-form-item label="日期" prop="estimatedDate">
<el-date-picker
v-model="form.estimatedDate"
value-format="YYYY-MM-DD"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="changeDate"
></el-date-picker>
</el-form-item>
</el-col>
// 时间变化,重新获取用户列表
function changeDate(date) {
if (!date) return
form.value.scheduleStartDate = date[0]
form.value.scheduleEndDate = date[1]
let days = getDistanceDays(date[0], date[1])
form.value.tGsyfScheduleDate = []
for (let i = 0
let time = new Date(date[0]).getTime() + 1000 * 60 * 60 * 24 * i
let newdate = new Date(time)
let year = newdate.getFullYear()
let month =
newdate.getMonth() + 1 < 10
? "0" + (newdate.getMonth() + 1)
: newdate.getMonth() + 1
let day =
newdate.getDate() < 10 ? "0" + newdate.getDate() : newdate.getDate()
newdate = year + "-" + month + "-" + day
// let newdate = afterDate(date[0], i)
form.value.tGsyfScheduleDate.push({
startDate: newdate,
})
}