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/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 }) }, // 序号