Browse Source

修改问题

张保健 4 years ago
parent
commit
f471ea0beb
1 changed files with 26 additions and 8 deletions
  1. 26 8
      src/xt_pages/management/home.vue

+ 26 - 8
src/xt_pages/management/home.vue View File

@@ -2969,7 +2969,7 @@ export default {
2969 2969
         var bed_numberss = parseInt(bed_numbers)
2970 2970
         this.form.bed_number = bed_numberss
2971 2971
         this.$refs[formName].validate(valid => {
2972
-          UpdateMachineInfo(this.form).then(response => {
2972
+          UpdateMachineInfo(this.form).then(response => {debugger
2973 2973
             // console.log('form', this.form)
2974 2974
             if (response.data.state === 1) {
2975 2975
               var addmacher = response.data.data.addmacher
@@ -2980,14 +2980,14 @@ export default {
2980 2980
               for(let i = 0;i < this.tableDatatwo.length;i++) {
2981 2981
                 if(this.tableDatatwo[i].id == addmacher.id) {
2982 2982
                   this.tableDatatwo[i] = addmacher
2983
-                  this.$refs.singleTable.setCurrentRow(this.tableDatatwo[i])
2984
-                  this.$forceUpdate
2983
+                  // this.$refs.singleTable.setCurrentRow(this.tableDatatwo[i])
2984
+                  // this.$forceUpdate
2985 2985
                 }
2986 2986
               }
2987 2987
               // this.getAllMachine()
2988 2988
               // this.getAllSubregion()
2989
-              // this.$refs.singleTable.setCurrentRow(addmacher)
2990
-              // this.$forceUpdate()
2989
+              this.$refs.singleTable.setCurrentRow(addmacher)
2990
+              this.$forceUpdate()
2991 2991
             }
2992 2992
           })
2993 2993
         })
@@ -3025,9 +3025,19 @@ export default {
3025 3025
               if (response.data.state === 1) {
3026 3026
                 // eslint-disable-next-line no-unused-vars
3027 3027
                 var addmacher = response.data.data.addmacher
3028
+
3028 3029
                 this.$message.success('修改成功')
3029
-                this.getAllMachine()
3030
+                for(let i = 0;i < this.tableDatatwo.length;i++) {
3031
+                  if(this.tableDatatwo[i].id == addmacher.id) {
3032
+                    this.tableDatatwo[i] = addmacher
3033
+                
3034
+                  }
3035
+                }
3036
+                // this.getAllMachine()
3037
+                this.$forceUpdate
3030 3038
                 this.getAllSubregion()
3039
+                // this.$refs.singleTable.setCurrentRow(addmacher)
3040
+                
3031 3041
               }
3032 3042
             })
3033 3043
           }
@@ -3053,9 +3063,17 @@ export default {
3053 3063
         this.$refs[formName].validate(valid => {
3054 3064
           UpdateMacheineTwo(this.form).then(response => {
3055 3065
             if (response.data.state === 1) {
3056
-              var add = response.data.data.addmacher
3066
+              var addmacher = response.data.data.addmacher
3057 3067
               this.$message.success('修改成功')
3058
-              this.getAllMachine()
3068
+              for(let i = 0;i < this.tableDatatwo.length;i++) {
3069
+                  if(this.tableDatatwo[i].id == addmacher.id) {
3070
+                    this.tableDatatwo[i] = addmacher
3071
+
3072
+                  }
3073
+                }
3074
+                // this.getAllMachine()
3075
+                this.$forceUpdate
3076
+              // this.getAllMachine()
3059 3077
               this.getAllSubregion()
3060 3078
             }
3061 3079
           })