See999 4 年前
父节点
当前提交
dc529c3261

+ 251 - 76
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue 查看文件

18
           <el-form-item label="证件号: " prop="name">
18
           <el-form-item label="证件号: " prop="name">
19
             <el-input v-model="patientInfo.id_card_no" placeholder="" readonly></el-input>
19
             <el-input v-model="patientInfo.id_card_no" placeholder="" readonly></el-input>
20
           </el-form-item>
20
           </el-form-item>
21
+          <!--<el-form-item label="挂号类型: " prop="name">-->
22
+            <!--<el-input v-model="hisPatientInfo.register_type" placeholder="" readonly></el-input>-->
23
+          <!--</el-form-item>-->
21
           <el-form-item label="挂号类型: " prop="name">
24
           <el-form-item label="挂号类型: " prop="name">
22
-            <el-input v-model="hisPatientInfo.register_type" placeholder="" readonly></el-input>
23
-          </el-form-item>
24
-          <el-form-item label="挂号类型: " prop="name">
25
-            <el-select style="margin-right:5px;" v-model="doctorValue" placeholder="">
25
+            <el-select style="margin-right:5px;" v-model="register_type" placeholder="">
26
               <el-option
26
               <el-option
27
-                v-for="(item,index) in doctors"
27
+                v-for="(item,index) in getDictionaryDataConfig('system','register_type')"
28
                 :key="index"
28
                 :key="index"
29
-                :label="item.user_name"
30
-                :value="item.id">
29
+                :label="item.name"
30
+                :value="item.name">
31
               </el-option>
31
               </el-option>
32
             </el-select>
32
             </el-select>
33
           </el-form-item>
33
           </el-form-item>
40
               placeholder="请输入内容"
40
               placeholder="请输入内容"
41
             ></el-autocomplete>
41
             ></el-autocomplete>
42
           </el-form-item>
42
           </el-form-item>
43
-          <el-form-item label="特殊病史: " prop="name">
43
+          <el-form-item label="过敏史及特殊病史: " prop="name">
44
             <el-autocomplete
44
             <el-autocomplete
45
               style="width:100%;"
45
               style="width:100%;"
46
               class="inline-input"
46
               class="inline-input"
78
               v-for="(item,index) in doctors"
78
               v-for="(item,index) in doctors"
79
               :key="index"
79
               :key="index"
80
               :label="item.user_name"
80
               :label="item.user_name"
81
-              :value="item.id">
81
+              :value="item.user_name">
82
             </el-option>
82
             </el-option>
83
           </el-select>
83
           </el-select>
84
           <span>科室:</span>
84
           <span>科室:</span>
85
           <el-select style="margin-right:5px;" v-model="departmentValue" placeholder="">
85
           <el-select style="margin-right:5px;" v-model="departmentValue" placeholder="">
86
             <el-option
86
             <el-option
87
-              v-for="(item,index) in departMent"
87
+              v-for="(item,index) in getDictionaryDataConfig('system','department')"
88
               :key="index"
88
               :key="index"
89
               :label="item.name"
89
               :label="item.name"
90
-              :value="item.id">
90
+              :value="item.name">
91
             </el-option>
91
             </el-option>
92
           </el-select>
92
           </el-select>
93
           <span>总计:</span>
93
           <span>总计:</span>
223
     delHisPrescription,
223
     delHisPrescription,
224
     getInitData,
224
     getInitData,
225
     getPatientInfo,
225
     getPatientInfo,
226
-    getSchedulePatientList
226
+    getSchedulePatientList,
227
+
227
   } from '@/api/his/his'
228
   } from '@/api/his/his'
228
   import { getDictionaryDataConfig } from '@/utils/data'
229
   import { getDictionaryDataConfig } from '@/utils/data'
229
   import prescriptionTable from './prescriptionTable'
230
   import prescriptionTable from './prescriptionTable'
238
       hisPatientInfo: Object,
239
       hisPatientInfo: Object,
239
       prescriptions: Array,
240
       prescriptions: Array,
240
       record_date: String,
