Commit d331fbb8 by 胡悦

解决账户类型跳转问题

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