Browse Source

Merge branch '20200710_pc_vue_new_branch' into 20200916_pc_vue_new_branch

csx 4 years ago
parent
commit
4efa1b0e74

+ 5 - 3
src/api/common/common.js View File

@@ -48,7 +48,7 @@ export function getConfigurationList(limit, page) {
48 48
 }
49 49
 
50 50
 export function getConfigurationDetail(id, params) {
51
- 
51
+
52 52
   return request({
53 53
     url: 'com/api/getconfigurationdetail?id=' + id,
54 54
     method: 'get',
@@ -531,10 +531,12 @@ export function getCountModeId(params){
531 531
 }
532 532
 
533 533
 export function getRolloutCount(params){
534
-  
534
+
535 535
   return request({
536 536
     url:"/com/api/getrolloutcount",
537 537
     method:"Get",
538 538
     params:params
539 539
   })
540
-}
540
+}
541
+
542
+

+ 33 - 1
src/api/his/his.js View File

@@ -106,10 +106,11 @@ export function delHisProject(params) {
106 106
 }
107 107
 
108 108
 
109
-export function getHisOrderList() {
109
+export function getHisOrderList(params) {
110 110
   return request({
111 111
     url: "/api/hisorder/list",
112 112
     method: "get",
113
+    params:params,
113 114
   });
114 115
 }
115 116
 
@@ -152,5 +153,36 @@ export function Refund(params) {
152 153
 }
153 154
 
154 155
 
156
+export function delHisAddition(params) {
157
+  return request({
158
+    url: "/api/addition_charge/delete",
159
+    method: "post",
160
+    params:params,
161
+  });
162
+}
163
+
164
+
165
+
166
+export function getDoctorList() {
167
+  return request({
168
+    url: "/api/doctor/list",
169
+    method: "get",
170
+  });
171
+}
172
+
173
+
174
+export function getExportConsumeDetailList(params) {
175
+  return request({
176
+    url: "/api/consumedetail/export",
177
+    method: "get",
178
+    params:params
179
+  });
180
+}
181
+
182
+
183
+
184
+
185
+
186
+
155 187
 
156 188
 

+ 55 - 13
src/xt_pages/outpatientCharges/components/prescriptionTable.vue View File

@@ -10,39 +10,55 @@
10 10
       <el-table-column align="center" prop="name" width="90" label="单次用量">
11 11
         <template slot-scope="scope">
12 12
           <div style="display:flex;align-items:center;">
13
-            <el-input v-model="scope.row.single_dose" readonly style="width:65%;"></el-input>
13
+            <!--<el-input v-model="scope.row.single_dose" readonly style="width:65%;"></el-input>-->
14
+            <div> {{scope.row.single_dose}}</div>
15
+
14 16
             <div> {{scope.row.single_dose_unit}}</div>
15 17
           </div>
16 18
         </template>
17 19
       </el-table-column>
18 20
       <el-table-column align="center" prop="name" width="100" label="用法">
19 21
         <template slot-scope="scope">
20
-          <el-input v-model="scope.row.delivery_way" readonly></el-input>
22
+          <!--<el-input v-model="scope.row.delivery_way" readonly></el-input>-->
23
+          <div> {{scope.row.delivery_way}}</div>
21 24
 
22 25
         </template>
23 26
       </el-table-column>
24 27
       <el-table-column align="center" prop="name" width="100" label="频率">
25 28
         <template slot-scope="scope">
26
-          <el-input v-model="scope.row.execution_frequency" readonly></el-input>
29
+          <div> {{scope.row.execution_frequency}}</div>
30
+
31
+          <!--<el-input v-model="scope.row.execution_frequency" readonly></el-input>-->
32
+        </template>
33
+      </el-table-column>
34
+
35
+      <el-table-column align="center" prop="day" width="50" label="天数">
36
+        <template slot-scope="scope">
37
+          {{scope.row.day}}
27 38
         </template>
28 39
       </el-table-column>
29 40
 
30 41
       <el-table-column align="center" prop="name" width="100" label="总量">
31 42
         <template slot-scope="scope">
32 43
           <div style="display:flex;align-items:center;">
33
-            <el-input v-model="scope.row.prescribing_number" style="width:60%" readonly placeholder=""></el-input>
44
+            <!--<el-input v-model="scope.row.prescribing_number" style="width:60%" readonly placeholder=""></el-input>-->
45
+            <div> {{scope.row.prescribing_number}}</div>
46
+
34 47
             <div>{{scope.row.prescribing_number_unit}}</div>
35 48
           </div>
36 49
         </template>
37 50
       </el-table-column>
38 51
       <el-table-column align="center" prop="name" width="60" label="单价">
39 52
         <template slot-scope="scope">
40
-          <el-input v-model="scope.row.retail_price" placeholder="" readonly></el-input>
53
+          <div> {{scope.row.retail_price}}</div>
54
+
55
+          <!--<el-input v-model="scope.row.retail_price" placeholder="" readonly></el-input>-->
41 56
         </template>
42 57
       </el-table-column>
43 58
       <el-table-column align="center" prop="name" width="50" label="备注">
44 59
         <template slot-scope="scope">
45
-          <el-input v-model="scope.row.remark" :title="scope.row.remark" placeholder="" readonly></el-input>
60
+          <!--<el-input v-model="scope.row.remark" :title="scope.row.remark" placeholder="" readonly></el-input>-->
61
+          <div> {{scope.row.remark}}</div>
46 62
         </template>
47 63
       </el-table-column>
48 64
     </el-table>
@@ -60,42 +76,68 @@
60 76
       </el-table-column>
61 77
       <el-table-column align="center" prop="single_dose" width="80" label="单次用量">
62 78
         <template slot-scope="scope">
63
-          <el-input v-model="scope.row.single_dose" placeholder="" readonly></el-input>
79
+          <!--<el-input v-model="scope.row.single_dose" placeholder="" readonly></el-input>-->
80
+          {{scope.row.single_dose}}
64 81
         </template>
65 82
       </el-table-column>
66 83
       <el-table-column align="center" prop="delivery_way" width="80" label="用法">
67 84
         <template slot-scope="scope">
68
-          <el-input v-model="scope.row.delivery_way" placeholder="" readonly></el-input>
85
+          <!--<el-input v-model="scope.row.delivery_way" placeholder="" readonly></el-input>-->
86
+          {{scope.row.delivery_way}}
87
+
69 88
         </template>
70 89
       </el-table-column>
71 90
       <el-table-column align="center" prop="execution_frequency" width="80" label="频率">
72 91
         <template slot-scope="scope">
73
-          <el-input v-model="scope.row.execution_frequency" placeholder="" readonly></el-input>
92
+          <!--<el-input v-model="scope.row.execution_frequency" placeholder="" readonly></el-input>-->
93
+          {{scope.row.execution_frequency}}
94
+
74 95
         </template>
75 96
       </el-table-column>
76 97
       <el-table-column align="center" prop="number_days" width="50" label="天数">
77 98
         <template slot-scope="scope">
78
-          <el-input v-model="scope.row.number_days" placeholder="" readonly></el-input>
99
+          <!--<el-input v-model="scope.row.number_days" placeholder="" readonly></el-input>-->
100
+          {{scope.row.number_days}}
101
+
79 102
         </template>
80 103
       </el-table-column>
81 104
       <el-table-column align="center" prop="total" width="50" label="总量">
82 105
         <template slot-scope="scope">
83 106
           <div style="display:flex;">
84
-            <el-input v-model="scope.row.total" placeholder="" readonly></el-input>
107
+            <!--<el-input v-model="scope.row.total" placeholder="" readonly></el-input>-->
108
+            {{scope.row.total}}
109
+
110
+            <div>{{scope.row.unit}}</div>
111
+
85 112
           </div>
86 113
         </template>
87 114
       </el-table-column>
88 115
       <el-table-column align="center" prop="name" width="50" label="单价">
89 116
         <template slot-scope="scope">
90
-          <el-input v-model="scope.row.price" placeholder="" readonly></el-input>
117
+          <!--<el-input v-model="scope.row.price" placeholder="" readonly></el-input>-->
118
+          {{scope.row.price}}
119
+
91 120
         </template>
92 121
       </el-table-column>
93 122
       <el-table-column align="center" prop="name" width="50" label="备注">
94 123
         <template slot-scope="scope">
95
-          <el-input v-model="scope.row.remark" readonly></el-input>
124
+          <!--<el-input v-model="scope.row.remark" readonly></el-input>-->
125
+          {{scope.row.remark}}
126
+
96 127
         </template>
97 128
       </el-table-column>
98 129
     </el-table>
130
+
131
+    <div class="additionalBox">
132
+      <div class="additionalOne" v-for="(item,index) in prescription.addition" :key="index">
133
+        <span>{{item.item_name}}</span>
134
+        <el-input v-model="item.price" placeholder="" style="width:50px;" readonly></el-input>
135
+        共
136
+        <el-input v-model="item.count" placeholder="" style="width:50px;" readonly></el-input>
137
+        次
138
+        <!--<i class="el-icon-delete deleteIcon" @click="delAddition(index,item)"></i>-->
139
+      </div>
140
+    </div>
99 141
   </div>
100 142
 </template>
101 143
 

+ 143 - 47
src/xt_pages/outpatientCharges/outpatientChargesManagement.vue View File

@@ -334,6 +334,7 @@
334 334
                   execution_frequency: prescription.advices[b].execution_frequency,
335 335
                   retail_price: prescription.advices[b].price.toString(),
336 336
                   remark: prescription.advices[b].remark,
337
+                  day: prescription.advices[b].day,
337 338
                   prescribing_number: prescription.advices[b].prescribing_number.toString(),
338 339
                   single_dose_unit: prescription.advices[b].single_dose_unit,
339 340
                   prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
@@ -357,8 +358,10 @@
357 358
                   total: prescription.project[b].count.toString(),
358 359
                   price: prescription.project[b].price,
359 360
                   remark: prescription.project[b].remark,
360
-                  medical_code: prescription.project[b].project.medical_code
361
+                  medical_code: prescription.project[b].project.medical_code,
362
+                  unit:prescription.project[b].unit,
361 363
                 }
364
+
362 365
                 tempProject.push(obj)
363 366
               }
364 367
               let index = i + 1
@@ -421,19 +424,21 @@
421 424
 
422 425
             }
423 426
           }
424
-          return Math.floor(total * 100) / 100
425
-
426 427
         } else {
427
-          var total = 0
428 428
           if (this.curPrescriptions.project != null) {
429 429
             for (let b = 0; b < this.curPrescriptions.project.length; b++) {
430 430
               total = total +  Math.floor((this.curPrescriptions.project[b].price * this.curPrescriptions.project[b].total) * 100) / 100
431 431
 
432 432
             }
433 433
           }
434
-          return Math.floor(total * 100) / 100
434
+        }
435 435
 
436
+        if (this.curPrescriptions.addition != null) {
437
+          for (let b = 0; b < this.curPrescriptions.addition.length; b++) {
438
+            total = total +  Math.floor((this.curPrescriptions.addition[b].price * this.curPrescriptions.addition[b].count) * 100) / 100
439
+          }
436 440
         }
441
+        return Math.floor(total * 100) / 100
437 442
 
438 443
       },
439 444
       getTotal() {
@@ -450,12 +455,14 @@
450 455
               total = total + Math.floor((this.prescriptions[i].project[b].price * this.prescriptions[i].project[b].total) * 100) / 100
451 456
             }
452 457
           }
