Browse Source

HL-5631 供应商发货记录质检明细不显示 权限按钮

hella_online_20240828
wangyufei 3 months ago
parent
commit
5e50f7dca4
  1. 27
      src/components/Detail/src/Detail.vue
  2. 1
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/index.vue

27
src/components/Detail/src/Detail.vue

@ -209,6 +209,7 @@ import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import DetailTable from '@/components/DetailTable/src/DetailTable.vue' import DetailTable from '@/components/DetailTable/src/DetailTable.vue'
import { SearchTable } from '@/components/SearchTable' import { SearchTable } from '@/components/SearchTable'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
defineOptions({ name: 'Detail' }) defineOptions({ name: 'Detail' })
@ -443,6 +444,23 @@ const props = defineProps({
default: 8 default: 8
} }
}) })
const filterPermissionAnnexTable = ()=>{
return props.annexTable.filter(item=>{
const { wsCache } = useCache()
const permissions = wsCache.get(CACHE_KEY.USER).permissions
const all_permission = '*:*:*'
if(item?.hasPermi&&item?.hasPermi.length > 0){
const hasPermissions = permissions.find((permission: string) => {
return all_permission === permission || item?.hasPermi === permission
})
if(!hasPermissions){
console.log('hasPermi',item)
return false
}
}
return true
})
}
const isShowDrawer = ref(false) const isShowDrawer = ref(false)
const detailLoading = ref(false) const detailLoading = ref(false)
const tabsList = ref(JSON.parse(JSON.stringify(props.tabs ? props.tabs : ''))) const tabsList = ref(JSON.parse(JSON.stringify(props.tabs ? props.tabs : '')))
@ -471,7 +489,7 @@ if(props.slotDetailTabList){
} }
let otherList = [...props.annexTable,{ let otherList = [...filterPermissionAnnexTable(),{
label:props.annexAlias.label, label:props.annexAlias.label,
prop:'Annex' prop:'Annex'
},{ },{
@ -482,7 +500,7 @@ let otherList = [...props.annexTable,{
prop:'ChangeRecord' prop:'ChangeRecord'
}] }]
if(props.annexAlias.hidden){ if(props.annexAlias.hidden){
otherList = [...props.annexTable,{ otherList = [...filterPermissionAnnexTable(),{
label:'备注', label:'备注',
prop:'Remarks' prop:'Remarks'
},{ },{
@ -548,9 +566,12 @@ const getFileList = async () => {
detailLoading.value = false detailLoading.value = false
} }
} }
// //
const getAnnexFileList = async (row) => { const getAnnexFileList = async (row) => {
props.annexTable?.forEach(async (item) => { let annexTable = filterPermissionAnnexTable()
annexTable?.forEach(async (item) => {
let requstData = {...remarksData.data,tableName: item?.tableName} let requstData = {...remarksData.data,tableName: item?.tableName}
if(item?.queryParams){ if(item?.queryParams){
item?.queryParams?.forEach(queryItem => { item?.queryParams?.forEach(queryItem => {

1
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/index.vue

@ -56,6 +56,7 @@
:annexTable="[{ :annexTable="[{
label: '质检明细', label: '质检明细',
prop: 'uploadFile', prop: 'uploadFile',
hasPermi:'wms:supplierdeliver-request-main:uploadCheck',
tableName:'SupplierdeliverInspectionDetail', tableName:'SupplierdeliverInspectionDetail',
hasSubDetail:true, // hasSubDetail:true, //
showPreview:true, // showPreview:true, //

Loading…
Cancel
Save