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