XMLWAN 3 years ago
parent
commit
f6c8203518

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

@@ -641,3 +641,11 @@ export function getOrderDetailByOrderId(params) {
641 641
     params: params
642 642
   })
643 643
 }
644
+
645
+export function getOrderDetailById(params) {
646
+  return request({
647
+    url: '/api/good/getorderdetaibyid',
648
+    method: 'Get',
649
+    params: params
650
+  })
651
+}

+ 8 - 26
src/xt_pages/stock/stockBatchNumber.vue View File

@@ -166,15 +166,13 @@
166 166
       }
167 167
     },
168 168
     methods:{
169
-    
170
-     
171 169
        handleSizeChange(val) {
172 170
         this.limit = val
173
-        this.GetAllDrugStockQueryList()
171
+        this.getlist()
174 172
       },
175 173
       handleCurrentChange(val) {
176 174
         this.page = val
177
-        this.GetAllDrugStockQueryList()
175
+        this.getlist()
178 176
       },
179 177
         
180 178
     startTimeChange: function(val) {
@@ -184,7 +182,7 @@
184 182
         this.$message.error("开始时间不能大于结束时间");
185 183
         this.start_time = "";
186 184
       } else {
187
-        this.GetAllDrugStockQueryList();
185
+        this.getlist()
188 186
       }
189 187
     },
190 188
     endTimeChange: function(val) {
@@ -193,7 +191,7 @@
193 191
         this.$message.error("结束时间不能小于开始时间");
194 192
         this.end_time = "";
195 193
       } else {
196
-        this.GetAllDrugStockQueryList();
194
+       this.getlist()
197 195
       }
198 196
      },
199 197
      changeDrug(){},
@@ -238,26 +236,10 @@
238 236
          }
239 237
       })
240 238
      },
241
-    //  getOutList(){
242
-    //   var params= {
243
-    //       limit:this.limit,
244
-    //       page:this.page,
245
-    //       id:this.$route.query.id,
246
-    //       start_time:this.start_time,
247
-    //       end_time:this.end_time, 
248
-    //     } 
249
-    //    getStockOutList(params).then(response=>{
250
-    //       if(response.data.state == 1){
251
-    //          var outlist = response.data.data.outList
252
-    //          console.log("出库数据",outlist)
253
-    //          for(let i=0;i<outlist.length;i++){
254
-    //            outlist[i].stock_way = 2
255
-    //            this.tableList.push(outlist[i])
256
-    //          }
257
-    //          console.log("hhhhhhhhhhh",this.tableList)
258
-    //       }
259
-    //    })  
260
-    //  }
239
+     getTimestamp(time) {
240
+      // 把时间日期转成时间戳
241
+      return new Date(time).getTime() / 1000;
242
+     },
261 243
     }
262 244
   }
263 245
 </script>

+ 75 - 38
src/xt_pages/stock/stockFlow.vue View File

@@ -6,8 +6,9 @@
6 6
     <div class="app-container ">
7 7
       <div class="cell clearfix">
8 8
        耗材名称:{{this.$route.query.good_name}}
9
-       <!-- 库存:
10
-       厂家: -->
9
+       库存:{{getInCount(this.$route.query.id)}}
10
+       <!-- 厂家:{{this.$route.query.manufacturer}}
11
+       规格: -->
11 12
       </div>
12 13
       <div class="cell clearfix">
13 14
         <span>日期查询:</span>
@@ -38,15 +39,15 @@
38 39
               @change="endTimeChange"
39 40
           ></el-date-picker>
40 41
 
41
-        <span>出入库方式:</span>
42
-        <el-select v-model="stock_type" style="width:160px;margin-right:10px;" placeholder="请选择" @change="changeDrug">
42
+        <!-- <span>出入库方式:</span> -->
43
+        <!-- <el-select v-model="stock_type" style="width:160px;margin-right:10px;" placeholder="请选择" @change="changeDrug">
43 44
             <el-option
44 45
               v-for="(item,index) in stockType"
45 46
               :key="index"
46 47
               :label="item.name"
47 48
               :value="item.id">
48 49
             </el-option>
49
-        </el-select>
50
+        </el-select> -->
50 51
         
51 52
         
52 53
       </div>
@@ -84,9 +85,10 @@
84 85
              <span v-if="scope.row.stock_way == 2 && scope.row.count!=0">{{scope.row.count}}</span>
85 86
            </template>
86 87
         </el-table-column>
87
-         <el-table-column prop="drug_name" label="库存剩余量"  align="center">
88
+         <el-table-column prop="drug_name" label="剩余库存量"  align="center">
88 89
            <template slot-scope="scope">
89
-             <span v-if="scope.row.stock_way == 4 && scope.row.stock_count!=0">{{scope.row.stock_count}} </span>
90
+             <!-- <span v-if="scope.row.stock_way == 4 && scope.row.stock_count!=0">{{scope.row.stock_count}} </span> -->
91
+              {{getInCount(scope.row.good_id)- getOutCount(scope.row.good_id) - getAutoCount(scope.row.good_id)}}
90 92
            </template>
