Pārlūkot izejas kodu

Merge branch '20201109_pc_vue_new_branch' of http://git.shengws.com/csx/Vue_New into 20201109_pc_vue_new_branch

see999 4 gadus atpakaļ
vecāks
revīzija
59a4135e64

+ 16 - 1
src/xt_pages/workforce/next_remind_print.vue Parādīt failu

145
         var resp = rs.data
145
         var resp = rs.data
146
         console.log(resp)
146
         console.log(resp)
147
         if (resp.state == 1) {
147
         if (resp.state == 1) {
148
-          this.scheduleData = resp.data.schedule
148
+         var scheduleData = resp.data.schedule
149
+
150
+         for(let i=0;i<scheduleData.length;i++){
151
+             scheduleData[i].sort = scheduleData[i].number.sort
152
+          }
153
+          var arr = scheduleData.sort(this.compare('sort'))
154
+          console.log("打印数据",arr)
155
+          this.scheduleData = arr
149
         } else {
156
         } else {
150
           this.$message.error(resp.msg)
157
           this.$message.error(resp.msg)
151
         }
158
         }
281
         }
288
         }
282
         
289
         
283
         
290
         
291
+      },
292
+
293
+       compare(property) {
294
+       return function (a, b) {
295
+          var value1 = a[property];
296
+          var value2 = b[property];
297
+          return value1 - value2;
284
       }
298
       }
299
+     },
285
     }
300
     }
286
   }
301
   }
287
 </script>
302
 </script>

+ 17 - 4
src/xt_pages/workforce/remind_print.vue Parādīt failu

134
         var resp = rs.data
134
         var resp = rs.data
135
         console.log(resp)
135
         console.log(resp)
136
         if (resp.state == 1) {
136
         if (resp.state == 1) {
137
-          this.scheduleData = resp.data.schdules
137
+           var scheduleData = resp.data.schdules
138
+           console.log("树",scheduleData)
139
+          for(let i=0;i<scheduleData.length;i++){
140
+             scheduleData[i].sort = scheduleData[i].number.sort
141
+          }
142
+          var arr = scheduleData.sort(this.compare('sort'))
143
+          console.log("打印数据",arr)
144
+          this.scheduleData = arr
138
         } else {
145
         } else {
139
           this.$message.error(resp.msg)
146
           this.$message.error(resp.msg)
140
         }
147
         }
267
         }else{
274
         }else{
268
           var str = year + "年" + month + "月" + day + "日  " + days;
275
           var str = year + "年" + month + "月" + day + "日  " + days;
269
           return str;
276
           return str;
270
-        }
271
-        
272
-        
277
+        } 
278
+      },
279
+      compare(property) {
280
+       return function (a, b) {
281
+          var value1 = a[property];
282
+          var value2 = b[property];
283
+          return value1 - value2;
273
       }
284
       }
285
+     },
274
     }
286
     }
287
+   
275
   }
288
   }
276
 </script>
289
 </script>
277
 
290