Parcourir la source

排序问题处理

XMLWAN il y a 4 ans
Parent
révision
47f7342e07
2 fichiers modifiés avec 9 ajouts et 2 suppressions
  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 Voir le fichier

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

+ 4 - 1
src/utils/tools.js Voir le fichier

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