Browse Source

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

csx 4 years ago
parent
commit
a89b524e86
1 changed files with 196 additions and 68 deletions
  1. 196 68
      src/xt_pages/outpatientCharges/outpatientChargesManagement.vue

+ 196 - 68
src/xt_pages/outpatientCharges/outpatientChargesManagement.vue View File

@@ -5,20 +5,25 @@
5 5
     </div>
6 6
     <div class="app-container" style="display:flex;flex: 1;padding: 10px 20px 0px 20px;">
7 7
       <div class="mainLeft">
8
-         <!-- <div class="mainCell" style="justify-content: space-between;font-size:14px;">
9
-          <p >未收费:<span style="color: red">{{cal_one}}</span>人</p>
10
-          <p>已收费:<span  style="color: red">{{cal_two}}</span>人</p>
11
-          <p>已退费:<span  style="color: red">{{cal_three}}</span>人</p>
12
-        </div> -->
8
+
9
+        <!-- <div class="mainCell" style="justify-content: space-between;font-size:14px;">
10
+         <p >未收费:<span style="color: red">{{cal_one}}</span>人</p>
11
+         <p>已收费:<span  style="color: red">{{cal_two}}</span>人</p>
12
+         <p>已退费:<span  style="color: red">{{cal_three}}</span>人</p>
13
+       </div> -->
13 14
         <div class="mainCell">
14 15
           <el-radio-group v-model="radio" @change="changeRadio">
15 16
             <!-- <el-radio :label=1>未收费</el-radio>
16 17
             <el-radio :label=2>已收费</el-radio>
17 18
             <el-radio :label=3>已退费</el-radio>
18 19
             <el-radio :label=4>全部</el-radio> -->
19
-            <el-radio :label=1>未收费<span style="color: red;margin-bottom:10px;display: inline-block;">{{cal_one}}</span>人</el-radio>
20
-            <el-radio :label=2>已收费<span style="color: red;margin-bottom:10px;display: inline-block;">{{cal_two}}</span>人</el-radio>
21
-            <el-radio :label=3>已退费<span style="color: red;margin-bottom:10px;display: inline-block;">{{cal_three}}</span>人</el-radio>
20
+            <el-radio :label=1>未收费<span style="color: red;margin-bottom:10px;display: inline-block;">{{cal_one}}</span>人
21
+            </el-radio>
22
+            <el-radio :label=2>已收费<span style="color: red;margin-bottom:10px;display: inline-block;">{{cal_two}}</span>人
23
+            </el-radio>
24
+            <el-radio :label=3>已退费<span
25
+              style="color: red;margin-bottom:10px;display: inline-block;">{{cal_three}}</span>人
26
+            </el-radio>
22 27
             <el-radio :label=4>全部</el-radio>
23 28
 
24 29
           </el-radio-group>
@@ -62,6 +67,16 @@
62 67
           <el-button size="small" @click="open(5)" type="primary"
63 68
                      v-if="this.info && this.info.prescription_status == 3">退费
64 69
           </el-button>
70
+
71
+
72
+           <el-button size="small" @click="open(6)" type="primary"
73
+                              >对账
74
+          </el-button>
75
+
76
+
77
+          <el-button size="small" @click="open(7)" type="primary"
78
+                                 >明细对账
79
+          </el-button>
65 80
         </div>
66 81
 
67 82
         <div class="mainCenter">
@@ -227,6 +242,8 @@
227 242
 
228 243
 
229 244
 <script>
245
+  import axios from 'axios'
246
+
230 247
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
231 248
   import noCharge from './components/noCharge'
232 249
   import charged from './components/charged'
@@ -319,56 +336,101 @@
319 336
       this.getPatientList()
320 337
     },