91 93
         </el-table-column>
92 94
         <el-table-column prop="drug_name" label="进/出货单价"  align="center">
@@ -133,15 +135,15 @@
133 135
 <script>
134 136
   import { uParseTime } from '@/utils/tools'
135 137
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
136
-  import {getStockInList,getStockOutList} from "@/api/drug/drug_stock";
138
+  import {getStockInList} from "@/api/drug/drug_stock";
139
+  import {getStockDrugCount} from "@/api/stock"
137 140
   export default {
138 141
     name: 'stockIn',
139 142
     created() {
140
-    //   var drugCategory = getDictionaryDataConfig('system','drug_category')
141
-    //   this.drugCategory.push(...drugCategory)
142
-    //   this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
143
+     
143 144
       this.getlist()
144
-      this.getOutList()
145
+      this.getStockDrugCount()
146
+
145 147
     },
146 148
     components: {
147 149
       BreadCrumb
@@ -184,7 +186,11 @@
184 186
           {id:2,name:"自动出库"},
185 187
           {id:3,name:"入库"},
186 188
         ],
187
-      
189
+        countList:[],
190
+        outCountList:[],
191
+        autoCountList:[],
192
+        keywords:"",
193
+        obj:{},
188 194
       }
189 195
     },
190 196
     methods:{
@@ -192,11 +198,11 @@
192 198
      
193 199
        handleSizeChange(val) {
194 200
         this.limit = val
195
-        this.GetAllDrugStockQueryList()
201
+        this.getlist()
196 202
       },
197 203
       handleCurrentChange(val) {
198 204
         this.page = val
199
-        this.GetAllDrugStockQueryList()
205
+        this.getlist()
200 206
       },
201 207
         
202 208
     startTimeChange: function(val) {
@@ -206,7 +212,7 @@
206 212
         this.$message.error("开始时间不能大于结束时间");
207 213
         this.start_time = "";
208 214
       } else {
209
-        this.GetAllDrugStockQueryList();
215
+        this.getlist()
210 216
       }
211 217
     },
212 218
     endTimeChange: function(val) {
@@ -215,10 +221,9 @@
215 221
         this.$message.error("结束时间不能小于开始时间");
216 222
         this.end_time = "";
217 223
       } else {
218
-        this.GetAllDrugStockQueryList();
224
+       this.getlist()
219 225
       }
220 226
      },
221
-     changeDrug(){},
222 227
      getManufacturer(id){
223 228
        var name = ""
224 229
        for(let i=0;i<this.manufacturerList.length;i++){
@@ -262,26 +267,58 @@
262 267
          }
263 268
       })
264 269
      },
265
-    //  getOutList(){
266
-    //   var params= {
267
-    //       limit:this.limit,
268
-    //       page:this.page,
269
-    //       id:this.$route.query.id,
270
-    //       start_time:this.start_time,
271
-    //       end_time:this.end_time, 
272
-    //     } 
273
-    //    getStockOutList(params).then(response=>{
274
-    //       if(response.data.state == 1){
275
-    //          var outlist = response.data.data.outList
276
-    //          console.log("出库数据",outlist)
277
-    //          for(let i=0;i<outlist.length;i++){
278
-    //            outlist[i].stock_way = 2
279
-    //            this.tableList.push(outlist[i])
280
-    //          }
281
-    //          console.log("hhhhhhhhhhh",this.tableList)
282
-    //       }
283
-    //    })  
284
-    //  }
270
+    getStockDrugCount(){
271
+        var params ={
272
+          keywords: this.keywords,
273
+          start_time:this.start_time,
274
+          end_time:this.end_time,
275
+        }
276
+      getStockDrugCount(params).then(response=>{
277
+         if(response.data.state == 1){
278
+           var count = response.data.data.count
279
+           console.log("详情入库统计",count)
280
+           this.countList = count
281
+           var outlist = response.data.data.outList
282
+           console.log("详情出库数量",outlist)
283
+           this.outCountList = outlist
284
+           var autoCount = response.data.data.autoCount
285
+           console.log("详情自动出库",autoCount)
286
+           this.autoCountList = autoCount
287
+         }
288
+      })
289
+    },
290
+    getInCount(id){
291
+      var count= ""
292
+      for(let i=0;i<this.countList.length;i++){
293
+          if(id == this.countList[i].good_id){
294
+              count = this.countList[i].count
295
+          }
296
+        }
297
+        return count
298
+        },
299
+      getOutCount(id){
300
+        console.log("id222",id)
301
+        var count = ""
302
+        for(let i=0;i<this.outCountList.length;i++){
303
+          if(id == this.outCountList[i].good_id){
304
+            count = this.outCountList[i].count
305
+          }
306
+        }
307
+        return count
308
+      },
309
+      getAutoCount(id){
310
+        var count= ""
311
+        for(let i=0;i<this.autoCountList.length;i++){
312
+          if(id == this.autoCountList[i].good_id){
313
+            count = this.outCountList[i].count
314
+          }
315
+        }
316
+        return count
317
+      },
318
+     getTimestamp(time) {
319
+      // 把时间日期转成时间戳
320
+      return new Date(time).getTime() / 1000;
321
+     },
285 322
     }
