提交 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: '获取居民列表',
})
};
...@@ -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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册