321 338
     methods: {
322
-      chargeConfirm(form){
339
+      chargeConfirm(form) {
323 340
         form['id'] = this.patientInfo.id
324
-        form['record_time'] =  this.record_date
341
+        form['record_time'] = this.record_date
325 342
         this.loadingtwo = true
326
-        upload(form).then(response => {
327
-          if (response.data.state == 0) {
328
-            this.$message.error(response.data.msg)
329
-            this.loadingtwo = false
330
-            this.$refs.charge.hide()
331
-            return false
332
-          } else {
333
-            this.state = '已收费'
334
-            this.$message({message: '收费成功', type: 'success'})
335
-            this.$refs.charge.hide()
336
-            this.loadingtwo = false
337
-            this.cal_one = this.cal_one - 1
338
-            this.cal_two = this.cal_two + 1
339
-            this.patientTableData.splice(this.current_index, 1)
340
-          }
341
-        })
343
+        if (this.$store.getters.xt_user.org_id == 4) {
344
+          axios.get('http://127.0.0.1:9532/api/upload/get', {
345
+            params: form
346
+          })
347
+            .then(function (response) {
348
+              if (response.data.state == 0) {
349
+                this.$message.error(response.data.msg)
350
+                this.loadingtwo = false
351
+                this.$refs.charge.hide()
352
+                return false
353
+              } else {
354
+                this.state = '已收费'
355
+                this.$message({message: '收费成功', type: 'success'})
356
+                this.$refs.charge.hide()
357
+                this.loadingtwo = false
358
+                this.cal_one = this.cal_one - 1
359
+                this.cal_two = this.cal_two + 1
360
+                this.patientTableData.splice(this.current_index, 1)
361
+              }
362
+            })
363
+            .catch(function (error) {
342 364
 
343
-      },chargeCancel(){
365
+            });
366
+        } else {
367
+          upload(form).then(response => {
368
+            if (response.data.state == 0) {
369
+              this.$message.error(response.data.msg)
370
+              this.loadingtwo = false
371
+              this.$refs.charge.hide()
372
+              return false
373
+            } else {
374
+              this.state = '已收费'
375
+              this.$message({message: '收费成功', type: 'success'})
376
+              this.$refs.charge.hide()
377
+              this.loadingtwo = false
378
+              this.cal_one = this.cal_one - 1
379
+              this.cal_two = this.cal_two + 1
380
+              this.patientTableData.splice(this.current_index, 1)
381
+            }
382
+          })
383
+        }
384
+      }, chargeCancel() {
344 385
         this.$refs.charge.hide()
345 386
       },
346 387
       confirm(forms) {
347
-        forms['id'] = this.patientInfo.id,
388
+          forms['id'] = this.patientInfo.id,
348 389
           forms['record_time'] = this.record_date,
349 390
           this.loadingone = true
350
-        register(forms).then(response => {
351
-          if (response.data.state == 0) {
352
-            this.$message.error(response.data.msg)
353
-            this.loadingone = false
354
-            this.$refs.register.hide()
355
-            return false
356
-          } else {
357
-            this.getPatientList()
358
-            this.$message({message: '挂号成功', type: 'success'})
359
-            this.$refs.register.hide()
360
-            this.loadingone = false
361
-            var his_info = response.data.data.his_info
362
-            this.hisPatientInfo = his_info
363
-          }
364
-        })
365 391
 
392
+        if (this.$store.getters.xt_user.org_id == 4) {
393
+          axios.get('http://127.0.0.1:9532/api/register/get', {
394
+            params: forms
395
+          })
396
+            .then(function (response) {
397
+              if (response.data.state == 0) {
398
+                this.$message.error(response.data.msg)
399
+                this.loadingone = false
400
+                this.$refs.register.hide()
401
+                return false
402
+              } else {
403
+                this.getPatientList()
404
+                this.$message({message: '挂号成功', type: 'success'})
405
+                this.$refs.register.hide()
406
+                this.loadingone = false
407
+                var his_info = response.data.data.his_info
408
+                this.hisPatientInfo = his_info
409
+              }
410
+            })
411
+            .catch(function (error) {
366 412
 
367
-      }, cancel() {
413
+            });
414
+        } else {
415
+          register(forms).then(response => {
416
+            if (response.data.state == 0) {
417
+              this.$message.error(response.data.msg)
418
+              this.loadingone = false
419
+              this.$refs.register.hide()
420
+              return false
421
+            } else {
422
+              this.getPatientList()
423
+              this.$message({message: '挂号成功', type: 'success'})
424
+              this.$refs.register.hide()
425
+              this.loadingone = false
426
+              var his_info = response.data.data.his_info
427
+              this.hisPatientInfo = his_info
428
+            }
429
+          })
430
+        }
368 431
 
432
+      }, cancel() {
369 433
         this.$refs.register.hide()
370
-
371
-
372 434
       },
373 435
       addCharges() {
374 436
         this.$refs.additionalCharges.show()
@@ -571,33 +633,78 @@
571 633
           this.$refs.charge.show(this.getTotal())
572 634
 
573 635
 
574
-
575 636
         } else if (index == 5) {
637
+          if (this.$store.getters.xt_user.org_id == 4) {
638
+            this.$confirm('是否退费', '退费', {
639
+              confirmButtonText: '确 定',
640
+              cancelButtonText: '取 消',
641
+              type: 'warning'
642
+            }).then(() => {
643
+              let params = {
644
+                'order_id': this.order.id,
645
+                'number': this.order.number,
646
+                'patient_id': this.patientInfo.id,
647
+                'record_time': this.record_date,
576 648
 
577
-          this.$confirm('是否退费', '退费', {
578
-            confirmButtonText: '确 定',
579
-            cancelButtonText: '取 消',
580
-            type: 'warning'
581
-          }).then(() => {
582
-            let params = {
583
-              'order_id': this.order.id,
584
-              'number': this.order.number,
585
-            }
586
-            Refund(params).then(response => {
587
-              if (response.data.state == 0) {
588
-                this.$message.error(response.data.msg)
589
-                this.loadingtwo = false
590
-                return false
591
-              } else {
592
-                this.$message({message: '退费成功', type: 'success'})
593
-                this.loadingtwo = false
649
+              }
650
+              axios.post('http://127.0.0.1:9532/api/refund/post', {
651
+                params: params
652
+              })
653
+                .then(function (response) {
654
+                  if (response.data.state == 0) {
655
+                    this.$message.error(response.data.msg)
656
+                    this.loadingtwo = false
657
+                    return false
658
+                  } else {
659
+                    this.$message({message: '退费成功', type: 'success'})
660
+                    this.loadingtwo = false
661
+
662
+                  }
663
+                })
664
+                .catch(function (error) {
665
+
666
+                });
667
+
668
+            }).catch(() => {
669
+
670
+            })
671
+
672
+          }else{
673
+
674
+            this.$confirm('是否退费', '退费', {
675
+              confirmButtonText: '确 定',
676
+              cancelButtonText: '取 消',
677
+              type: 'warning'
678
+            }).then(() => {
679
+              let params = {
680
+                'order_id': this.order.id,
681
+                'number': this.order.number,
682
+                'patient_id': this.patientInfo.id,
683
+                'record_time': this.record_date,
594 684
 
595 685
               }
686
+              Refund(params).then(response => {
687
+                if (response.data.state == 0) {
688
+                  this.$message.error(response.data.msg)
689
+                  this.loadingtwo = false
690
+                  return false
691
+                } else {
692
+                  this.$message({message: '退费成功', type: 'success'})
693
+                  this.loadingtwo = false
694
+
695
+                }
696
+              })
697
+
698
+            }).catch(() => {
699
+
596 700
             })
597 701
 
598
-          }).catch(() => {
599 702
 
600
-          })
703
+
704
+          }
705
+
706
+
707
+
601 708
 
602 709
 
603 710
         } else if (index == 6) {
@@ -610,7 +717,27 @@
610 717
           this.$refs.register.show(this.patientInfo)
611 718
 
612 719
 
613
-        }
720
+        }else if (index == 6) {
721
+
722
+            if (this.patientInfo.id == 0) {
723
+               this.$message.error('请先选择要挂号的病人')
724
+               return
725
+            }
726
+
727
+           this.$refs.register.show(this.patientInfo)
728
+
729
+
730
+                 }else if (index == 6) {
731
+
732
+                            if (this.patientInfo.id == 0) {
733
+                              this.$message.error('请先选择要挂号的病人')
734
+                              return
735
+                            }
736
+
737
+                            this.$refs.register.show(this.patientInfo)
738
+
739
+
740
+                          }
614 741
       },
615 742
 
616 743
       choosePatient() {
@@ -894,6 +1021,7 @@
894 1021
       }
895 1022
     },
896 1023
     mounted() {
1024
+      console.log(this.$store.getters.xt_user.org_id)
897 1025
       const that = this
898 1026
       window.onresize = () => {
899 1027
         return (() => {
@@ -992,7 +1120,7 @@
992 1120
   .mainCenter {
993 1121
     display: flex;
994 1122
     flex: 1;
995
-    height:100%;
1123
+    height: 100%;
996 1124
   }
997 1125
 
998 1126
   .costBox {