Commit e5cd54be by 胡悦

修改账户详情

1 parent 3f4ca788
......@@ -40,6 +40,11 @@ const accountApi = {
saveStaff(data = {}) {
data.method = 'cn.com.glsx.merchants.staff.saveStaff'
return request(data)
},
// 获取账户类型下产品菜单功能树
accountTypeSearchRequest(data) {
data.method = 'cn.com.glsx.merchants.merchant.accountTypeSearchRequest'
return request(data)
}
}
......
......@@ -89,6 +89,7 @@
</el-button-group>
</div>
<el-tree
style="font-size:13px"
:ref="`tree${index}`"
:data="treeData[index] ? treeData[index].children : []"
show-checkbox
......@@ -295,12 +296,10 @@ export default {
case 'cancelAllTree':
this.$refs[`tree${index}`][0].setCheckedNodes([])
break
// eslint-disable-next-line no-case-declarations
case 'resetTree':
this.responseList.forEach((item, index) => {
if (this.$refs[`tree${index}`][0]) {
this.$refs[`tree${index}`][0].setCheckedKeys(item.idList)
}
})
const list = [].concat(this.responseList[index].menuIdList)
this.$refs[`tree${index}`][0].setCheckedKeys(list)
this.addStyle()
break
// eslint-disable-next-line no-case-declarations
......@@ -456,6 +455,9 @@ export default {
// setCheckedKeys全选的接口,
this.$refs[`tree${idx}`][0].setCheckedKeys(arr.menuIdList)
})
this.$nextTick(() => {
this.addStyle()
})
}
})
}
......
......@@ -30,9 +30,9 @@
:name="item.productName"
>
<el-tree
style="font-size:13px"
:ref="`tree${index}`"
:data="treeData[index] ? treeData[index].children : []"
show-checkbox
:data="treeData[index] ? treeData[index].merchantProTreeResponses : []"
node-key="id"
:props="defaultProps"
default-expand-all
......@@ -55,92 +55,6 @@ import { accountApi } from '@/api/accountManage'
import _ from 'lodash'
export default {
data() {
const data = [
{
id: 1,
label: '一级菜单',
disabled: true,
children: [
{
id: 4,
label: '二级菜单',
disabled: true,
children: [
{
id: 9,
label: '三级功能',
disabled: true,
children: [
// value: '1,2,3|人保,平安,寿险'
{
id: 111,
label: '人保',
disabled: true,
logo: 'function'
},
{
id: 112,
label: '平安',
disabled: true,
logo: 'function'
},
{
id: 113,
label: '寿险',
disabled: true,
logo: 'function'
}
]
},
{
id: 10,
label: '三级功能-1',
disabled: true,
value: null
}
]
}
]
},
{
id: 2,
label: '一级菜单2',
disabled: true,
children: [
{
id: 5,
label: '二级菜单2',
disabled: true,
children: [
// value: '1,2,3|人保,平安,寿险'
{
id: 114,
label: '人保',
disabled: true,
logo: 'function'
},
{
id: 115,
label: '平安',
disabled: true,
logo: 'function'
},
{
id: 116,
label: '寿险',
disabled: true,
logo: 'function'
}
]
},
{
id: 6,
disabled: true,
label: '二级菜单2.0'
}
]
}
]
return {
detailForm: {
requestList: []
......@@ -158,7 +72,8 @@ export default {
mounted() {
if (this.$Common.getParams()) {
this.detailId = this.$Common.getParams().id
this.getById(this.$Common.getParams().id)
this.getById(this.detailId)
this.accountTypeSearchRequest(this.detailId)
}
// this.$root.eventBus.$on('params', params => {
// console.log(params)
......@@ -192,33 +107,43 @@ export default {
requestList: data.responseList,
accountAuth: data.responseList ? data.responseList.map(item => item.productName).join('、') : '无'
}
if (data.responseList && data.responseList.length != 0) {
this.findProductById()
}
}
})
},
findProductById() {
const productId = this.detailForm.requestList.map(item => item.productId)
const params = { productId }
if (this.detailId) params.accountTypeId = this.detailId
accountApi.findProductById(params).then(res => {
accountTypeSearchRequest(id) {
accountApi.accountTypeSearchRequest({ ids: id }).then(res => {
if (res.code == '0') {
const data = _.cloneDeep(res.data)
this.treeData = this.setDisabled(data)
// 编辑
if (this.detailForm.requestList && this.detailForm.requestList.length != 0) {
this.$nextTick(() => {
this.activeName = this.detailForm.requestList[0].productName
this.detailForm.requestList.forEach((item, index) => {
this.$refs[`tree${index}`][0].setCheckedKeys(item.menuIdList)
})
this.addStyle()
})
}
const data = _.cloneDeep(res.data[0].products)
this.treeData = data
this.activeName = res.data[0].products[0].productName
setTimeout(() => {
this.addStyle()
}, 1000 / 60)
}
})
},
// findProductById() {
// const productId = this.detailForm.requestList.map(item => item.productId)
// const params = { productId }
// if (this.detailId) params.accountTypeId = this.detailId
// accountApi.findProductById(params).then(res => {
// if (res.code == '0') {
// const data = _.cloneDeep(res.data)
// console.log(data, '---')
// this.treeData = this.setDisabled(data)
// // 编辑
// if (this.detailForm.requestList && this.detailForm.requestList.length != 0) {
// this.$nextTick(() => {
// this.activeName = this.detailForm.requestList[0].productName
// this.detailForm.requestList.forEach((item, index) => {
// this.$refs[`tree${index}`][0].setCheckedKeys(item.menuIdList)
// })
// this.addStyle()
// })
// }
// }
// })
// },
// 渲染树结构
renderContent(h, v) {
if (v.data.logo == 'functionValue') {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!