286 323
   }
287 324
 </script>

+ 34 - 5
src/xt_pages/stock/stockOutOrder.vue View File

@@ -232,7 +232,8 @@
232 232
         
233 233
         <el-table-column label="出库数量" align="center">
234 234
           <template slot-scope="scope">
235
-            {{ scope.row.count}}
235
+           <span v-if="scope.row.is_sys == 0">{{ scope.row.count}}</span> 
236
+           <span v-if="scope.row.is_sys == 1">{{getOutStockCount(scope.row.good_id)}}</span> 
236 237
           </template>
237 238
         </el-table-column>
238 239
 
@@ -277,7 +278,7 @@
277 278
         </el-table-column>
278 279
         <el-table-column label="操作" align="center">
279 280
           <template slot-scope="scope">
280
-            <span v-if="scope.row.is_sys == 1"  style="color: #589ff8" @click="GetOrderDetail(scope.row.id)">使用明细</span>
281
+            <span v-if="scope.row.is_sys == 1"  style="color: #589ff8" @click="GetOrderDetailById(scope.row)">使用明细</span>
281 282
           </template>
282 283
         </el-table-column>
283 284
       </el-table>  
@@ -697,7 +698,8 @@ import {
697 698
   deleteWarehouseOutInfo,
698 699
   GetAllGoodInfoByID,
699 700
   editWarehouseoutInfo,
700
-  getOrderDetailByOrderId
701
+  getOrderDetailByOrderId,
702
+  getOrderDetailById
701 703
 } from "@/api/stock";
702 704
 import BreadCrumb from "../components/bread-crumb";
703 705
 import StockInDialog from './Dialog/stockInDialog'
@@ -1521,8 +1523,35 @@ export default {
1521 1523
         })
1522 1524
       }, 
1523 1525
      
1524
-     
1525
-
1526
+      GetOrderDetailById(val){
1527
+         this.userList =[]
1528
+         var params = {
1529
+           good_id:val.good_id,
1530
+           record_time:val.sys_record_time,
1531
+          }
1532
+         getOrderDetailById(params).then(response=>{
1533
+            if(response.data.state == 1){
1534
+              var total = 0
1535
+              var list = response.data.data.list
1536
+              var arrList =  this.unique(list)
1537
+              for (let i = 0; i < arrList.length; i++) {
1538
+                var obj = arrList[i]
1539
+                obj['is_total'] = 0
1540
+                this.userList.push(obj)
1541
+                total = total + arrList[i].count
1542
+              }
1543
+              this.userList.push({
1544
+                is_total: 1,
1545
+                total: total,
1546
+              })
1547
+              // this.type_name = this.userList[0].type.type_name
1548
+              // this.specification_name = this.userList[0].info.specification_name
1549
+              console.log("详情数据区",this.userList)
1550
+              this.editdialogVisibleThree = true
1551
+            }
1552
+         })
1553
+      },
1554
+    
1526 1555
   }
1527 1556
 };
1528 1557
 </script>

+ 10 - 3
src/xt_pages/stock/stockQuery.vue View File

@@ -108,7 +108,7 @@
108 108
        </el-table-column>
109 109
        <el-table-column label="出库数量" align="center">
110 110
          <template slot-scope="scope">
111
-           <span>{{getOutCount(scope.row.good_id)+getAutoCount(scope.row.good_id)}}</span>
111
+           <span>{{getOutCount(scope.row.good_id) + getAutoCount(scope.row.good_id)}}</span>
112 112
 
113 113
          </template>
114 114
        </el-table-column>
@@ -261,7 +261,7 @@ export default {
261 261
 
262 262
          }
263 263
 
264
-        console.log("数据2222222",this.WarehouseInfo.warehouseInfoDate)
264
+       
265 265
       });
266 266
     },
267 267
 
@@ -455,7 +455,14 @@ export default {
455 455
        return name
456 456
     },
457 457
     toClick(val){
458
-      this.$router.push({path:"/stock/in/stockflow?id="+val.good_id+"&good_name="+val.good_name})
458
+       var manufacturer_name = ""
459
+       for(let i=0;i<this.manufacturerList.length;i++){
460
+          if(val.manufacturer == this.manufacturerList[i].id){
461
+            manufacturer_name = this.manufacturerList[i].manufacturer_name  
462
+          }
463
+       }
464
+      console.log("厂家22222",manufacturer_name)
465
+      this.$router.push({path:"/stock/in/stockflow?id="+val.good_id+"&good_name="+val.good_name+"&manufacturer="+manufacturer_name})
459 466
     },
460 467
     toClickOne(val){
461 468
       this.$router.push({path:"/stock/in/stockbatchnumber?id="+val.good_id+"&good_name="+val.good_name})