瀏覽代碼

518合并代码

XMLWAN 2 年之前
父節點
當前提交
2cbc131134

+ 79 - 12
src/xt_pages/outpatientTool/components/detailStatistics.vue 查看文件

@@ -111,7 +111,10 @@
111 111
     </el-table>
112 112
     <div style="display:flex;justify-content: space-around;">
113 113
       <div>总费用:{{getAllPice()}}</div>
114
-     <div>个人支付:{{getActPay()}}</div>
114
+     <div>个人支付:
115
+        <span v-if="his_patient.balance_accounts_type == 2"></span> {{getAllPice()}}
116
+        <span v-if="his_patient.balance_accounts_type != 2"></span> {{getActPay()}}
117
+    </div>
115 118
      <div>基金支付记账:{{getFundPaySumamt()}}</div>
116 119
      <div>补充医疗支付记账:{{getHifesPay()}}</div>
117 120
     <div>救助支付金额:{{getMafPay()}}</div>
@@ -155,13 +158,13 @@ export default {
155 158
       item_type: '0',
156 159
       items: [
157 160
         { id: 1, name: '药品' },
161
+        { id: 2, name: '项目' },
158 162
         { id: 3, name: '耗材' },
159
-        { id: 2, name: '项目' }
160 163
 
161 164
       ],
162 165
       list:[],
163
-      
164
-
166
+      his_patient:{},
167
+      id:0,
165 168
     }
166 169
   },