453
-
454
-          for (let i = 0; i < this.addtions_charge.length; i++) {
455
-            total = total + Math.floor(this.addtions_charge[i].price * 100) / 100
458
+          if (this.prescriptions[i].addition != null) {
459
+            for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
460
+              total = total + Math.floor((this.prescriptions[i].addition[b].price * this.prescriptions[i].addition[b].count) * 100) / 100
461
+            }
456 462
           }
457
-          return Math.floor(total * 100) / 100
458 463
         }
464
+        return Math.floor(total * 100) / 100
465
+
459 466
       },
460 467
       moreState(tab, event) {
461 468
         if (tab == 'more') {
@@ -500,28 +507,43 @@
500 507
           })
501 508
 
502 509
         } else if (index == 5) {
503
-          let params = {
504
-            'order_id': this.order.id,
505
-            'number': this.order.number,
506
-          }
507
-          Refund(params).then(response => {
508
-            if (response.data.state == 0) {
509
-              this.$message.error(response.data.msg)
510
-              this.loadingtwo = false
511
-              return false
512
-            } else {
513
-              this.$message({ message: '退费成功', type: 'success' })
514
-              this.loadingtwo = false
515 510
 
511
+          this.$confirm('是否退费', '退费', {
512
+            confirmButtonText: '确 定',
513
+            cancelButtonText: '取 消',
514
+            type: 'warning'
515
+          }).then(() => {
516
+            let params = {
517
+              'order_id': this.order.id,
518
+              'number': this.order.number,
516 519
             }
520
+            Refund(params).then(response => {
521
+              if (response.data.state == 0) {
522
+                this.$message.error(response.data.msg)
523
+                this.loadingtwo = false
524
+                return false
525
+              } else {
526
+                this.$message({ message: '退费成功', type: 'success' })
527
+                this.loadingtwo = false
528
+
529
+              }
530
+            })
531
+
532
+          }).catch(() => {
533
+
517 534
           })
518 535
 
536
+
519 537
         } else if (index == 6) {
520 538
 
521 539
           if (this.patientInfo.id == 0) {
522 540
             this.$message.error('请先选择要挂号的病人')
523 541
             return
524 542
           }
543
+
544
+
545
+
546
+
525 547
           let params = {
526 548
             'id': this.patientInfo.id,
527 549
             'record_time': this.record_date
@@ -554,45 +576,102 @@
554 576
         // console.log(id)
555 577
         // this.radioStatus = id
556 578
         // this.getPatientList()
579
+        let temp_id = id
557 580
 
558
-        switch (id) {
559
-          case 1:
560
-                this.patientTableData = []
581
+        let params = {
582
+          'record_date': this.record_date
583
+        }
584
+        getSchedulePatientList(params).then(response => {
585
+          if (response.data.state == 0) {
586
+            this.$message.error(response.data.msg)
587
+            return false
588
+          } else {
589
+            this.patientTableData = []
590
+            this.all_table_data = []
591
+            let one_count = 0
592
+            let two_count = 0
593
+            let three_count = 0
594
+            for (let i = 0; i < response.data.data.list.length; i++) {
595
+              // console.log('99999999', response.data.data.list)
561 596
 
562
-            for (let i = 0; i < this.all_table_data.length; i++){
563
-              if(this.all_table_data[i].info.prescription_status == 0 || this.all_table_data[i].info.prescription_status == 1 || this.all_table_data[i].info.prescription_status == 2 ){
564
-                this.patientTableData.push(this.all_table_data[i])
597
+              if(response.data.data.list[i].info.prescription_status == 0 || response.data.data.list[i].info.prescription_status == 1 ||response.data.data.list[i].info.prescription_status == 2 ){
598
+                if (response.data.data.list[i].prescription != null && response.data.data.list[i].prescription.length > 0) {
599
+                  one_count = one_count + 1
600
+                  this.patientTableData.push(response.data.data.list[i])
601
+                }
565 602
               }
566 603
 
567
-            }
568
-            break
569
-          case 2:
570
-            this.patientTableData = []
571
-            for (let i = 0; i < this.all_table_data.length; i++){
572
-              if(this.all_table_data[i].info.prescription_status == 3){
573
-                this.patientTableData.push(this.all_table_data[i])
604
+              if(response.data.data.list[i].info.prescription_status == 3){
605
+                if (response.data.data.list[i].prescription != null && response.data.data.list[i].prescription.length > 0) {
606
+
607
+                  two_count = two_count + 1
608
+                }
574 609
               }
575 610
 
611
+              if(response.data.data.list[i].info.prescription_status == 4){
612
+                if (response.data.data.list[i].prescription != null && response.data.data.list[i].prescription.length > 0) {
613
+                  three_count = three_count + 1
614
+                }
615
+              }
576 616
 
617
+              if (response.data.data.list[i].prescription != null && response.data.data.list[i].prescription.length > 0) {
618
+                this.all_table_data.push(response.data.data.list[i])
619
+              }
577 620
             }
578
-            break
579
-          case 3:
580
-            this.patientTableData = []
581 621
 
582
-            for (let i = 0; i < this.all_table_data.length; i++){
622
+            this.cal_one = one_count
623
+            this.cal_two = two_count
624
+            this.cal_three = three_count
583 625
 
584
-              if(this.all_table_data[i].info.prescription_status == 4){
585
-                this.patientTableData.push(this.all_table_data[i])
586
-              }
626
+            switch (temp_id) {
627
+
628
+              case 1:
629
+                this.patientTableData = []
630
+
631
+                for (let i = 0; i < this.all_table_data.length; i++){
632
+                  if(this.all_table_data[i].info.prescription_status == 0 || this.all_table_data[i].info.prescription_status == 1 || this.all_table_data[i].info.prescription_status == 2 ){
633
+                    this.patientTableData.push(this.all_table_data[i])
634
+                  }
635
+
636
+                }
637
+                break
638
+              case 2:
639
+                this.patientTableData = []
640
+                for (let i = 0; i < this.all_table_data.length; i++){
641
+                  if(this.all_table_data[i].info.prescription_status == 3){
642
+                    this.patientTableData.push(this.all_table_data[i])
643
+                  }
644
+
645
+
646
+                }
647
+                break
648
+              case 3:
649
+                this.patientTableData = []
650
+
651
+                for (let i = 0; i < this.all_table_data.length; i++){
652
+
653
+                  if(this.all_table_data[i].info.prescription_status == 4){
654
+                    this.patientTableData.push(this.all_table_data[i])
655
+                  }
656
+
657
+                }
658
+                break
659
+              case 4:
660
+                this.patientTableData = []
661
+                this.patientTableData = this.all_table_data
662
+                break
587 663
 
588 664
             }
589
-            break
590
-          case 4:
591
-            this.patientTableData = []
592
-            this.patientTableData = this.all_table_data
593
-            break
594 665
 
595
-        }
666
+            this.current_index = 0
667
+            this.$refs.tab.setCurrentRow(this.patientTableData[0])
668
+            this.getPatientInformation(this.patientTableData[0].patients.id,"")
669
+
670
+
671
+          }
672
+        })
673
+
674
+
596 675
 
597 676
 
598 677
 
@@ -699,6 +778,7 @@
699 778
 
700 779
               let tempAdvice = []
701 780
               let tempProject = []
781
+              let tempAddition = []
702 782
 
703 783
               for (let b = 0; b < prescription.advices.length; b++) {
704 784
                 let obj = {
@@ -709,6 +789,7 @@
709 789
                   execution_frequency: prescription.advices[b].execution_frequency,
710 790
                   retail_price: prescription.advices[b].price.toString(),
711 791
                   remark: prescription.advices[b].remark,
792
+                  day: prescription.advices[b].day,
712 793
                   prescribing_number: prescription.advices[b].prescribing_number.toString(),
713 794
                   single_dose_unit: prescription.advices[b].single_dose_unit,
714 795
                   prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
@@ -736,12 +817,27 @@
736 817
                 }
737 818
                 tempProject.push(obj)
738 819
               }
820
+
821
+              for (let b = 0; b < prescription.addition.length; b++) {
822
+                let obj = {
823
+                  id: prescription.addition[b].id,
824
+                  item_name: prescription.addition[b].item_name,
825
+                  price: prescription.addition[b].price,
826
+                  count: prescription.addition[b].count,
827
+                  item_id: prescription.addition[b].item_id,
828
+                }
829
+                tempAddition.push(obj)
830
+              }
831
+
832
+
833
+
739 834
               let index = i + 1
740 835
               let obj = {
741 836
                 id: prescription.id,
742 837
                 name: '处方' + index,
743 838
                 advices: tempAdvice,
744 839
                 project: tempProject,
840
+                addition:tempAddition,
745 841
                 order_status: response.data.data.prescription[i].order_status,
746 842
                 type: response.data.data.prescription[i].type
747 843
               }

+ 218 - 24
src/xt_pages/outpatientCharges/summary.vue View File

@@ -6,27 +6,40 @@
6 6
     <div class="app-container">
7 7
       <div style="display: flex;justify-content: space-between;margin-bottom:10px;">
8 8
         <div>
9
-          <el-input size="small" style="width:150px;" @keyup.enter.native='searchAction' v-model.trim="search_input"
9
+          <el-input size="small" style="width:150px;"  v-model="keywords"
10 10
                     class="filter-item"/>
11 11
           <el-button size="small" style="margin-left:10px;" class="filter-item" type="primary" @click="searchAction">
12 12
             搜索
13 13
           </el-button>
14
-          <el-select size="small" v-model="value" placeholder="请选择" style="width:150px;margin-left:10px;">
14
+          <el-select size="small" v-model="admin_user_id" placeholder="请选择" style="width:150px;margin-left:10px;" @change="changeDoctor">
15 15
             <el-option
16
-              v-for="item in options"
17
-              :key="item.value"
18
-              :label="item.label"
19
-              :value="item.value">
16
+              label="全部"
17
+              value="0">
18
+            </el-option>
19
+            <el-option
20
+              v-for="item,index in doctors"
21
+              :key="index"
22
+              :label="item.user_name"
23
+              :value="item.admin_user_id">
20 24
             </el-option>
21 25
           </el-select>
22
-          <el-date-picker size="small" v-model="selected_date" prefix-icon="el-icon-date"
23
-                          @change="handleScheduleDateChange" :editable="false" :clearable="false"
24
-                          style="width: 196px;margin-right:10px;" type="date" placeholder="选择日期时间"
26
+          <el-date-picker size="small" v-model="start_time" prefix-icon="el-icon-date"
27
+                          @change="handleStartTimeChange" :editable="false" :clearable="false"
28
+                          style="width: 196px;margin-right:10px;" type="date" placeholder="选择开始日期"
29
+                          format="yyyy-MM-dd"
30
+                          value-format="yyyy-MM-dd"
31
+                          align="right"></el-date-picker>
32
+
33
+          <el-date-picker size="small" v-model="end_time" prefix-icon="el-icon-date"
34
+                          @change="handleEndTimeChange" :editable="false" :clearable="false"
35
+                          style="width: 196px;margin-right:10px;" type="date" placeholder="选择结束日期"
36
+                          format="yyyy-MM-dd"
37
+                          value-format="yyyy-MM-dd"
25 38
                           align="right"></el-date-picker>
26 39
           <!--<el-radio v-model="radio" label="1">明细</el-radio>-->
27 40
           <!--<el-radio v-model="radio" label="2">汇总</el-radio>-->
28 41
         </div>
29
-        <!--<el-button size="small" type="primary">报表下载</el-button>-->
42
+        <el-button size="small" type="primary" @click="export_detail">报表下载</el-button>
30 43
       </div>
31 44
       <el-table :data="tableData" border height="500" style="width: 100%;" :row-style="{ color: '#303133' }"
32 45
                 :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
@@ -38,8 +51,8 @@
38 51
           type="index"
39 52
         >
40 53
         </el-table-column>
41
-        <el-table-column align="center" prop="name" label="门诊/销售编号">
42
-          <template slot-scope="scope">{{ scope.row.number }}</template>
54
+        <el-table-column align="center" prop="name" label="门诊号">
55
+          <template slot-scope="scope">{{ scope.row.his_patient.number }}</template>
43 56
         </el-table-column>
44 57
         <el-table-column align="center" prop="name" label="患者名字">
45 58
           <template slot-scope="scope">{{ scope.row.patient.name }}</template>
@@ -53,8 +66,8 @@
53 66
         <el-table-column align="center" prop="name" label="实收金额">
54 67
           <template slot-scope="scope">{{scope.row.medfee_sumamt}}</template>
55 68
         </el-table-column>
56
-        <el-table-column align="center" prop="name" label="舍入金额">
57
-          <template slot-scope="scope">{{scope.row.medfee_sumamt - scope.row.medfee_sumamt}}</template>
69
+        <el-table-column align="center" prop="name" label="科室">
70
+          <template slot-scope="scope">{{scope.row.p_info.department.name}}</template>
58 71
         </el-table-column>
59 72
         <el-table-column align="center" prop="name" label="收费日期">
60 73
           <template slot-scope="scope">  {{getTimes(scope.row.settle_accounts_date)}}</template>
@@ -75,14 +88,28 @@
75 88
           </template>
76 89
         </el-table-column>
77 90
       </el-table>
91
+      <el-pagination
92
+        @size-change="handleSizeChange"
93
+        @current-change="handleCurrentChange"
94
+        :page-sizes="[10, 50, 100]"
95
+        :page-size="10"
96
+        background
97
+        style="margin-top:20px;float: right"
98
+        layout="total, sizes, prev, pager, next, jumper"
99
+        :total="total"
100
+
101
+      >
102
+      </el-pagination>
78 103
     </div>
104
+
105
+
79 106
   </div>
80 107
 </template>
81 108
 
82 109
 
83 110
 <script>
84 111
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
85
-  import { getHisOrderList } from '@/api/his/his'
112
+  import { getHisOrderList,getDoctorList,getExportConsumeDetailList } from '@/api/his/his'
86 113
   import { uParseTime } from '@/utils/tools'
87 114
 
88 115
   export default {
@@ -95,10 +122,153 @@
95 122
           { path: false, name: '门诊收费' },
96 123
           { path: false, name: '项目消费明细汇总' }
97 124
         ],
98
-        tableData: []
125
+        tableData: [],
126
+        limit:10,
127
+        page:1,
128
+        keywords:"",
129
+        start_time:"",
130
+        end_time:"",
131
+        total:"",
132
+        doctors:[],
133
+        admin_user_id:"",
134
+
99 135
       }
100 136
     },
101 137
     methods: {
138
+      export_detail(){
139
+        let params= {
140
+          start_time:this.start_time,
141
+          end_time: this.end_time,
142
+        }
143
+        getExportConsumeDetailList(params).then(response => {
144
+          if (response.data.state == 0) {
145
+            this.$message.error(response.data.msg)
146
+            return false
147
+          } else {
148
+
149
+            let list = []
150
+            for (let i =0; i < response.data.data.order.length; i++){
151
+            let order =   response.data.data.order[i]
152
+              let number = ""
153
+              let name = ""
154
+              let department = ""
155
+              let doctor_name = ""
156
+              let balance_accounts = ""
157
+
158
+              let order_status = ""
159
+
160
+
161
+
162
+              if(order.his_patient != null && order.his_patient.number.length > 0){
163
+                number = order.his_patient.number
164
+
165
+              }
166
+
167
+              if(order.his_patient != null ){
168
+                if(order.his_patient.balance_accounts_type == 1){
169
+                  balance_accounts = "自费"
170
+                }
171
+
172
+                if(order.his_patient.balance_accounts_type == 2){
173
+                  balance_accounts = "医保"
174
+                }
175
+              }
176
+
177
+              if(order.patient != null && order.patient.name.length > 0){
178
+                name = order.patient.name
179
+
180
+              }
181
+
182
+              if(order.p_info != null && order.p_info.department != null && order.p_info.department.name.length > 0){
183
+                department = order.p_info.department.name
184
+
185
+              }
186
+
187
+              if(order.p_info != null && order.p_info.doctor.length > 0){
188
+                doctor_name = order.p_info.doctor
189
+              }
190
+
191
+              if(order.order_status == 1){
192
+                order_status = "待结算"
193
+              }
194
+
195
+              if(order.order_status == 2){
196
+                order_status = "已结算"
197
+              }
198
+
199
+              if(order.order_status == 3){
200
+                order_status = "已退费"
201
+              }
202
+
203
+
204
+              let obj = {
205
+                "就诊号":number,
206
+                "患者姓名":name,
207
+                "应收金额":order.medfee_sumamt,
208
+                "实收金额":order.medfee_sumamt,
209
+                "科室":department,
210
+                "医生姓名":doctor_name,
211
+                "收费类别":balance_accounts,
212
+                "收费者姓名":doctor_name,
213
+                "总金额":order.medfee_sumamt,
214
+                "现金支付":"",
215
+                "账户支付":"",
216
+                "支付宝支付":"",
217
+                "微信支付":"",
218
+                "其他支付":"",
219
+                "收费日期":"",
220
+                "收费状态":order_status,
221
+                "退费日期":"",
222
+              }
223
+              list.push(obj)
224
+            }
225
+            import('@/vendor/Export2Excel').then(excel => {
226
+              const tHeader = ['就诊号', '患者姓名', '应收金额', '实收金额', '科室',"医生姓名","收费类别","收费者姓名","总金额","现金支付","账户支付","支付宝支付","微信支付","其他支付","收费日期","收费状态","退费日期"]
227
+              const filterVal = ['就诊号', '患者姓名', '应收金额', '实收金额', '科室',"医生姓名","收费类别","收费者姓名","总金额","现金支付","账户支付","支付宝支付","微信支付","其他支付","收费日期","收费状态","退费日期"]
228
+              const data = this.formatJson(filterVal, list)
229
+              excel.export_json_to_excel({
230
+                header: tHeader,
231
+                data,
232
+                filename: "消费明细"
233
+              })
234
+            })
235
+
236
+          }
237
+        })
238
+
239
+      },  formatJson(filterVal, jsonData) {
240
+        return jsonData.map(v => filterVal.map(j => v[j]))
241
+      },
242
+      changeDoctor(){
243
+        this.page = 1
244
+        this.keywords=""
245
+        this.getHisOrderList()
246
+      },
247
+      handleSizeChange(limit){
248
+        this.limit = limit;
249
+        this.getHisOrderList()
250
+
251
+      },handleCurrentChange(page){
252
+        this.page = page;
253
+        this.getHisOrderList()
254
+
255
+
256
+      },
257
+      handleStartTimeChange(){
258
+        this.page = 1
259
+        this.keywords=""
260
+        this.getHisOrderList()
261
+      },handleEndTimeChange(){
262
+        this.page = 1
263
+        this.keywords=""
264
+        this.getHisOrderList()
265
+      },
266
+      searchAction(){
267
+        this.page = 1
268
+        this.getHisOrderList()
269
+
270
+
271
+      },
102 272
       getTimes(time) {
103 273
         return uParseTime(time, "{y}-{m}-{d}");
104 274
       },
@@ -109,17 +279,41 @@
109 279
           return uParseTime(value, temp)
110 280
         }
111 281
         return ''
282
+      },getHisOrderList(){
283
+        let params= {
284
+          page : this.page,
285
+          limit: this.limit,
286
+          keywords:this.keywords,
287
+          start_time:this.start_time,
288
+          end_time: this.end_time,
289
+          type: this.admin_user_id
290
+        }
291
+        getHisOrderList(params).then(response => {
292
+          if (response.data.state == 0) {
293
+            this.$message.error(response.data.msg)
294
+            return false
295
+          } else {
296
+            this.tableData = response.data.data.order
297
+            this.total = response.data.data.total
298
+          }
299
+        })
300
+
301
+      },getDoctorList(){
302
+        getDoctorList().then(response => {
303
+          if (response.data.state == 0) {
304
+            this.$message.error(response.data.msg)
305
+            return false
306
+          } else {
307
+            this.doctors = response.data.data.doctors
308
+          }
309
+        })
310
+
311
+
112 312
       }
113 313
     }, created() {
114
-      getHisOrderList().then(response => {
115
-        if (response.data.state == 0) {
116
-          this.$message.error(response.data.msg)
117
-          return false
118
-        } else {
119
-          this.tableData = response.data.data.order
314
+     this.getDoctorList()
315
+     this.getHisOrderList()
120 316
 
121
-        }
122
-      })
123 317
 
124 318
     }
125 319
   }

+ 127 - 42
src/xt_pages/outpatientCharges/summaryDetail.vue View File

@@ -7,22 +7,87 @@
7 7
             <div class="mainCenter">
8 8
                 <div class="centerLeft">
9 9
                     <div class="tabsBox">
10
-                      <el-tabs class="preTabs" v-model="editableTabsValue" type="card" @tab-click="tabclickEvent">
11
-                        <el-tab-pane
12
-                          v-for="(item, index) in prescriptions"
13
-                          :key="index"
14
-                          :label="item.name"
15
-                          :name="item.name"
16
-                        >
17
-                        </el-tab-pane>
18
-
19
-                        <div class="RP">
20
-                          Rp
21
-                        </div>
22
-                        <prescription-table ref="prescription_tables"
23
-                                            :prescription="curPrescriptions"></prescription-table>
10
+                      <el-table  :data="tableData" border style="width: 99%;"
11
+                                :row-style="{ color: '#303133' }"
12
+                                :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
13
+
14
+                        <el-table-column align="center" prop="project_name" label="名称">
15
+                          <template slot-scope="scope">{{ scope.row.name }}</template>
16
+                        </el-table-column>
17
+
18
+                        <el-table-column align="center" prop="project_name" label="分类">
19
+                          <template slot-scope="scope">{{ scope.row.type == 1?'药品':'项目' }}</template>
20
+                        </el-table-column>
21
+
22
+
23
+                        <el-table-column align="center" prop="statistical_classification" width="100" label="组">
24
+                          <template slot-scope="scope">
25
+                            {{getGroup(scope.row.statistical_classification)}}
26
+                          </template>
27
+                        </el-table-column>
28
+                        <el-table-column align="center" prop="single_dose" width="80" label="单次用量">
29
+                          <template slot-scope="scope">
30
+                            <!--<el-input v-model="scope.row.single_dose" placeholder="" readonly></el-input>-->
31
+                            {{scope.row.single_dose}}{{scope.row.single_dose_unit}}
32
+                          </template>
33
+                        </el-table-column>
34
+                        <el-table-column align="center" prop="delivery_way" width="80" label="用法">
35
+                          <template slot-scope="scope">
36
+                            <!--<el-input v-model="scope.row.delivery_way" placeholder="" readonly></el-input>-->
37
+                            {{scope.row.delivery_way}}
38
+
39
+                          </template>
40
+                        </el-table-column>
41
+                        <el-table-column align="center" prop="execution_frequency" width="80" label="频率">
42
+                          <template slot-scope="scope">
43
+                            <!--<el-input v-model="scope.row.execution_frequency" placeholder="" readonly></el-input>-->
44
+                            {{scope.row.execution_frequency}}
24 45
 
25
-                      </el-tabs>
46
+                          </template>
47
+                        </el-table-column>
48
+                        <el-table-column align="center" prop="number_days" width="50" label="天数">
49
+                          <template slot-scope="scope">
50
+                            <!--<el-input v-model="scope.row.number_days" placeholder="" readonly></el-input>-->
51
+                            {{scope.row.day}}
52
+
53
+                          </template>
54
+                        </el-table-column>
55
+                        <el-table-column align="center" prop="total" width="50" label="总量">
56
+                          <template slot-scope="scope">
57
+                            <div style="display:flex;">
58
+                              <!--<el-input v-model="scope.row.total" placeholder="" readonly></el-input>-->
59
+                              {{scope.row.count}}
60
+                              <div>{{scope.row.prescribing_number_unit}}</div>
61
+
62
+                            </div>
63
+                          </template>
64
+                        </el-table-column>
65
+                        <el-table-column align="center" prop="name" width="50" label="单价">
66
+                          <template slot-scope="scope">
67
+                            <!--<el-input v-model="scope.row.price" placeholder="" readonly></el-input>-->
68
+                            {{scope.row.price}}
69
+
70
+                          </template>
71
+                        </el-table-column>
72
+                        <el-table-column align="center" prop="name" width="50" label="备注">
73
+                          <template slot-scope="scope">
74
+                            <!--<el-input v-model="scope.row.remark" readonly></el-input>-->
75
+                            {{scope.row.remark}}
76
+
77
+                          </template>
78
+                        </el-table-column>
79
+                      </el-table>
80
+
81
+                      <div class="additionalBox">
82
+                        <div class="additionalOne" v-for="(item,index) in additions" :key="index">
83
+                          <span>{{item.item_name}}</span>
84
+                          <el-input v-model="item.price" placeholder="" style="width:50px;" readonly></el-input>
85
+                          共
86
+                          <el-input v-model="item.count" placeholder="" style="width:50px;" readonly></el-input>
87
+                          次
88
+                          <!--<i class="el-icon-delete deleteIcon" @click="delAddition(index,item)"></i>-->
89
+                        </div>
90
+                      </div>
26 91
 
27 92
                     </div>
28 93
                     <div class="costBox">
@@ -68,6 +133,7 @@
68 133
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
69 134
 import { getHisOrder } from '@/api/his/his'
70 135
 import prescriptionTable from './components/prescriptionTable'
136
+import { getDictionaryDataConfig} from "@/utils/data";
71 137
 
72 138
 export default {
73 139
     components:{
@@ -86,6 +152,7 @@ export default {
86 152
           prescriptions: [],
87 153
           record_date: '',
88 154
           tableData: [],
155
+          additions:[],
89 156
           editableTabsValue: '1',
90 157
           loadingone: false,
91 158
           editableTabs: [{
@@ -111,7 +178,9 @@ export default {
111 178
     },created(){
112 179
       this.GetOrderDetail()
113 180
   },methods:{
114
-
181
+    getDictionaryDataConfig(module, filed_name) {
182
+      return getDictionaryDataConfig(module, filed_name)
183
+    },
115 184
     tabclickEvent(val) {
116 185
       for (let i = 0; i < this.prescriptions.length; i++) {
117 186
         if (this.prescriptions[i].name == val.name) {
@@ -134,6 +203,16 @@ export default {
134 203
         }
135 204
       })
136 205
       return targetObj
206
+    },  getGroup(id){
207
+      var name = ""
208
+      var statistics_category =  getDictionaryDataConfig('system','statistics_category')
209
+      console.log("2235",statistics_category)
210
+      for(let i=0;i<statistics_category.length;i++){
211
+        if(id == statistics_category[i].id){
212
+          name = statistics_category[i].name
213
+        }
214
+      }
215
+      return name
137 216
     },
138 217
     getTotal() {
139 218
       var total = 0
@@ -172,59 +251,65 @@ export default {
172 251
           this.order = response.data.data.order
173 252
 
174 253
           this.prescriptions = []
254
+          this.tableData = []
255
+
175 256
           for (let i = 0; i < response.data.data.prescription.length; i++) {
176 257
             var prescription = response.data.data.prescription[i]
177 258
 
178
-            let tempAdvice = []
179
-            let tempProject = []
180 259
 
181 260
             for (let b = 0; b < prescription.advices.length; b++) {
182 261
               let obj = {
183
-                advice_id: prescription.advices[b].id,
184
-                drug_name: prescription.advices[b].advice_name,
262
+                name: prescription.advices[b].advice_name,
263
+                statistical_classification:"",
264
+                type:1,
185 265
                 single_dose: prescription.advices[b].single_dose,
186 266
                 delivery_way: prescription.advices[b].delivery_way,
187 267
                 execution_frequency: prescription.advices[b].execution_frequency,
188
-                retail_price: prescription.advices[b].price.toString(),
268
+                price: prescription.advices[b].price.toString(),
269
+                day: prescription.advices[b].day,
270
+                count:prescription.advices[b].prescribing_number.toString(),
189 271
                 remark: prescription.advices[b].remark,
190
-                prescribing_number: prescription.advices[b].prescribing_number.toString(),
191 272
                 single_dose_unit: prescription.advices[b].single_dose_unit,
192 273
                 prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
193
-                min_unit: prescription.advices[b].single_dose_unit,
194
-                medical_insurance_number: prescription.advices[b].med_list_codg
195 274
 
196 275
               }
197
-              tempAdvice.push(obj)
276
+              this.tableData.push(obj)
198 277
             }
199 278
 
200 279
             for (let b = 0; b < prescription.project.length; b++) {
201
-              console.log(prescription.project[b].project.project_name)
202 280
               let obj = {
203
-                id: prescription.project[b].id,
204
-                project_id: prescription.project[b].project.id,
205
-                project_name: prescription.project[b].project.project_name,
281
+                name: prescription.project[b].project.project_name,
206 282
                 statistical_classification: prescription.project[b].project.statistical_classification,
207 283
                 single_dose: prescription.project[b].single_dose,
208 284
                 delivery_way: prescription.project[b].delivery_way,
209 285
                 execution_frequency: prescription.project[b].execution_frequency,
210
-                number_days: prescription.project[b].day,
211
-                total: prescription.project[b].count.toString(),
212 286
                 price: prescription.project[b].price,
287
+                day: prescription.project[b].day,
288
+                count: prescription.project[b].count.toString(),
213 289
                 remark: prescription.project[b].remark,
214
-                medical_code: prescription.project[b].project.medical_code
290
+                single_dose_unit:"",
291
+                prescribing_number_unit:"",
292
+                type:2,
215 293
               }
216
-              tempProject.push(obj)
294
+              this.tableData.push(obj)
217 295
             }
218
-            let index = i + 1
219
-            let obj = {
220
-              id: prescription.id,
221
-              name: '处方' + index,
222
-              advices: tempAdvice,
223
-              project: tempProject,
224
-              type: response.data.data.prescription[i].type
296
+
297
+            for (let b = 0; b < prescription.addition.length; b++) {
298
+                this.additions.push( prescription.addition[b])
225 299
             }
226
-            this.prescriptions.push(obj)
227
-            this.curPrescriptions = this.prescriptions[0]
300
+
301
+
302
+
303
+            // let index = i + 1
304
+            // let obj = {
305
+            //   id: prescription.id,
306
+            //   name: '处方' + index,
307
+            //   advices: tempAdvice,
308
+            //   project: tempProject,
309
+            //   type: response.data.data.prescription[i].type
310
+            // }
311
+            // this.prescriptions.push(obj)
312
+            // this.curPrescriptions = this.prescriptions[0]
228 313
 
229 314
           }
230 315
           // this.tableData = response.data.data.order

+ 12 - 37
src/xt_pages/outpatientDoctorStation/components/additionalCharges.vue View File

@@ -11,7 +11,7 @@
11 11
               @select='selectDrugs'>
12 12
       <el-table-column align="center" type="selection" width="40"></el-table-column>
13 13
       <el-table-column align="center" prop="name" label="名称" width="100">
14
-        <template slot-scope="scope">{{ scope.row.name }}</template>
14
+        <template slot-scope="scope">{{ scope.row.item_name }}</template>
15 15
       </el-table-column>
16 16
       <el-table-column align="center" prop="name" label="金额(元)">
17 17
         <template slot-scope="scope">
@@ -33,8 +33,7 @@
33 33
     props: {
34 34
       hisPatientInfo: Object,
35 35
       patientInfo: Object,
36
-      additions: Array,
37
-      addtions_charge: Array
36
+      additions: Array
38 37
 
39 38
     },
40 39
     data() {
@@ -60,28 +59,17 @@
60 59
       show() {
61 60
         this.chargeTable = []
62 61
         this.visible = true
63
-        if (this.addtions_charge == null || this.addtions_charge.length == 0) {
64
-          for (let i = 0; i < this.additions.length; i++) {
65
-            let obj = {
66
-              id: '0',
67
-              item_id: this.additions[i].id.toString(),
68
-              name: this.additions[i].name,
69
-              price: this.additions[i].price.toString()
70
-            }
71
-            this.chargeTable.push(obj)
72
-          }
73
-        } else {
74
-
75
-          for (let i = 0; i < this.addtions_charge.length; i++) {
76
-            let obj = {
77
-              id: this.addtions_charge[i].id.toString(),
78
-              item_id: this.addtions_charge[i].item_id.toString(),
79
-              name: this.addtions_charge[i].item_name,
80
-              price: this.addtions_charge[i].price.toString()
81
-            }
82
-            this.chargeTable.push(obj)
62
+        for (let i = 0; i < this.additions.length; i++) {
63
+          let obj = {
64
+            id: '0',
65
+            item_id: this.additions[i].id,
66
+            item_name: this.additions[i].name,
67
+            price: this.additions[i].price,
68
+            count: this.additions[i].count,
83 69
           }
70
+          this.chargeTable.push(obj)
84 71
         }
72
+
85 73
       },
86 74
       hide() {
87 75
         this.visible = false
@@ -90,20 +78,7 @@
90 78
         this.charges = val
91 79
       },
92 80
       submitAction() {
93
-        var params = {
94
-          his_patient_id: this.hisPatientInfo.id,
95
-          patient_id: this.patientInfo.id,
96
-          medicineData: this.charges
97
-        }
98
-        saveCharges(params).then(response => {
99
-          if (response.data.state == 1) {
100
-            var data = response.data.data.additional_charges
101
-            this.$emit('setData', data)
102
-            this.$message.success('保存成功')
103
-            this.visible = false
104
-
105
-          }
106
-        })
81
+        this.$emit('setData', this.charges)
107 82
       }
108 83
     },
109 84
     watch: {

+ 114 - 50
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue View File

@@ -145,6 +145,14 @@
145 145
                           <el-table-column label="规格" width="60">
146 146
                             <template slot-scope="scope">{{ scope.row.drug_spec }}</template>
147 147
                           </el-table-column>
148
+                          <el-table-column label="库存" width="60">
149
+                            <template slot-scope="scope">{{
150
+                              stockInCount(scope.row) -
151
+                              salesReturnCount(scope.row) -
152
+                              stockOutCount(scope.row) +
153
+                              cancelStockCount(scope.row)
154
+                              }}</template>
155
+                          </el-table-column>
148 156
                           <el-table-column label="单价" width="40">
149 157
                             <template slot-scope="scope">{{ scope.row.retail_price }}</template>
150 158
                           </el-table-column>
@@ -253,7 +261,7 @@
253 261
       </div>
254 262
     </div>
255 263
     <additionalCharges   v-on:setData="setCharge" ref='additionalCharges' :hisPatientInfo="hisPatientInfo"
256
-                       :patientInfo="patientInfo" :additions="additions" :addtions_charge="addtions_charge"></additionalCharges>
264
+                       :patientInfo="patientInfo" :additions="additions" ></additionalCharges>
257 265
     <select-template ref='selectTemplate'></select-template>
258 266
     <save-template ref='saveTemplate'></save-template>
259 267
   </div>
@@ -282,7 +290,10 @@
282 290
       prescriptions: Array,
283 291
       record_date: String,
284 292
       search_keyword: '',
285
-      addtions_charge:Array,
293
+      addtions_charge: {
294
+        type: Array,
295
+        default: []
296
+      },
286 297
 
287 298
       other_sick: {
288 299
         type: Array,
@@ -302,7 +313,7 @@
302 313
     data() {
303 314
       return {
304 315
         register_type: '',
305
-        value: '',
316
+        value: '0',
306 317
         form: {
307 318
           name: ''
308 319
         },
@@ -315,7 +326,7 @@
315 326
           title: '处方1',
316 327
           name: '1'
317 328
         }],
318
-        tabIndex: 1,
329
+        tabIndex: this.prescriptions.length,
319 330
         currenet_inedx: 0,
320 331
         rightTab: 1,
321 332
         activeName: '1',
@@ -355,11 +366,51 @@
355 366
       }
356 367
     },
357 368
     methods: {
358
-      setCharge(additional_charges){
359
-        console.log("111122222")
360
-        this.addtions_charge = additional_charges
361
-        console.log(this.addtions_charge )
369
+      stockInCount: function(row) {
370
+        let total = 0;
371
+        if(row.stock_in != null) {
372
+          for (let i = 0; i < row.stock_in.length; i++) {
373
+            total = total + row.stock_in[i].warehousing_count;
374
+          }
375
+        }
376
+        return total;
377
+      },
378
+      salesReturnCount: function(row) {
379
+        let total = 0;
380
+        if(row.sales_return != null) {
362 381
 
382
+          for (let i = 0; i < row.sales_return.length; i++) {
383
+            total = total + row.sales_return[i].count;
384
+          }
385
+        }
386
+        return total;
387
+      },
388
+      stockOutCount: function(row) {
389
+        let total = 0;
390
+        if(row.stock_out != null) {
391
+
392
+          for (let i = 0; i < row.stock_out.length; i++) {
393
+            total = total + row.stock_out[i].count;
394
+          }
395
+        }
396
+        return total;
397
+      },
398
+      cancelStockCount: function(row) {
399
+        let total = 0;
400
+        if(row.cancel_stock != null) {
401
+          for (let i = 0; i < row.cancel_stock.length; i++) {
402
+            total = total + row.cancel_stock[i].count;
403
+          }
404
+        }
405
+        return total;
406
+      },
407
+
408
+      setCharge(additional_charges){
409
+        for (let i = 0; i < additional_charges.length; i++){
410
+          additional_charges[i].count = 1
411
+          this.curPrescriptions.addition.push(additional_charges[i])
412
+        }
413
+        this.$refs.additionalCharges.hide()
363 414
 
364 415
       },
365 416
       searchAction() {
@@ -393,6 +444,15 @@
393 444
                 total = total + this.prescriptions[i].project[b].price * this.prescriptions[i].project[b].total
394 445
               }
395 446
             }
447
+
448
+            if (this.prescriptions[i].addition != null) {
449
+              for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
450
+                total = total + this.prescriptions[i].addition[b].price * this.prescriptions[i].addition[b].count
451
+              }
452
+            }
453
+
454
+
455
+
396 456
             total =  Math.floor(total * 100) / 100
397 457
           }
398 458
         }
@@ -400,7 +460,6 @@
400 460
 
401 461
       }, getCurTotal() {
402 462
         var total = 0
403
-        console.log(this.editableTabsValue)
404 463
 
405 464
         if(this.curPrescriptions.type == 1) {
406 465
           for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
@@ -428,12 +487,14 @@
428 487
               total = total + this.prescriptions[i].project[b].price * this.prescriptions[i].project[b].total
429 488
             }
430 489
           }
431
-        }
432
-        if(this.addtions_charge != null) {
433
-          for (let i = 0; i < this.addtions_charge.length; i++) {
434
-            total = total + this.addtions_charge[i].price
490
+
491
+          if (this.prescriptions[i].addition != null) {
492
+            for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
493
+              total = total + this.prescriptions[i].addition[b].price * this.prescriptions[i].addition[b].count
494
+            }
435 495
           }
436 496
         }
497
+
437 498
         return Math.floor(total * 100) / 100
438 499
       },
439 500
       createFilter(queryString) {
@@ -492,39 +553,22 @@
492 553
             this.department = response.data.data.department
493 554
             this.sick = response.data.data.sick
494 555
             this.additions = response.data.data.additions
495
-
496 556
             var info = response.data.data.info
497
-
498
-            if (this.$store.getters.xt_user.user.user_type == 2 || this.$store.getters.xt_user.user.user_type == 1) {
499
-              console.log('11111')
500
-              this.doctorValue = this.$store.getters.xt_user.user.id
501
-            } else {
502
-              console.log('222222')
503
-
504
-              this.doctorValue = this.doctors[0].admin_user_id
505
-            }
506
-
507 557
             if (info.user_type == 2 || info.user_type == 1) {
508
-
509
-
510 558
               this.doctorValue = info.admin_user_id
511
-
512
-
513 559
               if (info.department_id == 0) {
514
-
515 560
                 if (this.department.length > 0) {
516 561
                   this.departmentValue = this.department[0].id
517 562
                 } else {
518 563
                   this.departmentValue = ''
564
+
519 565
                 }
520 566
               } else {
521 567
                 this.departmentValue = info.department_id
522 568
               }
523 569
             }else{
524 570
               this.doctorValue = this.doctors[0].admin_user_id
525
-
526 571
             }
527
-
528 572
           }
529 573
         })
530 574
 
@@ -578,15 +622,14 @@
578 622
         this.teamList = []
579 623
 
580 624
       },
581
-      setData(data, info,addition_charge) {
582
-        this.addition_charge = addition_charge
625
+      setData(data, info) {
583 626
         this.prescription_id = data[0].id
584
-
585
-        console.log('99999999', data[0].id)
627
+        this.editableTabsValue = "处方1"
586 628
         this.$emit('event1', this.prescription_id)
587 629
         this.curStatus = 0
588 630
         this.prescriptions = data
589 631
         this.curPrescriptions = this.prescriptions[0]
632
+        console.log( this.curPrescriptions)
590 633
 
591 634
         if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
592 635
           this.curStatus = 1
@@ -608,7 +651,12 @@
608 651
         this.state1 = info.diagnosis
609 652
         this.state2 = info.sick_history
610 653
         this.doctorValue = info.doctor_id
611
-        this.departmentValue = info.departments
654
+        this.departmentValue = info.departmentValue
655
+
656
+        if(this.doctorValue == 0){
657
+
658
+        }
659
+
612 660
         this.register_type = info.register_type
613 661
 
614 662
         if (info.prescription_status == 1 || info.prescription_status == 2) {
@@ -635,8 +683,8 @@
635 683
         }
636 684
       },
637 685
       open(index) {
638
-        if (this.curPrescriptions.order_status >= 2) {
639
-          this.$message.error('当前处方处于结算或者退费状态,无法保存')
686
+        if (this.curPrescriptions.order_status == 2) {
687
+          this.$message.error('当前处方已经结算,无法保存')
640 688
           return
641 689
         }
642 690
         if (this.doctorValue.length <= 0) {
@@ -668,16 +716,26 @@
668 716
             if (this.prescriptions[i].advices.length == 0 && this.prescriptions[i].project.length > 0) {
669 717
               this.prescriptions[i]['type'] = 2
670 718
             }
719
+
720
+
671 721
             for (let b = 0; b < this.prescriptions[i].advices.length; b++) {
672 722
               this.prescriptions[i].advices[b].single_dose = this.prescriptions[i].advices[b].single_dose.toString()
673 723
               this.prescriptions[i].advices[b].prescribing_number = this.prescriptions[i].advices[b].prescribing_number.toString()
674 724
               this.prescriptions[i].advices[b].retail_price = this.prescriptions[i].advices[b].retail_price.toString()
725
+              this.prescriptions[i].advices[b].day = parseInt(this.prescriptions[i].advices[b].day)
675 726
 
676 727
             }
677 728
 
678 729
             for (let b = 0; b < this.prescriptions[i].project.length; b++) {
679 730
               this.prescriptions[i].project[b].price = parseFloat(this.prescriptions[i].project[b].price)
731
+              this.prescriptions[i].project[b].total = this.prescriptions[i].project[b].total.toString()
732
+            }
680 733
 
734
+            for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
735
+              this.prescriptions[i].addition[b].id = parseInt(this.prescriptions[i].addition[b].id)
736
+              this.prescriptions[i].addition[b].item_id = parseInt(this.prescriptions[i].addition[b].item_id)
737
+              this.prescriptions[i].addition[b].price = parseFloat(this.prescriptions[i].addition[b].price)
738
+              this.prescriptions[i].addition[b].count = this.prescriptions[i].addition[b].count.toString()
681 739
             }
682 740
           }
683 741
           let data = {
@@ -707,6 +765,8 @@
707 765
           return
708 766
         }
709 767
 
768
+        this.tabIndex = this.prescriptions.length
769
+
710 770
         ++this.tabIndex
711 771
         let newTabName = '处方' + this.tabIndex
712 772
         this.prescriptions.push({
@@ -714,7 +774,8 @@
714 774
           name: newTabName,
715 775
           order_status: 0,
716 776
           advices: [],
717
-          project: []
777
+          project: [],
778
+          addition:[]
718 779
 
719 780
         })
720 781
         this.editableTabsValue = newTabName
@@ -818,9 +879,9 @@
818 879
             })
819 880
           }
820 881
 
882
+        }).catch(() => {
883
+
821 884
         })
822
-          .catch(() => {
823
-          })
824 885
 
825 886
       },
826 887
       clickTab(tab) {
@@ -922,8 +983,6 @@
922 983
           }
923 984
         }
924 985
 
925
-        console.log(this.curDrugs)
926
-        console.log(this.curPrescriptions.advices)
927 986
 
928 987
         for (let i = 0; i < this.curDrugs.length; i++) {
929 988
           for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
@@ -939,8 +998,6 @@
939 998
           if (this.prescriptions[i].name == this.editableTabsValue) {
940 999
             var temp = this.deepClone(this.curDrugs)
941 1000
             var temp2 = this.deepClone(this.teamList)
942
-
943
-            console.log(temp2)
944 1001
             if (temp.length > 0) {
945 1002
               for (let b = 0; b < temp.length; b++) {
946 1003
                 let obj = {
@@ -952,12 +1009,17 @@
952 1009
                   execution_frequency: temp[b].execution_frequency,
953 1010
                   retail_price: temp[b].retail_price.toString(),
954 1011
                   remark: '',
1012
+                  day:'',
955 1013
                   prescribing_number: temp[b].prescribing_number,
956 1014
                   single_dose_unit: temp[b].min_unit,
957 1015
                   prescribing_number_unit: temp[b].max_unit,
958 1016
                   medical_insurance_number: temp[b].medical_insurance_number
959 1017
 
960 1018
                 }
1019
+
1020
+                if(obj.prescribing_number == 0 || obj.prescribing_number.length  == 0){
1021
+                  obj.prescribing_number = 1
1022
+                }
961 1023
                 this.prescriptions[i].advices.push(obj)
962 1024
               }
963 1025
               this.curStatus = 1
@@ -977,9 +1039,12 @@
977 1039
                   total: temp2[b].total,
978 1040
                   price: temp2[b].price,
979 1041
                   remark: '',
980
-                  medical_code: temp2[b].medical_code
1042
+                  medical_code: temp2[b].medical_code,
1043
+                  unit:temp2[b].unit
1044
+                }
1045
+                if(obj.total == 0 ){
1046
+                  obj.total = 1
981 1047
                 }
982
-                console.log(obj)
983 1048
                 this.prescriptions[i].project.push(obj)
984 1049
               }
985 1050
               this.curStatus = 2
@@ -1077,16 +1142,15 @@
1077 1142
           }
1078 1143
         }
1079 1144
       }