241
       record_date: String,
242
+
241
       other_sick: {
243
       other_sick: {
242
         type: Array,
244
         type: Array,
243
         default: []
245
         default: []
255
     },
257
     },
256
     data() {
258
     data() {
257
       return {
259
       return {
260
+        register_type:"",
258
         value: '',
261
         value: '',
259
         form: {
262
         form: {
260
           name: ''
263
           name: ''
303
         for (let i = 0; i < this.prescriptions.length; i++) {
306
         for (let i = 0; i < this.prescriptions.length; i++) {
304
           if (this.prescriptions[i].advices != null) {
307
           if (this.prescriptions[i].advices != null) {
305
             for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
308
             for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
306
-              total = total + this.prescriptions[i].advices[a].price * this.prescriptions[i].advices[a].prescribing_number
309
+              total = total + this.prescriptions[i].advices[a].retail_price * this.prescriptions[i].advices[a].prescribing_number
307
             }
310
             }
308
           }
311
           }
309
           if (this.prescriptions[i].project != null) {
312
           if (this.prescriptions[i].project != null) {
310
             for (let b = 0; b < this.prescriptions[i].project.length; b++) {
313
             for (let b = 0; b < this.prescriptions[i].project.length; b++) {
311
-              total = total + this.prescriptions[i].project[b].price * this.prescriptions[i].project[b].count
314
+              total = total + this.prescriptions[i].project[b].price * this.prescriptions[i].project[b].total
312
             }
315
             }
313
           }
316
           }
314
         }
317
         }
315
-        return total
318
+        return Math.floor(total * 100) / 100
316
       },
319
       },
317
       createFilter(queryString) {
320
       createFilter(queryString) {
318
         return (restaurant) => {
321
         return (restaurant) => {
367
             this.allDrugs = response.data.data.drugs
370
             this.allDrugs = response.data.data.drugs
368
             this.advices_template = response.data.data.advices_template
371
             this.advices_template = response.data.data.advices_template
369
             this.doctors = response.data.data.doctors
372
             this.doctors = response.data.data.doctors
370
-            this.departMent = response.data.data.department
373
+
371
 
374
 
372
           }
375
           }
373
         })
376
         })
378
           console.log(this.prescriptions[i].name)
381
           console.log(this.prescriptions[i].name)
379
           if (this.prescriptions[i].name == val.name) {
382
           if (this.prescriptions[i].name == val.name) {
380
             this.curPrescriptions = this.prescriptions[i]
383
             this.curPrescriptions = this.prescriptions[i]
384
+            this.teamList = []
385
+            this.curDrugs = []
386
+            this.$refs.multipleTable.clearSelection()
387
+            this.$refs.tables.clearSelection()
381
 
388
 
382
             //用来区分处方属于项目还是药品
389
             //用来区分处方属于项目还是药品
383
             if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
390
             if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
384
               this.customTabIndex = 1
391
               this.customTabIndex = 1
385
               this.curStatus = 1
392
               this.curStatus = 1
393
+              this.rightTab = 1
394
+              this.showOne = true
395
+              this.showTwo = false
386
             }
396
             }
387
             if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
397
             if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
388
 
398
 
389
               this.customTabIndex = 2
399
               this.customTabIndex = 2
390
               this.curStatus = 2
400
               this.curStatus = 2
401
+              this.rightTab = 2
402
+
403
+              this.showTwo = true
404
+              this.showOne = false
391
             }
405
             }
392
 
406
 
393
             if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
407
             if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
394
               this.customTabIndex = this.rightTab
408
               this.customTabIndex = this.rightTab
409
+              this.curStatus = 0
410
+
395
             }
411
             }
396
 
412
 
397
           }
413
           }
398
 
414
 
399
         }
415
         }
400
-      }, clearData() {
401
-
416
+      },
417
+      clearData() {
418
+        console.log("111111")
402
         this.curPrescriptions = []
419
         this.curPrescriptions = []
420
+        this.curStatus = 0
421
+        this.curDrugs = []
422
+        this.preDrugs = []
423
+        this.teamList = []
424
+
425
+
403
       },
