提交 b6993720 编写于 作者: Yuanzhao.dai's avatar Yuanzhao.dai

Merge branch 'dev-followUp-20190312' of...

Merge branch 'dev-followUp-20190312' of http://192.168.110.53/com.pica.cloud.education.frontend/pica.cloud.web-education-admin into dev-followUp-20190312
...@@ -20,7 +20,14 @@ ...@@ -20,7 +20,14 @@
:value="item.no"> :value="item.no">
</el-option> </el-option>
</el-select> </el-select>
<el-select v-if="showSecond" v-model="typeId" placeholder="请选择类目" size="small" style="margin-left:20px;"> <el-select
v-if="showSecond"
v-model="typeId"
@change="changeType"
placeholder="请选择类目"
size="small"
style="margin-left:20px;"
>
<el-option <el-option
v-for="(item,index) in typeList" v-for="(item,index) in typeList"
:key="index" :key="index"
...@@ -57,10 +64,11 @@ ...@@ -57,10 +64,11 @@
hasSelected: '', hasSelected: '',
closeStatus: false, closeStatus: false,
}, },
saasDisease: '', // 高血压标识
showSecond: false,//是否显示分类 showSecond: false,//是否显示分类
showCartoonDialog: true, showCartoonDialog: true,
cartoonList: [], cartoonList: [],
patientTypeModels: [],
diseaseId: '',//所选疾病id diseaseId: '',//所选疾病id
typeId: '',//所选分类id typeId: '',//所选分类id
typeList : [ // 分类列表 typeList : [ // 分类列表
...@@ -88,9 +96,17 @@ ...@@ -88,9 +96,17 @@
}).then(res=>{ }).then(res=>{
this.diseaseOptions = this.diseaseOptions.concat(res.data.P004) this.diseaseOptions = this.diseaseOptions.concat(res.data.P004)
this.typeList = this.typeList.concat(res.data.P036) this.typeList = this.typeList.concat(res.data.P036)
this.patientTypeModels = [...res.data.P004,...res.data.P036]
}) })
getAllEducationComtent({}).then(res=>{ getAllEducationComtent({}).then(res=>{
this.cartoonList = [...res.data.picapEducationComtentsForHypertension,...res.data.picapEducationComtentsForNotHypertension] this.picapEducationComtentsForHypertension = res.data.picapEducationComtentsForHypertension;
this.picapEducationComtentsForNotHypertension = res.data.picapEducationComtentsForNotHypertension;
this.allList = [...this.picapEducationComtentsForHypertension,...this.picapEducationComtentsForNotHypertension];
this.cartoonList = this.allList
this.articleTable = this.picapEducationComtentsForNotHypertension
}) })
} }
} }
...@@ -100,15 +116,46 @@ ...@@ -100,15 +116,46 @@
}, },
methods: { methods: {
changeDisease(val){ changeDisease(val){
console.log(val) this.saasDisease = val
if(!val){ if(!val){
console.log('选择了全部') this.cartoonList = this.allList
this.showSecond = false this.showSecond = false
}else if(val===1){ }else if(val===1){
this.showSecond = true this.showSecond = true
this.articleTable = this.picapEducationComtentsForHypertension
this.reduceArticleArray(this.articleTable,val)
this.cartoonList = this.articleTable
}else{ }else{
this.showSecond = false this.showSecond = false
this.articleTable = this.picapEducationComtentsForNotHypertension
this.cartoonList = this.reduceArticleArray(this.articleTable,val)
}
},
changeType(id){
if(!id && this.saasDisease === 1){ // 选中全部时。
this.cartoonList = this.picapEducationComtentsForHypertension
}else{
this.cartoonList = this.reduceArticleArray(this.articleTable,id);
}
},
reduceArticleArray(articleTable,id){
let array = [];
let count = 0;
for(let k = 0; k < this.patientTypeModels.length; k++){
if(this.patientTypeModels[k].no > count){
count = this.patientTypeModels[k].no;
}
}
for(let j = 0; j <= count; j++){
array[j] = [];
}
for(let i = 0; i < articleTable.length; i++){
let coun = this.showSecond ? articleTable[i].education_classify : articleTable[i].type;
if(coun && coun <= count){
array[coun].push(articleTable[i]);
}
} }
return array[id]
}, },
clickClose() { clickClose() {
this.$emit('closeSelectCartoon', this.sendObj) this.$emit('closeSelectCartoon', this.sendObj)
......
...@@ -124,7 +124,6 @@ ...@@ -124,7 +124,6 @@
data() { data() {
return { return {
checkForm: false, checkForm: false,
// saveStatus: false,
/*面包屑配置*/ /*面包屑配置*/
curmbFirst: '随访管理', curmbFirst: '随访管理',
curmbSecond: '计划管理', curmbSecond: '计划管理',
...@@ -212,7 +211,6 @@ ...@@ -212,7 +211,6 @@
message: res.message, message: res.message,
showClose: false showClose: false
}); });
// this.saveStatus = false
} }
}) })
// console.log('保存setTimeNodeList1',this.$refs.getTimeNodeList.setTimeNodeList1) // console.log('保存setTimeNodeList1',this.$refs.getTimeNodeList.setTimeNodeList1)
......
...@@ -95,7 +95,6 @@ ...@@ -95,7 +95,6 @@
checkForm: false, checkForm: false,
patientIdList: [], //获取的病人列表 patientIdList: [], //获取的病人列表
hasSelectedList: [], //已选居民 hasSelectedList: [], //已选居民
// saveStatus: false,
/*面包屑配置*/ /*面包屑配置*/
curmbFirst: '随访管理', curmbFirst: '随访管理',
curmbSecond: '计划管理', curmbSecond: '计划管理',
...@@ -240,7 +239,6 @@ ...@@ -240,7 +239,6 @@
message: res.message, message: res.message,
showClose: false showClose: false
}); });
// this.saveStatus = false
} }
}) })
}else{ }else{
......
...@@ -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;
} }
......
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,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>
...@@ -275,22 +275,25 @@ ...@@ -275,22 +275,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;
...@@ -299,7 +302,7 @@ ...@@ -299,7 +302,7 @@
return false; return false;
} }
}, },
async sendReservationRow(row){ sendReservationRow(row){
let newList = []; let newList = [];
newList.push({ newList.push({
planId: row.fuPlanId, planId: row.fuPlanId,
...@@ -309,22 +312,12 @@ ...@@ -309,22 +312,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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册