Commit 42a05070 authored by 何鹏程's avatar 何鹏程

修改bug

parent bd8c8f4a
...@@ -20,11 +20,31 @@ ...@@ -20,11 +20,31 @@
label="单位全称:" label="单位全称:"
prop="hospitalName" prop="hospitalName"
> >
<el-input <!-- <el-input
placeholder="请输入单位全称" placeholder="请输入单位全称"
v-model="dataForm.hospitalName" v-model="dataForm.hospitalName"
@blur="blurHandle" @blur="blurHandle"
/> /> -->
<el-select
v-model="dataForm.hospitalName"
placeholder="请选择单位全称"
style="width: 100%"
filterable
allow-create
default-first-option
remote
:loading="selectLoading"
:remote-method="remoteMethod"
@change="changeHandle"
:clearable="true"
>
<el-option
v-for="item in hospitalList"
:label="item.hospitalName"
:key="item.id"
:value="item.hospitalName"
/>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
...@@ -170,7 +190,10 @@ export default { ...@@ -170,7 +190,10 @@ export default {
return { return {
dialogVisible: true, dialogVisible: true,
loading: false, loading: false,
hospitalList: [],
selectLoading: false,
areaList: [], areaList: [],
hospitalList: [],
dataForm: { dataForm: {
hospitalStep: '', hospitalStep: '',
area: '', area: '',
...@@ -232,18 +255,23 @@ export default { ...@@ -232,18 +255,23 @@ export default {
} }
}) })
}, },
blurHandle() { remoteMethod(query) {
if (!this.dataForm.hospitalName) { if (!query) {
this.hospitalList = []
return return
} }
queryHospitalByName(this.dataForm.hospitalName).then(res => { this.selectLoading = true;
if (res.respData) { queryHospitalByName(query).then(res => {
this.dataForm.hospitalStep = res.respData.hospitalStep this.hospitalList = res.respData
this.dataForm.area = res.respData.area this.selectLoading = false;
// this.dataForm.unitType = res.respData.unitType
}
}) })
},
changeHandle(val) {
const item = this.hospitalList.find(i => i.hospitalName == val)
console.log(item)
this.dataForm.hospitalStep = item ? item.hospitalStep : ''
this.dataForm.area = item ? item.area : ''
this.dataForm.unitType = item ? item.unitType : ''
} }
} }
} }
......
...@@ -51,7 +51,7 @@ router.beforeEach((to, from, next) => { ...@@ -51,7 +51,7 @@ router.beforeEach((to, from, next) => {
staticRouteLength += item.children.length staticRouteLength += item.children.length
} }
}) })
if (routers.length === staticRouteLength) { if (routers.length === staticRouteLength && menu) {
router.addRoutes(routeHandle(menu)) router.addRoutes(routeHandle(menu))
next({ next({
...to, ...to,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment