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

发送预约接口

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