Kaynağa Gözat

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

csx 3 yıl önce
ebeveyn
işleme
d87ba67469

+ 167 - 151
src/xt_pages/data/components/addDrugs.vue Dosyayı Görüntüle

@@ -115,26 +115,42 @@
115 115
                     <el-form-item label="默认单次用量 : " prop="drug_dose">
116 116
                          <el-input v-model="form.drug_dose" style="width:70px;margin-right:5px;" placeholder=""
117 117
                                       maxlength="30"></el-input>
118
-                          <el-select v-model="form.drug_dose_unit" style="width:80px;" placeholder="单次用量单位">
118
+                          <!-- <el-select v-model="form.drug_dose_unit" style="width:80px;" placeholder="单次用量单位">
119 119
                                 <el-option
120 120
                                         v-for="(item,index) in unitList"
121 121
                                         :key="index"
122 122
                                         :label="item.name"
123 123
                                         :value="item.id">
124 124
                                 </el-option>
125
-                           </el-select>
125
+                           </el-select> -->
126
+                         <el-select v-model="form.drug_dose_unit" style="width:80px;" filterable placeholder="单次用量单位">
127
+                               <el-option
128
+                                v-for="(item,index) in getDataConfig('hemodialysis','units')"
129
+                                :key="index"
130
+                                :label="item.name"
131
+                                :value="item.id">
132
+                              </el-option>
133
+                        </el-select>
126 134
                      </el-form-item>
127 135
                     <el-form-item label="默认开药数量:" prop="prescribing_number">
128 136
                         <el-input v-model="form.prescribing_number" style="width:70px;margin-right:5px;" placeholder=""
129 137
                                   maxlength="30"></el-input>
130
-                        <el-select v-model="form.prescribing_number_unit" style="width:80px;" placeholder="开药数量单位">
138
+                        <!-- <el-select v-model="form.prescribing_number_unit" style="width:80px;" placeholder="开药数量单位">
131 139
                               <el-option
132 140
                                 v-for="(item,index) in packingUnit"
133 141
                                 :key="index"
134 142
                                 :label="item.name"
135 143
                                 :value="item.name">
136 144
                               </el-option>
137
-                          </el-select>
145
+                          </el-select> -->
146
+                         <el-select v-model="form.prescribing_number_unit" style="width:80px;" filterable placeholder="开药数量单位">
147
+                               <el-option
148
+                                v-for="(item,index) in getDataConfig('hemodialysis','units')"
149
+                                :key="index"
150
+                                :label="item.name"
151
+                                :value="item.name">
152
+                              </el-option>
153
+                        </el-select>
138 154
                     </el-form-item>
139 155
                      <!-- <el-form-item label="开药数量单位:" prop="prescribing_number">
140 156
                           <el-select v-model="form.prescribing_number_unit" style="width:160px;" placeholder="开药数量单位">
@@ -574,7 +590,7 @@
574 590
           packing_unit: [{ required: true, message: '请填写包装单位', trigger: 'change' }],
575 591
           drug_type: [{ required: true, message: '请填写药品类型', trigger: 'blur' }],
576 592
           drug_stock_limit: [{ required: true, message: '请填写库存警戒', trigger: 'blur' }],
577
-          drug_origin_place: [{ required: true, message: '请填写产地', trigger: 'blur' }],
593
+          // drug_origin_place: [{ required: true, message: '请填写产地', trigger: 'blur' }],
578 594
           drug_dosage_form: [{ required: true, message: '请填写药品剂型', trigger: 'blur' }],
579 595
           medical_insurance_level: [{ required: true, message: '请选择医保等级', trigger: 'change' }],
580 596
 
@@ -925,156 +941,156 @@
925 941
            }
926 942
         })
927 943
       },
