XMLWAN 3 years ago
parent
commit
32bec4bd07

+ 8 - 0
src/api/stock.js View File

@@ -625,3 +625,11 @@ export function getAllStockList(params) {
625 625
     params: params
626 626
   })
627 627
 }
628
+
629
+export function getStockDrugCount(params) {
630
+  return request({
631
+    url: '/api/good/getstockdrugcount',
632
+    method: 'get',
633
+    params: params
634
+  })
635
+}

+ 18 - 7
src/xt_pages/stock/stockInOrder.vue View File

@@ -71,9 +71,9 @@
71 71
           @change="changeAllSelected"
72 72
           >全选</el-checkbox
73 73
         >
74
-        <el-button size="small" icon="el-icon-delete" @click="batchDelete"
75
-          >删除</el-button
76
-        >
74
+        <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
75
+
76
+        <el-button size="small" type="primary" @click="toPrint">打印</el-button>
77 77
       </div>
78 78
 
79 79
       <el-table
@@ -188,7 +188,7 @@
188 188
     </div>
189 189
 
190 190
 
191
-   <div v-show="tableShow" style="margin-bottom:10px">
191
+   <div v-show="tableShow" style="margin-top:80px">
192 192
       <el-table
193 193
         :data="tableList"
194 194
         :class="signAndWeighBoxPatients"
@@ -204,8 +204,8 @@
204 204
           color: '#606266'
205 205
         }"
206 206
       >
207
-       <el-table-column align="center" type="selection" width="55">
208
-       </el-table-column>
207
+       <!-- <el-table-column align="center" type="selection" width="55">
208
+       </el-table-column> -->
209 209
 
210 210
        <el-table-column label="耗材名称" align="center">
211 211
           <template slot-scope="scope">
@@ -790,7 +790,8 @@ export default {
790 790
       drug_id:1,
791 791
       tableShow:false,
792 792
       tableList:[],
793
-      isVisibility:false
793
+      isVisibility:false,
794
+      order_id:0,
794 795
     };
795 796
     
796 797
   
@@ -1119,7 +1120,10 @@ export default {
1119 1120
       }
1120 1121
     },
1121 1122
     select(selection) {
1123
+      this.order_id = selection[0].id
1124
+      console.log("selection",selection)
1122 1125
       this.selectedTableData = selection;
1126
+
1123 1127
     },
1124 1128
     batchDelete() {
1125 1129
       if (this.selectedTableData.length <= 0) {
@@ -1465,6 +1469,13 @@ export default {
1465 1469
 
1466 1470
       this.propForm.goodType = [];
1467 1471
     },
1472
+    toPrint(){
1473
+      if(this.order_id == 0){
1474
+        this.$message.error("请勾选入库单")
1475
+      }else{
1476
+        this.$router.push("/stock/in/detail/print?id="+this.order_id)
1477
+      }
1478
+    }
1468 1479
   }
1469 1480
 };
1470 1481
 </script>

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

@@ -76,7 +76,7 @@
76 76
                   >
77 77
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
78 78
                   <template slot-scope="{ item }">
79
-                    <div class="name">{{ item.good_name }}</div>
79
+                    <div class="name">{{ item.good_name +"  " +item.specification_name }}</div>
80 80
                   </template>
81 81
                  </el-autocomplete>
82 82
             </template>

+ 5 - 5
src/xt_pages/stock/stockInOrderEdit.vue View File

@@ -50,7 +50,7 @@
50 50
         </el-date-picker>
51 51
       </div>
52 52
 
53
-      <div class="cell clearfix">
53
+      <!-- <div class="cell clearfix">
54 54
         <label class="title"><span class="name">经销商</span> : </label>
55 55
         <el-select
56 56
           size="small"
@@ -66,9 +66,9 @@
66 66
           >
67 67
           </el-option>
68 68
         </el-select>
69
-      </div>
69
+      </div> -->
70 70
 
71
-      <div class="cell clearfix">
71
+      <!-- <div class="cell clearfix">
72 72
         <label class="title"><span class="name">厂商</span> : </label>
73 73
 
74 74
         <el-select
@@ -85,7 +85,7 @@
85 85
           >
86 86
           </el-option>
87 87
         </el-select>
88
-      </div>
88
+      </div> -->
89 89
 
90 90
       <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
91 91
         <el-table
@@ -115,7 +115,7 @@
115 115
                   >
116 116
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
117 117
                   <template slot-scope="{ item }">
