Browse Source

518合并代码

XMLWAN 2 years ago
parent
commit
35d88d14f8

+ 1 - 1
src/xt_pages/data/components/drugs.vue View File

1199
             if (results[i]['默认给药途径'] === undefined) {
1199
             if (results[i]['默认给药途径'] === undefined) {
1200
                 obj['delivery_way'] = ''
1200
                 obj['delivery_way'] = ''
1201
               } else {
1201
               } else {
1202
-            if (key == '经销商') {
1202
+            if (key == '默认给药途径') {
1203
                 obj['delivery_way'] = results[i][key].replace(/\s/g,"")
1203
                 obj['delivery_way'] = results[i][key].replace(/\s/g,"")
1204
               }
1204
               }
1205
            }
1205
            }

+ 18 - 19
src/xt_pages/dialysis/dialysisDoctorAdvice.vue View File

440
     this.getAllZone();
440
     this.getAllZone();
441
     this.getTemplateInfo();
441
     this.getTemplateInfo();
442
     this.requestSchedualDoctors(this.time)
442
     this.requestSchedualDoctors(this.time)
443
-    // this.template_id = this.$store.getters.xt_user.template_info.template_id;
444
     this.org_id = this.$store.getters.xt_user.template_info.org_id;
443
     this.org_id = this.$store.getters.xt_user.template_info.org_id;
445
   },
444
   },
446
   methods: {
445
   methods: {
470
 
469
 
471
       this.schedulType = scheduleType;
470
       this.schedulType = scheduleType;
472
       this.listQuery.schedul_type = scheduleType;
471
       this.listQuery.schedul_type = scheduleType;
473
-      console.log("班次",this.listQuery.schedul_type)
474
       this.requestSchedualDoctors(this.time);
472
       this.requestSchedualDoctors(this.time);
475
     },
473
     },
476
     selectPartitionType(partitionType) {
474
     selectPartitionType(partitionType) {
477
       this.partitionType = partitionType;
475
       this.partitionType = partitionType;
478
       this.listQuery.partition_type = partitionType;
476
       this.listQuery.partition_type = partitionType;
479
-      console.log("分区",this.listQuery.partition_type)
480
       this.requestSchedualDoctors(this.time);
477
       this.requestSchedualDoctors(this.time);
481
     },
478
     },
482
 
479
 
522
          var schedule_type = this.listQuery.schedul_type
519
          var schedule_type = this.listQuery.schedul_type
523
          var partition_type = this.listQuery.partition_type
520
          var partition_type = this.listQuery.partition_type
524
 
521
 
525
-        console.log("班次",schedule_type,"分区",partition_type)
526
         getSchedualDoctors({date: newTime,patient_type: 0,advice_type: 2,delivery_way:name,schedule_type:schedule_type,partition_type:partition_type,patient_id:this.patient_id}).then(rs => {
522
         getSchedualDoctors({date: newTime,patient_type: 0,advice_type: 2,delivery_way:name,schedule_type:schedule_type,partition_type:partition_type,patient_id:this.patient_id}).then(rs => {
527
         var resp = rs.data
523
         var resp = rs.data
528
         if (resp.state == 1) {
524
         if (resp.state == 1) {
529
             this.admin_users = resp.data.adminUser
525
             this.admin_users = resp.data.adminUser
530
             var schedules = resp.data.scheduals
526
             var schedules = resp.data.scheduals
531
-            console.log("列表数据",schedules)
527
+         
532
             var config = resp.data.config
528
             var config = resp.data.config
533
-            console.log("config222222",config.is_open)
529
+           
534
             let project_config = resp.data.project_config
530
             let project_config = resp.data.project_config
535
-            console.log('project_config',)
531
+            
536
             if(project_config.is_open == 1){
532
             if(project_config.is_open == 1){
537
               this.project = resp.data.project
533
               this.project = resp.data.project
538
               console.log( this.project)
534
               console.log( this.project)
539
              
535
              
540
               let projectArr = []
536
               let projectArr = []
541
-              if(this.org_id !=9671 && this.org_id!= 10318){
537
+              if(this.org_id!= 10318){
542
                 this.project.map(item => {
538
                 this.project.map(item => {
543
                   resp.data.hisAdvices.map(it => {
539
                   resp.data.hisAdvices.map(it => {
544
                     if(item.patient_id == it.patient_id){
540
                     if(item.patient_id == it.patient_id){
546
                     }
542
                     }
547
                   })
543
                   })
548
                 })
544
                 })
549
-               
545
+                 console.log("projexta仍然333232323232",projectArr)
550
                  resp.data.hisAdvices.map((item,index) => {
546
                  resp.data.hisAdvices.map((item,index) => {
551
                   if(projectArr[index].project && projectArr[index].project.length > 0){
547
                   if(projectArr[index].project && projectArr[index].project.length > 0){
552
-                    projectArr[index].project.map(it => {
548
+                     projectArr[index].project.map(it => {
549
+                      console.log("i23323232323我的",it)
553
                       let obj = {
550
                       let obj = {
554
                         advice_doctor: it.doctor,
551
                         advice_doctor: it.doctor,
555
                         start_time:it.start_time,
552
                         start_time:it.start_time,
556
-                        advice_name:it.team_id > 0 && it.is_check_team == 1 ? it.team.project_team : it.type == 2 ? it.project.project_name : it.good_info.good_name,
553
+                        advice_name:it.team_id > 0 && it.is_check_team == 1 ? it.team.project_team : it.type == 2 ? it.project.project_name+' '+it.count + it.project.unit : it.good_info.good_name +' '+it.count+ it.good_info.packing_unit,
557
                         execution_time:it.execution_time,
554
                         execution_time:it.execution_time,
558
                         execution_state:it.execution_state,
555
                         execution_state:it.execution_state,
559
                         execution_staff:it.execution_staff,
556
                         execution_staff:it.execution_staff,
575
                 })
572
                 })
576
               }
573
               }
577
             
574
             
578
-              console.log(projectArr)
575
+              console.log("repso23323233232",resp.data.hisAdvices)
579
 
576
 
580
             }
577
             }
581
-            console.log('resp.data.hisAdvices',resp.data.hisAdvices)
578
+           
582
            if(config.is_open == 0 || config.is_open == 2){
579
            if(config.is_open == 0 || config.is_open == 2){
583
             this.show = true
580
             this.show = true
584
             this.showOne = false
581
             this.showOne = false
602
                     arr.push(it)
599
                     arr.push(it)
603
                 })
600
                 })
604
             })
601
             })
605
-            console.log("班次3333333",this.schedulType)
602
+           
606
             if(this.schedulType == 0){
603
             if(this.schedulType == 0){
607
                 newSchedules = arr
604
                 newSchedules = arr
608
             }else{
605
             }else{
613
                 })
610
                 })
614
             }
611
             }
615
 
612
 
616
-            console.log("分区",this.partitionType)
613
+           
617
             if(this.partitionType == 0){
614
             if(this.partitionType == 0){
618
                 this.scheduleMap = newSchedules
615
                 this.scheduleMap = newSchedules
619
             }else {
616
             }else {
625
                 })
622
                 })
626
                 this.scheduleMap = a
623
                 this.scheduleMap = a
627
             }
624
             }
628
-            console.log("列表22222",this.scheduleMap)
625
+
629
             this.scheduleMap.map(ele => {
626
             this.scheduleMap.map(ele => {
630
                 let firstIndex = this.scheduleMap.findIndex(item => {
627
                 let firstIndex = this.scheduleMap.findIndex(item => {
631
                   return item.patient_id === ele.patient_id   // 当category相同的时候,返回第一个相同的Index 赋值给 firstIndex
628
                   return item.patient_id === ele.patient_id   // 当category相同的时候,返回第一个相同的Index 赋值给 firstIndex
642
             this.indexInfoList = newArr
639
             this.indexInfoList = newArr
643
            }
640
            }
644
            if(config.is_open == 1){
641
            if(config.is_open == 1){
642
+            console.log("进阿里云 2323323223我的")
645
              this.show = false
643
              this.show = false
646
              this.showOne  = true
644
              this.showOne  = true
647
             var schedules =  resp.data.hisAdvices
645
             var schedules =  resp.data.hisAdvices
648
-            console.log("hhhhhhhh22323232323232",schedules)
646
+           
649
             let arr = []
647
             let arr = []
650
             let newArr = []
648
             let newArr = []
651
             let newSchedules = []
649
             let newSchedules = []
688
                 })
686
                 })
689
                 this.scheduleMap = a
687
                 this.scheduleMap = a
690
             }
688
             }
691
-            console.log('333333344444',this.scheduleMap)
689
+ 
692
             this.scheduleMap.map(ele => {
690
             this.scheduleMap.map(ele => {
693
                 let firstIndex = this.scheduleMap.findIndex(item => {
691
                 let firstIndex = this.scheduleMap.findIndex(item => {
694
                   return item.patient_id === ele.patient_id   // 当category相同的时候,返回第一个相同的Index 赋值给 firstIndex
692
                   return item.patient_id === ele.patient_id   // 当category相同的时候,返回第一个相同的Index 赋值给 firstIndex
705
             this.indexInfoList = newArr
703
             this.indexInfoList = newArr
706
            }
704
            }
707
          }
705
          }
708
-         console.log("列表22222",this.indexInfoList)
706
+         
709
         })
707
         })
708
+        
710
     },
709
     },