426
       },
404
-      setData(data) {
427
+      setData(data,info) {
428
+        this.curStatus = 0
405
         this.prescriptions = data
429
         this.prescriptions = data
406
-        console.log(this.$refs)
407
-        this.$nextTick(() => {
408
-          this.$refs.prescription_tables.setNewData(this.prescriptions[0])
409
-        })
430
+        this.curPrescriptions = this.prescriptions[0]
431
+        if(this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0 ){
432
+          this.curStatus = 1
433
+          this.customTabIndex= 1
434
+          this.rightTab = 1
435
+          this.showOne = true
436
+          this.showTwo = false
437
+
438
+        }
439
+
440
+        if(this.curPrescriptions.project.length > 0 && this.curPrescriptions.advices.length == 0 ){
441
+          this.curStatus = 2
442
+          this.customTabIndex= 2
443
+          this.rightTab = 2
444
+          this.showOne = false
445
+          this.showTwo = true
446
+        }
447
+
448
+
449
+        this.state1 = info.diagnosis
450
+        this.state2 = info.sick_history
451
+        this.doctorValue = info.doctor
452
+        this.departmentValue = info.departments
453
+
454
+
455
+        // console.log(this.$refs)
456
+        // this.$nextTick(() => {
457
+        //   this.$refs.prescription_tables.setNewData(this.prescriptions[0])
458
+        // })
410
       },
459
       },
411
       moreState(tab, event) {
460
       moreState(tab, event) {
412
         if (tab == 'more') {
461
         if (tab == 'more') {
414
         }
463
         }
415
       },
464
       },
416
       open(index) {
465
       open(index) {
466
+        if(this.doctorValue.length <= 0){
467
+          this.$message.error("医生不能为空")
468
+          return
469
+        }
470
+
471
+        if(this.departmentValue.length <= 0){
472
+          this.$message.error("科室不能为空")
473
+          return
474
+        }
475
+
417
         if (index == 1) {
476
         if (index == 1) {
418
           let params = {
477
           let params = {
419
             patient_id: this.patientInfo.id,
478
             patient_id: this.patientInfo.id,
420
             diagnose: this.state1,
479
             diagnose: this.state1,
421
             sick_history: this.state2,
480
             sick_history: this.state2,
422
             doctor: this.doctorValue,
481
             doctor: this.doctorValue,
423
-            department: this.departmentValue,
482
+               department: this.departmentValue,
424
             record_date: this.record_date,
483
             record_date: this.record_date,
425
             his_patient_id: this.hisPatientInfo.id
484
             his_patient_id: this.hisPatientInfo.id
426
           }
485
           }
438
               this.prescriptions[i].advices[b].retail_price = this.prescriptions[i].advices[b].retail_price.toString()
497
               this.prescriptions[i].advices[b].retail_price = this.prescriptions[i].advices[b].retail_price.toString()
439
 
498
 
440
             }
499
             }
500
+
501
+            for (let b = 0; b < this.prescriptions[i].project.length; b++) {
502
+              this.prescriptions[i].project[b].price = parseFloat(this.prescriptions[i].project[b].price)
503
+
504
+            }
441
           }
505
           }
442
           let data = {
506
           let data = {
443
             'prescriptions': this.prescriptions
507
             'prescriptions': this.prescriptions
444
           }
508
           }
445
           createHisPrescription(data, params).then(response => {
509
           createHisPrescription(data, params).then(response => {
446
             if (response.data.state == 1) {
510
             if (response.data.state == 1) {
447
-              this.prescriptions = []
511
+              // this.prescriptions = []
448
               this.$message.success('保存成功')
512
               this.$message.success('保存成功')
449
             }
513
             }
450
           })
514
           })
472
         this.curStatus = 0
536
         this.curStatus = 0
473
       },
537
       },
