XMLWAN 3 years ago
parent
commit
e0cdcea228

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

@@ -626,7 +626,7 @@ export default {
626 626
       for(let i=0;i<this.exportList.length;i++){
627 627
         this.exportList[i].total_price = this.exportList[i].count * this.exportList[i].price
628 628
         this.exportList[i].good_name = this.exportList[i].GoodInfo.good_name
629
-        this.exportList[i].unit = this.exportList[i].GoodInfo.specification_name + "/" +this.exportList[i].packing_unit
629
+        this.exportList[i].unit = this.exportList[i].GoodInfo.specification_name + "/" +this.exportList[i].GoodInfo.packing_unit
630 630
         if(this.exportList[i].dealer == 0){
631 631
           this.exportList[i].dealer = ""
632 632
         }

+ 3 - 3
src/xt_pages/stock/cancelStockOrderPrint.vue View File

@@ -29,7 +29,7 @@
29 29
               <td style="line-height: 50px" width="80">总金额</td>
30 30
             </tr>
31 31
 
32
-            <tr v-for="(item,i) in it.CancelStockInfo" :key="i">
32
+            <tr v-for="(item,i) in it.XtCancelStockInfo" :key="i">
33 33
               <td style="line-height: 50px">
34 34
                 <span>{{item.GoodInfo.good_name}}</span>
35 35
               </td>
@@ -314,7 +314,7 @@
314 314
       },
315 315
 
316 316
       getCancelStockOrderPrint(id){
317
-        console.log("23232322332",id)
317
+       
318 318
         var params = {
319 319
             id:id
320 320
         }
@@ -330,7 +330,7 @@
330 330
         var total = 0
331 331
         var arr = []
332 332
         for(let i=0;i<this.tableList.length;i++){
333
-          arr.push(...this.tableList[i].CancelStockInfo)
333
+          arr.push(...this.tableList[i].XtCancelStockInfo)
334 334
         } 
335 335
         console.log("arr23223",arr)
336 336
         for(let i=0;i<arr.length;i++){

+ 25 - 10
src/xt_pages/stock/drugs/cancelDrugStockOrderAdd.vue View File

@@ -212,7 +212,7 @@
212 212
                     v-for="(item,index) in numberList"
213 213
                     :key="index"
214 214
                     :label="item.batch_number"
215
-                    :value="item.batch_number">
215
+                    :value="item.id">
216 216
                   </el-option>
217 217
               </el-select>
218 218
               </el-form-item>
@@ -498,6 +498,7 @@ export default {
498 498
       tempObj["product_date"] = ""
499 499
       tempObj["expiry_date"] = ""
500 500
       tempObj["batch_number"] = ""
501
+      tempObj["batch_number_id"] = ""
501 502
       this.recordInfo.recordData.push(tempObj);
502 503
     },
503 504
     handleDelete: function(index, row) {
@@ -595,10 +596,18 @@ export default {
595 596
             this.$message.success("请添加退库商品");
596 597
             return;
597 598
           }
598
-
599
+          for(let i=0;i<this.recordInfo.recordData.length;i++){
600
+             for(let j=0;j<this.numberList.length;j++){
601
+                if(this.recordInfo.recordData[i].batch_number == this.numberList[j].id){
602
+                   this.recordInfo.recordData[i].batch_number = this.numberList[j].batch_number
603
+                   this.recordInfo.recordData[i].batch_number_id = this.numberList[j].id
604
+                }
605
+             }
606
+          }
599 607
           const params = {
600 608
             cancelStock: this.recordInfo.recordData
601 609
           };
610
+          console.log("params2222",params)
602 611
           postDrugCancelStock(
603 612
             params,
604 613
             this.return_time,
@@ -610,14 +619,19 @@ export default {
610 619
               this.$message.error(response.data.msg);
611 620
               return false;
612 621
             } else {
613
-              this.$notify({
614
-                title: "成功",
615
-                message: "退库成功",
616
-                type: "success",
617
-                duration: 2000
618
-              });
619
-              this.recordInfo.recordData = [];
620
-              this.$router.back(-1);
622
+              if(response.data.data.msg == 1){
623
+                this.$notify({
624
+                  title: "成功",
625
+                  message: "退库成功",
626
+                  type: "success",
627
+                  duration: 2000
628
+                });
629
+                this.recordInfo.recordData = [];
630
+                this.$router.back(-1);
631
+              }
632
+              if(response.data.data.msg == 2){
633
+                this.$message.error("退库数量大于入库数量")
634
+              }
621 635
             }
622 636
           });
623 637
         } else {
@@ -737,6 +751,7 @@ export default {
737 751
     tempObj["product_date"] = ""
738 752
     tempObj["expiry_date"] = ""
739 753
     tempObj["batch_number"] = ""
754
+    tempObj["batch_number_id"] = ""
740 755
     this.unitList =  getDataConfig('hemodialysis','units')
741 756
     console.log("单位",this.unitList)
742 757
     this.recordInfo.recordData.push(tempObj);

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

@@ -1172,7 +1172,7 @@ export default {
1172 1172
           this.exportList[i].unit = this.exportList[i].dose + this.exportList[i].dose_unit + "*" + this.exportList[i].min_number + this.exportList[i].min_unit + "/"+this.exportList[i].max_unit
1173 1173
 
1174 1174
           this.exportList[i].total_price = (this.exportList[i].count * this.exportList[i].price).toFixed(2)
1175
-          this.exportList[i].expire_date  = this.getTime(this.exportList[i].expiry_date,"{y}-{h}-{d}")
1175
+          this.exportList[i].expiry_date  = this.getTime(this.exportList[i].expiry_date,"{y}-{h}-{d}")
1176 1176
            this.exportList[i].product_date = this.getTime(this.exportList[i].product_date,"{y}-{h}-{d}")
1177 1177
           for(let j=0;j<this.manufacturerList.length;j++){
1178 1178
             if(this.exportList[i].manufacturer == this.manufacturerList[j].id){

+ 19 - 2
src/xt_pages/stock/drugs/query.vue View File

@@ -121,6 +121,11 @@
121 121
              {{getCount(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}
122 122
            </template>
123 123
         </el-table-column>
124
+        <el-table-column prop="drug_name" label="退库数量" align="center">
125
+           <template slot-scope="scope">
126
+             {{getCancelCount(scope.row.drug_id)}}
127
+           </template>
128
+        </el-table-column>
124 129
         <el-table-column prop="drug_name" label="剩余库存量" align="center">
125 130
            <template slot-scope="scope">
126 131
              <span v-if="getCountTwo(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)!=''">{{getCountTwo(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}</span>
@@ -246,7 +251,7 @@ import { min } from 'moment'
246 251
         drug_type:0,
247 252
         minCount:[],
248 253
         drugOutList:[],
249
-        
254
+        cancelCountList:[],
250 255
       }
251 256
     },
252 257
     methods: {
@@ -571,6 +576,9 @@ import { min } from 'moment'
571 576
             var minCount = response.data.data.minCount
572 577
             console.log("minCount",minCount)
573 578
             this.minCount = minCount
579
+            var cancelCountList =  response.data.data.cancelCountList
580
+            console.log("退库数据",cancelCountList)
581
+            this.cancelCountList = cancelCountList
574 582
             var info = response.data.data.info
575 583
             for(let i=0;i<info.length;i++){
576 584
               if(info[i].count_unit == info[i].max_unit){
@@ -668,7 +676,16 @@ import { min } from 'moment'
668 676
 
669 677
        console.log("str0000000",str,str_min)
670 678
        return str+str_min
671
-     }
679
+     },
680
+      getCancelCount(id){
681
+        var count= 0
682
+        for(let i=0;i<this.cancelCountList.length;i++){
683
+          if(id == this.cancelCountList[i].drug_id){
684
+            count = this.cancelCountList[i].count
685
+          }
686
+        }
687
+        return count
688
+      },
672 689
     }
673 690
   }
674 691
 </script>

+ 5 - 7
src/xt_pages/stock/stockFlow.vue View File

@@ -71,6 +71,7 @@
71 71
            <template slot-scope="scope">
72 72
             <span v-if="scope.row.consumable_type == 1">{{scope.row.warehousing_order}}</span>
73 73
             <span v-if="scope.row.consumable_type == 2">{{scope.row.warehouse_out_order_number}}</span>  
74
+            <span v-if="scope.row.consumable_type == 3">{{scope.row.warehouse_out_order_number}}</span>  
74 75
            </template>
75 76
         </el-table-column>
76 77
         <el-table-column prop="drug_name" label="操作日期" align="center">
@@ -391,12 +392,8 @@
391 392
      },
392 393
      changeDrug(val){
393 394
        this.tableList= []
394
-       if(val == 4 || val == 0){
395
-        this.getlist()
396
-       }
397
-       if(val == 2 || val == 3 || val == 0){
398
-        this.getStockOutList()
399
-       }
395
+       this.stock_type = val
396
+       this.getStockFlow()
400 397
      },
401 398
      getStockCount(id){
402 399
       var stock_count = 0
@@ -415,8 +412,9 @@
415 412
           good_id:this.$route.query.id,
416 413
           start_time:this.start_time,
417 414
           end_time:this.end_time,
418
-          is_sys:this.stockType 
415
+          is_sys:this.stock_type 
419 416
         } 
417
+        
420 418
        getStockFlow(params).then(response=>{
421 419
           if(response.data.state == 1){
422 420
             var list =  response.data.data.list

+ 28 - 3
src/xt_pages/stock/stockPrint.vue View File

@@ -39,8 +39,11 @@
39 39
                                    <td>{{item.price}}</td>
40 40
                                    <td>{{getManufacture(item.manufacturer)}}</td>
41 41
                                    <td>{{getInCount(item.good_id)}}</td>
42
-                                   <td><span>{{getOutCount(item.good_id) + getAutoCount(item.good_id)}}</span></td> 
43
-                                   <td>{{getInCount(item.good_id)- getOutCount(item.good_id) - getAutoCount(item.good_id)}}</td>
42
+                                   <!-- <td><span>{{getOutCount(item.good_id) + getAutoCount(item.good_id)}}</span></td>  -->
43
+                                   <td><span>{{getInCount(item.good_id) - getStockCount(item.good_id)}}{{item.packing_unit}}</span></td>
44
+                                   <!-- <td>{{getInCount(item.good_id)- getOutCount(item.good_id) - getAutoCount(item.good_id)}}</td> -->
45
+                                   <!-- <td>{{getCancelCount(item.good_id)}}{{item .packing_unit}}</td> -->
46
+                                   <td> {{getStockCount(item.good_id)}} {{item.packing_unit}} </td>
44 47
                                 </tr>
45 48
                             </tbody>
46 49
                         </table>
@@ -87,6 +90,7 @@ export default {
87 90
           countList:[],
88 91
           outCountList:[],
89 92
           autoCountList:[],
93
+          cancelCountList:[],
90 94
         }
91 95
     },
92 96
     methods:{
@@ -197,6 +201,9 @@ export default {
197 201
            var autoCount = response.data.data.autoCount
198 202
            console.log("autoCount",autoCount)
199 203
            this.autoCountList = autoCount
204
+           var totalCount = response.data.data.totalCount
205
+           console.log("totalcount",totalCount)
206
+           this.cancelCountList = totalCount
200 207
          }
201 208
       })
202 209
     },
@@ -226,7 +233,25 @@ export default {
226 233
           }
227 234
         }
228 235
         return count
229
-      }
236
+      },
237
+      getCancelCount(id){
238
+        var count = 0
239
+        for(let i=0;i<this.cancelCountList.length;i++){
240
+          if(id == this.cancelCountList[i].good_id){
241
+              count = this.cancelCountList[i].count
242
+          }
243
+        }
244
+        return count
245
+     },
246
+    getStockCount(id){
247
+     var stock_count = 0
248
+     for(let i=0;i<this.countList.length;i++){
249
+       if(id == this.countList[i].good_id){
250
+         stock_count = this.countList[i].stock_count
251
+       }
252
+     }
253
+     return stock_count
254
+     }
230 255
     },
231 256
     created(){
232 257
       var starttime =  this.$route.query.start_time

+ 4 - 2
src/xt_pages/stock/stockQuery.vue View File

@@ -414,8 +414,10 @@ export default {
414 414
            this.tableList[i].unit = this.tableList[i].specification_name + "/" + this.tableList[i].packing_unit
415 415
            this.tableList[i].prodect_name = this.getManufacture(this.tableList[i].manufacturer)
416 416
            this.tableList[i].inCount =  this.getInCount(this.tableList[i].good_id)
417
-           this.tableList[i].outCount = this.getOutCount(this.tableList[i].good_id) + this.getAutoCount(this.tableList[i].good_id)
418
-           this.tableList[i].overplus =this.getInCount(this.tableList[i].good_id)- this.getOutCount(this.tableList[i].good_id) - this.getAutoCount(this.tableList[i].good_id)
417
+          //  this.tableList[i].outCount = this.getOutCount(this.tableList[i].good_id) + this.getAutoCount(this.tableList[i].good_id)
418
+          //  this.tableList[i].overplus =this.getInCount(this.tableList[i].good_id)- this.getOutCount(this.tableList[i].good_id) - this.getAutoCount(this.tableList[i].good_id)
419
+          this.tableList[i].outCount =  this.getInCount(this.tableList[i].good_id) - this.getStockCount(this.tableList[i].good_id)
420
+          this.tableList[i].overplus = this.getStockCount(this.tableList[i].good_id)
419 421
          }
420 422
          console.log("table",this.tableList)
421 423
          const data = this.formatJson(filterVal, this.tableList)