Commit e5cd54be by 胡悦

修改账户详情

1 parent 3f4ca788
...@@ -40,6 +40,11 @@ const accountApi = { ...@@ -40,6 +40,11 @@ const accountApi = {
saveStaff(data = {}) { saveStaff(data = {}) {
data.method = 'cn.com.glsx.merchants.staff.saveStaff' data.method = 'cn.com.glsx.merchants.staff.saveStaff'
return request(data) return request(data)
},
// 获取账户类型下产品菜单功能树
accountTypeSearchRequest(data) {
data.method = 'cn.com.glsx.merchants.merchant.accountTypeSearchRequest'
return request(data)
} }
} }
......
...@@ -89,6 +89,7 @@ ...@@ -89,6 +89,7 @@
</el-button-group> </el-button-group>
</div> </div>
<el-tree <el-tree
style="font-size:13px"
:ref="`tree${index}`" :ref="`tree${index}`"
:data="treeData[index] ? treeData[index].children : []" :data="treeData[index] ? treeData[index].children : []"
show-checkbox show-checkbox
...@@ -295,12 +296,10 @@ export default { ...@@ -295,12 +296,10 @@ export default {
case 'cancelAllTree': case 'cancelAllTree':
this.$refs[`tree${index}`][0].setCheckedNodes([]) this.$refs[`tree${index}`][0].setCheckedNodes([])
break break
// eslint-disable-next-line no-case-declarations
case 'resetTree': case 'resetTree':
this.responseList.forEach((item, index) => { const list = [].concat(this.responseList[index].menuIdList)
if (this.$refs[`tree${index}`][0]) { this.$refs[`tree${index}`][0].setCheckedKeys(list)
this.$refs[`tree${index}`][0].setCheckedKeys(item.idList)
}
})
this.addStyle() this.addStyle()
break break
// eslint-disable-next-line no-case-declarations // eslint-disable-next-line no-case-declarations
...@@ -456,6 +455,9 @@ export default { ...@@ -456,6 +455,9 @@ export default {
// setCheckedKeys全选的接口, // setCheckedKeys全选的接口,
this.$refs[`tree${idx}`][0].setCheckedKeys(arr.menuIdList) this.$refs[`tree${idx}`][0].setCheckedKeys(arr.menuIdList)
}) })
this.$nextTick(() => {
this.addStyle()
})
} }
}) })
} }
......
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
:name="item.productName" :name="item.productName"
> >
<el-tree <el-tree
style="font-size:13px"
:ref="`tree${index}`" :ref="`tree${index}`"
:data="treeData[index] ? treeData[index].children : []" :data="treeData[index] ? treeData[index].merchantProTreeResponses : []"
show-checkbox
node-key="id" node-key="id"
:props="defaultProps" :props="defaultProps"
default-expand-all default-expand-all
...@@ -55,92 +55,6 @@ import { accountApi } from '@/api/accountManage' ...@@ -55,92 +55,6 @@ import { accountApi } from '@/api/accountManage'
import _ from 'lodash' import _ from 'lodash'
export default { export default {
data() { 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 { return {
detailForm: { detailForm: {
requestList: [] requestList: []
...@@ -158,7 +72,8 @@ export default { ...@@ -158,7 +72,8 @@ 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.$Common.getParams().id) this.getById(this.detailId)
this.accountTypeSearchRequest(this.detailId)
} }
// this.$root.eventBus.$on('params', params => { // this.$root.eventBus.$on('params', params => {
// console.log(params) // console.log(params)
...@@ -192,33 +107,43 @@ export default { ...@@ -192,33 +107,43 @@ export default {
requestList: data.responseList, requestList: data.responseList,
accountAuth: data.responseList ? 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()
}
} }
}) })
}, },
findProductById() { accountTypeSearchRequest(id) {
const productId = this.detailForm.requestList.map(item => item.productId) accountApi.accountTypeSearchRequest({ ids: id }).then(res => {
const params = { productId }
if (this.detailId) params.accountTypeId = this.detailId
accountApi.findProductById(params).then(res => {
if (res.code == '0') { if (res.code == '0') {
const data = _.cloneDeep(res.data) const data = _.cloneDeep(res.data[0].products)
this.treeData = this.setDisabled(data) this.treeData = data
// 编辑 this.activeName = res.data[0].products[0].productName
if (this.detailForm.requestList && this.detailForm.requestList.length != 0) { setTimeout(() => {
this.$nextTick(() => { this.addStyle()
this.activeName = this.detailForm.requestList[0].productName }, 1000 / 60)
this.detailForm.requestList.forEach((item, index) => {
this.$refs[`tree${index}`][0].setCheckedKeys(item.menuIdList)
})
this.addStyle()
})
}
} }
}) })
}, },
// 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) { renderContent(h, v) {
if (v.data.logo == 'functionValue') { 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!