1080
-    },
1081
-    created() {
1145
+    },mounted(){
1082 1146
       this.getInitData()
1083 1147
       //获取所有项目
1084 1148
       this.getlist()
1085 1149
       //获取所以项目组套
1086 1150
       this.getAllProjectTeam()
1087 1151
 
1088
-    }
1089 1152
 
1153
+    },
1090 1154
   }
1091 1155
 </script>
1092 1156
 

+ 0 - 9
src/xt_pages/outpatientDoctorStation/components/inquiriesDetail.vue View File

@@ -53,15 +53,6 @@
53 53
             <span style="width:200px;">血压:{{case_history.sbp}}~{{case_history.dbp}} mmHg</span>
54 54
           </div>
55 55
         </div>
56
-        <div class="commonCell">
57
-          <p></p>
58
-          <div class="detailMain">
59
-            <span style="width:140px;">血糖:{{case_history.blood_sugar}} mmol/L</span>
60
-            <span style="width:140px;">血脂:{{case_history.blood_fat}} mmol/L</span>
61
-            <span style="width:140px;">身高:{{case_history.height}} cm</span>
62
-            <span style="width:200px;">体重: kg</span>
63
-          </div>
64
-        </div>
65 56
         <div class="commonCell">
66 57
           <p>主诉</p>
