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

细节调节

上级 dcbcb6f3
...@@ -394,6 +394,7 @@ ...@@ -394,6 +394,7 @@
let getArguments = arguments[0]; let getArguments = arguments[0];
const selectPatients = getArguments[1]; // 每次选中获取的人 const selectPatients = getArguments[1]; // 每次选中获取的人
let labelId = this.$route.query.labelId; let labelId = this.$route.query.labelId;
let patientLen = selectPatients.length;
saveLabelsForPatient(labelId,{ saveLabelsForPatient(labelId,{
newLablelName: this.$route.query.labelName, newLablelName: this.$route.query.labelName,
oldLabelName: this.$route.query.labelName, oldLabelName: this.$route.query.labelName,
...@@ -402,7 +403,7 @@ ...@@ -402,7 +403,7 @@
}).then((data) => { }).then((data) => {
if(data.code == '000000') { if(data.code == '000000') {
setTimeout(() => { setTimeout(() => {
this.$message.success(data.message) this.$message.success(`已成功添加${patientLen}位居民`)
this.isShowSelectPatient = getArguments[0]; this.isShowSelectPatient = getArguments[0];
this.getDetail(); this.getDetail();
},500) },500)
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</bread-crumb> </bread-crumb>
<div class="f-main-content screenSet"> <div class="f-main-content screenSet">
<div class="header-title"> <div class="header-title">
<span>基本信息</span> <span>居民信息</span>
<p> <p>
<el-button plain size="small" @click="cancelEdit">取消</el-button> <el-button plain size="small" @click="cancelEdit">取消</el-button>
<el-button type="primary" size="small" @click="saveEdit">保存</el-button> <el-button type="primary" size="small" @click="saveEdit">保存</el-button>
...@@ -72,8 +72,8 @@ ...@@ -72,8 +72,8 @@
addListenSave(val) { addListenSave(val) {
this.checkForm = false; this.checkForm = false;
if(val.status) { if(val.status) {
this.patientInfo = val.patientInfoForm // this.patientInfo = val.patientInfoForm
savePatientInfo(this.patientInfo).then(data => { savePatientInfo(val.patientInfoForm).then(data => {
if(data.code == '000000'){ if(data.code == '000000'){
this.$message.success('保存备注成功') this.$message.success('保存备注成功')
setTimeout(() => { setTimeout(() => {
......
...@@ -43,8 +43,8 @@ ...@@ -43,8 +43,8 @@
@change="changeDiseases" @change="changeDiseases"
placeholder="请选择居民疾病诊断"> placeholder="请选择居民疾病诊断">
<el-option <el-option
v-for="item in diseasesList" v-for="(item, index) in diseasesList"
:key="item.diseaseId" :key="index"
:label="item.diseaseName" :label="item.diseaseName"
:value="item.diseaseId"> :value="item.diseaseId">
</el-option> </el-option>
...@@ -119,8 +119,8 @@ ...@@ -119,8 +119,8 @@
placeholder="请选择居民常驻类型" placeholder="请选择居民常驻类型"
clearable> clearable>
<el-option <el-option
v-for="item in residenceList" v-for="(item, index) in residenceList"
:key="item.no" :key="index"
:label="item.value" :label="item.value"
:value="item.noChar"> :value="item.noChar">
</el-option> </el-option>
...@@ -134,8 +134,8 @@ ...@@ -134,8 +134,8 @@
placeholder="请选择民族" placeholder="请选择民族"
clearable> clearable>
<el-option <el-option
v-for="item in nationsList" v-for="(item, index) in nationsList"
:key="item.code" :key="index"
:label="item.name" :label="item.name"
:value="item.code"> :value="item.code">
</el-option> </el-option>
...@@ -168,11 +168,11 @@ ...@@ -168,11 +168,11 @@
<div class="has-header">联系方式</div> <div class="has-header">联系方式</div>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="所在地区" prop="patientAddress"> <el-form-item label="所在地区" prop="addressList">
<el-cascader <el-cascader
placeholder="请选择省市县乡" placeholder="请选择省市县乡"
:options="provinceList" :options="provinceList"
v-model="patientInfoForm.patientAddress" v-model="addressList"
@active-item-change="handleItemChange" @active-item-change="handleItemChange"
:props="optionProps"> :props="optionProps">
</el-cascader> </el-cascader>
...@@ -288,6 +288,7 @@ ...@@ -288,6 +288,7 @@
nationsList: [], nationsList: [],
diseaseIdList: [], diseaseIdList: [],
labelIdList: [], labelIdList: [],
addressList: [],
baseInfoEdit: true, baseInfoEdit: true,
patientInfoForm: { patientInfoForm: {
nickname: '', nickname: '',
...@@ -307,9 +308,13 @@ ...@@ -307,9 +308,13 @@
isRemind: 1, isRemind: 1,
wechatNickname: '', wechatNickname: '',
remark: '', remark: '',
patientAddress: [], patientAddress: '',
address: '', address: '',
workplace: '', workplace: '',
provinceId: null,
cityId: null,
countyId: null,
townId: null,
}, },
hasIdNo: false, hasIdNo: false,
validStatus: false, validStatus: false,
...@@ -320,14 +325,15 @@ ...@@ -320,14 +325,15 @@
}, },
optionProps: { optionProps: {
// value: 'value',
// children: 'cities'
value: "id", value: "id",
label: "name", label: "name",
children: "children" children: "children"
}, },
provinceList: [], provinceList: [],
provinceLists: [], //省列表
cityLists: [], //市列表
countyLists: [], //县列表
townLists: [],//乡镇列表
} }
}, },
props: { props: {
...@@ -361,10 +367,17 @@ ...@@ -361,10 +367,17 @@
}else { }else {
this.hasIdNo = false; this.hasIdNo = false;
} }
// this.$refs['patientInfoForm'].clearValidate(); //对地区数据做处理
if(this.patientInfoForm.patientAddress) {
this.addressList[0] = this.patientInfoForm.provinceId;
this.patientInfoForm.patientAddress = []; // 特殊处理 this.addressList[1] = this.patientInfoForm.cityId;
this.addressList[2] = this.patientInfoForm.countyId;
this.addressList[3] = this.patientInfoForm.townId;
// this.addressList = JSON.parse(this.addressList);
}else {
this.addressList = [];
}
this.$refs['patientInfoForm'].clearValidate();
this.$forceUpdate(); this.$forceUpdate();
}else { }else {
// 新增 // 新增
...@@ -386,9 +399,13 @@ ...@@ -386,9 +399,13 @@
isRemind: null, isRemind: null,
wechatNickname: '', wechatNickname: '',
remark: '', remark: '',
patientAddress: [], patientAddress: '',
address: '', address: '',
workplace: '', workplace: '',
provinceId: null,
cityId: null,
countyId: null,
townId: null,
} }
} }
}, },
...@@ -397,8 +414,8 @@ ...@@ -397,8 +414,8 @@
this.saveInfoData(); this.saveInfoData();
} }
}, },
idNo(newv, oldv) { idNo(newVal, oldVal) {
console.log('>>>',newVal,oldVal)
} }
}, },
created() { created() {
...@@ -457,7 +474,6 @@ ...@@ -457,7 +474,6 @@
} }
}) })
}); });
// this.patientInfoForm.diseases = newDiseaseList;
this.patientInfoForm.patientDiseases = newDiseaseList; this.patientInfoForm.patientDiseases = newDiseaseList;
}, },
changeLabels(val){ changeLabels(val){
...@@ -491,8 +507,36 @@ ...@@ -491,8 +507,36 @@
}, },
saveInfoData() { saveInfoData() {
this.$refs['patientInfoForm'].validate((valid) => { this.$refs['patientInfoForm'].validate((valid) => {
//对地区数据做处理
if(this.addressList.length > 0) {
this.patientInfoForm.provinceId = this.addressList[0];
this.patientInfoForm.cityId = this.addressList[1];
this.patientInfoForm.countyId = this.addressList[2];
this.patientInfoForm.townId = this.addressList[3];
this.provinceLists.forEach((item) => {
if(this.patientInfoForm.provinceId == item.provinceId) {
this.patientInfoForm.provinceName = item.provinceName;
}
});
this.cityLists.forEach((item) => {
if(this.patientInfoForm.cityId == item.cityId) {
this.patientInfoForm.cityName = item.cityName;
}
});
this.countyLists.forEach((item) => {
if(this.patientInfoForm.countyId == item.countyId) {
this.patientInfoForm.countyName = item.countyName;
}
})
this.townLists.forEach((item) => {
if(this.patientInfoForm.townId == item.townId) {
this.patientInfoForm.townName = item.townName;
}
})
this.patientInfoForm.patientAddress = `${this.patientInfoForm.provinceName}${this.patientInfoForm.cityName}${this.patientInfoForm.countyName}${this.patientInfoForm.townName}`
}
if (valid) { if (valid) {
console.log('对象',this.patientInfoForm) // console.log('提交表单',this.patientInfoForm);
this.$emit('addListenSave',{ this.$emit('addListenSave',{
status: true, status: true,
patientInfoForm: { patientInfoForm: {
...@@ -557,26 +601,24 @@ ...@@ -557,26 +601,24 @@
} }
}, },
handleItemChange (val) { handleItemChange (val) {
console.log('地区选择',val); if (val.length === 1) { //获取市(二级)
if (val.length === 1) {
this.getCity(val[0]); this.getCity(val[0]);
// 获取地区 (三级) } else if (val.length === 2) { //获取县区 (三级)
this.getCounty(val[0], val[1]);
} else if(val.length === 3) { //获取乡镇 (四级)
this.getTown(val[0], val[1], val[2]);
} }
// else if (val.length === 2) {
// this.getAreaList(val[0], val[1]);
// }
}, },
getProvinceLists() { getProvinceLists() {
getProvinceList({}).then((data) => { getProvinceList({}).then((data) => {
if(data.code == '000000') { if(data.code == '000000') {
let provinceLists = data.data.provinceList; this.provinceLists = data.data.provinceList;
provinceLists.map(item => { this.provinceLists.map(item => {
this.$set(item, "id", item.provinceId); this.$set(item, "id", item.provinceId);
this.$set(item, "name", item.provinceName); this.$set(item, "name", item.provinceName);
this.$set(item, "children", []); this.$set(item, "children", []);
}); });
this.provinceList = provinceLists; this.provinceList = this.provinceLists;
} }
}) })
// this.$forceUpdate(); // this.$forceUpdate();
...@@ -584,15 +626,57 @@ ...@@ -584,15 +626,57 @@
getCity(provinceId) { getCity(provinceId) {
getCityList({provinceId: provinceId}).then((data) => { getCityList({provinceId: provinceId}).then((data) => {
if(data.code == '000000') { if(data.code == '000000') {
let cityLists = data.data.cityList; this.cityLists = data.data.cityList;
cityLists.map(item => { this.cityLists.map(item => {
this.$set(item, "id", item.cityId); this.$set(item, "id", item.cityId);
this.$set(item, "name", item.cityName); this.$set(item, "name", item.cityName);
this.$set(item, "children", []); this.$set(item, "children", []);
}); });
this.provinceList.map((item, index) => { this.provinceList.map((item, index) => {
if(item.id == provinceId) { if(item.id == provinceId) {
item.children = cityLists; item.children = this.cityLists;
}
})
}
})
},
getCounty(provinceId, cityId) {
getCountyList({cityId: cityId}).then((data) => {
if(data.code == '000000') {
this.countyLists = data.data.countyList;
this.countyLists.map(item => {
this.$set(item, "id", item.countyId);
this.$set(item, "name", item.countyName);
this.$set(item, "children", []);
});
this.provinceList.map((item, index) => {
if(item.id == provinceId) {
item.children.map((city, idx) => {
city.children = this.countyLists;
})
}
})
}
})
},
getTown(provinceId, cityId, countyId) {
getTownList({countyId: countyId}).then((data) => {
if(data.code == '000000') {
this.townLists = data.data.townList;
this.townLists.map(item => {
this.$set(item, "id", item.townId);
this.$set(item, "name", item.townName);
// this.$set(item, "children", []);
});
this.provinceList.map((item, index) => {
if(item.id == provinceId) {
item.children.map((city, index2) => {
if(city.id == cityId) {
city.children.map((county, index3) => {
county.children = this.townLists;
})
}
})
} }
}) })
} }
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<div><p class="title">身份证:</p><p class="info">{{patientInfo.idNo | emptyFilter}}</p></div> <div><p class="title">身份证:</p><p class="info">{{patientInfo.idNo | emptyFilter}}</p></div>
</div> </div>
<div class="item"> <div class="item">
<div><p class="title">出生年月:</p><p class="info">{{birthTimeDisplay | emptyFilter}}</p></div> <div><p class="title">出生年月:</p><p class="info">{{birthTimeDisplay | emptyFilter}}{{patientInfo.age ? `、${patientInfo.age}岁` : ''}}</p></div>
<div><p class="title">性别:</p><p class="info">{{patientInfo.sex | sexFileter}}</p></div> <div><p class="title">性别:</p><p class="info">{{patientInfo.sex | sexFileter}}</p></div>
</div> </div>
<div class="item"> <div class="item">
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册