提交 7ef27784 编写于 作者: yi.li's avatar yi.li

发送预约接口

上级 e4495b87
...@@ -33,19 +33,33 @@ export default { ...@@ -33,19 +33,33 @@ export default {
context.commit('GET_RESERVATION_LIST', data); context.commit('GET_RESERVATION_LIST', data);
}); });
}, },
getCheckReservation(context, payload) { async getCheckReservation(context, payload) {
followApi.getCheckReservation({ await followApi.getCheckReservation({
...payload ...payload
}).then(({data}) => { }).then(({data}) => {
context.commit('GET_CHECK_RESERVATION', data) context.commit('GET_CHECK_RESERVATION', data)
}) })
}, },
getConstantsData(context, payload) { async getConstantsData(context, payload) {
followApi.getBasicData({ await followApi.getBasicData({
...payload ...payload
}).then(({data}) => { }).then(({data}) => {
context.commit('GET_CONSTANS_DATA', data) context.commit('GET_CONSTANS_DATA', data)
}) })
}, },
// getConstantsData({commit}) {
// return new Promise(async (resolve, reject)=>{
// const res = await followApi.getBasicData({
// ...payload
// });
// if (res === null) return;
// commit('GET_CONSTANS_DATA', res);
// resolve() // 接口请求完成
// })
// }
}, },
} }
...@@ -53,6 +53,13 @@ const reservationManageApi = [ ...@@ -53,6 +53,13 @@ const reservationManageApi = [
name: 'getCheckReservation', name: 'getCheckReservation',
description: '发送预约校验', description: '发送预约校验',
}, },
{
url: '/followup/appointmentPatient/accept/',
method: 'get',
params: 'params',
name: 'getReservationPatients',
description: '查看预约人数',
},
] ]
......
...@@ -183,6 +183,7 @@ ...@@ -183,6 +183,7 @@
placeholderTxt: '请输入变更原因', placeholderTxt: '请输入变更原因',
errTips: false, errTips: false,
dialogDetailShow: false, dialogDetailShow: false,
statusTabls:[],
} }
}, },
computed: { computed: {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
label-width="120px" label-width="120px"
:label-position="'left'"> :label-position="'left'">
<el-form-item label="已选居民"> <el-form-item label="已选居民">
<span>{{reservationForm.totalNumber}}</span><span>(微信发送{{reservationForm.wechatNumber}}人;短信发送{{reservationForm.smsNumber}}人)</span> <span>{{checkData.total}}</span><span>(微信发送{{checkData.weChatNum}}人;短信发送{{checkData.messageNum}}人)</span>
</el-form-item> </el-form-item>
<el-form-item label="预约时间" required> <el-form-item label="预约时间" required>
<div style="display: flex;"> <div style="display: flex;">
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
placeholder="请选择预约日期" placeholder="请选择预约日期"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
value="yyyy-MM-dd" value="yyyy-MM-dd"
:picker-options="pickerOptions"> :picker-options="pickerOptions" @change="changeHandler">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item prop="timeRange"> <el-form-item prop="timeRange">
...@@ -50,11 +50,11 @@ ...@@ -50,11 +50,11 @@
</div> </div>
<div class="item"> <div class="item">
<span class="title">本次推送:</span> <span class="title">本次推送:</span>
<p>{{reservationForm.totalNumber}}条(微信不限额推送{{reservationForm.wechatNumber}}条;使用短信额度推送{{reservationForm.smsNumber}}条)</p> <p>{{checkData.total}}条(微信不限额推送{{checkData.weChatNum}}条;使用短信额度推送{{checkData.messageNum}}条)</p>
</div> </div>
<div class="item"> <div class="item">
<span class="title">推送成功后剩余余额:</span> <span class="title">推送成功后剩余余额:</span>
<p>{{smsBalanceNumber}}</p> <p>{{ checkData.messageCount - checkData.messageNum}}</p>
</div> </div>
<p>提示:微信推送不消耗额度,建议您与居民绑定微信,关注云鹊健康微信公众号</p> <p>提示:微信推送不消耗额度,建议您与居民绑定微信,关注云鹊健康微信公众号</p>
</div> </div>
...@@ -66,18 +66,16 @@ ...@@ -66,18 +66,16 @@
</div> </div>
</template> </template>
<script> <script>
import followApi from '@/utils/followup/followapis'
export default { export default {
components: {}, components: {},
data(){ data(){
return{ return{
reservationDialog: true, reservationDialog: true,
reservationForm: { reservationForm: {
totalNumber: 88,
wechatNumber: 60,
smsNumber: 28,
reservationDate: '', reservationDate: '',
timeRange: '', timeRange: '',
hasReservedNumber: 60 hasReservedNumber: null
}, },
timeRangeOptions: [ timeRangeOptions: [
{ {
...@@ -145,13 +143,21 @@ ...@@ -145,13 +143,21 @@
isDialogShow: { isDialogShow: {
type: Boolean, type: Boolean,
default: false default: false
} },
checkData: {},
}, },
computed: { computed: {
}, },
mounted(){ mounted(){
}, },
methods: { methods: {
changeHandler(val) {
followApi.getReservationPatients({
time: val
}).then(({data}) => {
this.reservationForm.hasReservedNumber = data.number;
})
},
closeSendReserve1(){ closeSendReserve1(){
if (this.$refs['reservationForm']) { if (this.$refs['reservationForm']) {
this.$refs['reservationForm'].resetFields(); this.$refs['reservationForm'].resetFields();
......
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
label="操作" label="操作"
align="center"> align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button class="btn-right-class" type="text" >发送预约</el-button>| <el-button class="btn-right-class" type="text" @click="sendReservationRow(scope.row)">发送预约</el-button>|
<el-button class="btn-right-class" type="text" @click="changeReserveClick(scope.row)">变更预约</el-button> <el-button class="btn-right-class" type="text" @click="changeReserveClick(scope.row)">变更预约</el-button>
</template> </template>
</el-table-column> </el-table-column>
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
</div> </div>
</div> </div>
</div> </div>
<send-reservation :isDialogShow="isDialogShow" @closeSendReserve="closeSendReserve"></send-reservation> <send-reservation :isDialogShow="isDialogShow" :checkData="checkRevervationData" @closeSendReserve="closeSendReserve"></send-reservation>
<no-enough :isNoEnoughShow="isNoEnoughShow" @closeTipsDialog="closeTipsDialog"></no-enough> <no-enough :isNoEnoughShow="isNoEnoughShow" @closeTipsDialog="closeTipsDialog"></no-enough>
<change-reservation :isChangeReservation="isChangeReservation" @closeChangeReserve="closeChangeReserve"></change-reservation> <change-reservation :isChangeReservation="isChangeReservation" @closeChangeReserve="closeChangeReserve"></change-reservation>
</div> </div>
...@@ -164,8 +164,9 @@ ...@@ -164,8 +164,9 @@
label: '已过期' label: '已过期'
} }
], //居民预约状态\ ], //居民预约状态\
hasSmsBalance: true, //短信余额是否充足 // hasSmsBalance: true, //短信余额是否充足
isDialogShow: false, //发送预约dialog展示 isDialogShow: false, //发送预约dialog展示
// checkData: {},
isNoEnoughShow: false, //余额不足dialog展示 isNoEnoughShow: false, //余额不足dialog展示
isChangeReservation: false, //变更预约状态dialog展示 isChangeReservation: false, //变更预约状态dialog展示
selectionData: [], selectionData: [],
...@@ -238,19 +239,21 @@ ...@@ -238,19 +239,21 @@
} }
return para; return para;
}, },
sendReservation() { async sendReservation() {
if(this.selectionData.length > 0){ if(this.selectionData.length > 0){
this.getCheckReservation({ await this.getCheckReservation({
patientIds: this.ids patientIds: this.ids
}); })
const { messageCount, messageNum, weChatNum, total} = this.checkRevervationData const { messageCount, messageNum, weChatNum, total} = this.checkRevervationData
//判断短信余额是否不足 //判断短信余额是否不足
// if(this.hasSmsBalance){ // if(this.hasSmsBalance){
if(messageNum <= messageCount){ if(parseInt(messageNum) <= parseInt(messageCount)){
this.isDialogShow = true; this.isDialogShow = true;
// this.checkData = JSON.parse(JSON.stringify(this.checkRevervationData));
}else { }else {
this.isNoEnoughShow = true; this.isNoEnoughShow = true;
} }
}else if(this.selectionData.length > 100){ }else if(this.selectionData.length > 100){
this.$message.warning('每次最多选择100条单条随访进行预约!'); this.$message.warning('每次最多选择100条单条随访进行预约!');
return false; return false;
...@@ -259,6 +262,9 @@ ...@@ -259,6 +262,9 @@
return false; return false;
} }
}, },
sendReservationRow(row){
console.log('单条')
},
changeReserveClick(){ changeReserveClick(){
this.isChangeReservation = true; this.isChangeReservation = true;
}, },
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册