Browse Source

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

see999 4 years ago
parent
commit
59a4135e64

+ 16 - 1
src/xt_pages/workforce/next_remind_print.vue View File

@@ -145,7 +145,14 @@
145 145
         var resp = rs.data
146 146
         console.log(resp)
147 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 156
         } else {
150 157
           this.$message.error(resp.msg)
151 158
         }
@@ -281,7 +288,15 @@
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 302
 </script>

+ 17 - 4
src/xt_pages/workforce/remind_print.vue View File

@@ -134,7 +134,14 @@
134 134
         var resp = rs.data
135 135
         console.log(resp)
136 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 145
         } else {
139 146
           this.$message.error(resp.msg)
140 147
         }
@@ -267,11 +274,17 @@
267 274
         }else{
268 275
           var str = year + "年" + month + "月" + day + "日  " + days;
269 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 289
 </script>
277 290