diff --git a/src/views/modules/inspection/com_inspectionScheduleView.vue b/src/views/modules/inspection/com_inspectionScheduleView.vue
index 6814da4..4d23593 100644
--- a/src/views/modules/inspection/com_inspectionScheduleView.vue
+++ b/src/views/modules/inspection/com_inspectionScheduleView.vue
@@ -22,9 +22,9 @@
style="width: 100%;"
:max-height="qcTableHeight"
class="qc-table">
-
-
-
+
+
+
import { searchInspectionRequestHeaderList, auditInspectionRequest } from '@/api/inspection/inspectionRequestHeader.js'
+import { getPermissionValue } from '@/api/sys/specialSecurity.js'
import Chooselist from '@/views/modules/common/Chooselist_eam'
import ComInspectionRequestDetail from './com_inspectionRequestDetail.vue'
import ComInspectionRequestDetailTab from './com_inspectionRequestDetailTab.vue'
@@ -146,6 +147,8 @@ export default {
tagNo: '',
searchType: '',
activeTab: 'base',
+ // SRM0004 特殊权限:有权限可查看所有审核任务,无权限仅能查看自己作为 planner 的数据
+ canViewAllTasks: false,
searchData: {
requestNo: '',
supplierNo: '',
@@ -464,7 +467,8 @@ export default {
const calculatedHeight = (window.innerHeight - 220) / 2
this.height = calculatedHeight
this.detailHeight = calculatedHeight
- this.loadMainOrReminder()
+ // 先确认 SRM0004 权限再加载,避免首次查询泄漏他人数据
+ this.checkViewAllPermission()
})
},
watch: {
@@ -493,6 +497,23 @@ export default {
}
return ''
},
+ // 查询 SRM0004 特殊权限:是否允许查看所有审核任务
+ checkViewAllPermission () {
+ const username = this.$store.state.user.name || ''
+ if (!username) {
+ this.canViewAllTasks = false
+ this.loadMainOrReminder()
+ return
+ }
+ getPermissionValue(username, 'SRM0004').then(({ data }) => {
+ this.canViewAllTasks = !!(data && data.code === 0 && String(data.value).trim() === 'Y')
+ this.loadMainOrReminder()
+ }).catch(error => {
+ console.error('查询查看所有审核任务权限失败:', error)
+ this.canViewAllTasks = false
+ this.loadMainOrReminder()
+ })
+ },
loadMainOrReminder () {
// 首页跳转带入的 planner 条件仅首次生效 - rqrq
const plannerAccount = this.getRoutePlannerAccount()
@@ -550,6 +571,10 @@ export default {
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
this.searchData.status = 'Confirmed' // 强制只查询已确认的
+ // 无 SRM0004 权限时,强制只查当前用户作为 planner 的数据
+ if (!this.canViewAllTasks) {
+ this.searchData.plannerAccount = this.$store.state.user.name
+ }
// 后端查询字段使用 planStartDateStr/planEndDateStr - rqrq
this.searchData.planStartDateStr = this.searchData.planStartDate || ''
this.searchData.planEndDateStr = this.searchData.planEndDate || ''
diff --git a/src/views/modules/inspection/inspectionScheduleList.vue b/src/views/modules/inspection/inspectionScheduleList.vue
index 1c5fbc2..db65242 100644
--- a/src/views/modules/inspection/inspectionScheduleList.vue
+++ b/src/views/modules/inspection/inspectionScheduleList.vue
@@ -233,6 +233,7 @@ export default {
requestNo: '',
supplierNo: '',
supplierName: '',
+ plannerAccount: '',
status: 'AUDITED', // 默认状态为已审核
qcOperator: '',
createBy: '',
@@ -603,6 +604,8 @@ export default {
getMainData () {
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
+ // 排程页仅限 Planner 查看自己名下的数据,强制按当前登录账号过滤
+ this.searchData.plannerAccount = this.$store.state.user.name
// 后端查询字段使用 planStartDateStr/planEndDateStr - rqrq
this.searchData.planStartDateStr = this.searchData.planStartDate || ''
this.searchData.planEndDateStr = this.searchData.planEndDate || ''