tanyanfei hace 5 años
padre
commit
f7efae55c9
Se han modificado 4 ficheros con 51 adiciones y 5 borrados
  1. 0 2
      src/views/Home.vue
  2. 17 1
      src/views/apply/Change.vue
  3. 17 1
      src/views/apply/New.vue
  4. 17 1
      src/views/apply/Update.vue

+ 0 - 2
src/views/Home.vue

@@ -113,8 +113,6 @@ export default {
           	})
 		}
 	},
-	$route(to){
-    },
 	created(){
 		// console.log(this.$route)
 		this.getData()

+ 17 - 1
src/views/apply/Change.vue

@@ -262,7 +262,7 @@ export default {
       getData(){
           var parm=this.form;
           this.loading=true;
-          if(this.order_status != '-3'){parm.order_status=this.order_status}
+          if(this.order_status != '-3'){parm.order_status=this.order_status}else{parm.order_status=''}
           this.$api.getSignList(parm).then(res=>{
               let data=res.data.data.list;
               for(let i=0;i<data.length;i++){
@@ -459,6 +459,22 @@ export default {
           }
       }
   },
+  watch:{
+    $route(to){
+        console.log(to)
+        this.subject_id=to.path.split('/')[2]
+        this.$api.getSubList().then(res=>{
+          let data=res.data.data;
+            for(let i=0;i<data.length;i++){
+                if(data[i].id == this.subject_id){
+                    this.subject_item=data[i].name
+                    this.form.subject_item=data[i].name
+                }
+            }
+            this.getData()
+      })
+    },
+  },
   created(){
       this.subject_id=this.$route.path.split('/')[2]
       this.$api.getSubList().then(res=>{

+ 17 - 1
src/views/apply/New.vue

@@ -262,7 +262,7 @@ export default {
       getData(){
           var parm=this.form;
           this.loading=true;
-          if(this.order_status != '-3'){parm.order_status=this.order_status}
+          if(this.order_status != '-3'){parm.order_status=this.order_status}else{parm.order_status=''}
           this.$api.getSignList(parm).then(res=>{
               let data=res.data.data.list;
               for(let i=0;i<data.length;i++){
@@ -459,6 +459,22 @@ export default {
           }
       }
   },
+  watch:{
+    $route(to){
+        console.log(to)
+        this.subject_id=to.path.split('/')[2]
+        this.$api.getSubList().then(res=>{
+          let data=res.data.data;
+            for(let i=0;i<data.length;i++){
+                if(data[i].id == this.subject_id){
+                    this.subject_item=data[i].name
+                    this.form.subject_item=data[i].name
+                }
+            }
+            this.getData()
+      })
+    },
+  },
   created(){
       this.subject_id=this.$route.path.split('/')[2]
       this.$api.getSubList().then(res=>{

+ 17 - 1
src/views/apply/Update.vue

@@ -262,7 +262,7 @@ export default {
       getData(){
           var parm=this.form;
           this.loading=true;
-          if(this.order_status != '-3'){parm.order_status=this.order_status}
+          if(this.order_status != '-3'){parm.order_status=this.order_status}else{parm.order_status=''}
           this.$api.getSignList(parm).then(res=>{
               let data=res.data.data.list;
               for(let i=0;i<data.length;i++){
@@ -459,6 +459,22 @@ export default {
           }
       }
   },
+  watch:{
+    $route(to){
+        console.log(to)
+        this.subject_id=to.path.split('/')[2]
+        this.$api.getSubList().then(res=>{
+          let data=res.data.data;
+            for(let i=0;i<data.length;i++){
+                if(data[i].id == this.subject_id){
+                    this.subject_item=data[i].name
+                    this.form.subject_item=data[i].name
+                }
+            }
+            this.getData()
+      })
+    },
+  },
   created(){
       this.subject_id=this.$route.path.split('/')[2]
       this.$api.getSubList().then(res=>{