67 58
           <div>{{case_history.chief_conplaint}}</div>

+ 62 - 16
src/xt_pages/outpatientDoctorStation/components/prescriptionTable.vue View File

@@ -2,6 +2,7 @@
2 2
   <div class="prescriptionTable">
3 3
     <el-table v-if="activeType  == 1" :data="prescription.advices" border style="width: 99%;" :row-style="{ color: '#303133' }"
4 4
               :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
5
+      <el-table-column align="center" type="index" width="40" label="序号"></el-table-column>
5 6
       <el-table-column align="center" prop="drug_name" label="名称">
6 7
         <template slot-scope="scope"><span :title="scope.row.drug_name">{{ scope.row.drug_name }}</span></template>
7 8
       </el-table-column>
@@ -39,6 +40,13 @@
39 40
         </template>
40 41
       </el-table-column>
41 42
 
43
+
44
+      <el-table-column align="center" prop="day" width="50" label="天数">
45
+        <template slot-scope="scope">
46
+          <el-input v-model="scope.row.day" placeholder=""></el-input>
47
+        </template>
48
+      </el-table-column>
49
+
42 50
       <el-table-column align="center" prop="prescribing_number" width="80" label="总量">
43 51
         <template slot-scope="scope">
44 52
           <div style="display:flex;align-items:center;">
