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

监听路由的变化

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