提交 5cd7008a 编写于 作者: yi.li's avatar yi.li

预约校验修改

上级 c42ed563
......@@ -70,7 +70,7 @@
</div>
</template>
<script>
import {sendReservation} from '@/utils/followup/followapis'
import {sendReservation, getCheckReservation} from '@/utils/followup/followapis'
import NoEnough from './no-enough'
import { mapState, mapActions } from 'vuex'
export default {
......@@ -78,6 +78,7 @@
data(){
return{
reservationDialog: true,
sendFlagLast: null,
reservationForm: {
appointmentDate: '',
appointmentRange: '',
......@@ -165,13 +166,13 @@
...mapState('reservationManage',{
getRevervationNum: state => state.getRevervationNum,
userName: state => state.userName,
checkRevervationData: state => state.checkRevervationData,
// checkRevervationData: state => state.checkRevervationData,
})
},
mounted(){
},
methods: {
...mapActions('reservationManage', ['getReservationPatients', 'getCheckReservation']),
...mapActions('reservationManage', ['getReservationPatients']),
changeHandler(val) {
this.getReservationPatients({makeAnAppointDate: val});
},
......@@ -184,34 +185,31 @@
}
this.$emit('closeSendReserve',false)
},
async initLastCheck() {
await this.getCheckReservation({
content: '',
validContents: this.validContents
})
},
closeSendReserve(formName){
let _self = this;
_self.$refs[formName].validate((valid) => {
if (valid) {
//校验额度是否不够
_self.initLastCheck();
const { sendFlag } = _self.checkRevervationData;
console.log('sendFlag',sendFlag)
if(sendFlag){ //额度还可用
sendReservation({
...this.reservationForm,
patientAppointList: this.selectList
}).then(({data}) => {
this.$refs['reservationForm'].resetFields();
this.$emit('closeSendReserve',false);
})
}else {
console.log('余额不足')
// 额度不足
this.isNoEnoughShow = true;
return;
}
getCheckReservation({
content: '',
validContents: this.validContents
}).then(({data}) => {
const sendFlagLast = data.sendFlag;
if(sendFlagLast){ //额度还可用
sendReservation({
...this.reservationForm,
patientAppointList: this.selectList
}).then(({data}) => {
this.$refs['reservationForm'].resetFields();
this.$emit('closeSendReserve',false);
})
}else {
console.log('余额不足')
// 额度不足
this.isNoEnoughShow = true;
return;
}
})
} else {
return false;
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册