提交 425f450c 编写于 作者: chengxiang.li's avatar chengxiang.li

fix merge

...@@ -16,8 +16,43 @@ export const getConstants = (params) => { ...@@ -16,8 +16,43 @@ export const getConstants = (params) => {
description: '获取常量', description: '获取常量',
}) })
}; };
/*获取省市县乡列表*/
export const getProvinceList = (params) => {
return fetch({
headers,
url: getBaseUrl(`basic-data/position/provinces`),
method: 'get',
params: params,
description: '获取省列表',
})
};
export const getCityList = (params) => {
return fetch({
headers,
url: getBaseUrl(`basic-data/position/cities`),
method: 'get',
params: params,
description: '获取市列表',
})
};
export const getCountyList = (params) => {
return fetch({
headers,
url: getBaseUrl(`basic-data/position/counties`),
method: 'get',
params: params,
description: '获取区县列表',
})
};
export const getTownList = (params) => {
return fetch({
headers,
url: getBaseUrl(`basic-data/position/towns`),
method: 'get',
params: params,
description: '获取乡镇列表',
})
};
/*居民管理*/ /*居民管理*/
export const getPatientList = (data) => { export const getPatientList = (data) => {
return fetch({ return fetch({
...@@ -116,6 +151,18 @@ export const deleteCurrentPatients = data => { ...@@ -116,6 +151,18 @@ export const deleteCurrentPatients = data => {
}) })
} }
<<<<<<< HEAD
=======
export const saveLabelsForPatient = (labelId, data) => {
return fetch({
headers,
url: getBaseUrl(`healths/labels/${labelId}/patients`),
method: 'post',
data: data,
description: '分组中添加居民',
})
}
>>>>>>> 4f5afc8ed770a74179b192c64944c2c0c7273804
// 获取七牛上传token // 获取七牛上传token
export const getQiniuToken = (params) => { export const getQiniuToken = (params) => {
...@@ -239,3 +286,13 @@ export const getHealthRecordList = (data) => { ...@@ -239,3 +286,13 @@ export const getHealthRecordList = (data) => {
description: '健康档案记录列表', description: '健康档案记录列表',
}) })
}; };
/*新的获取居民接口,搜索条件有变化*/
export const getPatientInfoList = (data) => {
return fetch({
headers,
url: getBaseUrl(`healths/patients/v2/infolist`),
method: 'post',
data: data,
description: '获取居民列表',
})
};
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
:before-close="clickClose" :before-close="clickClose"
:close-on-click-modal="false" :close-on-click-modal="false"
:close-on-press-escape="false" :close-on-press-escape="false"
width="950px" width="1100px"
top="2%" top="2%"
center> center>
<div class="finish-content"> <div class="finish-content">
...@@ -17,80 +17,93 @@ ...@@ -17,80 +17,93 @@
:inline="true" :inline="true"
class="select-width" class="select-width"
size="small"> size="small">
<el-form-item> <div style="display: flex;justify-content: flex-end;margin-bottom: 10px">
<el-select <el-button plain size="small" @click="goAddPatient">+ 新增居民</el-button>
v-model="searchData.sex" </div>
@change="changeSex" <div style="display: flex;justify-content: space-between;">
placeholder="请选择性别"> <div>
<el-option <el-form-item style="width: 100px;" prop="sex">
v-for="(item,index) in sexOptions" <el-select
:key="index" v-model="searchData.sex"
:label="item.value" placeholder="请选择性别"
:value="item.no"> clearable>
</el-option> <el-option
</el-select> v-for="(item,index) in sexOptions"
</el-form-item> :key="index"
<el-form-item> :label="item.value"
<el-select :value="item.no">
v-model="searchData.ageRange" </el-option>
@change="changeAge" </el-select>
multiple </el-form-item>
collapse-tags <el-form-item style="width: 140px;" prop="ageRange">
placeholder="请选择年龄段"> <el-select
<el-option v-model="searchData.ageRange"
v-for="(item,index) in ageOptions" multiple
:key="index" collapse-tags
:label="item.value" placeholder="请选择年龄段"
:value="item.value"> clearable>
</el-option> <el-option
</el-select> v-for="(item,index) in ageOptions"
</el-form-item> :key="index"
<el-form-item> :label="item.value"
<el-select :value="item.value">
v-model="searchData.diseaseId" </el-option>
@change="changeDisease" </el-select>
multiple </el-form-item>
collapse-tags <el-form-item prop="diseaseId">
placeholder="请选择诊断"> <el-select
<el-option v-model="searchData.diseaseId"
v-for="(item,index) in diseaseOptions" multiple
:key="index" collapse-tags
:label="item.diseaseName" style="width: 200px;"
:value="item.diseaseId"> placeholder="请选择诊断"
</el-option> clearable>
</el-select> <el-option
</el-form-item> v-for="(item,index) in diseaseOptions"
<el-form-item> :key="index"
<el-select :label="item.diseaseName"
v-model="searchData.labelId" :value="item.diseaseId">
@change="changeLabel" </el-option>
multiple </el-select>
collapse-tags </el-form-item>
filterable <el-form-item prop="labelId">
placeholder="请选择或搜索分组"> <el-select
<el-option v-model="searchData.labelId"
v-for="(item,index) in labelOptions" multiple
:key="index" collapse-tags
:label="item.labelName" filterable
:value="item.labelId"> style="width: 200px;"
</el-option> placeholder="请选择或搜索分组"
</el-select> clearable>
</el-form-item> <el-option
<el-form-item style="width:160px;"> v-for="(item,index) in labelOptions"
<el-input v-model="searchData.searchCondition" placeholder="请输入姓名或手机号" > :key="index"
<i slot="prefix" class="el-input__icon el-icon-search" @click="searchHandler" style="cursor: pointer"></i> :label="item.labelName"
</el-input> :value="item.labelId">
</el-form-item> </el-option>
<el-form-item> </el-select>
<el-button>查询</el-button> </el-form-item>
<el-button>重置</el-button> <el-form-item prop="searchCondition">
</el-form-item> <el-input
v-model="searchData.searchCondition"
placeholder="请输入姓名,手机号,身份证"
clearable
style="width:200px;">
<!--<i slot="prefix" class="el-input__icon el-icon-search" @click="searchHandler" style="cursor: pointer"></i>-->
</el-input>
</el-form-item>
</div>
<div>
<el-button type="primary" @click="searchHandler" size="small">查询</el-button>
<el-button plain @click="resetData('searchData')" size="small">重置</el-button>
</div>
</div>
</el-form> </el-form>
<el-table <el-table
:data="patientsData" :data="patientsData"
ref="multipleTable" ref="multipleTable"
center center
style="width: 100%;margin-top: 20px;" style="width: 100%;margin-top: 10px;"
height="280" height="280"
:row-key="getRowKeys" :row-key="getRowKeys"
@selection-change="handleSelectionChange"> @selection-change="handleSelectionChange">
...@@ -108,35 +121,43 @@ ...@@ -108,35 +121,43 @@
<el-table-column <el-table-column
prop="sexStr" prop="sexStr"
label="性别" label="性别"
min-width="50"
align="center"> align="center">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="age" prop="age"
label="年龄" label="年龄"
min-width="50"
align="center"> align="center">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="mobilePhone" prop="mobilePhone"
label="手机" label="手机"
align="center" align="center"
min-width="150px"> min-width="130">
</el-table-column>
<el-table-column
prop="idNo"
label="身份证"
align="center"
min-width="130">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="showDiseaseNames" prop="showDiseaseNames"
label="基础疾病" label="基础疾病"
align="center" align="center"
width="200" width="180"
:show-overflow-tooltip="true"> :show-overflow-tooltip="true">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="showLabelName" prop="showLabelName"
label="分组" label="分组"
align="center" align="center"
width="200" width="180"
:show-overflow-tooltip="true"> :show-overflow-tooltip="true">
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-row type="flex" justify="end" class="margin-top20"> <el-row type="flex" justify="end" class="margin-top15">
<el-pagination <el-pagination
background background
v-if="patientsData.length" v-if="patientsData.length"
...@@ -160,7 +181,7 @@ ...@@ -160,7 +181,7 @@
<script> <script>
import { mapState, mapActions } from 'vuex' import { mapState, mapActions } from 'vuex'
import { getBasicData, getPlanPatientsList, getAllDiseases, getAllLabels } from '@/utils/followup/followapis' import { getConstants, getPatientInfoList, getDiseasesList, getLabelList } from '@/utils/patients/patientsapi'
export default { export default {
components: {}, components: {},
name: "select-patient", name: "select-patient",
...@@ -170,23 +191,12 @@ ...@@ -170,23 +191,12 @@
allSelects: [], allSelects: [],
// eachSelects: [],//仅仅是操作选择的总人员 // eachSelects: [],//仅仅是操作选择的总人员
// totalSelect: [],// 当前所选的人 // totalSelect: [],// 当前所选的人
labelId: '',
diseaseId: '',
age: '',
sex: '',
ageBegin: '',
ageEnd: '',
srvPackageId: '', srvPackageId: '',
searchCondition: '',
patientsData: [], patientsData: [],
searchData: { searchData: {
sex: null, sex: null,
ageRange: [], ageRange: [],
ageBegin: '',
ageEnd: '',
// diseaseId: '基础疾病',
diseaseId: [], diseaseId: [],
// labelId: '分组',
labelId: [], labelId: [],
searchCondition: '' searchCondition: ''
}, },
...@@ -200,26 +210,16 @@ ...@@ -200,26 +210,16 @@
value: '不限' value: '不限'
}], }],
ageOptions: [ ageOptions: [
// { // {no: '', value: '年龄范围'}
// no: '',
// value: '年龄范围'
// }
], ],
diseaseOptions: [ diseaseOptions: [
// { // {diseaseId: '', diseaseName: '基础疾病'}
// diseaseId: '',
// diseaseName: '基础疾病'
// }
], ],
labelOptions: [ labelOptions: [
// { // {labelId: '', labelName: '分组'}
// labelId: '',
// labelName: '分组'
// }
], ],
newSelects: [], //新选中的人 newSelects: [], //新选中的人
getRowKeys(row) { getRowKeys(row) {
// console.log('sshkdhdk',row)
return row.patientId; return row.patientId;
}, },
} }
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
if(val){ if(val){
this.getPatientsList() this.getPatientsList()
// 获取常量 性别、年龄 // 获取常量 性别、年龄
getBasicData({ getConstants({
numList: 'P057,P006' numList: 'P057,P006'
}).then(res=>{ }).then(res=>{
this.sexOptions = [{ this.sexOptions = [{
...@@ -243,32 +243,23 @@ ...@@ -243,32 +243,23 @@
}]; }];
this.sexOptions = this.sexOptions.concat(res.data.P006);//性别 this.sexOptions = this.sexOptions.concat(res.data.P006);//性别
this.ageOptions = [ this.ageOptions = [
// { // {no: '', value: '年龄范围'}
// no: '', ];
// value: '年龄范围'
// }
]
this.ageOptions = this.ageOptions.concat(res.data.P057);//年龄段 this.ageOptions = this.ageOptions.concat(res.data.P057);//年龄段
}) })
// 获取所有疾病 // 获取所有疾病
getAllDiseases().then(res=>{ getDiseasesList().then(res=>{
this.diseaseOptions = [ this.diseaseOptions = [
// { // {diseaseId: '', diseaseName: '基础疾病'}
// diseaseId: '', ];
// diseaseName: '基础疾病'
// }
]
this.diseaseOptions = this.diseaseOptions.concat(res.data); this.diseaseOptions = this.diseaseOptions.concat(res.data);
}) })
// 获取所有分组 // 获取所有分组
getAllLabels({type: 1}).then(res=>{ getLabelList({type: 1}).then(res=>{
this.labelOptions = [ this.labelOptions = [
// { // {labelId: '', labelName: '分组'}
// labelId: '',
// labelName: '分组'
// }
] ]
this.labelOptions = this.labelOptions.concat(res.data.labelNameList); this.labelOptions = this.labelOptions.concat(res.data.labelNameList);
}) })
...@@ -287,32 +278,33 @@ ...@@ -287,32 +278,33 @@
const data = { const data = {
pageSize: this.paginationSet.pageSize, pageSize: this.paginationSet.pageSize,
pageNo: this.paginationSet.pageNum, pageNo: this.paginationSet.pageNum,
labelId:this.labelId, labelIdList:this.searchData.labelId,
diseaseId: this.diseaseId, diseaseIdList: this.searchData.diseaseId,
age: this.age, ageList: this.searchData.ageRange,
sex: this.sex, sex: this.searchData.sex,
ageBegin: this.ageBegin, searchCondition:this.searchData.searchCondition,
ageEnd: this.ageEnd,
srvPackageId:this.srvPackageId, srvPackageId:this.srvPackageId,
searchCondition:this.searchCondition, addType: 1,
fuPlanIdList: [],
} }
getPlanPatientsList(data).then(res=>{ getPatientInfoList(data).then(res=>{
if(res.data.patientList){ if(res.data.patientList){
this.patientsData = res.data.patientList //接口获取的当页居民 this.patientsData = res.data.patientList //接口获取的当页居民
this.getSex() this.getSex()
this.paginationSet.total = res.data.totalRows this.paginationSet.total = res.data.totalRows
// 设置所请求的当页人员是否成为选中状态 // 设置所请求的当页人员是否成为选中状态
// console.log('传入的已选居民',this.patientIdList) // console.log('传入的已选居民',this.patientIdList)
this.patientsData.forEach((item)=>{ this.patientsData.forEach((item)=>{
item.disableNum = 1; item.disableNum = 1;
let diseaseNames = []; let diseaseNames = [];
let groupNames = [] let groupNames = []
if(!item.idNo) {
item.idNo = '-';
}
//转化分组 //转化分组
if(item.labelModels) { if(item.labelModels) {
item.labelModels.forEach(item => { item.labelModels.forEach(item => {
groupNames.push(item.label) groupNames.push(item.label)
}); });
item.showLabelName = groupNames.join('、'); item.showLabelName = groupNames.join('、');
} else { } else {
...@@ -396,40 +388,21 @@ ...@@ -396,40 +388,21 @@
}, },
handleSizeChangePre(val) { handleSizeChangePre(val) {
// console.log('handleSizeChangePre') this.paginationSet.pageSize = val;
this.paginationSet.pageSize = val this.getPatientsList();
this.getPatientsList()
}, },
changeSex(val){ searchHandler() {
this.sex = val;
this.paginationSet.pageNum = 1;
this.getPatientsList()
},
changeAge(val){
if(val=='年龄范围'){
val = null
}
this.age = val;
this.ageBegin = this.ageDate(val).ageBegin;
this.ageEnd = this.ageDate(val).ageEnd;
this.paginationSet.pageNum = 1;
this.getPatientsList()
},
changeDisease(val){
this.diseaseId = val;
this.paginationSet.pageNum = 1; this.paginationSet.pageNum = 1;
this.getPatientsList() this.getPatientsList();
}, },
changeLabel(val){ resetData(formName) {
this.labelId = val; this.$refs[formName].resetFields();
this.paginationSet.pageNum = 1; this.getPatientsList();
this.getPatientsList()
}, },
searchHandler() { goAddPatient() {
const searchCondition = this.searchData.searchCondition; this.$router.push({
this.searchCondition = searchCondition; path: '/patients-manage/new-manage/new-patient'
this.paginationSet.pageNum = 1; })
this.getPatientsList()
}, },
ageDate(val){ ageDate(val){
let ageObj; let ageObj;
...@@ -457,11 +430,15 @@ ...@@ -457,11 +430,15 @@
</script> </script>
<style lang="scss"> <style lang="scss">
@import '../../../../style/patients-style/element-reset.css';
.select-patient-dialog { .select-patient-dialog {
.el-dialog__wrapper { .el-dialog__wrapper {
overflow: hidden; overflow: hidden;
.el-dialog--center { .el-dialog--center {
height: 580px; height: 580px;
.el-dialog__body{
padding: 10px 25px 15px;
}
.el-table--scrollable-y,.el-table__body-wrapper { .el-table--scrollable-y,.el-table__body-wrapper {
&::-webkit-scrollbar{ &::-webkit-scrollbar{
width:5px; width:5px;
...@@ -489,13 +466,15 @@ ...@@ -489,13 +466,15 @@
} }
.select-width .el-form-item{ .select-width .el-form-item{
width: 130px; /*width: 130px;*/
}
.margin-top15{
margin-top: 15px;
} }
.margin-top20{ .el-form-item--mini.el-form-item, .el-form-item--small.el-form-item{
margin-top: 20px; margin-bottom: 8px;
} }
} }
</style> </style>
...@@ -152,6 +152,7 @@ ...@@ -152,6 +152,7 @@
deleteCurrentLabel, deleteCurrentLabel,
changeLabelName, changeLabelName,
deleteCurrentPatients, deleteCurrentPatients,
saveLabelsForPatient,
} from '@/utils/patients/patientsapi' } from '@/utils/patients/patientsapi'
import SelectPatient from './dialog/select-patitents'; import SelectPatient from './dialog/select-patitents';
...@@ -216,6 +217,7 @@ ...@@ -216,6 +217,7 @@
console.log('获取分组详情>> ', data) console.log('获取分组详情>> ', data)
if(data.data){ if(data.data){
this.searchData = data.data; this.searchData = data.data;
this.patientIdList = data.data.patientIdList;
let list = data.data.patientListsByLabelModels; let list = data.data.patientListsByLabelModels;
if(list && list.length > 0){ if(list && list.length > 0){
this.searchData.tableData = list; this.searchData.tableData = list;
...@@ -371,6 +373,7 @@ ...@@ -371,6 +373,7 @@
type: 'success' type: 'success'
}); });
this.showDeletePatientsDialog = false; this.showDeletePatientsDialog = false;
this.getDetail();
}else{ }else{
this.$message({ this.$message({
message: '请求接口失败,请重新再试', message: '请求接口失败,请重新再试',
...@@ -384,8 +387,30 @@ ...@@ -384,8 +387,30 @@
addPatientsHandler() { addPatientsHandler() {
this.isShowSelectPatient = true; this.isShowSelectPatient = true;
}, },
closeSelectPatient() {}, closeSelectPatient(val) {
sureSelectPatient(arg) { this.isShowSelectPatient = val;
},
sureSelectPatient() {
let getArguments = arguments[0];
const selectPatients = getArguments[1]; // 每次选中获取的人
let labelId = this.$route.query.labelId;
let patientLen = selectPatients.length;
saveLabelsForPatient(labelId,{
newLablelName: this.$route.query.labelName,
oldLabelName: this.$route.query.labelName,
saveLists: selectPatients,
// token:
}).then((data) => {
if(data.code == '000000') {
setTimeout(() => {
this.$message.success(`已成功添加${patientLen}位居民`)
this.isShowSelectPatient = getArguments[0];
this.getDetail();
},500)
}else {
this.$message.error(data.message)
}
})
}, },
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</bread-crumb> </bread-crumb>
<div class="f-main-content screenSet"> <div class="f-main-content screenSet">
<div class="header-title"> <div class="header-title">
<span>基本信息</span> <span>居民信息</span>
<p> <p>
<el-button plain size="small" @click="cancelEdit">取消</el-button> <el-button plain size="small" @click="cancelEdit">取消</el-button>
<el-button type="primary" size="small" @click="saveEdit">保存</el-button> <el-button type="primary" size="small" @click="saveEdit">保存</el-button>
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
<script> <script>
import BreadCrumb from '@/components/breadcrumb' import BreadCrumb from '@/components/breadcrumb'
import editInformation from './components/edit-information' import editInformation from './components/edit-information'
import { mapGetters } from 'vuex' import { getPatientDetail, savePatientInfo } from '@/utils/patients/patientsapi'
import { getPatientDetail, getRemindPatient, savePatientInfo } from '@/utils/patients/patientsapi'
export default { export default {
name: "basicInfo", name: "basicInfo",
components: { components: {
...@@ -50,11 +49,7 @@ ...@@ -50,11 +49,7 @@
this.patientId = String(this.$route.query.patientId); this.patientId = String(this.$route.query.patientId);
this.init(); this.init();
}, },
computed: { computed: {},
...mapGetters([
'_token',
])
},
methods: { methods: {
init() { init() {
getPatientDetail(this.patientId).then((data) => { getPatientDetail(this.patientId).then((data) => {
...@@ -72,10 +67,10 @@ ...@@ -72,10 +67,10 @@
addListenSave(val) { addListenSave(val) {
this.checkForm = false; this.checkForm = false;
if(val.status) { if(val.status) {
this.patientInfo = val.patientInfoForm // this.patientInfo = val.patientInfoForm
savePatientInfo(this.patientInfo).then(data => { savePatientInfo(val.patientInfoForm).then(data => {
if(data.code == '000000'){ if(data.code == '000000'){
this.$message.success('保存备注成功') this.$message.success('修改成功')
setTimeout(() => { setTimeout(() => {
this.$router.go(-1); this.$router.go(-1);
},500) },500)
...@@ -88,24 +83,6 @@ ...@@ -88,24 +83,6 @@
this.$message.error('请正确填写信息'); this.$message.error('请正确填写信息');
} }
}, },
//提醒绑定
// remindBind() {
// let remindMobileWechatPara = {
// qrcodeType: 1,
// patientId: this.patientId,
// // deviceInfo: window.getDeviceInfo()
// }
// getRemindPatient({
// ...remindMobileWechatPara
// }).then( data => {
// if(data.code == '000000') {
// this.$message.success(data.data.respMsg);
// }else {
// this.$message.error(data.message);
// }
// })
// },
}, },
filters: { filters: {
emptyFilter: function(value) { emptyFilter: function(value) {
......
...@@ -32,196 +32,203 @@ ...@@ -32,196 +32,203 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" style="text-align: center;margin-top:15px;" v-if="!patientId"> <el-button plain size="small" @click="toggleClick">{{tipsText}}</el-button></el-col>
</el-row> </el-row>
<div class="has-header">数据记录</div> <div v-show="isShowAll || patientId">
<el-row> <div class="has-header">数据记录</div>
<el-col :span="12"> <el-row>
<el-form-item label="诊断" prop="diseaseIdList"> <el-col :span="12">
<el-select <el-form-item label="诊断" prop="diseaseIdList">
v-model="diseaseIdList" <el-select
multiple v-model="diseaseIdList"
@change="changeDiseases" multiple
placeholder="请选择居民疾病诊断"> @change="changeDiseases"
<el-option placeholder="请选择居民疾病诊断">
v-for="item in diseasesList" <el-option
:key="item.diseaseId" v-for="(item, index) in diseasesList"
:label="item.diseaseName" :key="index"
:value="item.diseaseId"> :label="item.diseaseName"
</el-option> :value="item.diseaseId">
</el-select> </el-option>
</el-form-item> </el-select>
</el-col> </el-form-item>
<el-col :span="12"> </el-col>
<el-form-item label="分组" prop="labelIdList"> <el-col :span="12">
<el-select <el-form-item label="分组" prop="labelIdList">
v-model="labelIdList" <el-select
multiple v-model="labelIdList"
@change="changeLabels" multiple
placeholder="请选择居民分组"> @change="changeLabels"
<el-option placeholder="请选择居民分组">
v-for="(item, index) in labelsList" <el-option
:key="index" v-for="(item, index) in labelsList"
:label="item.labelName" :key="index"
:value="item.labelId"> :label="item.labelName"
</el-option> :value="item.labelId">
</el-select> </el-option>
</el-form-item> </el-select>
</el-col> </el-form-item>
</el-row> </el-col>
<div class="has-header">基本信息</div> </el-row>
<el-row> <div class="has-header">基本信息</div>
<el-col :span="12"> <el-row>
<el-form-item label="身份证" prop="idNo"> <el-col :span="12">
<el-input <el-form-item label="身份证" prop="idNo">
v-model="patientInfoForm.idNo" <el-input
placeholder="请输入身份证" v-model="patientInfoForm.idNo"
clearable placeholder="请输入身份证"
maxlength="18" clearable
:disabled="hasIdNo"> maxlength="18"
</el-input> @blur="idNoBlurHandler"
</el-form-item> :disabled="hasIdNo">
</el-col> </el-input>
<el-col :span="12"> </el-form-item>
<el-form-item label="出生年月" prop="birthTime"> </el-col>
<el-date-picker <el-col :span="12">
type="date" <el-form-item label="出生日期" prop="birthTime">
v-model="patientInfoForm.birthTime" <el-date-picker
placeholder="请选择出生年月" type="date"
value-format="yyyy-MM-dd" v-model="patientInfoForm.birthTime"
value="yyyy-MM-dd" placeholder="请选择出生日期"
@change="getAge" value-format="yyyy-MM-dd"
style="width:250px" value="yyyy-MM-dd"
clearable> @change="getAge"
</el-date-picker> style="width:250px"
</el-form-item> clearable>
</el-col> </el-date-picker>
</el-row> </el-form-item>
<el-row> </el-col>
<el-col :span="12"> </el-row>
<el-form-item label="年龄" prop="age"> <el-row>
<span>{{patientInfoForm.age ? `${patientInfoForm.age}岁` : '-'}}</span> <el-col :span="12">
</el-form-item> <el-form-item label="年龄" prop="age">
</el-col> <span>{{(patientInfoForm.age || patientInfoForm.age == 0) ? `${patientInfoForm.age}岁` : '-'}}</span>
<el-col :span="12"> </el-form-item>
<el-form-item label="性别" prop="sex"> </el-col>
<el-radio-group v-model="patientInfoForm.sex"> <el-col :span="12">
<el-radio :label="1"></el-radio> <el-form-item label="性别" prop="sex">
<el-radio :label="2"></el-radio> <el-radio-group v-model="patientInfoForm.sex">
</el-radio-group> <el-radio :label="1"></el-radio>
</el-form-item> <el-radio :label="2"></el-radio>
</el-col> </el-radio-group>
</el-row> </el-form-item>
<el-row> </el-col>
<el-col :span="12"> </el-row>
<el-form-item label="常驻类型" prop="permanentResidence"> <el-row>
<el-select <el-col :span="12">
v-model="patientInfoForm.permanentResidence" <el-form-item label="常驻类型" prop="permanentResidence">
placeholder="请选择居民常驻类型" <el-select
clearable> v-model="patientInfoForm.permanentResidence"
<el-option placeholder="请选择居民常驻类型"
v-for="item in residenceList" clearable>
:key="item.no" <el-option
:label="item.value" v-for="(item, index) in residenceList"
:value="item.noChar"> :key="index"
</el-option> :label="item.value"
</el-select> :value="item.noChar">
</el-form-item> </el-option>
</el-col> </el-select>
<el-col :span="12"> </el-form-item>
<el-form-item label="民族" prop="nationality"> </el-col>
<el-select <el-col :span="12">
v-model="patientInfoForm.nationality" <el-form-item label="民族" prop="nationality">
placeholder="请选择民族" <el-select
clearable> v-model="patientInfoForm.nationality"
<el-option placeholder="请选择民族"
v-for="item in nationsList" clearable>
:key="item.code" <el-option
:label="item.name" v-for="(item, index) in nationsList"
:value="item.code"> :key="index"
</el-option> :label="item.name"
</el-select> :value="item.code">
</el-form-item> </el-option>
</el-col> </el-select>
</el-row> </el-form-item>
<el-row> </el-col>
<el-col :span="12"> </el-row>
<el-form-item label="医保号" prop="socialCard"> <el-row>
<el-input <el-col :span="12">
v-model="patientInfoForm.socialCard" <el-form-item label="医保号" prop="socialCard">
placeholder="请输入居民医保卡号码" <el-input
maxlength="30" v-model="patientInfoForm.socialCard"
clearable> placeholder="请输入居民医保卡号码"
</el-input> maxlength="30"
</el-form-item> clearable>
</el-col> </el-input>
<el-col :span="12"> </el-form-item>
<el-form-item label="健康档案编号" prop="fileLocator"> </el-col>
<el-input <el-col :span="12">
v-model="patientInfoForm.fileLocator" <el-form-item label="健康档案编号" prop="fileLocator">
placeholder="请输入居民健康档案编号" <el-input
maxlength="30" v-model="patientInfoForm.fileLocator"
clearable> placeholder="请输入居民健康档案编号"
</el-input> maxlength="30"
</el-form-item> clearable>
</el-col> </el-input>
</el-row> </el-form-item>
<div class="has-header">联系方式</div> </el-col>
<el-row> </el-row>
<el-col :span="12"> <div class="has-header">联系方式</div>
<el-form-item label="所在地区" prop="patientAddress"> <el-row>
<el-input <el-col :span="12">
v-model="patientInfoForm.patientAddress" <el-form-item label="所在地区" prop="addressList">
placeholder="请输入居民医保卡号码" <el-cascader
clearable> placeholder="请选择省市县乡"
</el-input> :options="provinceList"
</el-form-item> v-model="addressList"
</el-col> @active-item-change="handleItemChange"
<el-col :span="12"> :props="optionProps">
<el-form-item label="详细地址" prop="address"> </el-cascader>
<el-input </el-form-item>
v-model="patientInfoForm.address" </el-col>
placeholder="请输入居民的详细地址" <el-col :span="12">
maxlength="50" <el-form-item label="详细地址" prop="address">
clearable> <el-input
</el-input> v-model="patientInfoForm.address"
</el-form-item> placeholder="请输入居民的详细地址"
</el-col> maxlength="50"
</el-row> clearable>
<el-row> </el-input>
<el-col :span="12"> </el-form-item>
<el-form-item label="工作单位" prop="workplace"> </el-col>
<el-input </el-row>
v-model="patientInfoForm.workplace" <el-row>
placeholder="请输入居民的工作单位" <el-col :span="12">
maxlength="30" <el-form-item label="工作单位" prop="workplace">
clearable> <el-input
</el-input> v-model="patientInfoForm.workplace"
</el-form-item> placeholder="请输入居民的工作单位"
</el-col> maxlength="30"
<el-col :span="12" v-if="patientId"> clearable>
<el-form-item label="微信" prop="address"> </el-input>
<p class="info" v-if="patientInfoForm.isWechatBind == '1'">未绑定 <el-button type="text" class="ml10" @click="remindBind" v-if="patientInfoForm.isRemind == '1'">提醒绑定</el-button><span class="ml10" v-if="patientInfoForm.isRemind == '2'">已提醒</span></p> </el-form-item>
<p class="info" v-else-if="patientInfoForm.isWechatBind == '2'">已绑定 <span class="ml10">(微信名:{{patientInfoForm.wechatNickname | emptyFilter}}</span></p> </el-col>
</el-form-item> <el-col :span="12" v-if="patientId">
</el-col> <el-form-item label="微信" prop="address">
</el-row> <p class="info" v-if="patientInfoForm.isWechatBind == '1'">未绑定 <el-button type="text" class="ml10" @click="remindBind" v-if="patientInfoForm.isRemind == '1'" style="color: #449284;">提醒绑定</el-button><span class="ml10" v-if="patientInfoForm.isRemind == '2'">已提醒</span></p>
<div class="has-header">其他</div> <!--<p class="info" v-else-if="patientInfoForm.isWechatBind == '2'">已绑定 <span class="ml10">(微信名:{{patientInfoForm.wechatNickname | emptyFilter}}</span></p>-->
<el-row> <p class="info" v-else-if="patientInfoForm.isWechatBind == '2'">{{patientInfoForm.wechatNickname | emptyFilter}}</p>
<el-col :span="16"> </el-form-item>
<el-form-item label="备注" prop="remark"> </el-col>
<el-input </el-row>
type="textarea" <div class="has-header">其他</div>
v-model="patientInfoForm.remark" <el-row>
placeholder="请输入内容" <el-col :span="16">
clearable <el-form-item label="备注" prop="remark">
maxlength="200" <el-input
:autosize="{ minRows: 3, maxRows: 7}" type="textarea"
show-word-limit> v-model="patientInfoForm.remark"
</el-input> placeholder="请输入内容"
<span class="text-count">{{currentCount}} / 200</span> clearable
</el-form-item> maxlength="200"
</el-col> :autosize="{ minRows: 3, maxRows: 7}"
</el-row> show-word-limit>
</el-input>
<span class="text-count">{{currentCount}} / 200</span>
</el-form-item>
</el-col>
</el-row>
</div>
</el-form> </el-form>
</div> </div>
</template> </template>
...@@ -229,7 +236,16 @@ ...@@ -229,7 +236,16 @@
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { checkMobile } from '@/utils/patients/checkValid'; import { checkMobile } from '@/utils/patients/checkValid';
import { isCardNo, checkProvince, checkBirthday, checkParity } from '@/utils/patients/checkCardNum'; import { isCardNo, checkProvince, checkBirthday, checkParity } from '@/utils/patients/checkCardNum';
import { getDiseasesList, getLabelList, getConstants, getNationsList, getRemindPatient,savePatientInfo } from '@/utils/patients/patientsapi'; import {
getDiseasesList,
getLabelList,
getConstants,
getNationsList,
getRemindPatient,
getProvinceList,
getCityList,
getCountyList,
getTownList } from '@/utils/patients/patientsapi';
export default { export default {
name: "basicInfo", name: "basicInfo",
components: {}, components: {},
...@@ -242,29 +258,13 @@ ...@@ -242,29 +258,13 @@
51:"四川",52:"贵州",53:"云南",54:"西藏",61:"陕西",62:"甘肃", 51:"四川",52:"贵州",53:"云南",54:"西藏",61:"陕西",62:"甘肃",
63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门",91:"国外" 63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门",91:"国外"
}; };
//是否为空
// if(value === ''){
// callback(new Error('请输入正确的身份证'))
// }
if(value) { if(value) {
//校验长度,类型 if(isCardNo(value) && checkProvince(value,vcity) && checkBirthday(value) && checkParity(value)) {
if(isCardNo(value) === false){ this.isTrue = true;
callback(new Error('请输入正确的身份证')) callback()
} }else {
//检查省份
if(checkProvince(value,vcity) === false){
callback(new Error('请输入正确的身份证'))
}
//校验生日
if(checkBirthday(value) === false){
callback(new Error('请输入正确的身份证'))
}
//检验位的检测
if(checkParity(value) === false){
callback(new Error('请输入正确的身份证')) callback(new Error('请输入正确的身份证'))
} }
this.go(value.length);
callback()
}else { }else {
callback() callback()
} }
...@@ -276,7 +276,9 @@ ...@@ -276,7 +276,9 @@
nationsList: [], nationsList: [],
diseaseIdList: [], diseaseIdList: [],
labelIdList: [], labelIdList: [],
addressList: [],
baseInfoEdit: true, baseInfoEdit: true,
isTrue: false,
patientInfoForm: { patientInfoForm: {
nickname: '', nickname: '',
mobilePhone: '', mobilePhone: '',
...@@ -295,9 +297,28 @@ ...@@ -295,9 +297,28 @@
isRemind: 1, isRemind: 1,
wechatNickname: '', wechatNickname: '',
remark: '', remark: '',
patientAddress: '',
address: '',
workplace: '',
provinceId: null,
cityId: null,
countyId: null,
townId: null,
}, },
hasIdNo: false, hasIdNo: false,
validStatus: false, validStatus: false,
provinceList: [],
provinceLists: [], //省列表
cityLists: [], //市列表
countyLists: [], //县列表
townLists: [],//乡镇列表
optionProps: {
value: "id",
label: "name",
children: "children"
},
tipsText: '展开录入完整信息',
isShowAll: false,
rules: { rules: {
nickname: [{required: true, message: '请输入居民姓名', trigger: ['change', 'blur'] }], nickname: [{required: true, message: '请输入居民姓名', trigger: ['change', 'blur'] }],
mobilePhone: [{required: true, message: '请输入手机号', trigger: ['change', 'blur'] },{ validator: checkMobile , trigger: ['blur','change'] }], mobilePhone: [{required: true, message: '请输入手机号', trigger: ['change', 'blur'] },{ validator: checkMobile , trigger: ['blur','change'] }],
...@@ -311,8 +332,8 @@ ...@@ -311,8 +332,8 @@
patientId: String, patientId: String,
}, },
watch: { watch: {
patientInfoObj(val){ async patientInfoObj(val) {
if(this.patientId){ if(this.patientId){ //编辑居民信息,对拿到的数据做处理
this.patientInfoForm = val; this.patientInfoForm = val;
this.baseInfoEdit = this.patientInfoForm.baseInfoEdit; this.baseInfoEdit = this.patientInfoForm.baseInfoEdit;
let customLabels = this.patientInfoForm.customLabels; let customLabels = this.patientInfoForm.customLabels;
...@@ -336,28 +357,46 @@ ...@@ -336,28 +357,46 @@
}else { }else {
this.hasIdNo = false; this.hasIdNo = false;
} }
// this.$refs['patientInfoForm'].clearValidate(); //对地区数据做回显处理
this.$forceUpdate(); if(this.patientInfoForm.patientAddress) {
}else { let provinceId = this.patientInfoForm.provinceId;
// 新增 let cityId = this.patientInfoForm.cityId;
let countyId = this.patientInfoForm.countyId;
let townId = this.patientInfoForm.townId;
await this.getCity(provinceId);
await this.getCounty(provinceId, cityId);
await this.getTown(provinceId, cityId, countyId);
this.addressList = [Number(provinceId), Number(cityId), Number(countyId), Number(townId)];
this.$forceUpdate();
}else {
this.addressList = [];
}
}else { // 新增
this.patientInfoForm = { this.patientInfoForm = {
nickname: '', nickname: '',
mobilePhone: '', mobilePhone: '',
diseases: [], diseases: [],
patientDiseases: [], patientDiseases: [],
customLabels: [], customLabels: [],
idNo: '', idNo: '',
birthTime: '', birthTime: '',
age: '', age: '',
sex: null, sex: null,
permanentResidence: '', permanentResidence: '',
nationality: '', nationality: '',
socialCard: '', socialCard: '',
fileLocator: '', fileLocator: '',
isWechatBind: null, isWechatBind: null,
isRemind: null, isRemind: null,
wechatNickname: '', wechatNickname: '',
remark: '', remark: '',
patientAddress: '',
address: '',
workplace: '',
provinceId: null,
cityId: null,
countyId: null,
townId: null,
} }
} }
}, },
...@@ -382,7 +421,6 @@ ...@@ -382,7 +421,6 @@
}else { }else {
return 0; return 0;
} }
}, },
}, },
methods: { methods: {
...@@ -411,7 +449,8 @@ ...@@ -411,7 +449,8 @@
if(data.code == '000000') { if(data.code == '000000') {
this.nationsList = data.data; this.nationsList = data.data;
} }
}) });
this.getProvinceLists();
}, },
changeDiseases(val) { changeDiseases(val) {
let newDiseaseList = []; let newDiseaseList = [];
...@@ -422,7 +461,6 @@ ...@@ -422,7 +461,6 @@
} }
}) })
}); });
// this.patientInfoForm.diseases = newDiseaseList;
this.patientInfoForm.patientDiseases = newDiseaseList; this.patientInfoForm.patientDiseases = newDiseaseList;
}, },
changeLabels(val){ changeLabels(val){
...@@ -436,6 +474,11 @@ ...@@ -436,6 +474,11 @@
}); });
this.patientInfoForm.customLabels = newLabelsList; this.patientInfoForm.customLabels = newLabelsList;
}, },
idNoBlurHandler() {
if(this.isTrue) {
this.go(this.patientInfoForm.idNo.length);
}
},
//提醒绑定 //提醒绑定
remindBind() { remindBind() {
let remindMobileWechatPara = { let remindMobileWechatPara = {
...@@ -456,8 +499,36 @@ ...@@ -456,8 +499,36 @@
}, },
saveInfoData() { saveInfoData() {
this.$refs['patientInfoForm'].validate((valid) => { this.$refs['patientInfoForm'].validate((valid) => {
//对地区数据做处理
if(this.addressList.length > 0) {
this.patientInfoForm.provinceId = this.addressList[0];
this.patientInfoForm.cityId = this.addressList[1];
this.patientInfoForm.countyId = this.addressList[2];
this.patientInfoForm.townId = this.addressList[3];
this.provinceLists.forEach((item) => {
if(this.patientInfoForm.provinceId == item.provinceId) {
this.patientInfoForm.provinceName = item.provinceName;
}
});
this.cityLists.forEach((item) => {
if(this.patientInfoForm.cityId == item.cityId) {
this.patientInfoForm.cityName = item.cityName;
}
});
this.countyLists.forEach((item) => {
if(this.patientInfoForm.countyId == item.countyId) {
this.patientInfoForm.countyName = item.countyName;
}
})
this.townLists.forEach((item) => {
if(this.patientInfoForm.townId == item.townId) {
this.patientInfoForm.townName = item.townName;
}
})
this.patientInfoForm.patientAddress = `${this.patientInfoForm.provinceName}${this.patientInfoForm.cityName}${this.patientInfoForm.countyName}${this.patientInfoForm.townName}`
}
if (valid) { if (valid) {
console.log('对象',this.patientInfoForm) // console.log('提交表单',this.patientInfoForm);
this.$emit('addListenSave',{ this.$emit('addListenSave',{
status: true, status: true,
patientInfoForm: { patientInfoForm: {
...@@ -521,11 +592,105 @@ ...@@ -521,11 +592,105 @@
this.patientInfoForm.age = null; this.patientInfoForm.age = null;
} }
}, },
handleItemChange (val) {
if (val.length === 1) { //获取市(二级)
this.getCity(val[0]);
} else if (val.length === 2) { //获取县区 (三级)
this.getCounty(val[0], val[1]);
} else if(val.length === 3) { //获取乡镇 (四级)
this.getTown(val[0], val[1], val[2]);
}
this.$forceUpdate();
},
async getProvinceLists() {
await getProvinceList({}).then((data) => {
if(data.code == '000000') {
this.provinceLists = data.data.provinceList;
this.provinceLists.map(item => {
this.$set(item, "id", item.provinceId);
this.$set(item, "name", item.provinceName);
this.$set(item, "children", []);
});
this.provinceList = this.provinceLists;
// this.$forceUpdate();
}
})
},
async getCity(provinceId) {
await getCityList({provinceId: provinceId}).then((data) => {
if(data.code == '000000') {
this.cityLists = data.data.cityList;
this.cityLists.map(item => {
this.$set(item, "id", item.cityId);
this.$set(item, "name", item.cityName);
this.$set(item, "children", []);
});
this.provinceList.map((item, index) => {
if(item.id == provinceId) {
item.children = this.cityLists;
}
})
// this.$forceUpdate();
}
})
},
async getCounty(provinceId, cityId) {
await getCountyList({cityId: cityId}).then((data) => {
if(data.code == '000000') {
this.countyLists = data.data.countyList;
this.countyLists.map(item => {
this.$set(item, "id", item.countyId);
this.$set(item, "name", item.countyName);
this.$set(item, "children", []);
});
this.provinceList.map((item, index) => {
if(item.id == provinceId) {
item.children.map((city, idx) => {
city.children = this.countyLists;
})
}
})
// this.$forceUpdate();
}
})
},
async getTown(provinceId, cityId, countyId) {
await getTownList({countyId: countyId}).then((data) => {
if(data.code == '000000') {
this.townLists = data.data.townList;
this.townLists.map(item => {
this.$set(item, "id", item.townId);
this.$set(item, "name", item.townName);
// this.$set(item, "children", []);
});
this.provinceList.map((item, index) => {
if(item.id == provinceId) {
item.children.map((city, index2) => {
if(city.id == cityId) {
city.children.map((county, index3) => {
county.children = this.townLists;
})
}
})
}
})
}
// this.$forceUpdate();
})
},
toggleClick() {
if(this.isShowAll) {
this.tipsText = '展开录入完整信息';
this.isShowAll = false;
}else {
this.tipsText = '收起录入完整信息';
this.isShowAll = true;
}
}
}, },
filters: { filters: {
emptyFilter: function(value) { emptyFilter: function(value) {
if (!value) { if (!value && value != 0) {
return '-'; return '-';
} else { } else {
return value; return value;
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<div><p class="title">身份证:</p><p class="info">{{patientInfo.idNo | emptyFilter}}</p></div> <div><p class="title">身份证:</p><p class="info">{{patientInfo.idNo | emptyFilter}}</p></div>
</div> </div>
<div class="item"> <div class="item">
<div><p class="title">出生年月:</p><p class="info">{{birthTimeDisplay | emptyFilter}}</p></div> <div><p class="title">出生日期:</p><p class="info">{{birthTimeDisplay | emptyFilter}}{{(patientInfo.age || patientInfo.age == 0) ? `、${patientInfo.age}岁` : ''}}</p></div>
<div><p class="title">性别:</p><p class="info">{{patientInfo.sex | sexFileter}}</p></div> <div><p class="title">性别:</p><p class="info">{{patientInfo.sex | sexFileter}}</p></div>
</div> </div>
<div class="item"> <div class="item">
...@@ -53,8 +53,9 @@ ...@@ -53,8 +53,9 @@
<div><p class="title">工作单位:</p><p class="info">{{patientInfo.workplace | emptyFilter}}</p></div> <div><p class="title">工作单位:</p><p class="info">{{patientInfo.workplace | emptyFilter}}</p></div>
<div> <div>
<p class="title">微信:</p> <p class="title">微信:</p>
<p class="info" v-if="patientInfo.isWechatBind == '1'">未绑定 <el-button type="text" class="ml10" @click="remindBind" v-if="patientInfo.isRemind == '1'">提醒绑定</el-button><span class="ml10" v-if="patientInfo.isRemind == '2'">已提醒</span></p> <p class="info" v-if="patientInfo.isWechatBind == '1'">未绑定 <el-button type="text" class="ml10" @click="remindBind" style="color: #449284;" v-if="patientInfo.isRemind == '1'">提醒绑定</el-button><span class="ml10" v-if="patientInfo.isRemind == '2'">已提醒</span></p>
<p class="info" v-else-if="patientInfo.isWechatBind == '2'">已绑定 <span class="ml10">(微信名:{{patientInfo.wechatNickname | emptyFilter}}</span></p> <!--<p class="info" v-else-if="patientInfo.isWechatBind == '2'">已绑定 <span class="ml10">(微信名:{{patientInfo.wechatNickname | emptyFilter}}</span></p>-->
<p class="info" v-else-if="patientInfo.isWechatBind == '2'">{{patientInfo.wechatNickname | emptyFilter}}</p>
<p class="info" v-else>-</p> <p class="info" v-else>-</p>
</div> </div>
</div> </div>
...@@ -228,8 +229,8 @@ ...@@ -228,8 +229,8 @@
}, },
getRecordList() { getRecordList() {
let reqPara = { let reqPara = {
// patientId: this.patientId, patientId: this.patientId,
patientId: '99997701', // patientId: '99997701',
pageNo: this.pageNo, pageNo: this.pageNo,
pageSize: this.pageSize, pageSize: this.pageSize,
} }
...@@ -257,11 +258,7 @@ ...@@ -257,11 +258,7 @@
} }
}) })
}, },
tabChangeHandler(tab) { tabChangeHandler(tab) {},
// if(tab.name == 'second'){
// this.getRecordList(true);
// }
},
deletePatient() { deletePatient() {
// 把写的提示信息需要换行的地方分成数组 confirmText // 把写的提示信息需要换行的地方分成数组 confirmText
const confirmText = ['您确定要删除此居民吗?', '删除后,您将无法对该居民发送患教和进行随访,重新添加该居民依旧可查看历史发送记录及随访记录']; const confirmText = ['您确定要删除此居民吗?', '删除后,您将无法对该居民发送患教和进行随访,重新添加该居民依旧可查看历史发送记录及随访记录'];
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册