711
     getValue: function(val) {
710
     getValue: function(val) {
712
       if (val != undefined) {
711
       if (val != undefined) {

+ 26 - 14
src/xt_pages/hospitalStation/components/deskPrescription.vue View File

2425
                             child: [],
2425
                             child: [],
2426
                             sum_count:item.drug.sum_count,
2426
                             sum_count:item.drug.sum_count,
2427
                             out_count:0,
2427
                             out_count:0,
2428
-                            str:item.drug.drug_name + " "+item.drug.dose + item.drug.dose_unit + "*" + item.drug.min_number + item.drug.min_unit+"/"+item.drug.max_unit
2428
+                            str:item.drug.drug_name + " "+item.drug.dose + item.drug.dose_unit + "*" + item.drug.min_number + item.drug.min_unit+"/"+item.drug.max_unit,
2429
+                            is_user:item.drug.is_user,
2429
                           };
2430
                           };
2430
                         }
2431
                         }
2431
                       });
2432
                       });
2453
                       
2454
                       
2454
                       if(newArr.length > 0){
2455
                       if(newArr.length > 0){
2455
                         for(let i=0;i<newArr.length;i++){
2456
                         for(let i=0;i<newArr.length;i++){
2456
-                          if(newArr[i].out_count > newArr[i].sum_count){
2457
-                            this.$message.error(newArr[i].str + "库存不足,保存失败!")
2458
-                            isLoading = false
2459
-                            this.$emit('editKeepLoad', false)
2460
-                            return
2461
-                          }
2457
+                           if(newArr[i].is_user!=1){
2458
+                             if(newArr[i].out_count > newArr[i].sum_count){
2459
+                              this.$message.error(newArr[i].str + "库存不足,保存失败!")
2460
+                              isLoading = false
2461
+                              this.$emit('editKeepLoad', false)
2462
+                              return
2463
+                             }
2464
+                           }
2465
+                       
2462
                         }
2466
                         }
2463
                       }
2467
                       }
2464
                       console.log("newArr",newArr )
2468
                       console.log("newArr",newArr )
2483
                             child: [],
2487
                             child: [],
2484
                             sum_count:item.drug.sum_count,
2488
                             sum_count:item.drug.sum_count,
2485
                             out_count:0,
2489
                             out_count:0,
2486
-                            str:item.drug.drug_name + " "+item.drug.dose + item.drug.dose_unit + "*" + item.drug.min_number + item.drug.min_unit+"/"+item.drug.max_unit
2490
+                            str:item.drug.drug_name + " "+item.drug.dose + item.drug.dose_unit + "*" + item.drug.min_number + item.drug.min_unit+"/"+item.drug.max_unit,
2491
+                            is_user:item.drug.is_user,
2487
                           };
2492
                           };
2488
                         }
2493
                         }
2489
                       });
2494
                       });
2523
                       
2528
                       
2524
                       if(newArr.length > 0){
2529
                       if(newArr.length > 0){
2525
                         for(let i=0;i<newArr.length;i++){
2530
                         for(let i=0;i<newArr.length;i++){
2526
-                          if(newArr[i].out_count > newArr[i].sum_count){
2527
-                            this.$message.error(newArr[i].str + "库存不足,保存失败!")
2528
-                            isLoading = false
2529
-                            this.$emit('editKeepLoad', false)
2530
-                            return
2531
+                          if(newArr[i].is_user!=1){
2532
+                            if(newArr[i].out_count > newArr[i].sum_count){
2533
+                              this.$message.error(newArr[i].str + "库存不足,保存失败!")
2534
+                              isLoading = false
2535
+                              this.$emit('editKeepLoad', false)
2536
+                              return
2537
+                            }
2531
                           }
2538
                           }
2539
+                        
2532
                         }
2540
                         }
2533
                       }
2541
                       }
2534
                       console.log("newArr",newArr )
2542
                       console.log("newArr",newArr )
2913
       //     return
2921
       //     return
2914
       //   }
2922
       //   }
2915
       // }
2923
       // }
2916
-       if (row.sum_count <= 0) {
2924
+    
2925
+      if(row.is_user!=1){
2926
+        if (row.sum_count <= 0) {
2917
           if (selection) {
2927
           if (selection) {
2918
             selection.forEach(row => {
2928
             selection.forEach(row => {
2919
               if (row.sum_count <= 0) {
2929
               if (row.sum_count <= 0) {
2926
           this.$message.error(row.drug_name + '库存不足')
2936
           this.$message.error(row.drug_name + '库存不足')
2927
           return
2937
           return
2928
        }
2938
        }
2939
+      }
2940
+
2929
       this.curDrugs = selection
2941
       this.curDrugs = selection
2930
     },
2942
     },
2931
 
2943
 

+ 20 - 8
src/xt_pages/hospitalStation/components/prescriptionTable.vue View File

462
         }
462
         }
463
         if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
463
         if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
464
           // scope.row.retail_price = scope.row.drug.min_number / scope.row.retail_price
464
           // scope.row.retail_price = scope.row.drug.min_number / scope.row.retail_price
465
-          if (scope.row.prescribing_number > scope.row.drug.sum_count) {
466
-            this.$message.error(scope.row.drug_name + '库存不足')
465
+          if(scope.row.drug.is_user!=1){
466
+            if (scope.row.prescribing_number > scope.row.drug.sum_count) {
467
+              this.$message.error(scope.row.drug_name + '库存不足')
468
+            }
467
           }
469
           }
470
+         
468
         } else {
471
         } else {
469
-          if ((parseInt(scope.row.prescribing_number) * scope.row.drug.min_number) > scope.row.drug.sum_count) {
470
-            this.$message.error(scope.row.drug_name + '库存不足')
472
+          if(scope.row.drug.is_user!=1){
473
+            if ((parseInt(scope.row.prescribing_number) * scope.row.drug.min_number) > scope.row.drug.sum_count) {
474
+              this.$message.error(scope.row.drug_name + '库存不足')
475
+            }
471
           }
476
           }
477
+        
472
           // scope.row.retail_price = scope.row.drug.retail_price * scope.row.prescribing_number
478
           // scope.row.retail_price = scope.row.drug.retail_price * scope.row.prescribing_number
473
         }
479
         }
474
 
480
 
506
       },
512
       },
507
       changePrescribingNumber(scope) {
513
       changePrescribingNumber(scope) {
508
         if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
514
         if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
509
-          if (parseInt(scope.row.prescribing_number) > scope.row.drug.sum_count) {
510
-            this.$message.error(scope.row.drug_name + '库存不足')
515
+          if(scope.row.drug.is_user!=1){
516
+           if (parseInt(scope.row.prescribing_number) > scope.row.drug.sum_count) {
517
+              this.$message.error(scope.row.drug_name + '库存不足')
518
+           }
511
           }
519
           }
520
+        
512
         } else {
521
         } else {
513
-          if ((parseInt(scope.row.prescribing_number) * scope.row.drug.min_number) > scope.row.drug.sum_count) {
514
-            this.$message.error(scope.row.drug_name + '库存不足')
522
+          if(scope.row.drug.is_user!=1){
523
+            if ((parseInt(scope.row.prescribing_number) * scope.row.drug.min_number) > scope.row.drug.sum_count) {
524
+              this.$message.error(scope.row.drug_name + '库存不足')
525
+            }
515
           }
526
           }
527
+         
516
         }
528
         }
517
       },
529
       },
