Browse Source

合并带嘛

csx 3 years ago
parent
commit
87b5b733d2

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

19
           "
19
           "
20
           :paramsObj="invoiceParams"
20
           :paramsObj="invoiceParams"
21
         ></printOne>
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
         <printThree
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
           :paramsObj="invoiceParams"
25
           :paramsObj="invoiceParams"
26
         ></printThree>
26
         ></printThree>
27
       </div>
27
       </div>

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

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

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

136
                 obj.bingTotal = this.getBingTotal(tempDetails)
136
                 obj.bingTotal = this.getBingTotal(tempDetails)
137
                 obj.otherTotal = this.getOtherTotal(tempDetails)
137
                 obj.otherTotal = this.getOtherTotal(tempDetails)
138
 
138
 
139
-                obj.details = this.setNewData(tempDetails)
139
+                obj.details = this.set10265NewData(tempDetails)
140
                 this.list.push(obj)
140
                 this.list.push(obj)
141
               }
141
               }
142
               console.log(this.list)
142
               console.log(this.list)
251
           total = Number(total) + Number(parseFloat(items[i].cnt) * parseFloat(items[i].pric))
251
           total = Number(total) + Number(parseFloat(items[i].cnt) * parseFloat(items[i].pric))
252
         }
252
         }
253
         return total.toFixed(2)
253
         return total.toFixed(2)
254
-      },setNewData(details) {
254
+      },
255
+      setNewData(details) {
255
         let drug_ids = []
256
         let drug_ids = []
256
         let project_ids = []
257
         let project_ids = []
257
 
258
 
259
           if (details[i].advice && details[i].advice.id > 0 && details[i].advice.prescription && details[i].advice.prescription.type == 1) { //药品
260
           if (details[i].advice && details[i].advice.id > 0 && details[i].advice.prescription && details[i].advice.prescription.type == 1) { //药品
260
             let obj = {
261
             let obj = {
261
               id: details[i].advice.drug_id,
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
             drug_ids.push(obj)
266
             drug_ids.push(obj)
265
           } else if (details[i].project && details[i].project.id > 0 && details[i].project.prescription && details[i].project.prescription.type == 2) { //项目
267
           } else if (details[i].project && details[i].project.id > 0 && details[i].project.prescription && details[i].project.prescription.type == 2) { //项目
266
             let obj = {
268
             let obj = {
267
               id: details[i].project.project_id,
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
             project_ids.push(obj)
274
             project_ids.push(obj)
283
         let new_project_ids = this.unique(project_ids)
286
         let new_project_ids = this.unique(project_ids)
284
         let list = []
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
         if (new_drug_ids.length > 0 && new_project_ids.length == 0) {
294
         if (new_drug_ids.length > 0 && new_project_ids.length == 0) {
292
           for (let i = 0; i < new_drug_ids.length; i++) {
295
           for (let i = 0; i < new_drug_ids.length; i++) {
293
             let obj = {}
296
             let obj = {}
294
             let count = 0
297
             let count = 0
295
             for (let a = 0; a < details.length; a++) {
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
                 obj['name'] = details[a].advice.advice_name
300
                 obj['name'] = details[a].advice.advice_name
298
                 // obj['spec'] = details[a].advice.drug.drug_spec
301
                 // obj['spec'] = details[a].advice.drug.drug_spec
299
                 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
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
         return list
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
       getType(med_chrgitm_type) {
446
       getType(med_chrgitm_type) {
348
         switch (med_chrgitm_type) {
447
         switch (med_chrgitm_type) {
349
           case '01':
448
           case '01':
415
 
514
 
416
             break
515
             break
417
           case "03":
516
           case "03":
418
-            return '自费'
517
+            return '丙类'
419
             break
518
             break
420
 
519
 
421
         }
520
         }
422
-      }, unique(array) {
521
+      },
522
+      unique(array) {
423
         // res用来存储结果
523
         // res用来存储结果
424
         var res = []
524
         var res = []
425
         for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
525
         for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
435
         }
535
         }
436
         return res
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
       printThisPage() {
555
       printThisPage() {
439
         if(this.org_id != 10106){
556
         if(this.org_id != 10106){
440
           if(this.org_id == 10215){
557
           if(this.org_id == 10215){