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

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

Merge branch 'dev-followUp-20190312' of 192.168.110.53:com.pica.cloud.education.frontend/pica.cloud.web-education-admin into dev-followUp-20190312
......@@ -10,14 +10,17 @@ const service = axios.create({
withCredentials: false
})
let loadingInstance = Loading.service({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
let loadingInstance = () => {
return Loading.service({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
}
// request拦截器
service.interceptors.request.use(config => {
loadingInstance()
if( config.headers['sysCode']==undefined) {
config.headers['sysCode'] = 12
}
......@@ -35,14 +38,14 @@ service.interceptors.request.use(config => {
return config
}, error => {
// logger.debug('service.interceptors.request: ', error)
loadingInstance.close();
loadingInstance().close();
Promise.reject(error)
})
// respone拦截器
service.interceptors.response.use(
response => {
loadingInstance.close();
loadingInstance().close();
const res = response.data
/*
baseUrl时,返回000000为成功
......@@ -56,7 +59,7 @@ service.interceptors.response.use(
},
error => {
// logger.error('err' + error)
loadingInstance.close();
loadingInstance().close();
return Promise.reject(error)
}
)
......
......@@ -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{
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册