Commit d331fbb8 by 胡悦

解决账户类型跳转问题

1 parent e4fa0f7e
<!-- 账户管理 -->
<template>
<div class="account-add">
<h2>{{accountParams.id ? '编辑' : '新增'}}账户类型</h2>
<h2>{{accountParams && accountParams.id ? '编辑' : '新增'}}账户类型</h2>
<h3 class="info-title">
<span class="info-icon"></span>基本信息
</h3>
......@@ -77,7 +77,7 @@
@click="btnClick('cancelAllTree', index)"
>全部取消</el-button>
<el-button
v-if="$Common.getParams().id"
v-if="accountParams.id"
:size="btn_size"
type="primary"
@click="btnClick('resetTree', index)"
......@@ -102,12 +102,12 @@
<div class="footer-btn">
<el-button
:size="btn_size"
v-if="!$Common.getParams().id"
v-if="!accountParams.id"
@click="btnClick('draft')"
type="primary"
>存草稿</el-button>
<el-button :size="btn_size" @click="btnClick('save')" type="primary">确定</el-button>
<el-button :size="btn_size" @click="btnClick('cancel')" type="primary">取消</el-button>
<!-- <el-button :size="btn_size" @click="btnClick('cancel')" type="primary">取消</el-button> -->
</div>
</div>
</template>
......@@ -128,7 +128,7 @@ export default {
productList: [],
treeData: [],
list: [],
accountParams: {},
accountParams: {id: ''},
defaultChecked: [],
responseList: [],
changeList: [],
......@@ -138,10 +138,22 @@ export default {
}
},
mounted() {
console.log(this.$Common.getParams())
this.accountParams = this.$Common.getParams()
if (this.accountParams.id) this.getById(this.accountParams.id)
this.getProductList()
this.$root.eventBus.$on('params', params => {
console.log(params, '1111')
if (params && params.id) {
this.accountParams.id = params.id
this.getById(params.id)
} else {
this.accountRuleForm = { accounttypeName: '', requestList: [] }
}
// this.accountParams = params
// if (this.accountParams.id) this.getById(this.accountParams.id)
this.getProductList()
})
// console.log(this.$Common.getParams(), )
// this.accountParams = this.$Common.getParams()
// if (this.accountParams.id) this.getById(this.accountParams.id)
// this.getProductList()
// this.$root.eventBus.$on('params', params => {
// console.log(params)
// })
......@@ -280,8 +292,8 @@ export default {
const { code, data } = res
if (code == '0' && data) {
this.notice.okTips()
// this.$root.close()
window.history.go(-1)
this.$root.close()
// window.history.go(-1)
}
})
.catch(err => {
......@@ -317,8 +329,8 @@ export default {
const { code, data } = res
if (code == '0' && data) {
this.notice.okTips()
// this.$root.close()
window.history.go(-1)
this.$root.close()
// window.history.go(-1)
}
})
.catch(err => {
......
......@@ -70,16 +70,16 @@ export default {
}
},
mounted() {
if (this.$Common.getParams()) {
this.detailId = this.$Common.getParams().id
this.getById(this.detailId)
this.accountTypeSearchRequest(this.detailId)
}
// this.$root.eventBus.$on('params', params => {
// console.log(params)
// this.detailId = params.id
// this.getById(params.id)
// })
// if (this.$Common.getParams()) {
// this.detailId = this.$Common.getParams().id
// this.getById(this.detailId)
// this.accountTypeSearchRequest(this.detailId)
// }
this.$root.eventBus.$on('params', params => {
console.log(params)
this.detailId = params.id
this.getById(params.id)
})
},
methods: {
setDisabled(data) {
......
......@@ -108,13 +108,17 @@ export default {
},
methods: {
btnClick(type, scope) {
const cfg = this.$get_session_common_config()
console.log(cfg)
switch (type) {
case 'create':
console.log('create')
window.location.href = `./add.html`
// window.location.href = `./add.html`
this.$root.to(cfg.axios.accountUrl, {id: ''})
break
case 'edit':
window.location.href = `./add.html?id=${scope.id}`
// window.location.href = `./add.html?id=${scope.id}`
this.$root.to(cfg.axios.accountUrl, {id: scope.id})
break
// eslint-disable-next-line no-case-declarations
case 'delete':
......@@ -146,7 +150,9 @@ export default {
this.$Common.confirmDialog(tipData)
break
case 'detail':
window.location.href = `./detail.html?id=${scope.id}`
// window.location.href = `./detail.html?id=${scope.id}`
console.log(cfg.axios.detailUrl, '==============-------------')
this.$parent.to(cfg.axios.detailUrl, {id: scope.id})
break
}
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!