928
-      changeDoseUnit(val){
929
-        if(val == this.form.min_unit){
930
-          // this.form.dose = 1
931
-          this.form.min_number = 1
932
-          this.dosageShow = true
933
-        }
934
-        if(val !=this.form.min_unit){
935
-          this.dosageShow = false
936
-        }
937
-        var arr =  getDataConfig('hemodialysis','units')
938
-        this.unitList = []
939
-        for(let i=0;i<arr.length;i++){
940
-
941
-          if(this.form.min_unit == arr[i].name){
942
-            this.unitList.push(arr[i])
943
-          }
944
-          if(val == arr[i].name){
945
-            this.unitList.push(arr[i])
946
-          }
947
-          let idArr = []
948
-          this.unitList.map(item => {
949
-            idArr.push(item.id)
950
-          })
951
-          if(idArr.indexOf(this.form.drug_dose_unit) == -1){
952
-            if(this.form.drug_dose_unit == arr[i].id){
953
-              this.unitList.push(arr[i])
954
-            }
955
-          }
956
-
957
-        }
958
-        let ojb = {};
959
-        this.unitList = this.unitList.reduce(function(prevArr, currentItem) {
960
-            //利用对象的键名无法重复的特点,mch_id是唯一区别的属性值
961
-            ojb[currentItem.name] ? '' : ojb[currentItem.name] = true && prevArr.push(currentItem);
962
-            return prevArr
963
-        }, [])
964
-
965
-      },
966
-      changeMinUnit(val){
967
-        if(val == this.form.dose_unit){
968
-          // this.form.dose = 1
969
-          this.form.min_number = 1
970
-          this.dosageShow = true
971
-        }else{
972
-          this.dosageShow = false
973
-        }
974
-        // if(val != this.form.max_unit){
975
-        //   this.dosageShow = false
976
-        // }
977
-        if(val == this.form.max_unit){
978
-          this.form.min_number = 1
979
-          this.minNumberShow = true
980
-        }else{
981
-          this.minNumberShow = false
982
-        }
983
-
984
-        // if(this.form.dosage == "" || this.form.max_unit == ""){
985
-        //    this.form.min_number = 1
986
-        // }
987
-        var arr = getDataConfig('hemodialysis','units')
988
-        this.unitList = []
989
-        this.packingUnit = []
990
-        for(let i=0;i<arr.length;i++){
991
-            if(val == arr[i].name){
992
-              this.unitList.push(arr[i])
993
-              this.packingUnit.push(arr[i])
994
-            }
995
-            if(this.form.max_unit == arr[i].name){
996
-              this.unitList.push(arr[i])
997
-              this.packingUnit.push(arr[i])
998
-            }
999
-            if(this.form.drug_dose_unit == arr[i].id){
1000
-              this.unitList.push(arr[i])
1001
-            }
1002
-            if(this.form.prescribing_number_unit == arr[i].id){
1003
-              this.packingUnit.push(arr[i])
1004
-            }
944
+      // changeDoseUnit(val){
945
+      //   if(val == this.form.min_unit){
946
+      //     // this.form.dose = 1
947
+      //     this.form.min_number = 1
948
+      //     this.dosageShow = true
949
+      //   }
950
+      //   if(val !=this.form.min_unit){
951
+      //     this.dosageShow = false
952
+      //   }
953
+      //   var arr =  getDataConfig('hemodialysis','units')
954
+      //   this.unitList = []
955
+      //   for(let i=0;i<arr.length;i++){
956
+
957
+      //     if(this.form.min_unit == arr[i].name){
958
+      //       this.unitList.push(arr[i])
959
+      //     }
960
+      //     if(val == arr[i].name){
961
+      //       this.unitList.push(arr[i])
962
+      //     }
963
+      //     let idArr = []
964
+      //     this.unitList.map(item => {
965
+      //       idArr.push(item.id)
966
+      //     })
967
+      //     if(idArr.indexOf(this.form.drug_dose_unit) == -1){
968
+      //       if(this.form.drug_dose_unit == arr[i].id){
969
+      //         this.unitList.push(arr[i])
970
+      //       }
971
+      //     }
972
+
973
+      //   }
974
+      //   let ojb = {};
975
+      //   this.unitList = this.unitList.reduce(function(prevArr, currentItem) {
976
+      //       //利用对象的键名无法重复的特点,mch_id是唯一区别的属性值
977
+      //       ojb[currentItem.name] ? '' : ojb[currentItem.name] = true && prevArr.push(currentItem);
978
+      //       return prevArr
979
+      //   }, [])
980
+
981
+      // },
982
+      // changeMinUnit(val){
983
+      //   if(val == this.form.dose_unit){
984
+      //     // this.form.dose = 1
985
+      //     this.form.min_number = 1
986
+      //     this.dosageShow = true
987
+      //   }else{
988
+      //     this.dosageShow = false
989
+      //   }
990
+      //   // if(val != this.form.max_unit){
991
+      //   //   this.dosageShow = false
992
+      //   // }
993
+      //   if(val == this.form.max_unit){
994
+      //     this.form.min_number = 1
995
+      //     this.minNumberShow = true
996
+      //   }else{
997
+      //     this.minNumberShow = false
998
+      //   }
999
+
1000
+      //   // if(this.form.dosage == "" || this.form.max_unit == ""){
1001
+      //   //    this.form.min_number = 1
1002
+      //   // }
1003
+      //   var arr = getDataConfig('hemodialysis','units')
1004
+      //   this.unitList = []
1005
+      //   this.packingUnit = []
1006
+      //   for(let i=0;i<arr.length;i++){
1007
+      //       if(val == arr[i].name){
1008
+      //         this.unitList.push(arr[i])
1009
+      //         this.packingUnit.push(arr[i])
1010
+      //       }
1011
+      //       if(this.form.max_unit == arr[i].name){
1012
+      //         this.unitList.push(arr[i])
1013
+      //         this.packingUnit.push(arr[i])
1014
+      //       }
1015
+      //       if(this.form.drug_dose_unit == arr[i].id){
1016
+      //         this.unitList.push(arr[i])
1017
+      //       }
1018
+      //       if(this.form.prescribing_number_unit == arr[i].id){
1019
+      //         this.packingUnit.push(arr[i])
1020
+      //       }
1005 1021
             
1006 1022
 
1007 1023
 
1008 1024
 
1009
-            let idArr = []
1010
-            this.unitList.map(item => {
1011
-              idArr.push(item.id)
1012
-            })
1013
-            if(idArr.indexOf(this.form.drug_dose_unit) == -1){
1014
-              if(this.form.drug_dose_unit == arr[i].id){
1015
-                this.unitList.push(arr[i])
1016
-              }
1017
-            }
1018
-            let packingIdArr = []
1019
-            this.packingUnit.map(item => {
1020
-              packingIdArr.push(item.id)
1021
-            })
1022
-            if(packingIdArr.indexOf(this.form.prescribing_number_unit) == -1){
1023
-              if(this.form.prescribing_number_unit == arr[i].id){
1024
-                this.packingUnit.push(arr[i])
1025
-              }
1026
-            }
1027
-        }
1028
-        let ojb = {};
1029
-        this.unitList = this.unitList.reduce(function(prevArr, currentItem) {
1030
-          //利用对象的键名无法重复的特点,mch_id是唯一区别的属性值
1031
-          ojb[currentItem.name] ? '' : ojb[currentItem.name] = true && prevArr.push(currentItem);
1032
-          return prevArr
1033
-        }, [])
1034
-
1035
-        let newojb = {};
1036
-        this.packingUnit = this.packingUnit.reduce(function(prevArr, currentItem) {
1037
-          //利用对象的键名无法重复的特点,mch_id是唯一区别的属性值
1038
-          newojb[currentItem.name] ? '' : newojb[currentItem.name] = true && prevArr.push(currentItem);
1039
-          return prevArr
1040
-        }, [])
1041
-
1042
-      },
1043
-      changeMaxUnit(val){
1044
-        if(val == this.form.min_unit){
1045
-          this.form.min_number = 1
1046
-          this.minNumberShow = true
1047
-        }else{
1048
-          this.minNumberShow = false
1049
-        }
1050
-        var arr = getDataConfig('hemodialysis','units')
1051
-        this.packingUnit = []
1052
-        for(let i=0;i<arr.length;i++){
1053
-            if(val == arr[i].name){
1054
-              this.packingUnit.push(arr[i])
1055
-            }
1056
-            if(this.form.min_unit == arr[i].name){
1057
-              this.packingUnit.push(arr[i])
1058
-            }
1059
-            let packingIdArr = []
1060
-            this.packingUnit.map(item => {
1061
-              packingIdArr.push(item.id)
1062
-            })
1063
-            if(packingIdArr.indexOf(this.form.prescribing_number_unit) == -1){
1064
-              if(this.form.prescribing_number_unit == arr[i].id){
1065
-                this.packingUnit.push(arr[i])
1066
-              }
1067
-            }
1068
-        }
1069
-
1070
-
1071
-        let newojb = {};
1072
-        this.packingUnit = this.packingUnit.reduce(function(prevArr, currentItem) {
1073
-          //利用对象的键名无法重复的特点,mch_id是唯一区别的属性值
1074
-          newojb[currentItem.name] ? '' : newojb[currentItem.name] = true && prevArr.push(currentItem);
1075
-          return prevArr
1076
-        }, [])
1077
-      }
1025
+      //       let idArr = []
1026
+      //       this.unitList.map(item => {
1027
+      //         idArr.push(item.id)
1028
+      //       })
1029
+      //       if(idArr.indexOf(this.form.drug_dose_unit) == -1){
1030
+      //         if(this.form.drug_dose_unit == arr[i].id){
1031
+      //           this.unitList.push(arr[i])
1032
+      //         }
1033
+      //       }
1034
+      //       let packingIdArr = []
1035
+      //       this.packingUnit.map(item => {
1036
+      //         packingIdArr.push(item.id)
1037
+      //       })
1038
+      //       if(packingIdArr.indexOf(this.form.prescribing_number_unit) == -1){
1039
+      //         if(this.form.prescribing_number_unit == arr[i].id){
1040
+      //           this.packingUnit.push(arr[i])
1041
+      //         }
1042
+      //       }
1043
+      //   }
1044
+      //   let ojb = {};
1045
+      //   this.unitList = this.unitList.reduce(function(prevArr, currentItem) {
1046
+      //     //利用对象的键名无法重复的特点,mch_id是唯一区别的属性值
1047
+      //     ojb[currentItem.name] ? '' : ojb[currentItem.name] = true && prevArr.push(currentItem);
1048
+      //     return prevArr
1049
+      //   }, [])
1050
+
1051
+      //   let newojb = {};
1052
+      //   this.packingUnit = this.packingUnit.reduce(function(prevArr, currentItem) {
1053
+      //     //利用对象的键名无法重复的特点,mch_id是唯一区别的属性值
1054
+      //     newojb[currentItem.name] ? '' : newojb[currentItem.name] = true && prevArr.push(currentItem);
1055
+      //     return prevArr
1056
+      //   }, [])
1057
+
1058
+      // },
1059
+      // changeMaxUnit(val){
1060
+      //   if(val == this.form.min_unit){
1061
+      //     this.form.min_number = 1
1062
+      //     this.minNumberShow = true
1063
+      //   }else{
1064
+      //     this.minNumberShow = false
1065
+      //   }
1066
+      //   var arr = getDataConfig('hemodialysis','units')
1067
+      //   this.packingUnit = []
1068
+      //   for(let i=0;i<arr.length;i++){
1069
+      //       if(val == arr[i].name){
1070
+      //         this.packingUnit.push(arr[i])
1071
+      //       }
1072
+      //       if(this.form.min_unit == arr[i].name){
1073
+      //         this.packingUnit.push(arr[i])
1074
+      //       }
1075
+      //       let packingIdArr = []
1076
+      //       this.packingUnit.map(item => {
1077
+      //         packingIdArr.push(item.id)
1078
+      //       })
1079
+      //       if(packingIdArr.indexOf(this.form.prescribing_number_unit) == -1){
1080
+      //         if(this.form.prescribing_number_unit == arr[i].id){
1081
+      //           this.packingUnit.push(arr[i])
1082
+      //         }
1083
+      //       }
1084
+      //   }
1085
+
1086
+
1087
+      //   let newojb = {};
1088
+      //   this.packingUnit = this.packingUnit.reduce(function(prevArr, currentItem) {
1089
+      //     //利用对象的键名无法重复的特点,mch_id是唯一区别的属性值
1090
+      //     newojb[currentItem.name] ? '' : newojb[currentItem.name] = true && prevArr.push(currentItem);
1091
+      //     return prevArr
1092
+      //   }, [])
1093
+      // }
1078 1094
     }, watch: {
1079 1095
       visible(val) {
1080 1096
         // this.form = this.formValue

+ 2 - 2
src/xt_pages/outpatientDoctorStation/components/prescriptionTemplateTable.vue Dosyayı Görüntüle

@@ -188,7 +188,7 @@
188 188
                     <el-input v-model="scope.row.remark" :title="scope.row.remark"></el-input>
189 189
                 </template>
190 190
             </el-table-column>
191
-            <el-table-column align="center" prop="remark" width="50" label="推送频率">
191
+            <el-table-column align="center" prop="remark" width="70" label="推送频率">
192 192
                 <template slot-scope="scope">
193 193
                     <div v-if="scope.row.frequency_type == 1">{{'每次必推'}}</div>
194 194
                     <div v-if="scope.row.frequency_type == 2">{{scope.row.day_count}}天/次</div>
@@ -196,7 +196,7 @@
196 196
 
197 197
                 </template>
198 198
             </el-table-column>
199
-            <el-table-column align="center" width="100" prop="name" label="操作">
199
+            <el-table-column align="center" width="140" prop="name" label="操作">
200 200
                 <template slot-scope="scope">
201 201
                     <el-button size="mini" type="primary" @click="handleEdit(scope.row,scope.$index)">推送</el-button>
202 202
                     <el-button size="mini" type="danger" @click="deleteProject(scope.row,scope.$index)">删除

+ 1 - 1
src/xt_pages/outpatientDoctorStation/treatTemplate/printOne.vue Dosyayı Görüntüle

@@ -52,7 +52,7 @@
52 52
                     <tr v-for="(it,index) in item.project" :key="index">
53 53
                         <td>{{index+1}}</td>
54 54
                         <td>{{it.type == 2 ? it.project.project_name : it.good_info.good_name}}</td>
55
-                        <td>{{it.single_dose}}</td>
55
+                        <td>{{it.count}}</td>
56 56
                         <td>{{getUnit(it.unit)}}</td>
57 57
                         <td>{{it.price}}</td>
58 58
                         <td></td>

+ 46 - 9
src/xt_pages/stock/detail/stockInDetail.vue Dosyayı Görüntüle

@@ -8,13 +8,21 @@
8 8
       type="primary"
9 9
       >打印
10 10
     </el-button>
11
+   
12
+    <el-button
13
+      style="float: right;margin-right:10px"
14
+      size="small"
15
+      @click="exportListDetal"
16
+      type="primary"
17
+      >明细导出
18
+    </el-button>
11 19
 
12 20
     <el-button
13 21
       style="float: right;margin-right:10px"
14 22
       size="small"
15 23
       @click="exportList"
16 24
       type="primary"
17
-      >导出
25
+      >汇总导出
18 26
     </el-button>
19 27
 
20 28
     <div class="cell clearfix">
@@ -40,7 +48,7 @@
40 48
           v-model="start_time"
41 49
           prefix-icon="el-icon-date"
42 50
           :editable="false"
43
-          style="width: 196px;"
51
+          style="width: 150px;"
44 52
           type="date"
45 53
           placeholder="选择日期时间"
46 54
           align="right"
@@ -54,7 +62,7 @@
54 62
           v-model="end_time"
55 63
           prefix-icon="el-icon-date"
56 64
           :editable="false"
57
-          style="width: 196px;"
65
+          style="width: 150px;"
58 66
           type="date"
59 67
           placeholder="选择日期时间"
60 68
           align="right"
@@ -398,10 +406,10 @@ export default {
398 406
           return false;
399 407
         } else {
400 408
           this.total = response.data.data.total;
401
-          var total_price = ""
402
-         
403
-        
409
+          var total_price = 0
410
+          console.log("收据3233232",response.data.data.list)
404 411
           for (let i = 0; i < response.data.data.list.length; i++) {
412
+            total_price += parseInt(response.data.data.list[i].warehousing_count) * response.data.data.list[i].price
405 413
             this.tableList.push(response.data.data.list[i])
406 414
             var obj = response.data.data.list[i];
407 415
             obj["is_total"] = 0;
@@ -411,7 +419,7 @@ export default {
411 419
           this.cancelStockDate.push({
412 420
             warehousing_order: "合计",
413 421
             is_total: 1,
414
-            total: response.data.data.total_price,
422
+            total:total_price.toFixed(2),
415 423
             Warehousing: {
416 424
               warehousing_time: 0
417 425
             }
@@ -747,8 +755,6 @@ export default {
747 755
     
748 756
       exportList(){
749 757
   
750
-        console.log("hhhh",this.tableInfo)
751
-       
752 758
         for(let i=0;i<this.tableInfo.length;i++){
753 759
           this.tableInfo[i].index = i+1  
754 760
           this.tableInfo[i].total_price = (this.tableInfo[i].warehousing_count * this.tableInfo[i].price).toFixed(2) 
@@ -769,6 +775,37 @@ export default {
769 775
             this.downloadLoading = false
770 776
         })
771 777
       },
778
+      exportListDetal(){
779
+        var obj = {index:"合计",total_price:0}
780
+        var total_price = 0
781
+        for(let i=0;i<this.cancelStockDate.length;i++){
782
+          this.cancelStockDate[i].index = i + 1
783
+          this.cancelStockDate[i].good_type_name = this.typeName(this.cancelStockDate[i].good_type_id)
784
+          this.cancelStockDate[i].good_name = this.typeNameOne(this.cancelStockDate[i].good_id)
785
+          this.cancelStockDate[i].specification_name = this.specificationName(this.cancelStockDate[i].good_id)
786
+          this.cancelStockDate[i].warehousing_time = this.getTime(this.cancelStockDate[i].Warehousing.warehousing_time)
787
+          this.cancelStockDate[i].user_name = this.getXuserName(this.cancelStockDate[i].Warehousing.creater)
788
+          this.cancelStockDate[i].total_price = (this.cancelStockDate[i].warehousing_count * this.cancelStockDate[i].price).toFixed(2)
789
+          total_price += this.cancelStockDate[i].warehousing_count * this.cancelStockDate[i].price
790
+        }
791
+        obj.total_price = total_price.toFixed(2)
792
+        this.cancelStockDate.push(obj)
793
+        import('@/vendor/Export2Excel').then(excel => {
794
+        const tHeader = ['序号','单据编号', '耗材类型', '耗材名称','规格型号','操作时间','制单人','进货价','数量','总价']
795
+        const filterVal = ['index','warehousing_count', 'good_type_name', 'good_name','specification_name','warehousing_time','user_name','price','warehousing_count','total_price']
796
+        console.log("hhhhhhhh",this.cancelStockDate)
797
+      
798
+        
799
+        const data = this.formatJson(filterVal, this.cancelStockDate)
800
+        console.log("data222222222",data)
801
+          excel.export_json_to_excel({
802
+            header: tHeader,
803
+            data,
804
+            filename: '耗材入库明细'
805
+          })
806
+            this.downloadLoading = false
807
+        })
808
+      },
772 809
      formatJson(filterVal, jsonData) {
773 810
         return jsonData.map(v => filterVal.map(j => v[j]));
774 811
      },

+ 64 - 9
src/xt_pages/stock/drugs/components/drugCancelDetail.vue Dosyayı Görüntüle

@@ -8,14 +8,19 @@
8 8
       type="primary"
9 9
       >打印
10 10
     </el-button>
11
-
11
+    <!-- <el-button
12
+      style="float: right;margin-right:10px"
13
+      size="small"
14
+      @click="exportListOne"
15
+      type="primary"
16
+      >明细导出
17
+    </el-button> -->
12 18
     <el-button
13 19
       style="float: right;margin-right:10px"
14 20
       size="small"
15
-      icon="el-icon-printer"
16 21
       @click="exportList"
17 22
       type="primary"
18
-      >导出
23
+      >汇总导出
19 24
     </el-button>
20 25
     <div class="cell clearfix">
21 26
       <el-input
@@ -40,7 +45,7 @@
40 45
           v-model="start_time"
41 46
           prefix-icon="el-icon-date"
42 47
           :editable="false"
43
-          style="width: 196px;"
48
+          style="width: 150px;"
44 49
           type="date"
45 50
           placeholder="选择日期时间"
46 51
           align="right"
@@ -54,7 +59,7 @@
54 59
           v-model="end_time"
55 60
           prefix-icon="el-icon-date"
56 61
           :editable="false"
57
-          style="width: 196px;"
62
+          style="width: 150px;"
58 63
           type="date"
59 64
           placeholder="选择日期时间"
60 65
           align="right"
@@ -145,12 +150,12 @@
145 150
           </template>
146 151
         </el-table-column>
147 152
 
148
-        <el-table-column label="单据类型" align="center">
153
+        <!-- <el-table-column label="单据类型" align="center">
149 154
           <template slot-scope="scope">
150 155
             <span v-if="scope.row.type == 1">药品退库单</span>
151 156
             <span v-if="scope.row.type == 2">其他</span>
152 157
           </template>
153
-        </el-table-column>
158
+        </el-table-column> -->
154 159
 
155 160
         <el-table-column label="操作时间" align="center">
156 161
           <template slot-scope="scope">
@@ -162,12 +167,21 @@
162 167
           {{getAdminUser(scope.row.creater)}}
163 168
           </template>
164 169
         </el-table-column>
165
-
170
+        <el-table-column label="退货价" align="center">
171
+          <template slot-scope="scope">
172
+          {{scope.row.price}}
173
+          </template>
174
+        </el-table-column>
166 175
         <el-table-column label="数量" align="center">
167 176
           <template slot-scope="scope">
168 177
             {{scope.row.count}}
169 178
           </template>
170 179
         </el-table-column>
180
+        <el-table-column label="总价" align="center">
181
+          <template slot-scope="scope">
182
+            {{scope.row.count * scope.row.price}}
183
+          </template>
184
+        </el-table-column>
171 185
       </el-table>
172 186
 
173 187
       <el-pagination
@@ -391,7 +405,7 @@ export default {
391 405
           this.tableList[i].unit = this.tableList[i].dose + this.tableList[i].dose_unit + "*"+this.tableList[i].min_number + this.tableList[i].min_unit+"/"+this.tableList[i].max_unit
392 406
         }
393 407
        import('@/vendor/Export2Excel').then(excel => {
394
-       const tHeader = ['序号','药品名称', '规格型号', '单位','数量','单价','备注']
408
+       const tHeader = ['序号','单据编号', '药品名称', '规格型号','单据类型','操作时间','制单人','数量']
395 409
        const filterVal = ['index','drug_name', 'unit', 'min_unit','count','price','remark']
396 410
        
397 411
        const data = this.formatJson(filterVal, this.tableList)
@@ -408,6 +422,47 @@ export default {
408 422
      formatJson(filterVal, jsonData) {
409 423
         return jsonData.map(v => filterVal.map(j => v[j]));
410 424
      },
425
+    exportListOne(){
426
+      let obj = {'index':'合计','total_price':0}
427
+       for(let i=0;i<this.tableList.length;i++){
428
+          this.tableList[i].index = i+1
429
+          this.tableList[i].unit = this.tableList[i].dose + this.tableList[i].dose_unit + "*"+this.tableList[i].min_number + this.tableList[i].min_unit+"/"+this.tableList[i].max_unit
430
+          if(this.tableData[i].drug_type == 1){
431
+             this.tableData[i].drugtype = "西药"
432
+          }
433
+          if(this.tableData[i].drug_type == 2){
434
+             this.tableData[i].drugtype = "草药"
435
+          }
436
+          if(this.tableData[i].drug_type == 3){
437
+             this.tableData[i].drugtype = "成药"
438
+          }
439
+          this.tableData[i].time = this.getTime(this.tableData[i].ctime)
440
+          this.tableData[i].user_name = this.getAdminUser(this.tableData[i].creater)
441
+          
442
+          this.tableData[i].total_price = this.tableData[i].count * this.tableData[i].price
443
+           obj.total_price += this.tabelePrintList[i].count * this.tabelePrintList[i].price
444
+        }
445
+        obj.total_price = obj.total_price.toFixed(2)
446
+       this.tableData.push(obj)
447
+       for(let i=0;i<this.tableData.length;i++){
448
+         this.tableData[i].total_price = this.tableData[i].total_price.toFixed(2)
449
+       }
450
+       import('@/vendor/Export2Excel').then(excel => {
451
+       const tHeader = ['序号','单据编号', '药品类型','药品名称', '规格型号','操作时间','制单人','退货价','数量','总价']
452
+       const filterVal = ['index','order_number','drugtype','drug_name', 'unit', 'time','user_name','price','count','total_price']
453
+       
454
+       const data = this.formatJson(filterVal, this.tableList)
455
+       console.log("data",data)
456
+       
457
+       excel.export_json_to_excel({
458
+           header: tHeader,
459
+           data,
460
+           filename: '药品退库明细'
461
+         })
462
+          this.downloadLoading = false
463
+        })
464
+     },
465
+
411 466
   }
412 467
 };
413 468
 </script>

+ 2 - 2
src/xt_pages/stock/drugs/components/drugCancelOrder.vue Dosyayı Görüntüle

@@ -12,9 +12,9 @@
12 12
       style="float: right;margin-right:10px"
13 13
       size="small"
14 14
       icon="el-icon-printer"
15
-      @click="exportList"
15
+      @click="c"
16 16
       type="primary"
17
-      >导出
17
+      >汇总导出
18 18
     </el-button>
19 19
     <div class="cell clearfix">
20 20
       <el-input

+ 60 - 8
src/xt_pages/stock/drugs/components/drugInOrder.vue Dosyayı Görüntüle

@@ -3,18 +3,25 @@
3 3
     <el-button
4 4
       style="float: right"
5 5
       size="small"
6
-      icon="el-icon-printer"
7 6
       @click="PrintAction"
8 7
       type="primary"
9 8
       >打印
10 9
     </el-button>
10
+    
11
+    <el-button
12
+      style="float: right;margin-right:10px"
13
+      size="small"
14
+      @click="exportListDetail"
15
+      type="primary"
16
+      >明细导出
17
+    </el-button>
11 18
 
12 19
      <el-button
13 20
       style="float: right;margin-right:10px"
14 21
       size="small"
15 22
       @click="exportList"
16 23
       type="primary"
17
-      >导出
24
+      >汇总导出
18 25
     </el-button>
19 26
 
20 27
     <div class="cell clearfix">
@@ -40,13 +47,14 @@
40 47
           v-model="start_time"
41 48
           prefix-icon="el-icon-date"
42 49
           :editable="false"
43
-          style="width: 196px;"
50
+          style="width: 150px;"
44 51
           type="date"
45 52
           placeholder="选择日期时间"
46 53
           align="right"
47 54
           format="yyyy-MM-dd"
48 55
           value-format="yyyy-MM-dd"
49 56
           @change="startTimeChange"
57
+         
50 58
         ></el-date-picker>
51 59
         <span class="cellLine"> - </span>
52 60
         <el-date-picker
@@ -54,7 +62,7 @@
54 62
           v-model="end_time"
55 63
           prefix-icon="el-icon-date"
56 64
           :editable="false"
57
-          style="width: 196px;"
65
+          style="width: 150px;"
58 66
           type="date"
59 67
           placeholder="选择日期时间"
60 68
           align="right"
@@ -321,7 +329,8 @@ export default {
321 329
         this.$message.error("结束时间不能小于开始时间");
322 330
         this.start_time = "";
323 331
       } else {
324
-        this.getlist();
332
+        this.getlist()
333
+        this.getDrugWarehouseInfoPrint()
325 334
       }
326 335
     },
327 336
     endTimeChange(val) {
@@ -330,7 +339,8 @@ export default {
330 339
         this.$message.error("结束时间不能小于开始时间");
331 340
         this.end_time = "";
332 341
       } else {
333
-        this.getlist();
342
+        this.getlist()
343
+        this.getDrugWarehouseInfoPrint()
334 344
       }
335 345
     },
336 346
     getTimestamp(time) {
@@ -436,7 +446,6 @@ export default {
436 446
       })
437 447
     },
438 448
     PrintAction(){
439
-      console.log("打印",this.order_type)
440 449
       this.$router.push("/stock/drugprint?start_time="+this.start_time+"&end_time="+this.end_time+"&order_type="+this.order_type+"&manufacturer_id="+this.manufacturer_id+"&keyword="+this.keyword+"&limit="+this.limit+"&page="+this.page)
441 450
     },
442 451
     select(){
@@ -482,10 +491,53 @@ export default {
482 491
          })
483 492
           this.downloadLoading = false
484 493
         })
485
-       },
494
+      },
486 495
      formatJson(filterVal, jsonData) {
487 496
         return jsonData.map(v => filterVal.map(j => v[j]));
488 497
      },
498
+     exportListDetail(){
499
+       
500
+       import('@/vendor/Export2Excel').then(excel => {
501
+       const tHeader = ['序号','单据编号', '药品类型', '药品名称','规格型号','操作时间','制单人','进货价','数量','总价']
502
+       const filterVal = ['index','warehousing_order','drugtype','drug_name', 'specification_name','time','user_name','price','warehousing_count','total']
503
+       console.log(" ba323223323223",this.cancelStockDate.length)
504
+       var newArr = []
505
+       newArr = this.cancelStockDate
506
+       let obj = {'index':'合计','total':0}
507
+       for(let i=0;i<newArr.length;i++){
508
+          newArr.specification_name = ""
509
+          newArr.index = i+1
510
+          if(newArr[i].drug_type == 1){
511
+             newArr[i].drugtype = "西药"
512
+          }
513
+          if(newArr[i].drug_type == 2){
514
+             newArr[i].drugtype = "草药"
515
+          }
516
+          if(newArr[i].drug_type == 3){
517
+             newArr[i].drugtype = "成药"
518
+          }
519
+        
520
+         newArr[i].specification_name = newArr[i].dose + newArr[i].dose_unit +"*" + newArr[i].min_number + newArr[i].min_unit +  "/" + newArr[i].max_unit
521
+
522
+         newArr[i].time = this.getTime(newArr[i].ctime)
523
+         newArr[i].user_name = this.getAdminUser(newArr[i].creater)
524
+         newArr[i].total = (newArr[i].price * newArr[i].warehousing_count).toFixed(2)
525
+         obj.total += (newArr[i].price * newArr[i].warehousing_count)
526
+       }
527
+       obj.total = obj.total.toFixed(2)
528
+       newArr.push(obj)
529
+       const data = this.formatJson(filterVal, newArr)
530
+       console.log("data",data)
531
+       
532
+        excel.export_json_to_excel({
533
+           header: tHeader,
534
+           data,
535
+           filename: '药品入库明细'
536
+         })
537
+          this.downloadLoading = false
538
+        })
539
+
540
+     }
489 541
   }
490 542
 };
491 543
 </script>

+ 75 - 19
src/xt_pages/stock/drugs/components/drugOutDetail.vue Dosyayı Görüntüle

@@ -7,14 +7,22 @@
7 7
       @click="PrintAction"
8 8
       type="primary"
9 9
       >打印
10
+    </el-button>
11
+     <el-button
12
+      style="float: right;margin-right:10px"
13
+      size="small"
14
+      @click="exportListDetai"
15
+      type="primary"
16
+      >明细导出
10 17
     </el-button>
11 18
      <el-button
12 19
       style="float: right;margin-right:10px"
13 20
       size="small"
14 21
       @click="exportList"
15 22
       type="primary"
16
-      >导出
23
+      >汇总导出
17 24
     </el-button>
25
+   
18 26
     <div class="cell clearfix">
19 27
       <el-input
20 28
         size="small"
@@ -38,7 +46,7 @@
38 46
           v-model="start_time"
39 47
           prefix-icon="el-icon-date"
40 48
           :editable="false"
41
-          style="width: 196px;"
49
+          style="width: 150px;"
42 50
           type="date"
43 51
           placeholder="选择日期时间"
44 52
           align="right"
@@ -52,7 +60,7 @@
52 60
           v-model="end_time"
53 61
           prefix-icon="el-icon-date"
54 62
           :editable="false"
55
-          style="width: 196px;"
63
+          style="width: 150px;"
56 64
           type="date"
57 65
           placeholder="选择日期时间"
58 66
           align="right"
@@ -462,35 +470,25 @@ export default {
462 470
      exportList(){
463 471
 
464 472
         for(let i=0;i<this.tablePrint.length;i++){
465
-          // for(let j=0;j<this.drugList.length;j++){
466
-          //    if(this.tableList[i].drug_id == this.drugList[j].id){
467
-          //      this.tableList[i].last_price = this.drugList[j].last_price
468
-               
469
-          //    }
470
-          // }
471 473
           this.tablePrint[i].index = i+1
472 474
           
473 475
         }
474 476
         for(let i=0;i<this.tablePrint.length;i++){
475 477
            this.tablePrint[i].count = this.getCount(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_unit,this.tablePrint[i].min_number)
476
-          //  this.tablePrint[i].total_price = this.tablePrint[i].last_price * this.tablePrint[i].count
477 478
            this.tablePrint[i].total_price = this.getTotalPrice(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_number,this.tablePrint[i].price)
478 479
            this.tablePrint[i].unit = this.tablePrint[i].dose + this.tablePrint[i].dose_unit + "*" + this.tablePrint[i].min_number +this.tablePrint[i].min_unit +"/"+this.tablePrint[i].max_unit
480
+            this.tablePrint[i].total = this.getTotalPriceOne(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_number,this.tablePrint[i].price) 
479 481
         }
480 482
        console.log("列表数据333333333",this.tablePrint)
481 483
      
482 484
        import('@/vendor/Export2Excel').then(excel => {
483 485
        const tHeader = ['序号','药品名称', '规格型号', '单位','数量','单价','总价','备注']
484 486
        const filterVal = ['index','drug_name', 'unit', 'min_unit','count','price','total_price','remark']
485
-      //  let obj = {'index':'合计','total_price':0}
486
-      //  for(let i=0;i<this.tablePrint.length;i++){
487
-      //    obj.total_price += (this.tablePrint[i].min_price * this.tablePrint[i].count)
488
-      //  }
489
-      //  for(let j=0;j<this.tablePrint.length;j++){
490
-      //     this.tablePrint[j].total_price = this.tablePrint[j].total_price.toFixed(2)
491
-      //  }
492
-      //  obj.total_price = obj.total_price.toFixed(2)
493
-      //  this.tablePrint.push(obj)
487
+       let obj = {'index':'合计','total_price':0}
488
+       for(let i=0;i<this.tablePrint.length;i++){
489
+         obj.total_price += this.tablePrint[i].total 
490
+       }
491
+       this.tablePrint.push(obj)
494 492
        const data = this.formatJson(filterVal, this.tablePrint)
495 493
        console.log("data",data)
496 494
        
@@ -502,9 +500,51 @@ export default {
502 500
           this.downloadLoading = false
503 501
         })
504 502
        },
503
+      
505 504
      formatJson(filterVal, jsonData) {
506 505
         return jsonData.map(v => filterVal.map(j => v[j]));
507 506
      },
507
+    exportListDetai(){
508
+      import('@/vendor/Export2Excel').then(excel => {
509
+       const tHeader = ['序号','单据编号', '药品类型', '药品名称','规格型号','操作时间','制单人','出货价','数量','总价']
510
+       const filterVal = ['index','warehouse_out_order_number', 'drugtype', 'drug_name','specification_name','time','user_name','price','count','total_price']
511
+       for(let i=0;i<this.tableData.length;i++){
512
+         this.tableData[i].index = i+1
513
+         if(this.tableData[i].drug_type == 1){
514
+            this.tableData[i].drugtype = "西药"
515
+         }
516
+         if(this.tableData[i].drug_type == 2){
517
+            this.tableData[i].drugtype = "草药"
518
+         }
519
+         if(this.tableData[i].drug_type == 3){
520
+            this.tableData[i].drugtype = "成药"
521
+         }
522
+        this.tableData[i].specification_name = this.tableData[i].dose + this.tableData[i].dose_unit +"*" + this.tableData[i].min_number + this.tableData[i].min_unit +  "/" + this.tableData[i].max_unit
523
+        this.tableData[i].time = this.getTime(this.tableData[i].ctime)
524
+        this.tableData[i].user_name = this.getAdminUser(this.tableData[i].creater)
525
+        this.tableData[i].total = (this.tableData[i].count * this.tableData[i].price)
526
+        this.tableData[i].total_price = (this.tableData[i].count * this.tableData[i].price)
527
+       }
528
+       let obj = {'index':'合计','total_price':0}
529
+       for(let i=0;i<this.tableData.length;i++){
530
+         obj.total_price += this.tableData[i].total 
531
+       }
532
+       
533
+       this.tableData.push(obj)
534
+       for(let j=0;j<this.tableData.length;j++){
535
+          this.tableData[j].total_price = this.tableData[j].total_price.toFixed(2)
536
+       }
537
+       const data = this.formatJson(filterVal, this.tableData)
538
+       console.log("data",data)
539
+       
540
+       excel.export_json_to_excel({
541
+           header: tHeader,
542
+           data,
543
+           filename: '药品出库明细'
544
+         })
545
+          this.downloadLoading = false
546
+      }) 
547
+    },
508 548
 
509 549
     getBaseDrugLibList() {
510 550
         let params = {
@@ -617,6 +657,22 @@ export default {
617 657
         }
618 658
         console.log("total23232",total)
619 659
         return (total*min_price).toFixed(2)
660
+      },
661
+
662
+      getTotalPriceOne(arr,max_unit,min_number,min_price){
663
+        var total = 0
664
+        for(let i=0;i<arr.length;i++){
665
+          if(arr[i].count_unit == max_unit){
666
+            arr[i].count = arr[i].count * min_number
667
+          }else{
668
+            arr[i].count = arr[i].count
669
+          }
670
+        }  
671
+        for(let j=0;j<arr.length;j++){
672
+          total +=arr[j].count
673
+        }
674
+        console.log("total23232",total)
675
+        return total*min_price
620 676
       }
621 677
   }
622 678
 };

+ 13 - 1
src/xt_pages/stock/drugs/drugCancelDetailPrint.vue Dosyayı Görüntüle

@@ -36,11 +36,12 @@
36 36
                 <span>{{item.dose}}{{item.dose_unit}}*{{item.min_number}}{{item.min_unit}}/{{item.max_unit}}</span>
37 37
               </td>
38 38
               <td style="line-height: 50px">
39
-                <span>{{item.min_unit}}</span>
39
+                <span>{{item.unit}}</span>
40 40
               </td>
41 41
             
42 42
               <td style="line-height: 50px">
43 43
                   {{item.count}}
44
+               
44 45
               </td>
45 46
               <td style="line-height:50px">
46 47
                   {{item.price}}
@@ -166,6 +167,17 @@
166 167
           var drugInOrder = response.data.data.order
167 168
           console.log("drug3434444",drugInOrder)
168 169
           this.cancelStockDate = drugInOrder
170
+          var orderPrint = response.data.data.orderPrint
171
+          
172
+          for(let i=0;i<orderPrint.length;i++){
173
+             orderPrint[i].child = []
174
+            for(let j=0;j<drugInOrder.length;j++){
175
+               if(orderPrint[i].drug_id == drugInOrder[j].drug_id){
176
+                 orderPrint[i].child.push(drugInOrder[j])   
177
+               }
178
+            }
179
+          }
180
+          console.log("orderPrint",orderPrint)
169 181
         }
170 182
       })  
