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

发送预约校验需求修改

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