Commit 60ed46bd by 匡雅琴

触达统计页面开发

1 parent a782e62f
...@@ -15,13 +15,22 @@ ...@@ -15,13 +15,22 @@
</div> </div>
</template> </template>
</van-field> </van-field>
<van-field name="跟进备注" label="跟进备注" placeholder="输入备注" :rules="[{ required: true, message: '请填写密码' }]" /> <van-field name="跟进备注" label="跟进备注" v-model="selectFollowForm.followTips" placeholder="输入备注" maxlength="200" />
<van-field name="switch" label="继续跟进"> <van-field name="switch" label="继续跟进">
<template #input> <template #input>
<van-switch v-model="checked" size="24px" /> <van-switch v-model="checked" size="24px" />
</template> </template>
</van-field> </van-field>
<van-field v-model="result" v-show="selectFollowForm.followResultId == 1" is-link readonly name="datetimePicker" label="预约到店" placeholder="请选择到店时间" @click="showDate" /> <van-field
v-show="selectFollowForm.followResultId == 1"
v-model="selectFollowForm.appointmentTime"
is-link
readonly
name="datetimePicker"
label="预约到店"
placeholder="请选择到店时间"
@click="showDate"
/>
<div v-show="showPicker"> <div v-show="showPicker">
<div class="datetime-box"> <div class="datetime-box">
<div class="datetime-picker"> <div class="datetime-picker">
...@@ -29,15 +38,15 @@ ...@@ -29,15 +38,15 @@
<div @click="selectDatetime(item)">{{ item.date }}</div> <div @click="selectDatetime(item)">{{ item.date }}</div>
</div> </div>
</div> </div>
<div>确定</div> <div @click="confirmAppointmentTime">确定</div>
</div> </div>
<van-calendar v-show="!tabIndex" :title="''" :poppable="false" :show-confirm="false" :style="{ height: '400px' }" /> <van-calendar v-show="!tabIndex" color="#3975C6" :show-title="false" :show-mark="false" :poppable="false" :show-confirm="false" :style="{ height: '500px' }" @select="selectDate" />
<van-datetime-picker v-show="tabIndex" type="time" title="选择时间" :min-hour="9" :max-hour="20" /> <van-datetime-picker v-show="tabIndex" type="time" @confirm="confirmTime" :min-hour="minHour" />
</div> </div>
</van-cell-group> </van-cell-group>
<div class="btn-group"> <div class="btn-group">
<van-button block native-type="cancel">取消</van-button> <van-button block native-type="cancel" @click="cancel">取消</van-button>
<van-button block type="primary" native-type="submit">提交</van-button> <van-button block type="primary">提交</van-button>
</div> </div>
</van-form> </van-form>
</van-popup> </van-popup>
...@@ -94,28 +103,35 @@ export default { ...@@ -94,28 +103,35 @@ export default {
datePickList: [ datePickList: [
{ {
index: 0, index: 0,
date: '2022-5-16' date: ''
}, },
{ {
index: 2, index: 2,
date: '10:00' date: ''
} }
], ],
selectFollowForm: { selectFollowForm: {
name: '', name: '',
followResultId: '', followResultId: '',
appointmentDate: '', followTips: '',
appointmentTime: '' appointmentTime: ''
}, },
// 展示预约到店时间 // 展示预约到店时间
showPicker: false, showPicker: false,
//继续跟进按钮 // 继续跟进按钮
checked: true checked: true,
// 当前日期
dayNow: '',
// 时间标签可选最小时间
minHour: ''
} }
}, },
methods: { methods: {
init() { init() {
this.show = true this.show = true
// 获取当前时间
const date = new Date(new Date().getTime() + (parseInt(new Date().getTimezoneOffset() / 60) + 8) * 3600 * 1000)
this.formatterDate(date)
}, },
// 选择跟进结果 // 选择跟进结果
selectFollow(val) { selectFollow(val) {
...@@ -124,14 +140,58 @@ export default { ...@@ -124,14 +140,58 @@ export default {
}, },
// 展示日历表 // 展示日历表
showDate() { showDate() {
console.log(this.showPicker)
this.showPicker = !this.showPicker this.showPicker = !this.showPicker
this.isShow = true
}, },
// 时间选择tab切换 // 时间选择tab切换
selectDatetime(item) { selectDatetime(item) {
console.log(item) console.log(item)
this.tabIndex = item.index this.tabIndex = item.index
},
// 选择日期
selectDate(val) {
console.log(val)
this.formatterDate(val, 2)
},
// 选择时间
confirmTime(val) {
console.log(val)
this.datePickList[1].date = val
},
// 确定选择的日期和时间
confirmAppointmentTime() {
this.selectFollowForm.appointmentTime = this.datePickList[0].date + ' ' + this.datePickList[1].date
console.log(this.selectFollowForm.appointmentTime)
},
// 取消按钮
cancel() {
this.show = false
},
// 提交按钮
primary() {
// 如果选择标签为预约到店,判断日期和时间是否填了
},
// 日期格式转化
formatterDate(val, type) {
let date = new Date(val)
let y = date.getFullYear()
let m = date.getMonth() + 1
m = m < 10 ? '0' + m : m
let h = date.getHours()
h = h < 10 ? '0' + h : h
let d = date.getDate()
d = d < 10 ? '0' + d : d
const time = y + '-' + m + '-' + d
if (!type) {
this.dayNow = time
}
this.datePickList[0].date = time
if (this.dayNow == time) {
this.datePickList[1].date = h + 1 + ':00'
this.minHour = h + 1
return
}
this.datePickList[1].date = '09:00'
this.minHour = ''
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!