XMLWAN 4 年之前
父節點
當前提交
64ae8cf8a4

+ 19 - 0
src/api/patient/patient.js 查看文件

@@ -448,6 +448,14 @@ export function DeleteManagement(id, params) {
448 448
   })
449 449
 }
450 450
 
451
+export function DeleteChild(id, params) {
452
+  return request({
453
+    url: '/m/api/patient/deletechild?id=' + id,
454
+    method: 'delete',
455
+    params: params
456
+  })
457
+}
458
+
451 459
 export function updatedPatient(data) {
452 460
   return request({
453 461
     url: '/m/api/patient/updatedpatient',
@@ -526,3 +534,14 @@ export function submitFeed(params) {
526 534
     params: params
527 535
   })
528 536
 }
537
+
538
+export function DeleteInspection(date) {
539
+  const params = {
540
+    date: date
541
+  }
542
+  return request({
543
+    url: '/m/api/patient/deleteinspection',
544
+    method: 'delete',
545
+    params: params
546
+  })
547
+}

+ 81 - 29
src/pages/doctorAdvice/components/DoctorManagement.vue 查看文件

@@ -66,7 +66,7 @@
66 66
                     <van-icon
67 67
                       class="ellipsis"
68 68
                       name="ellipsis"
69
-                      @click="Delete(item.groupno, index, it.execution_staff)"
69
+                      @click="DeleteOne(it.id)"
70 70
                     />
71 71
                   </div>
72 72
                   <div v-for="(i, index) in childList" :key="index">
@@ -82,7 +82,7 @@
82 82
                       <van-icon
83 83
                         class="ellipsis"
84 84
                         name="ellipsis"
85
-                        @click="Delete(item.groupno, index, it.execution_staff)"
85
+                        @click="DeleteChild(i.id, index, i.execution_state)"
86 86
                       />
87 87
                     </div>
88 88
                   </div>
@@ -123,7 +123,7 @@
123 123
                     <van-icon
124 124
                       class="ellipsis"
125 125
                       name="ellipsis"
126
-                      @click="Delete(item.groupno, index, it.execution_staff)"
126
+                      @click="DeleteTemporary(it.id)"
127 127
                     />
128 128
                   </div>
129 129
                   <div v-for="(i, index) in childList" :key="index">
@@ -139,7 +139,7 @@
139 139
                       <van-icon
140 140
                         class="ellipsis"
141 141
                         name="ellipsis"
142
-                        @click="Delete(item.groupno, index, it.execution_staff)"
142
+                        @click="DeleteChild(i.id, index, it.execution_state)"
143 143
                       />
144 144
                     </div>
145 145
                   </div>
@@ -225,11 +225,18 @@
225 225
         @select="toDelete"
226 226
       />
227 227
       <van-action-sheet
228
-        v-model="newShow"
228
+        v-model="newChildShow"
229 229
         :actions="actions1"
230 230
         cancel-text="取消"
231 231
         @cancel="onCancel"
232
-        @select="toDelete"
232
+        @select="toChildDelete"
233
+      />
234
+      <van-action-sheet
235
+        v-model="newChildShow"
236
+        :actions="actions2"
237
+        cancel-text="取消"
238
+        @cancel="onCancel"
239
+        @select="toChildDelete"
233 240
       />
234 241
     </div>
235 242
   </div>
@@ -239,7 +246,8 @@
239 246
 import {
240 247
   getDoctorAdvices,
241 248
   getPatientDetail,
242
-  DeleteManagement
249
+  DeleteManagement,
250
+  DeleteChild
243 251
 } from "@/api/patient/patient";
244 252
 import { uParseTime } from "@/utils/tools";
245 253
 import { Dialog } from "vant";
@@ -253,6 +261,7 @@ export default {
253 261
       loading: false,
254 262
       finished: false,
255 263
       newShow: false,
264
+      newChildShow: false,
256 265
       typeShow: false,
257 266
       startShow: false,
258 267
       endShow: false,
@@ -266,6 +275,7 @@ export default {
266 275
       currentDate: new Date(),
267 276
       actions: [{ name: "全部删除" }],
268 277
       actions1: [{ name: "删除" }],
278
+      actions2: [{ name: "删除" }],
269 279
       form: {
270 280
         type: "",
271 281
         limit: 10,
@@ -280,7 +290,9 @@ export default {
280 290
       doctor: [],
281 291
       id: 0,
282 292
       index: 0,
283
-      staff: 0
293
+      staff: 0,
294
+      childId: 0,
295
+      state: 0
284 296
     };
285 297
   },
286 298
   methods: {
@@ -427,10 +439,9 @@ export default {
427 439
 
428 440
           var doctor = response.data.data.doctor;
429 441
           this.doctor = doctor;
430
-          console.log("医生", doctor);
431
-          console.log("list", list);
432 442
           this.doctorAdvice = list.reverse();
433 443
           this.loading = false;
444
+          this.finished = true;
434 445
         }
435 446
       });
436 447
     },
@@ -457,24 +468,25 @@ export default {
457 468
     getTimes(time) {
458 469
       return uParseTime(time, "{h}:{i}");
459 470
     },
460
-    onLoad() {
461
-      setTimeout(() => {
462
-        this.page++;
463
-        if (this.page <= Math.ceil(this.total / 10)) {
464
-          this.getDoctorAdvices(
465
-            this.patient_id,
466
-            this.form.type,
467
-            this.startTime,
468
-            this.endTimes,
469
-            this.form.limit,
470
-            this.form.page
471
-          );
472
-        } else {
473
-          this.loading = false;
474
-          this.finished = true;
475
-        }
476
-      }, 1000);
477
-    },
471
+    // onLoad() {
472
+    //   setTimeout(() => {
473
+    //     this.page++;
474
+    //     if (this.page <= Math.ceil(this.total / 10)) {
475
+    //       this.getDoctorAdvices(
476
+    //         this.patient_id,
477
+    //         this.form.type,
478
+    //         this.startTime,
479
+    //         this.endTimes,
480
+    //         this.form.limit,
481
+    //         this.form.page
482
+    //       );
483
+    //     } else {
484
+    //       this.loading = false;
485
+    //       this.finished = true;
486
+    //     }
487
+    //   }, 1000);
488
+    // },
489
+    onLoad() {},
478 490
     toDoctorAdviceDetail(id) {
479 491
       var patientid = this.$route.query.patientid;
480 492
       this.$router.push(
@@ -499,11 +511,32 @@ export default {
499 511
       this.staff = staff;
500 512
       this.newShow = true;
501 513
     },
514
+    // 长期
515
+    DeleteOne(id) {
516
+      alert(id);
517
+    },
518
+    DeleteChild(id, index, state) {
519
+      this.id = id;
520
+      this.index = index;
521
+      this.state = state;
522
+      this.newChildShow = true;
523
+    },
524
+    // 临时
525
+    DeleteTemporary(id) {
526
+      alert(id);
527
+    },
502 528
     toDelete(val) {
503
-      if (val.name == "删除") {
529
+      if (val.name == "全部删除") {
504 530
         this.DeleteManagement(this.id, this.index, this.staff);
505 531
       }
506 532
     },
533
+    toChildDelete(val) {
534
+      console.log(val);
535
+      if (val.name == "删除") {
536
+        this.DeleteChild(this.id, this.index, this.state);
537
+      }
538
+    },
539
+    // 删除整组医嘱
507 540
     DeleteManagement(id, index, staff) {
508 541
       if (staff > 0) {
509 542
         this.$toast("医嘱已执行,无法删除");
@@ -522,6 +555,25 @@ export default {
522 555
           }
523 556
         });
524 557
       });
558
+    },
559
+    DeleteChild(id, index, state) {
560
+      if (state == 1) {
561
+        this.$toast("医嘱已执行,无法删除");
562
+        return false;
563
+      }
564
+      Dialog.confirm({
565
+        title: "删除提示!",
566
+        message: "确认删除该条信息吗?,删除后将无法恢复!"
567
+      }).then(() => {
568
+        DeleteChild(id).then(response => {
569
+          if (response.data.state === 1) {
570
+            var msg = response.data.data.msg;
571
+
572
+            this.childList.splice(index, 1);
573
+            this.newShow = false;
574
+          }
575
+        });
576
+      });
525 577
     }
526 578
   },
527 579
   created() {

+ 113 - 11
src/pages/doctorAdvice/components/Inspection.vue 查看文件

@@ -23,16 +23,32 @@
23 23
       </div>
24 24
 
25 25
       <div class="adviceBox" v-show="showOne">
26
-        <van-list v-model="loading" :finished="finished" finished-text="没有更多了">
27
-          <div class="adviceOne" v-for="(item, index) in Inspection" :key="index">
26
+        <van-list
27
+          v-model="loading"
28
+          :finished="finished"
29
+          finished-text="没有更多了"
30
+        >
31
+          <div
32
+            class="adviceOne"
33
+            v-for="(item, index) in Inspection"
34
+            :key="index"
35
+          >
28 36
             <div class="adviceTitle">
29 37
               <p>{{ getTime(item.inspect_date) }}</p>
30
-              <van-icon class="ellipsis" name="ellipsis" @click="newShow = true" />
38
+              <van-icon
39
+                class="ellipsis"
40
+                name="ellipsis"
41
+                @click="Delete(item.inspect_date, index)"
42
+              />
31 43
             </div>
32 44
             <div class="orderContent">
33 45
               <div class="flexBox" v-for="(it, i) in item.child" :key="i">
34 46
                 <p>{{ it }}</p>
35
-                <van-icon class="ellipsis" name="ellipsis" @click="newShow = true" />
47
+                <van-icon
48
+                  class="ellipsis"
49
+                  name="ellipsis"
50
+                  @click="DeleteOne(it, item.inspect_date, i)"
51
+                />
36 52
               </div>
37 53
             </div>
38 54
             <div class="all" @click="toInspection(item.inspect_date)">全部</div>
@@ -52,10 +68,23 @@
52 68
 
53 69
     <!-- 弹出层 -->
54 70
     <div>
55
-      <van-popup v-model="typeShow" position="bottom" :style="{ height: '40%' }">
56
-        <van-picker show-toolbar :columns="columns" @cancel="onCancel" @confirm="onConfirm" />
71
+      <van-popup
72
+        v-model="typeShow"
73
+        position="bottom"
74
+        :style="{ height: '40%' }"
75
+      >
76
+        <van-picker
77
+          show-toolbar
78
+          :columns="columns"
79
+          @cancel="onCancel"
80
+          @confirm="onConfirm"
81
+        />
57 82
       </van-popup>
58
-      <van-popup v-model="startShow" position="bottom" :style="{ height: '40%' }">
83
+      <van-popup
84
+        v-model="startShow"
85
+        position="bottom"
86
+        :style="{ height: '40%' }"
87
+      >
59 88
         <van-datetime-picker
60 89
           v-model="currentDate"
61 90
           type="date"
@@ -75,7 +104,18 @@
75 104
           @cancel="endShow = false"
76 105
         />
77 106
       </van-popup>
78
-      <van-action-sheet v-model="newShow" :actions="actions" cancel-text="取消" @cancel="onCancel" />
107
+      <van-action-sheet
108
+        v-model="newShow"
109
+        :actions="actions"
110
+        cancel-text="取消"
111
+        @select="toDelete"
112
+      />
113
+      <van-action-sheet
114
+        v-model="newShowOne"
115
+        :actions="actions1"
116
+        cancel-text="取消"
117
+        @select="DeleteInspection"
118
+      />
79 119
     </div>
80 120
   </div>
81 121
 </template>
@@ -84,7 +124,8 @@
84 124
 import {
85 125
   getPatientDetail,
86 126
   getAllInspection,
87
-  getInspection
127
+  getInspection,
128
+  DeleteInspection
88 129
 } from "@/api/patient/patient";
89 130
 import { uParseTime } from "@/utils/tools";
90 131
 import { Dialog } from "vant";
@@ -98,6 +139,7 @@ export default {
98 139
       loading: false,
99 140
       finished: false,
100 141
       newShow: false,
142
+      newShowOne: false,
101 143
       typeShow: false,
102 144
       startShow: false,
103 145
       endShow: false,
@@ -108,7 +150,8 @@ export default {
108 150
       minDate: new Date(1970, 0, 1),
109 151
       maxDate: new Date(2025, 10, 1),
110 152
       currentDate: new Date(),
111
-      actions: [{ name: "删除" }],
153
+      actions: [{ name: "全部删除" }],
154
+      actions1: [{ name: "删除" }],
112 155
       showOne: true,
113 156
       showTwo: false,
114 157
       list: [],
@@ -118,7 +161,12 @@ export default {
118 161
       Inspection: [],
119 162
       project_id: 0,
120 163
       patientid: 0,
121
-      checkdata: []
164
+      checkdata: [],
165
+      date: 0,
166
+      index: 0,
167
+      name: "",
168
+      date: "",
169
+      index: ""
122 170
     };
123 171
   },
124 172
   methods: {
@@ -255,6 +303,7 @@ export default {
255 303
                 arr.push(it.project_name);
256 304
               }
257 305
             });
306
+            console.log("arr", arr);
258 307
             item.child = arr;
259 308
           });