118
-                    <div class="name">{{ item.good_name }}</div>
118
+                    <div class="name">{{ item.good_name +" " + item.specification_name}}</div>
119 119
                   </template>
120 120
                  </el-autocomplete>
121 121
             </template>

+ 69 - 6
src/xt_pages/stock/stockQuery.vue View File

@@ -185,14 +185,25 @@
185 185
             {{scope.row.price}}
186 186
           </template>
187 187
         </el-table-column>
188
-        <el-table-column label="厂商">
188
+        <el-table-column label="厂商" align="center">
189 189
           <template slot-scope="scope">
190 190
            {{getManufacture(scope.row.manufacturer)}}
191 191
           </template>
192 192
         </el-table-column>
193
-       <el-table-column label="剩余库存量">
193
+       <el-table-column label="入库数量" align="center">
194 194
          <template slot-scope="scope">
195
-          <span v-if="scope.row.stock_count!=0">{{scope.row.stock_count}}</span>
195
+          <span>{{getInCount(scope.row.good_id)}}</span>
196
+         </template>
197
+       </el-table-column> 
198
+       <el-table-column label="出库数量" align="center">
199
+         <template slot-scope="scope">
200
+           <span>{{getOutCount(scope.row.good_id)+getAutoCount(scope.row.good_id)}}</span>
201
+          
202
+         </template>
203
+       </el-table-column> 
204
+       <el-table-column label="剩余库存量" align="center">
205
+         <template slot-scope="scope">
206
+           {{getInCount(scope.row.good_id)- getOutCount(scope.row.good_id) - getAutoCount(scope.row.good_id)}}
196 207
          </template>
197 208
        </el-table-column>
198 209
        <el-table-column label="操作" align="center" width="260px">
@@ -252,7 +263,8 @@ import {
252 263
   GetAllGoodInfo,
253 264
   GetAllGoodType,
254 265
   getAllStockQueryList,
255
-  getAllStockList
266
+  getAllStockList,
267
+  getStockDrugCount
256 268
 } from "@/api/stock";
257 269
 
258 270
 export default {
@@ -262,6 +274,7 @@ export default {
262 274
     this.GetAllGoodInfo();
263 275
     this.GetAllGoodType();
264 276
     this.getlist()
277
+    this.getStockDrugCount()
265 278
   },
266 279
   components: {
267 280
     BreadCrumb
@@ -291,7 +304,10 @@ export default {
291 304
       type_name:0,
292 305
       types:[],
293 306
       tableList:[],
294
-      manufacturerList:[]
307
+      manufacturerList:[],
308
+      countList:[],
309
+      outCountList:[],
310
+      autoCountList:[],
295 311
     };
296 312
   },
297 313
   methods: {
@@ -548,7 +564,54 @@ export default {
548 564
     },
549 565
     toClickOne(val){
550 566
       this.$router.push({path:"/stock/in/stockbatchnumber?id="+val.good_id+"&good_name="+val.good_name})
551
-    }
567
+    },
568
+    getStockDrugCount(){
569
+        var params ={
570
+          keywords: this.keywords,
571
+          start_time:this.start_time,
572
+          end_time:this.end_time,
573
+        }
574
+      getStockDrugCount(params).then(response=>{
575
+         if(response.data.state == 1){
576
+           var count = response.data.data.count
577
+           console.log("入库统计",count)
578
+           this.countList = count
579
+           var outlist = response.data.data.outList
580
+           console.log("出库数量",outlist)
581
+           this.outCountList = outlist
582
+           var autoCount = response.data.data.autoCount
583
+           console.log("autoCount",autoCount)
584
+           this.autoCountList = autoCount
585
+         }
586
+      })
587
+    },
588
+    getInCount(id){
589
+      var count= ""
590
+     for(let i=0;i<this.countList.length;i++){
591
+      if(id == this.countList[i].good_id){
592
+          count = this.countList[i].count
593
+      }
594
+     }
595
+     return count
596
+    },
597
+    getOutCount(id){
598
+      var count = ""
599
+      for(let i=0;i<this.outCountList.length;i++){
600
+         if(id == this.outCountList[i].good_id){
601
+           count = this.outCountList[i].count
602
+         }
603
+      }
604
+      return count
605
+    },
606
+   getAutoCount(id){
607
+     var count= ""
608
+     for(let i=0;i<this.autoCountList.length;i++){
609
+       if(id == this.autoCountList[i].good_id){
610
+         count = this.outCountList[i].count
611
+       }
612
+     }
613
+     return count
614
+   }
552 615
   }
553 616
 };
554 617
 </script>