518
       getProjectSingleDose(scope) {
530
       getProjectSingleDose(scope) {

+ 24 - 16
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue View File

2429
                             sum_count:item.drug.sum_count,
2429
                             sum_count:item.drug.sum_count,
2430
                             out_count:0,
2430
                             out_count:0,
2431
                             str:item.drug.drug_name + " "+item.drug.dose + item.drug.dose_unit + "*" + item.drug.min_number + item.drug.min_unit+"/"+item.drug.max_unit,
2431
                             str:item.drug.drug_name + " "+item.drug.dose + item.drug.dose_unit + "*" + item.drug.min_number + item.drug.min_unit+"/"+item.drug.max_unit,
2432
-
2432
+                            is_user:item.drug.is_user,
2433
                           };
2433
                           };
2434
                         }
2434
                         }
2435
                       });
2435
                       });
2469
                       
2469
                       
2470
                       if(newArr.length > 0){
2470
                       if(newArr.length > 0){
2471
                         for(let i=0;i<newArr.length;i++){
2471
                         for(let i=0;i<newArr.length;i++){
2472
-                          if(newArr[i].out_count > newArr[i].sum_count){
2473
-                            this.$message.error(newArr[i].str + "库存不足,保存失败!")
2474
-                            isLoading = false
2475
-                            this.$emit('editKeepLoad', false)
2476
-                            return
2472
+                          if(newArr[i].is_user!=1){
2473
+                            if(newArr[i].out_count > newArr[i].sum_count){
2474
+                              this.$message.error(newArr[i].str + "库存不足,保存失败!")
2475
+                              isLoading = false
2476
+                              this.$emit('editKeepLoad', false)
2477
+                              return
2478
+                            }
2477
                           }
2479
                           }
2480
+                         
2478
                         }
2481
                         }
2479
                       }
2482
                       }
2480
                       console.log("newArr",newArr )
2483
                       console.log("newArr",newArr )
2499
                             child: [],
2502
                             child: [],
2500
                             sum_count:item.drug.sum_count,
2503
                             sum_count:item.drug.sum_count,
2501
                             out_count:0,
2504
                             out_count:0,
2502
-                            str:item.drug.drug_name + " "+item.drug.dose + item.drug.dose_unit + "*" + item.drug.min_number + item.drug.min_unit+"/"+item.drug.max_unit
2505
+                            str:item.drug.drug_name + " "+item.drug.dose + item.drug.dose_unit + "*" + item.drug.min_number + item.drug.min_unit+"/"+item.drug.max_unit,
2506
+                            is_user:item.drug.is_user,
2503
                           };
2507
                           };
2504
                         }
2508
                         }
2505
                       });
2509
                       });
2527
                       console.log("new233223322323",newArr)
2531
                       console.log("new233223322323",newArr)
2528
                       if(newArr.length > 0){
2532
                       if(newArr.length > 0){
2529
                         for(let i=0;i<newArr.length;i++){
2533
                         for(let i=0;i<newArr.length;i++){
2530
-                          if(newArr[i].out_count > newArr[i].sum_count){
2531
-                            this.$message.error(newArr[i].str + "库存不足,保存失败!")
2532
-                            isLoading = false
2533
-                            this.$emit('editKeepLoad', false)
2534
-                            return
2534
+                          if(newArr[i].is_user!=1){
2535
+                            if(newArr[i].out_count > newArr[i].sum_count){
2536
+                              this.$message.error(newArr[i].str + "库存不足,保存失败!")
2537
+                              isLoading = false
2538
+                              this.$emit('editKeepLoad', false)
2539
+                              return
2540
+                            }
2535
                           }
2541
                           }
2542
+                        
2536
                         }
2543
                         }
2537
                       }
2544
                       }
2538
                       console.log("newArr",newArr )
2545
                       console.log("newArr",newArr )
2895
         this.$refs.additionalCharges.show()
2902
         this.$refs.additionalCharges.show()
2896
       },
2903
       },
