Browse Source

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

master
aBin 4 years ago
parent
commit
0c1297c13d
  1. 24
      src/components/RightPage/RightPage.vue
  2. 2
      src/views/Index/Index.vue

24
src/components/RightPage/RightPage.vue

@ -56,7 +56,7 @@
/>
</a-form-item>
<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>
</a-form-item>
@ -69,7 +69,7 @@
</template>
<script>
import { mapState } from 'vuex';
import { queryHospitalInfo, editHospitalInfo, queryHospitalById} from 'config/api';
import { queryHospitalInfo, editHospitalInfo, queryHospitalById } from 'config/api';
import TreeNode from './TreeNode.vue';
export default {
@ -92,10 +92,10 @@ export default {
provinceId: '',
cityId: '',
countyId: '',
id: ''
id: '',
};
},
computed: { ...mapState('home', ['hospitalInfo','level','area']) },
computed: { ...mapState('home', ['hospitalInfo', 'level', 'area']) },
watch: {
hospitalInfo() {
this.getHospitalInfo();
@ -108,21 +108,15 @@ export default {
//
async queryHospitalById() {
try {
const params = {
param: {
id: this.hospitalInfo.id
},
};
const params = { param: { id: this.hospitalInfo.id } };
const res = await queryHospitalById(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.$message.success('查询成功');
this.areaId[0] = data.cityId;
this.areaId[1] = data.countyId;
this.cityId = data.cityId;
this.countyId = data.countyId;
this.levelId = data.levelId;
this.name = data.name;
this.hospitalName = data.name;
this.visible4 = true;
} else {
this.$message.warning(msg);
@ -151,9 +145,7 @@ export default {
this.$emit('getHosList');
this.visible4 = false;
this.cityId = '';
this.countyId = '',
this.levelId = '',
this.name = ''
(this.countyId = ''), (this.levelId = ''), (this.name = '');
} else {
this.$message.warning(msg);
}
@ -162,6 +154,8 @@ export default {
}
},
changeArea(e) {
console.log('e: ', e);
this.areaId = e;
this.cityId = e[0];
this.countyId = e[1];
},

2
src/views/Index/Index.vue

@ -2,7 +2,7 @@
<div class="d-flex flex-row">
<LeftList ref="left-list" @showModal="showModal" />
<AddHospital @showModal="showModal" @getHosList="getHosList" :visible="isShow" :options="options" :level-list="levelList" />
<RightPage class="flex-1" v-if="hospitalInfo && hospitalInfo.name" @getHosList="getHosList"/>
<RightPage class="flex-1" v-if="hospitalInfo && hospitalInfo.name" @getHosList="getHosList" />
</div>
</template>
<script>

Loading…
Cancel
Save