Commit d976f4e1 by 胡悦

提交代码

1 parent 9f0b4bde
...@@ -326,7 +326,7 @@ export default { ...@@ -326,7 +326,7 @@ export default {
// this.$root.close() // this.$root.close()
window.history.go(-1) window.history.go(-1)
} else { } else {
this.notice.errorTips() this.notice.errorTips(res.message)
} }
}) })
} else { } else {
...@@ -428,12 +428,15 @@ export default { ...@@ -428,12 +428,15 @@ export default {
accountApi.getById({ id }).then(res => { accountApi.getById({ id }).then(res => {
const { code, data } = res const { code, data } = res
if (code == '0') { if (code == '0') {
const requestList = data.responseList.map(item => { let requestList = []
if (data.responseList && data.responseList.length != 0) {
requestList = data.responseList.map(item => {
return { return {
dictValue: item.productId, dictValue: item.productId,
dictLabel: item.productName dictLabel: item.productName
} }
}) })
}
this.responseList = data.responseList this.responseList = data.responseList
this.accountRuleForm = { this.accountRuleForm = {
accounttypeName: data.accounttypeName, accounttypeName: data.accounttypeName,
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</el-form> </el-form>
<h3 class="content-title">功能权限</h3> <h3 class="content-title">功能权限</h3>
<el-tabs <el-tabs
v-if="detailForm.requestList.length != 0" v-if="detailForm.requestList && detailForm.requestList.length != 0"
v-show="activeName" v-show="activeName"
v-model="activeName" v-model="activeName"
@tab-click="handleClick" @tab-click="handleClick"
...@@ -183,36 +183,31 @@ export default { ...@@ -183,36 +183,31 @@ export default {
}, },
getById(id) { getById(id) {
accountApi.getById({ id }).then(res => { accountApi.getById({ id }).then(res => {
console.log(res)
const { code, data } = res const { code, data } = res
if (code == '0') { if (code == '0') {
console.log()
// const accountAuth = data.responseList
this.detailForm = { this.detailForm = {
accounttypeName: data.accounttypeName, accounttypeName: data.accounttypeName,
accounttypeDetail: data.accounttypeDetail || '无', accounttypeDetail: data.accounttypeDetail || '无',
accounttypeCode: data.accounttypeCode, accounttypeCode: data.accounttypeCode,
requestList: data.responseList, requestList: data.responseList,
accountAuth: data.responseList.map(item => item.productName).join('、') accountAuth: data.responseList ? data.responseList.map(item => item.productName).join('、') : '无'
} }
if (data.responseList && data.responseList.length != 0) {
this.findProductById() this.findProductById()
} }
}
}) })
}, },
findProductById() { findProductById() {
const productId = this.detailForm.requestList.map(item => item.productId) const productId = this.detailForm.requestList.map(item => item.productId)
const params = { productId } const params = { productId }
// { productId, accountTypeId: 1 }
if (this.detailId) params.accountTypeId = this.detailId if (this.detailId) params.accountTypeId = this.detailId
accountApi.findProductById(params).then(res => { accountApi.findProductById(params).then(res => {
if (res.code == '0') { if (res.code == '0') {
const data = _.cloneDeep(res.data) const data = _.cloneDeep(res.data)
console.log(data, '=========')
// const data = _.cloneDeep(data)
console.log('disabled', this.setDisabled(data))
this.treeData = this.setDisabled(data) this.treeData = this.setDisabled(data)
// 编辑 // 编辑
if (this.detailForm.requestList.length != 0) { if (this.detailForm.requestList && this.detailForm.requestList.length != 0) {
this.$nextTick(() => { this.$nextTick(() => {
this.activeName = this.detailForm.requestList[0].productName this.activeName = this.detailForm.requestList[0].productName
this.detailForm.requestList.forEach((item, index) => { this.detailForm.requestList.forEach((item, index) => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!