Browse Source

合并带嘛

csx 2 years ago
parent
commit
87b5b733d2

+ 2 - 2
src/xt_pages/hospitalStation/invoicePrint.vue View File

@@ -19,9 +19,9 @@
19 19
           "
20 20
           :paramsObj="invoiceParams"
21 21
         ></printOne>
22
-        <printTwo v-if="org_id == 10215 ||  org_id == 0" :paramsObj="invoiceParams"></printTwo>
22
+        <printTwo v-if="org_id == 10215 " :paramsObj="invoiceParams"></printTwo>
23 23
         <printThree
24
-          v-if="org_id == 10265 || org_id == 4 || org_id == 9675"
24
+          v-if="org_id == 10265 || org_id == 4 || org_id == 9675 ||  org_id == 0"
25 25
           :paramsObj="invoiceParams"
26 26
         ></printThree>
27 27
       </div>

+ 3 - 2
src/xt_pages/hospitalStation/invoiceTemplate/printThree.vue View File

@@ -191,7 +191,7 @@
191 191
         </div> -->
192 192
         <div style="position: absolute;top:370px;left:40px">
193 193
             <!-- 预交款合计 -->
194
-            预交款合计:0.00
194
+            预交款合计:{{pre_pay_money}}
195 195
         </div>
196 196
         <div style="position: absolute;top:370px;left:250px">
197 197
             <!-- 补交款 -->
@@ -244,6 +244,7 @@ export default {
244 244
           out_hosptial_time:'',
245 245
           number:'',
246 246
           insutype:'',
247
+          pre_pay_money:"",
247 248
         }
248 249
     },
249 250
     mounted(){
@@ -302,7 +303,7 @@ export default {
302 303
               this.id_card_no = this.list.his_hospital_record.id_card_no
303 304
               this.number = this.list.his_hospital_record.number
304 305
               this.psn_no = this.list.his_hospital_record.psn_no
305
-
306
+              this.pre_pay_money = this.list.pre_pay_money
306 307
 
307 308
               this.balance_accounts_type = this.list.his_hospital_record.balance_accounts_type
308 309
               this.gend= this.list.his_hospital_record.gend

+ 128 - 11
src/xt_pages/outpatientCharges/listPrint.vue View File

@@ -136,7 +136,7 @@
136 136
                 obj.bingTotal = this.getBingTotal(tempDetails)
137 137
                 obj.otherTotal = this.getOtherTotal(tempDetails)
138 138
 
139
-                obj.details = this.setNewData(tempDetails)
139
+                obj.details = this.set10265NewData(tempDetails)
140 140
                 this.list.push(obj)
141 141
               }
142 142
               console.log(this.list)
@@ -251,7 +251,8 @@
251 251
           total = Number(total) + Number(parseFloat(items[i].cnt) * parseFloat(items[i].pric))
252 252
         }
253 253
         return total.toFixed(2)