474
       removeTab(targetName) {
538
       removeTab(targetName) {
475
-        let id = 0
476
-        for (let i = 0; i < this.prescriptions.length; i++) {
477
-          if (this.prescriptions[i].name == targetName) {
478
-            id = this.prescriptions[i].id
539
+        this.$confirm("处方删除后不可恢复,是否确认删除", "删除", {
540
+          confirmButtonText: "确 定",
541
+          cancelButtonText: "取 消",
542
+          type: "warning"
543
+        }).then(() => {
544
+          let id = 0
545
+          for (let i = 0; i < this.prescriptions.length; i++) {
546
+            if (this.prescriptions[i].name == targetName) {
547
+              id = this.prescriptions[i].id
548
+            }
479
           }
549
           }
480
-        }
481
-
482
-        if (id == 0) {
483
-          let tabs = this.prescriptions
484
-          let activeName = this.editableTabsValue
485
-          if (activeName === targetName) {
486
-            tabs.forEach((tab, index) => {
487
-              if (tab.name === targetName) {
488
-                let nextTab = tabs[index + 1] || tabs[index - 1]
489
-                if (nextTab) {
490
-                  activeName = nextTab.name
491
 
550
 
551
+          if (id == 0) {
552
+            let tabs = this.prescriptions
553
+            let activeName = this.editableTabsValue
554
+            if (activeName === targetName) {
555
+              tabs.forEach((tab, index) => {
556
+                if (tab.name === targetName) {
557
+                  let nextTab = tabs[index + 1] || tabs[index - 1]
558
+                  if (nextTab) {
559
+                    activeName = nextTab.name
560
+
561
+                  }
562
+                }
563
+              })
564
+            }
565
+            this.editableTabsValue = activeName
566
+            this.prescriptions = tabs.filter(tab => tab.name !== targetName)
567
+
568
+            for (let i = 0; i < this.prescriptions.length; i++) {
569
+              if (activeName == this.prescriptions[i].name) {
570
+                this.curPrescriptions = this.prescriptions[i]
571
+                if(this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0){
572
+                  this.curStatus = 1
573
+                }
574
+                if(this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0){
575
+                  this.curStatus = 2
492
                 }
576
                 }
493
               }
577
               }
494
-            })
578
+            }
579
+            if (this.prescriptions.length == 0) {
580
+              this.curPrescriptions = []
581
+              this.curStatus = 0
582
+            }
495
           }
583
           }
496
-          this.editableTabsValue = activeName
497
-          this.prescriptions = tabs.filter(tab => tab.name !== targetName)
498
-
499
-          for (let i = 0; i < this.prescriptions.length; i++) {
500
-            if (activeName == this.prescriptions[i].name) {
501
-              this.curPrescriptions = this.prescriptions[i]
502
-              if(this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0){
503
-                this.curStatus = 1
504
-              }
505
-              if(this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0){
506
-                this.curStatus = 2
507
-              }
584
+          else {
585
+            let params = {
586
+              'id': id
508
             }
587
             }
588
+            delHisPrescription(params).then(response => {
589
+              if (response.data.state == 1) {
590
+                this.$message.success('删除成功')
591
+                let tabs = this.prescriptions
592
+                let activeName = this.editableTabsValue
593
+                if (activeName === targetName) {
594
+                  tabs.forEach((tab, index) => {
595
+                    if (tab.name === targetName) {
596
+                      let nextTab = tabs[index + 1] || tabs[index - 1]
597
+                      if (nextTab) {
598
+                        activeName = nextTab.name
599
+
600
+                      }
601
+                    }
602
+                  })
603
+                }
604
+                this.editableTabsValue = activeName
605
+                this.prescriptions = tabs.filter(tab => tab.name !== targetName)
606
+
607
+                for (let i = 0; i < this.prescriptions.length; i++) {
608
+                  if (activeName == this.prescriptions[i].name) {
609
+                    this.curPrescriptions = this.prescriptions[i]
610
+                    if(this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0){
611
+                      this.curStatus = 1
612
+                    }
613
+                    if(this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0){
614
+                      this.curStatus = 2
615
+                    }
616
+                  }
617
+                }
618
+                if (this.prescriptions.length == 0) {
619
+                  this.curPrescriptions = []
620
+                  this.curStatus = 0
621
+                }
622
+              } else {
623
+                this.$message.success(response.data.msg)
624
+              }
625
+            })
509
           }
626
           }
510
-          if (this.prescriptions.length == 0) {
511
-            this.curPrescriptions = []
512
-            this.curStatus = 0
627
+
628
+        })
629
+          .catch(() => {});
630
+
631
+
632
+
633
+      },
634
+      clickTab(index) {
635
+        if (index == 1){
636
+          if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
637
+            this.$message.error("当前处方为项目,无法切换为药品,需要新开处方")
638
+            return
513
           }
639
           }
514
-        } else {
515
-          let params = {
516
-            'id': id
640
+        }else{
641
+          if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
642
+            this.$message.error("当前处方为药品,无法切换为项目,需要新开处方")
643
+            return
517
           }
644
           }
518
-          delHisPrescription(params).then(response => {
519
-            if (response.data.state == 1) {
520
-              this.$message.success('删除成功')
521
-            } else {
522
-              this.$message.success(response.data.msg)
523
-            }
524
-          })
645
+
646
+
525
         }
647
         }
