XMLWAN 3 years ago
parent
commit
32bec4bd07

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

625
     params: params
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
           @change="changeAllSelected"
71
           @change="changeAllSelected"
72
           >全选</el-checkbox
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
       </div>
77
       </div>
78
 
78
 
79
       <el-table
79
       <el-table
188
     </div>
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
       <el-table
192
       <el-table
193
         :data="tableList"
193
         :data="tableList"
194
         :class="signAndWeighBoxPatients"
194
         :class="signAndWeighBoxPatients"
204
           color: '#606266'
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
        <el-table-column label="耗材名称" align="center">
210
        <el-table-column label="耗材名称" align="center">
211
           <template slot-scope="scope">
211
           <template slot-scope="scope">
790
       drug_id:1,
790
       drug_id:1,
791
       tableShow:false,
791
       tableShow:false,
792
       tableList:[],
792
       tableList:[],
793
-      isVisibility:false
793
+      isVisibility:false,
794
+      order_id:0,
794
     };
795
     };
795
     
796
     
796
   
797
   
1119
       }
1120
       }
1120
     },
1121
     },
1121
     select(selection) {
1122
     select(selection) {
1123
+      this.order_id = selection[0].id
1124
+      console.log("selection",selection)
1122
       this.selectedTableData = selection;
1125
       this.selectedTableData = selection;
1126
+
1123
     },
1127
     },
1124
     batchDelete() {
1128
     batchDelete() {
1125
       if (this.selectedTableData.length <= 0) {
1129
       if (this.selectedTableData.length <= 0) {
1465
 
1469
 
1466
       this.propForm.goodType = [];
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
 </script>
1481
 </script>

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

76
                   >
76
                   >
77
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
77
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
78
                   <template slot-scope="{ item }">
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
                   </template>
80
                   </template>
81
                  </el-autocomplete>
81
                  </el-autocomplete>
82
             </template>
82
             </template>

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

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

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

185
             {{scope.row.price}}
185
             {{scope.row.price}}
186
           </template>
186
           </template>
187
         </el-table-column>
187
         </el-table-column>
188
-        <el-table-column label="厂商">
188
+        <el-table-column label="厂商" align="center">
189
           <template slot-scope="scope">
189
           <template slot-scope="scope">
190
            {{getManufacture(scope.row.manufacturer)}}
190
            {{getManufacture(scope.row.manufacturer)}}
191
           </template>
191
           </template>
192
         </el-table-column>
192
         </el-table-column>
193
-       <el-table-column label="剩余库存量">
193
+       <el-table-column label="入库数量" align="center">
194
          <template slot-scope="scope">
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
          </template>
207
          </template>
197
        </el-table-column>
208
        </el-table-column>
198
        <el-table-column label="操作" align="center" width="260px">
209
        <el-table-column label="操作" align="center" width="260px">
252
   GetAllGoodInfo,
263
   GetAllGoodInfo,
253
   GetAllGoodType,
264
   GetAllGoodType,
254
   getAllStockQueryList,
265
   getAllStockQueryList,
255
-  getAllStockList
266
+  getAllStockList,
267
+  getStockDrugCount
256
 } from "@/api/stock";
268
 } from "@/api/stock";
257
 
269
 
258
 export default {
270
 export default {
262
     this.GetAllGoodInfo();
274
     this.GetAllGoodInfo();
263
     this.GetAllGoodType();
275
     this.GetAllGoodType();
264
     this.getlist()
276
     this.getlist()
277
+    this.getStockDrugCount()
265
   },
278
   },
266
   components: {
279
   components: {
267
     BreadCrumb
280
     BreadCrumb
291
       type_name:0,
304
       type_name:0,
292
       types:[],
305
       types:[],
293
       tableList:[],
306
       tableList:[],
294
-      manufacturerList:[]
307
+      manufacturerList:[],
308
+      countList:[],
309
+      outCountList:[],
310
+      autoCountList:[],
295
     };
311
     };
296
   },
312
   },
297
   methods: {
313
   methods: {
548
     },
564
     },
549
     toClickOne(val){
565
     toClickOne(val){
550
       this.$router.push({path:"/stock/in/stockbatchnumber?id="+val.good_id+"&good_name="+val.good_name})
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
 </script>
617
 </script>