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

添加居民接口联调及操作

上级 4dc1e25d
......@@ -16,7 +16,16 @@ export const getConstants = (params) => {
description: '获取常量',
})
};
/*获取省市县乡列表*/
export const getProvinceList = (params) => {
return fetch({
headers,
url: getBaseUrl(`basic-data/position/provinces`),
method: 'get',
params: params,
description: '获取省列表',
})
};
/*居民管理*/
export const getPatientList = (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
export const getQiniuToken = (params) => {
return fetch({
......@@ -224,3 +243,13 @@ export const getHealthRecordList = (data) => {
description: '健康档案记录列表',
})
};
/*新的获取居民接口,搜索条件有变化*/
export const getPatientInfoList = (data) => {
return fetch({
headers,
url: getBaseUrl(`healths/patients/v2/infolist`),
method: 'post',
data: data,
description: '获取居民列表',
})
};
......@@ -7,7 +7,7 @@
:before-close="clickClose"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="950px"
width="1100px"
top="2%"
center>
<div class="finish-content">
......@@ -17,11 +17,16 @@
:inline="true"
class="select-width"
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
v-model="searchData.sex"
@change="changeSex"
placeholder="请选择性别">
placeholder="请选择性别"
clearable>
<el-option
v-for="(item,index) in sexOptions"
:key="index"
......@@ -30,13 +35,13 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-form-item style="width: 140px;" prop="ageRange">
<el-select
v-model="searchData.ageRange"
@change="changeAge"
multiple
collapse-tags
placeholder="请选择年龄段">
placeholder="请选择年龄段"
clearable>
<el-option
v-for="(item,index) in ageOptions"
:key="index"
......@@ -45,13 +50,14 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-form-item prop="diseaseId">
<el-select
v-model="searchData.diseaseId"
@change="changeDisease"
multiple
collapse-tags
placeholder="请选择诊断">
style="width: 200px;"
placeholder="请选择诊断"
clearable>
<el-option
v-for="(item,index) in diseaseOptions"
:key="index"
......@@ -60,14 +66,15 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-form-item prop="labelId">
<el-select
v-model="searchData.labelId"
@change="changeLabel"
multiple
collapse-tags
filterable
placeholder="请选择或搜索分组">
style="width: 200px;"
placeholder="请选择或搜索分组"
clearable>
<el-option
v-for="(item,index) in labelOptions"
:key="index"
......@@ -76,21 +83,27 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item style="width:160px;">
<el-input v-model="searchData.searchCondition" placeholder="请输入姓名或手机号" >
<i slot="prefix" class="el-input__icon el-icon-search" @click="searchHandler" style="cursor: pointer"></i>
<el-form-item prop="searchCondition">
<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>
<el-form-item>
<el-button>查询</el-button>
<el-button>重置</el-button>
</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-table
:data="patientsData"
ref="multipleTable"
center
style="width: 100%;margin-top: 20px;"
style="width: 100%;margin-top: 0;"
height="280"
:row-key="getRowKeys"
@selection-change="handleSelectionChange">
......@@ -108,35 +121,43 @@
<el-table-column
prop="sexStr"
label="性别"
min-width="50"
align="center">
</el-table-column>
<el-table-column
prop="age"
label="年龄"
min-width="50"
align="center">
</el-table-column>
<el-table-column
prop="mobilePhone"
label="手机"
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
prop="showDiseaseNames"
label="基础疾病"
align="center"
width="200"
width="180"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="showLabelName"
label="分组"
align="center"
width="200"
width="180"
:show-overflow-tooltip="true">
</el-table-column>
</el-table>
<el-row type="flex" justify="end" class="margin-top20">
<el-row type="flex" justify="end" class="margin-top15">
<el-pagination
background
v-if="patientsData.length"
......@@ -160,7 +181,7 @@
<script>
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 {
components: {},
name: "select-patient",
......@@ -170,23 +191,12 @@
allSelects: [],
// eachSelects: [],//仅仅是操作选择的总人员
// totalSelect: [],// 当前所选的人
labelId: '',
diseaseId: '',
age: '',
sex: '',
ageBegin: '',
ageEnd: '',
srvPackageId: '',
searchCondition: '',
patientsData: [],
searchData: {
sex: null,
ageRange: [],
ageBegin: '',
ageEnd: '',
// diseaseId: '基础疾病',
diseaseId: [],
// labelId: '分组',
labelId: [],
searchCondition: ''
},
......@@ -200,26 +210,16 @@
value: '不限'
}],
ageOptions: [
// {
// no: '',
// value: '年龄范围'
// }
// {no: '', value: '年龄范围'}
],
diseaseOptions: [
// {
// diseaseId: '',
// diseaseName: '基础疾病'
// }
// {diseaseId: '', diseaseName: '基础疾病'}
],
labelOptions: [
// {
// labelId: '',
// labelName: '分组'
// }
// {labelId: '', labelName: '分组'}
],
newSelects: [], //新选中的人
getRowKeys(row) {
// console.log('sshkdhdk',row)
return row.patientId;
},
}
......@@ -234,7 +234,7 @@
if(val){
this.getPatientsList()
// 获取常量 性别、年龄
getBasicData({
getConstants({
numList: 'P057,P006'
}).then(res=>{
this.sexOptions = [{
......@@ -243,32 +243,23 @@
}];
this.sexOptions = this.sexOptions.concat(res.data.P006);//性别
this.ageOptions = [
// {
// no: '',
// value: '年龄范围'
// }
]
// {no: '', value: '年龄范围'}
];
this.ageOptions = this.ageOptions.concat(res.data.P057);//年龄段
})
// 获取所有疾病
getAllDiseases().then(res=>{
getDiseasesList().then(res=>{
this.diseaseOptions = [
// {
// diseaseId: '',
// diseaseName: '基础疾病'
// }
]
// {diseaseId: '', diseaseName: '基础疾病'}
];
this.diseaseOptions = this.diseaseOptions.concat(res.data);
})
// 获取所有分组
getAllLabels({type: 1}).then(res=>{
getLabelList({type: 1}).then(res=>{
this.labelOptions = [
// {
// labelId: '',
// labelName: '分组'
// }
// {labelId: '', labelName: '分组'}
]
this.labelOptions = this.labelOptions.concat(res.data.labelNameList);
})
......@@ -287,23 +278,22 @@
const data = {
pageSize: this.paginationSet.pageSize,
pageNo: this.paginationSet.pageNum,
labelId:this.labelId,
diseaseId: this.diseaseId,
age: this.age,
sex: this.sex,
ageBegin: this.ageBegin,
ageEnd: this.ageEnd,
labelIdList:this.searchData.labelId,
diseaseIdList: this.searchData.diseaseId,
ageList: this.searchData.ageRange,
sex: this.searchData.sex,
searchCondition:this.searchData.searchCondition,
srvPackageId:this.srvPackageId,
searchCondition:this.searchCondition,
addType: 1,
fuPlanIdList: [],
}
getPlanPatientsList(data).then(res=>{
getPatientInfoList(data).then(res=>{
if(res.data.patientList){
this.patientsData = res.data.patientList //接口获取的当页居民
this.getSex()
this.paginationSet.total = res.data.totalRows
// 设置所请求的当页人员是否成为选中状态
// console.log('传入的已选居民',this.patientIdList)
this.patientsData.forEach((item)=>{
item.disableNum = 1;
let diseaseNames = [];
......@@ -396,40 +386,21 @@
},
handleSizeChangePre(val) {
// console.log('handleSizeChangePre')
this.paginationSet.pageSize = val
this.getPatientsList()
},
changeSex(val){
this.sex = val;
this.paginationSet.pageNum = 1;
this.getPatientsList()
this.paginationSet.pageSize = val;
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;
searchHandler() {
this.paginationSet.pageNum = 1;
this.getPatientsList()
this.getPatientsList();
},
changeLabel(val){
this.labelId = val;
this.paginationSet.pageNum = 1;
this.getPatientsList()
resetData(formName) {
this.$refs[formName].resetFields();
this.getPatientsList();
},
searchHandler() {
const searchCondition = this.searchData.searchCondition;
this.searchCondition = searchCondition;
this.paginationSet.pageNum = 1;
this.getPatientsList()
goAddPatient() {
this.$router.push({
path: '/patients-manage/new-manage/new-patient'
})
},
ageDate(val){
let ageObj;
......@@ -457,11 +428,15 @@
</script>
<style lang="scss">
@import '../../../../style/patients-style/element-reset.css';
.select-patient-dialog {
.el-dialog__wrapper {
overflow: hidden;
.el-dialog--center {
height: 580px;
.el-dialog__body{
padding: 10px 25px 15px;
}
.el-table--scrollable-y,.el-table__body-wrapper {
&::-webkit-scrollbar{
width:5px;
......@@ -489,13 +464,13 @@
}
.select-width .el-form-item{
width: 130px;
}
.margin-top20{
margin-top: 20px;
/*width: 130px;*/
}
.margin-top15{
margin-top: 15px;
}
}
</style>
......@@ -152,6 +152,7 @@
deleteCurrentLabel,
changeLabelName,
deleteCurrentPatients,
saveLabelsForPatient,
} from '@/utils/patients/patientsapi'
import SelectPatient from './dialog/select-patitents';
......@@ -371,6 +372,7 @@
type: 'success'
});
this.showDeletePatientsDialog = false;
this.getDetail();
}else{
this.$message({
message: '请求接口失败,请重新再试',
......@@ -383,9 +385,33 @@
},
addPatientsHandler() {
this.isShowSelectPatient = true;
this.searchData.tableData.forEach(item => {
this.patientIdList.push(item.id)
})
},
closeSelectPatient() {},
sureSelectPatient(arg) {
closeSelectPatient(val) {
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 @@
<el-row>
<el-col :span="12">
<el-form-item label="所在地区" prop="patientAddress">
<el-input
<el-cascader
placeholder="请选择省市县乡"
:options="provinceList"
v-model="patientInfoForm.patientAddress"
placeholder="请输入居民医保卡号码"
clearable>
</el-input>
@active-item-change="handleItemChange"
:props="optionProps">
</el-cascader>
</el-form-item>
</el-col>
<el-col :span="12">
......@@ -229,7 +231,7 @@
import { mapGetters } from 'vuex';
import { checkMobile } from '@/utils/patients/checkValid';
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 {
name: "basicInfo",
components: {},
......@@ -295,6 +297,9 @@
isRemind: 1,
wechatNickname: '',
remark: '',
patientAddress: [],
address: '',
workplace: '',
},
hasIdNo: false,
validStatus: false,
......@@ -303,6 +308,16 @@
mobilePhone: [{required: true, message: '请输入手机号', trigger: ['change', 'blur'] },{ validator: checkMobile , trigger: ['blur','change'] }],
idNo: [{required: false,validator: checkCardNum, trigger: ['change'] }],
},
optionProps: {
// value: 'value',
// children: 'cities'
value: "id",
label: "name",
children: "children"
},
provinceList: [],
}
},
props: {
......@@ -337,6 +352,9 @@
this.hasIdNo = false;
}
// this.$refs['patientInfoForm'].clearValidate();
this.patientInfoForm.patientAddress = []; // 特殊处理
this.$forceUpdate();
}else {
// 新增
......@@ -358,6 +376,9 @@
isRemind: null,
wechatNickname: '',
remark: '',
patientAddress: [],
address: '',
workplace: '',
}
}
},
......@@ -366,6 +387,9 @@
this.saveInfoData();
}
},
idNo(newv, oldv) {
}
},
created() {
this.initConstant();
......@@ -411,7 +435,8 @@
if(data.code == '000000') {
this.nationsList = data.data;
}
})
});
this.getProvinceLists();
},
changeDiseases(val) {
let newDiseaseList = [];
......@@ -521,6 +546,25 @@
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: {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册