Browse Source

排序问题处理

XMLWAN 4 years ago
parent
commit
47f7342e07
2 changed files with 9 additions and 2 deletions
  1. 5 1
      src/pages/main/add_urgent_schedule.vue
  2. 4 1
      src/utils/tools.js

+ 5 - 1
src/pages/main/add_urgent_schedule.vue View File

130
     </van-popup>
130
     </van-popup>
131
     <van-popup v-model="show_sch_type_picker" position="bottom" class="popup">
131
     <van-popup v-model="show_sch_type_picker" position="bottom" class="popup">
132
       <van-picker
132
       <van-picker
133
+        :default-index="defaultIndex"
133
         ref="schedule"
134
         ref="schedule"
134
         :columns="schedule_types"
135
         :columns="schedule_types"
135
         value-key="text"
136
         value-key="text"
184
       current_devices: [],
185
       current_devices: [],
185
       zone_device_options: [],
186
       zone_device_options: [],
186
 
187
 
187
-      origin_schedules: []
188
+      origin_schedules: [],
189
+      defaultIndex: 0
188
     };
190
     };
189
   },
191
   },
190
   computed: {
192
   computed: {
221
       for (let index = 0; index < this.schedule_types.length; index++) {
223
       for (let index = 0; index < this.schedule_types.length; index++) {
222
         const type = this.schedule_types[index];
224
         const type = this.schedule_types[index];
223
         if (type.value == this.schedule_type) {
225
         if (type.value == this.schedule_type) {
226
+          this.defaultIndex = this.schedule_type - 1;
224
           return type.text;
227
           return type.text;
225
         }
228
         }
226
       }
229
       }
251
         // console.log(rs.data.data)
254
         // console.log(rs.data.data)
252
         if (rs.data.state == 1) {
255
         if (rs.data.state == 1) {
253
           this.origin_schedules = rs.data.data.schedules;
256
           this.origin_schedules = rs.data.data.schedules;
257
+          console.log("数据源", this.origin_schedules);
254
           this.patients = rs.data.data.patients;
258
           this.patients = rs.data.data.patients;
255
           console.log(this.patients);
259
           console.log(this.patients);
256
           this.modes = rs.data.data.modes;
260
           this.modes = rs.data.data.modes;

+ 4 - 1
src/utils/tools.js View File

186
     return 0
186
     return 0
187
   }
187
   }
188
   shouji = parseFloat(shouji)
188
   shouji = parseFloat(shouji)
189
+  console.log('shouji', shouji)
189
   shichang = parseFloat(shichang)
190
   shichang = parseFloat(shichang)
191
+  console.log('时长', shichang)
190
   weichi = parseFloat(weichi)
192
   weichi = parseFloat(weichi)
193
+  console.log('维持', weichi)
191
   if (isNaN(shouji) || isNaN(shichang) || isNaN(weichi)) {
194
   if (isNaN(shouji) || isNaN(shichang) || isNaN(weichi)) {
192
     return 0
195
     return 0
193
   }
196
   }
194
-
197
+  console.log('总量', (shouji + (shichang - t) * weichi).toFixed(1))
195
   return (shouji + (shichang - t) * weichi).toFixed(1)
198
   return (shouji + (shichang - t) * weichi).toFixed(1)
196
 }
199
 }
197
 
200