254
-      },setNewData(details) {
254
+      },
255
+      setNewData(details) {
255 256
         let drug_ids = []
256 257
         let project_ids = []
257 258
 
@@ -259,13 +260,15 @@
259 260
           if (details[i].advice && details[i].advice.id > 0 && details[i].advice.prescription && details[i].advice.prescription.type == 1) { //药品
260 261
             let obj = {
261 262
               id: details[i].advice.drug_id,
262
-              price: details[i].advice.price
263
+              price: details[i].advice.price,
264
+              lv: details[i].chrgitm_lv,
263 265
             }
264 266
             drug_ids.push(obj)
265 267
           } else if (details[i].project && details[i].project.id > 0 && details[i].project.prescription && details[i].project.prescription.type == 2) { //项目
266 268
             let obj = {
267 269
               id: details[i].project.project_id,
268
-              price: details[i].project.price
270
+              price: details[i].project.price,
271
+              lv: details[i].chrgitm_lv,
269 272
 
270 273
             }
271 274
             project_ids.push(obj)
@@ -283,17 +286,17 @@
283 286
         let new_project_ids = this.unique(project_ids)
284 287
         let list = []
285 288
 
286
-        // console.log('ids')
287
-        // console.log(new_drug_ids)
288
-        // console.log(new_project_ids)
289
-        // console.log('ids')
289
+        console.log('ids')
290
+        console.log(new_drug_ids)
291
+        console.log(new_project_ids)
292
+        console.log('ids')
290 293
 
291 294
         if (new_drug_ids.length > 0 && new_project_ids.length == 0) {
292 295
           for (let i = 0; i < new_drug_ids.length; i++) {
293 296
             let obj = {}
294 297
             let count = 0
295 298
             for (let a = 0; a < details.length; a++) {
296
-              if (new_drug_ids[i].id == details[a].advice.drug_id && new_drug_ids[i].price == details[a].advice.price) {
299
+              if (new_drug_ids[i].id == details[a].advice.drug_id && new_drug_ids[i].price == details[a].advice.price ) {
297 300
                 obj['name'] = details[a].advice.advice_name
298 301
                 // obj['spec'] = details[a].advice.drug.drug_spec
299 302
                 obj['spec'] =   details[a].advice.drug.dose +   details[a].advice.drug.dose_unit+"*" +  details[a].advice.drug.min_number +   details[a].advice.drug.min_unit+"/"+ details[a].advice.drug.max_unit
@@ -344,6 +347,102 @@
344 347
         return list
345 348
 
346 349
       },
350
+      set10265NewData(details) {
351
+        let drug_ids = []
352
+        let project_ids = []
353
+
354
+        for (let i = 0; i < details.length; i++) {
355
+          if (details[i].advice && details[i].advice.id > 0 && details[i].advice.prescription && details[i].advice.prescription.type == 1) { //药品
356
+            let obj = {
357
+              id: details[i].advice.drug_id,
358
+              price: details[i].advice.price,
359
+              lv: details[i].chrgitm_lv,
360
+            }
361
+            drug_ids.push(obj)
362
+          } else if (details[i].project && details[i].project.id > 0 && details[i].project.prescription && details[i].project.prescription.type == 2) { //项目
363
+            let obj = {
364
+              id: details[i].project.project_id,
365
+              price: details[i].project.price,
366
+              lv: details[i].chrgitm_lv,
367
+
368
+            }
369
+            project_ids.push(obj)
370
+
371
+          }
372
+
373
+        }
374
+        //
375
+        // console.log('old ids')
376
+        // console.log(drug_ids)
377
+        // console.log(project_ids)
378
+        // console.log('old ids')
379
+
380
+        let new_drug_ids = this.unique10265(drug_ids)
381
+        let new_project_ids = this.unique10265(project_ids)
382
+        let list = []
383
+
384
+        console.log('ids')
385
+        console.log(new_drug_ids)
386
+        console.log(new_project_ids)
387
+        console.log('ids')
388
+
389
+        if (new_drug_ids.length > 0 && new_project_ids.length == 0) {
390
+          for (let i = 0; i < new_drug_ids.length; i++) {
391
+            let obj = {}
392
+            let count = 0
393
+            for (let a = 0; a < details.length; a++) {
394
+              if (new_drug_ids[i].id == details[a].advice.drug_id && new_drug_ids[i].price == details[a].advice.price && new_drug_ids[i].lv == details[a].chrgitm_lv) {
395
+                obj['name'] = details[a].advice.advice_name
396
+                // obj['spec'] = details[a].advice.drug.drug_spec
397
+                obj['spec'] =   details[a].advice.drug.dose +   details[a].advice.drug.dose_unit+"*" +  details[a].advice.drug.min_number +   details[a].advice.drug.min_unit+"/"+ details[a].advice.drug.max_unit
398
+                obj['unit'] = details[a].advice.drug.max_unit
399
+                obj['medicine_insurance_kind'] = this.getMedicineInsuranceType(details[a].chrgitm_lv)
400
+                obj['med_chrgitm_type'] = this.getType(details[a].med_chrgitm_type)
401
+                obj['price'] = parseFloat(details[a].pric)
402
+                obj['is_total'] = 2
403
+                count = count + details[a].cnt
404
+              }
405
+            }
406
+            obj['count'] = count
407
+            list.push(obj)
408
+          }
409
+        }
410
+
411
+        if (new_drug_ids.length == 0 && new_project_ids.length > 0) {
412
+          for (let i = 0; i < new_project_ids.length; i++) {
413
+            let obj = {}
414
+            let count = 0
415
+            for (let a = 0; a < details.length; a++) {
416
+              if (new_project_ids[i].id == details[a].project.project_id && new_project_ids[i].price == details[a].project.price && new_project_ids[i].lv == details[a].chrgitm_lv) {
417
+                if( details[a].project.type == 2){
418
+                  obj['name'] = details[a].project.project.project_name
419
+                  obj['spec'] = ''
420
+                  obj['unit'] = details[a].project.project.unit
421
+
422
+
423
+                }else if(details[a].project.type == 3){
424
+                  obj['name'] = details[a].project.good_info.good_name
425
+                  obj['spec'] = ''
426
+                  obj['unit'] = details[a].project.good_info.packing_unit
427
+
428
+                }
429
+                obj['medicine_insurance_kind'] = this.getMedicineInsuranceType(details[a].chrgitm_lv)
430
+                obj['med_chrgitm_type'] = this.getType(details[a].med_chrgitm_type)
431
+                obj['price'] = parseFloat(details[a].pric)
432
+                obj['is_total'] = 2
433
+
434
+                count = count + details[a].cnt
435
+              }
436
+            }
437
+            obj['count'] = count
438
+            list.push(obj)
439
+          }
440
+        }
441
+
442
+        return list
443
+
444
+      },
445
+
347 446
       getType(med_chrgitm_type) {
348 447
         switch (med_chrgitm_type) {
349 448
           case '01':
@@ -415,11 +514,12 @@
415 514
 
416 515
             break
417 516
           case "03":
418
-            return '自费'
517
+            return '丙类'
419 518
             break
420 519
 
421 520
         }
422
-      }, unique(array) {
521
+      },
522
+      unique(array) {
423 523
         // res用来存储结果
424 524
         var res = []
425 525
         for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
@@ -435,6 +535,23 @@
435 535
         }
436 536
         return res
437 537
       },
538
+      unique10265(array) {
539
+        // res用来存储结果
540
+        var res = []
541
+        for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
542
+          for (var j = 0, resLen = res.length; j < resLen; j++) {
543
+            if (array[i].id === res[j].id && array[i].price === res[j].price && array[i].lv === res[j].lv) {
544
+              break
545
+            }
546
+          }
547
+          // 如果array[i]是唯一的,那么执行完循环,j等于resLen
548
+          if (j === resLen) {
549
+            res.push(array[i])
550
+          }
551
+        }
552
+        return res
553
+      },
554
+
438 555
       printThisPage() {
439 556
         if(this.org_id != 10106){
440 557
           if(this.org_id == 10215){