Browse Source

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

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

Loading…
Cancel
Save