提交 81c62273 编写于 作者: yi.li's avatar yi.li

发送预约校验需求修改

上级 e79692e5
......@@ -66,13 +66,15 @@
<el-button type="primary" @click="closeSendReserve('reservationForm')">立即发送</el-button>
</div>
</el-dialog>
<no-enough :isNoEnoughShow="isNoEnoughShow" @closeTipsDialog="closeTipsDialog"></no-enough>
</div>
</template>
<script>
import {sendReservation} from '@/utils/followup/followapis'
import NoEnough from './no-enough'
import { mapState, mapActions } from 'vuex'
export default {
components: {},
components: {NoEnough},
data(){
return{
reservationDialog: true,
......@@ -127,7 +129,7 @@
value: 15,
label: '20:00-21:00'
}],
doctorName: '云晓雀',
isNoEnoughShow: false, //余额不足dialog展示
rules: {
appointmentDate: [{ required: true, message: '请选择预约日期', trigger: 'change' }],
appointmentRange: [{ required: true, message: '请选择时间段', trigger: 'change' }],
......@@ -148,6 +150,10 @@
selectList: { //已选择发送人员list
type: Array,
default: [],
},
validContents: {
type: Array,
default: [],
}
},
watch: {
......@@ -159,15 +165,19 @@
...mapState('reservationManage',{
getRevervationNum: state => state.getRevervationNum,
userName: state => state.userName,
checkRevervationData: state => state.checkRevervationData,
})
},
mounted(){
},
methods: {
...mapActions('reservationManage', ['getReservationPatients']),
...mapActions('reservationManage', ['getReservationPatients', 'getCheckReservation']),
changeHandler(val) {
this.getReservationPatients({makeAnAppointDate: val});
},
closeTipsDialog(val){
this.isNoEnoughShow = val;
},
closeSendReserve1(){
if (this.$refs['reservationForm']) {
this.$refs['reservationForm'].resetFields();
......@@ -177,13 +187,24 @@
closeSendReserve(formName){
this.$refs[formName].validate((valid) => {
if (valid) {
sendReservation({
...this.reservationForm,
patientAppointList: this.selectList
}).then(({data}) => {
this.$refs['reservationForm'].resetFields();
this.$emit('closeSendReserve',false);
//校验额度是否不够
this.getCheckReservation({
content: '',
validContents: this.validContents
})
const { sendFlag } = this.checkRevervationData;
if(sendFlag){ //额度还可用
sendReservation({
...this.reservationForm,
patientAppointList: this.selectList
}).then(({data}) => {
this.$refs['reservationForm'].resetFields();
this.$emit('closeSendReserve',false);
})
}else {
// 额度不足
this.isNoEnoughShow = true;
}
} else {
return false;
}
......
......@@ -122,7 +122,7 @@
</div>
</div>
</div>
<send-reservation :isDialogShow="isDialogShow" :checkData="checkRevervationData" :selectList="selectList" @closeSendReserve="closeSendReserve"></send-reservation>
<send-reservation :isDialogShow="isDialogShow" :checkData="checkRevervationData" :selectList="selectList" @closeSendReserve="closeSendReserve" :validContents="validContents"></send-reservation>
<no-enough :isNoEnoughShow="isNoEnoughShow" @closeTipsDialog="closeTipsDialog"></no-enough>
<change-reservation :isChangeReservation="isChangeReservation" @closeChangeReserve="closeChangeReserve" :reservationForm="needPara"></change-reservation>
<followup-detail :dialogFormVisible="dialogDetailShow" @closeDetail="closeDetail" :enteringInfo="enteringInfo"></followup-detail>
......@@ -270,22 +270,25 @@
}
return para;
},
async sendReservation() {
async initCheck() {
await this.getCheckReservation({
// patientIds: this.ids
content: '',
validContents:this.validContents
})
const { sendFlag } = this.checkRevervationData
//判断短信余额是否不足
if(sendFlag){
this.isDialogShow = true;
}else {
this.isNoEnoughShow = true;
}
},
sendReservation() {
if(this.selectionData.length > 0){
this.selectList = this.selectionData;
//发送预约校验接口
await this.getCheckReservation({
// patientIds: this.ids
content: '',
validContents:this.validContents
})
const { sendFlag } = this.checkRevervationData
//判断短信余额是否不足
if(sendFlag){
this.isDialogShow = true;
}else {
this.isNoEnoughShow = true;
}
// 发送预约校验
this.initCheck();
}else if(this.selectionData.length > 100){
this.$message.warning('每次最多选择100条单条随访进行预约!');
return false;
......@@ -294,7 +297,7 @@
return false;
}
},
async sendReservationRow(row){
sendReservationRow(row){
let newList = [];
newList.push({
planId: row.fuPlanId,
......@@ -304,22 +307,12 @@
type: row.fuPlanType,
});
this.selectList = newList;
//发送预约校验
await this.getCheckReservation({
content: '',
validContents: [{
patientId: row.patientId,
size: 1,
}],
// patientIds: [row.patientId]
})
const { sendFlag } = this.checkRevervationData
//判断短信余额是否不足
if(sendFlag){
this.isDialogShow = true;
}else {
this.isNoEnoughShow = true;
}
this.validContents = [{
patientId: row.patientId,
size: 1,
}];
// 发送预约校验
this.initCheck();
},
changeReserveClick(row){
this.needPara = {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册