初始上传
This commit is contained in:
224
addon/cashier/source/os/pages/reserve/config.vue
Executable file
224
addon/cashier/source/os/pages/reserve/config.vue
Executable file
@@ -0,0 +1,224 @@
|
||||
<template>
|
||||
<base-page>
|
||||
<view class="common-wrap common-form">
|
||||
<view class="common-title">预约设置</view>
|
||||
<view class="common-form-item">
|
||||
<label class="form-label">预约时间</label>
|
||||
<view class="form-block">
|
||||
<checkbox-group class="form-checkbox-group" @change="checkboxChange">
|
||||
<label class="form-checkbox-item">
|
||||
<checkbox value="1" :checked="week.includes('1') || week.includes(1)" />
|
||||
周一
|
||||
</label>
|
||||
<label class="form-checkbox-item">
|
||||
<checkbox value="2" :checked="week.includes('2') || week.includes(2)" />
|
||||
周二
|
||||
</label>
|
||||
<label class="form-checkbox-item">
|
||||
<checkbox value="3" :checked="week.includes('3') || week.includes(3)" />
|
||||
周三
|
||||
</label>
|
||||
<label class="form-checkbox-item">
|
||||
<checkbox value="4" :checked="week.includes('4') || week.includes(4)" />
|
||||
周四
|
||||
</label>
|
||||
<label class="form-checkbox-item">
|
||||
<checkbox value="5" :checked="week.includes('5') || week.includes(5)" />
|
||||
周五
|
||||
</label>
|
||||
<label class="form-checkbox-item">
|
||||
<checkbox value="6" :checked="week.includes('6') || week.includes(6)" />
|
||||
周六
|
||||
</label>
|
||||
<label class="form-checkbox-item">
|
||||
<checkbox value="0" :checked="week.includes('0') || week.includes(0)" />
|
||||
周日
|
||||
</label>
|
||||
</checkbox-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="common-form-item">
|
||||
<label class="form-label"></label>
|
||||
<view class="form-inline">
|
||||
<view class="form-input-inline">
|
||||
<picker mode="time" class="form-input" :value="time.start" @change="bindStartTimeChange">
|
||||
<view class="uni-input">{{ time.start }}</view>
|
||||
</picker>
|
||||
</view>
|
||||
<text class="form-mid">-</text>
|
||||
<view class="form-input-inline">
|
||||
<picker mode="time" class="form-input" :value="time.end" @change="bindEndTimeChange">
|
||||
<view class="uni-input">{{ time.end }}</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="common-form-item">
|
||||
<label class="form-label">预约时间间隔</label>
|
||||
<view class="form-inline">
|
||||
<radio-group @change="radioChange" class="form-radio-group">
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="30" :checked="interval == 30" />
|
||||
30分钟
|
||||
</label>
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="60" :checked="interval == 60" />
|
||||
1个小时
|
||||
</label>
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="90" :checked="interval == 90" />
|
||||
90分钟
|
||||
</label>
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="120" :checked="interval == 120" />
|
||||
2小时
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="common-form-item">
|
||||
<label class="form-label">预约提前</label>
|
||||
<view class="form-input-inline"><input type="number" v-model="advance" class="form-input" /></view>
|
||||
<text class="form-word-aux">小时</text>
|
||||
</view>
|
||||
<view class="common-form-item">
|
||||
<label class="form-label">每时段可预约</label>
|
||||
<view class="form-input-inline"><input type="number" v-model="max" class="form-input" /></view>
|
||||
<text class="form-word-aux">人</text>
|
||||
</view>
|
||||
<view class="common-btn-wrap"><button type="default" class="screen-btn" @click="saveFn">保存</button></view>
|
||||
<ns-loading :layer-background="{ background: 'rgba(255,255,255,.8)' }" ref="loading"></ns-loading>
|
||||
</view>
|
||||
</base-page>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getReserveConfig,
|
||||
setReserveConfig
|
||||
} from '@/api/reserve'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
time: {
|
||||
start: '08:30',
|
||||
end: '23:30'
|
||||
},
|
||||
interval: 30,
|
||||
advance: '',
|
||||
max: '',
|
||||
week: [],
|
||||
flag: false
|
||||
};
|
||||
},
|
||||
onLoad() {},
|
||||
onShow() {
|
||||
this.getData();
|
||||
uni.setLocale('zh-Hans');
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
getReserveConfig().then(res => {
|
||||
if (res.code >= 0) {
|
||||
({
|
||||
start: this.time.start,
|
||||
end: this.time.end,
|
||||
interval: this.interval,
|
||||
advance: this.advance,
|
||||
max: this.max,
|
||||
week: this.week
|
||||
} = res.data);
|
||||
this.time.start = this.timeFormat(this.time.start);
|
||||
this.time.end = this.timeFormat(this.time.end);
|
||||
this.$refs.loading.hide();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
bindStartTimeChange(e) {
|
||||
this.time.start = e.detail.value;
|
||||
},
|
||||
bindEndTimeChange(e) {
|
||||
this.time.end = e.detail.value;
|
||||
},
|
||||
radioChange(e) {
|
||||
this.interval = e.detail.value;
|
||||
},
|
||||
checkboxChange(e) {
|
||||
this.week = e.detail.value;
|
||||
},
|
||||
getSaveData() {
|
||||
let data = {};
|
||||
data.start = this.timeTurnTimeStamp(this.time.start);
|
||||
data.end = this.timeTurnTimeStamp(this.time.end);
|
||||
data.interval = this.interval;
|
||||
data.advance = this.advance;
|
||||
data.max = this.max;
|
||||
data.week = this.week.toString();
|
||||
return data;
|
||||
},
|
||||
saveFn() {
|
||||
if (this.flag) return false;
|
||||
this.flag = true;
|
||||
setReserveConfig(this.getSaveData()).then(res => {
|
||||
this.flag = false;
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
if (res.code >= 0) {
|
||||
this.$refs.loading.show();
|
||||
this.getData();
|
||||
}
|
||||
});
|
||||
},
|
||||
timeTurnTimeStamp(time) {
|
||||
let data = time.split(':');
|
||||
return data[0] * 3600 + data[1] * 60;
|
||||
},
|
||||
timeFormat(time) {
|
||||
let h = time / 3600;
|
||||
let i = (time % 3600) / 60;
|
||||
h = h < 10 ? '0' + h : h;
|
||||
i = i < 10 ? '0' + i : i;
|
||||
return h + ':' + i;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.common-wrap {
|
||||
position: relative;
|
||||
padding: 30rpx;
|
||||
height: calc(100vh - 51px);
|
||||
|
||||
.form-label {
|
||||
width: 1.5rem !important;
|
||||
}
|
||||
|
||||
.common-btn-wrap {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: 0.24rem 0.2rem;
|
||||
margin-left: 0;
|
||||
text-align: center;
|
||||
height: 0.4rem;
|
||||
button {
|
||||
width: 100%;
|
||||
height: 0.4rem;
|
||||
line-height: 0.4rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.common-title {
|
||||
font-size: 0.18rem;
|
||||
margin-bottom: 0.2rem;
|
||||
}
|
||||
</style>
|
||||
468
addon/cashier/source/os/pages/reserve/index.vue
Executable file
468
addon/cashier/source/os/pages/reserve/index.vue
Executable file
@@ -0,0 +1,468 @@
|
||||
<template>
|
||||
<base-page>
|
||||
<view class="uni-flex uni-row height-all">
|
||||
<view class="common-wrap uni-flex uni-column" style="-webkit-flex: 1;flex: 1;">
|
||||
<view class="common-tab-wrap" id="tab">
|
||||
<view class="tab-item" :class="{ 'active-bar': active == 0 }" @click="switchTab(0)">
|
||||
<text class="text">预约看板</text>
|
||||
</view>
|
||||
<view class="tab-item" :class="{ 'active-bar': active == 1 }" @click="switchTab(1)">
|
||||
<text class="text">预约列表</text>
|
||||
</view>
|
||||
<view class="active" :style="activeStyle"></view>
|
||||
</view>
|
||||
|
||||
<swiper :interval="3000" :duration="300" :current="active" @change="swiperChange">
|
||||
<!-- 预约看板 -->
|
||||
<swiper-item>
|
||||
<view class="swiper-item common-scrollbar">
|
||||
<view class="uni-flex panel-head">
|
||||
<button type="default" class="primary-btn" @click="addYuyue()">添加预约</button>
|
||||
<view class="status uni-flex">
|
||||
<block v-for="(item, index) in status" :key="index">
|
||||
<view class="color" :class="item.state"></view>
|
||||
<view>{{ item.name }}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="panel-body">
|
||||
<view class="head-time uni-flex">
|
||||
<view @click="prevWeek()" class="item">
|
||||
<view class="iconfont iconqianhou1"></view>
|
||||
</view>
|
||||
<view class="time-box">{{ weekDate.start }} - {{ weekDate.end }}</view>
|
||||
<view @click="nextWeek()" class="item">
|
||||
<view class="iconfont iconqianhou2"></view>
|
||||
</view>
|
||||
<!-- <view class="head-time-switch">
|
||||
<view :class="yuYueDateType == 'week' ? 'active' : ''" @click="yuYueDateType = 'week'">周</view>
|
||||
<view :class="yuYueDateType == 'month' ? 'active' : ''" @click="yuYueDateType = 'month'">月</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<block v-if="yuYueDateType == 'week'">
|
||||
<view class="head uni-flex">
|
||||
<view v-for="(item, index) in weeks" class="item" :key="index">
|
||||
<button type="default" class="default-btn" :class="{ active: item.currday }">
|
||||
{{ item.week }}
|
||||
<text>{{ item.date }}</text>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="body uni-flex">
|
||||
<scroll-view scroll-y="true" @scrolltolower="getReserve(index)" class="common-scrollbar item" v-for="(item, index) in weeks" :key="index">
|
||||
<block v-if="item.data">
|
||||
<view class="panel-item" :class="reserve_item.reserve_state" v-for="(reserve_item, reserve_index) in item.data.list" :key="reserve_index">
|
||||
<view class="username">{{ reserve_item.nickname }}</view>
|
||||
<view class="time" :class="reserve_item.reserve_state">{{ $util.timeFormat(reserve_item.reserve_time, 'm-d H:i') }}</view>
|
||||
<view class="service" v-for="(server_item, server_index) in reserve_item.item" :key="server_index" @click="yuyueEvent('info', reserve_item)">{{ server_item.goods_name }}</view>
|
||||
<uni-dropdown>
|
||||
<view class="action" slot="dropdown-link">
|
||||
<text class="iconfont icongengduo"></text>
|
||||
</view>
|
||||
<view slot="dropdown">
|
||||
<view class="dropdown-menu">
|
||||
<view class="menu-item" @click="yuyueEvent('info', reserve_item)">详情</view>
|
||||
<view class="menu-item" v-for="(menu_item, menu_index) in operation[reserve_item.reserve_state]" :key="menu_index" @click="yuyueEvent(menu_item.event, reserve_item)">
|
||||
{{ menu_item.title }}
|
||||
</view>
|
||||
<view class="arrow"></view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-dropdown>
|
||||
</view>
|
||||
<view style="height: 1.5rem;"></view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="yuYueDateType == 'month'">
|
||||
<view class="head uni-flex">
|
||||
<view v-for="(item, index) in week" class="item" :key="index">
|
||||
<button type="default" class="default-btn">{{ item }}</button>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
<!-- 预约列表 -->
|
||||
<swiper-item>
|
||||
<view class="yuyuelist">
|
||||
<view class="yuyuelist-box">
|
||||
<view class="yuyuelist-left">
|
||||
<view class="yuyue-title">预约客户</view>
|
||||
<view class="yuyue-search">
|
||||
<view class="search">
|
||||
<text class="iconfont icon31sousuo" @click="searchYuyueList()"></text>
|
||||
<input type="text" v-model="yuyueSearchText" placeholder="请输入会员手机号" />
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view @scrolltolower="getYuyueList()" scroll-y="true" class="yuyue-list-scroll all-scroll">
|
||||
<view class="item" v-for="(item, index) in yuyueList" :key="index" @click="selectYuyue(item.reserve_id)" :class="{ active: item.reserve_id == reserveId }">
|
||||
<view class="item-head">
|
||||
<image mode="aspectFill" v-if="item.headimg" :src="$util.img(item.headimg)" @error="item.headimg = defaultImg.head"/>
|
||||
<image mode="aspectFill" v-else :src="$util.img(defaultImg.head)"/>
|
||||
<view class="item-right">
|
||||
<view class="yuyue-name" v-if="item.nickname">{{ item.nickname }}</view>
|
||||
<view class="yuyue-desc">{{ item.mobile }}</view>
|
||||
</view>
|
||||
<text>{{ item.reserve_state_name }}</text>
|
||||
</view>
|
||||
<view class="item-common">预约时间:{{ $util.timeFormat(item.create_time) }}
|
||||
</view>
|
||||
<view class="item-common yuyue-project">
|
||||
预约项目:
|
||||
<block v-for="(sItem, sIndex) in item.item" :key="sIndex">
|
||||
{{ sItem.goods_name }}{{ sIndex != item.item.length - 1 ? ';' : '' }}
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="yuyueList.length == 0" class="empty">
|
||||
<image src="@/static/member/member-empty.png" mode="widthFix"/>
|
||||
<view class="tips">暂无预约客户</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="yuyuelist-right" v-if="yuyueInfo">
|
||||
<view class="yuyue-title">预约详情</view>
|
||||
<view class="yuyue-information common-scrollbar">
|
||||
<view class="title">预约信息</view>
|
||||
<view class="information-box">
|
||||
<view class="box-left">
|
||||
<view class="information">
|
||||
<view>预约客户:</view>
|
||||
<view>{{ yuyueInfo.nickname }}</view>
|
||||
</view>
|
||||
<view class="information">
|
||||
<view>客户手机号:</view>
|
||||
<view>{{ yuyueInfo.mobile }}</view>
|
||||
</view>
|
||||
<view class="information">
|
||||
<view>预约门店:</view>
|
||||
<view>{{ yuyueInfo.store_name }}</view>
|
||||
</view>
|
||||
<view class="information">
|
||||
<view>预约状态:</view>
|
||||
<view>{{ yuyueInfo.reserve_state_name }}</view>
|
||||
</view>
|
||||
<view class="information">
|
||||
<view>预约到店时间:</view>
|
||||
<view>{{ $util.timeFormat(yuyueInfo.reserve_time, 'Y-m-d H:i') }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="information">
|
||||
<view>预约时间:</view>
|
||||
<view>{{ $util.timeFormat(yuyueInfo.create_time) }}</view>
|
||||
</view>
|
||||
<view class="information">
|
||||
<view>备注:</view>
|
||||
<view>{{ yuyueInfo.desc ? yuyueInfo.desc : '--' }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="title title2">预约内容</view>
|
||||
<view class="table" v-if="yuyueInfo">
|
||||
<view class="table-th table-all">
|
||||
<view class="table-td" style="width:50%">项目</view>
|
||||
<view class="table-td" style="width:50%">员工</view>
|
||||
</view>
|
||||
<scroll-view class="table-tb" scroll-y="true">
|
||||
<view class="table-tr table-all" v-for="(item, index) in yuyueInfo.item" :key="index">
|
||||
<view class="table-td" style="width:50%">{{ item.goods_name }}
|
||||
</view>
|
||||
<view class="table-td" style="width:50%">
|
||||
{{ item.uid ? item.username : '--' }}
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="button-box flex items-center justify-end" v-if="yuyueInfo && operation[yuyueInfo.reserve_state]">
|
||||
<button class="default-btn" v-for="(menu_item, menu_index) in operation[yuyueInfo.reserve_state]" :key="menu_index" @click="yuyueEvent(menu_item.event, yuyueInfo)">{{ menu_item.title }}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="yuyuelist-right empty" v-else>
|
||||
<image src="@/static/cashier/cart_empty.png" mode="widthFix"/>
|
||||
<view class="tips">暂无预约信息</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 添加/修改预约 -->
|
||||
<uni-popup ref="addYuyuePop" :maskClick="false">
|
||||
<view class="pop-box">
|
||||
<view class="pop-header">
|
||||
<view class="pop-header-text">{{ yuYueData.reserve_id ? '修改' : '添加' }}预约</view>
|
||||
<view class="pop-header-close" @click="closeYuyuePop">
|
||||
<text class="iconguanbi1 iconfont"></text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<scroll-view scroll-y="true" class="common-scrollbar pop-content">
|
||||
<view class="form-content">
|
||||
<view class="form-item" v-if="!yuYueData.reserve_id">
|
||||
<view class="form-label">
|
||||
<text class="required">*</text>
|
||||
手机号:
|
||||
</view>
|
||||
<view class="form-inline search-wrap">
|
||||
<input type="number" class="form-input" v-model="searchMobile" placeholder="请输入客户手机号" />
|
||||
<text class="iconfont icon31sousuo" @click="searchMember"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="form-label">
|
||||
<text class="required">*</text>
|
||||
客户:
|
||||
</view>
|
||||
<view class="form-inline">
|
||||
<view class="member-info" v-if="yuYueData.member_id">
|
||||
<image :src="$util.img(yuYueData.member.headimg, { size: 'small' })" mode="widthFix" />
|
||||
<view class="info">
|
||||
<view class="name">{{ yuYueData.member.nickname }}</view>
|
||||
<view>
|
||||
<text>手机号:{{ yuYueData.member.mobile }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="form-label">
|
||||
<text class="required">*</text>
|
||||
到店时间:
|
||||
</view>
|
||||
<view class="form-inline">
|
||||
<uni-datetime-picker :start="toDay" v-model="yuYueData.date" type="date" :clearIcon="false" @change="changeYuyueTime" />
|
||||
</view>
|
||||
<view class="form-inline">
|
||||
<select-lay :zindex="10" :value="yuYueData.time" name="names" placeholder="请选择到店时间" :options="yuYueTime" @selectitem="selectYuYueTime"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="form-label">
|
||||
<text class="required">*</text>
|
||||
预约门店:
|
||||
</view>
|
||||
<view class="form-inline">{{ globalStoreInfo.store_name }}</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="form-label">
|
||||
<text class="required">*</text>
|
||||
项目:
|
||||
</view>
|
||||
<view>
|
||||
<view class="table">
|
||||
<view class="table-tr table-head">
|
||||
<view class="table-th">预约项目</view>
|
||||
<view class="table-th">员工</view>
|
||||
<view class="table-th">操作</view>
|
||||
</view>
|
||||
|
||||
<view class="table-content table-tr" v-for="(goods_item, goods_index) in yuYueData.goods" :key="goods_index">
|
||||
<view class="table-td">
|
||||
<uni-dropdown>
|
||||
<view class="action" slot="dropdown-link">
|
||||
<view class="service-item">
|
||||
<view class="info" v-if="goods_item.goods_id">
|
||||
<view class="title">{{ goods_item.goods_name }}</view>
|
||||
<view class="desc">项目时长:{{ goods_item.service_length }}分钟 ¥{{ goods_item.price }}</view>
|
||||
</view>
|
||||
<view class="info" v-else>请选择项目</view>
|
||||
<text class="iconfont iconsanjiao_xia"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view slot="dropdown">
|
||||
<view class="dropdown-content-box">
|
||||
<view class="select-service">
|
||||
<div class="service-wrap">
|
||||
<div class="flex-wrap">
|
||||
<div class="item" v-for="(item, index) in goodsList" :key="index" @click="selectGoods(item, goods_index)">
|
||||
<div class="title">{{ item.goods_name }}</div>
|
||||
<div class="desc">项目时长:{{ item.service_length }}分钟 ¥{{ item.price }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</view>
|
||||
<view class="arrow"></view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-dropdown>
|
||||
</view>
|
||||
<view class="table-td">
|
||||
<uni-dropdown>
|
||||
<view class="action" slot="dropdown-link">
|
||||
<view class="service-item" @click="loadServicer(goods_index)">
|
||||
<view class="info">
|
||||
<view class="title" v-if="goods_item.uid && goods_item.uid > 0">
|
||||
{{ goods_item.username }}
|
||||
</view>
|
||||
<view class="title" v-else>不选择员工</view>
|
||||
</view>
|
||||
<text class="iconfont iconsanjiao_xia"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view slot="dropdown">
|
||||
<view class="dropdown-content-box">
|
||||
<div class="select-servicer">
|
||||
<div class="select-item">
|
||||
<div class="title" @click="selectServicer({ uid: 0, username: '' }, goods_index)">不选择员工</div>
|
||||
</div>
|
||||
<div class="select-item" v-for="(item, index) in servicerList" :key="index" @click="selectServicer(item, goods_index)">
|
||||
<div class="title">{{ item.username }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<view class="arrow"></view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-dropdown>
|
||||
</view>
|
||||
<view class="table-td">
|
||||
<view class="action-btn" @click="deleteService(goods_index)">删除</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<button class="primary-btn select-btn" @click="addService">添加项目</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="form-label">
|
||||
<text class="required"></text>
|
||||
备注:
|
||||
</view>
|
||||
<view class="form-inline">
|
||||
<textarea class="form-textarea" v-model="yuYueData.desc"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="pop-bottom">
|
||||
<button class="primary-btn" @click="yuYueSubmit">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
<!-- 预约详情 -->
|
||||
<uni-popup ref="yuyuePop">
|
||||
<view class="pop-box yuyue-info">
|
||||
<view class="pop-header">
|
||||
<view class="pop-header-text">预约详情</view>
|
||||
<view class="pop-header-close" @click="$refs.yuyuePop.close()">
|
||||
<text class="iconguanbi1 iconfont"></text>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view scroll-y="true" class="common-scrollbar pop-content">
|
||||
<view class="yuyue-pop form-content" v-if="yuYueDetail">
|
||||
<view class="form-item">
|
||||
<view class="form-label">预约客户:</view>
|
||||
<view class="form-inline search-wrap">
|
||||
<text>{{ yuYueDetail.member.nickname }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<view class="form-label">客户手机号:</view>
|
||||
<view class="form-inline search-wrap">
|
||||
<text>{{ yuYueDetail.member.mobile }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<view class="form-label">预约门店:</view>
|
||||
<view class="form-inline search-wrap">{{ yuYueDetail.store_name }}</view>
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<view class="form-label">预约状态:</view>
|
||||
<view class="form-inline search-wrap">{{ yuYueDetail.reserve_state_name }}</view>
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<view class="form-label">预约到店时间:</view>
|
||||
<view class="form-inline search-wrap">
|
||||
{{ $util.timeFormat(yuYueDetail.reserve_time, 'Y-m-d H:i') }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<view class="form-label">创建时间:</view>
|
||||
<view class="form-inline search-wrap">
|
||||
{{ $util.timeFormat(yuYueDetail.create_time, 'Y-m-d H:i:s') }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<view class="form-label">预约项目:</view>
|
||||
<scroll-view scroll-y="true" class="form-inline search-wrap make-server">
|
||||
<view class="table-container">
|
||||
<view class="thead">
|
||||
<view class="th">
|
||||
<view class="content">项目</view>
|
||||
<view class="content">员工</view>
|
||||
<view class="content">时长</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tbody">
|
||||
<view class="tr" v-for="(item, index) in yuYueDetail.item" :key="index">
|
||||
<view class="td">
|
||||
<view class="content">{{ item.goods_name }}</view>
|
||||
<view class="content">{{ item.username ? item.username : '--' }}</view>
|
||||
<view class="content">{{ item.service_length }}分钟</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<view class="form-label">备注:</view>
|
||||
<view class="form-inline search-wrap">{{ yuYueDetail.remark ? yuYueDetail.remark : '--' }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="pop-bottom"><button class="primary-btn" @click="$refs.yuyuePop.close()">确定</button></view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
<ns-loading :layer-background="{ background: 'rgba(255,255,255,.6)' }" :default-show="false" ref="loading"></ns-loading>
|
||||
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<ns-update></ns-update>
|
||||
<!-- #endif -->
|
||||
</base-page>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uniDatetimePicker from '@/components/uni-datetime-picker/uni-datetime-picker.vue';
|
||||
import selectLay from '@/components/select-lay/select-lay.vue';
|
||||
import index from './public/js/index.js';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
uniDatetimePicker,
|
||||
selectLay
|
||||
},
|
||||
mixins: [index]
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.table-content>>>.tr .td .content.action {
|
||||
overflow: unset;
|
||||
}
|
||||
|
||||
.form-inline>>>.uni-icons {
|
||||
height: 0.3rem;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './public/css/index.scss';
|
||||
</style>
|
||||
1224
addon/cashier/source/os/pages/reserve/public/css/index.scss
Executable file
1224
addon/cashier/source/os/pages/reserve/public/css/index.scss
Executable file
File diff suppressed because it is too large
Load Diff
603
addon/cashier/source/os/pages/reserve/public/js/index.js
Executable file
603
addon/cashier/source/os/pages/reserve/public/js/index.js
Executable file
@@ -0,0 +1,603 @@
|
||||
import {
|
||||
getReserveStatus,
|
||||
getReserveConfig,
|
||||
getReserveWeekday,
|
||||
getReserveLists,
|
||||
getAppointmentProjectList,
|
||||
getEmployeeList,
|
||||
editReserve,
|
||||
addReserve,
|
||||
cancelReserve,
|
||||
getReserveDetail,
|
||||
reserveToStore,
|
||||
reserveConfirm,
|
||||
reserveComplete
|
||||
} from '@/api/reserve'
|
||||
import {
|
||||
getMemberInfoBySearchMember
|
||||
} from '@/api/member'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
activeStyle: {},
|
||||
active: 0,
|
||||
weeks: [],
|
||||
status: [],
|
||||
length: 0, //周
|
||||
//预约记录操作
|
||||
operation: {
|
||||
arrived_store: [{
|
||||
title: '确认完成',
|
||||
event: 'complet'
|
||||
}],
|
||||
wait_confirm: [{
|
||||
title: '确认预约',
|
||||
event: 'confirm'
|
||||
}, {
|
||||
title: '更改预约',
|
||||
event: 'update'
|
||||
}, {
|
||||
title: '取消预约',
|
||||
event: 'cancel'
|
||||
}],
|
||||
wait_to_store: [{
|
||||
title: '确认到店',
|
||||
event: 'tostore'
|
||||
}, {
|
||||
title: '取消预约',
|
||||
event: 'cancel'
|
||||
}]
|
||||
},
|
||||
yuYueTime: [], //预约时间段
|
||||
yuYueConfig: {},
|
||||
yuYueData: {
|
||||
time: '', //时间
|
||||
date: '', //日期
|
||||
member_id: '',
|
||||
member: {},
|
||||
goods: [],
|
||||
desc: '',
|
||||
reserve_id: 0
|
||||
},
|
||||
searchMobile: '',
|
||||
flag: false,
|
||||
yuYueDetail: null,
|
||||
weekDate: {
|
||||
start: '-',
|
||||
end: '-'
|
||||
},
|
||||
week: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
|
||||
current: '',
|
||||
yuYueDateType: 'week',
|
||||
goodsList: [],
|
||||
allServicerList: [], //所有的员工
|
||||
servicerList: [], //所有的员工
|
||||
yuyueList: [],
|
||||
yuyuePage: 1,
|
||||
yuyueSearchText: '',
|
||||
reserveId: 0,
|
||||
yuyueInfo: null,
|
||||
toDay: '', // 今天日期
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
uni.hideTabBar();
|
||||
this.init();
|
||||
},
|
||||
onReady() {
|
||||
this.tabActive('tab');
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.weeks = [];
|
||||
this.getReserveStatusFn(); // 预约状态
|
||||
this.getReserveConfigFn(); // 预约配置
|
||||
this.getAppointmentProjectListFn(); // 预约项目列表
|
||||
this.getEmployeeListFn(); // 员工列表
|
||||
this.getWeekReserve(); // 预约看板/周
|
||||
this.getYuyueList(); // 预约记录列表
|
||||
let date = new Date();
|
||||
var y = date.getFullYear();
|
||||
var m = date.getMonth() + 1;
|
||||
var d = date.getDate();
|
||||
this.toDay = y + '-' + m + '-' + d;
|
||||
},
|
||||
tabActive(id) {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
var tab;
|
||||
query.select('#' + id).boundingClientRect(data => {
|
||||
tab = data;
|
||||
});
|
||||
query.select('#' + id + ' .active-bar .text').boundingClientRect(data => {
|
||||
this.activeStyle = {
|
||||
width: data.width + 'px',
|
||||
transform: 'translateX(' + (data.left - tab.left) + 'px)'
|
||||
};
|
||||
}).exec();
|
||||
},
|
||||
switchTab(value) {
|
||||
this.active = value;
|
||||
this.$nextTick(() => {
|
||||
this.tabActive('tab');
|
||||
});
|
||||
},
|
||||
swiperChange(e) {
|
||||
this.active = e.detail.current;
|
||||
this.$nextTick(() => {
|
||||
this.tabActive('tab');
|
||||
});
|
||||
},
|
||||
// 预约状态
|
||||
getReserveStatusFn() {
|
||||
getReserveStatus().then(res => {
|
||||
if (res.code >= 0) {
|
||||
this.status = res.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 预约配置
|
||||
getReserveConfigFn() {
|
||||
getReserveConfig().then(res => {
|
||||
if (res.code >= 0) {
|
||||
this.yuYueConfig = res.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// ******************** 预约看板 ********************
|
||||
|
||||
// 查询预约记录(每周)
|
||||
getWeekReserve() {
|
||||
if (this.flag) return;
|
||||
this.flag = true;
|
||||
getReserveWeekday({
|
||||
length: this.length
|
||||
}).then(res => {
|
||||
if (res.code >= 0) {
|
||||
this.weeks = res.data;
|
||||
this.$refs.loading.hide();
|
||||
this.weekDate.start = this.$util.timeFormat(this.weeks[0].start, 'Y-m-d');
|
||||
this.weekDate.end = this.$util.timeFormat(this.weeks[this.weeks.length - 1].end, 'Y-m-d');
|
||||
for (let i in this.weeks) {
|
||||
this.getReserve(i);
|
||||
if (i == this.weeks.length - 1) {
|
||||
setTimeout(() => {
|
||||
this.flag = false;
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.flag = false;
|
||||
});
|
||||
},
|
||||
//获取预约分页数据
|
||||
getReserve(index) {
|
||||
let currentWeek = this.weeks[index];
|
||||
if (!currentWeek.page) currentWeek.page = 1;
|
||||
getReserveLists({
|
||||
page: currentWeek.page,
|
||||
start: currentWeek.start,
|
||||
end: currentWeek.end
|
||||
}).then(res => {
|
||||
if (res.code >= 0) {
|
||||
let data = res.data;
|
||||
if (currentWeek.page == 1) {
|
||||
currentWeek.data = {
|
||||
list: [],
|
||||
page_count: data.page_count,
|
||||
count: data.count
|
||||
};
|
||||
currentWeek.data['list'] = data.list;
|
||||
} else {
|
||||
currentWeek.data['list'] = currentWeek.data['list'].concat(data.list);
|
||||
}
|
||||
if (data.page_count >= currentWeek.page) currentWeek.page++;
|
||||
this.$forceUpdate();
|
||||
}
|
||||
});
|
||||
},
|
||||
//上一周
|
||||
prevWeek() {
|
||||
this.$refs.loading.show();
|
||||
--this.length;
|
||||
this.getWeekReserve();
|
||||
},
|
||||
//下一周
|
||||
nextWeek() {
|
||||
this.$refs.loading.show();
|
||||
++this.length;
|
||||
this.getWeekReserve();
|
||||
},
|
||||
// ******************** 添加/编辑预约 ********************
|
||||
// 查询预约项目列表
|
||||
getAppointmentProjectListFn() {
|
||||
getAppointmentProjectList({
|
||||
page: 1,
|
||||
page_size: 0
|
||||
}).then(res => {
|
||||
if (res.code >= 0) {
|
||||
this.goodsList = res.data.list;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 查询员工列表
|
||||
getEmployeeListFn() {
|
||||
getEmployeeList().then(res => {
|
||||
if (res.code >= 0) {
|
||||
this.allServicerList = res.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
//添加预约
|
||||
addYuyue() {
|
||||
this.yuYueData = {
|
||||
reserve_id: 0,
|
||||
member_id: '',
|
||||
member: {},
|
||||
time: '', //时间
|
||||
date: this.toDay, //日期
|
||||
goods: [{}],
|
||||
desc: '',
|
||||
};
|
||||
this.reserveId = 0;
|
||||
this.handleYuyueDate();
|
||||
this.$refs.addYuyuePop.open();
|
||||
},
|
||||
closeYuyuePop() {
|
||||
this.yuYueData = {
|
||||
time: '', //时间
|
||||
date: '', //日期
|
||||
member_id: '',
|
||||
member: {},
|
||||
goods: [{}],
|
||||
desc: '',
|
||||
reserve_id: 0
|
||||
};
|
||||
this.$refs.addYuyuePop.close();
|
||||
},
|
||||
// 查询会员信息
|
||||
searchMember() {
|
||||
if (this.searchMobile.length == 0) {
|
||||
this.$util.showToast({
|
||||
title: '请输入客户手机号'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!this.$util.verifyMobile(this.searchMobile)) {
|
||||
this.$util.showToast({
|
||||
title: '手机号格式不正确'
|
||||
});
|
||||
return;
|
||||
}
|
||||
getMemberInfoBySearchMember({
|
||||
search_text: this.searchMobile
|
||||
}).then(res => {
|
||||
if (res.data) {
|
||||
this.yuYueData.member_id = res.data.member_id;
|
||||
this.yuYueData.member = res.data;
|
||||
} else {
|
||||
this.yuYueData.member_id = '';
|
||||
this.yuYueData.member = {};
|
||||
this.$util.showToast({
|
||||
title: '客户未找到'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
//处理预约时间段
|
||||
handleYuyueDate() {
|
||||
let time_list = [];
|
||||
let start = this.yuYueConfig.start / 60;
|
||||
let end = this.yuYueConfig.end / 60;
|
||||
let date = new Date();
|
||||
var y = date.getFullYear();
|
||||
var m = date.getMonth() + 1;
|
||||
var d = date.getDate();
|
||||
let time = date.getHours() * 60 + date.getMinutes();
|
||||
|
||||
let yuyue_time_stamp = this.$util.timeTurnTimeStamp(this.yuYueData.date);
|
||||
let time_stamp = this.$util.timeTurnTimeStamp(y + '-' + m + '-' + d);
|
||||
// if(time > start) start = time;
|
||||
|
||||
for (let i = start; i < end; i++) {
|
||||
if (i % this.yuYueConfig.interval == 0) {
|
||||
let data = {
|
||||
label: (Math.floor(i / 60) < 10 ? '0' + Math.floor(i / 60) : Math.floor(i / 60)) + ':' + (i % 60 == '0' ? '00' : i % 60),
|
||||
value: (Math.floor(i / 60) < 10 ? '0' + Math.floor(i / 60) : Math.floor(i / 60)) + ':' + (i % 60 == '0' ? '00' : i % 60),
|
||||
disabled: false
|
||||
};
|
||||
if (yuyue_time_stamp < time_stamp) data.disabled = true;
|
||||
if (yuyue_time_stamp == time_stamp && time > i) data.disabled = true;
|
||||
|
||||
let week = new Date(this.yuYueData.date).getDay();
|
||||
|
||||
let yuyue_week = this.yuYueConfig.week;
|
||||
let config_week = [];
|
||||
|
||||
for (let i in yuyue_week) config_week.push(parseInt(yuyue_week[i]));
|
||||
|
||||
if (config_week.indexOf(week) === -1) data.disabled = true;
|
||||
time_list.push(data);
|
||||
}
|
||||
}
|
||||
this.yuYueTime = time_list;
|
||||
},
|
||||
// 监听预约时间
|
||||
changeYuyueTime(time) {
|
||||
this.yuYueData.date = time;
|
||||
this.handleYuyueDate();
|
||||
},
|
||||
// 选择预约时间·
|
||||
selectYuYueTime(index, item) {
|
||||
if (index >= 0) {
|
||||
this.yuYueData.time = item.value;
|
||||
} else {
|
||||
this.yuYueData.time = '';
|
||||
}
|
||||
},
|
||||
// 设置项目
|
||||
selectGoods(data, index) {
|
||||
this.yuYueData.goods[index] = Object.assign(this.yuYueData.goods[index], JSON.parse(JSON.stringify(data)));
|
||||
this.$forceUpdate();
|
||||
},
|
||||
// 加载员工列表
|
||||
loadServicer(index) {
|
||||
this.servicerList = this.allServicerList;
|
||||
},
|
||||
// 设置员工
|
||||
selectServicer(data, index) {
|
||||
this.yuYueData.goods[index].uid = data.uid;
|
||||
this.yuYueData.goods[index].username = data.username;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
// 添加项目
|
||||
addService() {
|
||||
this.yuYueData.goods.push({});
|
||||
},
|
||||
// 删除项目
|
||||
deleteService(index) {
|
||||
if (this.yuYueData.goods.length == 1) {
|
||||
this.$util.showToast({
|
||||
title: '至少需要有一项项目'
|
||||
});
|
||||
} else {
|
||||
this.yuYueData.goods.splice(index, 1);
|
||||
}
|
||||
},
|
||||
// 预约验证
|
||||
verify() {
|
||||
if (!this.yuYueData.member_id) {
|
||||
this.$util.showToast({
|
||||
title: '请选择会员'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (!this.yuYueData.date || !this.yuYueData.time) {
|
||||
this.$util.showToast({
|
||||
title: '请设置到店时间'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.yuYueData.goods.length) {
|
||||
this.$util.showToast({
|
||||
title: '请选择预约项目'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
for (let i in this.yuYueData.goods) {
|
||||
if (!this.yuYueData.goods[i]['goods_id']) {
|
||||
this.$util.showToast({
|
||||
title: '请选择预约项目'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
// 添加/编辑预约
|
||||
yuYueSubmit() {
|
||||
if (this.verify()) {
|
||||
if (this.flag) return;
|
||||
this.flag = true;
|
||||
let data = Object.assign({}, this.yuYueData);
|
||||
data.goods = JSON.stringify(data.goods);
|
||||
data.member = JSON.stringify(data.member);
|
||||
let save = data.reserve_id ? editReserve : addReserve;
|
||||
save(data).then(res => {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
this.flag = false;
|
||||
if (res.code >= 0) {
|
||||
this.getWeekReserve();
|
||||
if (this.reserveId) this.getYuyueInfo();
|
||||
this.closeYuyuePop();
|
||||
|
||||
this.yuyuePage = 1;
|
||||
this.getYuyueList();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
//操作
|
||||
yuyueEvent(event, data) {
|
||||
this.reserveId = data.reserve_id;
|
||||
switch (event) {
|
||||
case 'info':
|
||||
this.getYuYueDetail(data.reserve_id);
|
||||
break;
|
||||
case 'tostore':
|
||||
this.tostore(data.reserve_id);
|
||||
break;
|
||||
case 'cancel':
|
||||
this.cancel(data.reserve_id);
|
||||
break;
|
||||
case 'confirm':
|
||||
this.confirm(data.reserve_id);
|
||||
break;
|
||||
case 'update': // 修改预约
|
||||
this.$refs.loading.show();
|
||||
this.yuYueInfo(data.reserve_id);
|
||||
break;
|
||||
case 'complet':
|
||||
this.complet(data.reserve_id);
|
||||
break;
|
||||
}
|
||||
},
|
||||
//修改预约
|
||||
yuYueInfo(reserve_id) {
|
||||
if (this.flag) return;
|
||||
this.flag = true;
|
||||
getReserveDetail(reserve_id).then(res => {
|
||||
if (res.code >= 0) {
|
||||
this.yuYueData = {
|
||||
reserve_id: res.data.reserve_id,
|
||||
member_id: res.data.member_id,
|
||||
member: res.data.member,
|
||||
time: this.$util.timeFormat(res.data.reserve_time, 'H:i'),
|
||||
date: this.$util.timeFormat(res.data.reserve_time, 'Y-m-d'),
|
||||
goods: res.data.item,
|
||||
desc: res.data.remark
|
||||
};
|
||||
|
||||
this.handleYuyueDate();
|
||||
this.$refs.addYuyuePop.open();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
this.flag = false;
|
||||
this.$refs.loading.hide();
|
||||
});
|
||||
},
|
||||
// 预约详情
|
||||
getYuYueDetail(reserve_id) {
|
||||
if (this.flag) return;
|
||||
this.flag = true;
|
||||
getReserveDetail(reserve_id).then(res => {
|
||||
if (res.code >= 0) {
|
||||
this.yuYueDetail = res.data;
|
||||
this.$refs.yuyuePop.open();
|
||||
}
|
||||
this.flag = false;
|
||||
});
|
||||
},
|
||||
//预约确认
|
||||
confirm(reserve_id) {
|
||||
if (this.flag) return;
|
||||
this.flag = true;
|
||||
reserveConfirm(reserve_id).then(res => {
|
||||
this.flag = false;
|
||||
if (res.code >= 0) {
|
||||
this.getWeekReserve();
|
||||
this.getYuyueInfo();
|
||||
}
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
});
|
||||
},
|
||||
//完成
|
||||
complet(reserve_id) {
|
||||
if (this.flag) return;
|
||||
this.flag = true;
|
||||
reserveComplete(reserve_id).then(res => {
|
||||
this.flag = false;
|
||||
if (res.code >= 0) {
|
||||
this.getWeekReserve();
|
||||
this.getYuyueInfo();
|
||||
}
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
});
|
||||
},
|
||||
//取消预约
|
||||
cancel(reserve_id) {
|
||||
if (this.flag) return;
|
||||
this.flag = true;
|
||||
cancelReserve(reserve_id).then(res => {
|
||||
this.flag = false;
|
||||
if (res.code >= 0) {
|
||||
this.getWeekReserve();
|
||||
this.getYuyueInfo();
|
||||
}
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
});
|
||||
},
|
||||
//确认到店
|
||||
tostore(reserve_id) {
|
||||
reserveToStore(reserve_id).then(res => {
|
||||
this.flag = false;
|
||||
if (res.code >= 0) {
|
||||
this.getWeekReserve();
|
||||
this.getYuyueInfo();
|
||||
}
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// ******************** 预约列表 ********************
|
||||
|
||||
// 获取预约分页数据
|
||||
getYuyueList() {
|
||||
getReserveLists({
|
||||
page: this.yuyuePage,
|
||||
search_text: this.yuyueSearchText
|
||||
}).then(res => {
|
||||
if (res.code >= 0) {
|
||||
if (this.yuyuePage == 1) this.yuyueList = [];
|
||||
|
||||
this.yuyueList = this.yuyueList.concat(res.data.list);
|
||||
|
||||
if (this.yuyuePage == 1 && this.yuyueList.length > 0) {
|
||||
this.reserveId = this.yuyueList[0]['reserve_id'];
|
||||
this.getYuyueInfo();
|
||||
}
|
||||
|
||||
if (res.data.page_count >= this.yuyuePage) this.yuyuePage++;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 搜索预约客户
|
||||
searchYuyueList() {
|
||||
this.yuyuePage = 1;
|
||||
this.getYuyueList();
|
||||
},
|
||||
selectYuyue(id) {
|
||||
this.reserveId = id;
|
||||
this.getYuyueInfo();
|
||||
},
|
||||
getYuyueInfo() {
|
||||
getReserveDetail(this.reserveId).then(res => {
|
||||
if (res.code >= 0) {
|
||||
this.yuyueInfo = res.data;
|
||||
} else {
|
||||
this.yuyueInfo = null;
|
||||
}
|
||||
this.refreshStatus();
|
||||
this.$forceUpdate();
|
||||
});
|
||||
},
|
||||
refreshStatus() {
|
||||
if (this.yuyueList && this.yuyueInfo) {
|
||||
Object.keys(this.yuyueList).forEach(key => {
|
||||
let data = this.yuyueList[key];
|
||||
if (data.reserve_id == this.yuyueInfo['reserve_id']) {
|
||||
this.yuyueList[key]['reserve_state'] = this.yuyueInfo['reserve_state'];
|
||||
this.yuyueList[key]['reserve_state_name'] = this.yuyueInfo['reserve_state_name'];
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user