|
|
@@ -352,7 +352,10 @@ export default {
|
|
|
this.pickerIndexObj[typeName] = rangeArr.findIndex(item => item.value === selectedId);
|
|
|
},
|
|
|
makeFromData(){
|
|
|
- if(this.baseFormData.age == '0')this.baseFormData.age = '';
|
|
|
+ // 后台返回 0 代表没填过,这几个数字输入框不应该显示字面上的 "0",统一归一化成空字符串
|
|
|
+ ['age','height','weight','children_age','symptom_duration'].forEach((key)=>{
|
|
|
+ if (this.baseFormData[key] == '0') this.baseFormData[key] = ''
|
|
|
+ })
|
|
|
this.baseFormData.sex = Number(this.baseFormData.sex);
|
|
|
if(this.baseFormData.sex == '0')this.baseFormData.sex = '';
|
|
|
this.baseFormData.profession = Number(this.baseFormData.profession);
|
|
|
@@ -394,6 +397,13 @@ export default {
|
|
|
if (res.code === 200) {
|
|
|
this.doctorRange = this.objToArr(res.data);
|
|
|
this.pickerEchoShow(this.doctorRange,this.baseFormData.doctor_id,'doctor')
|
|
|
+ // 切换医院后,原来选的医生 id 在新医院的医生列表里匹配不到,会导致选择器空白;
|
|
|
+ // 匹配不到但列表非空时,默认选中返回的第一个医生
|
|
|
+ if (this.pickerIndexObj.doctor === -1 && this.doctorRange.length) {
|
|
|
+ this.pickerIndexObj.doctor = 0
|
|
|
+ this.baseFormData.doctor_id = this.doctorRange[0].value
|
|
|
+ this.baseFormData.doctor_name = this.doctorRange[0].text
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
async submitForm() {
|