|
|
@@ -109,16 +109,12 @@ export default {
|
|
|
const res = await request('user', 'get_case_info', { openId: currentOpenId() })
|
|
|
if (res.code === 200) {
|
|
|
this.baseFormData = res.data;
|
|
|
- this.baseFormData.sex = Number(this.baseFormData.sex);
|
|
|
- this.baseFormData.common_hand = Number(this.baseFormData.common_hand);
|
|
|
- this.baseFormData.doctor_id = Number(this.baseFormData.doctor_id);
|
|
|
- this.baseFormData.education = Number(this.baseFormData.education);
|
|
|
- this.baseFormData.hospital_id = Number(this.baseFormData.hospital_id);
|
|
|
- this.baseFormData.marriage = Number(this.baseFormData.marriage);
|
|
|
- this.baseFormData.nation = Number(this.baseFormData.nation);
|
|
|
- this.baseFormData.profession = Number(this.baseFormData.profession);
|
|
|
- this.baseFormData.type = Number(this.baseFormData.type);
|
|
|
- this.baseFormData.house = Number(this.baseFormData.house);
|
|
|
+ // 后台没填过的选择类字段存的是字符串 "0"(或者字段压根不存在),选项列表都是从 value:1 开始编号,
|
|
|
+ // 统一兜底成 1,否则这几个只读下拉会显示空白(跟 history.vue 是同一套处理)
|
|
|
+ ['sex','common_hand','doctor_id','education','hospital_id','marriage','nation','profession','type','house'].forEach((key)=>{
|
|
|
+ if (!this.baseFormData[key] || this.baseFormData[key] == '0') this.baseFormData[key] = 1
|
|
|
+ this.baseFormData[key] = Number(this.baseFormData[key])
|
|
|
+ })
|
|
|
this.getUserSelect();
|
|
|
}
|
|
|
},
|