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

分组详情字段调整

上级 b9419c84
...@@ -26,7 +26,33 @@ export const getProvinceList = (params) => { ...@@ -26,7 +26,33 @@ export const getProvinceList = (params) => {
description: '获取省列表', 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({
......
...@@ -217,6 +217,7 @@ ...@@ -217,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;
...@@ -385,9 +386,6 @@ ...@@ -385,9 +386,6 @@
}, },
addPatientsHandler() { addPatientsHandler() {
this.isShowSelectPatient = true; this.isShowSelectPatient = true;
this.searchData.tableData.forEach(item => {
this.patientIdList.push(item.id)
})
}, },
closeSelectPatient(val) { closeSelectPatient(val) {
this.isShowSelectPatient = val; this.isShowSelectPatient = val;
......
...@@ -231,7 +231,17 @@ ...@@ -231,7 +231,17 @@
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, getProvinceList } from '@/utils/patients/patientsapi'; import {
getDiseasesList,
getLabelList,
getConstants,
getNationsList,
getRemindPatient,
savePatientInfo,
getProvinceList,
getCityList,
getCountyList,
getTownList } from '@/utils/patients/patientsapi';
export default { export default {
name: "basicInfo", name: "basicInfo",
components: {}, components: {},
...@@ -548,7 +558,13 @@ ...@@ -548,7 +558,13 @@
}, },
handleItemChange (val) { handleItemChange (val) {
console.log('地区选择',val); console.log('地区选择',val);
// this.getPosition(val) if (val.length === 1) {
this.getCity(val[0]);
// 获取地区 (三级)
}
// else if (val.length === 2) {
// this.getAreaList(val[0], val[1]);
// }
}, },
getProvinceLists() { getProvinceLists() {
...@@ -563,9 +579,25 @@ ...@@ -563,9 +579,25 @@
this.provinceList = provinceLists; this.provinceList = provinceLists;
} }
}) })
this.$forceUpdate(); // this.$forceUpdate();
},
getCity(provinceId) {
getCityList({provinceId: provinceId}).then((data) => {
if(data.code == '000000') {
let cityLists = data.data.cityList;
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 = cityLists;
}
})
}
})
}, },
}, },
filters: { filters: {
emptyFilter: function(value) { emptyFilter: function(value) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册