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

地区回显问题1

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