提交 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,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: 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){ 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 +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-top15{
margin-top: 20px; 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(val) {
this.isShowSelectPatient = val;
}, },
closeSelectPatient() {}, sureSelectPatient() {
sureSelectPatient(arg) { 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,27 +352,33 @@ ...@@ -337,27 +352,33 @@
this.hasIdNo = false; this.hasIdNo = false;
} }
// this.$refs['patientInfoForm'].clearValidate(); // this.$refs['patientInfoForm'].clearValidate();
this.patientInfoForm.patientAddress = []; // 特殊处理
this.$forceUpdate(); this.$forceUpdate();
}else { }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: '',
} }
} }
}, },
...@@ -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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册