This commit is contained in:
parent
2a408b2706
commit
fe600b762c
3
App.vue
3
App.vue
|
@ -757,6 +757,9 @@ export default {
|
||||||
// /deep/.uni-scroll-view-content{
|
// /deep/.uni-scroll-view-content{
|
||||||
// height: 350px !important;
|
// height: 350px !important;
|
||||||
// }
|
// }
|
||||||
|
/deep/.uni-picker-view-wrapper uni-picker-view-column:nth-child(1) {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
/deep/uni-page-body {
|
/deep/uni-page-body {
|
||||||
background-color: #f7f7f7 !important;
|
background-color: #f7f7f7 !important;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
//生产环境
|
//生产环境
|
||||||
const PROT = "https://"//生产需替换
|
const PROT = "https://"//生产需替换
|
||||||
const ROOTHOST = "admin.sjajk.com";//生产需替换
|
// const ROOTHOST = "admin.sjajk.com";//生产需替换
|
||||||
//测试环境
|
//测试环境
|
||||||
// const PROT = "http://"
|
// const PROT = "http://"
|
||||||
// const ROOTHOST = "47.75.182.93:8090";
|
// const ROOTHOST = "47.75.182.93:8090";
|
||||||
// const ROOTHOST = "1.92.152.160";
|
// const ROOTHOST = "1.92.152.160";
|
||||||
// const ROOTHOST = "1.92.152.160";
|
// const ROOTHOST = "1.92.152.160";
|
||||||
// const ROOTHOST1 = "sausers.blxinchuang.com";
|
const ROOTHOST = "sausers.blxinchuang.com";
|
||||||
// const ROOTHOST = "192.168.2.15:8187";
|
// const ROOTHOST = "192.168.2.15:8187";
|
||||||
// const ROOTHOST = "120.46.52.165";
|
// const ROOTHOST = "120.46.52.165";
|
||||||
// const ROOTHOST = "192.168.0.115:8187";
|
// const ROOTHOST = "192.168.0.115:8187";
|
||||||
|
|
|
@ -126,6 +126,7 @@ export default {
|
||||||
data.multiArray[0] = monthDay;
|
data.multiArray[0] = monthDay;
|
||||||
data.multiArray[1] = hours;
|
data.multiArray[1] = hours;
|
||||||
data.multiArray[2] = minute;
|
data.multiArray[2] = minute;
|
||||||
|
|
||||||
this.multiArray = data.multiArray;
|
this.multiArray = data.multiArray;
|
||||||
this.multiIndex = data.multiIndex;
|
this.multiIndex = data.multiIndex;
|
||||||
},
|
},
|
||||||
|
@ -194,13 +195,11 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
bindStartMultiPickerChange(e) {
|
bindStartMultiPickerChange(e) {
|
||||||
console.log(e);
|
|
||||||
this.multiIndex = e.detail.value;
|
this.multiIndex = e.detail.value;
|
||||||
let da = this.multiArray;
|
let da = this.multiArray;
|
||||||
let di = e.detail.value;
|
let di = e.detail.value;
|
||||||
|
|
||||||
let caseDate = da[1][di[1]].replace('时', ':') + this.timeFormat(da[2][di[2]].replace('分', ''));
|
let caseDate = da[1][di[1]].replace('时', ':') + this.timeFormat(da[2][di[2]].replace('分', ''));
|
||||||
|
|
||||||
let appointTime = new Date(caseDate.replace(/-/g,'/')).getTime() / 1000;
|
let appointTime = new Date(caseDate.replace(/-/g,'/')).getTime() / 1000;
|
||||||
if (appointTime < new Date().getTime() / 1000) {
|
if (appointTime < new Date().getTime() / 1000) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|
|
@ -89,7 +89,7 @@
|
||||||
},
|
},
|
||||||
beginTime: {
|
beginTime: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "00:30"
|
default: "00:00"
|
||||||
},
|
},
|
||||||
endTime: {
|
endTime: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -113,7 +113,9 @@
|
||||||
handler(val) {
|
handler(val) {
|
||||||
if (val && val.length) {
|
if (val && val.length) {
|
||||||
this.initOnload()
|
this.initOnload()
|
||||||
|
console.log('11111',val)
|
||||||
}else{
|
}else{
|
||||||
|
console.log('22222',val)
|
||||||
this.orderTimeArr={}
|
this.orderTimeArr={}
|
||||||
this.initOnload()
|
this.initOnload()
|
||||||
}
|
}
|
||||||
|
@ -248,7 +250,6 @@
|
||||||
// 时间选择事件
|
// 时间选择事件
|
||||||
selectTimeEvent(index, item) {
|
selectTimeEvent(index, item) {
|
||||||
if (this.isQuantum) {
|
if (this.isQuantum) {
|
||||||
console.log("333333")
|
|
||||||
return this.handleSelectQuantum(index, item)
|
return this.handleSelectQuantum(index, item)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,103 +3,524 @@
|
||||||
<view class="timeView">
|
<view class="timeView">
|
||||||
<view class="timeView-top">
|
<view class="timeView-top">
|
||||||
<span class="dx_title">是否接单 <!-- <text class="switchTxt">{{switchTxt=='true'?'接单':'不接单'}}</text> --></span>
|
<span class="dx_title">是否接单 <!-- <text class="switchTxt">{{switchTxt=='true'?'接单':'不接单'}}</text> --></span>
|
||||||
<switch checked style="transform:scale(0.7)" @change="switch1Change"/>
|
<switch :checked='isTrue' style="transform:scale(0.7)" @change="switch1Change"/>
|
||||||
</view>
|
</view>
|
||||||
<view class="selectTimt">
|
<view class="selectTimt">
|
||||||
<view class="dx_title">选择接单时问</view>
|
<view class="dx_title">选择接单时问</view>
|
||||||
<view class="selectTimt-bottom">
|
<view class="selectTimt-bottom">
|
||||||
<picker class="selectTimt-time" mode="time" :value="starTime" :start="starTime" end="23:59" @change="bindTimeChange">
|
<hTimePicker class="selectTimt-time" dayNum='0' sTime="0" cTime="23" interval="30" @changeTime="bindTimeChange">
|
||||||
<view class="selectTimt-time-title">开始时间</view>
|
<view slot="pCon" class="changeTime">
|
||||||
<view class="uni-input">{{starTime}}</view>
|
<view class="selectTimt-time-title">开始时间</view>
|
||||||
</picker>
|
<view class="uni-input">{{starTime}}</view>
|
||||||
<picker class="selectTimt-time" mode="time" :value="endTime" start="00:00" end="23:59" @change="bindTimeChangeEndTime">
|
</view>
|
||||||
<view class="selectTimt-time-title">结束时间</view>
|
</hTimePicker>
|
||||||
<view class="uni-input">
|
<hTimePickerEnd class="selectTimt-time" dayNum='0' sTime="0" cTime="23" interval="30" @changeTime="bindTimeChangeEndTime">
|
||||||
<span style="margin-right: 5px;">次日</span>
|
<view slot="pCon" class="changeTime">
|
||||||
<span>{{endTime}}</span>
|
<view class="selectTimt-time-title">结束时间</view>
|
||||||
</view>
|
<view class="uni-input">
|
||||||
</picker>
|
<span style="margin-right: 5px;">次日</span>
|
||||||
|
<span>{{endTime}}</span>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</hTimePickerEnd>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<times selectedTabColor="#28BA92" selectedItemColor="#28BA92" @change="getTime" :timeInterval="0.5" :appointTime="msList"
|
<view class="container-top">
|
||||||
:isMultiple="true" :disableTimeSlot = "disableTimeSlot"></times>
|
<span>设置不可接单时间</span>
|
||||||
<!-- <its-calendar :sta_num="0" :end_num="24" :int_num="msTimeDate" @getTime="TimeData" @getDate="SelData">
|
<span>(只能设置近3天的时间)</span>
|
||||||
</its-calendar> -->
|
</view>
|
||||||
<view class="dx_view margin-bottom-sm" v-if="msList.length > 0">
|
<scroll-view class="scroll-view_H b-t b-b" scroll-x>
|
||||||
<view class="dx_title">不可接单时间</view>
|
<block v-for="(item,index) in dateArr" :key="index">
|
||||||
<view class="flex align-center flex-wrap ">
|
<div class="flex-box" @click="selectDateEvent(index,item)" :class="{ borderb: index==dateActive}">
|
||||||
<view v-for="(item,index) in msList" :key="index" class="btn flex align-center margin-top">
|
<view class="date-box" :style="{color:index==dateActive?selectedTabColor:'#333'}">
|
||||||
<view>{{item}}</view>
|
<text class="fontw">{{item.week}}</text>
|
||||||
<view class="margin-left-sm" @tap.stop="bindupdata(index,item)">x</view>
|
<text>{{item.date}}</text>
|
||||||
|
</view>
|
||||||
|
</div>
|
||||||
|
</block>
|
||||||
|
</scroll-view>
|
||||||
|
<view class="time-box">
|
||||||
|
<view class="item" v-for="(item,index) in today" :key="index" @click="selectTime(index,item)">
|
||||||
|
<view class="item-box" :class="[item.isSelected==false?'disable':'active']">
|
||||||
|
<text>{{item.artificerTime}}</text>
|
||||||
|
<text class="all">{{item.title}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="sub" @click="sub()" v-if="switchTxt==true">保存选择1</view>
|
<view class="sub" @click="sub()">保存选择</view>
|
||||||
<view class="sub" @click="sub()" v-if="switchTxt==false">保存选择2</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import hTimePicker from "@/components/h-timePicker/h-timePicker.vue";
|
||||||
|
import hTimePickerEnd from "@/components/h-timePicker/h-timePickerEnd.vue";
|
||||||
import {
|
import {
|
||||||
currentTime,
|
tomorrow,
|
||||||
|
dayAfterTomorrow,
|
||||||
initData,
|
initData,
|
||||||
tomorrow
|
initTime,
|
||||||
|
timeStamp,
|
||||||
|
currentTime
|
||||||
} from '../../utils/date.js'
|
} from '../../utils/date.js'
|
||||||
import times from '@/components/pretty-times/pretty-times.vue'
|
import times from '@/components/pretty-times/pretty-times.vue'
|
||||||
import itsCalendar from '@/components/its-calendar/its-calendar.vue';
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
itsCalendar,
|
times,
|
||||||
times
|
hTimePicker,
|
||||||
|
hTimePickerEnd
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
starTime:'',
|
today: [
|
||||||
|
{
|
||||||
|
artificerTime: '00:00',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
|
||||||
|
}, {
|
||||||
|
artificerTime: '00:30',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '01:00',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '01:30',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '02:00',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '02:30',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '03:00',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '03:30',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '04:00',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '04:30',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '05:00',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '05:30',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '06:00',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '06:30',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '07:00',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '07:30',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '08:00',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '08:30',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '09:00',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '09:30',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '10:00',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '10:30',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '11:00',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '11:30',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '12:00',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '12:30',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '13:00',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '13:30',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '14:00',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '14:30',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '15:00',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '15:30',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '16:00',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '16:30',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '17:00',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '17:30',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '18:00',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '18:30',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '19:00',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '19:30',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '20:00',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '20:30',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '21:00',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '21:30',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '22:00',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '22:30',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '23:00',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}, {
|
||||||
|
artificerTime: '23:30',
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
}
|
||||||
|
],
|
||||||
|
checkbox1: [],
|
||||||
|
selectedTabColor:'rgb(40, 186, 146)',
|
||||||
|
dateActive: 0, //选中的日期索引
|
||||||
|
dateArr: [], //日期数据
|
||||||
|
multiSelector: '',
|
||||||
|
isTrue: true,
|
||||||
|
starTime:'00:00',
|
||||||
endTime: '00:00',
|
endTime: '00:00',
|
||||||
endTimes:'23:30',
|
|
||||||
appointTime:[],
|
appointTime:[],
|
||||||
disableTimeSlot:[],
|
disableTimeSlot:[],
|
||||||
msTimeDate: 0,
|
|
||||||
newmsList: [],
|
newmsList: [],
|
||||||
msList: [],
|
msList: [],
|
||||||
startTime: '',
|
startTime: '',
|
||||||
yearsDate: '',
|
yearsDate: '',
|
||||||
switchTxt:'',
|
switchTxt:'',
|
||||||
timeCurrent:'',
|
timeCurrent:'',
|
||||||
tomorrowTime:''
|
tomorrowTime:'',
|
||||||
|
selected:[],
|
||||||
|
timeData:[],
|
||||||
|
timeList:''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
if (this.$queue.getData('msTimeDate')) {
|
|
||||||
this.msTimeDate = parseInt(this.$queue.getData('msTimeDate'));
|
|
||||||
} else {
|
|
||||||
this.msTimeDate = 60;
|
|
||||||
}
|
|
||||||
if(this.timeCurrent==''){
|
if(this.timeCurrent==''){
|
||||||
this.timeCurrent=tomorrow().tomorrow+' '+this.endTime;
|
this.timeCurrent=tomorrow().tomorrow+' '+this.endTime;
|
||||||
}
|
}
|
||||||
this.starTime=currentTime().times;
|
// this.tomorrowTime=currentTime().date+' '+currentTime().times;
|
||||||
this.tomorrowTime=currentTime().date+' '+currentTime().times;
|
this.timeList=currentTime().date;
|
||||||
|
this.getMsTime(currentTime().date);
|
||||||
var date = new Date();
|
this.initOnload();
|
||||||
var year = date.getFullYear();
|
this.getTimeMs(currentTime().myDate)
|
||||||
let month = (parseInt(date.getMonth()) + 1) > 9 ? (parseInt(date.getMonth()) + 1) : "0" + (parseInt(
|
|
||||||
date.getMonth()) + 1) // 当前月份
|
|
||||||
let days = (date.getDate()) > 9 ? date.getDate() : "0" + date.getDate() //当前日期
|
|
||||||
let fullDate = `${month}-${days}`
|
|
||||||
let Time = year + '-' + fullDate
|
|
||||||
this.yearsDate = Time;
|
|
||||||
// this.getMsTime(Time);
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
isToday(date){
|
||||||
|
const today = new Date();
|
||||||
|
return date.getDate() === today.getDate() // 比较日期
|
||||||
|
&& date.getMonth() === today.getMonth() // 比较月份
|
||||||
|
&& date.getFullYear() === today.getFullYear(); // 比较年份
|
||||||
|
},
|
||||||
|
getTimeMs(someDate){
|
||||||
|
// const someDate = new Date(); // 假设你有一个日期对象
|
||||||
|
var data=[];
|
||||||
|
if (this.isToday(someDate)) {
|
||||||
|
var time=currentTime().times
|
||||||
|
for(var i=0;i<this.today.length;i++){
|
||||||
|
if(time<=this.today[i].artificerTime){
|
||||||
|
data.push({
|
||||||
|
artificerTime: this.today[i].artificerTime,
|
||||||
|
isSelected: true,
|
||||||
|
disable:true,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
data.push({
|
||||||
|
artificerTime: this.today[i].artificerTime,
|
||||||
|
isSelected: false,
|
||||||
|
disable:false,
|
||||||
|
title:'不可预约',
|
||||||
|
createTime:currentTime().date
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.today=data
|
||||||
|
} else {
|
||||||
|
for(var i=0;i<this.today.length;i++){
|
||||||
|
data.push({
|
||||||
|
artificerTime: this.today[i].artificerTime,
|
||||||
|
isSelected: true,
|
||||||
|
disable:true,
|
||||||
|
title:'可预约',
|
||||||
|
createTime:this.timeList
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.today=data;
|
||||||
|
console.log("这个日期不是今天");
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
selectTime(index,item){
|
||||||
|
var data = [];
|
||||||
|
if(item.disable==true){
|
||||||
|
if(item.isSelected==true){
|
||||||
|
item.isSelected=false;
|
||||||
|
item.title='不可预约';
|
||||||
|
|
||||||
|
}else{
|
||||||
|
item.isSelected=true;
|
||||||
|
item.title='可预约';
|
||||||
|
}
|
||||||
|
var index = this.selected.indexOf(item);
|
||||||
|
if(item.huixian==false){//回显的时候反选
|
||||||
|
item.huixian=true
|
||||||
|
this.selected.splice(index, 1);
|
||||||
|
}else{
|
||||||
|
if (index === -1) {
|
||||||
|
this.selected.push(item);
|
||||||
|
} else {
|
||||||
|
this.selected.splice(index, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.timeData=this.selected;
|
||||||
|
console.log("this.timeData",this.timeData)
|
||||||
|
}else{
|
||||||
|
console.log("时间过了")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 日期选择事件
|
||||||
|
selectDateEvent(index, item) {
|
||||||
|
const today = new Date();
|
||||||
|
this.dateActive = index
|
||||||
|
this.selectDate = item.date
|
||||||
|
if(item.week=='明天'){
|
||||||
|
this.selected=[];
|
||||||
|
this.timeList=tomorrow().tomorrow;
|
||||||
|
this.getTimeMs(tomorrow().todayT)
|
||||||
|
}else if(item.week=='后天'){
|
||||||
|
this.selected=[];
|
||||||
|
this.timeList=dayAfterTomorrow().dayAfterTomorrow;
|
||||||
|
this.getTimeMs(dayAfterTomorrow().todayD)
|
||||||
|
}else{
|
||||||
|
this.selected=[];
|
||||||
|
this.timeList=currentTime().date;
|
||||||
|
this.getTimeMs(today)
|
||||||
|
}
|
||||||
|
this.initOnload()
|
||||||
|
this.getMsTime(this.timeList)
|
||||||
|
},
|
||||||
|
initOnload() {
|
||||||
|
var danqian=initData() // 日期栏初始化
|
||||||
|
// this.dateArr = initData() // 日期栏初始化
|
||||||
|
let newObj = [];
|
||||||
|
for (let i = 0; i < 3; i++) {
|
||||||
|
let key = danqian[i];
|
||||||
|
if (key.week == '今天') {
|
||||||
|
key.week = "今天"
|
||||||
|
} else if (key.week == "明天") {
|
||||||
|
key.week = "明天"
|
||||||
|
|
||||||
|
} else if (key.week == '后天') {
|
||||||
|
key.week = "后天";
|
||||||
|
|
||||||
|
}
|
||||||
|
newObj.push(key)
|
||||||
|
}
|
||||||
|
this.dateArr = newObj
|
||||||
|
|
||||||
|
},
|
||||||
bindTimeChange: function(e) {// 当天接单开始时间
|
bindTimeChange: function(e) {// 当天接单开始时间
|
||||||
this.starTime = e.detail.value;
|
this.starTime = e;
|
||||||
this.tomorrowTime=currentTime().date+' '+this.starTime;
|
this.tomorrowTime=currentTime().date+' '+this.starTime;
|
||||||
},
|
},
|
||||||
bindTimeChangeEndTime(e){//次日接单结束时间
|
bindTimeChangeEndTime(e){//次日接单结束时间
|
||||||
this.endTime = e.detail.value;
|
this.endTime = e;
|
||||||
this.timeCurrent=tomorrow().tomorrow+' '+this.endTime;
|
this.timeCurrent=tomorrow().tomorrow+' '+this.endTime;
|
||||||
},
|
},
|
||||||
switch1Change: function (e) {
|
switch1Change: function (e) {
|
||||||
|
@ -116,20 +537,19 @@
|
||||||
sfJdan(time){//是否接单
|
sfJdan(time){//是否接单
|
||||||
var data={
|
var data={
|
||||||
flag:time,
|
flag:time,
|
||||||
userId:uni.getStorageSync('userId')
|
artificerId:uni.getStorageSync('artificerId')
|
||||||
}
|
}
|
||||||
this.$Request.postT('/app/artificerTime/setArtificerAccept',data).then(res => {
|
this.$Request.postT('/app/artificerTime/setArtificerAccept',data).then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.$queue.showToast('设置成功!')
|
this.$queue.showToast('设置成功!')
|
||||||
|
this.getMsTime(this.timeList)
|
||||||
} else {
|
} else {
|
||||||
this.$queue.showToast(res.msg);
|
this.$queue.showToast(res.msg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getTime(time){
|
getTime(time){
|
||||||
|
|
||||||
this.msList=time;
|
this.msList=time;
|
||||||
|
|
||||||
},
|
},
|
||||||
sub() {
|
sub() {
|
||||||
this.saveMangShi();
|
this.saveMangShi();
|
||||||
|
@ -165,69 +585,183 @@
|
||||||
if (!over) {
|
if (!over) {
|
||||||
this.msList.splice(index1, 1)
|
this.msList.splice(index1, 1)
|
||||||
} else {
|
} else {
|
||||||
this.$queue.showToast('当前时间已被用户下单,禁止删除!')
|
ithis.$queue.showToast('当前时间已被用户下单,禁止删除!')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
saveMangShi() {
|
saveMangShi() {
|
||||||
// artificerId:uni.getStorageSync('artificerId')
|
var time=[];
|
||||||
|
for(var i=0;i<this.timeData.length;i++){
|
||||||
|
time.push(
|
||||||
|
this.timeData[i].createTime+' '+this.timeData[i].artificerTime
|
||||||
|
)
|
||||||
|
}
|
||||||
var data={
|
var data={
|
||||||
idleTime:this.tomorrowTime+','+this.timeCurrent,
|
idleTime:this.tomorrowTime+','+this.timeCurrent,
|
||||||
busyTime:this.msList.toString(),
|
busyTime:time.toString(),
|
||||||
userId:uni.getStorageSync('userId')
|
artificerId:uni.getStorageSync('artificerId')
|
||||||
}
|
}
|
||||||
this.$Request.postT('/app/artificerTime/setArtificerTime',data).then(res => {
|
this.$Request.postT('/app/artificerTime/setArtificerTime',data).then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.$queue.showToast('设置成功!')
|
this.$queue.showToast('设置成功!')
|
||||||
|
this.getMsTime(this.timeList)
|
||||||
} else {
|
} else {
|
||||||
this.$queue.showToast(res.msg);
|
this.$queue.showToast(res.msg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getMsTime(artificerDate) {
|
getMsTime(artificerDate) {
|
||||||
this.yearsDate = artificerDate;
|
// this.yearsDate = artificerDate;
|
||||||
this.$Request.getT('/selectArtificerTimeByArtificerId?userId=' + uni.getStorageSync('userId') + '&artificerDate=' + artificerDate).then(res => {
|
this.$Request.getT('/app/artificerTime/selectArtificerTimeByArtificerId?artificerId=' + uni.getStorageSync('artificerId') + '&artificerDate=' + artificerDate).then(res => {
|
||||||
if (res && res.code == 0 && res.data) {
|
if (res.code == 0) {
|
||||||
this.msList = [];
|
var data=[];
|
||||||
this.newmsList = res.data;
|
for(var i=0;i<res.data.length;i++){
|
||||||
this.msList = res.data.map((item)=> item.artificerTime);
|
data.push({
|
||||||
console.log('getMsTime',this.msList);
|
artificerTime: res.data[i].artificerTime,
|
||||||
uni.$emit("sendChildMsList",this.msList);
|
isSelected: false,
|
||||||
}
|
disable:true,
|
||||||
|
title:'不可预约',
|
||||||
|
createTime:res.data[i].artificerDate,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.today.forEach(item1 => {
|
||||||
|
let item2 = data.find(item => item.artificerTime == item1.artificerTime);
|
||||||
|
if(item2){
|
||||||
|
item1.isSelected=false;
|
||||||
|
item1.title='不可预约';
|
||||||
|
item1.huixian=false;
|
||||||
|
}else{
|
||||||
|
item1.isSelected=true
|
||||||
|
item1.title='可预约'
|
||||||
|
item1.huixian=true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var jintian=currentTime().date;//今天
|
||||||
|
var mingtian=tomorrow().tomorrow;//明天
|
||||||
|
var houtian=dayAfterTomorrow().dayAfterTomorrow;//后天
|
||||||
|
if (res.acceptOrders == 1) {
|
||||||
|
this.isTrue = true
|
||||||
|
} else if (res.acceptOrders == 2) {
|
||||||
|
this.isTrue = false
|
||||||
|
}
|
||||||
|
if(res.startTime){
|
||||||
|
this.starTime=res.startTime.slice(11,16);
|
||||||
|
this.tomorrowTime=jintian+' '+this.starTime;
|
||||||
|
}else{
|
||||||
|
// 获取当前时间
|
||||||
|
const now = new Date();
|
||||||
|
// 格式化时间为时分
|
||||||
|
const hours = now.getHours();
|
||||||
|
const minutes = now.getMinutes();
|
||||||
|
// 将分钟划分为半小时
|
||||||
|
let halfHour = false;
|
||||||
|
if (minutes >= 30) {
|
||||||
|
halfHour = true;
|
||||||
|
}
|
||||||
|
// 格式化输出
|
||||||
|
this.starTime = `${hours.toString().padStart(2, '0')}:${halfHour ? '30' : '00'}`;
|
||||||
|
this.tomorrowTime=jintian+' '+this.starTime;
|
||||||
|
}
|
||||||
|
this.endTime=res.endTime.slice(11,16);
|
||||||
|
}else {
|
||||||
|
this.isTrue = false
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
SelData(e) {
|
|
||||||
console.log(e)
|
|
||||||
var date = new Date();
|
|
||||||
var year = date.getFullYear();
|
|
||||||
let Time = year + '-' + e.days
|
|
||||||
this.getMsTime(Time);
|
|
||||||
this.msList = [];
|
|
||||||
},
|
|
||||||
// 时间段数据
|
|
||||||
TimeData(e) {
|
|
||||||
console.log(e, e.days)
|
|
||||||
var date = new Date();
|
|
||||||
var year = date.getFullYear();
|
|
||||||
this.startTime = year + '-' + e.days + ' ' + e.hours
|
|
||||||
this.yearsDate = year + '-' + e.days
|
|
||||||
console.log(this.yearsDate)
|
|
||||||
var hours=e.hours;
|
|
||||||
for(var i=0;i<hours.length;i++){
|
|
||||||
if (!this.msList.includes(hours[i].hours)) {
|
|
||||||
this.msList.push(hours[i].hours);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
console.log('忙时list' + JSON.stringify(this.msList) );
|
|
||||||
|
|
||||||
// this.msList.push(e.hours);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.container-top span:nth-child(1){
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
.container-top span:nth-child(2){
|
||||||
|
font-size: 13px;
|
||||||
|
color: #ccc;
|
||||||
|
}
|
||||||
|
.container-top{
|
||||||
|
width:100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
background: #fff;
|
||||||
|
padding-top: 10px;
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
|
.active{
|
||||||
|
border: 1px solid #28ba92;
|
||||||
|
font-weight: bold;
|
||||||
|
color: rgb(40, 186, 146);
|
||||||
|
}
|
||||||
|
.disable{
|
||||||
|
border: 1px solid #EEEEEE;
|
||||||
|
background: #F1F3F6 !important;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
/deep/.checkbox__inner{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.all{
|
||||||
|
white-space: nowrap;
|
||||||
|
font-size: 10px;
|
||||||
|
padding-top: 5px;
|
||||||
|
}
|
||||||
|
.item-box{
|
||||||
|
width: 100%;
|
||||||
|
height: 50px;
|
||||||
|
padding: 0 21px;
|
||||||
|
background: #fff;
|
||||||
|
font-size: 13px;
|
||||||
|
border-radius: 4px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.item{
|
||||||
|
width: 25%;
|
||||||
|
padding: 0 4px;
|
||||||
|
margin: 10px 0;
|
||||||
|
}
|
||||||
|
.time-box{
|
||||||
|
width:100%;
|
||||||
|
padding: 13px 5px 12px;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
.flex-box .date-box{
|
||||||
|
border: none;
|
||||||
|
display: flex;
|
||||||
|
height: 50px;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-around;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #818181;
|
||||||
|
}
|
||||||
|
.flex-box{
|
||||||
|
display: inline-block;
|
||||||
|
height: 60px;
|
||||||
|
width: 25%;
|
||||||
|
margin: 0 3px 0 3px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
/deep/.uni-scroll-view-content{
|
||||||
|
display:flex;
|
||||||
|
}
|
||||||
|
/deep/.scroll-view_H{
|
||||||
|
width: 100%;
|
||||||
|
white-space: nowrap;
|
||||||
|
height: 75px;
|
||||||
|
background-color: #fff;
|
||||||
|
position: relative;
|
||||||
|
padding-top: 10px;
|
||||||
|
}
|
||||||
|
.borderb {
|
||||||
|
border-bottom: 2px solid rgb(40, 186, 146);
|
||||||
|
}
|
||||||
.selectTimt-time-title{
|
.selectTimt-time-title{
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
|
@ -344,10 +878,7 @@
|
||||||
margin-right: 25rpx;
|
margin-right: 25rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.active {
|
|
||||||
/* background: #FCD202; */
|
|
||||||
/* border: none; */
|
|
||||||
}
|
|
||||||
|
|
||||||
.topView {
|
.topView {
|
||||||
width: 750rpx;
|
width: 750rpx;
|
||||||
|
|
|
@ -8,24 +8,26 @@
|
||||||
<view class="selectTimt">
|
<view class="selectTimt">
|
||||||
<view class="dx_title">选择接单时问</view>
|
<view class="dx_title">选择接单时问</view>
|
||||||
<view class="selectTimt-bottom">
|
<view class="selectTimt-bottom">
|
||||||
<picker class="selectTimt-time" range="halfHours" mode="time" :value="starTime" step="30" start="00:30" end="23:30" @change="bindTimeChange">
|
<hTimePicker class="selectTimt-time" dayNum='0' sTime="0" cTime="23" interval="30" @changeTime="bindTimeChange">
|
||||||
<view class="selectTimt-time-title">开始时间</view>
|
<view slot="pCon" class="changeTime">
|
||||||
<view class="uni-input">{{starTime}}</view>
|
<view class="selectTimt-time-title">开始时间</view>
|
||||||
</picker>
|
<view class="uni-input">{{starTime}}</view>
|
||||||
<picker class="selectTimt-time" mode="time" :value="endTime" start="00:00" end="23:59" @change="bindTimeChangeEndTime">
|
</view>
|
||||||
<view class="selectTimt-time-title">结束时间</view>
|
</hTimePicker>
|
||||||
<view class="uni-input">
|
<hTimePickerEnd class="selectTimt-time" dayNum='0' sTime="0" cTime="23" interval="30" @changeTime="bindTimeChangeEndTime">
|
||||||
<span style="margin-right: 5px;">次日</span>
|
<view slot="pCon" class="changeTime">
|
||||||
<span>{{endTime}}</span>
|
<view class="selectTimt-time-title">结束时间</view>
|
||||||
</view>
|
<view class="uni-input">
|
||||||
</picker>
|
<span style="margin-right: 5px;">次日</span>
|
||||||
|
<span>{{endTime}}</span>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</hTimePickerEnd>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<times selectedTabColor="#28BA92" selectedItemColor="#28BA92" @change="getTime" :timeInterval="0.5" :appointTime="msList"
|
<times selectedTabColor="#28BA92" selectedItemColor="#28BA92" @change="getTime" :timeInterval="0.5" :appointTime="msList"
|
||||||
:isMultiple="true" :disableTimeSlot = "disableTimeSlot"></times>
|
:isMultiple="true" :disableTimeSlot = "disableTimeSlot"></times>
|
||||||
<!-- <its-calendar :sta_num="0" :end_num="24" :int_num="msTimeDate" @getTime="TimeData" @getDate="SelData">
|
|
||||||
</its-calendar> -->
|
|
||||||
<view class="dx_view margin-bottom-sm" v-if="msList.length > 0">
|
<view class="dx_view margin-bottom-sm" v-if="msList.length > 0">
|
||||||
<view class="dx_title">不可接单时间</view>
|
<view class="dx_title">不可接单时间</view>
|
||||||
<view class="flex align-center flex-wrap ">
|
<view class="flex align-center flex-wrap ">
|
||||||
|
@ -42,27 +44,28 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import hTimePicker from "@/components/h-timePicker/h-timePicker.vue";
|
||||||
|
import hTimePickerEnd from "@/components/h-timePicker/h-timePickerEnd.vue";
|
||||||
import {
|
import {
|
||||||
currentTime,
|
currentTime,
|
||||||
initData,
|
initData,
|
||||||
tomorrow
|
tomorrow
|
||||||
} from '../../utils/date.js'
|
} from '../../utils/date.js'
|
||||||
import times from '@/components/pretty-times/pretty-times.vue'
|
import times from '@/components/pretty-times/pretty-times.vue'
|
||||||
import itsCalendar from '@/components/its-calendar/its-calendar.vue';
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
itsCalendar,
|
times,
|
||||||
times
|
hTimePicker,
|
||||||
|
hTimePickerEnd
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
multiSelector: '',
|
||||||
isTrue: true,
|
isTrue: true,
|
||||||
starTime:'00:00',
|
starTime:'00:00',
|
||||||
endTime: '00:00',
|
endTime: '00:00',
|
||||||
endTimes:'23:30',
|
|
||||||
appointTime:[],
|
appointTime:[],
|
||||||
disableTimeSlot:[],
|
disableTimeSlot:[],
|
||||||
msTimeDate: 0,
|
|
||||||
newmsList: [],
|
newmsList: [],
|
||||||
msList: [],
|
msList: [],
|
||||||
startTime: '',
|
startTime: '',
|
||||||
|
@ -73,34 +76,20 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
if (this.$queue.getData('msTimeDate')) {
|
|
||||||
this.msTimeDate = parseInt(this.$queue.getData('msTimeDate'));
|
|
||||||
} else {
|
|
||||||
this.msTimeDate = 60;
|
|
||||||
}
|
|
||||||
if(this.timeCurrent==''){
|
if(this.timeCurrent==''){
|
||||||
this.timeCurrent=tomorrow().tomorrow+' '+this.endTime;
|
this.timeCurrent=tomorrow().tomorrow+' '+this.endTime;
|
||||||
}
|
}
|
||||||
// this.starTime=currentTime().times;
|
// this.tomorrowTime=currentTime().date+' '+currentTime().times;
|
||||||
this.tomorrowTime=currentTime().date+' '+currentTime().times;
|
this.getMsTime(currentTime().date);
|
||||||
|
|
||||||
var date = new Date();
|
|
||||||
var year = date.getFullYear();
|
|
||||||
let month = (parseInt(date.getMonth()) + 1) > 9 ? (parseInt(date.getMonth()) + 1) : "0" + (parseInt(
|
|
||||||
date.getMonth()) + 1) // 当前月份
|
|
||||||
let days = (date.getDate()) > 9 ? date.getDate() : "0" + date.getDate() //当前日期
|
|
||||||
let fullDate = `${month}-${days}`
|
|
||||||
let Time = year + '-' + fullDate
|
|
||||||
this.yearsDate = Time;
|
|
||||||
this.getMsTime(Time);
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
bindTimeChange: function(e) {// 当天接单开始时间
|
bindTimeChange: function(e) {// 当天接单开始时间
|
||||||
this.starTime = e.detail.value;
|
this.starTime = e;
|
||||||
this.tomorrowTime=currentTime().date+' '+this.starTime;
|
this.tomorrowTime=currentTime().date+' '+this.starTime;
|
||||||
},
|
},
|
||||||
bindTimeChangeEndTime(e){//次日接单结束时间
|
bindTimeChangeEndTime(e){//次日接单结束时间
|
||||||
this.endTime = e.detail.value;
|
this.endTime = e;
|
||||||
this.timeCurrent=tomorrow().tomorrow+' '+this.endTime;
|
this.timeCurrent=tomorrow().tomorrow+' '+this.endTime;
|
||||||
},
|
},
|
||||||
switch1Change: function (e) {
|
switch1Change: function (e) {
|
||||||
|
@ -171,7 +160,6 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
saveMangShi() {
|
saveMangShi() {
|
||||||
// artificerId:uni.getStorageSync('artificerId')
|
|
||||||
var data={
|
var data={
|
||||||
idleTime:this.tomorrowTime+','+this.timeCurrent,
|
idleTime:this.tomorrowTime+','+this.timeCurrent,
|
||||||
busyTime:this.msList.toString(),
|
busyTime:this.msList.toString(),
|
||||||
|
@ -180,65 +168,57 @@
|
||||||
this.$Request.postT('/app/artificerTime/setArtificerTime',data).then(res => {
|
this.$Request.postT('/app/artificerTime/setArtificerTime',data).then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.$queue.showToast('设置成功!')
|
this.$queue.showToast('设置成功!')
|
||||||
|
this.getMsTime(currentTime().date)
|
||||||
} else {
|
} else {
|
||||||
this.$queue.showToast(res.msg);
|
this.$queue.showToast(res.msg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getMsTime(artificerDate) {
|
getMsTime(artificerDate) {
|
||||||
this.yearsDate = artificerDate;
|
// this.yearsDate = artificerDate;
|
||||||
this.$Request.getT('/app/artificerTime/selectArtificerTimeByArtificerId?artificerId=' + uni.getStorageSync('artificerId') + '&artificerDate=' + artificerDate).then(res => {
|
this.$Request.getT('/app/artificerTime/selectArtificerTimeByArtificerId?artificerId=' + uni.getStorageSync('artificerId') + '&artificerDate=' + artificerDate).then(res => {
|
||||||
if (res && res.code == 0 && res.data) {
|
if (res && res.code == 0 && res.data) {
|
||||||
if (res.data) {
|
if (res.acceptOrders == 1) {
|
||||||
if (res.data.acceptOrders == 1) {
|
this.isTrue = true
|
||||||
this.isTrue = true
|
} else if (res.acceptOrders == 2) {
|
||||||
} else if (res.data.acceptOrders == 2) {
|
this.isTrue = false
|
||||||
this.isTrue = false
|
}
|
||||||
|
if(res.startTime){
|
||||||
|
this.starTime=res.startTime.slice(11,18);
|
||||||
|
this.tomorrowTime=currentTime().date+' '+this.starTime;
|
||||||
|
}else{
|
||||||
|
// 获取当前时间
|
||||||
|
const now = new Date();
|
||||||
|
// 格式化时间为时分
|
||||||
|
const hours = now.getHours();
|
||||||
|
const minutes = now.getMinutes();
|
||||||
|
// 将分钟划分为半小时
|
||||||
|
let halfHour = false;
|
||||||
|
if (minutes >= 30) {
|
||||||
|
halfHour = true;
|
||||||
}
|
}
|
||||||
}
|
// 格式化输出
|
||||||
// this.msList = [];
|
this.starTime = `${hours.toString().padStart(2, '0')}:${halfHour ? '30' : '00'}`;
|
||||||
// this.newmsList = res.data;
|
this.tomorrowTime=currentTime().date+' '+this.starTime;
|
||||||
// this.msList = res.data.map((item)=> item.artificerTime);
|
}
|
||||||
// console.log('getMsTime',this.msList);
|
this.endTime=res.endTime.slice(11,18);
|
||||||
|
this.msList = [];
|
||||||
|
|
||||||
|
this.newmsList = res.data;
|
||||||
|
this.msList = res.data.map((item)=> item.createTime);
|
||||||
|
this.disableTimeSlot=this.msList
|
||||||
// uni.$emit("sendChildMsList",this.msList);
|
// uni.$emit("sendChildMsList",this.msList);
|
||||||
}else {
|
}else {
|
||||||
this.isTrue = false
|
this.isTrue = false
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
SelData(e) {
|
|
||||||
console.log(e)
|
|
||||||
var date = new Date();
|
|
||||||
var year = date.getFullYear();
|
|
||||||
let Time = year + '-' + e.days
|
|
||||||
this.getMsTime(Time);
|
|
||||||
this.msList = [];
|
|
||||||
},
|
|
||||||
// 时间段数据
|
|
||||||
TimeData(e) {
|
|
||||||
console.log(e, e.days)
|
|
||||||
var date = new Date();
|
|
||||||
var year = date.getFullYear();
|
|
||||||
this.startTime = year + '-' + e.days + ' ' + e.hours
|
|
||||||
this.yearsDate = year + '-' + e.days
|
|
||||||
console.log(this.yearsDate)
|
|
||||||
var hours=e.hours;
|
|
||||||
for(var i=0;i<hours.length;i++){
|
|
||||||
if (!this.msList.includes(hours[i].hours)) {
|
|
||||||
this.msList.push(hours[i].hours);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
console.log('忙时list' + JSON.stringify(this.msList) );
|
|
||||||
|
|
||||||
// this.msList.push(e.hours);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss">
|
||||||
|
|
||||||
.selectTimt-time-title{
|
.selectTimt-time-title{
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
|
|
|
@ -2,18 +2,34 @@
|
||||||
function strFormat(str) {
|
function strFormat(str) {
|
||||||
return str < 10 ? `0${str}` : str
|
return str < 10 ? `0${str}` : str
|
||||||
}
|
}
|
||||||
// 获取当前时间
|
// 获取明天日期
|
||||||
export function tomorrow() {
|
export function tomorrow() {
|
||||||
|
|
||||||
// 获取当前日期
|
// 获取明天日期
|
||||||
const today = new Date();
|
const todayT= new Date();
|
||||||
// 增加一天
|
// 增加一天
|
||||||
today.setDate(today.getDate() + 1);
|
todayT.setDate(todayT.getDate() + 1);
|
||||||
// 格式化日期为YYYY-MM-DD
|
// 格式化日期为YYYY-MM-DD
|
||||||
const tomorrow = `${today.getFullYear()}-${(today.getMonth() + 1).toString().padStart(2, '0')}-${today.getDate().toString().padStart(2, '0')}`;
|
const tomorrow = `${todayT.getFullYear()}-${(todayT.getMonth() + 1).toString().padStart(2, '0')}-${todayT.getDate().toString().padStart(2, '0')}`;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
tomorrow
|
tomorrow,
|
||||||
|
todayT
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 获取后天日期
|
||||||
|
export function dayAfterTomorrow() {
|
||||||
|
|
||||||
|
// 获取明天日期
|
||||||
|
const todayD = new Date();
|
||||||
|
// 增加一天
|
||||||
|
todayD.setDate(todayD.getDate() + 2);
|
||||||
|
// 格式化日期为YYYY-MM-DD
|
||||||
|
const dayAfterTomorrow = `${todayD.getFullYear()}-${(todayD.getMonth() + 1).toString().padStart(2, '0')}-${todayD.getDate().toString().padStart(2, '0')}`;
|
||||||
|
|
||||||
|
return {
|
||||||
|
dayAfterTomorrow,
|
||||||
|
todayD
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 获取当前时间
|
// 获取当前时间
|
||||||
|
@ -32,7 +48,8 @@ export function currentTime() {
|
||||||
return {
|
return {
|
||||||
date,
|
date,
|
||||||
time,
|
time,
|
||||||
times
|
times,
|
||||||
|
myDate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +76,7 @@ export function timeStamp(time, isQuantum) {
|
||||||
export function initData() {
|
export function initData() {
|
||||||
const time = []
|
const time = []
|
||||||
const date = new Date()
|
const date = new Date()
|
||||||
|
|
||||||
const now = date.getTime() //获取当前日期的时间戳
|
const now = date.getTime() //获取当前日期的时间戳
|
||||||
let timeStr = 3600 * 24 * 1000 //一天的时间戳
|
let timeStr = 3600 * 24 * 1000 //一天的时间戳
|
||||||
let obj = {
|
let obj = {
|
||||||
|
|
Loading…
Reference in New Issue