Commit 6c8364f5 authored by 刘用法's avatar 刘用法

报备时的下次联系时间不需要做时间校验

parent 456bf7a5
......@@ -16,7 +16,7 @@
<view class="u-flex u-row-between date-box">
<view :class="{'date-item':true,'active':item.day===appointTime}"
@click="dateChange(item,index,dateList)" v-for="(item,index) in dateList" :key="index">
<text class="day">{{ item.day | datefmt('周dd')}}</text>
<text class="day">{{ weekFmt(item.day)}}</text>
<text class="day day1">{{ item.day | datefmt('DD')}}</text>
</view>
</view>
......@@ -36,7 +36,7 @@
:class="{'time-item':true,'active': item.pkey===appointRange}" v-for="(item,index) in timeList"
:key="item.pkey">
<button class="time" :plain="true"
:disabled="item.disabled || (currentDayIndex == 0 && item.pkey <= currentPkey)" :hair-line="false"
:disabled="item.disabled || (currentDayIndex == 0 && item.pkey.replace(/[^0-9]/ig,'') <= currentPkey && needTodyClipping)" :hair-line="false"
@click="timeChange(item,index,timeList)">
{{item.name}}
</button>
......@@ -63,7 +63,10 @@
return "预约时间"
}
},
type: { // subscribe 预约; filing 报备
type: String,
default: 'subscribe'
},
dateList: {
type: Array,
default(){
......@@ -102,7 +105,7 @@
appointRangeText: '',
num: 0,
hasLast: false,
currentPkey: 'appointment_range_' + new Date().getHours(),
currentPkey: new Date().getHours(),
currentDayIndex: -1,
}
},
......@@ -111,9 +114,14 @@
this.appointTime = null
this.appointRange = null
this.appointRangeText = ''
this.currentDayIndex = -1
}
},
computed: {
needTodyClipping() { // 报备不限制当天已经过去的时间
return this.type != 'filing'
}
},
computed: {},
methods: {
getDateList() {
// 获取日期
......@@ -176,6 +184,19 @@
}
this.$emit('week-change', data)
},
weekFmt(day) {
let morrow = this.moment(now).add(1, 'days')
let content
if(day == now) {
content = this.moment(day).format('今天')
} else if(day == morrow) {
content = this.moment(day).format('明天')
} else {
content = this.moment(day).format('周dd')
}
return content
},
}
}
</script>
......
......@@ -54,6 +54,7 @@
:dateList="dateList"
:title="appointTitle"
:timeList="timeList"
:type="timeType"
@dateChange="dateChange"
@timeChange="timeChange"
@weekChange="weekChange"
......@@ -151,6 +152,12 @@ export default {
}
return true;
},
types() {
return {'报备': 'filing', '改约': 'subscribe'}
},
timeType() {
return this.types[this.options[this.curTab].name]
}
},
async onLoad(e) {
......@@ -233,6 +240,7 @@ export default {
self.trace.remark = '';
self.traceDate = null;
self.timeRange = null;
self.dateItem = null
if (self.trace.reasonType == '改约') {
self.showRemark = true;
if (self.dateList && self.timeList) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment