XMLWAN 4 years ago
parent
commit
92c4b302fd
2 changed files with 31 additions and 7 deletions
  1. 30 6
      src/xt_pages/stock/detail/print.vue
  2. 1 1
      src/xt_pages/stock/stockQuery.vue

+ 30 - 6
src/xt_pages/stock/detail/print.vue View File

60
                 <span v-else>{{calCount(stock)}}</span> 
60
                 <span v-else>{{calCount(stock)}}</span> 
61
               </td>
61
               </td>
62
               <td style="line-height:50px" v-if="type == 1 && stock.query_warehousing_info.length > 0">{{stock.query_warehousing_info[0].price}}</td>
62
               <td style="line-height:50px" v-if="type == 1 && stock.query_warehousing_info.length > 0">{{stock.query_warehousing_info[0].price}}</td>
63
-              <td style="line-height:50px" v-if="type == 3 && stock.query_warehouseout_info.length > 0">{{stock.query_warehouseout_info[0].price}}</td>
63
+              <td style="line-height:50px" v-if="type == 3 && stock.query_warehouseout_info.length > 0">
64
+                <!-- {{stock.query_warehouseout_info[0].price}} -->
65
+                {{getReailPrice(stock.id)}}
66
+              </td>
64
               <td style="line-height: 50px" v-if="type == 1">{{calTotal(stock)}}</td>
67
               <td style="line-height: 50px" v-if="type == 1">{{calTotal(stock)}}</td>
65
               <td style="line-height: 50px" v-if="type == 3">
68
               <td style="line-height: 50px" v-if="type == 3">
66
                 
69
                 
67
-                  <span v-if="org_id == 10090">{{getPrice(stock.id)}}</span>
68
-                  <span v-else>{{(getStockCount(stock.id) * stock.query_warehouseout_info[0].price).toFixed(2)}}</span> 
70
+                  <span v-if="org_id == 9671">{{getPrice(stock.id)}}</span>
71
+                  <span v-else>{{(getStockCount(stock.id) * getPrice(stock.id)).toFixed(2)}}</span> 
69
                
72
                
70
              </td>
73
              </td>
71
               <td style="line-height: 50px"></td>
74
               <td style="line-height: 50px"></td>
134
         end_time: this.$route.query.end_time,
137
         end_time: this.$route.query.end_time,
135
         stockTotal:[],
138
         stockTotal:[],
136
         wareOutInfo:[],
139
         wareOutInfo:[],
137
-        org_id:0
140
+        org_id:0,
141
+        informationList:[]
138
       }
142
       }
139
     },
143
     },
140
     methods: {
144
     methods: {
188
             var org_id = response.data.data.orgid
192
             var org_id = response.data.data.orgid
189
             console.log("org_id",org_id)
193
             console.log("org_id",org_id)
190
             this.org_id = org_id
194
             this.org_id = org_id
191
-           
195
+
196
+            var informationlist = response.data.data.infomationList
197
+            console.log('数据列表',informationlist)
198
+            this.informationList = informationlist
192
             for (let i = 0; i < response.data.data.list.length; i++) {
199
             for (let i = 0; i < response.data.data.list.length; i++) {
193
               if (this.type == 1) {
200
               if (this.type == 1) {
194
                 if (response.data.data.list[i].query_warehousing_info.length > 0) {
201
                 if (response.data.data.list[i].query_warehousing_info.length > 0) {
352
      },
359
      },
353
      getPrice(id){
360
      getPrice(id){
354
        var sum = ""
361
        var sum = ""
362
+       for(let i=0;i<this.informationList.length;i++){
363
+        for(let j=0;j<this.wareOutInfo.length;j++){
364
+           if(this.informationList[i].id == this.wareOutInfo[j].good_id){
365
+             this.wareOutInfo[j].retail_price =  this.informationList[i].retail_price 
366
+           }
367
+        }
368
+       }
369
+      
355
        for(let j=0;j<this.wareOutInfo.length;j++){
370
        for(let j=0;j<this.wareOutInfo.length;j++){
356
          if(id == this.wareOutInfo[j].good_id){
371
          if(id == this.wareOutInfo[j].good_id){
357
-            sum += this.wareOutInfo[j].price * this.wareOutInfo[j].count
372
+            sum += (this.wareOutInfo[j].retail_price * this.wareOutInfo[j].count).toFixed(2)
358
          }
373
          }
359
        }
374
        }
360
        
375
        
361
        return sum
376
        return sum
362
        
377
        
378
+     },
379
+     getReailPrice(id){
380
+       var price = 0
381
+       for(let i=0;i<this.informationList.length;i++){
382
+          if(id == this.informationList[i].id){
383
+             price = this.informationList[i].retail_price
384
+          }
385
+       }
386
+       return price
363
      }
387
      }
364
     },
388
     },
365
     created() {
389
     created() {

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

383
     },
383
     },
384
 
384
 
385
     exportList(){
385
     exportList(){
386
-         console.log("2222222",this.WarehouseInfo.warehouseInfoDate)
386
+      
387
          import('@/vendor/Export2Excel').then(excel => {
387
          import('@/vendor/Export2Excel').then(excel => {
388
          const tHeader = ['商品编码', '耗材名称', '耗材类型','规格型号','入库数量','进货价','入库退货','实际入库','出库数量','出库退库','实际出库','剩余库存']
388
          const tHeader = ['商品编码', '耗材名称', '耗材类型','规格型号','入库数量','进货价','入库退货','实际入库','出库数量','出库退库','实际出库','剩余库存']
389
          const filterVal = ['good_code', 'good_name', 'type_name','specification_name','stockInCount','price','salesReturnCount','realCount','stockOutCount','cancelStockCount','realOutCount','overplus'] 
389
          const filterVal = ['good_code', 'good_name', 'type_name','specification_name','stockInCount','price','salesReturnCount','realCount','stockOutCount','cancelStockCount','realOutCount','overplus']