预约时间修改为时间段
This commit is contained in:
parent
871dc0d92c
commit
d6e9967d1c
|
|
@ -2,5 +2,33 @@ export default {
|
|||
deptId: 101,
|
||||
from: 'server',
|
||||
initPageNum: 1,
|
||||
initPageSize: 20
|
||||
initPageSize: 20,
|
||||
timeRangeList: [
|
||||
'08:00-08:30',
|
||||
'08:30-09:00',
|
||||
'09:00-09:30',
|
||||
'09:30-10:00',
|
||||
'10:00-10:30',
|
||||
'10:30-11:00',
|
||||
'11:00-11:30',
|
||||
'11:30-12:00',
|
||||
'12:00-12:30',
|
||||
'12:30-13:00',
|
||||
'13:00-13:30',
|
||||
'13:30-14:00',
|
||||
'14:00-14:30',
|
||||
'14:30-15:00',
|
||||
'14:30-15:00',
|
||||
'15:00-15:30',
|
||||
'15:30-16:00',
|
||||
'16:00-16:30',
|
||||
'16:30-17:00',
|
||||
'17:00-17:30',
|
||||
'17:30-18:00',
|
||||
'18:00-18:30',
|
||||
'18:30-19:00',
|
||||
'19:00-19:30',
|
||||
'19:30-20:00'
|
||||
],
|
||||
timeRangeSplit: '-'
|
||||
}
|
||||
|
|
@ -13,8 +13,8 @@ export default {
|
|||
})
|
||||
let userInfo = _this.getCurUserInfo();
|
||||
// request 触发前拼接 url
|
||||
args.url = 'https://www.opsoul.com' + args.url;
|
||||
// args.url = 'http://127.0.0.1:80' + args.url;
|
||||
// args.url = 'https://www.opsoul.com' + args.url;
|
||||
args.url = 'http://127.0.0.1:80' + args.url;
|
||||
// args.url = 'http://192.168.2.42:80' + args.url;
|
||||
|
||||
if (!args.data) {
|
||||
|
|
|
|||
|
|
@ -27,15 +27,15 @@
|
|||
</view>
|
||||
<view>
|
||||
<view class="margin-bottom-xs">选择时间:</view>
|
||||
<picker mode="time" :value="'08:00'" :start="'08:00'" :end="'20:00'"
|
||||
<!-- <picker mode="time" :value="'08:00'" :start="'08:00'" :end="'20:00'"
|
||||
@change="timeChange">
|
||||
<input class="radius-input" v-model="time"></input>
|
||||
</picker>
|
||||
<!-- <text class="margin-lr-xs">或</text>
|
||||
<picker class="inline-input" mode="selector" :value="timeRangeIndex" :range="timeRangeList"
|
||||
<text class="margin-lr-xs">或</text> -->
|
||||
<picker mode="selector" :value="timeRangeIndex" :range="timeRangeList"
|
||||
@change="timeRangeChange">
|
||||
<input class="radius-input" v-model="timeRange"></input>
|
||||
</picker> -->
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-top-sm padding">
|
||||
|
|
@ -96,7 +96,9 @@
|
|||
time: '',
|
||||
timeRangeList: [],
|
||||
timeRange: '',
|
||||
timeRangeIndex: 0
|
||||
timeRangeIndex: 0,
|
||||
expectTimeStart: null,
|
||||
expectTimeEnd: null
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
|
|
@ -104,23 +106,33 @@
|
|||
},
|
||||
methods: {
|
||||
async loadData() {
|
||||
this.timeRangeList = await this.$api.data('timeRangeList');
|
||||
this.timeRangeList = this.$globalData.timeRangeList;
|
||||
},
|
||||
resetData() {
|
||||
this.date = null;
|
||||
this.time = null;
|
||||
this.timeRange = null;
|
||||
this.timeRangeIndex = 0;
|
||||
this.expectTimeStart = null,
|
||||
this.expectTimeEnd = null;
|
||||
},
|
||||
dateChange(e) {
|
||||
this.date = e.detail.value
|
||||
this.date = e.detail.value;
|
||||
this.changeExpectTime();
|
||||
},
|
||||
timeChange(e) {
|
||||
this.time = e.detail.value;
|
||||
},
|
||||
timeRangeChange(e) {
|
||||
this.timeRangeIndex = e.detail.value;
|
||||
this.timeRange = this.timeRangeList[this.timeRangeIndex];
|
||||
this.timeRange = this.timeRangeList[this.timeRangeIndex];
|
||||
this.changeExpectTime();
|
||||
},
|
||||
changeExpectTime() {
|
||||
let timeRangeSplit = this.$globalData.timeRangeSplit;
|
||||
let timeArr = this.timeRange.split(timeRangeSplit);
|
||||
this.expectTimeStart = this.date + ' ' + timeArr[0] + ':00';
|
||||
this.expectTimeEnd = this.date + ' ' + timeArr[1] + ':00';
|
||||
},
|
||||
hideModal(e) {
|
||||
this.resetData();
|
||||
|
|
@ -137,8 +149,8 @@
|
|||
})
|
||||
return;
|
||||
}
|
||||
let datetime = this.date + ' ' + (this.time || this.timeRange) + ':00';
|
||||
this.$emit('editServTime', this.data.orderDetailId, datetime, this.ifRollback2WS);
|
||||
// let datetime = this.date + ' ' + (this.time || this.timeRange) + ':00';
|
||||
this.$emit('editServTime', this.data.orderDetailId, [this.expectTimeStart, this.expectTimeEnd], this.ifRollback2WS);
|
||||
this.hideModal(e);
|
||||
},
|
||||
changeReasonRadio(e) {
|
||||
|
|
|
|||
|
|
@ -27,15 +27,15 @@
|
|||
</view>
|
||||
<view>
|
||||
<view class="margin-bottom-xs">选择时间:</view>
|
||||
<picker mode="time" :value="'08:00'" :start="'08:00'" :end="'20:00'"
|
||||
<!-- <picker mode="time" :value="'08:00'" :start="'08:00'" :end="'20:00'"
|
||||
@change="timeChange">
|
||||
<input class="radius-input" v-model="time" disabled></input>
|
||||
</picker>
|
||||
<!-- <text class="margin-lr-xs">或</text>
|
||||
<picker class="inline-input" mode="selector" :value="timeRangeIndex" :range="timeRangeList"
|
||||
<text class="margin-lr-xs">或</text> -->
|
||||
<picker mode="selector" :value="timeRangeIndex" :range="timeRangeList"
|
||||
@change="timeRangeChange">
|
||||
<input class="radius-input" v-model="timeRange" disabled></input>
|
||||
</picker> -->
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -74,7 +74,9 @@
|
|||
time: null,
|
||||
timeRangeList: [],
|
||||
timeRange: null,
|
||||
timeRangeIndex: 0
|
||||
timeRangeIndex: 0,
|
||||
expectTimeStart: null,
|
||||
expectTimeEnd: null
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
|
|
@ -82,23 +84,33 @@
|
|||
},
|
||||
methods: {
|
||||
async loadData() {
|
||||
this.timeRangeList = await this.$api.data('timeRangeList');
|
||||
this.timeRangeList = this.$globalData.timeRangeList;
|
||||
},
|
||||
resetData() {
|
||||
this.date = null;
|
||||
this.time = null;
|
||||
this.timeRange = null;
|
||||
this.timeRangeIndex = 0;
|
||||
this.expectTimeStart = null,
|
||||
this.expectTimeEnd = null;
|
||||
},
|
||||
dateChange(e) {
|
||||
this.date = e.detail.value
|
||||
this.date = e.detail.value;
|
||||
this.changeExpectTime();
|
||||
},
|
||||
timeChange(e) {
|
||||
this.time = e.detail.value;
|
||||
},
|
||||
timeRangeChange(e) {
|
||||
this.timeRangeIndex = e.detail.value;
|
||||
this.timeRange = this.timeRangeList[this.timeRangeIndex];
|
||||
this.timeRange = this.timeRangeList[this.timeRangeIndex];
|
||||
this.changeExpectTime();
|
||||
},
|
||||
changeExpectTime() {
|
||||
let timeRangeSplit = this.$globalData.timeRangeSplit;
|
||||
let timeArr = this.timeRange.split(timeRangeSplit);
|
||||
this.expectTimeStart = this.date + ' ' + timeArr[0] + ':00';
|
||||
this.expectTimeEnd = this.date + ' ' + timeArr[1] + ':00';
|
||||
},
|
||||
hideModal(e) {
|
||||
this.resetData();
|
||||
|
|
@ -115,8 +127,8 @@
|
|||
})
|
||||
return;
|
||||
}
|
||||
let datetime = this.date + ' ' + (this.time || this.timeRange) + ':00';
|
||||
this.$emit('editServTime', this.data.orderMasterId, datetime);
|
||||
// let datetime = this.date + ' ' + this.time + ':00';
|
||||
this.$emit('editServTime', this.data.orderMasterId, [this.expectTimeStart, this.expectTimeEnd]);
|
||||
this.hideModal(e);
|
||||
},
|
||||
makePhoneCall(phoneNum) {
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@
|
|||
</view>
|
||||
<view class="margin-top-sm">
|
||||
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-time"></text></text>
|
||||
<text>服务时间:{{order.serverTime}}</text>
|
||||
<text>服务时间:{{order.expectTimeStart + '~' + order.expectTimeEnd}}</text>
|
||||
</view>
|
||||
<view class="margin-top-sm" v-if="tabCur !== 0 && tabCur !== 1">
|
||||
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-time"></text></text>
|
||||
|
|
@ -103,10 +103,10 @@
|
|||
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-repair"></text></text>
|
||||
<text>距上门:</text>
|
||||
<uni-countdown :show-colon="false" :backgroundColor="'#eee'"
|
||||
:day="$dateUtil.countDownDiff(order.serverTime).day"
|
||||
:hour="$dateUtil.countDownDiff(order.serverTime).hour"
|
||||
:minute="$dateUtil.countDownDiff(order.serverTime).min"
|
||||
:second="$dateUtil.countDownDiff(order.serverTime).seconds">
|
||||
:day="$dateUtil.countDownDiff(order.expectTimeEnd).day"
|
||||
:hour="$dateUtil.countDownDiff(order.expectTimeEnd).hour"
|
||||
:minute="$dateUtil.countDownDiff(order.expectTimeEnd).min"
|
||||
:second="$dateUtil.countDownDiff(order.expectTimeEnd).seconds">
|
||||
</uni-countdown>
|
||||
</view>
|
||||
<view class="margin-top-sm flex justify-start align-center" v-if="order.subState === 4 && order.chargeReachDate">
|
||||
|
|
@ -560,15 +560,23 @@
|
|||
data: data
|
||||
});
|
||||
},
|
||||
async editServTime(id, datetime, ifRollback2WS) {
|
||||
async editServTime(id, datetimeArr, ifRollback2WS) {
|
||||
// 确定方法名
|
||||
let reqFunName = "updateDetailOrder";
|
||||
if (this.tabCur === 0) {
|
||||
reqFunName = "updateOrder"
|
||||
}
|
||||
let res = await this.$request[reqFunName]({
|
||||
// 确定参数
|
||||
let params = datetimeArr && datetimeArr.length > 1 ? {
|
||||
id: id,
|
||||
expectTimeStart: datetimeArr[0],
|
||||
expectTimeEnd: datetimeArr[1]
|
||||
} : {
|
||||
id: id,
|
||||
revTime: datetime
|
||||
});
|
||||
}
|
||||
|
||||
let res = await this.$request[reqFunName](params);
|
||||
if (res.code === 0) {
|
||||
let finishFlag = false;
|
||||
if (ifRollback2WS) {
|
||||
|
|
@ -576,6 +584,8 @@
|
|||
if (statusUpdateRes && statusUpdateRes.code === 0) {
|
||||
finishFlag = true;
|
||||
}
|
||||
} else {
|
||||
finishFlag = true;
|
||||
}
|
||||
if (finishFlag) {
|
||||
this.reloadMasterOrderPage();
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@
|
|||
</view>
|
||||
<view class="margin-top-sm">
|
||||
<text class="cuIcon-time text-main-color margin-right-xs"></text>
|
||||
<text>预约时间:{{servDetail.serverTime}}</text>
|
||||
<text>预约时间:{{servDetail.expectTimeStart + '~' + servDetail.expectTimeEnd}}</text>
|
||||
</view>
|
||||
<!-- <view class="margin-top-sm">
|
||||
<text class="cuIcon-time text-main-color margin-right-xs"></text>
|
||||
|
|
|
|||
Loading…
Reference in New Issue