Browse Source

完善出库申请--数据权限、按钮功能化、本人权限

zhanglei
yunuo970428 2 years ago
parent
commit
ea20ceeca2
  1. 10
      anrui-buscenter/anrui-buscenter-ui/src/api/dictcommons/dictcommons.js
  2. 41
      anrui-buscenter/anrui-buscenter-ui/src/views/chukuguanli/chukubanli/chukushenqing.vue

10
anrui-buscenter/anrui-buscenter-ui/src/api/dictcommons/dictcommons.js

@ -125,3 +125,13 @@ export function getTypeValueList(data) {
params: data
})
}
// 根据当前登录用户的角色获取菜单分页列表页面右上角按钮的隐藏
export function getButtonPermissions(data) {
return request({
url: '/portal/v1/sysfunction/getButtonPermissions',
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }
})
}

41
anrui-buscenter/anrui-buscenter-ui/src/views/chukuguanli/chukubanli/chukushenqing.vue

@ -117,7 +117,7 @@
<script>
import { delBySids, pagerList, revokeProcess } from '@/api/chukuguanli/chukubanli'
import { typeValues, selectHaveMessage } from '@/api/dictcommons/dictcommons'
import { typeValues, selectHaveMessage, getButtonPermissions } from '@/api/dictcommons/dictcommons'
import { getStorage } from '@/utils/auth'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
@ -149,6 +149,7 @@ export default {
payType: [],
list: [],
sids: [], // SIDs
multipleSelection: [],
FormLoading: false,
listLoading: false,
//
@ -163,7 +164,9 @@ export default {
applySid: '', // sid
contractNo: '', //
name: '', //
paymentMethodKey: ''
paymentMethodKey: '',
menuUrl: '',
orgPath: ''
}
},
btnList: [
@ -199,7 +202,18 @@ export default {
mounted() {
// vuewindowpostMessagehandleMessage
window.addEventListener('message', this.handleMessage)
this.$refs['btnbar'].setButtonList(this.btnList)
getButtonPermissions({ userSid: window.sessionStorage.getItem('userSid'), url: this.$route.path, type: 0 }).then((res) => {
if (res.success) {
for (var i = 0; i < res.data.length; i++) {
for (var k = 0; k < this.btnList.length; k++) {
if (res.data[i].buttonId === this.btnList[k].btnKey) {
this.btnList.splice(k, 1)
}
}
}
this.$refs['btnbar'].setButtonList(this.btnList)
}
})
},
methods: {
async handleMessage(event) {
@ -289,6 +303,7 @@ export default {
// sid
handleSelectionChange(row) {
const aa = []
this.multipleSelection = row
row.forEach(element => {
aa.push(element.sid)
})
@ -300,6 +315,8 @@ export default {
getList() {
this.listLoading = true
this.listQuery.params.applySid = window.sessionStorage.getItem('userSid')
this.listQuery.params.menuUrl = this.$route.path
this.listQuery.params.orgPath = window.sessionStorage.getItem('defaultOrgPath')
pagerList(this.listQuery).then(response => { //
this.listLoading = false
if (response.success) {
@ -329,7 +346,9 @@ export default {
applySid: '', // sid
contractNo: '', //
name: '', //
paymentMethodKey: ''
paymentMethodKey: '',
menuUrl: '',
orgPath: ''
}
}
this.getList()
@ -344,8 +363,12 @@ export default {
},
//
toEdit(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
if (row.allowModify) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
} else {
this.$message({ showClose: true, type: 'error', message: '非本人发起的申请,无权限操作' })
}
},
//
toInfo(row) {
@ -358,6 +381,12 @@ export default {
this.$message({ showClose: true, type: 'error', message: '请选择至少一条记录进行删除操作' })
return
}
for (var i = 0; i < this.multipleSelection.length; i++) {
if (!this.multipleSelection[i].allowModify) {
this.$message({ showClose: true, type: 'error', message: '非本人发起的申请,无权限操作' })
return
}
}
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',

Loading…
Cancel
Save