2897
       selectDrugs(selection, row) {
2904
       selectDrugs(selection, row) {
2898
-        //console.log("row233232233232",row)
2905
+        console.log("row233232233232",row)
2899
         // if(this.org_id == 10138 || this.org_id == 9671 || this.org_id == 9675 || this.org_id == 4 || this.org_id == 3877 || this.org_id == 10028 || this.org_id == 10243 || this.org_id == 10188 || this.org_id == 10245 || this.org_id == 9919 || this.org_id == 10106 || this.org_id == 9504 || this.org_id ==10215 || this.org_id == 10188 || this.org_id == 10265 || this.org_id == 10164 || this.org_id == 9956 || this.org_id == 10188 || this.org_id == 10191 || this.org_id == 10278 || this.org_id == 10217 || this.org_id ==10210 || this.org_id ==10318 || this.org_id ==10340){
2906
         // if(this.org_id == 10138 || this.org_id == 9671 || this.org_id == 9675 || this.org_id == 4 || this.org_id == 3877 || this.org_id == 10028 || this.org_id == 10243 || this.org_id == 10188 || this.org_id == 10245 || this.org_id == 9919 || this.org_id == 10106 || this.org_id == 9504 || this.org_id ==10215 || this.org_id == 10188 || this.org_id == 10265 || this.org_id == 10164 || this.org_id == 9956 || this.org_id == 10188 || this.org_id == 10191 || this.org_id == 10278 || this.org_id == 10217 || this.org_id ==10210 || this.org_id ==10318 || this.org_id ==10340){
2900
         //     if (row.count <= 0) {
2907
         //     if (row.count <= 0) {
2901
         //       if (selection) {
2908
         //       if (selection) {
2925
         //       return
2932
         //       return
2926
         //     }
2933
         //     }
2927
         // }
2934
         // }
2928
-
2929
-        if (row.sum_count <= 0) {
2935
+        
2936
+        if(row.is_user!=1){
2937
+          if (row.sum_count <= 0) {
2930
           if (selection) {
2938
           if (selection) {
2931
             selection.forEach(row => {
2939
             selection.forEach(row => {
2932
               if (row.sum_count <= 0) {
2940
               if (row.sum_count <= 0) {
2939
           this.$message.error(row.drug_name + '库存不足')
2947
           this.$message.error(row.drug_name + '库存不足')
2940
           return
2948
           return
2941
          }
2949
          }
2942
-
2950
+        }
2943
         this.curDrugs = selection
2951
         this.curDrugs = selection
2944
       },
2952
       },
2945
 
2953
 

+ 19 - 6
src/xt_pages/outpatientDoctorStation/components/prescriptionTable.vue View File

432
 
432
 
433
       },
433
       },
434
       getAllChange(scope) {
434
       getAllChange(scope) {
435
+        console.log("scope23322332233232",scope)
435
         if (scope.row.drug.min_unit == scope.row.single_dose_unit) {
436
         if (scope.row.drug.min_unit == scope.row.single_dose_unit) {
436
           if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
437
           if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
437
             console.log(1)
438
             console.log(1)
454
         }
455
         }
455
         if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
456
         if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
456
           // scope.row.retail_price = scope.row.drug.min_number / scope.row.retail_price
457
           // scope.row.retail_price = scope.row.drug.min_number / scope.row.retail_price
457
-          if (scope.row.prescribing_number > scope.row.drug.sum_count) {
458
+          if(scope.row.drug.is_user!=1){
459
+           if (scope.row.prescribing_number > scope.row.drug.sum_count) {
458
             this.$message.error(scope.row.drug_name + '库存不足')
460
             this.$message.error(scope.row.drug_name + '库存不足')
461
+           }
459
           }
462
           }
463
+         
460
         } else {
464
         } else {
461
-          if ((parseInt(scope.row.prescribing_number) * scope.row.drug.min_number) > scope.row.drug.sum_count) {
465
+          if(scope.row.drug.is_user!=1){
466
+           if ((parseInt(scope.row.prescribing_number) * scope.row.drug.min_number) > scope.row.drug.sum_count) {
462
             this.$message.error(scope.row.drug_name + '库存不足')
467
             this.$message.error(scope.row.drug_name + '库存不足')
468
+           }
463
           }
469
           }
470
+         
464
           // scope.row.retail_price = scope.row.drug.retail_price * scope.row.prescribing_number
471
           // scope.row.retail_price = scope.row.drug.retail_price * scope.row.prescribing_number
465
         }
472
         }
466
 
473
 
548
 
555
 
549
 
556
 
550
         if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
557
         if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
551
-          if (parseInt(scope.row.prescribing_number) > scope.row.drug.sum_count) {
552
-            this.$message.error(scope.row.drug_name + '库存不足')
558
+          if(scope.row.drug.is_user!=1){
559
+            if (parseInt(scope.row.prescribing_number) > scope.row.drug.sum_count) {
560
+              this.$message.error(scope.row.drug_name + '库存不足')
561
+            }
553
           }
562
           }
563
+       
554
         } else {
564
         } else {
555
-          if ((parseInt(scope.row.prescribing_number) * scope.row.drug.min_number) > scope.row.drug.sum_count) {
556
-            this.$message.error(scope.row.drug_name + '库存不足')
565
+          if(scope.row.drug.is_user!=1){
566
+            if ((parseInt(scope.row.prescribing_number) * scope.row.drug.min_number) > scope.row.drug.sum_count) {
567
+              this.$message.error(scope.row.drug_name + '库存不足')
568
+            }
557
           }
569
           }
570
+        
558
         }
571
         }
559
       },
572
       },
560
       getProjectSingleDose(scope) {
573
       getProjectSingleDose(scope) {

+ 17 - 4
src/xt_pages/outpatientTool/components/detailStatistics.vue View File

168
       <div>总费用:{{ getAllPice() }}</div>
168
       <div>总费用:{{ getAllPice() }}</div>
169
       <div>
169
       <div>
170
         个人支付: 
170
         个人支付: 
171
-       
172
-        <span v-if="his_patient.balance_accounts_type == 2">{{ getAllPice() }}</span>  
173
-        <span v-if="his_patient.balance_accounts_type != 2">{{ getActPay() }}</span>
171
+        {{getActPay()}}
172
+        <!-- <span v-if="his_patient.balance_accounts_type == 2">{{ getAllPice() }}</span>  
173
+        <span v-if="his_patient.balance_accounts_type != 2">{{ getActPay() }}</span> -->
174
       
174
       
175
       </div>
175
       </div>
176
       <div>基金支付记账:{{ getFundPaySumamt() }}</div>
176
       <div>基金支付记账:{{ getFundPaySumamt() }}</div>
444
       return total_price.toFixed(2);
444
       return total_price.toFixed(2);
445
     },
445
     },
446
     getActPay() {
446
     getActPay() {
447
+      var arrNew = []
447
       var act_pay = 0;
448
       var act_pay = 0;
448
       for (let i = 0; i < this.list.length; i++) {
449
       for (let i = 0; i < this.list.length; i++) {
449
         for (let j = 0; j < this.list[i].orders.length; j++) {
450
         for (let j = 0; j < this.list[i].orders.length; j++) {
450
-          act_pay += this.list[i].orders[j].psn_cash_pay;
451
+          //个人支付
452
+          console.log("is",this.list[i].orders[j])
453
+          if(this.list[i].orders[j].is_medicine_insurance == 0){
454
+             arrNew.push(this.list[i].orders[j])
455
+          }
456
+        }
457
+      }
458
+      if(arrNew.length > 0){
459
+        for(let i=0;i<arrNew.length;i++){
460
+           for(let j=0;j<arrNew[i].order_info.length;j++){
461
+             act_pay += arrNew[i].order_info[j].cnt * arrNew[i].order_info[j].pric
462
+           }
451
         }
463
         }
452
       }
464
       }
465
+      console.log("arrNew2332323223",arrNew)
453
       return act_pay.toFixed(2);
466
       return act_pay.toFixed(2);
454
     },
467
     },
455
     getFundPaySumamt() {
468
     getFundPaySumamt() {

+ 31 - 18
src/xt_pages/outpatientTool/detailPrint.vue View File

19
             <td>患者姓名:{{ patient.name }}</td>
19
             <td>患者姓名:{{ patient.name }}</td>
20
             <td>性别:{{ patient.gender == 1 ? "男" : "女" }}</td>
20
             <td>性别:{{ patient.gender == 1 ? "男" : "女" }}</td>
21
             <td>结算类别:
21
             <td>结算类别:
22
-          <!-- {{ getType(his_patient.balance_accounts_type) }} -->
23
-          {{getType(his_record_patient.balance_accounts_type)}}</td>
22
+            <span v-if="his_patient!=null&&his_patient.balance_accounts_type >0"> {{ getType(his_patient.balance_accounts_type) }} </span>
23
+            <span v-if="his_record_patient!=null&&his_record_patient.balance_accounts_type >0">{{getType(his_record_patient.balance_accounts_type)}}</span></td>
24
             <td>发票号码:{{order.fa_piao_number}}</td>
24
             <td>发票号码:{{order.fa_piao_number}}</td>
25
           </tr>
25
           </tr>
26
           <tr>
26
           <tr>
27
             <td>住院/门诊号:
27
             <td>住院/门诊号:
28
-          <!-- {{his_patient.number}} -->
29
-          {{his_record_patient.ipt_otp_no}}</td>
28
+          <span v-if="his_patient!=null && his_patient.number!=''">{{his_patient.number}}</span>
29
+          <span v-if="his_record_patient!=null && his_record_patient.ipt_otp_no!=''">{{his_record_patient.ipt_otp_no}}</span></td>
30
             <td>科室:
30
             <td>科室:
31
-          <!-- {{ getDepartment(his_patient.departments) }} -->
32
-          {{ getDepartment(his_record_patient.departments) }}</td>
31
+          <span v-if="his_patient!=null && his_patient.departments >0"> {{ getDepartment(his_patient.departments) }}</span> 
32
+          <span v-if="his_record_patient!=null && his_record_patient.departments > 0">{{ getDepartment(his_record_patient.departments) }}</span></td>
33
             <td>就诊流水号:
33
             <td>就诊流水号:
34
-          <!-- {{ his_patient.number }} -->
35
-          {{his_record_patient.number}}</td>
34
+          <span v-if="his_patient!=null && his_patient.number!=''"> {{ his_patient.number }}</span>
35
+          <span v-if="his_record_patient!=null && his_record_patient.number!=''">{{his_record_patient.number}}</span></td>
36
           </tr>
36
           </tr>
37
           <tr>
37
           <tr>
38
             <td>总费用:{{ getAllPice() }}</td>
38
             <td>总费用:{{ getAllPice() }}</td>
39
             <td>个人支付:
39
             <td>个人支付:
40
-          <!-- <span v-if="this.$route.query.balance_accounts_type == 2 && his_patient.id >0">{{ getAllPice() }}</span>
41
-          <span v-if="this.$route.query.balance_accounts_type != 2 && his_patient.id >0">{{ getActPay() }}</span> -->
42
-          
43
-          <span v-if="his_record_patient.balance_accounts_type == 2">{{ getAllPice() }}</span>
44
-          <span v-if="his_record_patient.balance_accounts_type != 2">{{ getActPay() }}</span>
40
+             {{getActPay()}}
41
+            <!-- <span v-if="his_record_patient.balance_accounts_type == 2">{{ getAllPice() }}</span>
42
+            <span v-if="his_record_patient.balance_accounts_type != 2">{{ getActPay() }}</span> -->
45
             </td>
43
             </td>
46
             <td>基金支付记账:{{ getFundPaySumamt() }}</td>
44
             <td>基金支付记账:{{ getFundPaySumamt() }}</td>
47
             <td>补充医疗支付记账:{{ getHifesPay() }}</td>
45
             <td>补充医疗支付记账:{{ getHifesPay() }}</td>
394
       }
392
       }
395
       return total_price;
393
       return total_price;
396
     },
394
     },
397
-    getActPay(){
398
-      var act_pay = 0
399
-      for(let i=0;i<this.orderList.length;i++){
400
-         act_pay += this.orderList[i].psn_part_amt
395
+    getActPay() {
396
+      var arrNew = []
397
+      var act_pay = 0;
398
+      for (let i = 0; i < this.list.length; i++) {
399
+        for (let j = 0; j < this.list[i].orders.length; j++) {
400
+          //个人支付
401
+          console.log("is",this.list[i].orders[j])
402
+          if(this.list[i].orders[j].is_medicine_insurance == 0){
403
+             arrNew.push(this.list[i].orders[j])
404
+          }
405
+        }
406
+      }
407
+      if(arrNew.length > 0){
408
+        for(let i=0;i<arrNew.length;i++){
409
+           for(let j=0;j<arrNew[i].order_info.length;j++){
410
+             act_pay += arrNew[i].order_info[j].cnt * arrNew[i].order_info[j].pric
411
+           }
412
+        }
401
       }
413
       }
402
-      return act_pay.toFixed(2)
414
+      console.log("arrNew2332323223",arrNew)
415
+      return act_pay.toFixed(2);
403
     },
416
     },
