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

预约校验修改

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