260 309
           this.Inspection = list.reverse();
@@ -277,6 +326,59 @@ export default {
277 326
           "&active=" +
278 327
           this.active
279 328
       );
329
+    },
330
+    Delete(date, index) {
331
+      this.newShow = true;
332
+      this.date = date;
333
+      this.index = index;
334
+    },
335
+    toDelete(val) {
336
+      console.log("val", val);
337
+      if (val.name === "全部删除") {
338
+        this.DeleteInspection(this.date, this.index);
339
+      }
340
+    },
341
+    DeleteInspection(id, index) {
342
+      Dialog.confirm({
343
+        title: "删除提示!",
344
+        message: "确认删除该条信息吗?,删除后将无法恢复!"
345
+      }).then(() => {
346
+        DeleteInspection(id).then(response => {
347
+          if (response.data.state === 1) {
348
+            var msg = response.data.data.msg;
349
+
350
+            this.Inspection.splice(index, 1);
351
+            this.newShow = false;
352
+          }
353
+        });
354
+      });
355
+    },
356
+    DeleteOne(name, date, index) {
357
+      this.newShowOne = true;
358
+      this.name = name;
359
+      this.date = date;
360
+      this.index = index;
361
+    },
362
+    DeleteInspection(val) {
363
+      if (val.name == "删除") {
364
+        this.DeleteChildInspection(this.name, this.date, this.index);
365
+      }
366
+    },
367
+    // 删除整组医嘱
368
+    DeleteInspection(name, index, staff) {
369
+      Dialog.confirm({
370
+        title: "删除提示!",
371
+        message: "确认删除该条信息吗?,删除后将无法恢复!"
372
+      }).then(() => {
373
+        DeleteInspection(id).then(response => {
374
+          if (response.data.state === 1) {
375
+            var msg = response.data.data.msg;
376
+
377
+            this.doctorAdvice.splice(index, 1);
378
+            this.newShow = false;
379
+          }
380
+        });
381
+      });
280 382
     }
281 383
   },
282 384
   created() {