404
     getFundPaySumamt() {
417
     getFundPaySumamt() {
405
       var fund_pay_sumamt = 0;
418
       var fund_pay_sumamt = 0;

+ 36 - 10
src/xt_pages/outpatientTool/gatherPrint.vue View File

53
         <div class="listInfo" style="margin-bottom: 20px;">
53
         <div class="listInfo" style="margin-bottom: 20px;">
54
             <div>记账支付:{{getFundPaySumamt()}}</div>
54
             <div>记账支付:{{getFundPaySumamt()}}</div>
55
             <div>个人账号:{{getAcctPay()}}</div>
55
             <div>个人账号:{{getAcctPay()}}</div>
56
-            <div>现金支付:{{getPsnCashPay()}}</div>
56
+            <div>现金支付:{{getActPay()}}</div>
57
         </div>
57
         </div>
58
         <table class="listTable" border="1">
58
         <table class="listTable" border="1">
59
             <tr>
59
             <tr>
145
           his_record_patient:{},
145
           his_record_patient:{},
146
           orderList:[],
146
           orderList:[],
147
           org_id:0,
147
           org_id:0,
148
+          list:[],
148
         }
149
         }
149
     },
150
     },
150
     methods:{
151
     methods:{
195
           this.drugTypeList =response.data.data.drugTypeList
196
           this.drugTypeList =response.data.data.drugTypeList
196
           this.costClassifyList = response.data.data.costClassifyList 
197
           this.costClassifyList = response.data.data.costClassifyList 
197
           var list = response.data.data.list
198
           var list = response.data.data.list
199
+          this.list = list
198
           this.orderList = response.data.data.orderList
200
           this.orderList = response.data.data.orderList
199
-
201
+          console.log("orderlist23323223",this.orderList)
200
           var new_arr = []
202
           var new_arr = []
201
 
203
 
202
           for(let i=0;i<list.length;i++){
204
           for(let i=0;i<list.length;i++){
659
       if(total_price > 0){
661
       if(total_price > 0){
660
         return total_price.toFixed(2)
662
         return total_price.toFixed(2)
661
       }else{
663
       }else{
662
-        return total_price
664
+        return "0.00"
663
       }
665
       }
664
      
666
      
665
     },
667
     },
1080
       }
1082
       }
1081
     },
1083
     },
1082
     getPsnCashPay(){
1084
     getPsnCashPay(){
1083
-      var psn_cash_pay = 0
1085
+      var psn_cash_pay = 0.00
1084
       for(let i=0;i<this.orderList.length;i++){
1086
       for(let i=0;i<this.orderList.length;i++){
1085
         psn_cash_pay += this.orderList[i].psn_cash_pay
1087
         psn_cash_pay += this.orderList[i].psn_cash_pay
1086
       }
1088
       }
1087
       if(psn_cash_pay > 0){
1089
       if(psn_cash_pay > 0){
1088
          return psn_cash_pay.toFixed(2)
1090
          return psn_cash_pay.toFixed(2)
1089
       }else{
1091
       }else{
1090
-        return 0.00
1092
+        return "0.00"
1091
       }
1093
       }
1092
     },
1094
     },
1093
     getAcctPay(){
1095
     getAcctPay(){
1094
-      var acct_pay = 0
1096
+      var acct_pay = 0.00
1095
       for(let i=0;i<this.orderList.length;i++){
1097
       for(let i=0;i<this.orderList.length;i++){
1096
          acct_pay +=this.orderList[i].acct_pay
1098
          acct_pay +=this.orderList[i].acct_pay
1097
       }
1099
       }
1098
       if(acct_pay > 0){
1100
       if(acct_pay > 0){
1099
         return acct_pay.toFixed(2)
1101
         return acct_pay.toFixed(2)
1100
       }else{
1102
       }else{
1101
-        return 0.00
1103
+        return "0.00"
1102
       }
1104
       }
1103
     },
1105
     },
1104
     getFundPaySumamt(){
1106
     getFundPaySumamt(){
1105
-      var fund_pay_sumamt = 0
1107
+      var fund_pay_sumamt = 0.00
1106
       for(let i=0;i<this.orderList.length;i++){
1108
       for(let i=0;i<this.orderList.length;i++){
1107
         fund_pay_sumamt +=this.orderList[i].fund_pay_sumamt
1109
         fund_pay_sumamt +=this.orderList[i].fund_pay_sumamt
1108
       }
1110
       }
1111
+     
1109
       if(fund_pay_sumamt >0){
1112
       if(fund_pay_sumamt >0){
1110
         return fund_pay_sumamt.toFixed(2)
1113
         return fund_pay_sumamt.toFixed(2)
1111
       }else{
1114
       }else{
1112
-        return 0.00
1115
+      
1116
+        return "0.00"
1113
       }
1117
       }
1114
-    }
1118
+    },
1119
+    getActPay() {
1120
+      var arrNew = []
1121
+      var act_pay = 0;
1122
+      for (let i = 0; i < this.list.length; i++) {
1123
+        for (let j = 0; j < this.list[i].orders.length; j++) {
1124
+          //个人支付
1125
+          console.log("is",this.list[i].orders[j])
1126
+          if(this.list[i].orders[j].is_medicine_insurance == 0){
1127
+             arrNew.push(this.list[i].orders[j])
1128
+          }
1129
+        }
1130
+      }
1131
+      if(arrNew.length > 0){
1132
+        for(let i=0;i<arrNew.length;i++){
1133
+           for(let j=0;j<arrNew[i].order_info.length;j++){
1134
+             act_pay += arrNew[i].order_info[j].cnt * arrNew[i].order_info[j].pric
1135
+           }
1136
+        }
1137
+      }
1138
+      console.log("arrNew2332323223",arrNew)
1139
+      return act_pay.toFixed(2);
1140
+    },
1115
 
1141
 
1116
     },
1142
     },
1117
     created(){
1143
     created(){

+ 5 - 2
src/xt_pages/stock/detail/stockOutDetail.vue View File

768
       },
768
       },
769
 
769
 
