diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/busvehicleapply/BusVehicleApplyDetailsVo.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/busvehicleapply/BusVehicleApplyDetailsVo.java index e4fb99e995..c8f6877221 100644 --- a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/busvehicleapply/BusVehicleApplyDetailsVo.java +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/busvehicleapply/BusVehicleApplyDetailsVo.java @@ -67,4 +67,7 @@ public class BusVehicleApplyDetailsVo implements Vo { private String carBrandSid; @ApiModelProperty(value = "品牌名称") private String carBrandName; + + @ApiModelProperty("申请人orgPath") + private String orgPath; } diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/busvehicleapply/BusVehicleApplyQuery.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/busvehicleapply/BusVehicleApplyQuery.java index c2d029a3a8..e3d07f8d39 100644 --- a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/busvehicleapply/BusVehicleApplyQuery.java +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/busvehicleapply/BusVehicleApplyQuery.java @@ -39,4 +39,6 @@ public class BusVehicleApplyQuery implements Query { private String schedulingTypeKey; private String applicationCode; + @ApiModelProperty("当前组织机构的全路径sid") + private String orgPath; } diff --git a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/busvehicleapply/BusVehicleApplyMapper.java b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/busvehicleapply/BusVehicleApplyMapper.java index 54f2b744e8..238065dfef 100644 --- a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/busvehicleapply/BusVehicleApplyMapper.java +++ b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/busvehicleapply/BusVehicleApplyMapper.java @@ -50,4 +50,5 @@ public interface BusVehicleApplyMapper extends BaseMapper { int selectCountBySids(String join); ActualAndOrgDeptVo getActualAndOrgDept(@Param("sid") String vehicleOrderSid, @Param("modelSid") String modelSid, @Param("configSid") String configSid); + } \ No newline at end of file diff --git a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/busvehicleapply/BusVehicleApplyService.java b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/busvehicleapply/BusVehicleApplyService.java index 0b4af1c23a..58631d809c 100644 --- a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/busvehicleapply/BusVehicleApplyService.java +++ b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/busvehicleapply/BusVehicleApplyService.java @@ -161,6 +161,9 @@ public class BusVehicleApplyService extends MybatisBaseService busVehicleApplyDetailVos = busVehicleApplyDetailService.fetchByApplySid(sid); busVehicleApplyDetailsVo.setBusVehicleApplyDetailList(busVehicleApplyDetailVos); return busVehicleApplyDetailsVo; diff --git a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/busvehicleapplydetail/BusVehicleApplyDetailMapper.xml b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/busvehicleapplydetail/BusVehicleApplyDetailMapper.xml index ec965f6dc7..ac06c46d52 100644 --- a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/busvehicleapplydetail/BusVehicleApplyDetailMapper.xml +++ b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/busvehicleapplydetail/BusVehicleApplyDetailMapper.xml @@ -58,7 +58,7 @@ where bd.vehicleSid = #{modelSid} and bd.configSid = #{configSid} and length(bo.orderNo)>0 and length (bo.platformNo) - > 0 and bo.platformNo != bo.lockingNum + > 0 + + + + \ No newline at end of file diff --git a/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysmenu/SysMenuService.java b/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysmenu/SysMenuService.java index dbb2955be1..03cefcb364 100644 --- a/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysmenu/SysMenuService.java +++ b/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysmenu/SysMenuService.java @@ -409,4 +409,8 @@ public class SysMenuService extends MybatisBaseService { sysSourceMenuService.save(sysSourceMenu); save(entity); } + + public List selectByMenuUrl(String menuUrl) { + return baseMapper.selectByMenuUrl(menuUrl); + } } \ No newline at end of file diff --git a/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysuser/SysUserRest.java b/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysuser/SysUserRest.java index 1faf291e3e..34df3813a4 100644 --- a/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysuser/SysUserRest.java +++ b/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysuser/SysUserRest.java @@ -626,8 +626,8 @@ public class SysUserRest implements SysUserFeign { } @Override - public ResultBean> selectSysUserList(String userSid) { - return sysUserService.selectSysUserList(userSid); + public ResultBean> selectSysUserList(String userSid,String orgPath) { + return sysUserService.selectSysUserList(userSid,orgPath); } @Override @@ -636,8 +636,8 @@ public class SysUserRest implements SysUserFeign { } @Override - public ResultBean selectHaveMessage(String menuSid, String orgPath) { - return sysUserService.selectHaveMessage(menuSid,orgPath); + public ResultBean selectHaveMessage(SysHaveMessageQuery sysHaveMessageQuery) { + return sysUserService.selectHaveMessage(sysHaveMessageQuery); } @Override diff --git a/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysuser/SysUserService.java b/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysuser/SysUserService.java index aa6585969e..2748e99037 100644 --- a/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysuser/SysUserService.java +++ b/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysuser/SysUserService.java @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.yxt.anrui.crm.api.crmcustomer.CrmCustomer; import com.yxt.anrui.crm.api.crmcustomer.CrmCustomerFeign; import com.yxt.anrui.portal.api.sms.SmsFeign; +import com.yxt.anrui.portal.api.sysmenu.SysMenu; import com.yxt.anrui.portal.api.sysorganization.SysOrganization; import com.yxt.anrui.portal.api.sysstaffinfo.SysStaffinfo; import com.yxt.anrui.portal.api.sysstaffinfo.SysStaffinfoVo; @@ -20,6 +21,7 @@ import com.yxt.anrui.portal.api.sysuser.wx.WxHomePageVo; import com.yxt.anrui.portal.api.sysuser.wx.WxMySysUserInfoVo; import com.yxt.anrui.portal.api.sysuser.wx.WxSysUserVo; import com.yxt.anrui.portal.api.sysuserdefaultorg.SysUserDefaultOrg; +import com.yxt.anrui.portal.biz.sysmenu.SysMenuService; import com.yxt.anrui.portal.biz.sysorganization.SysOrganizationService; import com.yxt.anrui.portal.biz.sysrole.SysRoleService; import com.yxt.anrui.portal.biz.sysstaffinfo.SysStaffinfoService; @@ -105,6 +107,8 @@ public class SysUserService extends MybatisBaseService { @Autowired private SysUserDefaultOrgService sysUserDefaultOrgService; + @Autowired + private SysMenuService sysMenuService; public PagerVo listPage(PagerQuery pq) { @@ -1100,17 +1104,21 @@ public class SysUserService extends MybatisBaseService { return rb.success().setData(sysUserVoList); } - public ResultBean> selectSysUserList(String userSid) { + public ResultBean> selectSysUserList(String userSid,String orgPath) { ResultBean> rb = ResultBean.fireFail(); //销售经理角色sid String roleSid = "f07e98d3-d179-48ee-a5ff-5928addead3f"; - //根据用户sid查询用户的部门全路径 - SysUserVo vo = fetchBySidVo(userSid); - //根据staffSid获取用户的组织全路径 - SysStaffOrg sysStaffOrg = sysStaffOrgService.getOrgByStaffSid(vo.getStaffSid()); UserQuery userRoleQuery = new UserQuery(); + if(StringUtils.isNotBlank(orgPath)){ + userRoleQuery.setOrgSidPath(orgPath); + }else{ + //根据用户sid查询用户的部门全路径 + SysUserVo vo = fetchBySidVo(userSid); + //根据staffSid获取用户的组织全路径 + SysStaffOrg sysStaffOrg = sysStaffOrgService.getOrgByStaffSid(vo.getStaffSid()); + userRoleQuery.setOrgSidPath(sysStaffOrg.getOrgSidPath()); + } userRoleQuery.setRoleSid(roleSid); - userRoleQuery.setOrgSidPath(sysStaffOrg.getOrgSidPath()); ResultBean> resultBean = getUserByRole(userRoleQuery); List sysUserVoList = resultBean.getData(); sysUserVoList.removeAll(Collections.singleton(null)); @@ -1152,8 +1160,10 @@ public class SysUserService extends MybatisBaseService { return baseMapper.updateAppIdNull(appId); } - public ResultBean selectHaveMessage(String menuSid, String orgPath) { + public ResultBean selectHaveMessage(SysHaveMessageQuery sysHaveMessageQuery) { ResultBean rb = ResultBean.fireFail(); + String menuUrl = sysHaveMessageQuery.getMenuUrl(); + String orgPath = sysHaveMessageQuery.getOrgPath(); //根据orgPath 查询当前组织所管理的层级 List orgPathsList = Arrays.asList(orgPath.split("/")); String orgSid = orgPathsList.get(orgPathsList.size()-1); @@ -1161,20 +1171,29 @@ public class SysUserService extends MybatisBaseService { if(sysOrganization == null){ return rb.setMsg("当前所在组织机构不存在"); } - //根据菜单sid查询所授权的角色 - List list = sysRoleService.selectRoleList(menuSid); - list.removeAll(Collections.singleton(null)); - if(!list.isEmpty()){ - List typeList = list.stream().map(v->v.getRoleType()).collect(Collectors.toList()); - if(StringUtils.isBlank(sysOrganization.getOrgLevelKey())){ - return rb.setMsg("当前组织未设置管理层级"); - } - if(!typeList.contains(sysOrganization.getOrgLevelKey())){ - return rb.setMsg("请检查当前菜单是否为目前机构层级对应的角色"); - } - + //根据菜单路由查询菜单的sid + List sysMenuList = sysMenuService.selectByMenuUrl(menuUrl); + if(sysMenuList.size()>1){ + return rb.setMsg("当前菜单的路由存在多个,请联系管理员"); + }else if(sysMenuList.size() == 0){ + return rb.setMsg("当前菜单不存在"); }else{ - return rb.setMsg("当前菜单未授权角色权限"); + String menuSid = sysMenuList.get(0).getSid(); + //根据菜单sid查询所授权的角色 + List list = sysRoleService.selectRoleList(menuSid); + list.removeAll(Collections.singleton(null)); + if(!list.isEmpty()){ + List typeList = list.stream().map(v->v.getRoleType()).collect(Collectors.toList()); + if(StringUtils.isBlank(sysOrganization.getOrgLevelKey())){ + return rb.setMsg("当前组织未设置管理层级"); + } + if(!typeList.contains(sysOrganization.getOrgLevelKey())){ + return rb.setMsg("请检查当前菜单是否为目前机构层级对应的角色"); + } + + }else{ + return rb.setMsg("当前菜单未授权角色权限"); + } } return rb.success(); } diff --git a/anrui-scm/anrui-scm-ui/src/api/cheliang/dictcommons.js b/anrui-scm/anrui-scm-ui/src/api/cheliang/dictcommons.js index f04e9d5e65..cb9f20f52b 100644 --- a/anrui-scm/anrui-scm-ui/src/api/cheliang/dictcommons.js +++ b/anrui-scm/anrui-scm-ui/src/api/cheliang/dictcommons.js @@ -67,6 +67,16 @@ export function getPathSidByUserSid(data) { params: data }) } + +// 根据当前登录人orgSidPath(全路径sid)查询分公司 +export function getOrgSidByPath(data) { + return request({ + url: '/portal/v1/sysstafforg/getOrgSidByPath', + method: 'get', + params: data + }) +} + // 根据分公司sid查询分公司名称 export function fetchBySid(sid) { return request({ @@ -205,3 +215,13 @@ export function selectOrgByLevel(data) { }) } +// 当前用户创建申请时判断该用户是否有该菜单的操作权限 +export function selectHaveMessage(data) { + return request({ + url: '/portal/v1/sysuser/selectHaveMessage ', + method: 'post', + data: data, + headers: { 'Content-Type': 'application/json' } + }) +} + diff --git a/anrui-scm/anrui-scm-ui/src/layout/components/Navbar.vue b/anrui-scm/anrui-scm-ui/src/layout/components/Navbar.vue index 6636e15388..1ea517e4e0 100644 --- a/anrui-scm/anrui-scm-ui/src/layout/components/Navbar.vue +++ b/anrui-scm/anrui-scm-ui/src/layout/components/Navbar.vue @@ -28,7 +28,7 @@ mounted() { this.Orgname = window.sessionStorage.getItem('Orgname') this.departmentName = window.sessionStorage.getItem('departmentName') - this.pNameAndDepartmentNameAndPostName = window.sessionStorage.getItem('pNameAndDepartmentNameAndPostName') + this.pNameAndDepartmentNameAndPostName = window.sessionStorage.getItem('defaultOrgPathName') this.name = window.sessionStorage.getItem('name') var nowDate = new Date() this.year = nowDate.getFullYear() diff --git a/anrui-scm/anrui-scm-ui/src/main.js b/anrui-scm/anrui-scm-ui/src/main.js index 5c9642f530..4bea269823 100644 --- a/anrui-scm/anrui-scm-ui/src/main.js +++ b/anrui-scm/anrui-scm-ui/src/main.js @@ -16,7 +16,7 @@ import eimage from '@/components/E-image/index.vue' import moment from 'moment' import Print from '@/utils/print' // 引入附件的js文件 import request from '@/utils/request' -import { setStorage } from './utils/auth.js' +import { setDefaultOrgPath, setDefaultOrgPathName, setStorage } from './utils/auth.js' import VueAMap from 'vue-amap' Vue.use(ElementUI) @@ -52,6 +52,17 @@ if (token) { // window.location.href = href.slice(0, href.length - 1) } +var one = window.location.href.indexOf('&organizationData') + 18 +if (parseInt(one) > 18) { + const data = window.location.href.substr(one) // url解码unescape()已从web中移除,尽量不使用 + var data1 = decodeURIComponent(data) + if (data1 !== undefined) { + const obj = JSON.parse(data1) + setDefaultOrgPath(obj.defaultOrgPath) + setDefaultOrgPathName(obj.defaultOrgPathName) + } +} + // 获取登录用户信息 function getUserInfo() { return request({ @@ -75,8 +86,7 @@ function getUserInfo() { Orgname: data.organizationName, dwjb: data.dwjb, orgNamePath: data.orgNamePath, // 使用组织全路径名称 - orgSidPath: data.orgSidPath, // 使用组织全路径Sid - pNameAndDepartmentNameAndPostName:data.pNameAndDepartmentNameAndPostName + orgSidPath: data.orgSidPath // 使用组织全路径Sid } // 结果存入缓存 window.sessionStorage.setItem('staffSid', user.staffSid) @@ -90,7 +100,6 @@ function getUserInfo() { window.sessionStorage.setItem('departmentSid', user.departmentSid) window.sessionStorage.setItem('orgNamePath', user.orgNamePath) window.sessionStorage.setItem('orgSidPath', user.orgSidPath) - window.sessionStorage.setItem('pNameAndDepartmentNameAndPostName', user.pNameAndDepartmentNameAndPostName) new Vue({ el: '#app', router, diff --git a/anrui-scm/anrui-scm-ui/src/router/modules/codemenu.js b/anrui-scm/anrui-scm-ui/src/router/modules/codemenu.js index 74160f51a2..b2f77f2819 100644 --- a/anrui-scm/anrui-scm-ui/src/router/modules/codemenu.js +++ b/anrui-scm/anrui-scm-ui/src/router/modules/codemenu.js @@ -316,13 +316,13 @@ const codemenu = [ path: '/vehicle/cheliangpaichan', component: () => import('@/views/supplychain/cheliangpaichan/cheliangpaichan.vue'), name: 'cheliangpaichan', - meta: { title: '厂家采购', noCache: true } + meta: { title: '厂家采购', noCache: false } }, { path: '/vehicle/paichandingjintobeconfirmed', component: () => import('@/views/supplychain/paichandingjin/paichandingjintobeconfirmed.vue'), name: 'paichandingjindaiqueren', - meta: { title: '排产订金申请确认', noCache: true } + meta: { title: '排产订金申请确认', noCache: false } } ] }, @@ -338,7 +338,7 @@ const codemenu = [ path: '/supplychain/changjiaxitong', component: () => import('@/views/supplychain/changjiaxitong/manufacturers.vue'), name: 'changjiaxitongrenkuan', - meta: { title: '厂家系统认款', noCache: true } + meta: { title: '厂家系统认款', noCache: false } } ] }, diff --git a/anrui-scm/anrui-scm-ui/src/utils/auth.js b/anrui-scm/anrui-scm-ui/src/utils/auth.js index 5cced900a5..4204c335ec 100644 --- a/anrui-scm/anrui-scm-ui/src/utils/auth.js +++ b/anrui-scm/anrui-scm-ui/src/utils/auth.js @@ -24,6 +24,14 @@ export function setStorage(session) { return sessionStorage.setItem('token', session) } +export function setDefaultOrgPathName(data) { + return sessionStorage.setItem('defaultOrgPathName', data) +} + +export function setDefaultOrgPath(data) { + return sessionStorage.setItem('defaultOrgPath', data) +} + export function removeStorage() { return sessionStorage.removeItem('token') } diff --git a/anrui-scm/anrui-scm-ui/src/views/supplychain/cheliangpaichan/cheliangpaichan.vue b/anrui-scm/anrui-scm-ui/src/views/supplychain/cheliangpaichan/cheliangpaichan.vue index 714b4b4d61..33024fdb15 100644 --- a/anrui-scm/anrui-scm-ui/src/views/supplychain/cheliangpaichan/cheliangpaichan.vue +++ b/anrui-scm/anrui-scm-ui/src/views/supplychain/cheliangpaichan/cheliangpaichan.vue @@ -90,6 +90,7 @@ import Pagination from '@/components/pagination' import pageye from '@/components/pagination/pageye' import divAdd from './cheliangpaichanAdd' import divInfo from './cheliangpaichanInfo' +import { selectHaveMessage } from '@/api/cheliang/dictcommons' import { getStorage } from '@/utils/auth' export default { @@ -157,7 +158,8 @@ export default { applicationDateEnd: '', applyTypeKey: '', schedulingTypeKey: '', - userSid: '' + userSid: '', + orgPath: '' } }, row: {} @@ -247,9 +249,13 @@ export default { this.nodeState_list = bb console.log('获取sids数组', this.sids) }, - toAdd(row) { - this.viewState = 2 - this.$refs['divadd'].showAdd() + toAdd() { + selectHaveMessage({ menuUrl: this.$route.path, orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((resp) => { + if (resp.success) { + this.viewState = 2 + this.$refs['divadd'].showAdd() + } + }) }, toInfo(row) { this.viewState = 4 @@ -278,7 +284,8 @@ export default { applicationDateEnd: '', applyTypeKey: '', schedulingTypeKey: '', - userSid: '' + userSid: '', + orgPath: '' } } this.dosearch() @@ -287,6 +294,7 @@ export default { loadList() { this.tableLoading = true this.queryParams.params.userSid = window.sessionStorage.getItem('userSid') + this.queryParams.params.orgPath = window.sessionStorage.getItem('defaultOrgPath') req.listPage(this.queryParams).then(resp => { console.log('查询列表', resp) this.tableLoading = false diff --git a/anrui-scm/anrui-scm-ui/src/views/supplychain/cheliangpaichan/cheliangpaichanAdd.vue b/anrui-scm/anrui-scm-ui/src/views/supplychain/cheliangpaichan/cheliangpaichanAdd.vue index be938c5e25..f7f7887fbb 100644 --- a/anrui-scm/anrui-scm-ui/src/views/supplychain/cheliangpaichan/cheliangpaichanAdd.vue +++ b/anrui-scm/anrui-scm-ui/src/views/supplychain/cheliangpaichan/cheliangpaichanAdd.vue @@ -187,7 +187,7 @@ import configuration from './chexingbyconfiguration' import shangzhuangpeizhi from '../../../views/supplychain/cheliangpaichan/shangzhuangselect/shangzhuangpeizhi' import shangzhuangpeizhiAdd from '../../../views/supplychain/cheliangpaichan/shangzhuangselect/shangzhuangpeizhiAdd' import vehicleconfiguration from '@/views/cheliang/cheliangcaigou/relation/vehicleconfiguration' -import { getPathSidByUserSid, fetchBySid, selectSysUserList, fetchDetailsByUseOrgSid, brandDown, selectNameByOrg } from '@/api/cheliang/dictcommons' +import { getOrgSidByPath, fetchBySid, selectSysUserList, fetchDetailsByUseOrgSid, brandDown, selectNameByOrg } from '@/api/cheliang/dictcommons' export default { name: 'cheliangpaichanAdd', @@ -238,6 +238,7 @@ export default { orgDeptSid: '', carBrandName: '', carBrandSid: '', + orgPath: '', busVehicleApplyDetailList: [] }, rules: {}, @@ -256,14 +257,14 @@ export default { this.applyType_list = res.data } }) - selectSysUserList({ userSid: window.sessionStorage.getItem('userSid') }).then((resp) => { + selectSysUserList({ userSid: window.sessionStorage.getItem('userSid'), orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((resp) => { if (resp.success) { this.user_list = resp.data } }) }, getUserOrg() { - getPathSidByUserSid({ userSid: window.sessionStorage.getItem('userSid') }).then((resp) => { + getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((resp) => { if (resp.success) { this.formobj.createOrgSid = resp.data fetchBySid(this.formobj.createOrgSid).then((response) => { @@ -294,17 +295,13 @@ export default { }) }, newDate() { - let date = new Date() - let year = date.getFullYear() // 年 - let month = date.getMonth() + 1 // 月 - let day = date.getDate() // 日 - if (month < 10) { - month = '0' + month + var nowDate = new Date() + var date = { + year: nowDate.getFullYear(), + month: nowDate.getMonth() + 1, + day: nowDate.getDate() } - if (day < 10) { - day = '0' + day - } - this.formobj.applicationDate = year + '-' + month + '-' + day + this.formobj.applicationDate = date.year + '-' + (date.month >= 10 ? date.month : '0' + date.month) + '-' + (date.day >= 10 ? date.day : '0' + date.day) }, oninput(val, limit = 0) { val = val.replace(/[^\d]/g, '') // 保留数字 @@ -328,7 +325,7 @@ export default { return } this.viewState = 2 - this.$refs['divconfiguration'].showData(this.formobj.busVehicleApplyDetailList, this.formobj.carBrandSid) + this.$refs['divconfiguration'].showData(this.formobj.busVehicleApplyDetailList, this.formobj.carBrandSid, this.formobj.createOrgSid) }, handleLook(row) { this.viewState = 5 @@ -353,6 +350,7 @@ export default { }) this.dialogStatus = 'add' this.viewTitle = '【新增】厂家采购' + this.formobj.orgPath = window.sessionStorage.getItem('defaultOrgPath') this.formobj.createBySid = window.sessionStorage.getItem('userSid') this.formobj.createByName = window.sessionStorage.getItem('name') }, @@ -574,7 +572,7 @@ export default { }, handleShangZhuang(index) { this.viewState = 3 - this.$refs['divShangzhuangpeizhi'].showData(index) + this.$refs['divShangzhuangpeizhi'].showData(index, this.formobj.createOrgSid) }, backPeizhi(val, index) { this.viewState = 1 @@ -665,6 +663,7 @@ export default { this.formobj.orgDeptSid = '' this.formobj.carBrandName = '' this.formobj.carBrandSid = '' + this.formobj.orgPath = '' this.user_list = [] this.submitdisabled = false this.formobj.busVehicleApplyDetailList = [] diff --git a/anrui-scm/anrui-scm-ui/src/views/supplychain/cheliangpaichan/chexingbyconfiguration.vue b/anrui-scm/anrui-scm-ui/src/views/supplychain/cheliangpaichan/chexingbyconfiguration.vue index 2bbf581b51..f7ac8da711 100644 --- a/anrui-scm/anrui-scm-ui/src/views/supplychain/cheliangpaichan/chexingbyconfiguration.vue +++ b/anrui-scm/anrui-scm-ui/src/views/supplychain/cheliangpaichan/chexingbyconfiguration.vue @@ -133,15 +133,6 @@ export default { handleReturn() { this.$emit('doback') }, - getPathSid() { - const userSid = window.sessionStorage.getItem('userSid') - getPathSidByUserSid({ userSid: userSid }).then((res) => { - if (res.success) { - this.listQuery.params.useOrgSid = res.data - this.getList() - } - }) - }, // 查询列表信息 getList() { this.listLoading = true @@ -156,7 +147,7 @@ export default { // 查询按钮 handleFilter() { this.listQuery.current = 1 - this.getPathSid() + this.getList() }, // 重置按钮 handresetting() { @@ -168,7 +159,7 @@ export default { this.listQuery.params.useOrgSid = '' this.listQuery.params.vehicleStateValue = '' this.listQuery.params.insideCode = '' - this.getPathSid() + this.getList() }, handleSelectionChange(row) { this.sids = [] @@ -187,7 +178,7 @@ export default { }) this.sids = aa }, - showData(value, carBrandSid) { + showData(value, carBrandSid, createOrgSid) { const aa = [] if (value.length > 0) { for (var i = 0; i < value.length; i++) { @@ -204,7 +195,8 @@ export default { this.listQuery.total = 0 this.listQuery.size = 5 this.listQuery.params.carBrandSid = carBrandSid - this.getPathSid() + this.listQuery.params.useOrgSid = createOrgSid + this.getList() }, // 添加修改返回 AddUpdateReturn() { diff --git a/anrui-scm/anrui-scm-ui/src/views/supplychain/cheliangpaichan/shangzhuangselect/shangzhuangpeizhi.vue b/anrui-scm/anrui-scm-ui/src/views/supplychain/cheliangpaichan/shangzhuangselect/shangzhuangpeizhi.vue index 70e4fd23d2..ec58e791c0 100644 --- a/anrui-scm/anrui-scm-ui/src/views/supplychain/cheliangpaichan/shangzhuangselect/shangzhuangpeizhi.vue +++ b/anrui-scm/anrui-scm-ui/src/views/supplychain/cheliangpaichan/shangzhuangselect/shangzhuangpeizhi.vue @@ -146,13 +146,8 @@ export default { }, methods: { init() { - getPathSidByUserSid({ userSid: window.sessionStorage.getItem('userSid') }).then((res) => { - if (res.success) { - this.queryParams.params.createOrgSid = res.data - this.loadList() - } - }) this.DataDictionary() + this.loadList() }, DataDictionary() { // 上装名称 @@ -193,11 +188,12 @@ export default { break } }, - showData(index) { + showData(index, createOrgSid) { this.tableIndex = index this.queryParams.current = 1 this.queryParams.total = 0 this.queryParams.size = 5 + this.queryParams.params.createOrgSid = createOrgSid this.init() }, dosearch() { @@ -205,32 +201,31 @@ export default { this.init() }, resetQuery() { - this.queryParams = { - current: 1, - size: 5, - total: 0, - params: { - vehicleTypeKey: '', - installNameKey: '', - refitMethodKey: '', - refitFactory: '', - colorKey: '', - plateMaterial: '', - createOrgSid: '' - } - } + this.queryParams.current = 1 + this.queryParams.size = 5 + this.queryParams.total = 0 + this.queryParams.params.vehicleTypeKey = '' + this.queryParams.params.installNameKey = '' + this.queryParams.params.refitMethodKey = '' + this.queryParams.params.refitFactory = '' + this.queryParams.params.colorKey = '' + this.queryParams.params.plateMaterial = '' this.init() }, loadList() { - const _this = this this.tableLoading = true req.listPage(this.queryParams).then((resp) => { - _this.tableLoading = false - const data = resp.data - _this.queryParams.total = data.total - _this.dataList = data.records + this.tableLoading = false + if (resp.success) { + const data = resp.data + this.queryParams.total = data.total + this.dataList = data.records + } else { + this.queryParams.total = 0 + this.dataList = [] + } }).catch(() => { - _this.tableLoading = false + this.tableLoading = false }) }, // 序号 diff --git a/anrui-scm/anrui-scm-ui/src/views/workFlow/paichanguanliFlow/paichanguanli/cheliangpaichanEdit.vue b/anrui-scm/anrui-scm-ui/src/views/workFlow/paichanguanliFlow/paichanguanli/cheliangpaichanEdit.vue index 97a5a6bc5d..e4cfebd089 100644 --- a/anrui-scm/anrui-scm-ui/src/views/workFlow/paichanguanliFlow/paichanguanli/cheliangpaichanEdit.vue +++ b/anrui-scm/anrui-scm-ui/src/views/workFlow/paichanguanliFlow/paichanguanli/cheliangpaichanEdit.vue @@ -237,6 +237,7 @@ export default { orgDeptSid: '', carBrandSid: '', carBrandName: '', + orgPath: '', busVehicleApplyDetailList: [] }, rules: {}, @@ -274,11 +275,6 @@ export default { this.applyType_list = res.data } }) - selectSysUserList({ userSid: window.sessionStorage.getItem('userSid') }).then((resp) => { - if (resp.success) { - this.user_list = resp.data - } - }) }, init() { @@ -305,7 +301,7 @@ export default { return } this.viewState = 2 - this.$refs['divconfiguration'].showData(this.formobj.busVehicleApplyDetailList, this.formobj.carBrandSid) + this.$refs['divconfiguration'].showData(this.formobj.busVehicleApplyDetailList, this.formobj.carBrandSid, this.formobj.createOrgSid) }, handleLook(row) { this.viewState = 5 @@ -349,6 +345,11 @@ export default { this.actualPay_list = res.data } }) + selectSysUserList({ userSid: window.sessionStorage.getItem('userSid'), orgPath: this.formobj.orgPath }).then((resp) => { + if (resp.success) { + this.user_list = resp.data + } + }) } }).catch((e) => { this.formobj = row @@ -561,7 +562,7 @@ export default { }, handleShangZhuang(index) { this.viewState = 3 - this.$refs['divShangzhuangpeizhi'].showData(index) + this.$refs['divShangzhuangpeizhi'].showData(index, this.formobj.createOrgSid) }, backPeizhi(val, index) { this.viewState = 1 diff --git a/anrui-scm/anrui-scm-ui/src/views/workFlow/paichanguanliFlow/paichanguanli/chexingbyconfiguration.vue b/anrui-scm/anrui-scm-ui/src/views/workFlow/paichanguanliFlow/paichanguanli/chexingbyconfiguration.vue index 2ba37b22d2..c00210db92 100644 --- a/anrui-scm/anrui-scm-ui/src/views/workFlow/paichanguanliFlow/paichanguanli/chexingbyconfiguration.vue +++ b/anrui-scm/anrui-scm-ui/src/views/workFlow/paichanguanliFlow/paichanguanli/chexingbyconfiguration.vue @@ -133,15 +133,6 @@ export default { handleReturn() { this.$emit('doback') }, - getPathSid() { - const userSid = window.sessionStorage.getItem('userSid') - getPathSidByUserSid({ userSid: userSid }).then((res) => { - if (res.success) { - this.listQuery.params.useOrgSid = res.data - this.getList() - } - }) - }, // 查询列表信息 getList() { this.listLoading = true @@ -156,7 +147,7 @@ export default { // 查询按钮 handleFilter() { this.listQuery.current = 1 - this.getPathSid() + this.getList() }, // 重置按钮 handresetting() { @@ -168,7 +159,7 @@ export default { this.listQuery.params.useOrgSid = '' this.listQuery.params.vehicleStateValue = '' this.listQuery.params.insideCode = '' - this.getPathSid() + this.getList() }, handleSelectionChange(row) { this.sids = [] @@ -187,7 +178,7 @@ export default { }) this.sids = aa }, - showData(value, carBrandSid) { + showData(value, carBrandSid, createOrgSid) { const aa = [] if (value.length > 0) { for (var i = 0; i < value.length; i++) { @@ -204,7 +195,8 @@ export default { this.listQuery.total = 0 this.listQuery.size = 5 this.listQuery.params.carBrandSid = carBrandSid - this.getPathSid() + this.listQuery.params.useOrgSid = createOrgSid + this.getList() }, // 添加修改返回 AddUpdateReturn() { diff --git a/anrui-scm/anrui-scm-ui/src/views/workFlow/paichanguanliFlow/paichanguanli/shangzhuangselect/shuangzhuangpeizhi.vue b/anrui-scm/anrui-scm-ui/src/views/workFlow/paichanguanliFlow/paichanguanli/shangzhuangselect/shuangzhuangpeizhi.vue index a96f4cefb7..3e4263df17 100644 --- a/anrui-scm/anrui-scm-ui/src/views/workFlow/paichanguanliFlow/paichanguanli/shangzhuangselect/shuangzhuangpeizhi.vue +++ b/anrui-scm/anrui-scm-ui/src/views/workFlow/paichanguanliFlow/paichanguanli/shangzhuangselect/shuangzhuangpeizhi.vue @@ -146,13 +146,8 @@ export default { }, methods: { init() { - getPathSidByUserSid({ userSid: window.sessionStorage.getItem('userSid') }).then((res) => { - if (res.success) { - this.queryParams.params.createOrgSid = res.data - this.loadList() - } - }) this.DataDictionary() + this.loadList() }, DataDictionary() { // 上装名称 @@ -193,11 +188,12 @@ export default { break } }, - showData(index) { + showData(index, createOrgSid) { this.tableIndex = index this.queryParams.current = 1 this.queryParams.total = 0 this.queryParams.size = 5 + this.queryParams.params.createOrgSid = createOrgSid this.init() }, dosearch() { @@ -205,32 +201,31 @@ export default { this.init() }, resetQuery() { - this.queryParams = { - current: 1, - size: 5, - total: 0, - params: { - vehicleTypeKey: '', - installNameKey: '', - refitMethodKey: '', - refitFactory: '', - colorKey: '', - plateMaterial: '', - createOrgSid: '' - } - } + this.queryParams.current = 1 + this.queryParams.size = 5 + this.queryParams.total = 0 + this.queryParams.params.vehicleTypeKey = '' + this.queryParams.params.installNameKey = '' + this.queryParams.params.refitMethodKey = '' + this.queryParams.params.refitFactory = '' + this.queryParams.params.colorKey = '' + this.queryParams.params.plateMaterial = '' this.init() }, loadList() { - const _this = this this.tableLoading = true req.listPage(this.queryParams).then((resp) => { - _this.tableLoading = false - const data = resp.data - _this.queryParams.total = data.total - _this.dataList = data.records + this.tableLoading = false + if (resp.success) { + const data = resp.data + this.queryParams.total = data.total + this.dataList = data.records + } else { + this.queryParams.total = 0 + this.dataList = [] + } }).catch(() => { - _this.tableLoading = false + this.tableLoading = false }) }, // 序号 diff --git a/anrui-system-ui/src/api/User/login.js b/anrui-system-ui/src/api/User/login.js index f12ed2314c..e4472168b1 100644 --- a/anrui-system-ui/src/api/User/login.js +++ b/anrui-system-ui/src/api/User/login.js @@ -42,6 +42,13 @@ class user { method: 'get' }) } + getOrgListByUserSid(data) { + return request({ + url: '/portal/v1/sysuser/getOrgListByUserSid', + method: 'get', + params: data + }) + } } export default new user() diff --git a/anrui-system-ui/src/store/modules/user.js b/anrui-system-ui/src/store/modules/user.js index ccc864a4d8..a5c891d503 100644 --- a/anrui-system-ui/src/store/modules/user.js +++ b/anrui-system-ui/src/store/modules/user.js @@ -41,7 +41,9 @@ const actions = { Orgname: data.organizationName, dwjb: data.dwjb, pNameAndDepartmentNameAndPostName: data.pNameAndDepartmentNameAndPostName, - roleName: data.roleName + roleName: data.roleName, + defaultOrgPathName: data.defaultOrgPathName, + defaultOrgPath: data.defaultOrgPath } commit('SET_UESRINFO', user) window.sessionStorage.setItem('userSid', user.userSid) @@ -50,6 +52,8 @@ const actions = { window.sessionStorage.setItem('name', user.name) window.sessionStorage.setItem('pNameAndDepartmentNameAndPostName', user.pNameAndDepartmentNameAndPostName) window.sessionStorage.setItem('roleName', user.roleName) + window.sessionStorage.setItem('defaultOrgPathName', user.defaultOrgPathName) + window.sessionStorage.setItem('defaultOrgPath', user.defaultOrgPath) resolve(data) }).catch(error => { reject(error) diff --git a/anrui-system-ui/src/views/Home/Home.vue b/anrui-system-ui/src/views/Home/Home.vue index f175c62b5e..3b87e27e6b 100644 --- a/anrui-system-ui/src/views/Home/Home.vue +++ b/anrui-system-ui/src/views/Home/Home.vue @@ -3,10 +3,13 @@

