Browse Source

修改医院信息医院内容回显

master
aBin 4 years ago
parent
commit
0c1297c13d
  1. 20
      src/components/RightPage/RightPage.vue

20
src/components/RightPage/RightPage.vue

@ -56,7 +56,7 @@
/> />
</a-form-item> </a-form-item>
<a-form-item label="医院等级"> <a-form-item label="医院等级">
<a-select placeholder="医院等级" allow-clear @change="changeProvince"> <a-select :value="levelId" placeholder="医院等级" allow-clear @change="changeProvince">
<a-select-option v-for="(item, index) in level" :value="item.levelId" :key="index"> {{ item.name }} </a-select-option> <a-select-option v-for="(item, index) in level" :value="item.levelId" :key="index"> {{ item.name }} </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
@ -92,7 +92,7 @@ export default {
provinceId: '', provinceId: '',
cityId: '', cityId: '',
countyId: '', countyId: '',
id: '' id: '',
}; };
}, },
computed: { ...mapState('home', ['hospitalInfo', 'level', 'area']) }, computed: { ...mapState('home', ['hospitalInfo', 'level', 'area']) },
@ -108,21 +108,15 @@ export default {
// //
async queryHospitalById() { async queryHospitalById() {
try { try {
const params = { const params = { param: { id: this.hospitalInfo.id } };
param: {
id: this.hospitalInfo.id
},
};
const res = await queryHospitalById(params); const res = await queryHospitalById(params);
const { code, msg, data } = res.data; const { code, msg, data } = res.data;
if (code === 200) { if (code === 200) {
this.$message.success('查询成功'); this.$message.success('查询成功');
this.areaId[0] = data.cityId; this.areaId[0] = data.cityId;
this.areaId[1] = data.countyId; this.areaId[1] = data.countyId;
this.cityId = data.cityId;
this.countyId = data.countyId;
this.levelId = data.levelId; this.levelId = data.levelId;
this.name = data.name; this.hospitalName = data.name;
this.visible4 = true; this.visible4 = true;
} else { } else {
this.$message.warning(msg); this.$message.warning(msg);
@ -151,9 +145,7 @@ export default {
this.$emit('getHosList'); this.$emit('getHosList');
this.visible4 = false; this.visible4 = false;
this.cityId = ''; this.cityId = '';
this.countyId = '', (this.countyId = ''), (this.levelId = ''), (this.name = '');
this.levelId = '',
this.name = ''
} else { } else {
this.$message.warning(msg); this.$message.warning(msg);
} }
@ -162,6 +154,8 @@ export default {
} }
}, },
changeArea(e) { changeArea(e) {
console.log('e: ', e);
this.areaId = e;
this.cityId = e[0]; this.cityId = e[0];
this.countyId = e[1]; this.countyId = e[1];
}, },

Loading…
Cancel
Save