770
     exportList(){
770
     exportList(){
771
+      console.log("shij232333",this.tableOut)
772
+     
771
        for(let i=0;i<this.tableOut.length;i++){
773
        for(let i=0;i<this.tableOut.length;i++){
772
         this.tableOut[i].index = i+1
774
         this.tableOut[i].index = i+1
773
         this.tableOut[i].good_name = this.tableOut[i].good_name
775
         this.tableOut[i].good_name = this.tableOut[i].good_name
774
         this.tableOut[i].specification_name = this.tableOut[i].specification_name
776
         this.tableOut[i].specification_name = this.tableOut[i].specification_name
775
         this.tableOut[i].packing_unit = this.tableOut[i].packing_unit
777
         this.tableOut[i].packing_unit = this.tableOut[i].packing_unit
778
+        this.tableOut[i].ctime = this.getTime(this.tableOut[i].ctime)
776
         if(this.orgId == 9919){
779
         if(this.orgId == 9919){
777
           this.tableOut[i].total_price = (this.tableOut[i].count * this.tableOut[i].buy_price).toFixed(2)
780
           this.tableOut[i].total_price = (this.tableOut[i].count * this.tableOut[i].buy_price).toFixed(2)
778
           this.tableOut[i].packing_price = this.tableOut[i].buy_price
781
           this.tableOut[i].packing_price = this.tableOut[i].buy_price
809
         }
812
         }
810
        }
813
        }
811
        import('@/vendor/Export2Excel').then(excel => {
814
        import('@/vendor/Export2Excel').then(excel => {
812
-       const tHeader = ['序号','耗材名称', '规格型号', '单位','数量','出货价','总价','备注']
815
+       const tHeader = ['序号','耗材名称', '规格型号', '单位','数量','出货价','总价','出库时间','备注']
813
 
816
 
814
-       const filterVal = ['index','good_name', 'specification_name', 'packing_unit','out_count','packing_price','total_price','remark']
817
+       const filterVal = ['index','good_name', 'specification_name', 'packing_unit','out_count','packing_price','total_price','ctime','remark']
815
 
818
 
816
        const data = this.formatJson(filterVal, this.tableOut)
819
        const data = this.formatJson(filterVal, this.tableOut)
817
 
820
 

+ 7 - 3
src/xt_pages/stock/drugs/components/drugOutDetail.vue View File

570
     },
570
     },
571
 
571
 
572
      exportList(){
572
      exportList(){
573
-
573
+      
574
         for(let i=0;i<this.tablePrint.length;i++){
574
         for(let i=0;i<this.tablePrint.length;i++){
575
           this.tablePrint[i].index = i+1
575
           this.tablePrint[i].index = i+1
576
+          this.tablePrint[i].ctime = this.getTime(this.tablePrint[i].ctime)
576
         }
577
         }
577
         for(let i=0;i<this.tablePrint.length;i++){
578
         for(let i=0;i<this.tablePrint.length;i++){
578
            if(this.org_id == 9919){
579
            if(this.org_id == 9919){
591
 
592
 
592
 
593
 
593
        import('@/vendor/Export2Excel').then(excel => {
594
        import('@/vendor/Export2Excel').then(excel => {
594
-       const tHeader = ['序号','药品名称', '规格型号', '单位','数量','单价','总价','备注']
595
-       const filterVal = ['index','drug_name', 'unit', 'min_unit','count','min_price','total_price','remark']
595
+       const tHeader = ['序号','药品名称', '规格型号', '单位','数量','单价','总价','出库时间','备注']
596
+       const filterVal = ['index','drug_name', 'unit', 'min_unit','count','min_price','total_price','ctime','remark']
596
        let obj = {'index':'合计','total_price':0.00}
597
        let obj = {'index':'合计','total_price':0.00}
597
        for(let i=0;i<this.tablePrint.length;i++){
598
        for(let i=0;i<this.tablePrint.length;i++){
598
          obj.total_price += this.tablePrint[i].total
599
          obj.total_price += this.tablePrint[i].total
701
      getDrugOutOrderPrint(params).then(response=>{
702
      getDrugOutOrderPrint(params).then(response=>{
702
         if(response.data.state == 1){
703
         if(response.data.state == 1){
703
             var list = response.data.data.list
704
             var list = response.data.data.list
705
+         
704
             let objInfo = {}
706
             let objInfo = {}
705
             if(this.org_id == 9919){
707
             if(this.org_id == 9919){
706
               list.forEach((item,index)=>{
708
               list.forEach((item,index)=>{
721
                   min_number:item.XtBaseDrug.min_number,
723
                   min_number:item.XtBaseDrug.min_number,
722
                   max_unit:item.XtBaseDrug.max_unit,
724
                   max_unit:item.XtBaseDrug.max_unit,
723
                   min_price:item.XtBaseDrug.min_price,
725
                   min_price:item.XtBaseDrug.min_price,
726
+                  ctime:item.ctime,
724
                 }
727
                 }
725
               }
728
               }
726
              })
729
              })
743
                   min_number:item.XtBaseDrug.min_number,
746
                   min_number:item.XtBaseDrug.min_number,
744
                   max_unit:item.XtBaseDrug.max_unit,
747
                   max_unit:item.XtBaseDrug.max_unit,
745
                   min_price:item.XtBaseDrug.min_price,
748
                   min_price:item.XtBaseDrug.min_price,
749
+                  ctime:item.ctime,
746
                 }
750
                 }
747
               }
751
               }
748
             })
752
             })

+ 5 - 0
src/xt_pages/stock/drugs/drugBatchNumber.vue View File

104
             {{ scope.row.price }}
104
             {{ scope.row.price }}
105
           </template>
105
           </template>
106
         </el-table-column>
106
         </el-table-column>
107
+         <el-table-column prop="remake" label="备注" align="center">
108
+          <template slot-scope="scope">
109
+            {{ scope.row.remark }}
110
+          </template>
111
+        </el-table-column>
107
       </el-table>
112
       </el-table>
108
 
113
 
109
       <el-pagination
114
       <el-pagination

+ 1 - 0
src/xt_pages/stock/drugs/drugDamaged.vue View File

273
             min_price:0,
273
             min_price:0,
274
             drug_id:0,
274
             drug_id:0,
275
             storehouse_id:0,
275
             storehouse_id:0,
276
+            houseList:[],
276
         }
277
         }
277
     },
278
     },
278
     methods:{
279
     methods:{

+ 6 - 2
src/xt_pages/stock/drugs/drugStockOutOrder.vue View File

1404
       getExportOutOrderDrugList(params).then((response) => {
1404
       getExportOutOrderDrugList(params).then((response) => {
1405
         if (response.data.state == 1) {
1405
         if (response.data.state == 1) {
1406
           var list = response.data.data.list;
1406
           var list = response.data.data.list;
1407
-          // console.log("list22222", list);
1407
+        
1408
           this.exportList = list;
1408
           this.exportList = list;
1409
           this.manufacturerList = response.data.data.manufacturerList;
1409
           this.manufacturerList = response.data.data.manufacturerList;
1410
           this.dealerList = response.data.data.dealerList;
1410
           this.dealerList = response.data.data.dealerList;
1412
       });
1412
       });
1413
     },
1413
     },
1414
     toExport() {
1414
     toExport() {
1415
+     
1415
       if (this.order_id == "") {
1416
       if (this.order_id == "") {
1416
         this.$message.error("请勾选出库单");
1417
         this.$message.error("请勾选出库单");
1417
         return;
1418
         return;
1418
       }
1419
       }
1419
-      // console.log("hh2323232322323", this.exportList);
1420
+     
1420
       for (let i = 0; i < this.exportList.length; i++) {
1421
       for (let i = 0; i < this.exportList.length; i++) {
1421
         if (this.exportList[i].dealer == 0) {
1422
         if (this.exportList[i].dealer == 0) {
1422
           this.exportList[i].dealer = "";
1423
           this.exportList[i].dealer = "";
1454
             this.exportList[i].dealer = this.dealerList[z].dealer_name;
1455
             this.exportList[i].dealer = this.dealerList[z].dealer_name;
1455
           }
1456
           }
1456
         }
1457
         }
1458
+        this.exportList[i].ctime = this.getTime(this.exportList[i].ctime)
1457
       }
1459
       }
1458
 
1460
 
1459
       import("@/vendor/Export2Excel").then((excel) => {
1461
       import("@/vendor/Export2Excel").then((excel) => {
1478
           "有效日期",
1480
           "有效日期",
1479
           "经销商",
1481
           "经销商",
1480
           "批准文号",
1482
           "批准文号",
1483
+          "出库时间",
1481
           "备注",
1484
           "备注",
1482
         ];
1485
         ];
1483
         const filterVal = [
1486
         const filterVal = [
1494
           "expiry_date",
1497
           "expiry_date",
1495
           "dealer",
1498
           "dealer",
1496
           "number",
1499
           "number",
1500
+          "ctime",
1497
           "remark",
1501
           "remark",
1498
         ];
1502
         ];
1499
 
1503
 

+ 1 - 1
src/xt_pages/stock/drugs/inventoryDetails.vue View File

27
                 >
27
                 >
28
             </div>
28
             </div>
29
             <div>
29
             <div>
30
-               <!-- <el-button size="small" type="primary" @click="print_1">打印</el-button> -->
30
+               <el-button size="small" type="primary" @click="print_1">打印</el-button>
31
                <el-button size="small" type="primary" @click="print">盘点模版打印</el-button>
31
                <el-button size="small" type="primary" @click="print">盘点模版打印</el-button>
32
             </div>
32
             </div>
33
             <!-- <div>
33
             <!-- <div>

+ 87 - 73
src/xt_pages/stock/drugs/print.vue View File

41
                         <td> 
41
                         <td> 
42
                             <span v-if="item.stock_max_number>0">{{item.stock_max_number}}{{item.warehousing_unit}} </span>  
42
                             <span v-if="item.stock_max_number>0">{{item.stock_max_number}}{{item.warehousing_unit}} </span>  
43
                             <span v-if="item.stock_min_number>0">{{item.stock_min_number}}{{item.min_unit}}</span>
43
                             <span v-if="item.stock_min_number>0">{{item.stock_min_number}}{{item.min_unit}}</span>
44
-                            <span v-if="item.stock_max_number == 0 && item.stock_min_number == 0">0</span></td>
44
+                            <span v-if="item.stock_max_number == 0 && item.stock_min_number == 0">0</span>
45
+                        </td>
45
                         <td>
46
                         <td>
46
                             <span v-if="item.last_stock_max_number > 0">{{item.last_stock_max_number}}{{item.warehousing_unit}}</span>  
47
                             <span v-if="item.last_stock_max_number > 0">{{item.last_stock_max_number}}{{item.warehousing_unit}}</span>  
47
                             <span v-if="item.last_stock_min_number>0">{{item.last_stock_min_number}}{{item.min_unit}}</span>
48
                             <span v-if="item.last_stock_min_number>0">{{item.last_stock_min_number}}{{item.min_unit}}</span>
52
                           <span v-if="item.inventory_type == 11">盘亏</span>  
53
                           <span v-if="item.inventory_type == 11">盘亏</span>  
53
                         </td>
54
                         </td>
54
                         <td>{{getPrice(item.id)}}</td>
55
                         <td>{{getPrice(item.id)}}</td>
55
-                        <td v-if="item.inventory_type == 11">{{getTotalPrice(item.stock_max_number,item.stock_min_number,item.min_number,item.id,item.warehousing_unit,item.min_unit) - getReduceTotalPrice(item.last_stock_max_number,item.last_stock_min_number,item.min_number,item.id,item.warehousing_unit,item.min_unit)}}</td>
56
-                        <td v-if="item.inventory_type == 10">{{getTotalPrice(item.last_stock_max_number,item.last_stock_min_number,item.min_number,item.id,item.warehousing_unit,item.min_unit) - getReduceTotalPrice(item.stock_max_number,item.stock_min_number,item.min_number,item.id,item.warehousing_unit,item.min_unit)}}</td>
57
-                        <td v-if="item.inventory_type != 10 && item.inventory_type!=11">0</td>
56
+                      
57
+                        <td v-if="item.inventory_type ==11">
58
+                          <span>{{getCount(item.stock_max_number,item.stock_min_number,item.last_stock_max_number,item.last_stock_min_number,item.min_number,item.id)}}</span>
59
+                        </td>
60
+
61
+                        <td v-if="item.inventory_type ==10">
62
+                          <span>{{getCountOne(item.stock_max_number,item.stock_min_number,item.last_stock_max_number,item.last_stock_min_number,item.min_number,item.id)}}</span>
63
+                        </td>
64
+                        <td v-if="item.inventory_type!=10 && item.inventory_type!=11"></td>
58
                     </tr>
65
                     </tr>
59
                     </tbody>
66
                     </tbody>
60
                 </table>
67
                 </table>
69
 import { uParseTime } from '@/utils/tools'
76
 import { uParseTime } from '@/utils/tools'
70
 import { getInventoryDetailList } from "@/api/drug/drug"
77
 import { getInventoryDetailList } from "@/api/drug/drug"
71
 import print from "print-js";
78
 import print from "print-js";
79
+import { min } from 'moment';
72
 export default {
80
 export default {
73
     components:{
81
     components:{
74
         BreadCrumb
82
         BreadCrumb
122
               this.tableData = response.data.data.list
130
               this.tableData = response.data.data.list
123
               this.houseList = response.data.data.houseList
131
               this.houseList = response.data.data.houseList
124
               this.inventoryList = response.data.data.inventoryList
132
               this.inventoryList = response.data.data.inventoryList
125
-              console.log("hhahhh2o2o233oo2332",this.inventoryList)
133
+              console.log("hhahhh2o2o233oo2332",this.tableData)
126
               
134
               
127
              }
135
              }
128
           })   
136
           })   
146
           }
154
           }
147
           return number
155
           return number
148
          },
156
          },
149
-         getTotalPrice(last_stock_max_number,last_stock_min_number,min_number,id,last_max_unit,last_min_unit){
150
-           var retail_price = 0
151
-           var totail_price =0
152
-           var max_unit = ""
153
-           var min_unit = ""
154
-           var max_number = 0
155
-           for(let i=0;i<this.inventoryList.length;i++){
156
-            if(id == this.inventoryList[i].id){
157
-              retail_price = this.inventoryList[i].drug_warehouse_info.retail_price
158
-              max_unit = this.inventoryList[i].drug.max_unit
159
-              min_unit = this.inventoryList[i].drug.min_unit
160
-            }
161
-          }
162
-          console.log("max_unit",max_unit)
163
-          console.log("min_unit",min_unit)
164
-          if(last_max_unit == max_unit){
165
-            if(last_stock_max_number%min_number == 0){
166
-              totail_price = (last_stock_max_number/min_number) * retail_price + last_stock_min_number * retail_price
167
-            }
168
-            if(last_stock_max_number%min_number != 0){
169
-                totail_price = (last_stock_max_number/min_number)* retail_price + (last_stock_min_number%min_number) * retail_price + last_stock_min_number * retail_price
170
-            }
171
-          }
172
-          if(last_min_unit == min_unit){
173
-            totail_price = last_stock_max_number * retail_price + last_stock_min_number * retail_price
174
-          }
175
-          if(totail_price > 0){
176
-             return totail_price.toFixed(4)
177
-          }else{
178
-            return ""
179
-          }
180
-         },
181
-         getReduceTotalPrice(last_stock_max_number,last_stock_min_number,min_number,id,last_max_unit,last_min_unit){
182
-           var retail_price = 0
183
-           var totail_price =0
184
-           var max_unit = ""
185
-           var min_unit = ""
186
-           var max_number = 0
187
-           for(let i=0;i<this.inventoryList.length;i++){
188
-            if(id == this.inventoryList[i].id){
189
-              retail_price = this.inventoryList[i].drug_warehouse_info.retail_price
190
-              max_unit = this.inventoryList[i].drug.max_unit
191
-              min_unit = this.inventoryList[i].drug.min_unit
192
-            }
193
-          }
194
-          console.log("max_unit",max_unit)
195
-          console.log("min_unit",min_unit)
196
-          if(last_max_unit == max_unit){
197
-            if(last_stock_max_number%min_number == 0){
198
-              totail_price = (last_stock_max_number/min_number) * retail_price + last_stock_min_number * retail_price
199
-            }
200
-            if(last_stock_max_number%min_number != 0){
201
-                totail_price = (last_stock_max_number/min_number)* retail_price + (last_stock_min_number%min_number) * retail_price + last_stock_min_number * retail_price
202
-            }
203
-          }
204
-          if(last_min_unit == min_unit){
205
-            totail_price = last_stock_max_number * retail_price + last_stock_min_number * retail_price
206
-          }
207
-          if(totail_price > 0){
208
-             return totail_price.toFixed(4)
209
-          }else{
210
-            return ""
211
-          }
212
-         },
213
          getPrice(id){
157
          getPrice(id){
214
-           var retail_price = 0
158
+           var price = 0
215
            for(let i=0;i<this.inventoryList.length;i++){
159
            for(let i=0;i<this.inventoryList.length;i++){
216
             if(id == this.inventoryList[i].id){
160
             if(id == this.inventoryList[i].id){
217
-               retail_price = this.inventoryList[i].drug_warehouse_info.retail_price
161
+               price = this.inventoryList[i].drug_warehouse_info.price
218
             }
162
             }
219
           }
163
           }
220
-          if(retail_price > 0){
221
-          return retail_price
164
+          if(price > 0){
165
+          return price
222
           }
166
           }
223
           
167
           
224
          },
168
          },
234
          }else{
178
          }else{
235
            return storehouse_name
179
            return storehouse_name
236
          }
180
          }
181
+       },
182
+       getCount(stock_max_number,stock_min_number,last_stock_max_number,last_stock_min_number,min_number,id){
183
+         
184
+         var cha_count = 0
185
+         var befor_total_count = 0
186
+         var after_total_count = 0
187
+         var befor_total_count = stock_max_number * min_number + stock_min_number
188
+         var after_total_count = last_stock_max_number * min_number + last_stock_min_number
189
+         var retail_price = 0
190
+         var price = 0
191
+         var max_count = 0
192
+         var min_count = 0
193
+         var total_price = 0
194
+        for(let i=0;i<this.inventoryList.length;i++){
195
+          if(id == this.inventoryList[i].id){
196
+            retail_price = this.inventoryList[i].drug_warehouse_info.retail_price
197
+            price = this.inventoryList[i].drug_warehouse_info.price
198
+          }
199
+        }
200
+
201
+         //如果透前数量大于透后数量 盘亏
202
+         if(befor_total_count  > after_total_count){
203
+           cha_count = befor_total_count - after_total_count
204
+         }
205
+         max_count = cha_count/min_number
206
+         min_count = cha_count%min_number
207
+         console.log("price",price/min_number)
208
+         console.log("max_count23323232",max_count)
209
+         console.log("min_count33333",min_count)
210
+         console.log("min_number2332233232",min_number)
211
+         
212
+         total_price = Math.floor(max_count) * price + min_count * (price/min_number)
213
+         
214
+         if(total_price > 0){
215
+            return total_price.toFixed(2)
216
+         }else{
217
+          return ""
218
+         }
219
+        return cha_count
220
+       },
221
+       getCountOne(stock_max_number,stock_min_number,last_stock_max_number,last_stock_min_number,min_number,id){
222
+         var cha_count = 0
223
+         var befor_total_count = 0
224
+         var after_total_count = 0
225
+         var befor_total_count = stock_max_number * min_number + stock_min_number
226
+         var after_total_count = last_stock_max_number * min_number + last_stock_min_number
227
+         var retail_price = 0
228
+         var price = 0
229
+         var max_count = 0
230
+         var min_count = 0
231
+         var total_price = 0
232
+          for(let i=0;i<this.inventoryList.length;i++){
233
+          if(id == this.inventoryList[i].id){
234
+            retail_price = this.inventoryList[i].drug_warehouse_info.retail_price
235
+            price = this.inventoryList[i].drug_warehouse_info.price
236
+          }
237
+        }
238
+         //如果透前数量大于透后数量 盘盈
239
+         if(befor_total_count  < after_total_count){
240
+           cha_count = after_total_count - befor_total_count
241
+         }
242
+         max_count = cha_count/min_number
243
+         min_count = cha_count%min_number
244
+         total_price =  Math.floor(max_count) *price + min_count * (price/min_number)
245
+         if(total_price > 0){
246
+            return total_price.toFixed(2)
247
+         }else{
248
+          return ""
249
+         }
250
+        
237
        }
251
        }
238
     },
252
     },
