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

添加居民接口联调及操作

上级 4dc1e25d
...@@ -16,7 +16,16 @@ export const getConstants = (params) => { ...@@ -16,7 +16,16 @@ 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 getPatientList = (data) => { export const getPatientList = (data) => {
...@@ -102,6 +111,16 @@ export const deleteCurrentPatients = data => { ...@@ -102,6 +111,16 @@ export const deleteCurrentPatients = data => {
}) })
} }
export const saveLabelsForPatient = (labelId, data) => {
return fetch({
headers,
url: getBaseUrl(`healths/labels/${labelId}/patients`),
method: 'post',
data: data,
description: '分组中添加居民',
})
}
// 获取七牛上传token // 获取七牛上传token
export const getQiniuToken = (params) => { export const getQiniuToken = (params) => {
return fetch({ return fetch({
...@@ -224,3 +243,13 @@ export const getHealthRecordList = (data) => { ...@@ -224,3 +243,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,11 +17,16 @@ ...@@ -17,11 +17,16 @@
: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-button plain size="small" @click="goAddPatient">+ 新增居民</el-button>
</div>
<div style="display: flex;justify-content: space-between;">
<div>
<el-form-item style="width: 100px;" prop="sex">
<el-select <el-select
v-model="searchData.sex" v-model="searchData.sex"
@change="changeSex" placeholder="请选择性别"
placeholder="请选择性别"> clearable>
<el-option <el-option
v-for="(item,index) in sexOptions" v-for="(item,index) in sexOptions"
:key="index" :key="index"
...@@ -30,13 +35,13 @@ ...@@ -30,13 +35,13 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item style="width: 140px;" prop="ageRange">
<el-select <el-select
v-model="searchData.ageRange" v-model="searchData.ageRange"
@change="changeAge"
multiple multiple
collapse-tags collapse-tags
placeholder="请选择年龄段"> placeholder="请选择年龄段"
clearable>
<el-option <el-option
v-for="(item,index) in ageOptions" v-for="(item,index) in ageOptions"
:key="index" :key="index"
...@@ -45,13 +50,14 @@ ...@@ -45,13 +50,14 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item prop="diseaseId">
<el-select <el-select
v-model="searchData.diseaseId" v-model="searchData.diseaseId"
@change="changeDisease"
multiple multiple
collapse-tags collapse-tags
placeholder="请选择诊断"> style="width: 200px;"
placeholder="请选择诊断"
clearable>
<el-option <el-option
v-for="(item,index) in diseaseOptions" v-for="(item,index) in diseaseOptions"
:key="index" :key="index"
...@@ -60,14 +66,15 @@ ...@@ -60,14 +66,15 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item prop="labelId">
<el-select <el-select
v-model="searchData.labelId" v-model="searchData.labelId"
@change="changeLabel"
multiple multiple
collapse-tags collapse-tags
filterable filterable
placeholder="请选择或搜索分组"> style="width: 200px;"
placeholder="请选择或搜索分组"
clearable>
<el-option <el-option
v-for="(item,index) in labelOptions" v-for="(item,index) in labelOptions"
:key="index" :key="index"
...@@ -76,21 +83,27 @@ ...@@ -76,21 +83,27 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item style="width:160px;"> <el-form-item prop="searchCondition">
<el-input v-model="searchData.searchCondition" placeholder="请输入姓名或手机号" > <el-input
<i slot="prefix" class="el-input__icon el-icon-search" @click="searchHandler" style="cursor: pointer"></i> 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-input>
</el-form-item> </el-form-item>
<el-form-item> </div>
<el-button>查询</el-button> <div>
<el-button>重置</el-button> <el-button type="primary" @click="searchHandler" size="small">查询</el-button>
</el-form-item> <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: 0;"
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,23 +278,22 @@ ...@@ -287,23 +278,22 @@
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 = [];
...@@ -396,40 +386,21 @@ ...@@ -396,40 +386,21 @@
}, },
handleSizeChangePre(val) { handleSizeChangePre(val) {
// console.log('handleSizeChangePre') this.paginationSet.pageSize = val;
this.paginationSet.pageSize = val this.getPatientsList();
this.getPatientsList()
},
changeSex(val){
this.sex = val;
this.paginationSet.pageNum = 1;
this.getPatientsList()
}, },
changeAge(val){ searchHandler() {
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 +428,15 @@ ...@@ -457,11 +428,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 +464,13 @@ ...@@ -489,13 +464,13 @@
} }
.select-width .el-form-item{ .select-width .el-form-item{
width: 130px; /*width: 130px;*/
}
.margin-top20{
margin-top: 20px;
} }
.margin-top15{
margin-top: 15px;
} }
}
</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';
...@@ -371,6 +372,7 @@ ...@@ -371,6 +372,7 @@
type: 'success' type: 'success'
}); });
this.showDeletePatientsDialog = false; this.showDeletePatientsDialog = false;
this.getDetail();
}else{ }else{
this.$message({ this.$message({
message: '请求接口失败,请重新再试', message: '请求接口失败,请重新再试',
...@@ -383,9 +385,33 @@ ...@@ -383,9 +385,33 @@
}, },
addPatientsHandler() { addPatientsHandler() {
this.isShowSelectPatient = true; this.isShowSelectPatient = true;
this.searchData.tableData.forEach(item => {
this.patientIdList.push(item.id)
})
}, },
closeSelectPatient() {}, closeSelectPatient(val) {
sureSelectPatient(arg) { this.isShowSelectPatient = val;
},
sureSelectPatient() {
let getArguments = arguments[0];
const selectPatients = getArguments[1]; // 每次选中获取的人
let labelId = this.$route.query.labelId;
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(data.message)
this.isShowSelectPatient = getArguments[0];
this.getDetail();
},500)
}else {
this.$message.error(data.message)
}
})
}, },
} }
......
...@@ -169,11 +169,13 @@ ...@@ -169,11 +169,13 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="所在地区" prop="patientAddress"> <el-form-item label="所在地区" prop="patientAddress">
<el-input <el-cascader
placeholder="请选择省市县乡"
:options="provinceList"
v-model="patientInfoForm.patientAddress" v-model="patientInfoForm.patientAddress"
placeholder="请输入居民医保卡号码" @active-item-change="handleItemChange"
clearable> :props="optionProps">
</el-input> </el-cascader>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
...@@ -229,7 +231,7 @@ ...@@ -229,7 +231,7 @@
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,savePatientInfo, getProvinceList } from '@/utils/patients/patientsapi';
export default { export default {
name: "basicInfo", name: "basicInfo",
components: {}, components: {},
...@@ -295,6 +297,9 @@ ...@@ -295,6 +297,9 @@
isRemind: 1, isRemind: 1,
wechatNickname: '', wechatNickname: '',
remark: '', remark: '',
patientAddress: [],
address: '',
workplace: '',
}, },
hasIdNo: false, hasIdNo: false,
validStatus: false, validStatus: false,
...@@ -303,6 +308,16 @@ ...@@ -303,6 +308,16 @@
mobilePhone: [{required: true, message: '请输入手机号', trigger: ['change', 'blur'] },{ validator: checkMobile , trigger: ['blur','change'] }], mobilePhone: [{required: true, message: '请输入手机号', trigger: ['change', 'blur'] },{ validator: checkMobile , trigger: ['blur','change'] }],
idNo: [{required: false,validator: checkCardNum, trigger: ['change'] }], idNo: [{required: false,validator: checkCardNum, trigger: ['change'] }],
}, },
optionProps: {
// value: 'value',
// children: 'cities'
value: "id",
label: "name",
children: "children"
},
provinceList: [],
} }
}, },
props: { props: {
...@@ -337,6 +352,9 @@ ...@@ -337,6 +352,9 @@
this.hasIdNo = false; this.hasIdNo = false;
} }
// this.$refs['patientInfoForm'].clearValidate(); // this.$refs['patientInfoForm'].clearValidate();
this.patientInfoForm.patientAddress = []; // 特殊处理
this.$forceUpdate(); this.$forceUpdate();
}else { }else {
// 新增 // 新增
...@@ -358,6 +376,9 @@ ...@@ -358,6 +376,9 @@
isRemind: null, isRemind: null,
wechatNickname: '', wechatNickname: '',
remark: '', remark: '',
patientAddress: [],
address: '',
workplace: '',
} }
} }
}, },
...@@ -366,6 +387,9 @@ ...@@ -366,6 +387,9 @@
this.saveInfoData(); this.saveInfoData();
} }
}, },
idNo(newv, oldv) {
}
}, },
created() { created() {
this.initConstant(); this.initConstant();
...@@ -411,7 +435,8 @@ ...@@ -411,7 +435,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 = [];
...@@ -521,6 +546,25 @@ ...@@ -521,6 +546,25 @@
this.patientInfoForm.age = null; this.patientInfoForm.age = null;
} }
}, },
handleItemChange (val) {
console.log('地区选择',val);
// this.getPosition(val)
},
getProvinceLists() {
getProvinceList({}).then((data) => {
if(data.code == '000000') {
let provinceLists = data.data.provinceList;
provinceLists.map(item => {
this.$set(item, "id", item.provinceId);
this.$set(item, "name", item.provinceName);
this.$set(item, "children", []);
});
this.provinceList = provinceLists;
}
})
this.$forceUpdate();
},
}, },
filters: { filters: {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册