Bläddra i källkod

Merge remote-tracking branch 'origin/master'

guarantee-lsq 2 veckor sedan
förälder
incheckning
5c918954b8
1 ändrade filer med 12 tillägg och 10 borttagningar
  1. 12 10
      src/views/repair/application-form/RepairForm.vue

+ 12 - 10
src/views/repair/application-form/RepairForm.vue

@@ -162,13 +162,12 @@ export default {
     }
   },
   data() {
-    // 从通知链接跳转时(带no参数)或「我的工单」页面,不默认按本部门筛选,显示全部工单
+    // 从通知链接跳转时(带no参数)不默认按本部门筛选,其他情况默认显示本部门工单
     const hasNoParam = this.$route.query.no != null
-    const skipDeptDefault = hasNoParam || this.searchType === 2
     return {
       // 查询参数
       queryParam: {
-        deptIdList: skipDeptDefault ? [] : [this.$store.getters.userInfo.deptId],
+        deptIdList: hasNoParam ? [] : [this.$store.getters.userInfo.deptId],
         searchStartTime: null,
         searchEndTime: null
       },
@@ -443,16 +442,19 @@ export default {
       this.selectedRows = selectedRows
     },
     resetSearchForm() {
-      // 重置时:通知跳转(带no参数)或「我的工单」页面不恢复部门筛选
+      // 重置时:仅通知跳转(带no参数)不恢复部门筛选,其他情况恢复默认部门
       const no = this.$route.query.no
-      const skipDeptDefault = no != null || this.searchType === 2
-      this.queryParam = {
-        deptIdList: skipDeptDefault ? [] : [this.$store.getters.userInfo.deptId],
-        searchStartTime: null,
-        searchEndTime: null
-      }
+      // 先清空所有查询条件,让 a-select 组件先响应清空状态
+      this.queryParam.deptIdList = []
+      this.queryParam.searchStartTime = null
+      this.queryParam.searchEndTime = null
       if (no != null) {
         this.queryParam.no = no
+      } else {
+        // 等 a-select 同步清空后,再恢复默认部门,避免标签删不掉
+        this.$nextTick(() => {
+          this.queryParam.deptIdList = [this.$store.getters.userInfo.deptId]
+        })
       }
       this.$refs.table.refresh(true)
     },