提交 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 @@
:value="item.no">
</el-option>
</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
v-for="(item,index) in typeList"
:key="index"
......@@ -57,10 +64,11 @@
hasSelected: '',
closeStatus: false,
},
saasDisease: '', // 高血压标识
showSecond: false,//是否显示分类
showCartoonDialog: true,
cartoonList: [],
patientTypeModels: [],
diseaseId: '',//所选疾病id
typeId: '',//所选分类id
typeList : [ // 分类列表
......@@ -88,9 +96,17 @@
}).then(res=>{
this.diseaseOptions = this.diseaseOptions.concat(res.data.P004)
this.typeList = this.typeList.concat(res.data.P036)
this.patientTypeModels = [...res.data.P004,...res.data.P036]
})
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 @@
},
methods: {
changeDisease(val){
console.log(val)
this.saasDisease = val
if(!val){
console.log('选择了全部')
this.cartoonList = this.allList
this.showSecond = false
}else if(val===1){
this.showSecond = true
this.articleTable = this.picapEducationComtentsForHypertension
this.reduceArticleArray(this.articleTable,val)
this.cartoonList = this.articleTable
}else{
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() {
this.$emit('closeSelectCartoon', this.sendObj)
......
......@@ -124,7 +124,6 @@
data() {
return {
checkForm: false,
// saveStatus: false,
/*面包屑配置*/
curmbFirst: '随访管理',
curmbSecond: '计划管理',
......@@ -212,7 +211,6 @@
message: res.message,
showClose: false
});
// this.saveStatus = false
}
})
// console.log('保存setTimeNodeList1',this.$refs.getTimeNodeList.setTimeNodeList1)
......
......@@ -95,7 +95,6 @@
checkForm: false,
patientIdList: [], //获取的病人列表
hasSelectedList: [], //已选居民
// saveStatus: false,
/*面包屑配置*/
curmbFirst: '随访管理',
curmbSecond: '计划管理',
......@@ -240,7 +239,6 @@
message: res.message,
showClose: false
});
// this.saveStatus = false
}
})
}else{
......
......@@ -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;
}
......
......@@ -127,7 +127,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>
......@@ -275,22 +275,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;
......@@ -299,7 +302,7 @@
return false;
}
},
async sendReservationRow(row){
sendReservationRow(row){
let newList = [];
newList.push({
planId: row.fuPlanId,
......@@ -309,22 +312,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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册