浏览代码

fix(repair): 修复通知跳转工单查看权限问题

- 从通知链接跳转时不再默认按本部门筛选,避免跨部门工单看不到
- 通知跳转过来时清除部门筛选条件,确保能查看目标工单
- 重置搜索表单时保留通知跳转标识,维持正确的筛选状态
- 修复查询参数初始化逻辑,支持带no参数的通知跳转场景
dazhaxie 6 小时之前
父节点
当前提交
41b5902b3c
共有 1 个文件被更改,包括 11 次插入3 次删除
  1. 11 3
      src/views/repair/application-form/RepairForm.vue

+ 11 - 3
src/views/repair/application-form/RepairForm.vue

@@ -162,10 +162,12 @@ export default {
     }
   },
   data() {
+    // 从通知链接跳转时(带no参数),不默认按本部门筛选,避免跨部门工单看不到
+    const hasNoParam = this.$route.query.no != null
     return {
       // 查询参数
       queryParam: {
-        deptId: this.$store.getters.userInfo.deptId,
+        deptId: hasNoParam ? null : this.$store.getters.userInfo.deptId,
         searchStartTime: null,
         searchEndTime: null
       },
@@ -339,6 +341,8 @@ export default {
     const no = this.$route.query.no
     if (no != null) {
       this.queryParam.no = no
+      // 从通知跳转过来时,清除部门筛选,确保能看到该工单
+      this.queryParam.deptId = null
     }
     // 部门下拉数据
     queryDept({}).then(res => {
@@ -437,12 +441,16 @@ export default {
       this.selectedRows = selectedRows
     },
     resetSearchForm() {
+      // 重置时:如果是从通知跳转(带no参数),则不恢复部门筛选
+      const no = this.$route.query.no
       this.queryParam = {
-
-        deptId: this.$store.getters.userInfo.deptId,
+        deptId: no != null ? null : this.$store.getters.userInfo.deptId,
         searchStartTime: null,
         searchEndTime: null
       }
+      if (no != null) {
+        this.queryParam.no = no
+      }
       this.$refs.table.refresh(true)
     },
     doExport() {