@@ -49,7 +57,7 @@
49 57
       </el-table-column>
50 58
       <el-table-column align="center" prop="retail_price" width="60" label="单价">
51 59
         <template slot-scope="scope">
52
-          <el-input v-model="scope.row.retail_price" placeholder=""></el-input>
60
+          <el-input v-model="scope.row.retail_price" placeholder="" readonly></el-input>
53 61
         </template>
54 62
       </el-table-column>
55 63
       <el-table-column align="center" prop="remark" width="50" label="备注">
@@ -66,7 +74,7 @@
66 74
 
67 75
     <el-table v-if="activeType == 2" :data="prescription.project" border style="width: 99%;" :row-style="{ color: '#303133' }"
68 76
               :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
69
-      <!-- <el-table-column align="center" type="index" width="40" label="序号"></el-table-column> -->
77
+       <el-table-column align="center" type="index" width="40" label="序号"></el-table-column>
70 78
       <el-table-column align="center" prop="project_name" label="名称">
71 79
         <template slot-scope="scope"><span :title="scope.row.project_name">{{ scope.row.project_name }}</span></template>
72 80
       </el-table-column>
@@ -97,12 +105,14 @@
97 105
         <template slot-scope="scope">
98 106
           <div style="display:flex;">
99 107
             <el-input v-model="scope.row.total" style="width:50" placeholder=""></el-input>
