修改仓库数据范围报错
This commit is contained in:
@@ -6,6 +6,8 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 仓库管理对象 bas_warehouse
|
* 仓库管理对象 bas_warehouse
|
||||||
*
|
*
|
||||||
@@ -55,6 +57,10 @@ public class BasWarehouse extends BaseEntity
|
|||||||
@Excel(name = "是否可用", readConverterExp = "不=允许为空")
|
@Excel(name = "是否可用", readConverterExp = "不=允许为空")
|
||||||
private String isCurrent;
|
private String isCurrent;
|
||||||
|
|
||||||
|
/*仓库数据权限*/
|
||||||
|
private List<String> dataScope;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
// public String toString() {
|
// public String toString() {
|
||||||
|
|||||||
@@ -1,13 +1,22 @@
|
|||||||
package com.ruoyi.bas.warehouse.service.impl;
|
package com.ruoyi.bas.warehouse.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.ruoyi.bas.warehouse.domain.BasWarehouse;
|
import com.ruoyi.bas.warehouse.domain.BasWarehouse;
|
||||||
import com.ruoyi.bas.warehouse.mapper.BasWarehouseMapper;
|
import com.ruoyi.bas.warehouse.mapper.BasWarehouseMapper;
|
||||||
import com.ruoyi.bas.warehouse.service.IBasWarehouseService;
|
import com.ruoyi.bas.warehouse.service.IBasWarehouseService;
|
||||||
|
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||||
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
|
import com.ruoyi.system.mapper.SysUserRoleMapper;
|
||||||
|
import com.ruoyi.system.service.ISysRoleService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 仓库管理Service业务层处理
|
* 仓库管理Service业务层处理
|
||||||
@@ -20,6 +29,8 @@ public class BasWarehouseServiceImpl implements IBasWarehouseService
|
|||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
private BasWarehouseMapper basWarehouseMapper;
|
private BasWarehouseMapper basWarehouseMapper;
|
||||||
|
@Autowired
|
||||||
|
private ISysRoleService sysRoleService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询仓库管理
|
* 查询仓库管理
|
||||||
@@ -42,7 +53,19 @@ public class BasWarehouseServiceImpl implements IBasWarehouseService
|
|||||||
@Override
|
@Override
|
||||||
public List<BasWarehouse> selectBasWarehouseList(BasWarehouse basWarehouse)
|
public List<BasWarehouse> selectBasWarehouseList(BasWarehouse basWarehouse)
|
||||||
{
|
{
|
||||||
return basWarehouseMapper.selectBasWarehouseList(basWarehouse);
|
List<SysRole> roles = sysRoleService.selectRolesByUserId(SecurityUtils.getUserId());
|
||||||
|
if (roles.stream().anyMatch(SysRole::isAdmin)){
|
||||||
|
return basWarehouseMapper.selectBasWarehouseList(basWarehouse);
|
||||||
|
}else {
|
||||||
|
List<String> dateScope =new ArrayList<>();
|
||||||
|
for (SysRole role : roles) {
|
||||||
|
if (CollUtil.isNotEmpty(role.getWarehouseDataScope())){
|
||||||
|
dateScope.addAll(role.getWarehouseDataScope());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
basWarehouse.setDataScope(dateScope);
|
||||||
|
return basWarehouseMapper.selectBasWarehouseList(basWarehouse);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -32,6 +32,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="warehouseKind != null and warehouseKind != ''"> and warehouse_kind = #{warehouseKind}</if>
|
<if test="warehouseKind != null and warehouseKind != ''"> and warehouse_kind = #{warehouseKind}</if>
|
||||||
<if test="warehouseType != null and warehouseType != ''"> and warehouse_type = #{warehouseType}</if>
|
<if test="warehouseType != null and warehouseType != ''"> and warehouse_type = #{warehouseType}</if>
|
||||||
<if test="isCurrent != null and isCurrent != ''"> and is_current = #{isCurrent}</if>
|
<if test="isCurrent != null and isCurrent != ''"> and is_current = #{isCurrent}</if>
|
||||||
|
<if test="dataScope !=null and dataScope.size()>0">
|
||||||
|
and warehouse_id in
|
||||||
|
<foreach item="item" index="index" collection="dataScope" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.common.core.domain.entity;
|
package com.ruoyi.common.core.domain.entity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
@@ -69,6 +70,20 @@ public class SysRole extends BaseEntity
|
|||||||
|
|
||||||
/** 角色菜单权限 */
|
/** 角色菜单权限 */
|
||||||
private Set<String> permissions;
|
private Set<String> permissions;
|
||||||
|
/** 仓库权限 */
|
||||||
|
private List<String> warehouseDataScope;
|
||||||
|
|
||||||
|
public List<String> getWarehouseDataScope() {
|
||||||
|
return warehouseDataScope;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWarehouseDataScope(List<String> warehouseDataScope) {
|
||||||
|
this.warehouseDataScope = warehouseDataScope;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAdmin(boolean admin) {
|
||||||
|
this.admin = admin;
|
||||||
|
}
|
||||||
|
|
||||||
private boolean admin;
|
private boolean admin;
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ package com.ruoyi.framework.aspectj;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import org.aspectj.lang.JoinPoint;
|
import org.aspectj.lang.JoinPoint;
|
||||||
import org.aspectj.lang.annotation.Aspect;
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
import org.aspectj.lang.annotation.Before;
|
import org.aspectj.lang.annotation.Before;
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色和菜单关联 sys_role_menu
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class SysRoleWarehouse
|
||||||
|
{
|
||||||
|
/** 角色ID */
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long roleId;
|
||||||
|
|
||||||
|
/** 仓库ID */
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private String warehouseId;
|
||||||
|
|
||||||
|
public Long getRoleId()
|
||||||
|
{
|
||||||
|
return roleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoleId(Long roleId)
|
||||||
|
{
|
||||||
|
this.roleId = roleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWarehouseId() {
|
||||||
|
return warehouseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWarehouseId(String warehouseId) {
|
||||||
|
this.warehouseId = warehouseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("roleId", getRoleId())
|
||||||
|
.append("warehouseId", getWarehouseId())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.system.domain.SysRoleMenu;
|
||||||
|
import com.ruoyi.system.domain.SysRoleWarehouse;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface SysRoleWarehouseMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量新增角色仓库信息
|
||||||
|
*
|
||||||
|
* @param roleWarehouseList 角色菜单列表
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int batchRoleWarehouse(List<SysRoleWarehouse> roleWarehouseList);
|
||||||
|
|
||||||
|
List<String> selectRoleWarehouseByRoleId(Long roleId);
|
||||||
|
|
||||||
|
void deleteRoleWarehouseByRoleId(Long roleId);
|
||||||
|
}
|
||||||
@@ -6,7 +6,10 @@ import java.util.HashSet;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.ruoyi.system.domain.SysRoleWarehouse;
|
||||||
|
import com.ruoyi.system.mapper.*;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -21,10 +24,6 @@ import com.ruoyi.common.utils.spring.SpringUtils;
|
|||||||
import com.ruoyi.system.domain.SysRoleDept;
|
import com.ruoyi.system.domain.SysRoleDept;
|
||||||
import com.ruoyi.system.domain.SysRoleMenu;
|
import com.ruoyi.system.domain.SysRoleMenu;
|
||||||
import com.ruoyi.system.domain.SysUserRole;
|
import com.ruoyi.system.domain.SysUserRole;
|
||||||
import com.ruoyi.system.mapper.SysRoleDeptMapper;
|
|
||||||
import com.ruoyi.system.mapper.SysRoleMapper;
|
|
||||||
import com.ruoyi.system.mapper.SysRoleMenuMapper;
|
|
||||||
import com.ruoyi.system.mapper.SysUserRoleMapper;
|
|
||||||
import com.ruoyi.system.service.ISysRoleService;
|
import com.ruoyi.system.service.ISysRoleService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -47,6 +46,9 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SysRoleDeptMapper roleDeptMapper;
|
private SysRoleDeptMapper roleDeptMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysRoleWarehouseMapper roleWarehouseMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据条件分页查询角色数据
|
* 根据条件分页查询角色数据
|
||||||
*
|
*
|
||||||
@@ -70,6 +72,9 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||||||
public List<SysRole> selectRolesByUserId(Long userId)
|
public List<SysRole> selectRolesByUserId(Long userId)
|
||||||
{
|
{
|
||||||
List<SysRole> userRoles = roleMapper.selectRolePermissionByUserId(userId);
|
List<SysRole> userRoles = roleMapper.selectRolePermissionByUserId(userId);
|
||||||
|
for (SysRole userRole : userRoles) {
|
||||||
|
userRole.setWarehouseDataScope(roleWarehouseMapper.selectRoleWarehouseByRoleId(userRole.getRoleId()));
|
||||||
|
}
|
||||||
List<SysRole> roles = selectRoleAll();
|
List<SysRole> roles = selectRoleAll();
|
||||||
for (SysRole role : roles)
|
for (SysRole role : roles)
|
||||||
{
|
{
|
||||||
@@ -78,6 +83,7 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||||||
if (role.getRoleId().longValue() == userRole.getRoleId().longValue())
|
if (role.getRoleId().longValue() == userRole.getRoleId().longValue())
|
||||||
{
|
{
|
||||||
role.setFlag(true);
|
role.setFlag(true);
|
||||||
|
role.setWarehouseDataScope(userRole.getWarehouseDataScope());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -138,7 +144,10 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||||||
@Override
|
@Override
|
||||||
public SysRole selectRoleById(Long roleId)
|
public SysRole selectRoleById(Long roleId)
|
||||||
{
|
{
|
||||||
return roleMapper.selectRoleById(roleId);
|
SysRole sysRole = roleMapper.selectRoleById(roleId);
|
||||||
|
List<String> warehouseList = roleWarehouseMapper.selectRoleWarehouseByRoleId(roleId);
|
||||||
|
sysRole.setWarehouseDataScope(warehouseList);
|
||||||
|
return sysRole;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -285,7 +294,28 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||||||
// 删除角色与部门关联
|
// 删除角色与部门关联
|
||||||
roleDeptMapper.deleteRoleDeptByRoleId(role.getRoleId());
|
roleDeptMapper.deleteRoleDeptByRoleId(role.getRoleId());
|
||||||
// 新增角色和部门信息(数据权限)
|
// 新增角色和部门信息(数据权限)
|
||||||
return insertRoleDept(role);
|
int i = insertRoleDept(role);
|
||||||
|
int i1 = insertRoleWareHouse(role);
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int insertRoleWareHouse(SysRole role) {
|
||||||
|
int rows = 1;
|
||||||
|
// 新增用户与角色管理
|
||||||
|
List<SysRoleWarehouse> list = new ArrayList<SysRoleWarehouse>();
|
||||||
|
for (String wareHouseId : role.getWarehouseDataScope())
|
||||||
|
{
|
||||||
|
SysRoleWarehouse rw = new SysRoleWarehouse();
|
||||||
|
rw.setRoleId(role.getRoleId());
|
||||||
|
rw.setWarehouseId(wareHouseId);
|
||||||
|
list.add(rw);
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(list))
|
||||||
|
{
|
||||||
|
roleWarehouseMapper.deleteRoleWarehouseByRoleId(role.getRoleId());
|
||||||
|
rows = roleWarehouseMapper.batchRoleWarehouse(list);
|
||||||
|
}
|
||||||
|
return rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.ruoyi.system.mapper.SysRoleWarehouseMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<insert id="batchRoleWarehouse">
|
||||||
|
insert into sys_role_warehouse(role_id, warehouse_id) values
|
||||||
|
<foreach item="item" index="index" collection="list" separator=",">
|
||||||
|
(#{item.roleId},#{item.warehouseId})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
<delete id="deleteRoleWarehouseByRoleId">
|
||||||
|
delete from sys_role_warehouse where role_id=#{roleId}
|
||||||
|
</delete>
|
||||||
|
<select id="selectRoleWarehouseByRoleId" resultType="java.lang.String">
|
||||||
|
select warehouse_id from sys_role_warehouse where role_id=#{roleId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -1422,6 +1422,7 @@ export default {
|
|||||||
placeholderEmail: 'Enter Email',
|
placeholderEmail: 'Enter Email',
|
||||||
placeholderPost: 'Select Post',
|
placeholderPost: 'Select Post',
|
||||||
placeholderGender: 'Select Gender',
|
placeholderGender: 'Select Gender',
|
||||||
|
selectWarehouse: 'Select Warehouse',
|
||||||
|
|
||||||
//--------------交互按钮--------------
|
//--------------交互按钮--------------
|
||||||
btnSearch: 'Search',
|
btnSearch: 'Search',
|
||||||
@@ -3048,16 +3049,6 @@ export default {
|
|||||||
deleteSuccess: 'deleteSuccess',
|
deleteSuccess: 'deleteSuccess',
|
||||||
deleteConfirm: 'Are you sure to delete the customerNo with ID {ids}?'
|
deleteConfirm: 'Are you sure to delete the customerNo with ID {ids}?'
|
||||||
},
|
},
|
||||||
// ***************产品基础表添加字段**************
|
|
||||||
basproduct1:{
|
|
||||||
englishName:"englishName",
|
|
||||||
netWeightPerUnit:"netWeightPerUnit",
|
|
||||||
long:"long",
|
|
||||||
wide:"wide",
|
|
||||||
tall:"tall",
|
|
||||||
volume:"volume",
|
|
||||||
price:"price",
|
|
||||||
notes:"notes"
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1369,6 +1369,7 @@ export default {
|
|||||||
placeholderEmail: '请输入邮箱',
|
placeholderEmail: '请输入邮箱',
|
||||||
placeholderPost: '请选择岗位',
|
placeholderPost: '请选择岗位',
|
||||||
placeholderGender: '请选择性别',
|
placeholderGender: '请选择性别',
|
||||||
|
selectWarehouse: '请选择仓库',
|
||||||
|
|
||||||
//--------------交互按钮--------------
|
//--------------交互按钮--------------
|
||||||
btnSearch: '搜索',
|
btnSearch: '搜索',
|
||||||
|
|||||||
@@ -1409,6 +1409,7 @@ export default {
|
|||||||
roleName: '角色名称',
|
roleName: '角色名称',
|
||||||
roleKey: '权限字符',
|
roleKey: '权限字符',
|
||||||
dataScope: '权限范围',
|
dataScope: '权限范围',
|
||||||
|
warehouseDataScope: '仓库范围',
|
||||||
menuAccess: '菜单权限',
|
menuAccess: '菜单权限',
|
||||||
roleSort: '显示顺序',
|
roleSort: '显示顺序',
|
||||||
status: '角色状态',
|
status: '角色状态',
|
||||||
@@ -1431,6 +1432,7 @@ export default {
|
|||||||
placeholderEmail: '请输入邮箱',
|
placeholderEmail: '请输入邮箱',
|
||||||
placeholderPost: '请选择岗位',
|
placeholderPost: '请选择岗位',
|
||||||
placeholderGender: '请选择性别',
|
placeholderGender: '请选择性别',
|
||||||
|
selectWarehouse: '请选择仓库',
|
||||||
|
|
||||||
//--------------交互按钮--------------
|
//--------------交互按钮--------------
|
||||||
btnSearch: '搜索',
|
btnSearch: '搜索',
|
||||||
|
|||||||
@@ -148,7 +148,7 @@
|
|||||||
<!-- 仓库地址 -->
|
<!-- 仓库地址 -->
|
||||||
<el-table-column :label="$t('warehouse.address')" align="center" prop="address" />
|
<el-table-column :label="$t('warehouse.address')" align="center" prop="address" />
|
||||||
<!-- 备注 -->
|
<!-- 备注 -->
|
||||||
<el-table-column :label="$t('warehouse.cDesc')" align="center" prop="cDesc" />
|
<el-table-column :label="$t('warehouse.cDesc')" align="center" prop="cdesc" />
|
||||||
<!-- 仓库级别 -->
|
<!-- 仓库级别 -->
|
||||||
<el-table-column :label="$t('warehouse.warehouseKind')" align="center" prop="warehouseKind" />
|
<el-table-column :label="$t('warehouse.warehouseKind')" align="center" prop="warehouseKind" />
|
||||||
<!-- 仓库类型 -->
|
<!-- 仓库类型 -->
|
||||||
@@ -215,7 +215,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 备注 -->
|
<!-- 备注 -->
|
||||||
<el-form-item :label="$t('warehouse.cDesc')" prop="cDesc">
|
<el-form-item :label="$t('warehouse.cDesc')" prop="cDesc">
|
||||||
<el-input v-model="form.cDesc" :placeholder="$t('warehouse.placeholderCDesc')" />
|
<el-input v-model="form.cdesc" :placeholder="$t('warehouse.placeholderCDesc')" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 仓库级别 -->
|
<!-- 仓库级别 -->
|
||||||
<el-form-item :label="$t('warehouse.warehouseKind')" prop="warehouseKind">
|
<el-form-item :label="$t('warehouse.warehouseKind')" prop="warehouseKind">
|
||||||
|
|||||||
@@ -265,6 +265,16 @@
|
|||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('systemManagement_RoleManagement.warehouseDataScope')">
|
||||||
|
<el-select v-model="form.warehouseDataScope" @change="dataScopeSelectChange" multiple collapse-tags :placeholder="$t('systemManagement_RoleManagement.selectWarehouse')">
|
||||||
|
<el-option
|
||||||
|
v-for="item in warehouseOptions"
|
||||||
|
:key="item.warehouseId"
|
||||||
|
:label="item.warehouseName"
|
||||||
|
:value="item.warehouseId"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<!-- 数据权限 -->
|
<!-- 数据权限 -->
|
||||||
<el-form-item :label="$t('systemManagement_RoleManagement.dataScope')" v-show="form.dataScope == 2">
|
<el-form-item :label="$t('systemManagement_RoleManagement.dataScope')" v-show="form.dataScope == 2">
|
||||||
<!-- 标签文本:展开/折叠 -->
|
<!-- 标签文本:展开/折叠 -->
|
||||||
@@ -300,6 +310,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role"
|
import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role"
|
||||||
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu"
|
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu"
|
||||||
|
import {listWarehouse} from "@/api/bas/warehouse"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Role",
|
name: "Role",
|
||||||
@@ -364,6 +375,8 @@ export default {
|
|||||||
menuOptions: [],
|
menuOptions: [],
|
||||||
// 部门列表
|
// 部门列表
|
||||||
deptOptions: [],
|
deptOptions: [],
|
||||||
|
// 仓库选项
|
||||||
|
warehouseOptions: [],
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
@@ -397,8 +410,15 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList()
|
this.getList()
|
||||||
|
this.getWarehouseList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
/** 获取仓库列表 */
|
||||||
|
getWarehouseList() {
|
||||||
|
listWarehouse().then(response => {
|
||||||
|
this.warehouseOptions = response.rows;
|
||||||
|
});
|
||||||
|
},
|
||||||
/** 查询角色列表 */
|
/** 查询角色列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
@@ -505,7 +525,8 @@ export default {
|
|||||||
deptIds: [],
|
deptIds: [],
|
||||||
menuCheckStrictly: true,
|
menuCheckStrictly: true,
|
||||||
deptCheckStrictly: true,
|
deptCheckStrictly: true,
|
||||||
remark: undefined
|
remark: undefined,
|
||||||
|
warehouseDataScope: []
|
||||||
}
|
}
|
||||||
this.resetForm("form")
|
this.resetForm("form")
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user