2022-05-06 23:47:18 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<!-- 排单模态框 -->
|
|
|
|
|
|
<view class="cu-modal" :class="show?'show':''">
|
|
|
|
|
|
<view class="cu-dialog">
|
|
|
|
|
|
<view class="close-icon" data-modal="showTimeArrangeModal" @click="hideModal">
|
|
|
|
|
|
<text class="cuIcon-close text-red"></text>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="padding bg-white text-left">
|
|
|
|
|
|
<view class="solid-bottom padding padding-bottom-sm">
|
|
|
|
|
|
<view class="flex justify-between align-center margin-bottom-xs padding-top">
|
|
|
|
|
|
<view>
|
|
|
|
|
|
<text class="text-xxl text-main-color"><text class="cuIcon-phone"></text></text>
|
2022-06-13 16:13:10 +08:00
|
|
|
|
<text class="text-bold text-lg margin-lr-xs">{{data.customerPhone}}</text>
|
2022-05-06 23:47:18 +08:00
|
|
|
|
</view>
|
2022-06-16 23:14:43 +08:00
|
|
|
|
<button class="cu-btn line-main-color" @click="makePhoneCall(data.customerPhone)">拨打</button>
|
2022-05-06 23:47:18 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
<view class="text-sm">
|
|
|
|
|
|
拨打电话,按与客户约定的时间填入,完成排单,未完成排单将导致排单超时!
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="padding">
|
|
|
|
|
|
<view class="margin-bottom-xs">
|
|
|
|
|
|
<view class="margin-bottom-xs">选择日期:</view>
|
2022-10-23 00:40:08 +08:00
|
|
|
|
<picker class="relative-view" mode="date" :value="date" :start="curDate" @change="dateChange">
|
|
|
|
|
|
<input class="radius-input" v-model="date" disabled>
|
|
|
|
|
|
<view class="text-lg input-arrow"><text class="cuIcon-triangledownfill"></text></view>
|
|
|
|
|
|
</input>
|
2022-05-06 23:47:18 +08:00
|
|
|
|
</picker>
|
|
|
|
|
|
</view>
|
2022-10-27 00:44:47 +08:00
|
|
|
|
<view>
|
2022-05-06 23:47:18 +08:00
|
|
|
|
<view class="margin-bottom-xs">选择时间:</view>
|
2022-10-27 00:44:47 +08:00
|
|
|
|
<view class="flex justify-start align-center">
|
|
|
|
|
|
<picker class="relative-view" :class="disableTime ? 'readonlyPicker' : ''" mode="time" :value="''" :start="'08:00'" :end="'19:00'"
|
|
|
|
|
|
@change="timeChange" @click="showTime">
|
|
|
|
|
|
<input class="custom-input radius-input" v-model="time" disabled>
|
|
|
|
|
|
<view class="text-lg input-arrow"><text class="cuIcon-triangledownfill"></text></view>
|
|
|
|
|
|
</input>
|
|
|
|
|
|
</picker>
|
|
|
|
|
|
<text class="margin-lr-xs">或</text>
|
|
|
|
|
|
<picker class="relative-view" :class="!disableTime ? 'readonlyPicker' : ''" mode="selector" :value="timeRangeIndex" :range="timeRangeList"
|
|
|
|
|
|
@change="timeRangeChange" @click="showDuration">
|
|
|
|
|
|
<input class="custom-input radius-input" v-model="timeRange" disabled>
|
|
|
|
|
|
<view class="text-lg input-arrow"><text class="cuIcon-triangledownfill"></text></view>
|
|
|
|
|
|
</input>
|
|
|
|
|
|
</picker>
|
|
|
|
|
|
</view>
|
2022-05-06 23:47:18 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="cu-bar bg-white solid-top">
|
|
|
|
|
|
<view class="action margin-0 flex-sub text-black" @click="cannotArrangeTime">无法排单</view>
|
|
|
|
|
|
<view class="action margin-0 flex-sub text-black solid-left" data-modal="showTimeArrangeModal"
|
2022-06-13 16:13:10 +08:00
|
|
|
|
@click="hideModal">按原时间上门</view>
|
2022-05-06 23:47:18 +08:00
|
|
|
|
<view class="action margin-0 flex-sub text-main-color solid-left" data-modal="showTimeArrangeModal"
|
|
|
|
|
|
@click="arrangeTime">确认</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
export default {
|
2022-06-13 16:13:10 +08:00
|
|
|
|
name: 'time-arrange',
|
2022-06-16 23:14:43 +08:00
|
|
|
|
emits: ['showArrangeFailTime', 'editServTime'],
|
2022-05-06 23:47:18 +08:00
|
|
|
|
props: {
|
|
|
|
|
|
show: {
|
|
|
|
|
|
type: Boolean,
|
|
|
|
|
|
default: false
|
|
|
|
|
|
},
|
|
|
|
|
|
data: {
|
|
|
|
|
|
type: Object,
|
|
|
|
|
|
default: {}
|
2022-06-13 16:13:10 +08:00
|
|
|
|
},
|
|
|
|
|
|
curDate: {
|
|
|
|
|
|
type: String,
|
|
|
|
|
|
default: ''
|
2022-05-06 23:47:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
2022-06-13 16:13:10 +08:00
|
|
|
|
date: null,
|
|
|
|
|
|
time: null,
|
2022-05-06 23:47:18 +08:00
|
|
|
|
timeRangeList: [],
|
2022-06-13 16:13:10 +08:00
|
|
|
|
timeRange: null,
|
2022-06-20 18:08:22 +08:00
|
|
|
|
timeRangeIndex: 0,
|
|
|
|
|
|
expectTimeStart: null,
|
2022-10-27 00:44:47 +08:00
|
|
|
|
expectTimeEnd: null,
|
|
|
|
|
|
disableTime: false
|
2022-05-06 23:47:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
onReady() {
|
|
|
|
|
|
this.loadData();
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
async loadData() {
|
2022-06-20 18:08:22 +08:00
|
|
|
|
this.timeRangeList = this.$globalData.timeRangeList;
|
2022-05-06 23:47:18 +08:00
|
|
|
|
},
|
2022-06-13 16:13:10 +08:00
|
|
|
|
resetData() {
|
|
|
|
|
|
this.date = null;
|
|
|
|
|
|
this.time = null;
|
|
|
|
|
|
this.timeRange = null;
|
|
|
|
|
|
this.timeRangeIndex = 0;
|
2022-06-20 18:08:22 +08:00
|
|
|
|
this.expectTimeStart = null,
|
|
|
|
|
|
this.expectTimeEnd = null;
|
2022-05-06 23:47:18 +08:00
|
|
|
|
},
|
|
|
|
|
|
dateChange(e) {
|
2022-06-20 18:08:22 +08:00
|
|
|
|
this.date = e.detail.value;
|
|
|
|
|
|
this.changeExpectTime();
|
2022-10-27 00:44:47 +08:00
|
|
|
|
},
|
|
|
|
|
|
showTime() {
|
|
|
|
|
|
this.disableTime = false;
|
|
|
|
|
|
},
|
|
|
|
|
|
showDuration() {
|
|
|
|
|
|
this.disableTime = true;
|
2022-05-06 23:47:18 +08:00
|
|
|
|
},
|
|
|
|
|
|
timeChange(e) {
|
2022-10-27 00:44:47 +08:00
|
|
|
|
let time = e.detail.value;
|
|
|
|
|
|
if (time === '00:00') {
|
|
|
|
|
|
time = '08:00';
|
|
|
|
|
|
}
|
|
|
|
|
|
this.time = time;
|
|
|
|
|
|
this.timeRange = null;
|
|
|
|
|
|
this.changeExpectTime();
|
2022-05-06 23:47:18 +08:00
|
|
|
|
},
|
|
|
|
|
|
timeRangeChange(e) {
|
|
|
|
|
|
this.timeRangeIndex = e.detail.value;
|
2022-06-20 18:08:22 +08:00
|
|
|
|
this.timeRange = this.timeRangeList[this.timeRangeIndex];
|
2022-10-27 00:44:47 +08:00
|
|
|
|
this.time = null;
|
2022-06-20 18:08:22 +08:00
|
|
|
|
this.changeExpectTime();
|
|
|
|
|
|
},
|
|
|
|
|
|
changeExpectTime() {
|
2022-10-27 00:44:47 +08:00
|
|
|
|
if (this.time) {
|
|
|
|
|
|
this.expectTimeStart = this.date + ' ' + this.time + ':00';
|
|
|
|
|
|
this.expectTimeEnd = null;
|
|
|
|
|
|
} else if (this.timeRange) {
|
|
|
|
|
|
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';
|
|
|
|
|
|
}
|
2022-05-06 23:47:18 +08:00
|
|
|
|
},
|
2022-06-16 23:14:43 +08:00
|
|
|
|
hideModal(e) {
|
|
|
|
|
|
this.resetData();
|
2022-05-06 23:47:18 +08:00
|
|
|
|
uni.$emit(this.$globalFun.HIDE_MODAL, e);
|
|
|
|
|
|
},
|
2022-06-16 23:14:43 +08:00
|
|
|
|
cannotArrangeTime(e) {
|
|
|
|
|
|
this.resetData();
|
2022-06-13 16:13:10 +08:00
|
|
|
|
this.$emit('showArrangeFailTime', e)
|
2022-05-06 23:47:18 +08:00
|
|
|
|
},
|
2022-06-13 16:13:10 +08:00
|
|
|
|
arrangeTime(e) {
|
|
|
|
|
|
if (!(this.time || this.timeRange)) {
|
|
|
|
|
|
uni.showToast({
|
|
|
|
|
|
title: '请选择时间'
|
|
|
|
|
|
})
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2022-06-20 18:08:22 +08:00
|
|
|
|
// let datetime = this.date + ' ' + this.time + ':00';
|
2022-09-12 00:21:19 +08:00
|
|
|
|
this.$emit('editServTime', this.data.orderMasterId, [this.expectTimeStart, this.expectTimeEnd], false, this.data);
|
2022-05-06 23:47:18 +08:00
|
|
|
|
this.hideModal(e);
|
2022-06-16 23:14:43 +08:00
|
|
|
|
},
|
|
|
|
|
|
makePhoneCall(phoneNum) {
|
|
|
|
|
|
uni.makePhoneCall({
|
|
|
|
|
|
phoneNumber: phoneNum
|
|
|
|
|
|
})
|
2022-05-06 23:47:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
.inline-input {
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
width: calc((100% - 48rpx)/2);
|
|
|
|
|
|
vertical-align: middle;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.close-icon {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
right: 35rpx;
|
|
|
|
|
|
top: 35rpx;
|
|
|
|
|
|
z-index: 1;
|
2022-10-23 00:40:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.relative-view {
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.input-arrow {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
right: 10rpx;
|
|
|
|
|
|
top: 25%;
|
2022-05-06 23:47:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
</style>
|