108
+            <div>{{scope.row.unit}}</div>
109
+
100 110
           </div>
101 111
         </template>
102 112
       </el-table-column>
103 113
       <el-table-column align="center" prop="name" width="50" label="单价">
104 114
         <template slot-scope="scope">
105
-          <el-input v-model="scope.row.price" placeholder=""></el-input>
115
+          <el-input v-model="scope.row.price" placeholder="" readonly></el-input>
106 116
         </template>
107 117
       </el-table-column>
108 118
       <el-table-column align="center" prop="name" width="50" label="备注">
@@ -117,16 +127,16 @@
117 127
       </el-table-column>
118 128
     </el-table>
119 129
 
120
-    <!--<div class="additionalBox">-->
121
-      <!--<div class="additionalOne" v-for="(item,index) in 8" :key="index">-->
122
-        <!--<span>治疗费</span>-->
123
-        <!--<el-input v-model="input" placeholder="" style="width:50px;"></el-input>-->
124
-        <!---->
125
-        <!--<el-input v-model="input" placeholder="" style="width:50px;"></el-input>-->
126
-        <!---->
127
-        <!--<i class="el-icon-delete deleteIcon"></i>-->
128
-      <!--</div>-->
129
-    <!--</div>-->
130
+    <div class="additionalBox">
131
+      <div class="additionalOne" v-for="(item,index) in prescription.addition" :key="index">
132
+        <span>{{item.item_name}}</span>
133
+        <el-input v-model="item.price" placeholder="" style="width:50px;"></el-input>
134
+        共
135
+        <el-input v-model="item.count" placeholder="" style="width:50px;"></el-input>
136
+        次
137
+        <i class="el-icon-delete deleteIcon" @click="delAddition(index,item)"></i>
138
+      </div>
139
+    </div>
130 140
 
131 141
 
132 142
 
@@ -135,12 +145,13 @@
135 145
 
136 146
 <script>
137 147
   import { getDictionaryDataConfig} from "@/utils/data";
138
-  import { getInitData,delHisAdvice,delHisProject } from '@/api/his/his'
148
+  import { getInitData,delHisAdvice,delHisProject,delHisAddition } from '@/api/his/his'
139 149
 
