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

小红点

上级 beb3034a
<template> <template>
<div> <div>
<v-header :userName="userName" :portrait="portrait" :idType="idType"></v-header> <v-header :userName="userName" :portrait="portrait" :idType="idType"></v-header>
<v-slidebar :authList="authList" :tokenValue="token" :notCompleteCount="10"></v-slidebar> <v-slidebar :authList="authList" :tokenValue="token" :notCompleteCount="redNum"></v-slidebar>
<el-container> <el-container>
<div class="content" id="body-content"> <div class="content" id="body-content">
<transition name="router-fade" mode="out-in"> <transition name="router-fade" mode="out-in">
...@@ -25,6 +25,7 @@ import VFooter from './views/layout/footer.vue' ...@@ -25,6 +25,7 @@ import VFooter from './views/layout/footer.vue'
import { base64decode, isNotEmptyUtils, getUrlParamsMap } from "./utils/utils.js" import { base64decode, isNotEmptyUtils, getUrlParamsMap } from "./utils/utils.js"
import { mapActions, mapGetters } from 'vuex' import { mapActions, mapGetters } from 'vuex'
import { getLoginUrl } from './utils/index.js' import { getLoginUrl } from './utils/index.js'
import { getRedNum } from './utils/patients/patientsapi'
let vm = null let vm = null
export default { export default {
components:{ components:{
...@@ -38,7 +39,8 @@ export default { ...@@ -38,7 +39,8 @@ export default {
token: '', token: '',
userName: '', userName: '',
portrait: '', portrait: '',
authList: {} authList: {},
redNum: 0,
} }
}, },
computed:{ computed:{
...@@ -51,7 +53,7 @@ export default { ...@@ -51,7 +53,7 @@ export default {
vm.getToken() vm.getToken()
}, },
mounted() { mounted() {
vm.getRedData()
}, },
methods: { methods: {
// 解密token // 解密token
...@@ -107,8 +109,29 @@ export default { ...@@ -107,8 +109,29 @@ export default {
vm.$message.info(res.message) vm.$message.info(res.message)
} }
}) })
} },
} getRedData() {
getRedNum({
openTime: (new Date()).getTime()
}).then((data) => {
if(data.code == '000000') {
vm.redNum = data.data
}
}).catch(error => {
vm.$message.error(error)
})
}
},
watch: {
$route:{
deep:true,
handler:function(newVal){
if(vm.$route.path == '/patients-manage/not-complete/uncompleted-list'){ //避免重复请求
vm.redNum = 0
}
}
}
}
} }
</script> </script>
......
...@@ -98,16 +98,24 @@ export const sendCompleteMessageList = (data) => { ...@@ -98,16 +98,24 @@ export const sendCompleteMessageList = (data) => {
description: '批量提醒居民完善信息', description: '批量提醒居民完善信息',
}) })
}; };
export const getNotCompleteCount = (data) => { export const getNotCompleteCount = (params) => {
return fetch({ return fetch({
headers, headers,
url: getBaseUrl(`healths/patients/uncomplate/counts`), url: getBaseUrl(`healths/patients/uncomplate/counts`),
method: 'get', method: 'get',
data: data, params: params,
description: '获取未完善居民人数', description: '获取未完善居民人数',
}) })
}; };
export const getRedNum = (params) => {
return fetch({
headers,
url: getBaseUrl(`healths/patients/uncompleted/last/counts`),
method: 'get',
params: params,
description: '获取小红点数据',
})
};
export const getPatientDetail = (patientId) => { export const getPatientDetail = (patientId) => {
return fetch({ return fetch({
headers, headers,
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册