171 183
       },

+ 5 - 7
src/xt_pages/stock/drugs/drugDamaged.vue Dosyayı Görüntüle

@@ -1010,16 +1010,14 @@ export default {
1010 1010
          if(response.data.state == 1){
1011 1011
            var list = response.data.data.list
1012 1012
            console.log("list",list)
1013
-          //  this.form.total = list.stock_max_number + list.XtBaseDrug.max_unit + list.stock_min_number + list.XtBaseDrug.min_unit
1014
-          if(list.stock_max_number > 0){
1013
+         
1014
+          if(list.stock_max_number >0 ){
1015 1015
             this.form.total = list.stock_max_number + list.XtBaseDrug.max_unit
1016
-            this.form.stock_max_number = list.stock_max_number
1017 1016
           }
1018
-          if(list.stock_min_number >0 ){
1019
-            this.form.total = list.stock_min_number + list.XtBaseDrug.min_unit
1020
-            this.form.stock_min_number = list.stock_min_number
1017
+          if(list.stock_min_number > 0){
1018
+            this.form.total =  this.form.total + list.stock_min_number + list.XtBaseDrug.min_unit 
1021 1019
           }
1022
-          
1020
+          // this.form.total = list.stock_max_number + list.XtBaseDrug.max_unit + list.stock_min_number + list.XtBaseDrug.min_unit
1023 1021
          }
1024 1022
       })
1025 1023
      },