167 170
   methods: {
@@ -181,8 +184,10 @@ export default {
181 184
     changeDate() {
182 185
       this.getHisSummaryDetailList()
183 186
     },
184
-    changeItem() {
187
+    changeItem(id) {
188
+      this.id = id
185 189
       this.getHisSummaryDetailList()
190
+ 
186 191
     },
187 192
     getHisSummaryDetailList() {
188 193
       let start_time = this.chargeDate[0]
@@ -197,7 +202,7 @@ export default {
197 202
      getHisSummaryDetailList(params).then(response=>{
198 203
        if(response.data.state == 1){
199 204
           var list =  response.data.data.list
200
-         
205
+          this.his_patient = response.data.data.his_patient
201 206
           this.list = list
202 207
           this.tableData = []
203 208
           for(let i=0;i<list.length;i++){
@@ -218,7 +223,7 @@ export default {
218 223
           }
219 224
           obj.total_price = (obj.total_price).toFixed(2)
220 225
           this.tableData.push(obj)
221
-         
226
+          console.log("tabledata23233232233232",this.tableData)
222 227
           var new_arr = []
223 228
        
224 229
           if(this.keywords!=""){
@@ -243,15 +248,70 @@ export default {
243 248
                 }
244 249
               }
245 250
             }
246
-            if(this.keywords!=""){
247
-              this.tableData.push(obj)
248
-            }
251
+            var objs = {index:"合计",total_price:0,record_date:"0"}
252
+            objs.total_price = this.getPrice(new_arr)
253
+            new_arr.push(objs)
254
+            
249 255
             this.tableData = new_arr
250 256
           }
257
+           if(this.id == 1){
258
+              var obj = {index:"合计",total_price:0,record_date:"0"}
259
+              var new_arr = []
260
+              for(let i=0;i<this.tableData.length;i++){
261
+                if(this.tableData[i].index!="合计"){
262
+                  if(this.tableData[i].advice_id > 0){
263
+                    new_arr.push(this.tableData[i])
264
+                  }
265
+                } 
266
+              }
267
+              this.tableData = []
268
+              obj.total_price = this.getPrice(new_arr)
269
+              new_arr.push(obj)
270
+              this.tableData = new_arr
271
+           }
272
+          if(this.id == 2){
273
+            var obj = {index:"合计",total_price:0,record_date:"0"}
274
+            var new_arr = []
275
+            for(let i=0;i<this.tableData.length;i++){
276
+              if(this.tableData[i].index!="合计"){
277
+                if(this.tableData[i].project_id > 0){
278
+                  if(this.tableData[i].project.type ==2){
279
+                    new_arr.push(this.tableData[i])
280
+                  }
281
+                }
282
+              } 
283
+            }
284
+            console.log("项目new_arr",new_arr)
285
+            this.tableData = []
286
+            obj.total_price = this.getPrice(new_arr)
287
+            console.log("ar3233223232",new_arr)
288
+            new_arr.push(obj)
289
+            this.tableData = new_arr
290
+            }
291
+
292
+          if(this.id == 3){
293
+            var new_arr = []
294
+            var obj = {index:"合计",total_price:0,record_date:"0"}
295
+            for(let i=0;i<this.tableData.length;i++){
296
+              if(this.tableData[i].index!="合计"){
297
+                if(this.tableData[i].project_id > 0){
298
+                  if(this.tableData[i].project.type == 3){
299
+                    new_arr.push(this.tableData[i])
300
+                  }
301
+                }
302
+              } 
303
+            }
304
+            this.tableData = []
305
+            obj.total_price = this.getPrice(new_arr)
306
+            new_arr.push(obj)
307
+            console.log("new_arr2332323232",new_arr)
308
+            this.tableData = new_arr
309
+          }          
251 310
        }
252 311
      })
253 312
     },
254 313
     getAllPice(){
314
+     console.log("表哥233323232323223",this.tableData)
255 315
       var total_price = 0
256 316
       for(let i=0;i<this.tableData.length;i++){
257 317
         if(this.tableData[i].index =="合计"){
@@ -261,7 +321,7 @@ export default {
261 321
       return total_price
262 322
     },
263 323
     getActPay(){
264
-      
324
+      console.log("list2332323232323232",this.list)
265 325
       var act_pay = 0
266 326
       for(let i=0;i<this.list.length;i++){
267 327
         for(let j=0;j<this.list[i].orders.length;j++){
@@ -298,7 +358,14 @@ export default {
298 358
       return maf_pay
299 359
     },
300 360
     toPrint(){
301
-      this.$router.push({path:"/hisTool/detailPrint?patient_id="+this.patient_id+"&start_time="+this.chargeDate[0]+"&end_time="+this.chargeDate[1]+"&type="+this.item_type +"&keyword="+this.keywords})
361
+      this.$router.push({path:"/hisTool/detailPrint?patient_id="+this.patient_id+"&start_time="+this.chargeDate[0]+"&end_time="+this.chargeDate[1]+"&type="+this.item_type +"&keyword="+this.keywords+"&id="+this.id+"&balance_accounts_type="+this.his_patient.balance_accounts_type})
362
+    },
363
+    getPrice(val){
364
+      var total_price = 0
365
+      for(let i=0;i<val.length;i++){
366
+         total_price += val[i].cnt * val[i].pric
367
+      }
368
+      return total_price.toFixed(2)
302 369
     }
303 370
 
304 371
   },

+ 3 - 0
src/xt_pages/outpatientTool/components/gatherStatistics.vue 查看文件

@@ -240,6 +240,7 @@ export default {
240 240
         this.tableList = []
241 241
         this.getGatherDetailList()
242 242
       }
243
+      
243 244
       if(id == 1){
244 245
        var new_arr = []
245 246
        for(let i=0;i<this.tableList.length;i++){
@@ -1161,12 +1162,14 @@ export default {
1161 1162
 
1162 1163
   },
1163 1164
   created() {
1165
+    this.tableList = []
1164 1166
     this.getGatherDetailList()
1165 1167
 
1166 1168
   },
1167 1169
   watch:{
1168 1170
     "patient_id":function(){
1169 1171
       this.patient_id = this.patient_id
1172
+      this.tableList = []
1170 1173
       this.getGatherDetailList()
1171 1174
     }
1172 1175
   }

+ 99 - 14
src/xt_pages/outpatientTool/detailPrint.vue 查看文件

@@ -11,16 +11,20 @@
11 11
         <div>患者姓名:{{ patient.name }}</div>
12 12
         <div>性别:{{ patient.gender == 1 ? "男" : "女" }}</div>
13 13
         <div>结算类别:{{ getType(his_patient.balance_accounts_type) }}</div>
14
-        <div style="min-width:300px;">发票号码:</div>
14
+        <div style="min-width:300px;">发票号码:{{order.fa_piao_number}}</div>
15 15
       </div>
16 16
       <div class="listInfo">
17
-        <div>住院/门诊号:</div>
17
+        <div>住院/门诊号:{{his_patient.number}}</div>
18 18
         <div>科室:{{ getDepartment(his_patient.departments) }}</div>
19 19
         <div style="min-width:350px;">就诊流水号:{{ his_patient.number }}</div>
20 20
       </div>
21 21
       <div class="listInfo">
22 22
         <div>总费用:{{ getAllPice() }}</div>
23
-        <div>个人支付:{{ getActPay() }}</div>
23
+        <div>个人支付:
24
+          <span v-if="this.$route.query.balance_accounts_type == 2">{{ getAllPice() }}</span> 
25
+          <span v-if="this.$route.query.balance_accounts_type != 2">{{ getActPay() }}</span> 
26
+          
27
+        </div>
24 28
         <div>基金支付记账:{{ getFundPaySumamt() }}</div>
25 29
         <div style="min-width:300px;">补充医疗支付记账:{{ getHifesPay() }}</div>
26 30
       </div>
@@ -40,7 +44,10 @@
40 44
           <td style="width: 10%; text-align: center">金额</td>
41 45
         </tr>
42 46
         <tr v-for="(item, index) in tableData" :key="index">
43
-          <td style="width: 19%; text-align: center">{{ index + 1 }}</td>
47
+          <td style="width: 19%; text-align: center">
48
+            <span v-if="item.is_total == 1">{{ index + 1 }}</span> 
49
+            <span v-if="item.is_total == 2">合计</span> 
50
+          </td>
44 51
           <td style="width: 10%; text-align: center">
45 52
             <span v-if="item.record_date > 0">{{
46 53
               getTimes(item.record_date)
@@ -54,7 +61,7 @@
54 61
                 item.project.project.project_name
55 62
               }}</span>
56 63
               <span v-if="item.project.type == 3"
57
-                >{item.project.good_info.good_name}}</span
64
+                >{{item.project.good_info.good_name}}</span
58 65
               >
59 66
             </span>
60 67
           </td>
@@ -119,6 +126,7 @@ export default {
119 126
         { value: 7, label: "合同" },
120 127
         { value: 8, label: "医保自费" },
121 128
       ],
129
+      order:{},
122 130
     };
123 131
   },
124 132
   methods: {
@@ -174,31 +182,34 @@ export default {
174 182
          
175 183
 
176 184
           this.hisDepatment = response.data.data.hisDepatment;
177
-
185
+           
186
+          this.order = response.data.data.order
178 187
           this.tableData = [];
179 188
           for (let i = 0; i < list.length; i++) {
180 189
             for (let j = 0; j < list[i].orders.length; j++) {
181 190
               for (let z = 0; z < list[i].orders[j].order_info.length; z++) {
182 191
                 list[i].orders[j].order_info[z].record_date =
183
-                  list[i].orders[j].settle_accounts_date;
192
+                list[i].orders[j].settle_accounts_date;
184 193
                 list[i].orders[j].order_info[z].number =
185
-                  list[i].orders[j].number;
194
+                list[i].orders[j].number;
186 195
                 this.tableData.push(list[i].orders[j].order_info[z]);
187 196
               }
188 197
             }
189 198
           }
190
-          var obj = { index: "合计", total_price: 0, record_date: "0" };
199
+          var obj = { index: "合计", total_price: 0, record_date: "0",is_total:2 };
191 200
           for (let i = 0; i < this.tableData.length; i++) {
192 201
             this.tableData[i].index = i + 1;
193 202
             this.tableData[i].total_price = 0;
203
+            this.tableData[i].is_total = 1
194 204
             this.tableData[i].total_price = (
195
-              this.tableData[i].cnt * this.tableData[i].pric
196
-            ).toFixed(2);
205
+            this.tableData[i].cnt * this.tableData[i].pric).toFixed(2);
197 206
             obj.total_price += this.tableData[i].cnt * this.tableData[i].pric;
198 207
           }
199 208
           obj.total_price = obj.total_price.toFixed(2);
200 209
           this.tableData.push(obj);
210
+          console.log("表哥233232323232233232322323",this.tableData)
201 211
           if (this.$route.query.keyword != "") {
212
+            var new_arr = []
202 213
             for (let i = 0; i < this.tableData.length; i++) {
203 214
               if (this.tableData[i].index != "合计") {
204 215
                 if (this.tableData[i].advice_id > 0) {
@@ -232,12 +243,79 @@ export default {
232 243
                 }
233 244
               }
234 245
             }
235
-            if (this.$route.query.keyword != "") {
236
-              this.tableData.push(obj);
246
+            var objs = {index:"合计",total_price:0,record_date:"0",is_total:2}
247
+            for(let i=0;i<new_arr.length;i++){
248
+               new_arr[i].is_total = 1
237 249
             }
250
+            objs.total_price = this.getPrice(new_arr)
251
+            new_arr.push(objs)
238 252
             this.tableData = new_arr;
253
+            console.log("表哥2333333333333333333333333333",this.tableData)
239 254
           }
240
-          console.log("tabledata32233223323232", this.tableData);
255
+
256
+          if(this.$route.query.id == 1){
257
+              var obj = {index:"合计",total_price:0,record_date:"0",is_total:2}
258
+              var new_arr = []
259
+              for(let i=0;i<this.tableData.length;i++){
260
+                if(this.tableData[i].index!="合计"){
261
+                  if(this.tableData[i].advice_id > 0){
262
+                    new_arr.push(this.tableData[i])
263
+                  }
264
+                } 
265
+              }
266
+              this.tableData = []
267
+              obj.total_price = this.getPrice(new_arr)
268
+              for(let i=0;i<new_arr.length;i++){
269
+                new_arr[i].is_total = 1
270
+              }
271
+              new_arr.push(obj)
272
+              this.tableData = new_arr
273
+           }
274
+          if(this.$route.query.id == 2){
275
+            var obj = {index:"合计",total_price:0,record_date:"0",is_total:2}
276
+            var new_arr = []
277
+            for(let i=0;i<this.tableData.length;i++){
278
+              if(this.tableData[i].index!="合计"){
279
+                if(this.tableData[i].project_id > 0){
280
+                  if(this.tableData[i].project.type ==2){
281
+                    new_arr.push(this.tableData[i])
282
+                  }
283
+                }
284
+              } 
285
+            }
286
+            console.log("项目new_arr",new_arr)
287
+            this.tableData = []
288
+            obj.total_price = this.getPrice(new_arr)
289
+            console.log("ar3233223232",new_arr)
290
+            for(let i=0;i<new_arr.length;i++){
291
+              new_arr[i].is_total = 1
292
+            }
293
+            new_arr.push(obj)
294
+            this.tableData = new_arr
295
+            }
296
+
297
+          if(this.$route.query.id == 3){
298
+            var new_arr = []
299
+            var obj = {index:"合计",total_price:0,record_date:"0",is_total:2}
300
+            for(let i=0;i<this.tableData.length;i++){
301
+              if(this.tableData[i].index!="合计"){
302
+                if(this.tableData[i].project_id > 0){
303
+                  if(this.tableData[i].project.type == 3){
304
+                    new_arr.push(this.tableData[i])
305
+                  }
306
+                }
307
+              } 
308
+            }
309
+            this.tableData = []
310
+            obj.total_price = this.getPrice(new_arr)
311
+            for(let i=0;i<new_arr.length;i++){
312
+              new_arr[i].is_total = 1
313
+            }
314
+            new_arr.push(obj)
315
+            console.log("new_arr2332323232",new_arr)
316
+            this.tableData = new_arr
317
+          } 
318
+         
241 319
         }
242 320
       });
243 321
     },
@@ -305,6 +383,13 @@ export default {
305 383
       }
306 384
       return name;
307 385
     },
386
+    getPrice(val){
387
+      var total_price = 0
388
+      for(let i=0;i<val.length;i++){
389
+         total_price += val[i].cnt * val[i].pric
390
+      }
391
+      return total_price.toFixed(2)
392
+    }
308 393
   },
309 394
   created() {
310 395
     this.getHisSummaryDetailList();