239
     created(){
253
     created(){

+ 1 - 1
src/xt_pages/stock/inventoryDetails.vue View File

26
                 @click="search">搜索</el-button>
26
                 @click="search">搜索</el-button>
27
             </div>
27
             </div>
28
             <div>
28
             <div>
29
-              <!-- <el-button type="primary" @click="toprint">打印</el-button> -->
29
+              <el-button type="primary" @click="toprint">打印</el-button>
30
               <el-button type="primary" @click="inventoryExportList">盘点模版打印</el-button>
30
               <el-button type="primary" @click="inventoryExportList">盘点模版打印</el-button>
31
             </div>
31
             </div>
32
             <!-- <div>
32
             <!-- <div>

+ 7 - 13
src/xt_pages/stock/print_all.vue View File

42
                         <td>{{item.last_stock_count}}</td>
42
                         <td>{{item.last_stock_count}}</td>
43
                         <td>
43
                         <td>
44
                           <span v-if="item.stock_count > item.last_stock_count">盘亏</span>
44
                           <span v-if="item.stock_count > item.last_stock_count">盘亏</span>
45
-                           <span v-if="item.stock_count < item.last_stock_count">盘盈</span></td>
46
-                        <td></td>
47
-                         <td></td>
48
-                        <!-- <td>  
49
-                          <span v-if="parseInt(item.stock_count) > parseInt(item.last_stock_count)">盘亏</span>
50
-                          <span v-if="parseInt(item.stock_count) < parseInt(item.last_stock_count)">盘盈</span>
51
-                        </td>
52
-                        <td>{{item.buy_price}}</td>
53
-                        <td>
54
-                          <span v-if="item.stock_count > item.last_stock_count">{{((item.stock_count - item.last_stock_count)  * item.buy_price).toFixed(2)}}</span> 
55
-                          <span v-if="item.stock_count < item.last_stock_count">{{((item.last_stock_count - item.stock_count)  * item.buy_price).toFixed(2)}}</span> 
56
-                          <span v-if="item.stock_count = item.last_stock_count">0</span> 
57
-                        </td> -->
45
+                          <span v-if="item.stock_count < item.last_stock_count">盘盈</span></td>
46
+                        <td><span>{{item.buy_price}}</span></td>
47
+                         <td>
48
+                            <span v-if="item.stock_count > item.last_stock_count">{{((item.stock_count - item.last_stock_count)  * item.buy_price).toFixed(2)}}</span> 
49
+                            <span v-if="item.stock_count < item.last_stock_count">{{((item.last_stock_count - item.stock_count)  * item.buy_price).toFixed(2)}}</span> 
50
+                            <span v-if="item.stock_count == item.last_stock_count">0</span> 
51
+                         </td>
58
                     </tr>
52
                     </tr>
59
                     </tbody>
53
                     </tbody>
60
                 </table>
54
                 </table>

+ 5 - 0
src/xt_pages/stock/stockBatchNumber.vue View File

92
              <span v-if="scope.row.packing_price > 0"> {{scope.row.packing_price}}</span>
92
              <span v-if="scope.row.packing_price > 0"> {{scope.row.packing_price}}</span>
93
            </template>
93
            </template>
94
         </el-table-column>
94
         </el-table-column>
95
+        <el-table-column prop="drug_name" label="备注" align="center">
96
+           <template slot-scope="scope">
97
+             <span>{{scope.row.remark}}</span>
98
+           </template>
99
+        </el-table-column>
95
        </el-table>
100
        </el-table>
96
        
101
        
97
       <el-pagination
102
       <el-pagination

+ 10 - 2
src/xt_pages/stock/stockOutOrder.vue View File

1284
       }
1284
       }
