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