Ver código fonte

Merge branch '20230223_pc_vue_new_branch' of http://git.shengws.com/csx/Vue_New into 20230223_pc_vue_new_branch

28169 9 meses atrás
pai
commit
e0cc0a7496

Diferenças do arquivo suprimidas por serem muito extensas
+ 364 - 352
src/xt_pages/hospitalStation/components/deskPrescription.vue


+ 11 - 11
src/xt_pages/hospitalStation/components/prescriptionTable.vue Ver arquivo

@@ -6,7 +6,7 @@
6 6
       <el-table-column align="center" prop="day" width="70" label="序号">
7 7
         <template slot-scope="scope">
8 8
           <div style="display:flex;align-items:center;">
9
-            <el-input :disabled="prescription.is_medicine_status"  v-model="scope.row.groupno" placeholder=""></el-input>
9
+            <el-input :disabled="scope.row.is_medicine == 1"  v-model="scope.row.groupno" placeholder=""></el-input>
10 10
           </div>
11 11
         </template>
12 12
       </el-table-column>
@@ -28,10 +28,10 @@
28 28
       <el-table-column align="center" prop="single_dose" width="120" label="单次用量">
29 29
         <template slot-scope="scope">
30 30
           <div style="display:flex;align-items:center;">
31
-            <el-input :disabled="prescription.is_medicine_status"  v-model="scope.row.single_dose" @input="getAllChange(scope)"
31
+            <el-input :disabled="scope.row.is_medicine == 1"  v-model="scope.row.single_dose" @input="getAllChange(scope)"
32 32
                       style="width:50%;"></el-input>
33 33
             <!-- <div>{{scope.row.single_dose_unit}}</div> -->
34
-            <el-select :disabled="prescription.is_medicine_status"  v-model="scope.row.single_dose_unit" placeholder="请选择" style="width:50%;"
34
+            <el-select :disabled="scope.row.is_medicine == 1"  v-model="scope.row.single_dose_unit" placeholder="请选择" style="width:50%;"
35 35
                        @change="getAllChange(scope)">
36 36
               <el-option :label="scope.row.drug.min_unit" :value="scope.row.drug.min_unit"></el-option>
37 37
               <el-option :label="scope.row.drug.dose_unit"
@@ -43,7 +43,7 @@
43 43
       </el-table-column>
44 44
       <el-table-column align="center" prop="delivery_way" width="100" label="用法">
45 45
         <template slot-scope="scope">
46
-          <el-select :disabled="prescription.is_medicine_status"  v-model="scope.row.delivery_way" placeholder="请选择">
46
+          <el-select :disabled="scope.row.is_medicine == 1"  v-model="scope.row.delivery_way" placeholder="请选择">
47 47
             <el-option
48 48
                     v-for="(item,index) in drugways"
49 49
                     :key="index"
@@ -55,7 +55,7 @@
55 55
       </el-table-column>
56 56
       <el-table-column align="center" prop="execution_frequency" width="100" label="频率">
57 57
         <template slot-scope="scope">
58
-          <el-select  :disabled="prescription.is_medicine_status"  v-model="scope.row.execution_frequency" placeholder="请选择" @change="getAllChange(scope)">
58
+          <el-select  :disabled="scope.row.is_medicine == 1"  v-model="scope.row.execution_frequency" placeholder="请选择" @change="getAllChange(scope)">
59 59
             <el-option
60 60
                     v-for="item,index in efs"
61 61
                     :key="index"
@@ -70,7 +70,7 @@
70 70
       <el-table-column align="center" prop="day" width="70" label="天数">
71 71
         <template slot-scope="scope">
72 72
           <div style="display:flex;align-items:center;">
73
-            <el-input  :disabled="prescription.is_medicine_status"  v-model="scope.row.day" @input="getAllChange(scope)" placeholder=""></el-input>
73
+            <el-input  :disabled="scope.row.is_medicine == 1"  v-model="scope.row.day" @input="getAllChange(scope)" placeholder=""></el-input>
74 74
             {{'天'}}
75 75
           </div>
76 76
         </template>
@@ -79,10 +79,10 @@
79 79
       <el-table-column align="center" prop="prescribing_number" width="120" label="总量">
80 80
         <template slot-scope="scope">
81 81
           <div style="display:flex;align-items:center;">
82
-            <el-input :disabled="prescription.is_medicine_status"  v-model="scope.row.prescribing_number" @input="changePrescribingNumber(scope)"
82
+            <el-input :disabled="scope.row.is_medicine == 1"  v-model="scope.row.prescribing_number" @input="changePrescribingNumber(scope)"
83 83
                       style="width:50%" placeholder=""></el-input>
84 84
             <!-- <div> {{scope.row.prescribing_number_unit}}</div> -->
85
-            <el-select :disabled="prescription.is_medicine_status"  v-model="scope.row.prescribing_number_unit" placeholder="请选择" style="width:50%;"
85
+            <el-select :disabled="scope.row.is_medicine == 1"  v-model="scope.row.prescribing_number_unit" placeholder="请选择" style="width:50%;"
86 86
                        @change="getPrescribingNumberUnit(scope)">
87 87
               <el-option :label="scope.row.drug.min_unit" :value="scope.row.drug.min_unit"></el-option>
88 88
               <el-option :label="scope.row.drug.max_unit"
@@ -103,7 +103,7 @@
103 103
       </el-table-column>
104 104
       <el-table-column align="center" prop="hosp_appr_flag" width="100" label="医院审批标志">
105 105
         <template slot-scope="scope">
106
-          <el-select :disabled="prescription.is_medicine_status"  v-model="scope.row.hosp_appr_flag" placeholder="请选择">
106
+          <el-select :disabled="scope.row.is_medicine == 1"  v-model="scope.row.hosp_appr_flag" placeholder="请选择">
107 107
             <el-option label="审批通过" value="1"></el-option>
108 108
             <el-option label="无须审批" value="3"></el-option>
109 109
             <el-option label="审批不通过" value="2"></el-option>
@@ -112,7 +112,7 @@
112 112
       </el-table-column>
113 113
       <el-table-column align="center" prop="remark" width="50" label="备注">
114 114
         <template slot-scope="scope">
115
-          <el-input :disabled="prescription.is_medicine_status"  v-model="scope.row.remark" :title="scope.row.remark" placeholder=""></el-input>
115
+          <el-input :disabled="scope.row.is_medicine == 1"  v-model="scope.row.remark" :title="scope.row.remark" placeholder=""></el-input>
116 116
         </template>
117 117
       </el-table-column>
118 118
       <el-table-column align="center" width="40" prop="name" label="操作">
@@ -335,7 +335,7 @@
335 335
         })
336 336
 