1285
     },
1285
     },
1286
     select(selection) {
1286
     select(selection) {
1287
+     
1287
       var ids = [];
1288
       var ids = [];
1288
       for (let i = 0; i < selection.length; i++) {
1289
       for (let i = 0; i < selection.length; i++) {
1289
         ids.push(selection[i].id);
1290
         ids.push(selection[i].id);
1291
 
1292
 
1292
       this.exportList = [];
1293
       this.exportList = [];
1293
       this.order_id = ids.join(",");
1294
       this.order_id = ids.join(",");
1294
-      this.warehouse_out_time = selection[0].warehouse_out_time;
1295
+      if(selection.length >0){
1296
+        this.warehouse_out_time = selection[0].warehouse_out_time;
1297
+      }
1295
       this.selectedTableData = selection;
1298
       this.selectedTableData = selection;
1296
       this.getlist();
1299
       this.getlist();
1297
     },
1300
     },
1874
         start_time: this.start_time,
1877
         start_time: this.start_time,
1875
         end_time: this.end_time,
1878
         end_time: this.end_time,
1876
       };
1879
       };
1877
-
1880
+      console.log("params2332323232de",params)
1878
       getOutExportList(params).then((response) => {
1881
       getOutExportList(params).then((response) => {
1879
         if (response.data.state == 1) {
1882
         if (response.data.state == 1) {
1880
           var list = response.data.data.list;
1883
           var list = response.data.data.list;
1920
         this.$message.error("请勾选出库单");
1923
         this.$message.error("请勾选出库单");
1921
         return;
1924
         return;
1922
       }
1925
       }
1926
+      console.log("时间",this.exportList)
1927
+      
1923
       import("@/vendor/Export2Excel").then((excel) => {
1928
       import("@/vendor/Export2Excel").then((excel) => {
1924
         for (let i = 0; i < this.exportList.length; i++) {
1929
         for (let i = 0; i < this.exportList.length; i++) {
1925
           this.exportList[i].total_price =
1930
           this.exportList[i].total_price =
1938
           if (this.exportList[i].good_type_id == 0) {
1943
           if (this.exportList[i].good_type_id == 0) {
1939
             this.exportList[i].good_type_id = "";
1944
             this.exportList[i].good_type_id = "";
1940
           }
1945
           }
1946
+          this.exportList[i].ctime = this.getTime(this.exportList[i].ctime, "{y}-{m}-{d}")
1941
         }
1947
         }
1942
 
1948
 
1943
         const tHeader = [
1949
         const tHeader = [
1952
           "生产日期",
1958
           "生产日期",
1953
           "有效期",
1959
           "有效期",
1954
           "备注",
1960
           "备注",
1961
+          "出库时间"
1955
         ];
1962
         ];
1956
         const filterVal = [
1963
         const filterVal = [
1957
           "good_name",
1964
           "good_name",
1965
           "product_date",
1972
           "product_date",
1966
           "expiry_date",
1973
           "expiry_date",
1967
           "remark",
1974
           "remark",
1975
+          "ctime",
1968
         ];
1976
         ];
1969
 
1977
 
1970
         const data = this.formatJson(filterVal, this.exportList);
1978
         const data = this.formatJson(filterVal, this.exportList);