Commit 8f329008 by cwq0219
2 parents aea021e3 db606fa7
......@@ -326,7 +326,7 @@ export default {
// this.$root.close()
window.history.go(-1)
} else {
this.notice.errorTips()
this.notice.errorTips(res.message)
}
})
} else {
......@@ -428,12 +428,15 @@ export default {
accountApi.getById({ id }).then(res => {
const { code, data } = res
if (code == '0') {
const requestList = data.responseList.map(item => {
return {
dictValue: item.productId,
dictLabel: item.productName
}
})
let requestList = []
if (data.responseList && data.responseList.length != 0) {
requestList = data.responseList.map(item => {
return {
dictValue: item.productId,
dictLabel: item.productName
}
})
}
this.responseList = data.responseList
this.accountRuleForm = {
accounttypeName: data.accounttypeName,
......
......@@ -17,7 +17,7 @@
</el-form>
<h3 class="content-title">功能权限</h3>
<el-tabs
v-if="detailForm.requestList.length != 0"
v-if="detailForm.requestList && detailForm.requestList.length != 0"
v-show="activeName"
v-model="activeName"
@tab-click="handleClick"
......@@ -183,36 +183,31 @@ export default {
},
getById(id) {
accountApi.getById({ id }).then(res => {
console.log(res)
const { code, data } = res
if (code == '0') {
console.log()
// const accountAuth = data.responseList
this.detailForm = {
accounttypeName: data.accounttypeName,
accounttypeDetail: data.accounttypeDetail || '无',
accounttypeCode: data.accounttypeCode,
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() {
const productId = this.detailForm.requestList.map(item => item.productId)
const params = { productId }
// { productId, accountTypeId: 1 }
if (this.detailId) params.accountTypeId = this.detailId
accountApi.findProductById(params).then(res => {
if (res.code == '0') {
const data = _.cloneDeep(res.data)
console.log(data, '=========')
// const data = _.cloneDeep(data)
console.log('disabled', 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.activeName = this.detailForm.requestList[0].productName
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!