提交 8ace9a43 编写于 作者: changdi.hao's avatar changdi.hao

监听路由的变化

上级 0452fc59
...@@ -14,6 +14,7 @@ const downList = r => require.ensure([], () => r(require('../views/IM/diagnosis- ...@@ -14,6 +14,7 @@ const downList = r => require.ensure([], () => r(require('../views/IM/diagnosis-
export default [{ export default [{
path: '/', path: '/',
component: App, component: App,
mode: 'history',
children: [ children: [
{ {
path: '', path: '',
...@@ -45,7 +46,6 @@ export default [{ ...@@ -45,7 +46,6 @@ export default [{
}, { }, {
path: '/diagnosis-list-new', path: '/diagnosis-list-new',
component: diagnosisListNew component: diagnosisListNew
}, { }, {
path: '/down-list', path: '/down-list',
component: downList component: downList
......
...@@ -323,7 +323,7 @@ export const RUN_TAB_LIST = [ ...@@ -323,7 +323,7 @@ export const RUN_TAB_LIST = [
export const TRIAGE_TAB_LIST = [ export const TRIAGE_TAB_LIST = [
{ {
label: '全部', label: '全部',
active: '1' active: '99'
}, },
{ {
label: '待诊断', label: '待诊断',
...@@ -335,7 +335,7 @@ export const TRIAGE_TAB_LIST = [ ...@@ -335,7 +335,7 @@ export const TRIAGE_TAB_LIST = [
export const RECEPTION_TAB_LIST = [ export const RECEPTION_TAB_LIST = [
{ {
label: '全部', label: '全部',
active: '1' active: '99'
}, },
{ {
label: '待匹配医生', label: '待匹配医生',
......
...@@ -235,7 +235,6 @@ ...@@ -235,7 +235,6 @@
</template> </template>
<script> <script>
import {updateDiagnosis} from "../../../utils/diagnosis"; import {updateDiagnosis} from "../../../utils/diagnosis";
let vm = null;
const DOWN_URL= '/diagnose/admin/diagnose/export'; const DOWN_URL= '/diagnose/admin/diagnose/export';
const LIST_URL= '/diagnose/admin/diagnose/list'; const LIST_URL= '/diagnose/admin/diagnose/list';
const DEP_URL= '/hospital/departments/0' const DEP_URL= '/hospital/departments/0'
...@@ -335,17 +334,30 @@ export default { ...@@ -335,17 +334,30 @@ export default {
activated() { activated() {
this.search(); this.search();
}, },
watch: {
'$route': {
handler(newVal, oldVal) {
// this.getview(newVal, oldVal)
if (newVal) {
this.init()
}
},
deep: true,
immediate: true,
}
},
created() { created() {
vm = this;
this.fromType = +(this.$route.query.fromType || 1);
this.setTable();
this.getDep() this.getDep()
}, },
mounted() { mounted() {
this.setTableHeight(); this.setTableHeight();
this.search();
}, },
methods: { methods: {
init(){
this.fromType = +(this.$route.query.fromType || 1);
this.setTable();
this.search();
},
// 不同也main切换不同的tab // 不同也main切换不同的tab
setTable() { setTable() {
let tabs = ALL_TAB_LIST; let tabs = ALL_TAB_LIST;
...@@ -372,6 +384,7 @@ export default { ...@@ -372,6 +384,7 @@ export default {
break; break;
} }
this.tabpaneList = tabs; this.tabpaneList = tabs;
this.activeName = "99";
}, },
// 设置table的高度 // 设置table的高度
setTableHeight() { setTableHeight() {
...@@ -522,13 +535,13 @@ export default { ...@@ -522,13 +535,13 @@ export default {
} }
updateDiagnosis(req).then(function (res) { updateDiagnosis(req).then(function (res) {
if (res.code == "000000") { if (res.code == "000000") {
// vm.cancel(); // this.cancel();
vm.search(); this.search();
} else { } else {
vm.$message.error(res.message); this.$message.error(res.message);
} }
}).catch(function (error) { }).catch(function (error) {
vm.$message.error(error); this.$message.error(error);
}); });
}) })
...@@ -587,13 +600,13 @@ export default { ...@@ -587,13 +600,13 @@ export default {
} }
updateDiagnosis(req).then(function (res) { updateDiagnosis(req).then(function (res) {
if (res.code == "000000") { if (res.code == "000000") {
// vm.cancel(); // this.cancel();
vm.search(); this.search();
} else { } else {
vm.$message.error(res.message); this.$message.error(res.message);
} }
}).catch(function (error) { }).catch(function (error) {
vm.$message.error(error); this.$message.error(error);
}); });
}) })
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册