提交 93dfeb56 编写于 作者: tao.wu's avatar tao.wu

Merge branch 'dev-patients-20190513' of...

Merge branch 'dev-patients-20190513' of 192.168.110.53:com.pica.cloud.education.frontend/pica.cloud.web-education-admin into dev-patients-20190513
......@@ -105,10 +105,10 @@ const patientsRouters = {
path: 'not-complete',
component: notCompleteManage,
name: 'notCompleteManage',
redirect: 'not-complete/not-complete',
redirect: 'not-complete/uncompleted-list',
children: [
{
path: 'not-complete',
path: 'uncompleted-list',
component: notCompleteList,
name: 'notCompleteList',
meta: {
......
......@@ -19,6 +19,15 @@ export const getConstants = (params) => {
/*居民管理*/
export const getPatientList = (data) => {
return fetch({
headers,
url: getBaseUrl(`healths/patients/infolist`),
method: 'post',
data: data,
description: '获取居民列表',
})
};
export const getDiseasesList = (params) => {
return fetch({
headers,
......@@ -71,21 +80,30 @@ export const getNotCompleteList = (params) => {
description: '获取资料不全居民列表',
})
};
export const sendCompleteMessage = (params) => {
export const sendCompleteMessage = (data) => {
return fetch({
headers,
url: getBaseUrl(`healths/patients/remind`),
method: 'post',
data: params,
data: data,
description: '提醒居民完善信息',
})
};
export const getNotCompleteCount = (params) => {
export const sendCompleteMessageList = (data) => {
return fetch({
headers,
url: getBaseUrl(`healths/patients/list/remind`),
method: 'post',
data: data,
description: '批量提醒居民完善信息',
})
};
export const getNotCompleteCount = (data) => {
return fetch({
headers,
url: getBaseUrl(`healths/patients/uncomplate/counts`),
method: 'get',
data: params,
data: data,
description: '获取未完善居民人数',
})
};
......
......@@ -11,7 +11,7 @@
<p class="redNum"
v-if="subItem.title == '资料不全居民'
&&notCompleteCount
&&$route.path!='/patients-manage/not-complete/not-complete'"
&&$route.path!='/patients-manage/not-complete/uncompleted-list'"
>
<span v-if="notCompleteCount>999">+999</span>
<span v-else>{{notCompleteCount}}</span>
......@@ -103,7 +103,7 @@ export default {
{
title: '资料不全居民',
icon: 'el-icon-setting',
index: 'patients-manage/not-complete/not-complete'
index: 'patients-manage/not-complete/uncompleted-list'
}
]
}
......
......@@ -5,24 +5,38 @@
:curmbSecond="curmbSecond">
</bread-crumb>
<section class="not-complete-content screenSet">
<h1 class="page-title">我的居民:共800</h1>
<h1 class="page-title">我的居民:共{{pagination.totalRows}}</h1>
<div class="search-div">
<div class="search-input">
<el-form :model="searchData" ref="searchData" :inline="true" :label-width="labelWidth">
<el-form :model="searchData" ref="searchData" :inline="true">
<el-form-item label="性别:" prop="patientName">
<el-input v-model="searchData.patientName" size="small" placeholder="请输入姓名" clearable></el-input>
<el-select v-model="searchData.sex" size="small" clearable :popper-append-to-body="false">
<el-option
v-for="item in sexList"
:key="item.no"
:label="item.value"
:value="item.no">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="年龄段:" prop="mobile">
<el-input v-model="searchData.mobile" size="small" placeholder="请输入手机号" clearable></el-input>
<el-select v-model="searchData.age" size="small" clearable :popper-append-to-body="false">
<el-option
v-for="item in agesList"
:key="item.value"
:label="item.value"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="诊断:" prop="startDate" size="small">
<el-select v-model="searchData.startDate" size="small" clearable :popper-append-to-body="false">
<el-option label="全部" value=""></el-option>
<el-select v-model="searchData.diseaseId" size="small" clearable :popper-append-to-body="false">
<el-option
v-for="(item, index) in followStartTimeList"
:key="item+index"
:label="item"
:value="item">
v-for="item in diseaseList"
:key="item.diseaseId"
:label="item.diseaseName"
:value="item.diseaseId">
</el-option>
</el-select>
</el-form-item>
......@@ -41,59 +55,63 @@
</el-form>
</div>
<div class="search-btn">
<el-button class="button-green" type="primary" size="small" @click="searchResidentList">查询</el-button>
<el-button class="button-green" type="primary" size="small" @click="searchPatientList">查询</el-button>
<el-button class="button-white" plain size="small" @click="resetSearchData('searchData')">重置</el-button>
</div>
</div>
<el-table
:data="notCompleteList"
:row-key="getRowKeys"
@selection-change="handleSelectionChange"
:data="patientList"
style="width: 100%;">
<el-table-column
type="selection"
width="100">
</el-table-column>
<el-table-column
prop="headimgurl"
prop="nickname"
width="150"
label="姓名"
width="100"
lign="center">
<template slot-scope="scope">
<img class="user-photo" :src="scope.row.headimgurl"/>
</template>
</el-table-column>
<el-table-column
prop="wechatUsername"
width="200"
prop="sex"
width="80"
label="性别"
align="center">
<template slot-scope="scope">
<span v-if="scope.row.sex==1"></span>
<span v-if="scope.row.sex==2"></span>
</template>
</el-table-column>
<el-table-column
prop="country"
prop="age"
label="年龄"
width="80"
align="center">
</el-table-column>
<el-table-column
prop="wechatCreatedTime"
prop="showLabelName"
:show-overflow-tooltip="true"
label="分组"
align="center">
</el-table-column>
<el-table-column
prop="wechatCreatedTime"
prop="showDiseaseNames"
:show-overflow-tooltip="true"
label="诊断"
align="center">
</el-table-column>
<el-table-column
width="120"
label="操作"
align="center">
<template slot-scope="scope">
<!-- <el-button v-if="scope.row.isRemind==1" type="text" @click="sendMessageSingle(scope.row)">提醒完善信息</el-button>
<el-button v-else-if="scope.row.isRemind==2" type="text" style="color: #999">提醒已发送</el-button>-->
<el-button type="text" @click="goToDetails(scope.row)">查看详情</el-button>
</template>
</el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../../assets/image/no-content1.png">
<p>没有查询到相关结果</p>
</div>
</div>
</el-table>
<div class="pagination" v-if="notCompleteList.length">
<div class="pagination" v-if="patientList">
<el-pagination
background
@size-change="handleSizeChange"
......@@ -111,7 +129,10 @@
<script>
import BreadCrumb from '../../../components/breadcrumb.vue'
import { getConstants } from '../../../utils/patients/patientsapi'
import { getConstants,
getDiseasesList,
getLabelList,
getPatientList} from '../../../utils/patients/patientsapi'
export default {
name: "not-complete",
components: {
......@@ -120,41 +141,162 @@
data() {
return {
curmbFirst: '居民管理',
curmbSecond: '资料不全居民',
notCompleteList: [], //未完善列表
curmbSecond: '我的居民',
pagination: {
pageNo: 1,
pageSize: 15,
totalRows: 0,
},
searchData: {},
getRowKeys(row) {
return row.patientId;
},
selectList: []
selectList: [],
sexList: [], //性别
agesList: [], //年龄
diseaseList: [],
groupList: [],
patientList: []
}
},
created() {
//const vm = this;
},
mounted() {
this.getConstantData(); //获取性别、年龄段常量
this.getDiseaseData(); //获取疾病种类
this.getGroupList(); //获取分组
this.getPatients({
...this.searchData
}); //获取居民列表
},
methods: {
getConstantData() {
getConstants({
numList: 'P006,P057',
})
}).then((data) => {
if(data.code == "000000") {
this.sexList = data.data.P006;
this.agesList = data.data.P057;
}
}).catch((error) => {
this.$message({
message: error,
type: 'error'
});
});
},
methods: {
handleSelectionChange(val) {
this.selectList = val;
getDiseaseData() {
getDiseasesList().then((data) => {
if(data.code == "000000") {
this.diseaseList = data.data;
}
}).catch((error) => {
this.$message({
message: error,
type: 'error'
});
});
},
getGroupList() {
getLabelList({
type: 1,
token : localStorage.getItem("token")
}).then((data) => {
if(data.code == "000000") {
this.groupList = data.data.labelNameList;
}
}).catch((error) => {
this.$message({
message: error,
type: 'error'
});
});
},
getPatients(payload) {
const { pageNo, pageSize} = this.pagination;
let searchParams = {}
if(this.searchData.age) {
let ageBegin = '';
let ageEnd = '';
if(this.searchData.age == '84+') {
ageBegin = '84';
ageEnd = '200';
} else {
const ageItem = this.searchData.age.split('-');
ageBegin = ageItem[0];
ageEnd = ageItem[1];
}
searchParams = {
...payload,
ageBegin,
ageEnd
}
} else {
searchParams = payload
}
getPatientList({
pageNo,
pageSize,
...searchParams
}).then((data) => {
if(data.code == "000000") {
this.patientList = data.data.patientList;
this.pagination.totalRows = data.data.totalRows
this.patientList.forEach((item)=> {
item.disableNum = 1;
let diseaseNames = [];
let groupNames = []
//转化分组
if (item.labelModels) {
item.labelModels.forEach(item => {
groupNames.push(item.label)
});
item.showLabelName = groupNames.join('、');
} else {
item.showLabelName = '-';
}
//转化疾病
if (item.patientTypeModels) {
item.patientTypeModels.forEach(item => {
diseaseNames.push(item.name)
})
item.showDiseaseNames = diseaseNames.join('、');
} else {
item.showDiseaseNames = '-';
}
})
}
}).catch((error) => {
this.$message({
message: error,
type: 'error'
});
})
},
handleSizeChange(val) {
this.pagination.pageSize = val
this.getNotComplete()
this.getPatients({
...this.searchData
})
},
handleCurrentChange(val) {
this.pagination.pageNo = val
this.getNotComplete()
this.getPatients({
...this.searchData
})
},
searchPatientList() {
this.getPatients({
...this.searchData
})
},
resetSearchData() {
this.searchData = {}
this.getPatients({
...this.searchData
})
},
goToDetails(item) {
this.$router.push({path: '/patients-manage/mypatients-manage/patient-detail', query: {patientId:item.patientId}})
}
},
}
</script>
......@@ -209,6 +351,14 @@
border-radius: 50%;
width: 40px;
}
.table-empty {
img {
width: 100px;
}
p {
margin-top: -50px;
}
}
}
/*重置表格选择框*/
.el-checkbox__input.is-checked .el-checkbox__inner, .el-checkbox__input.is-indeterminate .el-checkbox__inner {
......
......@@ -78,7 +78,10 @@
<script>
import BreadCrumb from '../../../components/breadcrumb.vue'
import { getNotCompleteList, sendCompleteMessage, getNotCompleteCount } from '../../../utils/patients/patientsapi'
import { getNotCompleteList,
sendCompleteMessage,
getNotCompleteCount,
sendCompleteMessageList} from '../../../utils/patients/patientsapi'
export default {
name: "not-complete",
components: {
......@@ -99,9 +102,6 @@
selectList: []
}
},
created() {
//const vm = this;
},
mounted() {
this.getNotComplete()
this.getNotCompleteNum()
......@@ -125,15 +125,14 @@
pageSize,
}).then((data) => {
if(data.code == "000000") {
this.notCompleteList = data.data
console.log('1212',this.notCompleteList)
this.notCompleteList = data.data;
}
}).catch(function (error) {
}).catch((error) => {
this.$message({
message: error,
type: 'error'
});
});
})
},
sendMessageSingle(item) { //发送单个提醒
sendCompleteMessage({
......@@ -151,33 +150,59 @@
type: 'error'
});
}
}).catch(function (error) {
}).catch((error) => {
this.$message({
message: error,
type: 'error'
});
});
})
},
sendCompleteMessageMultiple(item) {
sendCompleteMessageMultiple() {
if(!this.selectList.length) {
this.$message({
message: '请选择居民',
type: 'warning'
});
return;
}
let patientIdList = []
this.selectList.forEach(item => {
patientIdList.push(item.patientId)
})
sendCompleteMessageList({
qrcodeType: 1,
patientIds: patientIdList,
}).then((data) => {
if(data.code == "000000") {
this.$message({
message: '已向居民发送提醒',
type: 'success'
});
}else {
this.$message({
message: data.message,
type: 'error'
});
}
}).catch((error) => {
this.$message({
message: error,
type: 'error'
});
})
},
getNotCompleteNum() {
getNotCompleteCount().then((data) => {
if(data.code == "000000") {
this.pagination.totalRows = data.data;
}
}).catch(function (error) {
}).catch((error) => {
this.$message({
message: error,
type: 'error'
});
});
})
}
}
}
......@@ -245,6 +270,7 @@
.el-pagination.is-background .el-pager li:not(.disabled).active {
background: #449284 !important;
}
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册