linwenxin 1 рік тому
батько
коміт
d3f93de89d

+ 1 - 1
src/views/workOrder/workOrderPool/detail.vue

@@ -53,7 +53,7 @@ export default {
   },
   data() {
     return {
-      activeName: this.$route.query.activeName || 'workOrderInfo',
+      activeName: this?.$route?.params?.pagePam || 'workOrderInfo',
       EvaluationShow: false,
       SettleAccountsShow: false
     }

+ 27 - 57
src/views/workOrder/workOrderPool/index.vue

@@ -204,54 +204,24 @@ export default {
   },
   methods: {
     initFun() {
-      if (this.$route.path === "/workOrder/workOrderPool") {
-        if (this.$route.query.id) {
-          this.createFormBool = false
-          this.detailFormBool = false
-          this.recordSelected = []
-          this.$nextTick(() => {
-            this.id = this.$route.query.id
-            this.$nextTick(() => {
-              this.detailFormBool = true
-            })
-          })
-        }
-        if (this.$route.query.saleOrderId) {
-          this.createFormBool = false
-          this.detailFormBool = false
-          this.recordSelected = []
-          this.$nextTick(() => {
-            this.defaultSearchData = [{ "param": "a.sale_order_id", "compare": "=", "value": this.$route.query.saleOrderId, label: "销售订单号" }]
-            this.$nextTick(() => {
-              // this.defaultSearchData = []
-              this.$router.push({ name: "workOrderPool", params: {}, query: {} })
-            })
-          })
-        }
-        if (this.$route.query.pgIncreItemId) {
-          this.createFormBool = false
-          this.detailFormBool = false
-          this.recordSelected = []
-          this.$nextTick(() => {
-            this.defaultSearchData = [{ "param": "a.pg_incre_order_id", "compare": "=", "value": this.$route.query.pgIncreItemId, label: "增置服务明细ID" }]
-            this.$nextTick(() => {
-              // this.defaultSearchData = []
-              this.$router.push({ name: "workOrderPool", params: {}, query: {} })
-            })
-          })
-        }
-        if (this.$route.query.rpProjectRepairId) {
-          this.createFormBool = false
-          this.detailFormBool = false
-          this.recordSelected = []
-          this.$nextTick(() => {
-            this.defaultSearchData = [{ "param": "a.rp_project_repair_id", "compare": "=", "value": this.$route.query.rpProjectRepairId, label: "维保配置ID" }]
-            this.$nextTick(() => {
-              // this.defaultSearchData = []
-              this.$router.push({ name: "workOrderPool", params: {}, query: {} })
-            })
-          })
-        }
+      if(this.pageType == "detail"){
+        this.id = this.pageCode
+        this.$nextTick(() => {
+          this.detailFormBool = true
+        })
+      }
+      
+      if(this.pageType == "saleOrderId"){
+        this.defaultSearchData = [{ "param": "a.sale_order_id", "compare": "=", "value": this.pageCode, label: "销售订单号" }]
+      }
+
+
+      if(this.pageType == "pgIncreItemId"){
+        this.defaultSearchData = [{ "param": "a.pg_incre_order_id", "compare": "=", "value": this.pageCode, label: "增置服务明细ID" }]
+      }
+
+      if(this.pageType == "rpProjectRepairId"){
+        this.defaultSearchData = [{ "param": "a.rp_project_repair_id", "compare": "=", "value": this.pageCode, label: "维保配置ID" }]
       }
     },
 
@@ -324,15 +294,15 @@ export default {
         if (pam.orderSmallType) {
           pam.params.push({ "param": "a.order_small_type", "compare": "=", "value": pam.orderSmallType })
         }
-        if (this.$route.query.saleOrderId && !pam.params.find(item => item.param == "a.sale_order_id")) {
-          pam.params.push({ "param": "a.sale_order_id", "compare": "like", "value": this.$route.query.saleOrderId, label: "销售订单号" })
-        }
-        if (this.$route.query.pgIncreItemId && !pam.params.find(item => item.param == "a.pg_incre_order_id")) {
-          pam.params.push({ "param": "a.pg_incre_order_id", "compare": "like", "value": this.$route.query.pgIncreItemId, label: "增置服务明细ID" })
-        }
-        if (this.$route.query.rpProjectRepairId  && !pam.params.find(item => item.param == "a.rp_project_repair_id")) {
-          pam.params.push({ "param": "a.rp_project_repair_id", "compare": "=", "value": this.$route.query.rpProjectRepairId })
-        }
+        // if (this.$route.query.saleOrderId && !pam.params.find(item => item.param == "a.sale_order_id")) {
+        //   pam.params.push({ "param": "a.sale_order_id", "compare": "like", "value": this.$route.query.saleOrderId, label: "销售订单号" })
+        // }
+        // if (this.$route.query.pgIncreItemId && !pam.params.find(item => item.param == "a.pg_incre_order_id")) {
+        //   pam.params.push({ "param": "a.pg_incre_order_id", "compare": "like", "value": this.$route.query.pgIncreItemId, label: "增置服务明细ID" })
+        // }
+        // if (this.$route.query.rpProjectRepairId  && !pam.params.find(item => item.param == "a.rp_project_repair_id")) {
+        //   pam.params.push({ "param": "a.rp_project_repair_id", "compare": "=", "value": this.$route.query.rpProjectRepairId })
+        // }
         cb && cb(pam)
         return orderBaseList(pam)
       } catch (err) {