XMLWAN 4 gadus atpakaļ
vecāks
revīzija
20c01db5d7

+ 30 - 7
src/pages/doctorAdvice/components/DialysisRecord.vue Parādīt failu

@@ -36,11 +36,6 @@
36 36
           >
37 37
             <div class="adviceTitle">
38 38
               <p>{{ getTime(item.dialysis_date) }}</p>
39
-              <van-icon
40
-                class="ellipsis"
41
-                name="ellipsis"
42
-                @click="newShow = true"
43
-              />
44 39
             </div>
45 40
             <div class="orderContent">
46 41
               <p>
@@ -257,7 +252,9 @@ export default {
257 252
       page: 1,
258 253
       dialysisRecord: [],
259 254
       doctor: [],
260
-      patient_name: ""
255
+      patient_name: "",
256
+      list: [],
257
+      total: 0
261 258
     };
262 259
   },
263 260
   methods: {
@@ -374,6 +371,7 @@ export default {
374 371
           arr.push(...dialysisrecord);
375 372
           this.dialysisRecord = arr;
376 373
           var total = response.data.data.total;
374
+          this.total = total;
377 375
           console.log("总计", total);
378 376
           var doctor = response.data.data.doctor;
379 377
           console.log("医生", doctor);
@@ -381,7 +379,32 @@ export default {
381 379
         }
382 380
       });
383 381
     },
384
-    onLoad() {},
382
+    onLoad() {
383
+      setTimeout(() => {
384
+        for (let i = 0; i < this.limit; i++) {
385
+          this.list.push(this.list.length + 1);
386
+        }
387
+        // 加载状态结束
388
+        this.loading = false;
389
+        console.log("长度", this.dialysisRecord.length);
390
+        if (this.dialysisRecord.length > 10) {
391
+          this.page++;
392
+        }
393
+        console.log("page是什么", this.page);
394
+        this.getDialysisRecord(
395
+          this.patient_id,
396
+          this.limit,
397
+          this.page,
398
+          this.startTime,
399
+          this.endTimes,
400
+          this.types
401
+        );
402
+        // 数据全部加载完成
403
+        if (this.list.length >= this.total) {
404
+          this.finished = true;
405
+        }
406
+      }, 1000);
407
+    },
385 408
     getTime(time) {
386 409
       // return uParseTime(time, "{y}-{m}-{d} {h}:{i}:{s}");
387 410
       return uParseTime(time, "{y}-{m}-{d}");

+ 25 - 9
src/pages/doctorAdvice/components/DoctorManagement.vue Parādīt failu

@@ -29,9 +29,13 @@
29 29
           finished-text="没有更多了"
30 30
           @load="onLoad"
31 31
         >
32
-          <div class="adviceOne" v-for="item in 3" :key="item">
32
+          <div
33
+            class="adviceOne"
34
+            v-for="(item, index) in doctorAdvice"
35
+            :key="index"
36
+          >
33 37
             <div class="adviceTitle">
34
-              <p>2019.09.01</p>
38
+              <p>{{ getTime(item.advice_date) }}</p>
35 39
               <van-icon
36 40
                 class="ellipsis"
37 41
                 name="ellipsis"
@@ -134,6 +138,7 @@
134 138
 
135 139
 <script>
136 140
 import { getDoctorAdvices, getPatientDetail } from "@/api/patient/patient";
141
+import { uParseTime } from "@/utils/tools";
137 142
 const moment = require("moment");
138 143
 export default {
139 144
   data() {
@@ -151,6 +156,9 @@ export default {
151 156
         .subtract(30, "days")
152 157
         .format("YYYY-MM-DD"),
153 158
       endTime: moment(new Date()).format("YYYY-MM-DD"),
159
+      endTimes: moment(new Date())
160
+        .add(1, "days")
161
+        .format("YYYY-MM-DD"),
154 162
       minDate: new Date(1970, 0, 1),
155 163
       maxDate: new Date(2025, 10, 1),
156 164
       currentDate: new Date(),
@@ -162,7 +170,8 @@ export default {
162 170
       },
163 171
       total: "",
164 172
       showOne: true,
165
-      showTwo: false
173
+      showTwo: false,
174
+      doctorAdvice: []
166 175
     };
167 176
   },
168 177
   methods: {
@@ -208,26 +217,26 @@ export default {
208 217
       console.log("val", val);
209 218
     },
210 219
     getDoctorAdvices(patientid) {
211
-      console.log("类型是什么", this.type);
212 220
       if (this.type === "全部") {
213 221
         this.form.type = 0;
214 222
       }
215
-      if (this.type === "透析患者") {
223
+      if (this.type === "长期医嘱") {
216 224
         this.form.type = 1;
217 225
       }
218
-      if (this.type === "慢病患者") {
226
+      if (this.type === "临时医嘱") {
219 227
         this.form.type = 2;
220 228
       }
221 229
       getDoctorAdvices(
222 230
         patientid,
223 231
         this.form.type,
224 232
         this.startTime,
225
-        this.endTime,
226
-        this.limit,
227
-        this.page
233
+        this.endTimes,
234
+        this.form.limit,
235
+        this.form.page
228 236
       ).then(response => {
229 237
         if (response.data.state === 1) {
230 238
           var advice = response.data.data.advice;
239
+          this.doctorAdvice = advice;
231 240
           console.log("医嘱", advice);
232 241
           var total = response.data.data.total;
233 242
           console.log("总计", total);
@@ -249,6 +258,13 @@ export default {
249 258
           this.patientName = patientDetail.name;
250 259
         }
251 260
       });
261
+    },
262
+    getTime(time) {
263
+      // return uParseTime(time, "{y}-{m}-{d} {h}:{i}:{s}");
264
+      return uParseTime(time, "{y}-{m}-{d}");
265
+    },
266
+    getTimes(time) {
267
+      return uParseTime(time, "{h}:{i}:{s}");
252 268
     }
253 269
   },
254 270
   created() {