140 150
   export default {
141 151
     props: {
142 152
       preDrugs: Array,
143 153
       activeType: Number,
154
+      addtions_charge:Array,
144 155
       prescription:{
145 156
         type:Object,
146 157
         default: function () {
@@ -179,6 +190,41 @@
179 190
       }
180 191
     },
181 192
    methods:{
193
+     delAddition(index, addition){
194
+       if(this.prescription.order_status == 2){
195
+         this.$message.error('该处方已经结算或者退费,无法删除')
196
+         return
197
+       }
198
+       this.$confirm("附加费删除后不可恢复,是否确认删除", "删除", {
199
+         confirmButtonText: "确 定",
200
+         cancelButtonText: "取 消",
201
+         type: "warning"
202
+       }).then(() => {
203
+         this.$nextTick(function(){
204
+           if(addition.id == 0){
205
+             this.prescription.addition.splice(index, 1)
206
+           }else{
207
+             let params = {
208
+               'id': addition.id,
209
+             }
210
+             delHisAddition(params).then(response => {
211
+               if (response.data.state == 0) {
212
+                 this.$message.error(response.data.msg)
213
+                 return false
214
+               } else {
215
+                 var temp2 = this.deepClone(this.prescription.addition)
216
+                 temp2.splice(index, 1)
217
+                 this.prescription.addition = temp2
218
+                 this.$message.success(response.data.data.msg)
219
+               }
220
+             })
221
+           }
222
+         });
223
+
224
+       })
225
+         .catch(() => {});
226
+
227
+     },
182 228
       getInitData(){
183 229
         getInitData().then(response => {
184 230
           if (response.data.state == 0) {
@@ -191,7 +237,7 @@
191 237
         })
192 238
 
193 239
       },deleteDrug:function(index, row){
194
-       if(this.prescription.order_status >= 2){
240
+       if(this.prescription.order_status == 2){
195 241
          this.$message.error('该处方已经结算或者退费,无法删除')
196 242
          return
197 243
        }
@@ -267,7 +313,7 @@
267 313
          return name
268 314
       },
269 315
       deleteProject(row,i){
270
-        if(this.prescription.order_status = 2){
316
+        if(this.prescription.order_status == 2){
271 317
           this.$message.error('该处方已经结算或者退费,无法删除')
272 318
           return
273 319
         }

+ 153 - 8
src/xt_pages/outpatientDoctorStation/doctorDesk.vue View File

@@ -147,7 +147,8 @@
147 147
           {
148 148
             name: '处方1',
149 149
             advice: [],
150
-            project: []
150
+            project: [],
151
+            addition:[],
151 152
           }
152 153
         ],
153 154
         search_input: '',
@@ -172,7 +173,6 @@
172 173
         templatedetail:{},
173 174
         detalid:0,
174 175
         prescription_id:0,
175
-        addtions_charge:[],
176 176
 
177 177
         patientid:0,
178 178
         prescriptionList:[],
@@ -231,7 +231,7 @@
231 231
 
232 232
             if(this.patientTableData.length > 0) {
233 233
               this.$refs.tab.setCurrentRow(this.patientTableData[0])
234
-              this.choosePatient(this.patientTableData[0])
234
+              this.getPatientInfo(this.patientTableData[0])
235 235
             }
236 236
 
237 237
             this.prescriptionList = response.data.data.list.prescription
@@ -239,8 +239,7 @@
239 239
 
240 240
           }
241 241
         })
242
-      },
243
-      choosePatient(val) {
242
+      },getPatientInfo(val){
244 243
         this.patientid = val.patients.id
245 244
         let params = {
246 245
           'record_date': this.record_date,
@@ -253,14 +252,12 @@
253 252
           } else {
254 253
 
255 254
             this.prescriptions = []
256
-            this.addtions_charge = []
257 255
             this.patientInfo = response.data.data.xt_info
258 256
             this.hisPatientInfo = response.data.data.his_info
259 257
             this.case_history = response.data.data.case_history
260 258
 
261 259
             this.info = response.data.data.info
262 260
 
263
-            this.addtions_charge = response.data.data.addtions_charge
264 261
 
265 262
 
266 263
             this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}')
@@ -300,6 +297,8 @@
300 297
                 var prescription = response.data.data.prescription[i]
301 298
                 let tempAdvice = []
302 299
                 let tempProject = []
300
+                let tempAddition = []
301
+
303 302
 
304 303
                 for (let b = 0; b < prescription.advices.length; b++) {
305 304
                   let obj = {
@@ -310,6 +309,7 @@
310 309
                     execution_frequency: prescription.advices[b].execution_frequency,
311 310
                     retail_price: prescription.advices[b].price.toString(),
312 311
                     remark: prescription.advices[b].remark,
312
+                    day:prescription.advices[b].day,
313 313
                     prescribing_number:prescription.advices[b].prescribing_number.toString(),
314 314
                     single_dose_unit:prescription.advices[b].single_dose_unit,
315 315
                     prescribing_number_unit:prescription.advices[b].prescribing_number_unit,
@@ -341,6 +341,18 @@
341 341
                 }
342 342
 
343 343
 
344
+                for (let b = 0; b < prescription.addition.length; b++) {
345
+                  let obj = {
346
+                    id: prescription.addition[b].id,
347
+                    item_name: prescription.addition[b].item_name,
348
+                    price: prescription.addition[b].price,
349
+                    count: prescription.addition[b].count,
350
+                    item_id: prescription.addition[b].item_id,
351
+                  }
352
+                  tempAddition.push(obj)
353
+                }
354
+
355
+
344 356
 
345 357
                 let index = i + 1
346 358
                 let obj = {
@@ -348,6 +360,7 @@
348 360
                   name: '处方' + index,
349 361
                   advices: tempAdvice,
350 362
                   project: tempProject,
363
+                  addition:tempAddition,
351 364
                   order_status:prescription.order_status
352 365
                 }
353 366
                 this.prescriptions.push(obj)
@@ -358,6 +371,7 @@
358 371
                 name: '处方' + 1,
359 372
                 advices: [],
360 373
                 project: [],
374
+                addition:[],
361 375
                 orderStatus:0,
362 376
               }
363 377
               this.prescriptions.push(obj)
@@ -365,7 +379,138 @@
365 379
 
366 380
 
367 381
 
368
-            this.$refs.prescriptions.setData(this.prescriptions,this.info,this.addition_charge)
382
+            this.$refs.prescriptions.setData(this.prescriptions,this.info)
383
+          }
384
+        })
385
+
386
+
387
+
388
+      },
389
+      choosePatient(val) {
390
+        this.patientid = val.patients.id
391
+        let params = {
392
+          'record_date': this.record_date,
393
+          'patient_id': val.patients.id
394
+        }
395
+        getPatientInfo(params).then(response => {
396
+          if (response.data.state == 0) {
397
+            this.$message.error(response.data.msg)
398
+            return false
399
+          } else {
400
+            this.prescriptions = []
401
+            this.patientInfo = response.data.data.xt_info
402
+            this.hisPatientInfo = response.data.data.his_info
403
+            this.case_history = response.data.data.case_history
404
+            this.info = response.data.data.info
405
+            this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}')
406
+            if (this.case_history.temperature <= 0) {
407
+              this.case_history.temperature = ''
408
+            }
409
+            if (this.case_history.blood_sugar <= 0) {
410
+              this.case_history.blood_sugar = ''
411
+            }
412
+            if (this.case_history.pulse <= 0) {
413
+              this.case_history.pulse = ''
414
+            }
415
+            if (this.case_history.sbp <= 0) {
416
+              this.case_history.sbp = ''
417
+            }
418
+            if (this.case_history.dbp <= 0) {
419
+              this.case_history.dbp = ''
420
+            }
421
+            if (this.case_history.height <= 0) {
422
+              this.case_history.height = ''
423
+            }
424
+            if (this.case_history.blood_fat <= 0) {
425
+              this.case_history.blood_fat = ''
426
+            }
427
+            if (this.case_history.sick_type <= 0) {
428
+              this.case_history.sick_type = ''
429
+            }
430
+            this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}')
431
+            if (this.case_history.is_infect == 1) {
432
+              this.case_history.is_infect = true
433
+            } else {
434
+              this.case_history.is_infect = false
435
+            }
436
+            this.prescriptionList =response.data.data.prescription
437
+            if (response.data.data.prescription.length > 0) {
438
+              for (let i = 0; i < response.data.data.prescription.length; i++) {
439
+                var prescription = response.data.data.prescription[i]
440
+                let tempAdvice = []
441
+                let tempProject = []
442
+                let tempAddition = []
443
+                for (let b = 0; b < prescription.advices.length; b++) {
444
+                  let obj = {
445
+                    advice_id: prescription.advices[b].id,
446
+                    drug_name: prescription.advices[b].advice_name,
447
+                    single_dose: prescription.advices[b].single_dose,
448
+                    delivery_way: prescription.advices[b].delivery_way,
449
+                    execution_frequency: prescription.advices[b].execution_frequency,
450
+                    retail_price: prescription.advices[b].price.toString(),
451
+                    remark: prescription.advices[b].remark,
452
+                    day:prescription.advices[b].day,
453
+                    prescribing_number:prescription.advices[b].prescribing_number.toString(),
454
+                    single_dose_unit:prescription.advices[b].single_dose_unit,
455
+                    prescribing_number_unit:prescription.advices[b].prescribing_number_unit,
456
+                    medical_insurance_number:prescription.advices[b].med_list_codg,
457
+                    id:prescription.advices[b].drug_id
458
+                  }
459
+                  tempAdvice.push(obj)
460
+                }
461
+                for (let b = 0; b < prescription.project.length; b++) {
462
+                  console.log(prescription.project[b])
463
+                  console.log(prescription.project[b].project)
464
+                  let obj = {
465
+                    id: prescription.project[b].id,
466
+                    project_id: prescription.project[b].project_id,
467
+                    project_name: prescription.project[b].project.project_name,
468
+                    statistical_classification: prescription.project[b].project.statistical_classification,
469
+                    single_dose: prescription.project[b].single_dose,
470
+                    delivery_way: prescription.project[b].delivery_way,
471
+                    execution_frequency: prescription.project[b].execution_frequency,
472
+                    number_days: prescription.project[b].day,
473
+                    total:prescription.project[b].count.toString(),
474
+                    price:prescription.project[b].price,
475
+                    remark:prescription.project[b].remark,
476
+                    medical_code:prescription.project[b].project.medical_code,
477
+                    unit:prescription.project[b].unit
478
+                  }
479
+                  tempProject.push(obj)
480
+                }
481
+                for (let b = 0; b < prescription.addition.length; b++) {
482
+                  let obj = {
483
+                    id: prescription.addition[b].id,
484
+                    item_name: prescription.addition[b].item_name,
485
+                    price: prescription.addition[b].price,
486
+                    count: prescription.addition[b].count,
487
+                    item_id: prescription.addition[b].item_id,
488
+                  }
489
+                  tempAddition.push(obj)
490
+                }
491
+                let index = i + 1
492
+                let obj = {
493
+                  id: prescription.id,
494
+                  name: '处方' + index,
495
+                  advices: tempAdvice,
496
+                  project: tempProject,
497
+                  addition:tempAddition,
498
+                  order_status:prescription.order_status
499
+                }
500
+                this.prescriptions.push(obj)
501
+              }
502
+            } else {
503
+              let obj = {
504
+                id:0,
505
+                name: '处方' + 1,
506
+                advices: [],
507
+                project: [],
508
+                addition:[],
509
+                orderStatus:0,
510
+              }
511
+              this.prescriptions.push(obj)
512
+            }
513
+            this.$refs.prescriptions.setData(this.prescriptions,this.info)
369 514
           }
370 515
         })
371 516
       },

+ 65 - 17
src/xt_pages/outpatientDoctorStation/pastInquiries.vue View File

@@ -5,43 +5,42 @@
5 5
     </div>
6 6
     <div class="app-container">
7 7
       <div class="cell clearfix">
8
-        <el-input size="small" style="width:150px;" @keyup.enter.native='searchAction' v-model.trim="search_input"
8
+        <el-input size="small" style="width:150px;" v-model="keywords"
9 9
                   class="filter-item"/>
10 10
         <el-button size="small" style="margin:0 10px;" class="filter-item" type="primary" @click="searchAction">搜索
11 11
         </el-button>
12
-        <el-date-picker v-model="selected_date" prefix-icon="el-icon-date" @change="handleScheduleDateChange"
12
+        <el-date-picker v-model="record_date" prefix-icon="el-icon-date" @change="handleScheduleDateChange"
13 13
                         :editable="false" :clearable="false" style="width: 196px;margin-right:10px;" type="date"
14
+                        format="yyyy-MM-dd"
15
+                        value-format="yyyy-MM-dd"
14 16
                         placeholder="选择日期时间" align="right"></el-date-picker>
15 17
       </div>
16 18
       <el-table :data="tableData" border ref="table" style="width: 100%;" :row-style="{ color: '#303133' }"
17 19
                 :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
18 20
         <el-table-column align="center" label="序号" width="60" type="index"></el-table-column>
19 21
         <el-table-column align="center" prop="name" label="姓名" width="100">
20
-          <template slot-scope="scope">{{ scope.row.patient.name }}</template>
22
+          <template slot-scope="scope">{{ scope.row.patients.name }}</template>
21 23
         </el-table-column>
22 24
         <el-table-column align="center" prop="name" label="处方日期" width="110">
23
-          <template slot-scope="scope"> {{getTimes(scope.row.record_date)}}</template>
25
+          <template slot-scope="scope"> {{getTimes(scope.row.info.ctime)}}</template>
24 26
 
25 27
         </el-table-column>
26 28
         <!--<el-table-column align="center" prop="name" label="患者类型">-->
27 29
           <!--<template slot-scope="scope">{{}}</template>-->
28 30
         <!--</el-table-column>-->
29 31
         <el-table-column align="center" prop="name" label="处方号">
30
-          <template slot-scope="scope">{{scope.row.prescription_number}}</template>
32
+          <template slot-scope="scope">{{scope.row.info.prescription_number}}</template>
31 33
         </el-table-column>
32 34
         <el-table-column align="center" prop="name" label="开立医生">
33
-          <template slot-scope="scope">{{scope.row.doctor}}</template>
35
+          <template slot-scope="scope">{{scope.row.info.doctor}}</template>
34 36
         </el-table-column>
35 37
         <el-table-column align="center" prop="name" label="诊断">
36
-          <template slot-scope="scope">{{ scope.row.diagnosis }}</template>
38
+          <template slot-scope="scope">{{ scope.row.info.diagnosis }}</template>
37 39
         </el-table-column>
38 40
         <el-table-column align="center" prop="name" label="状态">
39 41
           <template slot-scope="scope">
40
-            <div v-if=" scope.row.prescription_status == 1">新建</div>
41
-            <div v-if=" scope.row.prescription_status == 2">待结算</div>
42
-            <div v-if=" scope.row.prescription_status == 3">已结算</div>
43
-            <div v-if=" scope.row.prescription_status == 4">已退费</div>
44
-
42
+            <div v-if=" scope.row.info.id == 0">未就诊</div>
43
+            <div v-if=" scope.row.info.id > 0">已就诊</div>
45 44
           </template>
46 45
         </el-table-column>
47 46
         <el-table-column align="center" prop="name" label="操作" width="100">
@@ -80,6 +79,11 @@
80 79
     },