+ 2 - 1
src/xt_pages/stock/drugs/drugStockInOrderAdd.vue Dosyayı Görüntüle

@@ -120,7 +120,7 @@
120 120
               <el-form-item
121 121
                 :prop="'recordData.' + scope.$index + '.warehousing_count'"
122 122
                 :rules="tableRules.warehousing_count"
123
-                style="padding-top: 20px"
123
+                style="padding-top: 10px"
124 124
               >
125 125
               <div style="display:flex;">
126 126
                 <el-input
@@ -128,6 +128,7 @@
128 128
                   placeholder="请输入入库数量"
129 129
                   type="number"
130 130
                   v-model="scope.row.warehousing_count"
131
+                  style="width:80px"
131 132
                 ></el-input>
132 133
                  {{scope.row.max_unit}}
133 134
               </div>

+ 2 - 1
src/xt_pages/stock/drugs/drugStockInOrderEdit.vue Dosyayı Görüntüle

@@ -185,7 +185,7 @@
185 185
               <el-form-item
186 186
                 :prop="'recordData.' + scope.$index + '.warehousing_count'"
187 187
                 :rules="tableRules.warehousing_count"
188
-                style="padding-top: 20px;"
188
+                style="padding-top: 10px;"
189 189
               >
190 190
                 <div style="display:flex;">
