Commit 9c6cd59c by 前端

Merge branch 'v4.38.0' into 'master'

上线合并

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