dingdong-master/pages/order-manage/modal/edit-time-arrange.vue

173 lines
4.9 KiB
Vue
Raw Normal View History

2022-05-09 10:00:16 +08:00
<template>
<!-- 修改时间模态框 -->
<view class="cu-modal" :class="show?'show':''">
<view class="cu-dialog">
<view class="close-icon" data-modal="showEditTimeArrangeModal" @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-09 10:00:16 +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-09 10:00:16 +08:00
</view>
<view class="text-sm">
拨打电话按与客户约定的时间填入完成排单未完成排单将导致排单超时
</view>
</view>
<view class="padding">
<view class="margin-bottom-xs">
<view class="margin-bottom-xs">选择日期</view>
<picker mode="date" :value="date" :start="curDate" @change="dateChange">
<input class="radius-input" v-model="date"></input>
</picker>
</view>
<view>
<view class="margin-bottom-xs">选择时间</view>
2022-06-16 23:14:43 +08:00
<picker mode="time" :value="'08:00'" :start="'08:00'" :end="'20:00'"
2022-05-09 10:00:16 +08:00
@change="timeChange">
<input class="radius-input" v-model="time"></input>
</picker>
2022-06-16 23:14:43 +08:00
<!-- <text class="margin-lr-xs"></text>
2022-05-09 10:00:16 +08:00
<picker class="inline-input" mode="selector" :value="timeRangeIndex" :range="timeRangeList"
@change="timeRangeChange">
<input class="radius-input" v-model="timeRange"></input>
2022-06-16 23:14:43 +08:00
</picker> -->
2022-05-09 10:00:16 +08:00
</view>
</view>
<view class="padding-top-sm padding">
<view class="flex justify-start">
<view class="margin-right">原因选择</view>
<radio-group @change="changeReasonRadio">
<label class="radio margin-right-sm">
<radio style="transform:scale(0.7)" class="main-color" value="customer"
:checked="true" />
<text>客户原因</text>
</label>
<label class="radio">
<radio style="transform:scale(0.7)" class="main-color" value="master" />
<text>师傅原因</text>
</label>
</radio-group>
</view>
<view class="margin-top uni-textarea">
<textarea class="solid padding-sm" maxlength="-1" @input="inputSpecificReason"
placeholder="具体情况(选填)" />
</view>
</view>
</view>
<view class="cu-bar bg-white solid-top">
2022-06-16 23:14:43 +08:00
<view class="action margin-0 flex-sub text-black" data-modal="showEditTimeArrangeModal" @click="cannotArrangeTime">无法排单</view>
2022-05-09 10:00:16 +08:00
<view class="action margin-0 flex-sub text-main-color solid-left" data-modal="showEditTimeArrangeModal"
@click="arrangeTime">确认</view>
</view>
</view>
</view>
</template>
<script>
export default {
2022-06-16 23:14:43 +08:00
name: 'edit-time-arrange',
emits: ['showArrangeFailTime', 'editServTime'],
2022-05-09 10:00:16 +08:00
props: {
show: {
type: Boolean,
default: false
},
data: {
type: Object,
default: {}
2022-06-16 23:14:43 +08:00
},
curDate: {
type: String,
default: ''
2022-06-18 02:03:07 +08:00
},
ifRollback2WS: {
type: Boolean,
default: false
2022-05-09 10:00:16 +08:00
}
},
data() {
return {
date: '',
time: '',
timeRangeList: [],
timeRange: '',
timeRangeIndex: 0
}
},
onReady() {
this.loadData();
},
methods: {
async loadData() {
this.timeRangeList = await this.$api.data('timeRangeList');
2022-06-16 23:14:43 +08:00
},
resetData() {
this.date = null;
this.time = null;
this.timeRange = null;
this.timeRangeIndex = 0;
2022-05-09 10:00:16 +08:00
},
dateChange(e) {
this.date = e.detail.value
},
timeChange(e) {
this.time = e.detail.value;
},
timeRangeChange(e) {
this.timeRangeIndex = e.detail.value;
this.timeRange = this.timeRangeList[this.timeRangeIndex];
},
2022-06-16 23:14:43 +08:00
hideModal(e) {
this.resetData();
uni.$emit(this.$globalFun.HIDE_MODAL, e);
},
cannotArrangeTime(e) {
this.resetData();
this.$emit('showArrangeFailTime', e)
},
2022-06-18 02:03:07 +08:00
async arrangeTime(e) {
2022-06-16 23:14:43 +08:00
if (!(this.time || this.timeRange)) {
uni.showToast({
title: '请选择时间'
})
return;
2022-05-09 10:00:16 +08:00
}
2022-06-16 23:14:43 +08:00
let datetime = this.date + ' ' + (this.time || this.timeRange) + ':00';
2022-06-18 02:03:07 +08:00
this.$emit('editServTime', this.data.orderDetailId, datetime, this.ifRollback2WS);
2022-06-16 23:14:43 +08:00
this.hideModal(e);
2022-05-09 10:00:16 +08:00
},
changeReasonRadio(e) {
this.problemPerson = e.detail.value;
},
inputSpecificReason(e) {
this.specificReason = e.detail.value;
2022-06-16 23:14:43 +08:00
},
makePhoneCall(phoneNum) {
uni.makePhoneCall({
phoneNumber: phoneNum
})
2022-05-09 10:00:16 +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;
}
</style>