81 80
     data() {
82 81
       return {
82
+        keywords:"",
83
+        total:0,
84
+        record_date:"",
85
+        page:1,
86
+        limit:10,
83 87
         crumbs: [
84 88
           { path: false, name: '门诊医生站' },
85 89
           { path: false, name: '既往查询' }
@@ -104,28 +108,72 @@
104 108
       }
105 109
     },
106 110
     methods: {
111
+      searchAction(){
112
+        this.page = 1;
113
+        this.limit = 10;
114
+        this.getHisPrescriptionList()
115
+
116
+      },
117
+      handleScheduleDateChange(){
118
+        this.page = 1;
119
+        this.limit = 10;
120
+        this.getHisPrescriptionList()
121
+
122
+      },
123
+      handleCurrentChange(page) {
124
+        this.page = page;
125
+        this.getHisPrescriptionList()
126
+
127
+      },
128
+
129
+      handleSizeChange(limit) {
130
+        this.limit = limit;
131
+        this.getHisPrescriptionList()
132
+
133
+
134
+      },
107 135
       getTimes(time) {
108
-        return uParseTime(time, "{y}-{m}-{d}");
136
+        return uParseTime(time, "{y}-{m}-{d} {h}:{i}:{s}");
109 137
       },
110 138
       handerShowDetail(row) {
111
-        console.log(row)
112
-        this.$refs.inquiriesDetail.show(row.id)
139
+        if(row.info.id == 0){
140
+          this.$message.error("未就诊")
141
+          return
142
+        }
143
+        this.$refs.inquiriesDetail.show(row.info.id)
113 144
       }, getHisPrescriptionList() {
114
-        getHisPrescriptionList().then(response => {
145
+        let params = {
146
+          record_date:this.record_date,
147
+          page: this.page,
148
+          limit: this.limit,
149
+          keywords: this.keywords,
150
+        }
151
+        getHisPrescriptionList(params).then(response => {
115 152
           if (response.data.state == 0) {
116 153
             this.$message.error(response.data.msg)
117 154
             return false
118 155
           } else {
119 156
             this.tableData = response.data.data.order
157
+            this.total = response.data.data.total
120 158
             this.$nextTick(() => {
121 159
               this.$refs.table.doLayout(); //解决表格错位
122 160
             });
123
-
124 161
           }
125 162
         })
126 163
 
127 164
       }
128 165
     }, created() {
166
+      var nowDate = new Date()
167
+      var nowYear = nowDate.getFullYear()
168
+      var nowMonth = nowDate.getMonth() + 1
169
+      var nowDay = nowDate.getDate()
170
+      this.record_date =
171
+        nowYear +
172
+        '-' +
173
+        (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
174
+        '-' +
175
+        (nowDay < 10 ? '0' + nowDay : nowDay)
176
+
129 177
 
130 178
       this.getHisPrescriptionList()
131 179
 

+ 77 - 71
src/xt_pages/stock/drugs/query.vue View File

@@ -3,13 +3,14 @@
3 3
     <div class="position">
4 4
       <bread-crumb :crumbs="crumbs"></bread-crumb>
5 5
       <el-button
6
-          size="small"
7
-          class="filter-item"
8
-          type="primary"
9
-          icon="el-icon-search"
10
-          @click="setting"
11
-        >设置</el-button
12
-        >
6
+        size="small"
7
+        class="filter-item"
8
+        type="primary"
9
+        icon="el-icon-search"
10
+        @click="setting"
11
+      >设置
12
+      </el-button
13
+      >
13 14
     </div>
14 15
     <div class="app-container ">
15 16
       <div class="cell clearfix">
@@ -26,7 +27,8 @@
26 27
           type="primary"
27 28
           icon="el-icon-search"
28 29
           @click="search"
29
-        >搜索</el-button
30
+        >搜索
31
+        </el-button
30 32
         >
31 33
       </div>
32 34
 
@@ -136,9 +138,9 @@
136 138
   import SettingDialog from './settingDialog/index'
137 139
 
138 140
   export default {
139
-    name: "stockIn",
141
+    name: 'stockIn',
140 142
     created() {
141
-      this.GetAllDrugStockQueryList();
143
+      this.GetAllDrugStockQueryList()
142 144
     },
143 145
     components: {
144 146
       SettingDialog,
@@ -147,29 +149,29 @@
147 149
     data() {
148 150
       return {
149 151
         crumbs: [
150
-          { path: false, name: "库存管理" },
151
-          { path: "/stock/drugs/stock/query", name: "药品库存查询" }
152
+          { path: false, name: '库存管理' },
153
+          { path: '/stock/drugs/stock/query', name: '药品库存查询' }
152 154
         ],
153
-        keywords: "",
155
+        keywords: '',
154 156
         total: 0,
155 157
         multipleSelection: [],
156
-        signAndWeighBoxPatients: "sign-and-weigh-box-patients",
157
-        start_time: "",
158
-        end_time: "",
158
+        signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
159
+        start_time: '',
160
+        end_time: '',
159 161
         page: 1,
160 162
         limit: 10,
161 163
         goodType: [],
162 164
         goodInfo: [],
163
-        tempArr:[],
165
+        tempArr: [],
164 166
         sameRowArr: [],
165 167
         WarehouseInfo: {
166 168
           loading: false,
167 169
           warehouseInfoDate: []
168 170
         }
169
-      };
171
+      }
170 172
     },
171 173
     methods: {
172
-      handleSpanTempArr(){
174
+      handleSpanTempArr() {
173 175
         this.tempArr = []
174 176
 
175 177
         for (let i = 0; i < this.WarehouseInfo.warehouseInfoDate.length; i++) {
@@ -204,8 +206,6 @@
204 206
         })
205 207
         this.sameRowArr = sameRowArr
206 208
 
207
-
208
-
209 209
       },
210 210
       merge({ row, column, rowIndex, columnIndex }) {
211 211
         if (columnIndex === 0) {
@@ -218,113 +218,116 @@
218 218
         }
219 219
       },
220 220
       GetAllDrugStockQueryList: function() {
221
-        console.log(this.keywords);
221
+        console.log(this.keywords)
222 222
         const Params = {
223 223
           page: this.page,
224 224
           limit: this.limit,
225 225
           keyword: this.keywords
226
-        };
227
-        this.WarehouseInfo.loading = true;
228
-        this.WarehouseInfo.warehouseInfoDate = [];
226
+        }
227
+        this.WarehouseInfo.loading = true
228
+        this.WarehouseInfo.warehouseInfoDate = []
229 229
         getAllDrugStockQueryList(Params).then(response => {
230 230
           if (response.data.state == 0) {
231
-            this.WarehouseInfo.loading = false;
232
-            this.$message.error(response.data.msg);
233
-            return false;
231
+            this.WarehouseInfo.loading = false
232
+            this.$message.error(response.data.msg)
233
+            return false
234 234
           } else {
235
-            this.WarehouseInfo.loading = false;
236
-            this.total = response.data.data.total;
235
+            this.WarehouseInfo.loading = false
236
+            this.total = response.data.data.total
237 237
             for (let i = 0; i < response.data.data.list.length; i++) {
238 238
 
239 239
               this.WarehouseInfo.warehouseInfoDate.push(
240 240
                 response.data.data.list[i]
241
-              );
241
+              )
242 242
             }
243 243
             this.handleSpanTempArr()
244 244
           }
245
-        });
245
+        })
246 246
       },
247 247
       getSpecificationName: function(id) {
248
-        let name = "";
248
+        let name = ''
249 249
         for (let i = 0; i < this.goodInfo.length; i++) {
250 250
           if (this.goodInfo[i].id == id) {
251
-            name = this.goodInfo[i].specification_name;
251
+            name = this.goodInfo[i].specification_name
252 252
           }
253 253
         }
254
-        return name;
254
+        return name
255 255
       },
256 256
       getTypeName: function(id) {
257
-        let name = "";
257
+        let name = ''
258 258
         for (let i = 0; i < this.goodType.length; i++) {
259 259
           if (this.goodType[i].id == id) {
260
-            name = this.goodType[i].type_name;
260
+            name = this.goodType[i].type_name
261 261
           }
262 262
         }
263
-        return name;
263
+        return name
264 264
       },
265 265
 
266
-
267 266
       handleBack: function() {
268
-        this.$router.go(-1);
267
+        this.$router.go(-1)
269 268
       },
270 269
       handleSizeChange(val) {
271
-        this.limit = val;
272
-        this.GetAllDrugStockQueryList();
270
+        this.limit = val
271
+        this.GetAllDrugStockQueryList()
273 272
       },
274 273
       handleCurrentChange(val) {
275
-        this.page = val;
276
-        this.GetAllDrugStockQueryList();
274
+        this.page = val
275
+        this.GetAllDrugStockQueryList()
277 276
       },
278 277
       calculate: function(val) {
279
-        return Math.round(parseFloat(val) * 100) / 100;
278
+        return Math.round(parseFloat(val) * 100) / 100
280 279
       },
281 280
       startTimeChange: function() {
282
-        this.GetAllDrugStockQueryList();
281
+        this.GetAllDrugStockQueryList()
283 282
       },
284 283
       endTimeChange: function() {
285
-        this.GetAllDrugStockQueryList();
284
+        this.GetAllDrugStockQueryList()
286 285
       },
287 286
       stockInCount: function(row) {
288
-        let total = 0;
289
-          for (let i = 0; i < row.query_drug_warehousing_info.length; i++) {
290
-            total = total + row.query_drug_warehousing_info[i].warehousing_count;
287
+        let total = 0
288
+        for (let i = 0; i < row.query_drug_warehousing_info.length; i++) {
289
+          total = total + row.query_drug_warehousing_info[i].warehousing_count
291 290
         }
292
-        return total;
291
+        return total
293 292
       },
294 293
       salesReturnCount: function(row) {
295
-        let total = 0;
294
+        let total = 0
296 295
 
297
-          for (let i = 0; i < row.query_drug_sales_return_info.length; i++) {
298
-            total = total + row.query_drug_sales_return_info[i].count;
296
+        for (let i = 0; i < row.query_drug_sales_return_info.length; i++) {
297
+          total = total + row.query_drug_sales_return_info[i].count
299 298
         }
300
-        return total;
299
+        return total
301 300
       },
302 301
       stockOutCount: function(row) {
303
-        let total = 0;
302
+        let total = 0
304 303
 
305
-          for (let i = 0; i < row.query_drug_warehouseout_info.length; i++) {
306
-            total = total + row.query_drug_warehouseout_info[i].count;
304
+        for (let i = 0; i < row.query_drug_warehouseout_info.length; i++) {
305
+          total = total + row.query_drug_warehouseout_info[i].count
307 306
         }
308
-        return total;
307
+        return total
309 308
       },
310 309
       cancelStockCount: function(row) {
311
-        let total = 0;
312
-          for (let i = 0; i < row.query_drug_cancel_stock_info.length; i++) {
313
-            total = total + row.query_drug_cancel_stock_info[i].count;
314
-          }
315
-        return total;
310
+        let total = 0
311
+        for (let i = 0; i < row.query_drug_cancel_stock_info.length; i++) {
312
+          total = total + row.query_drug_cancel_stock_info[i].count
313
+        }
314
+        return total
315
+      },
316
+      showStockInDetailDialog: function(val) {
317
+      },
318
+      showSaleReturnDetailDialog: function() {
319
+      },
320
+      showStockOutDetailDialog: function() {
321
+      },
322
+      showCancelStockDetailDialog: function() {
316 323
       },
317
-      showStockInDetailDialog: function(val) {},
318
-      showSaleReturnDetailDialog: function() {},
319
-      showStockOutDetailDialog: function() {},
320
-      showCancelStockDetailDialog: function() {},
321 324
       search: function() {
322
-        this.GetAllDrugStockQueryList();
323
-      },setting:function() {
325
+        this.GetAllDrugStockQueryList()
326
+      }, setting: function() {
324 327
         this.$refs.dialog.show()
325 328
       }
326 329
     }
327
-  };
330
+  }
328 331
 </script>
329 332
 
330 333
 <style rel="stylesheet/css" lang="scss" scoped>
@@ -336,6 +339,7 @@
336 339
     border-bottom: 1px #dcdfe6 solid;
337 340
     margin: 0px 0 20px 0;
338 341
   }
342
+
339 343
   }
340 344
 
341 345
   .title {
@@ -366,12 +370,14 @@
366 370
   .count {
367 371
     color: #bd2c00;
368 372
   }
373
+
369 374
   .el-table td,
370 375
   .el-table th.is-leaf,
371 376
   .el-table--border,
372 377
   .el-table--group {
373 378
     border-color: #d0d3da;
374 379
   }
380
+
375 381
   .el-table--border::after,
376 382
   .el-table--group::after,
377 383
   .el-table::before {