提交 552e6760 编写于 作者: yi.li's avatar yi.li

调试发送预约校验接口

上级 939f4432
...@@ -8,12 +8,16 @@ export default { ...@@ -8,12 +8,16 @@ export default {
pageSize: 10, //每页数据大小 pageSize: 10, //每页数据大小
total: null, //总数 total: null, //总数
}, },
checkRevervationData: { //发送预约校验
},
}, },
mutations: { mutations: {
GET_RESERVATION_LIST(state, payload) { GET_RESERVATION_LIST(state, payload) {
state.reservationList = payload state.reservationList = payload
}, },
GET_CHECK_RESERVATION(state, payload) {
state.checkRevervationData = payload
},
}, },
actions: { actions: {
getReservationList(context, payload) { getReservationList(context, payload) {
...@@ -25,6 +29,13 @@ export default { ...@@ -25,6 +29,13 @@ export default {
}).then(({data}) => { }).then(({data}) => {
context.commit('GET_RESERVATION_LIST', data); context.commit('GET_RESERVATION_LIST', data);
}); });
} },
getCheckReservation(context, payload) {
followApi.getCheckReservation({
...payload
}).then(({data}) => {
context.commit('GET_CHECK_RESERVATION', data)
})
},
}, },
} }
...@@ -32,6 +32,13 @@ const reservationManageApi = [ ...@@ -32,6 +32,13 @@ const reservationManageApi = [
name: 'getReservationList', name: 'getReservationList',
description: '获取预约列表', description: '获取预约列表',
}, },
{
url: '/followup/appointmentPatient/check/',
method: 'get',
params: 'params',
name: 'getCheckReservation',
description: '发送预约校验',
},
] ]
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
</div> </div>
<p class="warn-tips" v-if="reservationForm.reservationDate">该日期已经成功预约{{reservationForm.hasReservedNumber}}人,请确保能在此时间段完成预约的随访任务</p> <p class="warn-tips" v-if="reservationForm.reservationDate">该日期已经成功预约{{reservationForm.hasReservedNumber}}人,请确保能在此时间段完成预约的随访任务</p>
</el-form-item> </el-form-item>
<el-form-item label="变更原因"> <el-form-item label="变更原因" prop="reason">
<el-input type="textarea" v-model="reservationForm.reason" placeholder="请输入变更原因" maxlength="30" rows="3" style="width:60%;"></el-input> <el-input type="textarea" v-model="reservationForm.reason" placeholder="请输入变更原因" maxlength="30" rows="3" style="width:60%;"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
......
...@@ -59,7 +59,8 @@ ...@@ -59,7 +59,8 @@
<el-table <el-table
:data="reservationList.fPlanAppointmentDtoList" :data="reservationList.fPlanAppointmentDtoList"
center center
style="width: 100%;margin-top: 20px;"> style="width: 100%;margin-top: 20px;"
@selection-change="handleSelectionChange">
<el-table-column <el-table-column
type="selection" type="selection"
align="center"> align="center">
...@@ -127,16 +128,16 @@ ...@@ -127,16 +128,16 @@
//面包屑 //面包屑
import BreadCrumb from '@/components/breadcrumb'; import BreadCrumb from '@/components/breadcrumb';
import sendReservation from './dialog/send-reservation'; import SendReservation from './dialog/send-reservation';
import noEnough from './dialog/no-enough'; import NoEnough from './dialog/no-enough';
import ChangeReservation from "./dialog/change-reservation"; import ChangeReservation from "./dialog/change-reservation";
export default { export default {
name: "reservation-list", name: "reservation-list",
components: { components: {
ChangeReservation, ChangeReservation,
BreadCrumb, BreadCrumb,
sendReservation, SendReservation,
noEnough NoEnough
}, },
data() { data() {
return { return {
...@@ -165,6 +166,8 @@ ...@@ -165,6 +166,8 @@
isDialogShow: false, //发送预约dialog展示 isDialogShow: false, //发送预约dialog展示
isNoEnoughShow: false, //余额不足dialog展示 isNoEnoughShow: false, //余额不足dialog展示
isChangeReservation: false, //变更预约状态dialog展示 isChangeReservation: false, //变更预约状态dialog展示
selectionData: [],
ids: '',
} }
}, },
created() { created() {
...@@ -176,10 +179,11 @@ ...@@ -176,10 +179,11 @@
computed: { computed: {
...mapState('reservationManage',{ ...mapState('reservationManage',{
reservationList: state => state.reservationList, reservationList: state => state.reservationList,
checkRevervationData: state => state.checkRevervationData,
}) })
}, },
methods: { methods: {
...mapActions('reservationManage', ['getReservationList']), ...mapActions('reservationManage', ['getReservationList','getCheckReservation']),
handleSizeChangePre(pageSize) { handleSizeChangePre(pageSize) {
this.getReservationList({ this.getReservationList({
pageSize, pageSize,
...@@ -233,12 +237,25 @@ ...@@ -233,12 +237,25 @@
return para; return para;
}, },
sendReservation() { sendReservation() {
if(this.selectionData.length > 0){
this.getCheckReservation({
patientIds: this.ids
});
const { messageCount, messageNum, weChatNum, total} = this.checkRevervationData
//判断短信余额是否不足 //判断短信余额是否不足
if(this.hasSmsBalance){ // if(this.hasSmsBalance){
if(messageNum <= messageCount){
this.isDialogShow = true; this.isDialogShow = true;
}else { }else {
this.isNoEnoughShow = true; this.isNoEnoughShow = true;
} }
}else if(this.selectionData.length > 100){
this.$message.warning('每次最多选择100条单条随访进行预约!');
return false;
} else {
this.$message.warning('请选择要发送预约的居民!');
return false;
}
}, },
changeReserveClick(){ changeReserveClick(){
this.isChangeReservation = true; this.isChangeReservation = true;
...@@ -251,7 +268,20 @@ ...@@ -251,7 +268,20 @@
}, },
closeChangeReserve(val){ closeChangeReserve(val){
this.isChangeReservation = val; this.isChangeReservation = val;
},
handleSelectionChange(val){
this.selectionData = val;
let idsArray = [];
if (val.length > 0) {
// this.disabledDelete = false
for(let i=0; i<val.length; i++){
idsArray.push(val[i].nickId)
} }
this.ids = idsArray.join(",")
} else {
// this.disabledDelete = true
}
},
}, },
watch: { watch: {
status(val) { status(val) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册