191 191
                   <el-input
@@ -193,6 +193,7 @@
193 193
                     placeholder="请输入入库数量"
194 194
                     type="number"
195 195
                     v-model="scope.row.warehousing_count"
196
+                    style="width:80px"
196 197
                   ></el-input>
197 198
                   {{scope.row.max_unit}}
198 199
                 </div>

+ 51 - 85
src/xt_pages/stock/drugs/drugStockOutOrder.vue Dosyayı Görüntüle

@@ -233,8 +233,8 @@
233 233
           </el-table-column> -->
234 234
           <el-table-column label="出库数量" align="center">
235 235
             <template slot-scope="scope">
236
-              <span v-if="scope.row.is_sys ==  0">{{getTotalCount(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}</span>
237
-              <span v-if="scope.row.is_sys == 1"> {{getTotalCountOne(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}</span>
236
+              <!-- <span v-if="scope.row.is_sys ==  0">{{getTotalCount(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}</span> -->
237
+              <span> {{getTotalCountOne(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}</span>
238 238
             </template>
239 239
           </el-table-column>
240 240
           <el-table-column label="出货单价" align="center">
@@ -249,7 +249,7 @@
249 249
           </el-table-column>
250 250
           <el-table-column label="总价" align="center">
251 251
             <template slot-scope="scope">
252
-              <span>{{getAllPrice(scope.row.drug_id,scope.row.price,scope.row.min_price).toFixed(2)}}</span>
252
+              <span>{{getAllPriceOne(scope.row.drug_id,scope.row.price,scope.row.min_price).toFixed(2)}}</span>
253 253
             </template>
254 254
           </el-table-column>
255 255
           <el-table-column label="生产厂家" align="center">
@@ -307,10 +307,7 @@
307 307
               <span>序号</span>
308 308
             </template>
309 309
             <template slot-scope="scope">
310
-              <!-- <span v-if="scope.row.is_total == 0">{{scope.$index+1}}</span>
311
-              <span v-if="scope.row.is_total == 1">{{'合计'}}</span> -->
312 310
               {{scope.$index+1}}
313
-            
314 311
             </template>
315 312
           </el-table-column>
316 313
 
@@ -670,7 +667,7 @@ export default {
670 667
     handleSearch(val){
671 668
        console.log("val23233232",val)
672 669
        this.getInitializtion()
673
-       this.getSinleOrderDetail(val.id,val.warehouse_out_time)
670
+       this.getSinleOrderDetail(val.id,val.warehouse_out_time,val.is_sys)
674 671
        this.list = []
675 672
       //  this.getDrugAutoMaticList(val.id,val.time,val.warehouse_out_order_number)
676 673
 
@@ -941,7 +938,7 @@ export default {
941 938
      }
942 939
      return name
943 940
    },
944
-   getSinleOrderDetail(id,start_time){
941
+   getSinleOrderDetail(id,start_time,is_sys){
945 942
        var params = {
946 943
          id:id,
947 944
          start_time:start_time,
@@ -951,17 +948,34 @@ export default {
951 948
           this.tableShow = true
952 949
           this.tableList = []
953 950
           var list =  response.data.data.list
954
-          var outList = response.data.data.outList
955
-          for(let i=0;i<outList.length;i++){
956
-          if(outList[i].count_unit == outList[i].max_unit){
957
-              outList[i].count =outList[i].count * outList[i].min_number
958
-            }
959
-          }
960
-          this.outList = outList
951
+          console.log("list",list)
961 952
          this.manufacturerList = response.data.data.manufacturerList
962 953
          this.dealerList = response.data.data.dealerList
963 954
          var drugFlowList = response.data.data.drugFlowList
964
-         this.drugFlowList = drugFlowList
955
+         if (is_sys == 1){
956
+            for(let i=0;i<drugFlowList.length;i++){
957
+              if(drugFlowList[i].count_unit == drugFlowList[i].XtBaseDrug.max_unit){
958
+                  drugFlowList[i].count = drugFlowList[i].count * drugFlowList[i].XtBaseDrug.min_number
959
+              }
960
+              if(drugFlowList[i].count_unit == drugFlowList[i].XtBaseDrug.min_unit){
961
+                  drugFlowList[i].count = drugFlowList[i].count 
962
+              }
963
+
964
+           }
965
+            this.drugFlowList = drugFlowList
966
+         }
967
+         if(is_sys == 0){
968
+            for(let i=0;i<list.length;i++){
969
+              if(list[i].count_unit == list[i].max_unit){
970
+                  list[i].count = list[i].count * list[i].min_number
971
+              }
972
+              if(list[i].count_unit == list[i].min_unit){
973
+                  list[i].count = list[i].count 
974
+              }
975
+            }
976
+            this.drugFlowList = list
977
+         }
978
+
965 979
          for(let i=0;i<list.length;i++){
966 980
            if(list[i].batch_number == "0" || list[i].batch_number == 0){
967 981
               list[i].batch_number = ""
@@ -983,11 +997,12 @@ export default {
983 997
        drug_id:val.drug_id,
984 998
        record_time:val.sys_record_time,
985 999
      }
1000
+     console.log("使用明细",params)
986 1001
      getAutoDrugDetail(params).then(response=>{
987 1002
        if(response.data.state == 1){
988 1003
         
989 1004
         this.userList = response.data.data.list
990
-        
1005
+        console.log("自动出库数据",this.userList)
991 1006
         if(val.is_sys == 1){
992 1007
         
993 1008
           this.drugDialogVisible = true
@@ -1097,84 +1112,23 @@ export default {
1097 1112
              arr.push(this.drugFlowList[i])
1098 1113
           }
1099 1114
         }
1100
-        var total = 0
1101
-        for(let i=0;i<arr.length;i++){
1102
-          if(arr[i].count_unit == max_unit){
1103
-             arr[i].count = arr[i].count * min_number
1104
-          }
1105
-          if(arr[i].count_unit == min_unit){
1106
-            arr[i].count = arr[i].count
1107
-          }
1108
-          total += arr[i].count
1109
-        }
1110 1115
         var str = ""
1111 1116
         var min_str = ""
1112
-        if(total >= min_number){
1117
+        var total = 0
1118
+        if(arr.length > 0){
1119
+          for(let i=0;i<arr.length;i++){
1120
+             total +=arr[i].count
1121
+          }
1113 1122
           if(parseInt(total/min_number)!=0){
1114
-            str = parseInt(total/min_number)+ max_unit
1123
+              str = parseInt(total/min_number)+ max_unit
1115 1124
           }
1116 1125
           if(total%min_number !=0){
1117 1126
             min_str =  total%min_number + min_unit
1118 1127
           }
1119 1128
         }
1120
-        if (total < min_number){
1121
-          str = ""
1122
-          min_str = total + min_unit
1123
-        }
1124 1129
         return str + min_str 
1125 1130
       },
1126
-    //   getTotalCountOne(id,min_number,max_unit,min_unit){
1127
-       
1128
-    //     for(let i=0;i<this.outList.length;i++){
1129
-    //       if(this.outList[i].count_unit == this.outList[i].max_unit){
1130
-    //         this.outList[i].total_count = this.outList[i].count * this.outList[i].min_number
1131
-    //       }
1132 1131
 
1133
-    //      if(this.outList[i].count_unit == this.outList[i].min_unit){
1134
-    //         this.outList[i].total_count = this.outList[i].count
1135
-    //       }
1136
-       
1137
-    //     }
1138
-    //     console.log("我的",this.outList)
1139
-    //       let dataInfo = {};
1140
-    //       this.outList.forEach((item, index) => {
1141
-    //         let { drug_id } = item;
1142
-    //         if (!dataInfo[drug_id]) {
1143
-    //           dataInfo[drug_id] = {
1144
-    //             drug_id,
1145
-    //             child: [],
1146
-    //             total:0,
1147
-    //           };
1148
-    //         }
1149
-    //       });
1150
-    //     let list = Object.values(dataInfo);
1151
-    //     console.log("drug_id22222",list)
1152
-    //     for(let i=0;i<list.length;i++){
1153
-    //       for(let j=0;j<this.outList.length;j++){
1154
-    //         if(list[i].drug_id == this.outList[j].drug_id){
1155
-    //           list[i].child.push(this.outList[j])
1156
-    //         }
1157
-    //       }
1158
-    //     }
1159
-    //    var total = 0
1160
-    //    for(let i=0;i<list.length;i++){
1161
-    //     for(let j=0;j<list[i].child.length;j++){
1162
-    //        if(id == list[i].child[j].drug_id){
1163
-    //          total+= list[i].child[j].total_count
1164
-    //        }
1165
-    //     }
1166
-    //    }
1167
-      
1168
-    //   var str = ""
1169
-    //   var min_str = ""
1170
-      
1171
-    //   str = parseInt(total/min_number)+ max_unit
1172
-    //   min_str =  total%min_number + min_unit
1173
-
1174
-    //  return str + min_str
1175
-      
1176
-       
1177
-    //  },
1178 1132
       getAllPrice(drug_id,price,min_price){
1179 1133
          var strprice = 0
1180 1134
          var minstrprice = 0
@@ -1198,7 +1152,7 @@ export default {
1198 1152
          return  total_price
1199 1153
       },
1200 1154
       getDrugBatchNumber(drugid,count){
1201
-        console.log("drug_id2323",drug_id)
1155
+        console.log("drug_id2323",drugid)
1202 1156
         console.log("count",count)
1203 1157
         console.log("hhhhhhhhhhh",this.batchNumberList)
1204 1158
         var arr = []
@@ -1275,6 +1229,18 @@ export default {
1275 1229
      formatJson(filterVal, jsonData) {
1276 1230
       return jsonData.map(v => filterVal.map(j => v[j]));
1277 1231
      },
1232
+      getAllPriceOne(drug_id,price,min_price){
1233
+        var total = 0
1234
+        var all_price = 0
1235
+        for(let i=0;i<this.drugFlowList.length;i++){
1236
+          if(drug_id == this.drugFlowList[i].drug_id){
1237
+              total += this.drugFlowList[i].count
1238
+          }
1239
+        }
1240
+        all_price = total * min_price
1241
+        console.log("total",total,min_price)
1242
+        return  all_price
1243
+      },
1278 1244
   }
1279 1245
 };
1280 1246
 </script>

+ 23 - 3
src/xt_pages/stock/drugs/drugStockOutOrderAdd.vue Dosyayı Görüntüle

@@ -126,7 +126,7 @@
126 126
                       placeholder="请输入批号"
127 127
                       v-model="scope.row.batch_number"
128 128
                     ></el-input> -->
129
-                    <el-select v-model="scope.row.batch_number" filterable placeholder="请选择">
129
+                    <el-select v-model="scope.row.batch_number" filterable placeholder="请选择" >
130 130
                       <el-option
131 131
                         v-for="(item,index) in numberList"
132 132
                         :key="index"
@@ -155,7 +155,7 @@
155 155
                     type="number"
156 156
                     v-model="scope.row.count"
157 157
                   ></el-input>
158
-                  <el-select v-model="scope.row.max_unit" filterable placeholder="请选择单位" style="width:80px">
158
+                  <el-select v-model="scope.row.max_unit" filterable placeholder="请选择单位" style="width:80px" @change="changeUnit(scope.row)">
159 159
                     <el-option
160 160
                       v-for="(option, index) in unitList"
161 161
                       :key="index"
@@ -686,8 +686,9 @@ export default {
686 686
             this.recordInfo.recordData[i].max_unit = val.max_unit
687 687
             this.recordInfo.recordData[i].min_number = val.min_number
688 688
             this.recordInfo.recordData[i].min_unit = val.min_unit
689
-          
689
+            this.recordInfo.recordData[i].min_price = val.min_price
690 690
             this.recordInfo.recordData[i].number = val.number
691
+            this.recordInfo.recordData[i].unit = val.max_unit
691 692
             if(val.retail_price == 0){
692 693
               this.recordInfo.recordData[i].price = ""
693 694
             }else{
@@ -719,6 +720,25 @@ export default {
719 720
              this.numberList = list
720 721
            }
721 722
         })
723
+      },
724
+      changeUnit(val){
725
+        console.log("val2323232322323",val,this.recordInfo.recordData)
726
+        this.getDrugBatchNumber(val.drug_id)
727
+        for(let i=0;i<this.recordInfo.recordData.length;i++){
728
+          if(this.recordInfo.recordData[i].drug_id == val.drug_id){
729
+             if(this.recordInfo.recordData[i].unit == val.max_unit){
730
+                this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price
731
+             }
732
+             if(this.recordInfo.recordData[i].min_unit == val.min_unit){
733
+               this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].min_price
734
+             }
735
+          }
736
+          for(let j=0;j<this.numberList.length;j++){
737
+            if(this.recordInfo.recordData[i].batch_number == this.numberList[j].id){
738
+               this.recordInfo.recordData[i].batch_number = this.numberList[j].batch_number
739
+            }
740
+          }
741
+        }
722 742
       }
723 743
   },
724 744
   created() {

+ 52 - 24
src/xt_pages/stock/drugs/inventory.vue Dosyayı Görüntüle

@@ -111,7 +111,8 @@
111 111
         <el-dialog
112 112
         title="药品盘点"
113 113
         :visible.sync="dialogVisible"
114
-        width="1200px">
114
+        width="1200px"
115
+        class="addDrugsDialog">
115 116
             <el-form :model="form" class="modifyDialog" label-width="120px">
116 117
                 <el-form-item label="药品ID">
117 118
                     <el-input v-model="form.drug_id" :disabled="true"></el-input>
@@ -147,11 +148,19 @@
147 148
                 <el-form-item label="规格">
148 149
                     <el-input v-model="form.specification_name" :disabled="true"></el-input>
149 150
                 </el-form-item>
150
-                <!-- <el-form-item label="单位">
151
-                    <el-input v-model="form.warehousing_unit" :disabled="true"></el-input>
152
-                </el-form-item> -->
153
-                 <el-form-item prop="max_unit" label="单位">
154
-                    <el-select v-model="form.warehousing_unit" style="width:160px;" placeholder="单位" @change="changeMaxUnit">
151
+                <el-form-item label="进货价">
152
+                    <el-input v-model="form.last_price" :disabled="true"></el-input>
153
+                </el-form-item>
154
+                <el-form-item label="零售价">
155
+                    <el-input v-model="form.retail_price" :disabled="true"></el-input>
156
+                </el-form-item>
157
+
158
+                <div style="width:100%;display:flex;">
159
+                    <el-form-item prop="dose" label="盘点数量" >
160
+                      <el-input v-model="form.count" type="number" style="width:160px;" placeholder="盘点数量"></el-input>
161
+                    </el-form-item>
162
+                    <el-form-item prop="dose_unit" class="noMargin">
163
+                      <el-select v-model="form.warehousing_unit" style="width:160px;" placeholder="最大单位">
155 164
                       <el-option
156 165
                         v-for="(item,index) in getDataConfig('hemodialysis','units')"
157 166
                         :key="index"
@@ -159,16 +168,22 @@
159 168
                         :value="item.name">
160 169
                       </el-option>
161 170
                     </el-select>
162
-                </el-form-item>
163
-                <el-form-item label="进货价">
164
-                    <el-input v-model="form.last_price" :disabled="true"></el-input>
165
-                </el-form-item>
166
-                <el-form-item label="零售价">
167
-                    <el-input v-model="form.retail_price" :disabled="true"></el-input>
168
-                </el-form-item>
169
-                <el-form-item label="盘点数量">
170
-                    <el-input v-model="form.count"></el-input>
171
-                </el-form-item>
171
+                    </el-form-item>
172
+                    <el-form-item prop="min_count" class="noMargin">
173
+                     <el-input v-model="form.min_count"  style="width:160px;margin-left:10px" placeholder="盘点数量"></el-input>
174
+                    </el-form-item>
175
+                    <el-form-item prop="min_unit" class="noMargin">
176
+                     <el-select v-model="form.min_unit"  style="width:160px;" placeholder="最小单位">
177
+                      <el-option
178
+                        v-for="(item,index) in getDataConfig('hemodialysis','units')"
179
+                        :key="index"
180
+                        :label="item.name"
181
+                        :value="item.name">
182
+                      </el-option>
183
+                    </el-select>
184
+                    </el-form-item>
185
+                </div>
186
+
172 187
                 <el-form-item label="库存">
173 188
                     <el-input v-model="form.total" :disabled="true"></el-input>
174 189
                 </el-form-item>
@@ -572,6 +587,8 @@ export default {
572 587
                 expiry_date:"",
573 588
                 warehouse_info_id:"",
574 589
                 proof_count:"",
590
+                min_count:"",
591
+                min_unit:"",
575 592
             },
576 593
             total: 0,
577 594
             editdialogVisible:false,
@@ -1111,16 +1128,13 @@ export default {
1111 1128
          if(response.data.state == 1){
1112 1129
            var list = response.data.data.list
1113 1130
            console.log("list",list)
1114
-        
1115
-          if(list.stock_max_number > 0){
1131
+          
1132
+          if(list.stock_max_number >0 ){
1116 1133
             this.form.total = list.stock_max_number + list.XtBaseDrug.max_unit
1117
-            this.form.stock_max_number = list.stock_max_number
1118 1134
           }
1119
-          if(list.stock_min_number >0 ){
1120
-            this.form.total = list.stock_min_number + list.XtBaseDrug.min_unit
1121
-            this.form.stock_min_number = list.stock_min_number
1135
+          if(list.stock_min_number > 0){
1136
+            this.form.total =  this.form.total + list.stock_min_number + list.XtBaseDrug.min_unit 
1122 1137
           }
1123
-          
1124 1138
          }
1125 1139
       })
1126 1140
      },
@@ -1140,4 +1154,18 @@ export default {
1140 1154
     mounted() {
1141 1155
     },
1142 1156
 };
1143
-</script>
1157
+</script>
1158
+<style lang="scss">
1159
+    .addDrugsDialog {
1160
+
1161
+      .el-dialog__body {
1162
+          padding-top: 0px;
1163
+      }
1164
+      .noMargin{
1165
+        .el-form-item__content{
1166
+          margin-left: 0 !important;
1167
+        }
1168
+      }
1169
+
1170
+    }
1171
+</style>

+ 81 - 7
src/xt_pages/stock/drugs/query.vue Dosyayı Görüntüle

@@ -112,15 +112,20 @@
112 112
         </el-table-column>
113 113
         <el-table-column prop="drug_name" label="出库数量" align="center">
114 114
            <template slot-scope="scope">
115
-              <span>{{getOutCount(scope.row.id)+getAutoCount(scope.row.id)}}{{scope.row.max_unit}}</span>
116
-              <!-- <span v-else>{{getWarehouseOutInfo(scope.row.drug_warehouse_out,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span>  -->
115
+             <span v-if="org_id == 9671 || org_id == 9675 || org_id == 4">
116
+                <span v-if="scope.row.drug_warehouse_out.length > 0"></span> {{getDrugOutList(scope.row.drug_warehouse_out,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}
117
+             </span>
118
+             <span v-else>{{getOutCount(scope.row.id)+getAutoCount(scope.row.id)}}{{scope.row.max_unit}}</span>
117 119
            </template>
118 120
         </el-table-column>
119 121
         <el-table-column prop="drug_name" label="剩余库存量" align="center">
120 122
            <template slot-scope="scope">
121 123
             <div v-if="getWarehoseInfo(scope.row.drug_warehouse_info)!=0">
122
-               <span>{{getWarehoseInfo(scope.row.drug_warehouse_info) - getOutCount(scope.row.id) - getAutoCount(scope.row.id)}}{{scope.row.max_unit}} </span>
123
-               <!-- <span v-else>{{getOverFlushInfo(scope.row.drug_warehouse_info,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span>  -->
124
+               <span v-if="org_id == 9671 || org_id == 9675 || org_id == 4">
125
+                 {{getDrugChaCount(scope.row.drug_warehouse_info,scope.row.drug_warehouse_out,scope.row.max_unit,scope.row.min_unit,scope.row.min_number,scope.row.drug_cancel_stock_info)}}
126
+               </span>
127
+               
128
+               <span v-else>{{getWarehoseInfo(scope.row.drug_warehouse_info) - getOutCount(scope.row.id) - getAutoCount(scope.row.id)}}{{scope.row.max_unit}} </span>
124 129
             </div>
125 130
            </template>
126 131
         </el-table-column>
@@ -173,7 +178,17 @@ import { min } from 'moment'
173 178
   export default {
174 179
     name: 'stockIn',
175 180
     created() {
176
-      
181
+      var start_time =  window.sessionStorage.getItem('start_time')
182
+      var end_time =  window.sessionStorage.getItem('end_time')
183
+      console.log("start_time",start_time,end_time)
184
+      if(start_time !=null){
185
+        this.start_time = start_time
186
+      }
187
+      if(end_time!=null){
188
+        this.end_time = end_time
189
+      }
190
+      window.sessionStorage.removeItem('start_time')
191
+      window.sessionStorage.removeItem('end_time')
177 192
       this.getlist()
178 193
       var drugCategory = getDictionaryDataConfig('system','drug_category')
179 194
       this.drugCategory.push(...drugCategory)
@@ -237,7 +252,6 @@ import { min } from 'moment'
237 252
     methods: {
238 253
      //获取库存
239 254
       getlist(){
240
-      
241 255
         const params = {
242 256
           page: this.page,
243 257
           limit: this.limit,
@@ -260,6 +274,11 @@ import { min } from 'moment'
260 274
                     list[i].drug_warehouse_out[y].count = list[i].drug_warehouse_out[y].count * list[i].min_number
261 275
                   }
262 276
                }
277
+               for(let z=0;z<list[i].drug_cancel_stock_info.length;z++){
278
+                 if(list[i].drug_cancel_stock_info[z].max_unit == list[i].max_unit){
279
+                   list[i].drug_cancel_stock_info[z].count = list[i].drug_cancel_stock_info[z].count * list[i].min_number
280
+                 } 
281
+               }
263 282
              }
264 283
              console.log("列表list232323323232323223",list)
265 284
              this.tableList = list
@@ -354,8 +373,8 @@ import { min } from 'moment'
354 373
       },
355 374
   
356 375
     startTimeChange: function(val) {
376
+      window.sessionStorage.removeItem('start_time')
357 377
       var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
358
-      
359 378
       if (time > 0) {
360 379
         this.$message.error("开始时间不能大于结束时间");
361 380
         this.start_time = "";
@@ -365,6 +384,7 @@ import { min } from 'moment'
365 384
       }
366 385
     },
367 386
     endTimeChange: function(val) {
387
+      window.sessionStorage.removeItem('end_time')
368 388
       var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
369 389
       if (time < 0) {
370 390
         this.$message.error("结束时间不能小于开始时间");
@@ -453,6 +473,8 @@ import { min } from 'moment'
453 473
         this.getlist()
454 474
       },
455 475
       printOrder(){
476
+        window.sessionStorage.setItem('start_time',this.start_time)
477
+        window.sessionStorage.setItem('end_time',this.end_time)
456 478
         this.$router.push({
457 479
           name: "drugQueryPrint",
458 480
           query: {drug_type:this.drug_type,keyword:this.keywords,start_time:this.start_time,end_time:this.end_time,page:this.page,limit:this.limit}
@@ -488,6 +510,8 @@ import { min } from 'moment'
488 510
         }
489 511
         var unit =  val.dose + val.dose_unit +"*"+val.min_number+val.min_unit+"/"+val.max_unit
490 512
         var overPlus = this.getOverFlushInfo(val.drug_warehouse_info,val.max_unit,val.min_unit,val.min_number)
513
+        window.sessionStorage.setItem('start_time',this.start_time)
514
+        window.sessionStorage.setItem('end_time',this.end_time)
491 515
         this.$router.push({path:'/drugstock/in/drugstockflow?drug_id='+val.id+"&drug_name="+val.drug_name+"&manufacturer="+manufacturer_name+"&unit="+unit+"&min_number="+val.min_number+"&max_unit="+val.max_unit+"&min_unit="+val.min_unit+"&overPlus="+overPlus})
492 516
       },
493 517
       handleBatch(val){
@@ -499,6 +523,8 @@ import { min } from 'moment'
499 523
         }
500 524
         var unit =  val.dose + val.dose_unit +"*"+val.min_number+val.min_unit+"/"+val.max_unit
501 525
         var overPlus = this.getOverFlushInfo(val.drug_warehouse_info,val.max_unit,val.min_unit,val.min_number)
526
+        window.sessionStorage.setItem('start_time',this.start_time)
527
+        window.sessionStorage.setItem('end_time',this.end_time)
502 528
         this.$router.push({path:'/drugstock/in/drugbatchnumber?drug_id='+val.id+"&drug_name="+val.drug_name+"&manufacturer="+manufacturer_name+"&unit="+unit+"&min_number="+val.min_number+"&max_unit="+val.max_unit+"&min_unit="+val.min_unit+"&overPlus="+overPlus})
503 529
       },
504 530
       getDrugCountList(){
@@ -715,6 +741,54 @@ import { min } from 'moment'
715 741
          }
716 742
         return max_str + min_str
717 743
 
744
+      },
745
+
746
+      getDrugOutList(arr,max_unit,min_unit,min_number){
747
+        var str = ""
748
+        var str_min = ""
749
+        if(arr.length > 0){
750
+          for(let i=0;i<arr.length;i++){
751
+           if(parseInt(arr[i].count/min_number)!=0){
752
+              str = parseInt(arr[i].count/min_number)+ max_unit
753
+            }
754
+            if(arr[i].count%min_number !=0){
755
+              str_min =  arr[i].count%min_number + min_unit
756
+            }
757
+          }
758
+        }
759
+        return str + str_min
760
+      },
761
+
762
+      getDrugChaCount(info,out_info,max_unit,min_unit,min_number,cancel_info){
763
+        var total_info = 0
764
+        var total_out = 0
765
+        var cha_count = 0
766
+        var cancel_count = 0
767
+        if(info.length > 0 ){
768
+          for(let i=0;i<info.length;i++){
769
+            total_info += info[i].warehousing_count * min_number
770
+          }
771
+        }
772
+        if(out_info.length>0){
773
+          for(let j=0;j<out_info.length;j++){
774
+            total_out += out_info[j].count
775
+          }
776
+        }
777
+        if(cancel_info.length >0){
778
+         for(let z=0;z<cancel_info.length;z++){
779
+            cancel_count +=cancel_info[z].count
780
+         }
781
+        }
782
+        cha_count = total_info - total_out + cancel_count
783
+        var str = ""
784
+        var str_min = ""
785
+        if(parseInt(cha_count/min_number)!=0){
786
+            str = parseInt(cha_count/min_number)+ max_unit
787
+         }
788
+         if(cha_count%min_number !=0){
789
+           str_min =  cha_count%min_number + min_unit
790
+         }
791
+         return str + str_min
718 792
       }
719 793
     }
720 794
   }

+ 2 - 2
src/xt_pages/stock/stockFlow.vue Dosyayı Görüntüle

@@ -112,11 +112,11 @@
112 112
              <span>{{getTime(scope.row.expire_date,"{y}-{h}-{d}")}}</span>
113 113
            </template>
114 114
         </el-table-column>
115
-        <el-table-column prop="drug_name" label="批准文号" align="center">
115
+        <!-- <el-table-column prop="drug_name" label="批准文号" align="center">
116 116
            <template slot-scope="scope" >
117 117
              <span>{{scope.row.license_number}}</span>
118 118
            </template>
119
-        </el-table-column>
119
+        </el-table-column> -->
120 120
         <el-table-column prop="drug_name" label="生产商" align="center">
121 121
            <template slot-scope="scope">
122 122
              <span > {{getManufacturer(scope.row.manufacturer)}}</span>

+ 30 - 30
src/xt_pages/stock/stockOutOrder.vue Dosyayı Görüntüle

@@ -637,15 +637,6 @@
637 637
                <span v-if="scope.row.is_total ==0">{{scope.row.number}}</span>
638 638
             </template>
639 639
           </el-table-column>
640
-<!-- 
641
-          <el-table-column min-width="70" align="center">
642
-            <template slot="header" slot-scope="scope">
643
-              <span>批次详情</span>
644
-            </template>
645
-            <template slot-scope="scope">
646
-              <span v-if="scope.row.is_total == 0">批次详情</span>
647
-            </template>
648
-          </el-table-column> -->
649 640
         </el-table>
650 641
       </el-row>
651 642
     </div>
@@ -1100,19 +1091,18 @@ export default {
1100 1091
         getOrderDetailByOrderId(params).then(response=>{
1101 1092
             if(response.data.state == 1){
1102 1093
               this.tableShow = true
1103
-              var list = response.data.data.list
1104
-              // console.log("list22222222",list)
1105
-              // for(let i=0;i<list.length;i++){
1106
-              //   if(list[i].dealer == 0){
1107
-              //     list[i].dealer = ""
1108
-              //   }
1109
-              //   if(list[i].manufacturer == 0){
1110
-              //     list[i].manufacturer = ""
1111
-              //   }
1112
-              //   this.tableList.push(list[i])
1113
-              // }
1094
+              var info = response.data.data.list
1095
+              console.log("list22222222",info)
1114 1096
               var list = response.data.data.info
1097
+              for(let i=0;i<info.length;i++){
1098
+                for(let j=0;j<list.length;j++){
1099
+                  if(info[i].good_id == list[j].good_id){
1100
+                     list[j].count = info[i].count
1101
+                  }
1102
+                }
1103
+              }
1115 1104
               console.log("info2232323",list)
1105
+              this.tableList = []
1116 1106
               for(let i=0;i<list.length;i++){
1117 1107
                 if(list[i].dealer == 0){
1118 1108
                   list[i].dealer = ""
@@ -1538,16 +1528,7 @@ export default {
1538 1528
               var stockflowlist = response.data.data.stockFlowList
1539 1529
               console.log("stockflowlist",stockflowlist)
1540 1530
               this.stockFlowList = stockflowlist
1541
-              // for (let i = 0; i < arrList.length; i++) {
1542
-              //   var obj = arrList[i]
1543
-              //   obj['is_total'] = 0
1544
-              //   this.userList.push(obj)
1545
-              //   total = total + arrList[i].count
1546
-              // }
1547
-              // this.userList.push({
1548
-              //   is_total: 1,
1549
-              //   total: total,
1550
-              // })
1531
+             
1551 1532
 
1552 1533
               for (let i = 0; i <  this.stockFlowList.length; i++) {
1553 1534
                 var obj =  this.stockFlowList[i]
@@ -1673,6 +1654,24 @@ export default {
1673 1654
     formatJson(filterVal, jsonData) {
1674 1655
     return jsonData.map(v => filterVal.map(j => v[j]));
1675 1656
    },
1657
+   unique(arr) {
1658
+      let newArr = [arr[0]];
1659
+      for (let i = 1; i < arr.length; i++) {
1660
+          let repeat = false;
1661
+          for (let j = 0; j < newArr.length; j++) {
1662
+              if (arr[i] === newArr[j]) {
1663
+                  repeat = true;
1664
+                  break;
1665
+              }else{
1666
+                  
1667
+              }
1668
+          }
1669
+          if (!repeat) {
1670
+              newArr.push(arr[i]);
1671
+          }
1672
+      }
1673
+      return newArr;
1674
+    },
1676 1675
    getBatchNumber(patient_id,good_id){
1677 1676
      var arr = []
1678 1677
      for(let i=0;i<this.stockFlowList.length;i++){
@@ -1680,6 +1679,7 @@ export default {
1680 1679
            arr.push(this.stockFlowList[i].number)
1681 1680
         }
1682 1681
      }
1682
+     arr = this.unique(arr)
1683 1683
      return arr.join(',')
1684 1684
    }
1685 1685
   }

+ 5 - 3
src/xt_pages/stock/stockPrint.vue Dosyayı Görüntüle

@@ -42,11 +42,13 @@
42 42
                                       <span v-if="getWareInfo(item.xt_warehouse_info)>0">{{getWareInfo(item.xt_warehouse_info)}}{{item.packing_unit}}</span>
43 43
                                    </td>
44 44
                                    <td>
45
-                                       <span v-if="getWareInfo(item.xt_warehouse_info)>0">{{getWareInfo(item.xt_warehouse_info) - getOverplus(item.xt_warehouse_info) - getCancelInfo(item.cancel_stock_info)}}{{item.packing_unit}}</span>
45
+                                        {{getAutoCount(item.id) + getOutCount(item.id)}}
46
+                                       <!-- <span v-if="getWareInfo(item.xt_warehouse_info)>0">{{getWareInfo(item.xt_warehouse_info) - getOverplus(item.xt_warehouse_info) - getCancelInfo(item.cancel_stock_info)}}{{item.packing_unit}}</span> -->
46 47
                                    </td>
47 48
                                   
48 49
                                    <td>
49
-                                     <span v-if="getOverplus(item.xt_warehouse_info)>0">{{getOverplus(item.xt_warehouse_info)}}{{item.packing_unit}}</span>  
50
+                                     <span v-if="getWareInfo(item.xt_warehouse_info) > 0">{{getWareInfo(item.xt_warehouse_info) - getAutoCount(item.id) - getOutCount(item.id) + getCancelCount(item.id) }}</span> 
51
+                                     <!-- <span v-if="getOverplus(item.xt_warehouse_info)>0">{{getOverplus(item.xt_warehouse_info)}}{{item.packing_unit}}</span>   -->
50 52
                                    </td>
51 53
                                 </tr>
52 54
                             </tbody>
@@ -303,7 +305,7 @@ export default {
303 305
       this.limit = this.$route.query.limit
304 306
       this.getlist()
305 307
       this.GetAllGoodType()
306
-      // this.getStockDrugCount()
308
+      this.getStockDrugCount()
307 309
     }
308 310
 }
309 311
 </script>

+ 24 - 4
src/xt_pages/stock/stockQuery.vue Dosyayı Görüntüle

@@ -110,14 +110,12 @@
110 110
        <el-table-column label="出库数量" align="center">
111 111
          <template slot-scope="scope">
112 112
             {{getAutoCount(scope.row.id) + getOutCount(scope.row.id)}}
113
-            <!-- <span v-if="getWareInfo(scope.row.xt_warehouse_info)>0">{{getWareInfo(scope.row.xt_warehouse_info) - getOverplus(scope.row.xt_warehouse_info) - getCancelInfo(scope.row.cancel_stock_info)}}{{scope.row.packing_unit}}</span> -->
114 113
          </template>
115 114
        </el-table-column>
116 115
 
117 116
        <el-table-column label="剩余库存量" align="center">
118 117
          <template slot-scope="scope">
119 118
           <span v-if="getWareInfo(scope.row.xt_warehouse_info) > 0">{{getWareInfo(scope.row.xt_warehouse_info) - getAutoCount(scope.row.id) - getOutCount(scope.row.id) + getCancelCount(scope.row.id) }}</span> 
120
-           <!-- <span v-if="getOverplus(scope.row.xt_warehouse_info)>0">{{getOverplus(scope.row.xt_warehouse_info)}}{{scope.row.packing_unit}}</span> -->
121 119
          </template>
122 120
        </el-table-column>
123 121
        <el-table-column label="操作" align="center" width="260px">
@@ -167,6 +165,18 @@ import {
167 165
 export default {
168 166
   name: "stockIn",
169 167
   created() {
168
+    var start_time =  window.sessionStorage.getItem('start_time')
169
+    var end_time =  window.sessionStorage.getItem('end_time')
170
+    console.log("start_time",start_time,end_time)
171
+    if(start_time !=null){
172
+      this.start_time = start_time
173
+    }
174
+    if(end_time!=null){
175
+      this.end_time = end_time
176
+    }
177
+   
178
+    window.sessionStorage.removeItem('start_time')
179
+    window.sessionStorage.removeItem('end_time')
170 180
     var nowDate = new Date();
171 181
     var nowYear = nowDate.getFullYear();
172 182
     var nowMonth = nowDate.getMonth() + 1;
@@ -333,8 +343,10 @@ export default {
333 343
       return Math.round(parseFloat(val) * 100) / 100;
334 344
     },
335 345
     startTimeChange: function(val) {
346
+      window.sessionStorage.removeItem('start_time')
347
+     
336 348
       var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
337
-
349
+      console.log("ime2222",time)
338 350
       if (time > 0) {
339 351
         this.$message.error("开始时间不能大于结束时间");
340 352
         this.start_time = "";
@@ -346,7 +358,9 @@ export default {
346 358
       }
347 359
     },
348 360
     endTimeChange: function(val) {
361
+      window.sessionStorage.removeItem('end_time')
349 362
       var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
363
+      console.log("ime2222",time)
350 364
       if (time < 0) {
351 365
         this.$message.error("结束时间不能小于开始时间");
352 366
         this.end_time = "";
@@ -434,6 +448,8 @@ export default {
434 448
        this.getlist()
435 449
       },
436 450
       toPrint(){
451
+        window.sessionStorage.setItem('start_time',this.start_time)
452
+        window.sessionStorage.setItem('end_time',this.end_time)
437 453
         this.$router.push("/stock/stockprint?start_time="+this.start_time+"&end_time="+this.end_time+"&keyword="+this.keywords+"&type_name="+this.type_name+"&page="+this.page+"&limit="+this.limit)
438 454
 
439 455
       },
@@ -504,6 +520,8 @@ export default {
504 520
        }
505 521
       specification_name = val.specification_name + "/" + val.packing_unit
506 522
       var overCount  = this.getOverplus(val.xt_warehouse_info)
523
+      window.sessionStorage.setItem('start_time',this.start_time)
524
+      window.sessionStorage.setItem('end_time',this.end_time)
507 525
       this.$router.push({path:"/stock/in/stockflow?id="+val.id+"&good_name="+val.good_name+"&manufacturer="+manufacturer_name+"&specification_name="+specification_name+"&packing_unit="+val.packing_unit+"&overCount="+overCount})
508 526
     },
509 527
     toClickOne(val){
@@ -515,7 +533,9 @@ export default {
515 533
           }
516 534
        }
517 535
       specification_name = val.specification_name + "/" + val.packing_unit
518
-       var overCount  = this.getOverplus(val.xt_warehouse_info)
536
+      var overCount  = this.getOverplus(val.xt_warehouse_info)
537
+      window.sessionStorage.setItem('start_time',this.start_time)
538
+      window.sessionStorage.setItem('end_time',this.end_time)
519 539
       this.$router.push({path:"/stock/in/stockbatchnumber?id="+val.id+"&good_name="+val.good_name+"&manufacturer="+manufacturer_name+"&specification_name="+specification_name+"&packing_unit="+val.packing_unit+"&overCount="+overCount})
520 540
     },
521 541
     getStockDrugCount(){