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

地区回显问题1

上级 1cdca983
...@@ -333,85 +333,75 @@ ...@@ -333,85 +333,75 @@
}, },
watch: { watch: {
// const obj = await searchObj(id).then(res => res); // const obj = await searchObj(id).then(res => res);
patientInfoObj: { async patientInfoObj(val) {
async handler(val) { if(this.patientId){
if(this.patientId){ this.patientInfoForm = val;
this.patientInfoForm = val; this.baseInfoEdit = this.patientInfoForm.baseInfoEdit;
this.baseInfoEdit = this.patientInfoForm.baseInfoEdit; let customLabels = this.patientInfoForm.customLabels;
let customLabels = this.patientInfoForm.customLabels; let diseases = this.patientInfoForm.diseases;
let diseases = this.patientInfoForm.diseases; if(customLabels && customLabels.length > 0){
if(customLabels && customLabels.length > 0){ customLabels.forEach((kkk)=>{
customLabels.forEach((kkk)=>{ this.labelIdList.push(Number(kkk.labelId))
this.labelIdList.push(Number(kkk.labelId)) })
}) }else {
}else { this.labelIdList = [];
this.labelIdList = []; }
} if(diseases && diseases.length > 0) {
if(diseases && diseases.length > 0) { diseases.forEach((dis)=>{
diseases.forEach((dis)=>{ this.diseaseIdList.push(Number(dis.diseaseId))
this.diseaseIdList.push(Number(dis.diseaseId)) })
}) }else {
}else { this.diseaseIdList = [];
this.diseaseIdList = []; }
} if(this.patientInfoForm.idNo) {
if(this.patientInfoForm.idNo) { this.hasIdNo = true;
this.hasIdNo = true; }else {
}else { this.hasIdNo = false;
this.hasIdNo = false; }
} //对地区数据做处理
//对地区数据做处理 if(this.patientInfoForm.patientAddress) {
if(this.patientInfoForm.patientAddress) { let provinceId = this.patientInfoForm.provinceId;
let provinceId = this.patientInfoForm.provinceId; let cityId = this.patientInfoForm.cityId;
let cityId = this.patientInfoForm.cityId; let countyId = this.patientInfoForm.countyId;
let countyId = this.patientInfoForm.countyId; let townId = this.patientInfoForm.townId;
let townId = this.patientInfoForm.townId;
await this.getCity(provinceId);
await this.getCounty(provinceId, cityId);
await this.getTown(provinceId, cityId, countyId);
await setTimeout(() => { await this.getCity(provinceId);
this.addressList[0] = parseInt(provinceId); await this.getCounty(provinceId, cityId);
this.addressList[1] = parseInt(cityId); await this.getTown(provinceId, cityId, countyId);
this.addressList[2] = parseInt(countyId); this.addressList = [Number(provinceId), Number(cityId), Number(countyId), Number(townId)];
this.addressList[3] = parseInt(townId); this.$forceUpdate();
},10);
this.$forceUpdate();
}else {
this.addressList = [];
}
// this.$refs['patientInfoForm'].clearValidate();
}else { }else {
// 新增 this.addressList = [];
this.patientInfoForm = {
nickname: '',
mobilePhone: '',
diseases: [],
patientDiseases: [],
customLabels: [],
idNo: '',
birthTime: '',
age: '',
sex: null,
permanentResidence: '',
nationality: '',
socialCard: '',
fileLocator: '',
isWechatBind: null,
isRemind: null,
wechatNickname: '',
remark: '',
patientAddress: '',
address: '',
workplace: '',
provinceId: null,
cityId: null,
countyId: null,
townId: null,
}
} }
}, }else {
deep: true, // 新增
this.patientInfoForm = {
nickname: '',
mobilePhone: '',
diseases: [],
patientDiseases: [],
customLabels: [],
idNo: '',
birthTime: '',
age: '',
sex: null,
permanentResidence: '',
nationality: '',
socialCard: '',
fileLocator: '',
isWechatBind: null,
isRemind: null,
wechatNickname: '',
remark: '',
patientAddress: '',
address: '',
workplace: '',
provinceId: null,
cityId: null,
countyId: null,
townId: null,
}
}
}, },
checkForm(val){ checkForm(val){
if(val){// 触发校验 if(val){// 触发校验
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册