526
-      },
527
-      clickTab(index) {
648
+
528
         if (index == 1) {
649
         if (index == 1) {
650
+
651
+            this.teamList = []
652
+          this.$refs.tables.clearSelection()
653
+
529
           this.showOne = true
654
           this.showOne = true
530
           this.showTwo = false
655
           this.showTwo = false
531
           this.$nextTick(() => {
656
           this.$nextTick(() => {
534
           this.customTabIndex = 1
659
           this.customTabIndex = 1
535
         }
660
         }
536
         if (index == 2) {
661
         if (index == 2) {
662
+          this.curDrugs = []
663
+          this.$refs.multipleTable.clearSelection()
664
+
537
           this.showTwo = true
665
           this.showTwo = true
538
           this.showOne = false
666
           this.showOne = false
539
           this.$nextTick(() => {
667
           this.$nextTick(() => {
545
 
673
 
546
         //用来区分处方属于项目还是药品
674
         //用来区分处方属于项目还是药品
547
         if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
675
         if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
548
-
549
           this.customTabIndex = 1
676
           this.customTabIndex = 1
677
+          this.curStatus =1
678
+
550
         }
679
         }
551
         if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
680
         if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
552
-
553
           this.customTabIndex = 2
681
           this.customTabIndex = 2
682
+          this.curStatus =2
554
         }
683
         }
555
         if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
684
         if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
556
           // this.customTabIndex = this.rightTab
685
           // this.customTabIndex = this.rightTab
557
           this.customTabIndex = index
686
           this.customTabIndex = index
687
+          this.curStatus =0
688
+
558
         }
689
         }
690
+
691
+
559
       }, changeAllGoodInfoTableData: function(selection) {
692
       }, changeAllGoodInfoTableData: function(selection) {
560
         this.curDrugs = selection
693
         this.curDrugs = selection
561
       }, addCharges() {
694
       }, addCharges() {
565
         this.curDrugs = selection
698
         this.curDrugs = selection
566
       },
699
       },
567
       comfirm() {
700
       comfirm() {
568
-        console.log(this.curStatus)
569
-        console.log(this.rightTab)
570
-        console.log(this.curPrescriptions)
571
-
572
 
701
 
573
         if (this.curStatus == 1  && this.rightTab == 2) {
702
         if (this.curStatus == 1  && this.rightTab == 2) {
574
           this.$message.error('改处方是药品,无法添加项目')
703
           this.$message.error('改处方是药品,无法添加项目')
584
           return
713
           return
585
         }
714
         }
586
 
715
 
716
+        for (let i = 0; i < this.teamList.length; i++){
717
+          for (let a = 0; a < this.curPrescriptions.project.length; a++){
718
+            if(this.teamList[i].id == this.curPrescriptions.project[a].project_id){
719
+              this.$message.error('改处方存在相同的项目,无法添加相同的项目')
720
+              return
721
+
722
+            }
723
+          }
724
+        }
725
+
726
+        console.log(this.curDrugs)
727
+        console.log(this.curPrescriptions.advices)
728
+
729
+
730
+        for (let i = 0; i < this.curDrugs.length; i++){
731
+          for (let a = 0; a < this.curPrescriptions.advices.length; a++){
732
+            if(this.curDrugs[i].id == this.curPrescriptions.advices[i].id){
733
+              this.$message.error('改处方存在相同的药品,无法添加相同的药品')
734
+              return
735
+
736
+            }
737
+          }
738
+        }
739
+
740
+
741
+
742
+
587
         for (let i = 0; i < this.prescriptions.length; i++) {
743
         for (let i = 0; i < this.prescriptions.length; i++) {
588
           if (this.prescriptions[i].name == this.editableTabsValue) {
744
           if (this.prescriptions[i].name == this.editableTabsValue) {
589
             var temp = this.deepClone(this.curDrugs)
745
             var temp = this.deepClone(this.curDrugs)
590
             var temp2 = this.deepClone(this.teamList)
746
             var temp2 = this.deepClone(this.teamList)
591
 
747
 
748
+            console.log(temp2)
592
             if (temp.length > 0) {
749
             if (temp.length > 0) {
593
               for (let b = 0; b < temp.length; b++) {
750
               for (let b = 0; b < temp.length; b++) {
594
                 let obj = {
751
                 let obj = {
595
                   advice_id: 0,
752
                   advice_id: 0,
753
+                  id:  temp[b].id,
596
                   drug_name: temp[b].drug_name,
754
                   drug_name: temp[b].drug_name,
597
                   single_dose: temp[b].single_dose,
755
                   single_dose: temp[b].single_dose,
598
                   delivery_way: temp[b].delivery_way,
756
                   delivery_way: temp[b].delivery_way,
602
                   prescribing_number: temp[b].prescribing_number,
760
                   prescribing_number: temp[b].prescribing_number,
603
                   single_dose_unit: temp[b].min_unit,
761
                   single_dose_unit: temp[b].min_unit,
604
                   prescribing_number_unit: temp[b].min_unit,
762
                   prescribing_number_unit: temp[b].min_unit,
605
-                  min_unit: temp[b].min_unit
763
+                  min_unit: temp[b].min_unit,
764
+                  medical_insurance_number:temp[b].medical_insurance_number,
606
 
765
 
607
                 }
766
                 }
608
                 this.prescriptions[i].advices.push(obj)
767
                 this.prescriptions[i].advices.push(obj)
612
 
771
 
613
             if (temp2.length > 0) {
772
             if (temp2.length > 0) {
614
               for (let b = 0; b < temp2.length; b++) {
773
               for (let b = 0; b < temp2.length; b++) {
615
-                this.prescriptions[i].project.push(temp2[b])
774
+                let obj = {
775
+                  id: 0,
776
+                  project_id: temp2[b].id,
777
+                  project_name: temp2[b].project_name,
778
+                  statistical_classification: temp2[b].statistical_classification,
779
+                  single_dose: temp2[b].single_dose,
780
+                  delivery_way: temp2[b].delivery_way,
781
+                  execution_frequency: temp2[b].execution_frequency,
782
+                  number_days: temp2[b].number_days,
783
+                  total:temp2[b].total,
784
+                  price:temp2[b].price,
785
+                  remark:"",
786
+                  medical_code:temp2[b].medical_code,
787
+                }
788
+                console.log(obj)
789
+                this.prescriptions[i].project.push(obj)
616
               }
790
               }
617
               this.curStatus = 2
791
               this.curStatus = 2
618
             }
792
             }
793
+
619
             this.curPrescriptions = this.prescriptions[i]
794
             this.curPrescriptions = this.prescriptions[i]
620
             this.$refs.multipleTable.clearSelection()
795
             this.$refs.multipleTable.clearSelection()
621
             this.$refs.tables.clearSelection()
796
             this.$refs.tables.clearSelection()

+ 66 - 47
src/xt_pages/outpatientDoctorStation/components/prescriptionTable.vue 查看文件

2
   <div class="prescriptionTable">
2
   <div class="prescriptionTable">
3
     <el-table v-if="activeType  == 1" :data="prescription.advices" border style="width: 99%;" :row-style="{ color: '#303133' }"
3
     <el-table v-if="activeType  == 1" :data="prescription.advices" border style="width: 99%;" :row-style="{ color: '#303133' }"
4
               :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
4
               :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
5
-      <el-table-column align="center" prop="name" label="名称">
5
+      <el-table-column align="center" prop="drug_name" label="名称">
6
         <template slot-scope="scope">{{ scope.row.drug_name }}</template>
6
         <template slot-scope="scope">{{ scope.row.drug_name }}</template>
7
       </el-table-column>
7
       </el-table-column>
8
 
8
 
9
-      <el-table-column align="center" prop="name" width="50" :label="'单次\n用量'">
9
+      <el-table-column align="center" prop="single_dose" width="50" :label="'单次\n用量'">
10
         <template slot-scope="scope">
10
         <template slot-scope="scope">
11
           <el-input  v-model="scope.row.single_dose"></el-input>
11
           <el-input  v-model="scope.row.single_dose"></el-input>
12
           <div> {{scope.row.min_unit}}</div>
12
           <div> {{scope.row.min_unit}}</div>
13
         </template>
13
         </template>
14
       </el-table-column>
14
       </el-table-column>
15
-      <el-table-column align="center" prop="name" width="50" label="用法">
15
+      <el-table-column align="center" prop="delivery_way" width="50" label="用法">
16
         <template slot-scope="scope">
16
         <template slot-scope="scope">
17
           <el-select v-model="scope.row.delivery_way" placeholder="请选择">
17
           <el-select v-model="scope.row.delivery_way" placeholder="请选择">
18
             <el-option
18
             <el-option
24
           </el-select>
24
           </el-select>
25
         </template>
25
         </template>
26
       </el-table-column>
26
       </el-table-column>
27
-      <el-table-column align="center" prop="name" width="50" label="频率">
27
+      <el-table-column align="center" prop="execution_frequency" width="50" label="频率">
28
         <template slot-scope="scope">
28
         <template slot-scope="scope">
29
           <el-select v-model="scope.row.execution_frequency" placehold er="请选择">
29
           <el-select v-model="scope.row.execution_frequency" placehold er="请选择">
30
             <el-option
30
             <el-option
37
         </template>
37
         </template>
38
       </el-table-column>
38
       </el-table-column>
39
 
39
 
40
-      <el-table-column align="center" prop="name" width="100" label="总量">
40
+      <el-table-column align="center" prop="prescribing_number" width="100" label="总量">
41
         <template slot-scope="scope">
41
         <template slot-scope="scope">
42
           <div style="display:flex;">
42
           <div style="display:flex;">
43
             <el-input v-model="scope.row.prescribing_number" style="width:50%" placeholder=""></el-input>
43
             <el-input v-model="scope.row.prescribing_number" style="width:50%" placeholder=""></el-input>
45
           </div>
45
           </div>
46
         </template>
46
         </template>
47
       </el-table-column>
47
       </el-table-column>
48
-      <el-table-column align="center" prop="name" width="50" label="单价">
48
+      <el-table-column align="center" prop="retail_price" width="50" label="单价">
49
         <template slot-scope="scope">
49
         <template slot-scope="scope">
50
           <el-input v-model="scope.row.retail_price" placeholder=""></el-input>
50
           <el-input v-model="scope.row.retail_price" placeholder=""></el-input>
51
         </template>
51
         </template>
52
       </el-table-column>
52
       </el-table-column>
53
-      <el-table-column align="center" prop="name" width="50" label="备注">
53
+      <el-table-column align="center" prop="remark" width="50" label="备注">
54
         <template slot-scope="scope">
54
         <template slot-scope="scope">
55
           <el-input v-model="scope.row.remark" style="width:50%" placeholder=""></el-input>
55
           <el-input v-model="scope.row.remark" style="width:50%" placeholder=""></el-input>
56
         </template>
56
         </template>
196
         })
196
         })
197
 
197
 
198
       },deleteDrug:function(index, row){
198
       },deleteDrug:function(index, row){
199
-        console.log(row)
200
-       console.log(index)
201
 
199
 
202
-       if(row.advice_id == 0){
203
-          this.prescription.advices.splice(index, 1)
204
-        }else{
205
-          let params = {
206
-            'id': row.advice_id,
207
-          }
208
-          delHisAdvice(params).then(response => {
209
-            if (response.data.state == 0) {
210
-              this.$message.error(response.data.msg)
211
-              return false
212
-            } else {
213
-              var temp2 = this.deepClone(this.prescription.advices)
214
-              temp2.splice(index, 1)
215
-              this.prescription.advices = temp2
216
-              this.$message.success(response.data.data.msg)
217
-            }
218
-          })
200
+       this.$confirm("药品删除后不可恢复,是否确认删除", "删除", {
201
+         confirmButtonText: "确 定",
202
+         cancelButtonText: "取 消",
203
+         type: "warning"
204
+       }).then(() => {
205
+         this.$nextTick(function(){
206
+           // this.prescription.advices.splice(index, 1)
207
+           if(row.advice_id == 0){
208
+           }else{
209
+             let params = {
210
+               'id': row.advice_id,
211
+             }
212
+             delHisAdvice(params).then(response => {
213
+               if (response.data.state == 0) {
214
+                 this.$message.error(response.data.msg)
215
+                 return false
216
+               } else {
217
+                 var temp2 = this.deepClone(this.prescription.advices)
218
+                 temp2.splice(index, 1)
219
+                 this.prescription.advices = temp2
220
+                 this.$message.success(response.data.data.msg)
221
+               }
222
+             })
223
+
224
+
225
+           }
226
+
227
+         });
228
+
229
+
230
+       })
231
+         .catch(() => {});
232
+
233
+
219
 
234
 
220
 
235
 
221
-        }
222
 
236
 
223
       },deepClone(source) {
237
       },deepClone(source) {
224
        if (!source && typeof source !== 'object') {
238
        if (!source && typeof source !== 'object') {
255
          return name
269
          return name
256
       },
270
       },
257
       deleteProject(row){
271
       deleteProject(row){
258
-        if(row.id == 0){
259
-          this.prescription.project.splice(i, 1)
272
+        this.$confirm("项目删除后不可恢复,是否确认删除", "删除", {
273
+          confirmButtonText: "确 定",
274
+          cancelButtonText: "取 消",
275
+          type: "warning"
276
+        }).then(() => {
277
+          if(row.id == 0){
278
+            this.prescription.project.splice(i, 1)
260
 
279
 
261
-        }else{
262
-          let params = {
263
-            'id': row.id,
264
-          }
265
-          delHisProject(params).then(response => {
266
-            if (response.data.state == 0) {
267
-              this.$message.error(response.data.msg)
268
-              return false
269
-            } else {
270
-              for (let i = 0; i < this.prescription.project.length; i++){
271
-                if(this.prescription.project[i].id == row.id){
272
-                  this.prescription.project.splice(i, 1)
280
+          }else{
281
+            let params = {
282
+              'id': row.id,
283
+            }
284
+            delHisProject(params).then(response => {
285
+              if (response.data.state == 0) {
286
+                this.$message.error(response.data.msg)
287
+                return false
288
+              } else {
289
+                for (let i = 0; i < this.prescription.project.length; i++){
290
+                  if(this.prescription.project[i].id == row.id){
291
+                    this.prescription.project.splice(i, 1)
292
+                  }
273
                 }
293
                 }
294
+                this.$message.success(response.data.data.msg)
274
               }
295
               }
275
-              this.$message.error(response.data.data.msg)
276
-            }
277
-          })
278
-
279
-
280
-        }
296
+            })
297
+          }
298
+        })
299
+          .catch(() => {});
281
 
300
 
282
       },
301
       },
283
     },mounted(){
302
     },mounted(){