Commit 6790bacf by cwq0219
2 parents a33563e7 662355ef
...@@ -17,7 +17,7 @@ import { routes } from '@/router' ...@@ -17,7 +17,7 @@ import { routes } from '@/router'
export async function start() { export async function start() {
if (window.__POWERED_BY_QIANKUN__) return if (window.__POWERED_BY_QIANKUN__) return
const { response, request, sign, secret } = await fetchConfig() const { response, request, sign, secret } = await fetchConfig()
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { TGT: 'scrm-base-57a2c9a4-42bd-4821-8af0-02e98a473594-rop' } }) Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { TGT: 'scrm-base-61a28f77-294f-4510-aa1c-6a35cff86f25-rop' } })
Vue.use(GLButton, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] }) Vue.use(GLButton, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
render('/', routes) render('/', routes)
} }
\ No newline at end of file \ No newline at end of file
...@@ -139,6 +139,7 @@ export default { ...@@ -139,6 +139,7 @@ export default {
}; };
}); });
this.tabName = this.tabMenu[0].accounttypeId; this.tabName = this.tabMenu[0].accounttypeId;
return this.tabMenu
}, },
// 获取当前的所有权限 // 获取当前的所有权限
async accountTypeSearchRequest(params,status) { async accountTypeSearchRequest(params,status) {
...@@ -171,6 +172,7 @@ export default { ...@@ -171,6 +172,7 @@ export default {
}); });
this.tabName = this.tabMenu[0].accounttypeId; this.tabName = this.tabMenu[0].accounttypeId;
this.findPermissionsByMerId(params.merchantId?params.merchantId:params.id); this.findPermissionsByMerId(params.merchantId?params.merchantId:params.id);
return this.tabMenu
}, },
// 获取已选择的权限 // 获取已选择的权限
findPermissionsByMerId(id) { findPermissionsByMerId(id) {
......
...@@ -45,19 +45,18 @@ export default { ...@@ -45,19 +45,18 @@ export default {
}, },
created() { created() {
//this.$globalState.accountLevel //this.$globalState.accountLevel
// const { session } = this.$globalState const { session } = this.$globalState
// this.platform = session.merchantModel this.platform = session.merchantModel
// this.loginInfo = session this.loginInfo = session
// this.accountLevel = session.accountLevel this.accountLevel = session.accountLevel
this.getBlocData() this.getBlocData()
}, },
methods: { methods: {
getBlocData() { getBlocData() {
// let para = { let para = {
// merchantId: this.loginInfo.merchantId, merchantId: this.loginInfo.merchantId,
// sessionId: this.loginInfo.sessionId }
// } this.$apis.baseInfo.merchantInfo(para).then(res => {
this.$apis.baseInfo.merchantInfo({}).then(res => {
this.blocInfo = res this.blocInfo = res
this.storesList = res.stores.map(item => { this.storesList = res.stores.map(item => {
item.date = `${this.dateFormat(item.starttime, 'YYYY.MM.DD')}--${this.dateFormat(item.endtime, 'YYYY.MM.DD')}` item.date = `${this.dateFormat(item.starttime, 'YYYY.MM.DD')}--${this.dateFormat(item.endtime, 'YYYY.MM.DD')}`
......
...@@ -126,12 +126,12 @@ export default { ...@@ -126,12 +126,12 @@ export default {
}, },
getDepartmentList() { getDepartmentList() {
this.$apis.baseInfo.getDepartment({ id: 1 }).then(res => { this.$apis.baseInfo.getDepartment({ id: 1 }).then(res => {
this.departmentList = this.traverse(res, 'relevanceMerchant') this.departmentList = this.traverse(1,res, 'relevanceMerchant')
}) })
}, },
getMerchantList() { getMerchantList() {
this.$apis.baseInfo.getMerchantTree({}).then(res => { this.$apis.baseInfo.getMerchantTree({}).then(res => {
this.shopList = this.traverse(res, 'entmicroName', 'merchantAccountLevel') this.shopList = this.traverse(2,res, 'entmicroName', 'merchantAccountLevel')
}) })
}, },
// 关联当前选择的 // 关联当前选择的
...@@ -255,15 +255,15 @@ export default { ...@@ -255,15 +255,15 @@ export default {
}) })
}, },
// 递归:处理层级数组 // 递归:处理层级数组
traverse(arr, string1, string2, arr1 = []) { traverse(type,arr, string1, string2, arr1 = []) {
arr.map(item => { arr.map(item => {
if (item[string1] || item[string2] != 4) { if (item[string1] || (item[string2] != 4&&type==2)) {
item.disabled = true item.disabled = true
} else { } else {
item.disabled = false item.disabled = false
} }
if (item.children && item.children instanceof Array) { if (item.children && item.children instanceof Array) {
this.traverse(item.children, string1, string2, (arr1 = [])) this.traverse(type,item.children, string1, string2, (arr1 = []))
} }
return arr1.push(item) return arr1.push(item)
}) })
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
<SelectProduct ref="productFrom" :roleType="true" :parentId="41712" :accountlevel="2" :pId="41713"></SelectProduct> <SelectProduct ref="productFrom" :roleType="true" title=""></SelectProduct>
</div> </div>
<div style="height: 84px"></div> <div style="height: 84px"></div>
<div class="fixed_bottom"> <div class="fixed_bottom">
...@@ -72,21 +72,24 @@ export default { ...@@ -72,21 +72,24 @@ export default {
//商户 //商户
list: [], list: [],
// tree数据 // tree数据
treeDataList: [] treeDataList: [],
accountLevel: 1
} }
}, },
created() { created() {
let id = Number(this.$route.params.id); let id = Number(this.$route.params.id)
if (!id) { if (!id) {
this.pageName = '新增角色' this.pageName = '新增角色'
this.pageType ='create' this.pageType = 'create'
this.getMerchantName() this.getMerchantName()
} else { } else {
this.pageName = '修改角色' this.pageName = '修改角色'
this.pageType ='edit' this.pageType = 'edit'
this.getRoleData(id) this.getRoleData(id)
this.editId = id this.editId = id
} }
const { session } = this.$globalState
this.accountLevel = session.accountLevel
}, },
methods: { methods: {
// 获取角色信息 // 获取角色信息
...@@ -97,9 +100,10 @@ export default { ...@@ -97,9 +100,10 @@ export default {
merchantName: res.merchantName, merchantName: res.merchantName,
roleName: res.roleName, roleName: res.roleName,
roleDesc: res.roleDescription, roleDesc: res.roleDescription,
merchantId:res.merchantId merchantId: res.merchantId
} }
this.getMerchantTree(id, res.responseList) this.getMerchantTree(id, res.responseList)
this.$refs.productFrom.accountTypeSearchRequest({id:res.merchantId }, 'edit')
}) })
}, },
// 获取商户树 // 获取商户树
...@@ -133,13 +137,12 @@ export default { ...@@ -133,13 +137,12 @@ export default {
} }
}, },
// 选择商户----获取权限 // 选择商户----获取权限
selectMerchant(id) { async selectMerchant(id) {
this.$apis.role.merchantRootById({ id }).then(res => { let res = await this.$refs.productFrom.accountTypeSearchRequest({ id }, 'create')
this.accountList = res.map(item => { this.accountList = res.map(item => {
item.select = false item.select = true
return item return item
}) })
})
}, },
// 选择商户权限 // 选择商户权限
selectCurAccount(item, index) { selectCurAccount(item, index) {
...@@ -155,21 +158,20 @@ export default { ...@@ -155,21 +158,20 @@ export default {
} }
}, },
// 确定按钮---处理参数---提交数据---创建为0---草稿为1 // 确定按钮---处理参数---提交数据---创建为0---草稿为1
toCreateRole(delFlag) { toCreateRole(delFlag) {
let { merchantId, roleDesc, roleName } = this.ruleForm let { merchantId, roleDesc, roleName } = this.ruleForm
if(!merchantId){ if (!merchantId) {
this.$message.error("请选择所属商户"); this.$message.error('请选择所属商户')
return return
} }
if(!roleName){ if (!roleName) {
this.$message.error("请输入角色名称"); this.$message.error('请输入角色名称')
return return
} }
if (this.$refs.productFrom.getSelectInfo().length == 0) { if (this.$refs.productFrom.getSelectInfo().length == 0) {
this.$message.error("请选择产品"); this.$message.error('请选择产品')
return; return
} }
let accountTypes = JSON.stringify(this.$refs.productFrom.getSelectInfo()) let accountTypes = JSON.stringify(this.$refs.productFrom.getSelectInfo())
let para = { let para = {
...@@ -177,12 +179,12 @@ export default { ...@@ -177,12 +179,12 @@ export default {
roleName: roleName, roleName: roleName,
roleDescription: roleDesc, roleDescription: roleDesc,
delFlag, delFlag,
requestList: accountTypes, requestList: accountTypes
} }
if(this.pageType=='edit'){ if (this.pageType == 'edit') {
para.id = this.editId para.id = this.editId
this.updateRole(para) this.updateRole(para)
}else{ } else {
this.insertRole(para) this.insertRole(para)
} }
}, },
...@@ -201,7 +203,7 @@ export default { ...@@ -201,7 +203,7 @@ export default {
}) })
}, },
toBack() { toBack() {
this.$router.push("/role/index"); this.$router.push('/role/index')
} }
} }
} }
...@@ -243,6 +245,7 @@ export default { ...@@ -243,6 +245,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
z-index: 20;
.wrap_driver { .wrap_driver {
margin: 0 40px; margin: 0 40px;
} }
...@@ -255,5 +258,4 @@ export default { ...@@ -255,5 +258,4 @@ export default {
margin-right: 15px; margin-right: 15px;
} }
} }
</style> </style>
...@@ -105,9 +105,8 @@ export default { ...@@ -105,9 +105,8 @@ export default {
} }
}, },
created() { created() {
// const { session } = this.$globalState const { session } = this.$globalState
// let accountLevel = session.accountLevel let accountLevel = session.accountLevel
let accountLevel = 1
if (accountLevel != 4) { if (accountLevel != 4) {
this.tableParams.tableColumns.splice(2, 0, { label: '所属商户名', prop: 'merchantName' }) this.tableParams.tableColumns.splice(2, 0, { label: '所属商户名', prop: 'merchantName' })
this.getMerchantName() this.getMerchantName()
...@@ -138,7 +137,7 @@ export default { ...@@ -138,7 +137,7 @@ export default {
this.$apis.role.roleDataList(para).then(res => { this.$apis.role.roleDataList(para).then(res => {
this.tableData = res.data this.tableData = res.data
this.tableTotal = res.count this.tableTotal = res.count
if (!res.data.length) { if (!res.data.length || !res) {
this.$refs.table.setTableHeightFun() this.$refs.table.setTableHeightFun()
} }
// this.$nextTick(() => { // this.$nextTick(() => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!