安瑞集团信息化平台

- - -

欢迎您,{{ pNameAndDepartmentNameAndPostName }} {{ roleName }} {{ name }}

- +

欢迎您

+

+ + + +

+

{{ roleName }} {{ name }}

@@ -238,6 +241,7 @@ export default { title: '系统管理' }], userInfo: {}, + orgDept_list: [], shuliang: { workCount: '' }, @@ -253,6 +257,8 @@ export default { departmentName: '', name: '', pNameAndDepartmentNameAndPostName: '', + defaultOrgPathName: '', + defaultOrgPath: '', roleName: '', year: '' } @@ -267,6 +273,8 @@ export default { this.Orgname = window.sessionStorage.getItem('Orgname') this.departmentName = window.sessionStorage.getItem('departmentName') this.pNameAndDepartmentNameAndPostName = window.sessionStorage.getItem('pNameAndDepartmentNameAndPostName') + this.defaultOrgPathName = window.sessionStorage.getItem('defaultOrgPathName') + this.defaultOrgPath = window.sessionStorage.getItem('defaultOrgPath') this.roleName = window.sessionStorage.getItem('roleName') this.name = window.sessionStorage.getItem('name') var nowDate = new Date() @@ -285,6 +293,11 @@ export default { this.timer = setInterval(this.getNum, 20000) } }) + User.getOrgListByUserSid({ userSid: window.sessionStorage.getItem('userSid') }).then((res) => { + if (res.success) { + this.orgDept_list= res.data + } + }) }, getNum() { getTodoNum(window.sessionStorage.getItem('userSid')).then((resp) => { @@ -360,26 +373,41 @@ export default { toNavbar(name) { let myPopup = window.open(name + '?token=' + getStorage(), '_blank') }, + changeOrg(value) { + const choose = this.orgDept_list.filter((item) => item.orgName === value) + this.defaultOrgPathName = choose[0].orgName + this.defaultOrgPath = choose[0].orgPath + }, toNav(index, name, titleName) { + const organizationData = { + defaultOrgPathName: this.defaultOrgPathName, + defaultOrgPath: this.defaultOrgPath + } if (index == '9') { // this.$router.push({path: '/index'}) let myPopup = window.open('/#/index', '_blank') } else if (index == '7') { + // let myPopup = window.open('http://127.0.0.1:9531/base/#/' + '?token=' + getStorage() + '&organizationData=' + encodeURI((JSON.stringify(organizationData))), '_blank') let myPopup = window.open('http://anrui.yyundong.com/base/#/' + '?token=' + getStorage(), '_blank') // let myPopup = window.open('http://120.46.172.184/base/#/' + '?token=' + getStorage(), '_blank') } else if (index == '8') { + // let myPopup = window.open('http://127.0.0.1:9531/message/#/' + '?token=' + getStorage() + '&organizationData=' + encodeURI((JSON.stringify(organizationData))), '_blank') let myPopup = window.open('http://anrui.yyundong.com/message/#/' + '?token=' + getStorage(), '_blank') // let myPopup = window.open('http://120.46.172.184/message/#/' + '?token=' + getStorage(), '_blank') } else if (index == '1') { - let myPopup = window.open('http://anrui.yyundong.com/scm/#/' + '?token=' + getStorage(), '_blank') + // let myPopup = window.open('http://127.0.0.1:9531/scm/#/' + '?token=' + getStorage() + '&organizationData=' + encodeURI((JSON.stringify(organizationData))), '_blank') + let myPopup = window.open('http://anrui.yyundong.com/scm/#/' + '?token=' + getStorage() + '&organizationData=' + encodeURI((JSON.stringify(organizationData))), '_blank') // let myPopup = window.open('http://120.46.172.184/scm/#/' + '?token=' + getStorage(), '_blank') } else if (index == '4') { + // let myPopup = window.open('http://127.0.0.1:9531/fin/#/' + '?token=' + getStorage() + '&organizationData=' + encodeURI((JSON.stringify(organizationData))), '_blank') let myPopup = window.open('http://anrui.yyundong.com/fin/#/' + '?token=' + getStorage(), '_blank') // let myPopup = window.open('http://120.46.172.184/fin/#/' + '?token=' + getStorage(), '_blank') } else if (index == '5') { + // let myPopup = window.open('http://127.0.0.1:9531/manage/#/' + '?token=' + getStorage() + '&organizationData=' + encodeURI((JSON.stringify(organizationData))), '_blank') let myPopup = window.open('http://anrui.yyundong.com/manage/#/' + '?token=' + getStorage(), '_blank') // let myPopup = window.open('http://120.46.172.184/manage/#/' + '?token=' + getStorage(), '_blank') } else if (index == '0') { + // let myPopup = window.open('http://127.0.0.1:9531/buscenter/#/' + '?token=' + getStorage() + '&organizationData=' + encodeURI((JSON.stringify(organizationData))), '_blank') let myPopup = window.open('http://anrui.yyundong.com/buscenter/#/' + '?token=' + getStorage(), '_blank') // let myPopup = window.open('http://120.46.172.184/buscenter/#/' + '?token=' + getStorage(), '_blank') } @@ -592,4 +620,12 @@ p { font-size: 14px !important; } } +.selectStyle { + ::v-deep .el-input__inner { + border: 0px !important; + background-color: #0294d7 !important; + font-size: 17px; + color: #FFFFFF; + } +} diff --git a/anrui-system-ui/src/views/organizationManage/organizationManage.vue b/anrui-system-ui/src/views/organizationManage/organizationManage.vue index 7f5f08576a..df37ffdab0 100644 --- a/anrui-system-ui/src/views/organizationManage/organizationManage.vue +++ b/anrui-system-ui/src/views/organizationManage/organizationManage.vue @@ -34,9 +34,11 @@ - 组织简称 + 主管人员 - + + + 分管人员 @@ -45,6 +47,12 @@ + + 组织简称 + + + + 管理层级 @@ -200,9 +208,11 @@ - 组织简称 + 主管人员 - + + + 分管人员 @@ -211,6 +221,12 @@ + + 组织简称 + + + + 管理层级 @@ -268,7 +284,7 @@ import { addOrgTree, delOrgtree, - getQrCode, + getQrCode, getStaff, getStaffName, orgList, pageList, @@ -339,6 +355,7 @@ export default { }, tableData: [], treedata: [], + staffdata: [], staffdata2: [], rules: {} } @@ -455,9 +472,11 @@ export default { this.form.organizationSid = this.$store.getters.userInfo.orgSid this.form.address = data.orgAddress || data.address this.form.dlxx = data.gisInfo || data.dlxx + this.getStaff(data.sid) this.getStaff2(data.sid) }, editRow(row) { + this.getStaff(row.sid) this.getStaff2(row.sid) this.dialogTitle = '编辑' this.isshow = 'edit' @@ -477,6 +496,7 @@ export default { }) }, deit(data) { // 节点编辑保存 + this.getStaff(data.sid) this.getStaff2(data.sid) console.log(data, 8888) this.dialogVisible = true @@ -542,6 +562,14 @@ export default { this.page.params.name = '' this.getPageList(this.page) }, + // 主管人员 + getStaff(orgSid) { + getStaff({ deptSid: orgSid }).then((res) => { + if (res.success) { + this.staffdata = res.data + } + }) + }, // 分管人员 getStaff2(orgSid) { getStaffName({ deptSid: orgSid }).then(res => {