337 337
       }, deleteDrug: function(index, row) {
338
-        if (this.prescription.is_medicine_status){
338
+        if (row.is_medicine == 1){
339 339
           this.$message.error('该处方包含已发药的药品,无法删除')
340 340
           return
341 341
         }

+ 18 - 18
src/xt_pages/hospitalStation/doctorDesk.vue Ver arquivo

@@ -1332,7 +1332,7 @@ export default {
1332 1332
                 order_status: prescription.order_status,
1333 1333
                 pre_time: preTime,
1334 1334
                 med_type: parseInt(prescription.med_type),
1335
-                is_medicine_status: is_medicine,
1335
+                is_medicine_status: prescription.is_medicine,
1336 1336
 
1337 1337
               }
1338 1338
               this.prescriptions.push(obj)
@@ -1674,9 +1674,9 @@ export default {
1674 1674
 
1675 1675
                       }
1676 1676
                       tempAdvice.push(obj)
1677
-                      if (prescription.advices[b].is_medicine == 1){
1678
-                        is_medicine = true
1679
-                      }
1677
+                      // if (prescription.advices[b].is_medicine == 1){
1678
+                      //   is_medicine = true
1679
+                      // }
1680 1680
                     }
1681 1681
 
1682 1682
                     //项目
@@ -1756,7 +1756,7 @@ export default {
1756 1756
                       order_status: prescription.order_status,
1757 1757
                       pre_time: preTime,
1758 1758
                       med_type: parseInt(prescription.med_type),
1759
-                      is_medicine_status: is_medicine,
1759
+                      is_medicine: prescription.is_medicine,
1760 1760
 
1761 1761
                     }
1762 1762
                     this.prescriptions.push(obj)
@@ -1911,7 +1911,7 @@ export default {
1911 1911
                       order_status: 0,
1912 1912
                       pre_time: nowTime,
1913 1913
                       med_type: '',
1914
-                      is_medicine_status:false,
1914
+                      is_medicine_status:0,
1915 1915
                     }
1916 1916
 
1917 1917
                     obj.med_type = 14
@@ -2247,7 +2247,7 @@ export default {
2247 2247
                       order_status: prescription.order_status,
2248 2248
                       pre_time: preTime,
2249 2249
                       med_type: parseInt(prescription.med_type),
2250
-                      is_medicine_status: is_medicine,
2250
+                      is_medicine_status: prescription.is_medicine,
2251 2251
 
2252 2252
                     }
2253 2253
                     this.prescriptions.push(obj)
@@ -2359,7 +2359,7 @@ export default {
2359 2359
                         order_status: 1,
2360 2360
                         pre_time: preTime,
2361 2361
                         med_type: '',
2362
-                        is_medicine_status:false,
2362
+                        is_medicine_status:0,
2363 2363
 
2364 2364
                       }
2365 2365
                       if (prescription.med_type == 0 || prescription.med_type == '') {
@@ -2386,7 +2386,7 @@ export default {
2386 2386
                       order_status: 0,
2387 2387
                       pre_time: nowTime,
2388 2388
                       med_type: '',
2389
-                      is_medicine_status:false
2389
+                      is_medicine_status:0
2390 2390
 
2391 2391
                     }
2392 2392
 
@@ -2721,7 +2721,7 @@ export default {
2721 2721
                     order_status: prescription.order_status,
2722 2722
                     pre_time: preTime,
2723 2723
                     med_type: parseInt(prescription.med_type),
2724
-                    is_medicine_status: is_medicine,
2724
+                    is_medicine_status: prescription.is_medicine,
2725 2725
 
2726 2726
                   }
2727 2727
                   this.prescriptions.push(obj)
@@ -2832,7 +2832,7 @@ export default {
2832 2832
                       order_status: 1,
2833 2833
                       pre_time: preTime,
2834 2834
                       med_type: '',
2835
-                      is_medicine_status:false,
2835
+                      is_medicine_status:0,
2836 2836
 
2837 2837
                     }
2838 2838
                     if (prescription.med_type == 0 || prescription.med_type == '') {
@@ -2860,7 +2860,7 @@ export default {
2860 2860
                     order_status: 0,
2861 2861
                     pre_time: nowTime,
2862 2862
                     med_type: '',
2863
-                    is_medicine_status:false,
2863
+                    is_medicine_status:0,
2864 2864
 
2865 2865
                   }
2866 2866
 
@@ -3266,7 +3266,7 @@ export default {
3266 3266
                       order_status: prescription.order_status,
3267 3267
                       pre_time: preTime,
3268 3268
                       med_type: parseInt(prescription.med_type),
3269
-                      is_medicine_status: is_medicine,
3269
+                      is_medicine_status: prescription.is_medicine,
3270 3270
 
3271 3271
                     }
3272 3272
                     this.prescriptions.push(obj)
@@ -3385,7 +3385,7 @@ export default {
3385 3385
                         order_status: 1,
3386 3386
                         pre_time: preTime,
3387 3387
                         med_type: '',
3388
-                        is_medicine_status: false,
3388
+                        is_medicine_status: 0,
3389 3389
 
3390 3390
 
3391 3391
                       }
@@ -3415,7 +3415,7 @@ export default {
3415 3415
                       order_status: 0,
3416 3416
                       pre_time: nowTime,
3417 3417
                       med_type: '',
3418
-                      is_medicine_status: false,
3418
+                      is_medicine_status: 0,
3419 3419
 
3420 3420
 
3421 3421
                     }
@@ -3723,7 +3723,7 @@ export default {
3723 3723
                       order_status: prescription.order_status,
3724 3724
                       pre_time: preTime,
3725 3725
                       med_type: parseInt(prescription.med_type),
3726
-                      is_medicine_status: is_medicine,
3726
+                      is_medicine_status: prescription.is_medicine,
3727 3727
 
3728 3728
                     }
3729 3729
                     this.prescriptions.push(obj)
@@ -3844,7 +3844,7 @@ export default {
3844 3844
                         order_status: 1,
3845 3845
                         pre_time: preTime,
3846 3846
                         med_type: '',
3847
-                        is_medicine_status: false,
3847
+                        is_medicine_status: 0,
3848 3848
 
3849 3849
 
3850 3850
                       }
@@ -3873,7 +3873,7 @@ export default {
3873 3873
                       order_status: 0,
3874 3874
                       pre_time: nowTime,
3875 3875
                       med_type: '',
3876
-                      is_medicine_status: false,
3876
+                      is_medicine_status: 0,
3877 3877
 
3878 3878
 
3879 3879
                     }

+ 6 - 6
src/xt_pages/outpatientCharges/components/prescriptionTable.vue Ver arquivo

@@ -34,6 +34,12 @@
34 34
           }}</span></template
35 35
         >
36 36
       </el-table-column>
37
+      <el-table-column align="center" prop="name" width="80" label="规格/型号">
38
+        <template slot-scope="scope">
39
+          <div>{{ scope.row.spec }}</div>
40
+        </template>
41
+      </el-table-column>
42
+      
37 43
       <el-table-column align="center" prop="name" width="80" label="单次用量">
38 44
         <template slot-scope="scope">
39 45
           <!--<el-input v-model="scope.row.delivery_way" readonly></el-input>-->
@@ -80,12 +86,6 @@
80 86
         </template>
81 87
       </el-table-column>
82 88
 
83
-      <el-table-column align="center" prop="name" width="80" label="规格/型号">
84
-        <template slot-scope="scope">
85
-          <div>{{ scope.row.spec }}</div>
86
-        </template>
87
-      </el-table-column>
88
-
89 89
       <el-table-column align="center" prop="name" width="60" label="金额">
90 90
         <template slot-scope="scope">
91 91
           <div>{{ scope.row.det_item_fee_sumamt }}</div>

+ 9 - 3
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue Ver arquivo

@@ -3366,10 +3366,16 @@ export default {
3366 3366
 
3367 3367
     },
3368 3368
     removeTab(targetName) {
3369
-      if (this.curPrescriptions.order_status == 2 || this.curPrescriptions.order_status == 5 || this.curPrescriptions.is_medicine_status) {
3370
-        this.$message.error('该处方已经结算或者记账或者已发药,无法删除')
3369
+      if (this.curPrescriptions.order_status == 2 || this.curPrescriptions.order_status == 5 ) {
3370
+        this.$message.error('该处方已经结算或者记账,无法删除')
3371 3371
         return
3372 3372
       }
3373
+      for(let i = 0; i < this.curPrescriptions.advices.length; i++){
3374
+        if(this.curPrescriptions.advices[i].is_medicine == 1){
3375
+          this.$message.error('该处方已发药,无法删除')
3376
+          return
3377
+        }
3378
+      }
3373 3379
       this.$confirm('处方删除后不可恢复,是否确认删除', '删除', {
3374 3380
         confirmButtonText: '确 定',
3375 3381
         cancelButtonText: '取 消',
@@ -3940,7 +3946,7 @@ export default {
3940 3946
             var temp2 = this.deepClone(this.teamList)
3941 3947
 
3942 3948
             var temp3 = this.deepClone(templateDrugs)
3943
-            
3949
+
3944 3950
             if (temp3.length > 0) {
3945 3951
               for (let b = 0; b < temp3.length; b++) {
3946 3952
                 let obj = {

+ 18 - 17
src/xt_pages/outpatientDoctorStation/components/prescriptionTable.vue Ver arquivo

@@ -6,7 +6,7 @@
6 6
             <el-table-column align="center" prop="day" width="70" label="序号" fixed>
7 7
                 <template slot-scope="scope">
8 8
                     <div style="display:flex;align-items:center;">
9
-                        <el-input :disabled="prescription.is_medicine_status" v-model="scope.row.groupno" placeholder="" @input="getAllIndex(scope.row)"></el-input>
9
+                        <el-input :disabled="scope.row.is_medicine == 1" v-model="scope.row.groupno" placeholder="" @input="getAllIndex(scope.row)"></el-input>
10 10
                     </div>
11 11
                 </template>
12 12
             </el-table-column>
@@ -26,11 +26,11 @@
26 26
             <el-table-column align="center" prop="single_dose" width="120" label="单次用量">
27 27
                 <template slot-scope="scope">
28 28
                     <div style="display:flex;align-items:center;">
29
-                        <el-input :disabled="prescription.is_medicine_status" v-model="scope.row.single_dose" @input="getAllChangeTwo(scope)"
29
+                        <el-input :disabled="scope.row.is_medicine == 1" v-model="scope.row.single_dose" @input="getAllChangeTwo(scope)"
30 30
                                   style="width:50%;"></el-input>
31 31
                         <!-- <div>{{scope.row.single_dose_unit}}</div> -->
32 32
                         <el-select v-model="scope.row.single_dose_unit" placeholder="请选择" style="width:50%;"
33
-                                   @change="getAllChangeTwo(scope)" :disabled="prescription.is_medicine_status" >
33
+                                   @change="getAllChangeTwo(scope)" :disabled="scope.row.is_medicine == 1" >
34 34
                             <el-option :label="scope.row.drug.min_unit" :value="scope.row.drug.min_unit"></el-option>
35 35
                           <el-option :label="scope.row.drug.min_unit" :value="scope.row.drug.min_unit"></el-option>
36 36
 
@@ -43,7 +43,7 @@
43 43
             </el-table-column>
44 44
             <el-table-column align="center" prop="delivery_way" width="100" label="用法">
45 45
                 <template slot-scope="scope">
46
-                    <el-select :disabled="prescription.is_medicine_status" v-model="scope.row.delivery_way" placeholder="请选择">
46
+                    <el-select :disabled="scope.row.is_medicine == 1" v-model="scope.row.delivery_way" placeholder="请选择">
47 47
                         <el-option
48 48
                                 v-for="(item,index) in drugways"
49 49
                                 :key="index"
@@ -55,7 +55,7 @@
55 55
             </el-table-column>
56 56
             <el-table-column align="center" prop="execution_frequency" width="100" label="频率">
57 57
                 <template slot-scope="scope">
58
-                    <el-select :disabled="prescription.is_medicine_status" v-model="scope.row.execution_frequency" placeholder="请选择" @change="getAllChangeTwo(scope)">
58
+                    <el-select :disabled="scope.row.is_medicine == 1" v-model="scope.row.execution_frequency" placeholder="请选择" @change="getAllChangeTwo(scope)">
59 59
                         <el-option
60 60
                                 v-for="item,index in efs"
61 61
                                 :key="index"
@@ -69,7 +69,7 @@
69 69
             <el-table-column align="center" prop="day" width="70" label="天数">
70 70
                 <template slot-scope="scope">
71 71
                     <div style="display:flex;align-items:center;">
72
-                        <el-input :disabled="prescription.is_medicine_status" v-model="scope.row.day" @input="getAllChangeTwo(scope)" placeholder=""></el-input>
72
+                        <el-input :disabled="scope.row.is_medicine == 1" v-model="scope.row.day" @input="getAllChangeTwo(scope)" placeholder=""></el-input>
73 73
                         {{'天'}}
74 74
                     </div>
75 75
                 </template>
@@ -78,11 +78,11 @@
78 78
             <el-table-column align="center" prop="prescribing_number" width="120" label="总量">
79 79
                 <template slot-scope="scope">
80 80
                     <div style="display:flex;align-items:center;">
81
-                        <el-input :disabled="prescription.is_medicine_status" v-model="scope.row.prescribing_number" @input="changePrescribingNumber(scope)"
81
+                        <el-input :disabled="scope.row.is_medicine == 1" v-model="scope.row.prescribing_number" @input="changePrescribingNumber(scope)"
82 82
                                   style="width:50%" placeholder=""></el-input>
83 83
                         <!-- <div> {{scope.row.prescribing_number_unit}}</div> -->
84
-                        <el-select :disabled="prescription.is_medicine_status" v-model="scope.row.prescribing_number_unit" placeholder="请选择" style="width:50%;"
85
-                                   @change="getPrescribingNumberUnit(scope)">
84
+                        <el-select :disabled="scope.row.is_medicine == 1" v-model="scope.row.prescribing_number_unit" placeholder="请选择" style="width:50%;"
85
+                                   @change="getPrescribingNumberUnit(scope.row)">
86 86
                             <el-option :label="scope.row.drug.min_unit" :value="scope.row.drug.min_unit"></el-option>
87 87
                             <el-option :label="scope.row.drug.max_unit"
88 88
                                        v-if="scope.row.drug.min_unit != scope.row.drug.max_unit"
@@ -102,7 +102,7 @@
102 102
             </el-table-column>
103 103
             <el-table-column align="center" prop="hosp_appr_flag" width="100" label="医院审批标志">
104 104
                 <template slot-scope="scope">
105
-                    <el-select :disabled="prescription.is_medicine_status" v-model="scope.row.hosp_appr_flag" placeholder="请选择">
105
+                    <el-select :disabled="scope.row.is_medicine == 1" v-model="scope.row.hosp_appr_flag" placeholder="请选择">
106 106
                         <el-option label="审批通过" value="1"></el-option>
107 107
                         <el-option label="无须审批" value="3"></el-option>
108 108
                         <el-option label="审批不通过" value="2"></el-option>
@@ -117,7 +117,7 @@
117 117
 
118 118
           <el-table-column align="center" prop="is_self_drug" width="100" label="医嘱性质" v-if="this.$store.getters.xt_user.org_id == 10206 || this.$store.getters.xt_user.org_id == 0">
119 119
             <template slot-scope="scope">
120
-              <el-select :disabled="prescription.is_medicine_status" v-model="scope.row.is_self_drug" placeholder="请选择">
120
+              <el-select :disabled="scope.row.is_medicine == 1" v-model="scope.row.is_self_drug" placeholder="请选择">
121 121
                 <el-option label="非自备药" value="0"></el-option>
122 122
                 <el-option label="自备药" value="1"></el-option>
123 123
               </el-select>
@@ -127,13 +127,13 @@
127 127
 
128 128
           <el-table-column align="center" prop="drug_way_count" width="100" label="给药途径次数" >
129 129
             <template slot-scope="scope">
130
-              <el-input :disabled="prescription.is_medicine_status"  v-model="scope.row.drug_way_count" :title="scope.row.drug_way_count" placeholder=""></el-input>
130
+              <el-input :disabled="scope.row.is_medicine == 1"  v-model="scope.row.drug_way_count" :title="scope.row.drug_way_count" placeholder=""></el-input>
131 131
             </template>
132 132
           </el-table-column>
133 133
 
134 134
             <el-table-column align="center" prop="remark" width="50" label="备注">
135 135
                 <template slot-scope="scope">
136
-                    <el-input :disabled="prescription.is_medicine_status"  v-model="scope.row.remark" :title="scope.row.remark" placeholder=""></el-input>
136
+                    <el-input :disabled="scope.row.is_medicine == 1"  v-model="scope.row.remark" :title="scope.row.remark" placeholder=""></el-input>
137 137
                 </template>
138 138
             </el-table-column>
139 139
             <el-table-column align="center" width="40" prop="name" label="操作" fixed="right">
@@ -372,7 +372,8 @@
372 372
         })
373 373
 
374 374
       }, deleteDrug: function(index, row) {
375
-        if (this.prescription.is_medicine_status){
375
+        console.log(row)
376
+        if (row.is_medicine == 1){
376 377
           this.$message.error('该处方包含已发药的药品,无法删除')
377 378
           return
378 379
         }
@@ -526,7 +527,7 @@
526 527
       },
527 528
       getAllChangeTwo(scope) {
528 529
         console.log("战国阿道夫阿道夫阿道夫",scope)
529
-        if (this.prescription.is_medicine_status){
530
+        if (scope.row.is_medicine == 1){
530 531
           this.$message.error('该处方包含已发药的药品,无法修改')
531 532
           return
532 533
         }
@@ -574,7 +575,7 @@
574 575
       },
575 576
 
576 577
       getPrescribingNumberUnit(scope) {
577
-        if (this.prescription.is_medicine_status){
578
+        if (scope.row.is_medicine == 1){
578 579
           this.$message.error('该处方包含已发药的药品,无法修改')
579 580
           return
580 581
         }
@@ -608,7 +609,7 @@
608 609
         }
609 610
       },
610 611
       changePrescribingNumber(scope) {
611
-        if (this.prescription.is_medicine_status){
612
+        if (scope.row.is_medicine == 1){
612 613
           this.$message.error('该处方包含已发药的药品,无法修改')
613 614
           return
614 615
         }

+ 305 - 0
src/xt_pages/outpatientTool/PrescriptionSmmary.vue Ver arquivo

@@ -0,0 +1,305 @@
1
+<template>
2
+  <div class="main-contain new-main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+    </div>
6
+    <div class="app-container" style="display:flex;flex: 1;padding: 10px 20px 0px 20px;">
7
+
8
+      <div class="mainRight">
9
+        <el-tabs v-model="titleType">
10
+          <el-tab-pane label="明细" name="明细"></el-tab-pane>
11
+          <el-tab-pane label="汇总" name="汇总"></el-tab-pane>
12
+        </el-tabs>
13
+<!--        <detail v-if="titleType == '明细'"></detail>-->
14
+<!--        <gather v-if="titleType == '汇总'"></gather>-->
15
+        <pdetail v-if="titleType == '明细'"></pdetail>
16
+        <pgather  v-if="titleType == '汇总'"></pgather>
17
+      </div>
18
+    </div>
19
+  </div>
20
+</template>
21
+
22
+<script>
23
+import BreadCrumb from '@/xt_pages/components/bread-crumb'
24
+import Pdetail from './components/pdetail.vue'
25
+import Pgather from './components/pgather.vue'
26
+
27
+
28
+const moment = require('moment')
29
+
30
+export default {
31
+  components: {
32
+    Pgather,
33
+    Pdetail,
34
+    Gather,
35
+    Settle,
36
+    Detail,
37
+    SummaryDetail,
38
+    BreadCrumb
39
+
40
+  },
41
+  data() {
42
+    return {
43
+      titleType: '明细'
44
+    }
45
+  },
46
+  methods: {},
47
+  created() {
48
+
49
+  },
50
+
51
+  mounted() {
52
+
53
+  },
54
+  watch: {}
55
+}
56
+</script>
57
+
58
+<style lang="scss" scoped>
59
+.new-main-contain {
60
+  height: 100%;
61
+  display: flex;
62
+  flex-direction: column;
63
+}
64
+
65
+.app-container {
66
+  height: 100%;
67
+}
68
+
69
+.mainCell {
70
+  height: 36px;
71
+  display: flex;
72
+  align-items: center;
73
+}
74
+
75
+.mainLeft {
76
+  width: 200px;
77
+  height: 100%;
78
+  display: flex;
79
+  flex-direction: column;
80
+
81
+.el-radio {
82
+  margin-right: 5px;
83
+}
84
+
85
+}
86
+.mainRight {
87
+  margin-left: 10px;
88
+  flex: 1;
89
+  height: 100%;
90
+  display: flex;
91
+  flex-direction: column;
92
+  overflow-y: auto;
93
+
94
+.cellSpan {
95
+  min-width: 80px;
96
+  display: inline-block;
97
+  margin-right: 10px;
98
+}
99
+
100
+}
101
+.mainCenter {
102
+  display: flex;
103
+  flex: 1;
104
+}
105
+
106
+.centerLeft {
107
+  flex: 1;
108
+  display: flex;
109
+  flex-direction: column;
110
+  position: relative;
111
+
112
+.el-form-item {
113
+  width: 32%;
114
+  margin-right: 1%;
115
+  float: left;
116
+}
117
+
118
+.el-form-item__label {
119
+  text-align: left;
120
+}
121
+
122
+}
123
+.backColor {
124
+  background: #f6f8f9;
125
+  height: 5px;
126
+  margin-bottom: 5px;
127
+}
128
+
129
+.tabsBox {
130
+  position: relative;
131
+  height: 76%;
132
+  overflow-y: auto;
133
+  margin-bottom: 60px;
134
+
135
+.el-tabs__item {
136
+  padding: 0 10px;
137
+}
138
+
139
+}
140
+.preTabs {
141
+  height: 100%;
142
+  display: flex;
143
+  flex-direction: column;
144
+
145
+.el-tabs__content {
146
+  flex: 1;
147
+  overflow-y: auto;
148
+}
149
+
150
+}
151
+
152
+.costBox {
153
+  width: 100%;
154
+  height: 60px;
155
+  background: #fff;
156
+  position: absolute;
157
+  bottom: 0;
158
+  display: flex;
159
+  align-items: center;
160
+}
161
+
162
+.addTab {
163
+  position: absolute;
164
+  right: 0;
165
+  top: 14px;
166
+  z-index: 20;
167
+}
168
+
169
+.centerRight {
170
+  width: 300px;
171
+  margin-left: 10px;
172
+  display: flex;
173
+  flex-direction: column;
174
+  position: relative;
175
+}
176
+
177
+.rightTab {
178
+  height: 40px;
179
+  width: 100%;
180
+  border: 1px solid #d2d2d2;
181
+  box-sizing: border-box;
182
+
183
+p {
184
+  width: 50%;
185
+  height: 40px;
186
+  line-height: 40px;
187
+  text-align: center;
188
+  background: #eee;
189
+  float: left;
190
+}
191
+
192
+> p:last-child {
193
+  border-left: 1px solid #d2d2d2;
194
+  float: right;
195
+}
196
+
197
+.activeP {
198
+  background: #409EFF;
199
+  color: #fff;
200
+}
201
+
202
+}
203
+.comfirmBox {
204
+  width: 100%;
205
+  height: 60px;
206
+  background: #fff;
207
+  position: absolute;
208
+  bottom: 0;
209
+  display: flex;
210
+  align-items: center;
211
+  justify-content: space-between;
212
+}
213
+
214
+.mainHeader {
215
+  width: 100%;
216
+  background: #fff;
217
+  position: fixed;
218
+  z-index: 100;
219
+  height: 36px;
220
+}
221
+
222
+.titleBox {
223
+  position: fixed;
224
+  z-index: 99;
225
+  background: #fff;
226
+}
227
+
228
+.fixedCell {
229
+  position: fixed;
230
+  z-index: 99;
231
+  right: 30px;
232
+  background: #fff;
233
+  width: 300px;
234
+  display: flex;
235
+  justify-content: space-between;
236
+}
237
+</style>
238
+
239
+<style lang="scss">
240
+.centerLeft {
241
+
242
+.el-form-item__label {
243
+  text-align: left;
244
+}
245
+
246
+}
247
+.tabsBox {
248
+
249
+.el-tabs__item {
250
+  padding: 0 10px;
251
+}
252
+
253
+.el-tabs--bottom .el-tabs--left > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--bottom .el-tabs--right > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--bottom.el-tabs--border-card > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--bottom.el-tabs--card > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top .el-tabs--left > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top .el-tabs--right > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top.el-tabs--border-card > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top.el-tabs--card > .el-tabs__header .el-tabs__item:nth-child(2) {
254
+  padding: 0 10px;
255
+}
256
+
257
+.el-tabs--bottom .el-tabs--left > .el-tabs__header .el-tabs__item:last-child, .el-tabs--bottom .el-tabs--right > .el-tabs__header .el-tabs__item:last-child, .el-tabs--bottom.el-tabs--border-card > .el-tabs__header .el-tabs__item:last-child, .el-tabs--bottom.el-tabs--card > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top .el-tabs--left > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top .el-tabs--right > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top.el-tabs--border-card > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top.el-tabs--card > .el-tabs__header .el-tabs__item:last-child {
258
+  padding: 0 10px;
259
+}
260
+
261
+.el-tabs--card > .el-tabs__header .el-tabs__item.is-active.is-closable {
262
+  padding: 0 10px;
263
+}
264
+
265
+}
266
+.centerRight {
267
+
268
+.el-tabs__nav-scroll {
269
+  display: flex;
270
+}
271
+
272
+.el-tabs__nav {
273
+  margin: 0 auto;
274
+}
275
+
276
+.el-table th .cell, .el-table td .cell {
277
+  padding: 0 2px;
278
+}
279
+
280
+}
281
+.preTabs {
282
+
283
+.el-tabs__content {
284
+
285
+}
286
+
287
+}
288
+.rightTabs {
289
+  height: 100%;
290
+
291
+
292
+.el-tabs__content {
293
+
294
+}
295
+
296
+}
297
+.centerDialog {
298
+
299
+.el-dialog__body {
300
+  max-height: calc(100vh - 100px) !important;
301
+  padding: 0 20px;
302
+}
303
+
304
+}
305
+</style>

+ 866 - 0
src/xt_pages/outpatientTool/components/pdetail.vue Ver arquivo

@@ -0,0 +1,866 @@
1
+<template>
2
+  <!-- <div class="main-contain outpatientChargesManagement">
3
+      <div class="position">
4
+          <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+      </div> -->
6
+  <div>
7
+    <div style="display: flex;justify-content: space-between;margin-bottom:10px;">
8
+      <div>
9
+        <!--<el-button size="small" style="margin-left:10px;" class="filter-item" type="primary"-->
10
+        <!--@click="Action">-->
11
+        <!--导出-->
12
+        <!--</el-button>-->
13
+        <el-input size="small" style="width:150px;" v-model="keywords" @input="searchAction"
14
+                  @keyup.enter.native='searchAction'
15
+                  placeholder="请输入患者姓名"
16
+                  class="filter-item"/>
17
+        <el-select size="small" v-model="item_type" placeholder="请选择"
18
+                   style="width:150px;margin-left:10px;" @change="changeItem">
19
+          <el-option
20
+            label="全部"
21
+            value="0">
22
+          </el-option>
23
+          <el-option
24
+            v-for="item,index in items"
25
+            :key="index"
26
+            :label="item.name"
27
+            :value="item.id">
28
+          </el-option>
29
+        </el-select>
30
+
31
+        <el-select size="small" v-model="item_time_type" placeholder="请选择"
32
+                   style="width:150px;margin-left:10px;" @change="changeTimeItem">
33
+          <el-option
34
+            label="处方时间"
35
+            value="0">
36
+          </el-option>
37
+          <el-option
38
+            label="结算时间"
39
+            value="1">
40
+          </el-option>
41
+        </el-select>
42
+
43
+        <el-date-picker
44
+          v-model="chargeDate"
45
+          type="daterange"
46
+          value-format="yyyy-MM-dd"
47
+          range-separator="至"
48
+          start-placeholder="开始日期"
49
+          @change="handleDateChange"
50
+          end-placeholder="结束日期">
51
+        </el-date-picker>
52
+        <!--<el-radio v-model="radio" label="1">明细</el-radio>-->
53
+        <!--<el-radio v-model="radio" label="2">汇总</el-radio>-->
54
+      </div>
55
+      <div>
56
+        <!-- <el-popover
57
+          placement="bottom"
58
+          width="210"
59
+          trigger="click">
60
+          <el-button size="small" ref="button_two" @click="open(1)">打印清单</el-button>
61
+          <el-button size="small" ref="button_six" @click="open(2)">打印汇总</el-button>
62
+          <el-button slot="reference" style="margin:0 10px;" type="primary" size="small">打印</el-button>
63
+
64
+        </el-popover> -->
65
+        <el-button size="small" type="primary" @click="export_detail">报表下载</el-button>
66
+      </div>
67
+    </div>
68
+    <el-table :data="tableData" border :row-style="{ color: '#303133' }" ref="table"
69
+              :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
70
+              :span-method="merge"
71
+              show-summary
72
+              :summary-method="getTotal"
73
+              max-height="600"
74
+
75
+              v-loading="detail_loading"
76
+              highlight-current-row>
77
+
78
+      <el-table-column align="center" prop="name" label="患者名字">
79
+        <template slot-scope="scope">{{ scope.row.name }}</template>
80
+      </el-table-column>
81
+      <el-table-column align="center" prop="name" label="处方日期">
82
+        <template slot-scope="scope">{{ scope.row.name }}</template>
83
+      </el-table-column>
84
+      <!--<el-table-column align="center" prop="name" label="患者类型">-->
85
+      <!--<template slot-scope="scope"></template>-->
86
+      <!--</el-table-column>-->
87
+      <el-table-column align="center" prop="name" label="费用类型">
88
+        <template slot-scope="scope">{{ scope.row.name }}</template>
89
+      </el-table-column>
90
+
91
+      <el-table-column align="center" prop="name" label="处方类型">
92
+        <template slot-scope="scope">{{ scope.row.name }}</template>
93
+      </el-table-column>
94
+
95
+
96
+      <el-table-column align="center" prop="name" label="项目名称">
97
+        <template slot-scope="scope">{{scope.row.item_name}}</template>
98
+      </el-table-column>
99
+
100
+      <el-table-column align="center" prop="name" label="规格型号">
101
+        <template slot-scope="scope">{{scope.row.item_spec}}</template>
102
+      </el-table-column>
103
+
104
+      <el-table-column align="center" prop="name" label="数量">
105
+        <template slot-scope="scope">{{scope.row.count}}</template>
106
+      </el-table-column>
107
+
108
+      <el-table-column align="center" prop="name" label="单位">
109
+        <template slot-scope="scope">{{scope.row.count}}</template>
110
+      </el-table-column>
111
+
112
+      <el-table-column align="center" prop="name" label="单价">
113
+        <template slot-scope="scope">{{scope.row.price.toFixed(2)}}</template>
114
+      </el-table-column>
115
+
116
+      <el-table-column align="center" prop="name" label="金额">
117
+        <template slot-scope="scope">
118
+          <div>{{((scope.row.price*scope.row.count).toFixed(2))}}</div>
119
+        </template>
120
+      </el-table-column>
121
+
122
+      <el-table-column align="center" prop="name" label="是否结算">
123
+        <template slot-scope="scope">{{scope.row.price.toFixed(2)}}</template>
124
+      </el-table-column>
125
+
126
+
127
+      <el-table-column align="center" prop="name" label="结算日期">
128
+        <template slot-scope="scope">{{scope.row.price.toFixed(2)}}</template>
129
+      </el-table-column>
130
+
131
+    </el-table>
132
+  </div>
133
+
134
+  <!-- </div> -->
135
+</template>
136
+
137
+
138
+<script>
139
+import BreadCrumb from '@/xt_pages/components/bread-crumb'
140
+import { GetSummaryDetail } from '@/api/his/his'
141
+import { uParseTime } from '@/utils/tools'
142
+import axios from 'axios'
143
+import pako from 'pako';
144
+// import NewStatementPrint from './newStatementPrint'
145
+const moment = require('moment')
146
+export default {
147
+  components: {
148
+    BreadCrumb
149
+
150
+  },
151
+  data() {
152
+    return {
153
+      pickerOptions: {
154
+        disabledDate(time) {
155
+          // 获取当前日期
156
+          const now = new Date();
157
+
158
+          // 设置一个月后的日期
159
+          const oneMonthLater = new Date();
160
+          oneMonthLater.setMonth(oneMonthLater.getMonth() + 1);
161
+
162
+          // 如果当前日期在一个月后之后,则禁用
163
+          return time.getTime() > oneMonthLater.getTime() || time.getTime() < now.getTime();
164
+        },
165
+      },
166
+      detail_loading: false,
167
+      tempArr: [],
168
+      pos: 0,
169
+
170
+      sameRowArr: [],
171
+      keywords: '',
172
+      tableData: [],
173
+      chargeDate: [moment(new Date()).add('year', 0).format('YYYY-MM-DD'), moment(new Date()).add('year', 0).format('YYYY-MM-DD')],
174
+      item_type: '0',
175
+      item_time_type:'0',
176
+      items: [
177
+        { id: 1, name: '未结算' },
178
+        { id: 2, name: '已结算' },
179
+      ]
180
+
181
+    }
182
+  },
183
+  methods: {
184
+    handleDateChangetwo(value) {
185
+      this.$confirm('提示', '接口优化升级,如有数据需要,请联系客服!', {
186
+        confirmButtonText: '确 定',
187
+        cancelButtonText: '取 消',
188
+        type: 'warning'
189
+      }).then(() => {
190
+
191
+
192
+      }).catch(() => {
193
+      })
194
+
195
+      // let start_time = this.chargeDate[0]
196
+      // let end_time = this.chargeDate[1]
197
+      // const dateObj1 = new Date(start_time);
198
+      // const dateObj2 = new Date(end_time);
199
+      //
200
+      // // 计算两个日期之间的月份差
201
+      // const monthDifference = (dateObj2.getFullYear() - dateObj1.getFullYear()) * 12 +
202
+      //   (dateObj2.getMonth() - dateObj1.getMonth());
203
+      // if (monthDifference >= 1){
204
+      //   this.$message.error("时间间隔不能超出一个月")
205
+      //   return
206
+      // }else{
207
+      //   this.getSummaryDetailList()
208
+      // }
209
+
210
+    },
211
+
212
+    handleDateChange(value) {
213
+      // let start_time = this.chargeDate[0]
214
+      // let end_time = this.chargeDate[1]
215
+      // const dateObj1 = new Date(start_time);
216
+      // const dateObj2 = new Date(end_time);
217
+      //
218
+      // // 计算两个日期之间的月份差
219
+      // const monthDifference = (dateObj2.getFullYear() - dateObj1.getFullYear()) * 12 +
220
+      //   (dateObj2.getMonth() - dateObj1.getMonth());
221
+      // if (monthDifference >= 1){
222
+      //   this.$message.error("时间间隔不能超出一个月")
223
+      //   return
224
+      // }else{
225
+      //   this.getSummaryDetailListtwo()
226
+      // }
227
+      this.getSummaryDetailList()
228
+
229
+
230
+    },
231
+    Action(){
232
+      var that = this
233
+      axios.get('http://127.0.0.1:9531/handelExcel', {
234
+        params: {}
235
+      })
236
+        .then(function(response) {
237
+          if (response.data.state == 0) {
238
+            that.$message.error(response.data.msg)
239
+
240
+
241
+            return false
242
+          } else {
243
+
244
+            var list = []
245
+            for(let i = 0; i < response.data.data.list.length; i++){
246
+              let team =  response.data.data.list[i]
247
+              for(let b = 0; b < team.list.length; b++){
248
+                let name = ""
249
+                if(team.list[b].type == 2){
250
+                  name = team.list[b].project.project_name
251
+                }else{
252
+
253
+                  name = team.list[b].good_info.good_name
254
+
255
+                }
256
+
257
+                let obj = {
258
+                  '客户组合编码': team.id,
259
+                  '客户组合名称': team.project_team,
260
+                  '客户单项编码': team.list[b].id,
261
+                  '客户单项名称': name,
262
+                  '中心组合编码': '',
263
+                  '中心组合名称': '',
264
+                  '中心单项编码': '',
265
+                  '中心单项名称': '',
266
+                }
267
+
268
+                list.push(obj)
269
+              }
270
+            }
271
+
272
+            import('@/vendor/Export2Excel').then(excel => {
273
+              const tHeader = [ '客户组合编码', '客户组合名称', '客户单项编码', '客户单项名称', '中心组合编码', '中心组合名称', '中心单项编码', '中心单项名称']
274
+              const filterVal = [ '客户组合编码', '客户组合名称', '客户单项编码', '客户单项名称', '中心组合编码', '中心组合名称', '中心单项编码', '中心单项名称']
275
+              const data = that.formatJson(filterVal, list)
276
+              excel.export_json_to_excel({
277
+                header: tHeader,
278
+                data,
279
+                filename: "消费明细"
280
+              })
281
+            })
282
+
283
+
284
+          }
285
+        })
286
+        .catch(function(error) {
287
+
288
+        })
289
+
290
+
291
+
292
+
293
+    },formatJson(filterVal, jsonData) {
294
+      return jsonData.map(v => filterVal.map(j => v[j]))
295
+    },
296
+    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
297
+      if (columnIndex === 0) {
298
+        if (rowIndex % 2 === 0) {
299
+          return {
300
+            rowspan: 2,
301
+            colspan: 1
302
+          }
303
+        } else {
304
+          return {
305
+            rowspan: 0,
306
+            colspan: 0
307
+          }
308
+        }
309
+      }
310
+    },
311
+    unique(arr) {
312
+      const res = new Map()
313
+      return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1))
314
+    },
315
+    uniquepid(arr) {
316
+      const res = new Map()
317
+      return arr.filter((arr) => !res.has(arr.p_id) && res.set(arr.p_id, 1))
318
+    },
319
+    changeDate() {
320
+      this.getSummaryDetailList()
321
+    },
322
+    changeItem() {
323
+      this.getSummaryDetailList()
324
+    },changeTimeItem(){
325
+
326
+      this.getSummaryDetailList()
327
+
328
+    },
329
+    searchAction() {
330
+      this.item_type = '0'
331
+      this.getSummaryDetailList()
332
+
333
+    },  getSummaryDetailListtwo() {
334
+      this.detail_loading = true
335
+      let start_time = this.chargeDate[0]
336
+      let end_time = this.chargeDate[1]
337
+      let params = {
338
+        start_time: start_time,
339
+        end_time: end_time,
340
+        type: this.item_type,
341
+        keyword: this.keywords
342
+      }
343
+      GetSummaryDetail(params).then(response => {
344
+        if (response.data.state == 0) {
345
+          this.detail_loading = false
346
+
347
+          this.$message.error(response.data.msg)
348
+          return false
349
+        } else {
350
+          this.detail_loading = false
351
+
352
+          this.$confirm('提示', '接口优化升级,如有数据需要,请联系客服!', {
353
+            confirmButtonText: '确 定',
354
+            cancelButtonText: '取 消',
355
+            type: 'warning'
356
+          }).then(() => {
357
+
358
+
359
+          }).catch(() => {
360
+          })
361
+
362
+
363
+        }
364
+
365
+
366
+
367
+
368
+        //
369
+        // console.log('去重前')
370
+        // console.log(advice)
371
+        // console.log(project)
372
+        // //
373
+        // //
374
+
375
+        // //
376
+        // console.log('去重后')
377
+        //
378
+        // console.log(advice.length)
379
+        // console.log(project.length)
380
+        //
381
+        // for (let i = 0; i < project.length; i++) {
382
+        //   let obj = {}
383
+        //   let count = 0
384
+        //   for (let a = 0; a < tempPatientsTwo.length; a++) {
385
+        //     if (project[i].patient_id == tempPatientsTwo[a].patient_id && project[i].item_id == tempPatientsTwo[a].item_id && project[i].price == tempPatientsTwo[a].price) {
386
+        //       count = count + tempPatientsTwo[a].count
387
+        //       obj['count'] = count
388
+        //
389
+        //     }
390
+        //     obj['price'] = project[i].price
391
+        //     obj['type'] = project[i].type
392
+        //     obj['item_name'] = project[i].item_name
393
+        //     obj['item_id'] = project[i].item_id
394
+        //     obj['name'] = project[i].name
395
+        //     obj['patient_id'] = project[i].patient_id
396
+        //     obj['count'] = count
397
+        //     this.tableData.push(obj)
398
+        //   }
399
+        // }
400
+        //
401
+        //
402
+        // for (let i = 0; i < advice.length; i++) {
403
+        //   let obj = {}
404
+        //   let count = 0
405
+        //   for (let a = 0; a < tempPatientsTwo.length; a++) {
406
+        //     if (advice[i].patient_id == tempPatientsTwo[a].patient_id && advice[i].item_id == tempPatientsTwo[a].item_id && advice[i].price == tempPatientsTwo[a].price) {
407
+        //       count = count + tempPatientsTwo[a].count
408
+        //       obj['count'] = count
409
+        //
410
+        //     }
411
+        //     obj['price'] = advice[i].price
412
+        //     obj['type'] = advice[i].type
413
+        //     obj['item_name'] = advice[i].item_name
414
+        //     obj['item_id'] = advice[i].item_id
415
+        //     obj['name'] = advice[i].name
416
+        //     obj['patient_id'] = advice[i].patient_id
417
+        //     this.tableData.push(obj)
418
+        //   }
419
+        // }
420
+        // console.log(this.tableData.length)
421
+        // this.tableData = this.sort(this.tableData)
422
+
423
+      })
424
+    },
425
+    getSummaryDetailList() {
426
+      this.detail_loading = true
427
+      let start_time = this.chargeDate[0]
428
+      let end_time = this.chargeDate[1]
429
+      let params = {
430
+        start_time: start_time,
431
+        end_time: end_time,
432
+        type: this.item_type,
433
+        keyword: this.keywords,
434
+        time_type:this.item_time_type
435
+      }
436
+      GetSummaryDetail(params).then(response => {
437
+        if (response.data.state == 0) {
438
+          this.detail_loading = false
439
+
440
+          this.$message.error(response.data.msg)
441
+          return false
442
+        } else {
443
+
444
+
445
+          this.detail_loading = false
446
+
447
+          this.tableData = []
448
+          let tempPatients = []
449
+          let tempPatientsTwo = []
450
+          //
451
+          let tempData = response.data
452
+          let allData =  response.data
453
+          tempData = this.uniquepid(tempData)
454
+          //
455
+          let order_infos = []
456
+          //
457
+          for (let i = 0; i < tempData.length; i++) {
458
+            let obj = {
459
+              patient_id: tempData[i].p_id,
460
+              name: tempData[i].p_name,
461
+              orders: []
462
+            }
463
+            for (let b = 0; b < allData.length; b++) {
464
+              if (tempData[i].p_id == allData[b].p_id) {
465
+                obj.orders = obj.orders.concat(allData[b])
466
+              }
467
+            }
468
+            tempPatients.push(obj)
469
+          }
470
+          console.log(tempPatients)
471
+          //
472
+          for (let i = 0; i < tempPatients.length; i++) {
473
+            let obj = {
474
+              patient_id: tempPatients[i].patient_id,
475
+              name: tempPatients[i].name,
476
+              order_info: []
477
+            }
478
+            let orders = tempPatients[i].orders
479
+
480
+            for (let c = 0; c < orders.length; c++) {
481
+              let newObj = {}
482
+              newObj['count'] = orders[c].cnt
483
+              newObj['price'] = orders[c].pric
484
+              newObj['item_total'] = orders[c].det_item_fee_sumamt
485
+
486
+              if (orders[c].advice_id > 0 && orders[c].project_id == 0) {
487
+                newObj['type'] = 1
488
+                newObj['item_name'] = orders[c].item_name
489
+                newObj['item_id'] = orders[c].item_id
490
+
491
+                if (orders[c].min_unit != orders[c].dose_unit) {
492
+                  newObj['item_spec'] =  orders[c].dose + orders[c].dose_unit + '*' + orders[c].min_number + orders[c].min_unit + '/' + orders[c].max_unit
493
+                } else {
494
+
495
+                  newObj['item_spec'] = ''
496
+                }
497
+
498
+              }
499
+              if (orders[c].advice_id == 0 && orders[c].project_id > 0) {
500
+                newObj['type'] = 2
501
+                newObj['item_id'] = orders[c].item_id
502
+
503
+                if (orders[c].p_type == 2) {
504
+                  newObj['item_spec'] =""
505
+                  newObj['item_name'] = orders[c].item_name
506
+
507
+
508
+                } else if (orders[c].p_type == 3) {
509
+                  newObj['item_spec'] =  orders[c].specification_name
510
+                  newObj['item_name'] = orders[c].item_name
511
+
512
+
513
+                }
514
+              }
515
+              obj.order_info.push(newObj)
516
+              order_infos.push(orders.order_info)
517
+            }
518
+            tempPatientsTwo.push(obj)
519
+          }
520
+          console.log(tempPatientsTwo)
521
+
522
+          //
523
+          for (let d = 0; d < tempPatientsTwo.length; d++) {
524
+            tempPatientsTwo[d]['new_order_info'] = []
525
+            let project = []
526
+            let advice = []
527
+            for (let b = 0; b < tempPatientsTwo[d].order_info.length; b++) {
528
+              if (tempPatientsTwo[d].order_info[b].type == 1) {
529
+                advice.push(tempPatientsTwo[d].order_info[b])
530
+              } else {
531
+                project.push(tempPatientsTwo[d].order_info[b])
532
+              }
533
+            }
534
+            project = this.uniqueProjectAndAdvice(project)
535
+            advice = this.uniqueProjectAndAdvice(advice)
536
+
537
+            for (let i = 0; i < project.length; i++) {
538
+              let obj = {}
539
+              let count = 0
540
+              for (let a = 0; a < tempPatientsTwo[d].order_info.length; a++) {
541
+                if (project[i].item_id == tempPatientsTwo[d].order_info[a].item_id && project[i].price == tempPatientsTwo[d].order_info[a].price) {
542
+                  count = count + tempPatientsTwo[d].order_info[a].count
543
+                }
544
+              }
545
+
546
+
547
+
548
+              obj['price'] = project[i].price
549
+              obj['type'] = project[i].type
550
+              obj['item_name'] = project[i].item_name
551
+              obj['item_spec'] = project[i].item_spec
552
+              obj['item_total'] = project[i].item_total
553
+
554
+              obj['item_id'] = project[i].item_id
555
+              obj['name'] = tempPatientsTwo[d].name
556
+              obj['patient_id'] = tempPatientsTwo[d].patient_id
557
+              obj['count'] = count
558
+              tempPatientsTwo[d].new_order_info.push(obj)
559
+            }
560
+
561
+            for (let i = 0; i < advice.length; i++) {
562
+              let obj = {}
563
+              let count = 0
564
+              for (let a = 0; a < tempPatientsTwo[d].order_info.length; a++) {
565
+                if (advice[i].item_id == tempPatientsTwo[d].order_info[a].item_id && advice[i].price == tempPatientsTwo[d].order_info[a].price) {
566
+                  count = count + tempPatientsTwo[d].order_info[a].count
567
+                }
568
+              }
569
+
570
+              obj['price'] = advice[i].price
571
+              obj['type'] = advice[i].type
572
+              obj['item_name'] = advice[i].item_name
573
+              obj['item_spec'] = advice[i].item_spec
574
+              obj['item_id'] = advice[i].item_id
575
+              obj['name'] = tempPatientsTwo[d].name
576
+              obj['item_total'] = advice[i].item_total
577
+              obj['patient_id'] = tempPatientsTwo[d].patient_id
578
+              obj['count'] = count
579
+              tempPatientsTwo[d].new_order_info.push(obj)
580
+            }
581
+
582
+          }
583
+          for (let i = 0; i < tempPatientsTwo.length; i++) {
584
+            let total = 0
585
+            for (let b = 0; b < tempPatientsTwo[i].new_order_info.length; b++) {
586
+              let new_name = tempPatientsTwo[i].new_order_info[b].item_name
587
+              if (new_name != undefined){
588
+                if (new_name.length != 0) {
589
+                  console.log(parseFloat(tempPatientsTwo[i].new_order_info[b].count) * parseFloat(tempPatientsTwo[i].new_order_info[b].price))
590
+                  total = parseFloat(total) + parseFloat((parseFloat(tempPatientsTwo[i].new_order_info[b].count) * parseFloat(tempPatientsTwo[i].new_order_info[b].price)).toFixed(2))
591
+                }
592
+
593
+
594
+
595
+              }
596
+
597
+
598
+            }
599
+            tempPatientsTwo[i]['total'] = total
600
+          }
601
+          for (let i = 0; i < tempPatientsTwo.length; i++) {
602
+            // console.log(111,tempPatientsTwo[i].total)
603
+            if (tempPatientsTwo[i].new_order_info.length > 0) {
604
+
605
+              for (let b = 0; b < tempPatientsTwo[i].new_order_info.length; b++) {
606
+                // let new_name = tempPatientsTwo[i].new_order_info[b].item_name
607
+                // console.log('2 ' + new_name)
608
+                //
609
+                // new_name = new_name.replace('( ', '')
610
+                // new_name = new_name.replace(' )', '')
611
+
612
+                let obj = {
613
+                  name: tempPatientsTwo[i].name,
614
+                  patient_id: tempPatientsTwo[i].patient_id,
615
+                  price: tempPatientsTwo[i].new_order_info[b].price,
616
+                  type: tempPatientsTwo[i].new_order_info[b].type,
617
+                  item_name: tempPatientsTwo[i].new_order_info[b].item_name,
618
+                  item_id: tempPatientsTwo[i].new_order_info[b].item_id,
619
+                  count: tempPatientsTwo[i].new_order_info[b].count,
620
+                  item_spec: tempPatientsTwo[i].new_order_info[b].item_spec
621
+                }
622
+
623
+
624
+                // if(b == 0){
625
+                obj['total'] = tempPatientsTwo[i].total
626
+                // }else{
627
+                //   obj['total'] = 0
628
+                // }
629
+                this.tableData.push(obj)
630
+
631
+
632
+
633
+
634
+              }
635
+            }
636
+          }
637
+          console.log( this.tableData)
638
+          this.handleSpanTempArr()
639
+          // this.tableData = tempPatientsTwo
640
+
641
+          // console.log(tempPatientsTwo.length)
642
+          //
643
+          let advices = []
644
+          let projects = []
645
+          let goods = []
646
+          for(let i = 0; i < order_infos.length; i++){
647
+            if(order_infos[i].advice_id > 0 && order_infos[i].project_id == 0){
648
+              advices.push(order_infos[i].advice)
649
+            }
650
+            if(order_infos[i].advice_id == 0 && order_infos[i].project_id > 0){
651
+              if(order_infos[i].project.type == 3){
652
+                goods.push(order_infos[i].project)
653
+              }
654
+            }
655
+            if(order_infos[i].advice_id == 0 && order_infos[i].project_id > 0){
656
+              if(order_infos[i].project.type == 2){
657
+                projects.push(order_infos[i].project)
658
+              }
659
+            }
660
+          }
661
+
662
+        }
663
+
664
+
665
+
666
+
667
+        //
668
+        // console.log('去重前')
669
+        // console.log(advice)
670
+        // console.log(project)
671
+        // //
672
+        // //
673
+
674
+        // //
675
+        // console.log('去重后')
676
+        //
677
+        // console.log(advice.length)
678
+        // console.log(project.length)
679
+        //
680
+        // for (let i = 0; i < project.length; i++) {
681
+        //   let obj = {}
682
+        //   let count = 0
683
+        //   for (let a = 0; a < tempPatientsTwo.length; a++) {
684
+        //     if (project[i].patient_id == tempPatientsTwo[a].patient_id && project[i].item_id == tempPatientsTwo[a].item_id && project[i].price == tempPatientsTwo[a].price) {
685
+        //       count = count + tempPatientsTwo[a].count
686
+        //       obj['count'] = count
687
+        //
688
+        //     }
689
+        //     obj['price'] = project[i].price
690
+        //     obj['type'] = project[i].type
691
+        //     obj['item_name'] = project[i].item_name
692
+        //     obj['item_id'] = project[i].item_id
693
+        //     obj['name'] = project[i].name
694
+        //     obj['patient_id'] = project[i].patient_id
695
+        //     obj['count'] = count
696
+        //     this.tableData.push(obj)
697
+        //   }
698
+        // }
699
+        //
700
+        //
701
+        // for (let i = 0; i < advice.length; i++) {
702
+        //   let obj = {}
703
+        //   let count = 0
704
+        //   for (let a = 0; a < tempPatientsTwo.length; a++) {
705
+        //     if (advice[i].patient_id == tempPatientsTwo[a].patient_id && advice[i].item_id == tempPatientsTwo[a].item_id && advice[i].price == tempPatientsTwo[a].price) {
706
+        //       count = count + tempPatientsTwo[a].count
707
+        //       obj['count'] = count
708
+        //
709
+        //     }
710
+        //     obj['price'] = advice[i].price
711
+        //     obj['type'] = advice[i].type
712
+        //     obj['item_name'] = advice[i].item_name
713
+        //     obj['item_id'] = advice[i].item_id
714
+        //     obj['name'] = advice[i].name
715
+        //     obj['patient_id'] = advice[i].patient_id
716
+        //     this.tableData.push(obj)
717
+        //   }
718
+        // }
719
+        // console.log(this.tableData.length)
720
+        // this.tableData = this.sort(this.tableData)
721
+
722
+      })
723
+    }, uniqueProjectAndAdvice(array) {
724
+      // res用来存储结果
725
+      var res = []
726
+      for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
727
+        for (var j = 0, resLen = res.length; j < resLen; j++) {
728
+          if (array[i].item_id === res[j].item_id && array[i].price === res[j].price) {
729
+            break
730
+          }
731
+        }
732
+        // 如果array[i]是唯一的,那么执行完循环,j等于resLen
733
+        if (j === resLen) {
734
+          res.push(array[i])
735
+        }
736
+      }
737
+      return res
738
+    }, sort(arr) {
739
+      for (var i = 0; i < arr.length - 1; i++) {
740
+        for (var j = 0; j < arr.length - i - 1; j++) {
741
+          if (arr[j].patient_id > arr[j + 1].patient_id) {// 相邻元素两两对比
742
+            var hand = arr[j]
743
+            arr[j] = arr[j + 1]
744
+            arr[j + 1] = hand
745
+
746
+          }
747
+        }
748
+      }
749
+      return arr
750
+    }, handleSpanTempArr() {
751
+      this.tempArr = []
752
+
753
+      for (let i = 0; i < this.tableData.length; i++) {
754
+        if (i === 0) {
755
+          this.tempArr.push(1)
756
+          this.pos = 0
757
+        } else {
758
+          // 判断当前元素与上一个元素是否相同
759
+          if (this.tableData[i].patient_id === this.tableData[i - 1].patient_id) {
760
+            this.tempArr[this.pos] += 1
761
+            this.tempArr.push(0)
762
+          } else {
763
+            this.tempArr.push(1)
764
+            this.pos = i
765
+          }
766
+        }
767
+      }
768
+
769
+      let sameRowArr = [], sIdx = 0
770
+      this.tableData.forEach((item, index) => {
771
+        item.index = index
772
+        if (index === 0) {
773
+          sameRowArr.push([index])
774
+        } else {
775
+          if (item.patient_id === this.tableData[index - 1].patient_id) {
776
+            sameRowArr[sIdx].push(index)
777
+          } else {
778
+            sIdx = sIdx + 1
779
+            sameRowArr.push([index])
780
+          }
781
+        }
782
+      })
783
+      this.sameRowArr = sameRowArr
784
+    }, merge({ row, column, rowIndex, columnIndex }) {
785
+      if (columnIndex === 0 || columnIndex === 6) {
786
+        const _row = this.tempArr[rowIndex]
787
+        const _col = _row > 0 ? 1 : 0
788
+        return {
789
+          rowspan: _row,
790
+          colspan: _col
791
+        }
792
+      }
793
+    }, export_detail() {
794
+
795
+      let list = []
796
+      for (let i = 0; i < this.tableData.length; i++) {
797
+        let order = this.tableData[i]
798
+        let name = order.name
799
+        let item_name = order.item_name
800
+        let count = order.count
801
+        let price = order.price.toFixed(2)
802
+        let pay_sumamt = (order.price.toFixed(2) * order.count).toFixed(2)
803
+        let total = order.total.toFixed(2)
804
+
805
+        let obj = {
806
+          '患者姓名': name,
807
+          '项目名称': item_name,
808
+          '数量': count,
809
+          '单价': price,
810
+          '费用': pay_sumamt,
811
+          '费用总额': total
812
+        }
813
+        list.push(obj)
814
+      }
815
+      import('@/vendor/Export2Excel').then(excel => {
816
+        const tHeader = ['患者姓名', '项目名称', '数量', '单价', '费用', '费用总额']
817
+        const filterVal = ['患者姓名', '项目名称', '数量', '单价', '费用', '费用总额']
818
+        const data = this.formatJson(filterVal, list)
819
+        excel.export_json_to_excel1({
820
+          header: tHeader,
821
+          data,
822
+          filename: '明细',
823
+          ref: this.$refs['table'].$el
824
+        })
825
+      })
826
+
827
+    }, formatJson(filterVal, jsonData) {
828
+      return jsonData.map(v => filterVal.map(j => v[j]))
829
+    }, getTotal(param) {
830
+      const { columns, data } = param
831
+      const sums = []
832
+      columns.forEach((column, index) => {
833
+        if (index === 0) {
834
+          sums[index] = '合计'
835
+          return
836
+        }
837
+        const values = data.map(item => Number(item[column.property]))
838
+        if (column.property === 'total') {
839
+          // sums[index] = values.reduce((prev, curr) => {
840
+          //   const value = Number(curr)
841
+          //   if (!isNaN(value)) {
842
+          //     return prev + curr
843
+          //   } else {
844
+          //     return prev
845
+          //   }
846
+          // }, 0)
847
+          // sums[index] = sums[index].toFixed(2)
848
+          let num = 0
849
+          data.map(item => {
850
+            num += item.price * item.count
851
+          })
852
+          sums[index] = num.toFixed(2)
853
+        } else {
854
+          sums[index] = ''
855
+        }
856
+      })
857
+
858
+      return sums
859
+    }
860
+  },
861
+  created() {
862
+    this.getSummaryDetailList()
863
+
864
+  }
865
+}
866
+</script>

+ 576 - 0
src/xt_pages/outpatientTool/components/pgather.vue Ver arquivo

@@ -0,0 +1,576 @@
1
+<template>
2
+  <div>
3
+    <div style="display: flex;justify-content: space-between;margin-bottom:10px;">
4
+      <div>
5
+        <!--<el-button size="small" style="margin-left:10px;" class="filter-item" type="primary"-->
6
+        <!--@click="Action">-->
7
+        <!--导出-->
8
+        <!--</el-button>-->
9
+        <el-input size="small" style="width:150px;" v-model="keywords" @input="searchAction"
10
+                  @keyup.enter.native='searchAction'
11
+                  placeholder="请输入患者姓名"
12
+
13
+                  class="filter-item"/>
14
+        <el-select size="small" v-model="item_type" placeholder="请选择"
15
+                   style="width:150px;margin-left:10px;" @change="changeItem">
16
+          <el-option
17
+            label="全部"
18
+            value="0">
19
+          </el-option>
20
+          <el-option
21
+            v-for="item,index in items"
22
+            :key="index"
23
+            :label="item.name"
24
+            :value="item.id">
25
+          </el-option>
26
+        </el-select>
27
+        <el-select size="small" v-model="item_time_type" placeholder="请选择"
28
+                   style="width:150px;margin-left:10px;" @change="changeTimeItem">
29
+          <el-option
30
+            label="处方时间"
31
+            value="0">
32
+          </el-option>
33
+          <el-option
34
+            label="结算时间"
35
+            value="1">
36
+          </el-option>
37
+        </el-select>
38
+        <el-date-picker
39
+          v-model="chargeDate"
40
+          type="daterange"
41
+          value-format="yyyy-MM-dd"
42
+          range-separator="至"
43
+          start-placeholder="开始日期"
44
+          @change="changeDate"
45
+          end-placeholder="结束日期">
46
+        </el-date-picker>
47
+        <!--<el-radio v-model="radio" label="1">明细</el-radio>-->
48
+        <!--<el-radio v-model="radio" label="2">汇总</el-radio>-->
49
+      </div>
50
+      <div>
51
+        <!-- <el-popover
52
+          placement="bottom"
53
+          width="210"
54
+          trigger="click">
55
+          <el-button size="small" ref="button_two" @click="open(1)">打印清单</el-button>
56
+          <el-button size="small" ref="button_six" @click="open(2)">打印汇总</el-button>
57
+          <el-button slot="reference" style="margin:0 10px;" type="primary" size="small">打印</el-button>
58
+
59
+        </el-popover> -->
60
+        <el-button size="small" type="primary" @click="export_detail">报表下载</el-button>
61
+      </div>
62
+    </div>
63
+    <el-table :data="tableData" border :row-style="{ color: '#303133' }" ref="tables"
64
+              :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
65
+              v-loading="gather_loading"
66
+              show-summary
67
+              max-height="600"
68
+              :span-method="merge"
69
+              :summary-method="getTotal"
70
+              highlight-current-row>
71
+
72
+      <el-table-column align="center" prop="name" label="费用分类">
73
+        <template slot-scope="scope">{{ scope.row.name }}</template>
74
+      </el-table-column>
75
+      <!--<el-table-column align="center" prop="name" label="患者类型">-->
76
+      <!--<template slot-scope="scope"></template>-->
77
+      <!--</el-table-column>-->
78
+
79
+      <el-table-column align="center" prop="item_name" label="处方类型">
80
+        <template slot-scope="scope">{{scope.row.item_name}}</template>
81
+      </el-table-column>
82
+      <el-table-column align="center" prop="price" label="项目名称">
83
+        <template slot-scope="scope">{{scope.row.price.toFixed(2)}}</template>
84
+      </el-table-column>
85
+      <el-table-column align="center" prop="sum" label="费用总额">
86
+        <template slot-scope="scope">
87
+          <div>{{scope.row.sum.toFixed(2)}}</div>
88
+        </template>
89
+      </el-table-column>
90
+
91
+    </el-table>
92
+  </div>
93
+</template>
94
+
95
+
96
+<script>
97
+import BreadCrumb from '@/xt_pages/components/bread-crumb'
98
+import { GetSummaryDetail } from '@/api/his/his'
99
+import { uParseTime } from '@/utils/tools'
100
+// import NewStatementPrint from './newStatementPrint'
101
+const moment = require('moment')
102
+export default {
103
+  components: {
104
+    BreadCrumb
105
+
106
+  },
107
+  data() {
108
+    return {
109
+      gather_loading:false,
110
+      crumbs: [],
111
+      tempArr: [],
112
+      sameRowArr: [],
113
+      keywords: '',
114
+      pos:0,
115
+
116
+      tableData: [],
117
+      chargeDate: [moment(new Date()).add('year', 0).format('YYYY-MM-DD'), moment(new Date()).add('year', 0).format('YYYY-MM-DD')],
118
+      item_type: '0',
119
+      item_time_type:'0',
120
+      items: [
121
+        { id: 1, name: '药品' },
122
+        { id: 2, name: '所有项目' },
123
+        { id: 4, name: '检验费' },
124
+        { id: 5, name: '治疗费' },
125
+        { id: 6, name: '护理费' },
126
+        { id: 7, name: '其他' },
127
+
128
+        { id: 3, name: '耗材' },
129
+
130
+      ]
131
+
132
+    }
133
+  },
134
+  methods: {
135
+
136
+    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
137
+      if (columnIndex === 0) {
138
+        if (rowIndex % 2 === 0) {
139
+          return {
140
+            rowspan: 2,
141
+            colspan: 1
142
+          }
143
+        } else {
144
+          return {
145
+            rowspan: 0,
146
+            colspan: 0
147
+          }
148
+        }
149
+      }
150
+    },
151
+    unique(arr) {
152
+      const res = new Map()
153
+      return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1))
154
+    },
155
+    changeDate() {
156
+      // console.log(this.chargeDate)
157
+      this.getSummaryDetailList()
158
+    },changeTimeItem(){
159
+      this.getSummaryDetailList()
160
+    },
161
+    changeItem() {
162
+      this.getSummaryDetailList()
163
+    }, uniquepid(arr) {
164
+      const res = new Map()
165
+      return arr.filter((arr) => !res.has(arr.p_id) && res.set(arr.p_id, 1))
166
+    },
167
+    searchAction() {
168
+      this.item_type = '0'
169
+      this.getSummaryDetailList()
170
+    },
171
+    getSummaryDetailList() {
172
+      this.gather_loading = true
173
+      let start_time = this.chargeDate[0]
174
+      let end_time = this.chargeDate[1]
175
+      let params = {
176
+        start_time: start_time,
177
+        end_time: end_time,
178
+        type: this.item_type,
179
+        keyword: this.keywords,
180
+        time_type:this.item_time_type,
181
+      }
182
+      GetSummaryDetail(params).then(response => {
183
+        if (response.data.state == 0) {
184
+          this.gather_loading = false
185
+
186
+          this.$message.error(response.data.msg)
187
+          return false
188
+        } else {
189
+          this.gather_loading = false
190
+
191
+          let tempPatients = []
192
+          let tempPatientsTwo = []
193
+          this.tableData = []
194
+          let tempData = response.data
195
+          let data = response.data
196
+          let orders = this.uniquepid(tempData)
197
+          console.log(orders)
198
+
199
+          for (let i = 0; i < orders.length; i++) {
200
+            let obj = {
201
+              patient_id: orders[i].p_id,
202
+              name: orders[i].p_name,
203
+              orders: []
204
+            }
205
+            for (let b = 0; b < data.length; b++) {
206
+              if (orders[i].p_id == data[b].p_id) {
207
+                obj.orders = obj.orders.concat(data[b])
208
+              }
209
+            }
210
+            tempPatients.push(obj)
211
+          }
212
+          console.log(tempPatients)
213
+
214
+          for (let i = 0; i < tempPatients.length; i++) {
215
+            let obj = {
216
+              patient_id: tempPatients[i].patient_id,
217
+              name: tempPatients[i].name,
218
+              order_info: []
219
+            }
220
+            let orders = tempPatients[i].orders
221
+            for (let c = 0; c < orders.length; c++) {
222
+              let newObj = {}
223
+
224
+              newObj['count'] = orders[c].cnt
225
+              newObj['price'] = orders[c].pric
226
+              if (orders[c].advice_id > 0 && orders[c].project_id == 0) {
227
+                newObj['type'] = 1
228
+                newObj['item_name'] = orders[c].item_name
229
+                newObj['item_id'] = orders[c].item_id
230
+
231
+              }
232
+              if (orders[c].advice_id == 0 && orders[c].project_id > 0) {
233
+                newObj['item_id'] = orders[c].item_id
234
+                if (orders[c].p_type == 2) {
235
+                  newObj['type'] = 2
236
+                  newObj['item_name'] = orders[c].item_name
237
+                } else if (orders[c].p_type == 3) {
238
+                  newObj['type'] = 3
239
+                  newObj['item_name'] = orders[c].item_name
240
+                }
241
+              }
242
+              obj.order_info.push(newObj)
243
+            }
244
+            tempPatientsTwo.push(obj)
245
+          }
246
+          console.log(tempPatientsTwo)
247
+
248
+          for (let d = 0; d < tempPatientsTwo.length; d++) {
249
+            tempPatientsTwo[d]['new_order_info'] = []
250
+            let project = []
251
+            let advice = []
252
+            for (let b = 0; b < tempPatientsTwo[d].order_info.length; b++) {
253
+              if (tempPatientsTwo[d].order_info[b].type == 1) {
254
+                advice.push(tempPatientsTwo[d].order_info[b])
255
+              } else {
256
+                project.push(tempPatientsTwo[d].order_info[b])
257
+              }
258
+            }
259
+            // project = this.uniqueProjectAndAdvice(project)
260
+            // advice = this.uniqueProjectAndAdvice(advice)
261
+
262
+            let obj = {}
263
+            let price = 0
264
+
265
+            let obj2 = {}
266
+            let price2 = 0
267
+
268
+            let obj3 = {}
269
+            let price3 = 0
270
+
271
+            for (let i = 0; i < project.length; i++) {
272
+              if (project[i].type == 2) {
273
+                price = parseFloat(price.toString()) + parseFloat((parseFloat(project[i].count.toString()) * parseFloat(project[i].price.toString()).toFixed(2)).toString())
274
+              } else if (project[i].type == 3) {
275
+                price3 = parseFloat(price3.toString()) + parseFloat((parseFloat(project[i].count.toString()) * parseFloat(project[i].price.toString()).toFixed(2)).toString())
276
+              }
277
+            }
278
+
279
+
280
+            for (let i = 0; i < advice.length; i++) {
281
+              price2 = parseFloat(price2.toString()) + parseFloat((parseFloat(advice[i].count.toString()) * parseFloat(advice[i].price.toString()).toFixed(2)).toString())
282
+            }
283
+
284
+
285
+            switch (parseInt(this.item_type)) {
286
+              case 0:
287
+
288
+                obj['sum'] = price + price2 + price3
289
+                obj['price'] = price
290
+                obj['item_name'] = '项目'
291
+                obj['name'] = tempPatientsTwo[d].name
292
+                obj['patient_id'] = tempPatientsTwo[d].patient_id
293
+                this.tableData.push(obj)
294
+
295
+                obj2['sum'] = 0
296
+                obj2['price'] = price2
297
+                obj2['item_name'] = '药品'
298
+                obj2['name'] = tempPatientsTwo[d].name
299
+                obj2['patient_id'] = tempPatientsTwo[d].patient_id
300
+                this.tableData.push(obj2)
301
+
302
+                obj3['sum'] = 0
303
+                obj3['price'] = price3
304
+                obj3['item_name'] = '耗材'
305
+                obj3['name'] = tempPatientsTwo[d].name
306
+                obj3['patient_id'] = tempPatientsTwo[d].patient_id
307
+                this.tableData.push(obj3)
308
+                break
309
+              case 1:
310
+                obj2['sum'] = price2
311
+                obj2['price'] = price2
312
+                obj2['item_name'] = '药品'
313
+                obj2['name'] = tempPatientsTwo[d].name
314
+                obj2['patient_id'] = tempPatientsTwo[d].patient_id
315
+                this.tableData.push(obj2)
316
+                break
317
+              case 2:
318
+
319
+                obj['sum'] = price
320
+                obj['price'] = price
321
+                obj['item_name'] = '项目'
322
+                obj['name'] = tempPatientsTwo[d].name
323
+                obj['patient_id'] = tempPatientsTwo[d].patient_id
324
+                this.tableData.push(obj)
325
+                break
326
+              case 3:
327
+                obj3['sum'] = price3
328
+                obj3['price'] = price3
329
+                obj3['item_name'] = '耗材'
330
+                obj3['name'] = tempPatientsTwo[d].name
331
+                obj3['patient_id'] = tempPatientsTwo[d].patient_id
332
+                this.tableData.push(obj3)
333
+                break
334
+              case 4:
335
+
336
+                obj['sum'] = price
337
+                obj['price'] = price
338
+                obj['item_name'] = '检验'
339
+                obj['name'] = tempPatientsTwo[d].name
340
+                obj['patient_id'] = tempPatientsTwo[d].patient_id
341
+                this.tableData.push(obj)
342
+                break
343
+              case 5:
344
+
345
+                obj['sum'] = price
346
+                obj['price'] = price
347
+                obj['item_name'] = '治疗'
348
+                obj['name'] = tempPatientsTwo[d].name
349
+                obj['patient_id'] = tempPatientsTwo[d].patient_id
350
+                this.tableData.push(obj)
351
+                break
352
+              case 6:
353
+
354
+                obj['sum'] = price
355
+                obj['price'] = price
356
+                obj['item_name'] = '护理'
357
+                obj['name'] = tempPatientsTwo[d].name
358
+                obj['patient_id'] = tempPatientsTwo[d].patient_id
359
+                this.tableData.push(obj)
360
+                break
361
+              case 7:
362
+
363
+                obj['sum'] = price
364
+                obj['price'] = price
365
+                obj['item_name'] = '其他'
366
+                obj['name'] = tempPatientsTwo[d].name
367
+                obj['patient_id'] = tempPatientsTwo[d].patient_id
368
+                this.tableData.push(obj)
369
+                break
370
+
371
+            }
372
+
373
+
374
+
375
+          }
376
+
377
+          this.handleSpanTempArr()
378
+          // this.tableData = tempPatientsTwo
379
+
380
+          // console.log(tempPatientsTwo.length)
381
+          //
382
+
383
+        }
384
+        //
385
+        // console.log('去重前')
386
+        // console.log(advice)
387
+        // console.log(project)
388
+        // //
389
+        // //
390
+
391
+        // //
392
+        // console.log('去重后')
393
+        //
394
+        // console.log(advice.length)
395
+        // console.log(project.length)
396
+        //
397
+        // for (let i = 0; i < project.length; i++) {
398
+        //   let obj = {}
399
+        //   let count = 0
400
+        //   for (let a = 0; a < tempPatientsTwo.length; a++) {
401
+        //     if (project[i].patient_id == tempPatientsTwo[a].patient_id && project[i].item_id == tempPatientsTwo[a].item_id && project[i].price == tempPatientsTwo[a].price) {
402
+        //       count = count + tempPatientsTwo[a].count
403
+        //       obj['count'] = count
404
+        //
405
+        //     }
406
+        //     obj['price'] = project[i].price
407
+        //     obj['type'] = project[i].type
408
+        //     obj['item_name'] = project[i].item_name
409
+        //     obj['item_id'] = project[i].item_id
410
+        //     obj['name'] = project[i].name
411
+        //     obj['patient_id'] = project[i].patient_id
412
+        //     obj['count'] = count
413
+        //     this.tableData.push(obj)
414
+        //   }
415
+        // }
416
+        //
417
+        //
418
+        // for (let i = 0; i < advice.length; i++) {
419
+        //   let obj = {}
420
+        //   let count = 0
421
+        //   for (let a = 0; a < tempPatientsTwo.length; a++) {
422
+        //     if (advice[i].patient_id == tempPatientsTwo[a].patient_id && advice[i].item_id == tempPatientsTwo[a].item_id && advice[i].price == tempPatientsTwo[a].price) {
423
+        //       count = count + tempPatientsTwo[a].count
424
+        //       obj['count'] = count
425
+        //
426
+        //     }
427
+        //     obj['price'] = advice[i].price
428
+        //     obj['type'] = advice[i].type
429
+        //     obj['item_name'] = advice[i].item_name
430
+        //     obj['item_id'] = advice[i].item_id
431
+        //     obj['name'] = advice[i].name
432
+        //     obj['patient_id'] = advice[i].patient_id
433
+        //     this.tableData.push(obj)
434
+        //   }
435
+        // }
436
+        // console.log(this.tableData.length)
437
+        // this.tableData = this.sort(this.tableData)
438
+
439
+      })
440
+    }, uniqueProjectAndAdvice(array) {
441
+      // res用来存储结果
442
+      var res = []
443
+      for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
444
+        for (var j = 0, resLen = res.length; j < resLen; j++) {
445
+          if (array[i].item_id === res[j].item_id && array[i].price === res[j].price) {
446
+            break
447
+          }
448
+        }
449
+        // 如果array[i]是唯一的,那么执行完循环,j等于resLen
450
+        if (j === resLen) {
451
+          res.push(array[i])
452
+        }
453
+      }
454
+      return res
455
+    }, sort(arr) {
456
+      for (var i = 0; i < arr.length - 1; i++) {
457
+        for (var j = 0; j < arr.length - i - 1; j++) {
458
+          if (arr[j].patient_id > arr[j + 1].patient_id) {// 相邻元素两两对比
459
+            var hand = arr[j]
460
+            arr[j] = arr[j + 1]
461
+            arr[j + 1] = hand
462
+
463
+          }
464
+        }
465
+      }
466
+      return arr
467
+    }, handleSpanTempArr() {
468
+      this.tempArr = []
469
+
470
+      for (let i = 0; i < this.tableData.length; i++) {
471
+        if (i === 0) {
472
+          this.tempArr.push(1)
473
+          this.pos = 0
474
+        } else {
475
+          // 判断当前元素与上一个元素是否相同
476
+          if (this.tableData[i].patient_id === this.tableData[i - 1].patient_id) {
477
+            this.tempArr[this.pos] += 1
478
+            this.tempArr.push(0)
479
+          } else {
480
+            this.tempArr.push(1)
481
+            this.pos = i
482
+          }
483
+        }
484
+      }
485
+
486
+      let sameRowArr = [], sIdx = 0
487
+      this.tableData.forEach((item, index) => {
488
+        item.index = index
489
+        if (index === 0) {
490
+          sameRowArr.push([index])
491
+        } else {
492
+          if (item.patient_id === this.tableData[index - 1].patient_id) {
493
+            sameRowArr[sIdx].push(index)
494
+          } else {
495
+            sIdx = sIdx + 1
496
+            sameRowArr.push([index])
497
+          }
498
+        }
499
+      })
500
+      this.sameRowArr = sameRowArr
501
+    }, merge({ row, column, rowIndex, columnIndex }) {
502
+      if (columnIndex === 0 || columnIndex === 3) {
503
+        const _row = this.tempArr[rowIndex]
504
+        const _col = _row > 0 ? 1 : 0
505
+        return {
506
+          rowspan: _row,
507
+          colspan: _col
508
+        }
509
+      }
510
+    }, getTotal(param) {
511
+      const { columns, data } = param
512
+      const sums = []
513
+      columns.forEach((column, index) => {
514
+        if (index === 0) {
515
+          sums[index] = '合计'
516
+          return
517
+        }
518
+        console.log(data)
519
+        const values = data.map(item => Number(item[column.property]))
520
+        if (column.property === 'sum') {
521
+          sums[index] = values.reduce((prev, curr) => {
522
+            const value = Number(curr)
523
+            if (!isNaN(value)) {
524
+              return prev + curr
525
+            } else {
526
+              return prev
527
+            }
528
+          }, 0)
529
+          sums[index] = sums[index].toFixed(2)
530
+        } else {
531
+          sums[index] = ''
532
+        }
533
+      })
534
+
535
+      return sums
536
+    }, export_detail() {
537
+
538
+      let list = []
539
+      for (let i = 0; i < this.tableData.length; i++) {
540
+        let order = this.tableData[i]
541
+        let name = order.name
542
+        let item_name = order.item_name
543
+        let pay_sumamt = order.price.toFixed(2)
544
+        let total = order.sum.toFixed(2)
545
+
546
+
547
+        let obj = {
548
+          '患者姓名': name,
549
+          '项目类别': item_name,
550
+          '费用': pay_sumamt,
551
+          '费用总额':total,
552
+        }
553
+        list.push(obj)
554
+      }
555
+      import('@/vendor/Export2Excel').then(excel => {
556
+        const tHeader = [ '患者姓名', '项目名称', '费用', '费用总额']
557
+        const filterVal = [ '患者姓名', '项目名称', '费用', '费用总额']
558
+        const data = this.formatJson(filterVal, list)
559
+        excel.export_json_to_excel1({
560
+          header: tHeader,
561
+          data,
562
+          filename: '汇总',
563
+          ref:this.$refs['tables'].$el
564
+        })
565
+      })
566
+
567
+    }, formatJson(filterVal, jsonData) {
568
+      return jsonData.map(v => filterVal.map(j => v[j]))
569
+    }
570
+  },
571
+  created() {
572
+    this.getSummaryDetailList()
573
+
574
+  }
575
+}
576
+</script>

+ 9 - 2
src/xt_pages/qcd/indicatorControlAnalysis/components/office.vue Ver arquivo

@@ -45,7 +45,7 @@
45 45
         :editable="false"
46 46
         style="width: 150px;"
47 47
         type="date"
48
-       
48
+
49 49
         placeholder="选择日期时间"
50 50
         align="right"
51 51
         format="yyyy-MM-dd"
@@ -57,7 +57,7 @@
57 57
         prefix-icon="el-icon-date"
58 58
         @change="changeEndTime"
59 59
         :editable="false"
60
-        
60
+
61 61
         style="width: 150px;"
62 62
         type="date"
63 63
         placeholder="选择日期时间"
@@ -323,6 +323,7 @@
323 323
         var projectInfo = this.getPojectInfo(this.query.project_id, val)
324 324
         console.log(projectInfo)
325 325
         this.item_name = projectInfo.item_name
326
+        this.query.range_type = projectInfo.range_type
326 327
 
327 328
         this.GetRangeValue(projectInfo.range_type, projectInfo.project_id, projectInfo.item_id)
328 329
 
@@ -384,8 +385,14 @@
384 385
 
385 386
       },
386 387
       getPojectInfo(project_id, item_id) {
388
+        console.log(project_id)
389
+        console.log(item_id)
390
+        console.log(this.all_inspection_reference)
391
+
392
+
387 393
         for (let i = 0; i < this.all_inspection_reference.length; i++) {
388 394
           if (this.all_inspection_reference[i].project_id == project_id && this.all_inspection_reference[i].item_id == item_id) {
395
+            console.log(this.all_inspection_reference[i])
389 396
             return this.all_inspection_reference[i]
390 397
           }
391 398
         }