482 lines
18 KiB
HTML
482 lines
18 KiB
HTML
<!--#
|
|
layout("/mobile/platform.html"){
|
|
#-->
|
|
|
|
<style>
|
|
.list-card {
|
|
background: #FFFFFF;
|
|
width: 92%;
|
|
margin: 0px auto 20px;
|
|
box-shadow: 0 2px 10px rgb(125 126 128 / 16%);
|
|
border-radius: 10px;
|
|
}
|
|
|
|
.van-dropdown-menu__bar {
|
|
display: -webkit-box;
|
|
}
|
|
|
|
.card-head {
|
|
line-height: 30px;
|
|
padding: 8px 16px;
|
|
position: relative;
|
|
}
|
|
|
|
.state-text {
|
|
position: absolute;
|
|
right: 16px;
|
|
}
|
|
|
|
.cancel-button {
|
|
text-align: right;
|
|
padding: 10px 16px;
|
|
}
|
|
|
|
.footer {
|
|
background-color: white;
|
|
position: fixed;
|
|
bottom: 0;
|
|
width: 100%;
|
|
height: 60px;
|
|
display: flex;
|
|
justify-content: space-evenly;
|
|
align-items: center;
|
|
left: 0;
|
|
}
|
|
|
|
.footer .van-button {
|
|
height: 34px;
|
|
border-radius: 6px;
|
|
width: 90% !important;
|
|
}
|
|
|
|
.cancel-button .van-button {
|
|
height: 24px !important;
|
|
padding: 0 12px !important;
|
|
}
|
|
|
|
.apply_pop {
|
|
width: 100%;
|
|
height: 100%;
|
|
background-color: #f6f7f9;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.van-doc-card {
|
|
background-color: #fff;
|
|
border-radius: 6px;
|
|
box-shadow: 0 8px 12px #ebedf0;
|
|
line-height: 20px;
|
|
position: relative;
|
|
}
|
|
|
|
.van-card-header {
|
|
padding: 14px 20px;
|
|
border-bottom: 1px solid #ebeef5;
|
|
box-sizing: border-box;
|
|
color: #0e78c5;
|
|
font-weight: bold;
|
|
font-size: 15px;
|
|
}
|
|
|
|
.van-card-body {
|
|
padding: 0px 10px 0px 10px
|
|
}
|
|
|
|
.van-doc-card > div:first-child {
|
|
border: 2px #0e78c5 solid;
|
|
width: 26px;
|
|
border-radius: 6px;
|
|
position: absolute;
|
|
top: 0;
|
|
left: 20px;
|
|
}
|
|
|
|
.label {
|
|
border-left: 5px #1867b0 solid;
|
|
border-radius: 4px;
|
|
padding-left: 6px;
|
|
margin: 10px 0px;
|
|
}
|
|
|
|
.label_text {
|
|
color: grey;
|
|
line-height: 24px;
|
|
white-space: break-spaces;
|
|
font-size: 18px;
|
|
}
|
|
|
|
.apply_pop {
|
|
width: 100%;
|
|
height: 100%;
|
|
background-color: #f6f7f9;
|
|
font-size: 14px;
|
|
}
|
|
</style>
|
|
|
|
<div id="app" v-cloak>
|
|
<van-nav-bar
|
|
title="我的预约记录"
|
|
left-arrow
|
|
placeholder
|
|
fixed
|
|
@click-left="window.history.back()"
|
|
></van-nav-bar>
|
|
|
|
<div class="search-fixed">
|
|
<van-dropdown-menu>
|
|
<van-dropdown-item v-model="pageForm.year" :options="yearList"
|
|
@change="doSearch"></van-dropdown-item>
|
|
<van-dropdown-item v-model="pageForm.stateId" :options="stateList"
|
|
@change="doSearch"></van-dropdown-item>
|
|
</van-dropdown-menu>
|
|
</div>
|
|
|
|
<div style="margin: 60px auto">
|
|
<van-list v-model="loading"
|
|
:finished="finished"
|
|
:finished-text="tableData.length>0?'没有更多了':''"
|
|
:immediate-check="false"
|
|
@load="pageData">
|
|
<div v-for="o in tableData" class="list-card" @click="viewInfo(o)">
|
|
<div class="card-head">
|
|
心理咨询预约
|
|
<span class="state-text">
|
|
<van-tag size="medium" v-if="o.stateId===2330" type="success">{{o.stateName}}</van-tag>
|
|
<van-tag size="medium" v-if="o.stateId===2320" type="error">{{o.stateName}}</van-tag>
|
|
<van-tag size="medium" v-if="o.stateId===2310" type="warning">{{o.stateName}}</van-tag>
|
|
</span>
|
|
</div>
|
|
<van-cell-group inset>
|
|
<van-cell :border="false" title="预约人">{{o.appointmentUserName}}</van-cell>
|
|
<van-cell :border="false" title="开始时间">{{o.startTime}}</van-cell>
|
|
<van-cell :border="false" title="结束时间">{{o.endTime}}</van-cell>
|
|
</van-cell-group>
|
|
<div class="cancel-button">
|
|
<van-button v-if="moment().unix() < moment(o.startTime).unix()" style="margin-right: 4px"
|
|
@click.stop="update(o)" round size="small" color="#1867b0">修改
|
|
</van-button>
|
|
<van-button v-if="moment().unix() < moment(o.startTime).unix()"
|
|
@click.stop="doCancel(o.id)" round size="small" color="#1867b0">取消
|
|
</van-button>
|
|
</div>
|
|
</div>
|
|
</van-list>
|
|
</div>
|
|
|
|
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg"
|
|
description="暂无数据">
|
|
</van-empty>
|
|
|
|
<van-popup v-model="show" class="apply_pop" position="right">
|
|
<van-nav-bar
|
|
title="预约详细信息"
|
|
left-arrow
|
|
placeholder
|
|
fixed
|
|
@click-left="show = false"
|
|
safe-area-inset-top></van-nav-bar>
|
|
|
|
<div class="van-doc-card" style="margin: 16px">
|
|
<div></div>
|
|
<div class="van-card-header">
|
|
预约时间段
|
|
</div>
|
|
<div class="van-card-body">
|
|
<van-cell-group>
|
|
<van-cell title="开始时间">{{ viewData.startTime }}</van-cell>
|
|
<van-cell title="结束时间">{{ viewData.endTime }}</van-cell>
|
|
</van-cell-group>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="van-doc-card" style="margin: 16px">
|
|
<div></div>
|
|
<div class="van-card-header">
|
|
预约人信息
|
|
</div>
|
|
<div class="van-card-body">
|
|
<van-cell-group>
|
|
<van-cell title="姓名">{{ viewData.appointmentUserName }}</van-cell>
|
|
<van-cell title="工号">{{ viewData.appointmentLoginName }}</van-cell>
|
|
<van-cell title="单位">{{ viewData.appointmentUnitName }}</van-cell>
|
|
<van-cell title="电话">{{ viewData.appointmentMobile }}</van-cell>
|
|
<van-cell title="预约咨询方式">{{ getAskTypeName() }}</van-cell>
|
|
<van-cell title="预约备注">{{ viewData.appointmentUserNote }}</van-cell>
|
|
</van-cell-group>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="van-doc-card" style="margin: 16px">
|
|
<div></div>
|
|
<div class="van-card-header">
|
|
咨询师信息
|
|
</div>
|
|
<div class="van-card-body">
|
|
<van-cell-group>
|
|
<van-cell title="姓名">{{ viewData.doctorUserName || '暂无'}}</van-cell>
|
|
<van-cell title="单位">{{ viewData.doctorUnitName || '暂无'}}</van-cell>
|
|
<van-cell title="电话">{{ viewData.doctorMobile || '暂无'}}</van-cell>
|
|
<van-cell title="擅长方向">{{ viewData.doctorSpecialty || '暂无'}}</van-cell>
|
|
<van-cell title="工作理念">{{ viewData.doctorWorkingIdeal || '暂无'}}</van-cell>
|
|
<van-cell title="咨询方式">
|
|
<div v-if="!viewData.askType || getDoctorAskTypeName().length === 0">暂无</div>
|
|
<div v-else>
|
|
<div v-for="item in getDoctorAskTypeName()">
|
|
{{ item.name }}
|
|
</div>
|
|
</div>
|
|
</van-cell>
|
|
<van-cell @click="doctorIntroduceShow = true" title="咨询师简介" is-link>
|
|
<div style="overflow: hidden; white-space: nowrap; text-overflow: ellipsis; word-break: break-word;">
|
|
{{ viewData.doctorIntroduce || '暂无'}}
|
|
</div>
|
|
</van-cell>
|
|
</van-cell-group>
|
|
</div>
|
|
</div>
|
|
|
|
</van-popup>
|
|
|
|
<van-popup v-model:show="doctorIntroduceShow" position="bottom" round style="padding: 20px; width: auto">
|
|
<div style="display: flex; align-items: center; justify-content: space-between">
|
|
<div class="label">咨询师简介</div>
|
|
<div @click="doctorIntroduceShow = false">
|
|
<van-icon name="cross"></van-icon>
|
|
</div>
|
|
</div>
|
|
<pre class="label_text">{{viewData.doctorIntroduce ? viewData.doctorIntroduce : '暂无数据,该资料待补充'}}</pre>
|
|
</van-popup>
|
|
|
|
<van-popup v-model="infoShow" class="apply_pop" position="right">
|
|
<van-nav-bar
|
|
title="预约信息"
|
|
left-arrow
|
|
placeholder
|
|
fixed
|
|
@click-left="infoShow = false">
|
|
</van-nav-bar>
|
|
<van-form ref="addForm" :show-error-message="false" input-align="right">
|
|
<van-cell-group inset class="mt10">
|
|
<van-field readonly
|
|
:value="chooseData.startTime"
|
|
label="开始时间"></van-field>
|
|
<van-field readonly
|
|
:value="chooseData.endTime"
|
|
label="结束时间"></van-field>
|
|
</van-cell-group>
|
|
|
|
<van-cell-group inset class="mt10" v-if="chooseData.doctorUser">
|
|
<van-field readonly
|
|
:value="chooseData.doctorUserName"
|
|
label="咨询师姓名"></van-field>
|
|
<van-field readonly
|
|
:value="chooseData.doctorMobile"
|
|
label="咨询师电话"></van-field>
|
|
</van-cell-group>
|
|
|
|
<van-cell-group inset class="mt10">
|
|
<van-field readonly
|
|
value="${@shiro.getPrincipalProperty('username')}"
|
|
label="预约人姓名"></van-field>
|
|
<van-field readonly
|
|
value="${@shiro.getPrincipalProperty('loginname')}"
|
|
label="预约人工号"></van-field>
|
|
<van-field readonly
|
|
value="${@shiro.getPrincipalProperty('unit').getName()}"
|
|
label="预约人单位"></van-field>
|
|
<van-field :rules="[{ required: true, message: '请填写电话' }]"
|
|
required
|
|
type="tel"
|
|
v-model=chooseData.userMobile
|
|
label="预约人电话"></van-field>
|
|
</van-cell-group>
|
|
<van-cell-group inset class="mt10">
|
|
|
|
<div v-if="chooseData.askType">
|
|
<van-field v-model="appointmentAskTypeText" label="咨询方式" @click="appointmentAskTypeShow = true"
|
|
placeholder="请选择咨询方式"></van-field>
|
|
<van-popup v-model:show="appointmentAskTypeShow" position="bottom" round>
|
|
<van-picker show-toolbar :columns="askTypeArray" @confirm="askTypeConfirm"
|
|
@cancel="appointmentAskTypeShow = false">
|
|
</van-picker>
|
|
</van-popup>
|
|
</div>
|
|
|
|
<van-field
|
|
v-model="appointmentUserNote"
|
|
rows="3"
|
|
autosize
|
|
label="预约备注"
|
|
type="textarea"
|
|
placeholder="您可以输入预约备注"
|
|
></van-field>
|
|
</van-cell-group>
|
|
</van-form>
|
|
<div class="footer">
|
|
<van-button @click="doSubmit()" color="#1867b0">提交预约</van-button>
|
|
</div>
|
|
</van-popup>
|
|
|
|
|
|
<div>
|
|
<van-tabbar v-model="tarBarActive">
|
|
<van-tabbar-item icon="home-o" replace url="/mobile/psychologyPro/entrance">心理咨询预约</van-tabbar-item>
|
|
<van-tabbar-item icon="manager-o" replace url="/mobile/psychologyPro/myApplyList">我的预约</van-tabbar-item>
|
|
</van-tabbar>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
const vue = new Vue({
|
|
el: '#app',
|
|
mixins: [mobileMixins],
|
|
data() {
|
|
return {
|
|
tarBarActive: 1,
|
|
appointmentAskTypeText: '',
|
|
appointmentUserNote: '',
|
|
appointmentAskTypeShow: false,
|
|
appointmentAskTypeValue: '',
|
|
askTypeArray: [],
|
|
chooseData: {},
|
|
infoShow: false,
|
|
doctorIntroduceShow: false,
|
|
stateList: [
|
|
{text: '全部预约状态', value: null},
|
|
{text: '预约中', value: 2100},
|
|
{text: '预约成功', value: 2300},
|
|
{text: '预约失败', value: 2200}
|
|
],
|
|
askTypeList: [],
|
|
show: false,
|
|
viewData: {},
|
|
}
|
|
},
|
|
methods: {
|
|
update(o) {
|
|
this.askTypeArray = []
|
|
if (o.askType) {
|
|
const array = JSON.parse(o.askType)
|
|
this.askTypeList.map(o => {
|
|
if (array.includes(o.code)) {
|
|
this.askTypeArray.push({text: o.name, value: o.code})
|
|
}
|
|
})
|
|
}
|
|
if (o.appointmentAskTypeValue) {
|
|
const type = this.askTypeList.find(x => x.code === o.appointmentAskTypeValue)
|
|
this.appointmentAskTypeText = type ? type.name : ''
|
|
}
|
|
this.chooseData = o
|
|
this.appointmentUserNote = o.appointmentUserNote
|
|
this.$set(this.chooseData, "userMobile", "${@shiro.getPrincipalProperty('mobile')}")
|
|
this.infoShow = true
|
|
},
|
|
askTypeConfirm(val) {
|
|
this.$set(this, "appointmentAskTypeText", val.text)
|
|
this.$set(this, "appointmentAskTypeValue", val.value)
|
|
this.appointmentAskTypeShow = false
|
|
},
|
|
async doSubmit() {
|
|
if (!this.chooseData.userMobile) {
|
|
this.$toast.fail("请输入手机号");
|
|
return
|
|
}
|
|
const valid = await vant.Dialog.confirm({
|
|
title: '提示',
|
|
message: '您确认提交吗?',
|
|
confirmButtonColor: '#1867b0'
|
|
})
|
|
if (valid) {
|
|
this.$toast.loading('提交中...')
|
|
const params = {
|
|
appointmentUserNote: this.appointmentUserNote,
|
|
appointmentAskTypeValue: this.appointmentAskTypeValue,
|
|
userMobile: this.chooseData.userMobile,
|
|
id: this.chooseData.id,
|
|
isAdd: false,
|
|
}
|
|
const resp = await $.post('/mobile/psychologyPro/doApply', params)
|
|
if (resp.code === 0) {
|
|
this.$toast.success('修改成功')
|
|
setTimeout(() => {
|
|
location.replace('/mobile/psychologyPro/myApplyList')
|
|
}, 1000)
|
|
} else if (resp.code === 1) {
|
|
this.$toast.error(resp.msg)
|
|
} else if (resp.code === 2) {
|
|
this.$toast(resp.msg)
|
|
}
|
|
}
|
|
},
|
|
getAskTypeName() {
|
|
if (this.viewData.appointmentAskTypeValue) {
|
|
const type = this.askTypeList.find(o => o.code === this.viewData.appointmentAskTypeValue + '')
|
|
return type ? type.name : '暂无'
|
|
} else {
|
|
return '暂无'
|
|
}
|
|
},
|
|
getDoctorAskTypeName() {
|
|
const askTypeArray = []
|
|
if (this.viewData.askType) {
|
|
const array = JSON.parse(this.viewData.askType)
|
|
this.askTypeList.map(o => {
|
|
if (array.includes(o.code)) {
|
|
askTypeArray.push(o)
|
|
}
|
|
})
|
|
}
|
|
return askTypeArray
|
|
},
|
|
async pageData() {
|
|
this.loading = true
|
|
const {data} = await $.get('/mobile/psychologyPro/MyPageData', this.pageForm)
|
|
setTimeout(() => {
|
|
this.tableData = this.tableData.concat(data.list)
|
|
if (this.tableData.length === data.totalCount) {
|
|
this.finished = true
|
|
} else {
|
|
this.pageForm.pageNumber++
|
|
}
|
|
this.loading = false
|
|
this.pageForm.totalCount = data.totalCount
|
|
}, 300)
|
|
},
|
|
doSearch() {
|
|
this.pageForm.pageNumber = 1
|
|
this.tableData = []
|
|
this.pageData()
|
|
},
|
|
viewInfo(o) {
|
|
this.viewData = o
|
|
this.show = true
|
|
},
|
|
async doCancel(id) {
|
|
const confirm = await vant.Dialog.confirm({
|
|
title: '提示',
|
|
message: '您确定取消此次预约吗?',
|
|
confirmButtonColor: '#1867b0'
|
|
})
|
|
if (confirm === 'confirm') {
|
|
const resp = await $.post('/mobile/psychologyPro/doCancel', {id})
|
|
if (resp.code === 0) {
|
|
vant.Toast.success('取消成功')
|
|
this.doSearch()
|
|
}
|
|
}
|
|
}
|
|
},
|
|
async created() {
|
|
this.pageForm.year = this.yearList[0].value
|
|
this.pageForm.stateId = null
|
|
this.pageData()
|
|
this.askTypeList = await getDictOptions("psychology_asktype")
|
|
}
|
|
})
|
|
</script>
|
|
|
|
<!--#
|
|
}
|
|
#-->
|