Commit 9c6cd59c by 前端

Merge branch 'v4.38.0' into 'master'

上线合并

See merge request !5
2 parents e4fa0f7e 5e4e640f
<!-- 账户管理 -->
<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,7 +102,7 @@
<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>
......@@ -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)
// })
......@@ -238,6 +250,7 @@ export default {
console.log(data)
},
btnClick(type, index) {
const cfg = this.$get_session_common_config()
switch (type) {
case 'allTree':
// this.$refs[`tree${index}`][0].setCheckedNodes(this.treeData[index].children)
......@@ -280,8 +293,10 @@ export default {
const { code, data } = res
if (code == '0' && data) {
this.notice.okTips()
// this.$root.close()
window.history.go(-1)
this.$root.close(cfg.axios.accountUrl.slice(-1))
// this.$root.close('*新增账户类型')
// window.history.go(-1)
this.$root.to(cfg.axios.listUrl)
}
})
.catch(err => {
......@@ -317,8 +332,10 @@ export default {
const { code, data } = res
if (code == '0' && data) {
this.notice.okTips()
// this.$root.close()
window.history.go(-1)
// this.$root.close('*新增账户类型')
this.$root.close(cfg.axios.accountUrl.slice(-1))
this.$root.to(cfg.axios.listUrl)
// window.history.go(-1)
}
})
.catch(err => {
......@@ -328,7 +345,11 @@ export default {
})
break
case 'cancel':
window.history.go(-1)
// window.history.go(-1)
this.$root.close(cfg.axios.accountUrl.slice(-1))
// this.$root.close('*新增账户类型')
console.log(cfg.axios.listUrl, '===-------------------===========')
this.$root.to(cfg.axios.listUrl)
// this.$parent.to(['MOCK系统G', '系统设置', '账户管理', '账户类型管理', '账户类型列表'])
break
}
......
......@@ -70,16 +70,17 @@ 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)
this.accountTypeSearchRequest(params.id)
})
},
methods: {
setDisabled(data) {
......@@ -169,7 +170,10 @@ export default {
},
handleClick() {},
cancel() {
window.history.go(-1)
const cfg = this.$get_session_common_config()
// window.history.go(-1)
this.$root.close(cfg.axios.detailUrl.slice(-1))
this.$root.to(cfg.axios.listUrl)
// this.$$parent.close()
}
}
......
......@@ -108,13 +108,21 @@ 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.close('账户类型列表')
this.$root.close(cfg.axios.listUrl.slice(-1))
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.close('账户类型列表')
this.$root.close(cfg.axios.listUrl.slice(-1))
this.$root.to(cfg.axios.accountUrl, {id: scope.id})
break
// eslint-disable-next-line no-case-declarations
case 'delete':
......@@ -146,7 +154,10 @@ 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}`
this.$root.close(cfg.axios.listUrl.slice(-1))
// this.$root.close('账户类型列表')
this.$root.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!