Sfoglia il codice sorgente

11月14日 库存扣减更新

XMLWAN 3 anni fa
parent
commit
4be45a1af5

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

@@ -970,3 +970,11 @@ export function getDamageDetailByGoodId(params) {
970 970
     params: params
971 971
   })
972 972
 }
973
+
974
+export function getInventoryExportList(params) {
975
+  return request({
976
+    url: '/api/stock/getinventoryexportlist',
977
+    method: 'get',
978
+    params: params
979
+  })
980
+}

+ 12 - 12
src/router/modules/drugs.js Vedi File

@@ -50,24 +50,24 @@ export default {
50 50
     //   name: 'drugDamaged',
51 51
     //   meta: { title: 'drugDamaged', noCache: true }
52 52
     // },
53
-    {
54
-      path: '/stock/drugs/drugDamagePrint',
55
-      component: () => import('@/xt_pages/stock/drugs/drugDamagePrint'),
56
-      name: 'drugDamaged',
57
-      meta: { title: 'drugDamaged', noCache: true }
58
-    },
53
+    // {
54
+    //   path: '/stock/drugs/drugDamagePrint',
55
+    //   component: () => import('@/xt_pages/stock/drugs/drugDamagePrint'),
56
+    //   name: 'drugDamaged',
57
+    //   meta: { title: 'drugDamaged', noCache: true }
58
+    // },
59 59
     // {
60 60
     //   path: '/stock/drugs/drugWarning',
61 61
     //   component: () => import('@/xt_pages/stock/drugs/drugWarning'),
62 62
     //   name: 'drugWarning',
63 63
     //   meta: { title: 'drugWarning', noCache: true }
64 64
     // },
65
-    // {
66
-    //   path: '/stock/drugs/drugInventory',
67
-    //   component: () => import('@/xt_pages/stock/drugs/drugInventory'),
68
-    //   name: 'drugInventory',
69
-    //   meta: { title: 'drugInventory', noCache: true }
70
-    // },
65
+    {
66
+      path: '/stock/drugs/drugInventory',
67
+      component: () => import('@/xt_pages/stock/drugs/drugInventory'),
68
+      name: 'drugInventory',
69
+      meta: { title: 'drugInventory', noCache: true }
70
+    },
71 71
     {
72 72
       path: '/stock/drugs/inventoryPrint',
73 73
       component: () => import('@/xt_pages/stock/drugs/inventoryPrint'),

+ 5 - 4
src/xt_pages/stock/drugs/cancelDrugStockOrderEdit.vue Vedi File

@@ -372,8 +372,9 @@
372 372
         this.currentIndex = -1
373 373
       }, cancle: function() {
374 374
         this.$refs.dialog.hide()
375
-      },calculate: function(val) {
376
-        if (val == 0) {
375
+      },
376
+      calculate: function(val) {
377
+        if (val == 0 || val == "NaN") {
377 378
           return ''
378 379
         }
379 380
         return Math.round(parseFloat(val) * 100) / 100
@@ -433,7 +434,7 @@
433 434
         const tempObj = {}
434 435
         tempObj['id'] = 0
435 436
         tempObj["return_count"] = "";
436
-        tempObj["price"] = "";
437
+        tempObj["price"] = 0;
437 438
         tempObj["retail_price"] = "";
438 439
         tempObj["register_account"] = ""
439 440
         tempObj["dealer"] = ""
@@ -443,7 +444,7 @@
443 444
         tempObj["expiry_date"] = ""
444 445
         tempObj["batch_number"] = ""
445 446
         tempObj["batch_number_id"] = 0
446
-
447
+         tempObj["count"] = 0
447 448
         this.recordInfo.recordData.push(tempObj)
448 449
       }, handleDelete: function(index, row) {
449 450
         if (row.id == 0) {

+ 10 - 9
src/xt_pages/stock/drugs/drugDamaged.vue Vedi File

@@ -96,7 +96,7 @@
96 96
             </el-col>
97 97
             <el-col :span="8">
98 98
               <el-form-item label="原因:">
99
-                  <el-select v-model="form.type" placeholder="请选择">
99
+                  <el-select v-model="form.type" placeholder="请选择" @change="changeReason">
100 100
                       <el-option
101 101
                         v-for="item in reasonList"
102 102
                         :key="item.id"
@@ -146,7 +146,7 @@
146 146
 
147 147
               <el-table-column prop="address" label="盘点原因" align="center">
148 148
                 <template slot-scope="scope">
149
-                  <span v-if="scope.row.type == 0">默认</span> 
149
+                  <span v-if="scope.row.type == 6">默认</span> 
150 150
                   <span v-if="scope.row.type == 1">到期退货</span> 
151 151
                   <span v-if="scope.row.type == 2">异常退货</span> 
152 152
                   <span v-if="scope.row.type == 3">退货</span> 
@@ -243,7 +243,7 @@ export default {
243 243
             unitList:[],
244 244
             datamageList:[],
245 245
             reasonList:[
246
-              {id:0,name:"默认"},
246
+              {id:6,name:"默认"},
247 247
               {id:1,name:"到期退货"},
248 248
               {id:2,name:"异常退货"},
249 249
               {id:3,name:"退货"},
@@ -284,6 +284,10 @@ export default {
284 284
             return uParseTime(val, '{y}-{m}-{d}')
285 285
          }
286 286
         },
287
+      changeReason(val){
288
+        this.form.type = val
289
+        this.clickDetai(this.drug_id)
290
+      },
287 291
       getlist(){
288 292
         var params = {
289 293
           limit:this.limit,
@@ -292,14 +296,13 @@ export default {
292 296
           end_time:this.end_time,
293 297
           keyword:this.searchKey,
294 298
         }
295
-        console.log("博阿孙param232332232323",params)
299
+       
296 300
         getDrugDamageList(params).then(response=>{
297 301
            if(response.data.state == 1){
298 302
              this.tableList = response.data.data.list
299 303
              this.total = response.data.data.total
300 304
              this.doctorList = response.data.data.doctorList
301 305
              var datamagelist = response.data.data.damagelist
302
-             console.log("hhh233223",datamagelist)
303 306
              this.datamageList = datamagelist
304 307
            }
305 308
         })
@@ -355,6 +358,7 @@ export default {
355 358
            warehouseing_order:this.form.warehousing_order,
356 359
            type:this.form.type,
357 360
          }
361
+        
358 362
         this.dialogVisible = true
359 363
         getDamagedByDrugId(params).then(response=>{
360 364
            if(response.data.state ==1){
@@ -364,7 +368,7 @@ export default {
364 368
                list[i].min_number == list[i].XtBaseDrug.min_number
365 369
                list[i].total = 0
366 370
              }
367
-             console.log("list232232332",list)
371
+            
368 372
 
369 373
              for(let i=0;i<list.length;i++){
370 374
                this.drug_name = list[0].drug_name
@@ -423,10 +427,7 @@ export default {
423 427
        this.clickDetai(this.drug_id)
424 428
      },
425 429
      getDrugDamageRadio(count){
426
-
427 430
        var total_count =  this.getDamagedCountOne(this.total_count)
428
-       console.log("count888888888888",count)
429
-       console.log("hh23232数据列表23322323",total_count)
430 431
        var all_count = 0
431 432
        all_count =  total_count * this.min_number
432 433
       

+ 40 - 20
src/xt_pages/stock/drugs/drugQueryPrint.vue Vedi File

@@ -45,10 +45,19 @@
45 45
               <td style="line-height: 50px">
46 46
                 <span> {{getManufacturerList(item.manufacturer)}}</span>
47 47
               </td>
48
-              <td><span v-if="getWarehoseInfo(item.drug_warehouse_info)!=0">{{getWarehoseInfo(item.drug_warehouse_info)}}{{item.max_unit}}</span ></td>
49
-              <td><span v-if="getWarehouseOutInfo(item.drug_warehouse_out,item.max_unit,item.min_unit,item.min_number)!=0">{{getWarehouseOutInfo(item.drug_warehouse_out,item.max_unit,item.min_unit,item.min_number)}}</span></td>
50 48
               <td>
51
-                <span v-if="getOverFlushInfo(item.drug_warehouse_info,item.max_unit,item.min_unit,item.min_number)!=0">{{getOverFlushInfo(item.drug_warehouse_info,item.max_unit,item.min_unit,item.min_number)}}</span>
49
+                <span v-if="getWarehoseInfo(item.drug_warehouse_info)!=0">{{getWarehoseInfo(item.drug_warehouse_info)}}{{item.max_unit}}</span >
50
+              </td>
51
+              <td>
52
+                <!-- <span v-if="getWarehouseOutInfo(item.drug_warehouse_out,item.max_unit,item.min_unit,item.min_number)!=0">
53
+                  {{getWarehouseOutInfo(item.drug_warehouse_out,item.max_unit,item.min_unit,item.min_number)}}
54
+                </span> -->
55
+                  {{getOutFlush(item.drug_warehouse_info,item.max_unit,item.min_unit,item.min_number,item.drug_cancel_stock_info)}}
56
+              </td>
57
+              <td>
58
+              <span v-if="getOverFlushInfo(item.drug_warehouse_info,item.max_unit,item.min_unit,item.min_number)!=0">
59
+                  {{getOverFlushInfo(item.drug_warehouse_info,item.max_unit,item.min_unit,item.min_number)}}
60
+              </span>
52 61
              </td> 
53 62
             </tr>
54 63
             </tbody>
@@ -346,23 +355,6 @@
346 355
         }
347 356
         return count
348 357
       },
349
-      // getCount(drug_id,min_number,max_unit,min_unit){
350
-      //   var count= 0
351
-      //   var str = ""
352
-      //   var min_str = ""
353
-      //   for(let i=0;i<this.drugOutList.length;i++){
354
-      //     if(drug_id == this.drugOutList[i].drug_id){
355
-      //        count += parseInt(this.drugOutList[i].count)
356
-      //     }
357
-      //   }
358
-      //   if(parseInt(count/min_number)!=0){
359
-      //     str = parseInt(count/min_number)+ max_unit
360
-      //   }
361
-      //   if((count%min_number)!=0){
362
-      //     min_str =  count%min_number + min_unit
363
-      //   }
364
-      //   return str + min_str
365
-      // },
366 358
         getCount(drug_id,min_number,max_unit,min_unit){
367 359
         var total= 0
368 360
         var str = ""
@@ -506,6 +498,34 @@
506 498
          }
507 499
         return max_str + min_str
508 500
 
501
+      },
502
+      getOutFlush(info,max_unit,min_unit,min_number,cancel_info){
503
+        var str = ""
504
+        var str_min = ""
505
+        var total = 0
506
+        var out_count = 0
507
+        var over_count = 0
508
+        var cancel_count = 0
509
+        for(let i=0;i<info.length;i++){
510
+           total += (info[i].warehousing_count * min_number)
511
+        }
512
+        
513
+        for(let j=0;j<info.length;j++){
514
+           out_count += (info[j].stock_max_number + info[j].stock_min_number)
515
+        }
516
+       
517
+        for(let z=0;z<cancel_info.length;z++){
518
+           cancel_count += cancel_info[z].count
519
+        }
520
+        over_count = total - out_count + cancel_count
521
+    
522
+        if(parseInt(over_count/min_number)!=0){
523
+            str = parseInt(over_count/min_number)+ max_unit
524
+         }
525
+         if(over_count%min_number !=0){
526
+           str_min =  over_count%min_number + min_unit
527
+         }
528
+       return str+str_min
509 529
       }
510 530
     },
511 531
     created() {

+ 2 - 2
src/xt_pages/stock/drugs/inventory.vue Vedi File

@@ -186,7 +186,7 @@ export default {
186 186
             index:"",
187 187
             unitList:[],
188 188
             reasonList:[
189
-              {id:0,name:"默认"},
189
+              {id:6,name:"默认"},
190 190
               {id:1,name:"到期退货"},
191 191
               {id:2,name:"异常退货"},
192 192
               {id:3,name:"退货"},
@@ -293,7 +293,7 @@ export default {
293 293
                    list[i].last_stock_min_number = ""
294 294
                    list[i].min_number = list[i].XtBaseDrug.min_number
295 295
                    list[i].manufacturer_name  = ""
296
-                   list[i].type = 0
296
+                   list[i].type = 6
297 297
                    for(let j=0;j<this.manufacturerList.length;j++){
298 298
                      if(list[i].manufacturer == this.manufacturerList[j].id){
299 299
                         list[i].manufacturer_name = this.manufacturerList[j].manufacturer_name

+ 3 - 3
src/xt_pages/stock/drugs/query.vue Vedi File

@@ -805,16 +805,16 @@ import { min } from 'moment'
805 805
         for(let i=0;i<info.length;i++){
806 806
            total += (info[i].warehousing_count * min_number)
807 807
         }
808
-        console.log("total232323232332323223",total)
808
+        
809 809
         for(let j=0;j<info.length;j++){
810 810
            out_count += (info[j].stock_max_number + info[j].stock_min_number)
811 811
         }
812
-        console.log("剩余库存",out_count)
812
+       
813 813
         for(let z=0;z<cancel_info.length;z++){
814 814
            cancel_count += cancel_info[z].count
815 815
         }
816 816
         over_count = total - out_count + cancel_count
817
-        console.log("hh233223232322323232323322332",over_count)
817
+    
818 818
         if(parseInt(over_count/min_number)!=0){
819 819
             str = parseInt(over_count/min_number)+ max_unit
820 820
          }

+ 2 - 2
src/xt_pages/stock/inventory.vue Vedi File

@@ -181,7 +181,7 @@ export default {
181 181
          id:0,
182 182
          numberList:[],
183 183
          reasonList:[
184
-          {id:0,name:"默认"},
184
+          {id:6,name:"默认"},
185 185
           {id:1,name:"到期退货"},
186 186
           {id:2,name:"异常退货"},
187 187
           {id:3,name:"退货"},
@@ -420,7 +420,7 @@ export default {
420 420
          if(response.data.state == 1){
421 421
            var list = response.data.data.list
422 422
            for(let i=0;i<list.length;i++){
423
-              list[i].type = 0
423
+              list[i].type = 6
424 424
               list[i].good_name = list[i].GoodInfo.good_name
425 425
               list[i].specification_name = list[i].GoodInfo.specification_name
426 426
               for(let j=0;j<this.manufacturerList.length;j++){

+ 8 - 1
src/xt_pages/stock/inventoryDetails.vue Vedi File

@@ -16,6 +16,9 @@
16 16
                 icon="el-icon-search"
17 17
                 @click="search">搜索</el-button>
18 18
             </div>
19
+            <div>
20
+              <el-button type="primary" @click="inventoryExportList">盘点模版打印</el-button>
21
+            </div>
19 22
             <!-- <div>
20 23
                 <el-button size="small" type="primary" @click="print">打印</el-button>
21 24
                 <el-button size="small" type="primary" @click="exportList">导出</el-button>
@@ -60,7 +63,7 @@
60 63
            
61 64
             <el-table-column prop="name" label="盘点原因" width="230" align="center">
62 65
               <template slot-scope="scope">
63
-                <span v-if="scope.row.inventory_type ==0">默认</span>
66
+                <span v-if="scope.row.inventory_type ==6">默认</span>
64 67
                 <span v-if="scope.row.inventory_type ==1">到期退货</span>
65 68
                 <span v-if="scope.row.inventory_type ==2">异常退货</span>
66 69
                 <span v-if="scope.row.inventory_type ==3">退货</span>
@@ -87,6 +90,7 @@
87 90
 <script>
88 91
 import { uParseTime } from '@/utils/tools'
89 92
 import { getInventoryDetailList } from "@/api/stock"
93
+
90 94
 export default {
91 95
     name: "inventory",
92 96
     data() {
@@ -182,6 +186,9 @@ export default {
182 186
             return uParseTime(val, '{y}-{m}-{d}')
183 187
          }
184 188
        },
189
+      inventoryExportList(){
190
+        this.$router.push({path:'/stock/inventoryPrint'})
191
+      }
185 192
     },
186 193
     created(){
187 194
       this.getlist()

+ 36 - 37
src/xt_pages/stock/inventoryPrint.vue Vedi File

@@ -10,41 +10,34 @@
10 10
         </div>
11 11
         <div class="app-container" style="background-color: white;">
12 12
             <div id="print_content">
13
-                <div class="printTitle">库存盘点核单数</div>
14
-                <div style="float:right;">调价日期:{{getTime(this.tableData[0].start_time)}}</div>
13
+              
15 14
                 <table class="printTable" border="1">
16 15
                     <tr>
17 16
                         <td>序号</td>
18
-                        <td>耗材名称</td>
17
+                        <td>名称</td>
19 18
                         <td>规格</td>
19
+                        <td>批号</td>
20
+                        <td>生产日期</td>
21
+                        <td>有效日期</td>
22
+                        <td>生产企业</td>
23
+                        <td>国药准字</td>
20 24
                         <td>单位</td>
21
-                        <td>零售价</td>
22
-                        <td>当前库存</td>
23
-                        <td>盘点数</td>
24
-                        <td>亏损金额</td>
25
+                        <td>库存量</td>
25 26
                     </tr>
26 27
                     <tr v-for="(item,index) in tableData" :key="index">
27 28
                         <td>{{index+1}}</td>
28 29
                         <td>{{item.good_name}}</td>
29 30
                         <td>{{item.specification_name}}</td>
31
+                        <td>{{item.number}}</td>
32
+                        <td>{{getTime(item.product_date)}}</td>
33
+                        <td>{{getTime(item.expiry_date)}}</td>
34
+                        <td>{{getManufacturerName(item.manufacturer)}}</td>
35
+                        <td>{{item.remark}}</td>
30 36
                         <td>{{item.warehousing_unit}}</td>
31
-                        <td>{{item.packing_price}}</td>
32
-                        <td></td>
33
-                        <td>{{item.count}}</td>
34 37
                         <td></td>
35 38
                     </tr>
36 39
                 </table>
37
-                <div style="margin-top:10px;">
38
-                    <span>合计:库存金额</span>
39
-                    <span>    库存盘点金额:亏损总计</span>
40
-                </div>
41
-                <div style="display:flex;float:right;margin-top:10px;border-top:1px solid #000;padding-top:10px;width:100%;">
42
-                    <div style="width:80px;">审批:</div><div style="width:100px;"></div>
43
-                    <div style="width:100px;">药材主任:</div><div style="width:60px;"></div>
44
-                    <div style="width:50px;">会计:</div><div style="width:100px;"></div>
45
-                    <div style="width:50px;">审核:</div><div style="width:100px;"></div>
46
-                    <div style="width:70px;">制单人:</div><div style="width:100px;"></div>
47
-                </div>
40
+               
48 41
             </div>
49 42
         </div>
50 43
     </div>
@@ -54,7 +47,7 @@
54 47
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
55 48
 const moment = require('moment');
56 49
 import { uParseTime } from '@/utils/tools'
57
-import { getInventoryPrintList } from "@/api/stock"
50
+import { getInventoryExportList } from "@/api/stock"
58 51
 export default {
59 52
     components:{
60 53
         BreadCrumb
@@ -68,6 +61,7 @@ export default {
68 61
           ],
69 62
           ids:"",
70 63
           tableData:[],
64
+          manufacturerList:[],
71 65
         }
72 66
     },
73 67
     methods:{
@@ -81,18 +75,6 @@ export default {
81 75
             scanStyles: false
82 76
             })
83 77
         },
84
-        
85
-        getInventoryPrintList(){
86
-            var params = {
87
-                ids:this.ids,
88
-            }
89
-         getInventoryPrintList(params).then(response=>{
90
-           if(response.data.state == 1){
91
-             var list = response.data.data.list
92
-             this.tableData = list
93
-           }
94
-         })
95
-        },
96 78
         getTime(val) {
97 79
          if(val < 0){
98 80
             return ""
@@ -103,11 +85,28 @@ export default {
103 85
             return uParseTime(val, '{y}-{m}-{d}')
104 86
          }
105 87
         },
106
-
88
+        getlist(){
89
+         getInventoryExportList().then(response=>{
90
+           if(response.data.state == 1){
91
+             var list =  response.data.data.list
92
+             console.log("list233233232323",list)
93
+             this.tableData = list
94
+             this.manufacturerList = response.data.data.manufacturerList
95
+           }
96
+         })
97
+        },
98
+        getManufacturerName(id){
99
+           var name = ""
100
+           for(let i=0;i<this.manufacturerList.length;i++){
101
+              if(id == this.manufacturerList[i].id){
102
+                  name = this.manufacturerList[i].manufacturer_name
103
+              }
104
+           }
105
+           return name
106
+        }
107 107
     },
108 108
     created(){
109
-      this.ids  = this.$route.query.ids
110
-      this.getInventoryPrintList()
109
+      this.getlist()
111 110
     }
112 111
 }
113 112
 </script>

+ 17 - 19
src/xt_pages/stock/stockDamaged.vue Vedi File

@@ -348,7 +348,7 @@
348 348
 
349 349
               <el-table-column prop="address" label="盘点原因" align="center">
350 350
                 <template slot-scope="scope">
351
-                  <span v-if="scope.row.inventory_type == 0">默认</span> 
351
+                  <span v-if="scope.row.inventory_type == 6">默认</span> 
352 352
                   <span v-if="scope.row.inventory_type == 1">到期退货</span> 
353 353
                   <span v-if="scope.row.inventory_type == 2">异常退货</span> 
354 354
                   <span v-if="scope.row.inventory_type == 3">退货</span> 
@@ -433,7 +433,7 @@ export default {
433 433
             damageList:[],
434 434
             modifyDialogVisible:false,
435 435
             reasonList:[
436
-              {id:0,name:"默认"},
436
+              {id:6,name:"默认"},
437 437
               {id:1,name:"到期退货"},
438 438
               {id:2,name:"异常退货"},
439 439
               {id:3,name:"退货"},
@@ -479,7 +479,7 @@ export default {
479 479
         if (response.data.state == 1) {
480 480
         
481 481
             var list = response.data.data.list
482
-            console.log("列表数据",list)
482
+           
483 483
             this.goodList = list
484 484
             var manufacturerList = response.data.data.manufacturerList
485 485
             this.manufacturerList = manufacturerList
@@ -584,8 +584,7 @@ export default {
584 584
               this.tableData[i].dealer = ""   
585 585
            }
586 586
          }
587
-         console.log("比阿哥",this.tableData)
588
-         console.log("numberlist",this.numberList)
587
+
589 588
          for(let i=0;i<this.tableData.length;i++){
590 589
            this.tableData[i].count =  parseInt(this.tableData[i].count)
591 590
            this.tableData[i].expiry_date = parseInt(this.tableData[i].expiry_date)
@@ -601,8 +600,7 @@ export default {
601 600
           var params = {
602 601
             tableData:this.tableData,
603 602
           }
604
-          console.log("params",params)
605
-       
603
+        
606 604
         saveReportStock(params).then(response=>{
607 605
            if(response.data.state == 1){
608 606
              var msg = response.data.data.msg
@@ -644,17 +642,16 @@ export default {
644 642
           limit:this.limit,
645 643
           page:this.page,
646 644
          }
647
-         console.log("param23223232322323",params)
648 645
        getReportStockList(params).then(response=>{
649 646
           if(response.data.state == 1){
650 647
             var list = response.data.data.list
651
-            console.log("list",list)
648
+     
652 649
             this.total = response.data.data.total
653 650
             this.tableList = list
654 651
            var doctorlist = response.data.data.doctorlist
655 652
            this.doctorList = doctorlist
656 653
            var damageList =  response.data.data.damageList
657
-           console.log("datamagelist",damageList)
654
+          
658 655
           this.damageList = damageList
659 656
           }
660 657
        })   
@@ -697,7 +694,7 @@ export default {
697 694
       getStockBatchNumber(params).then(response=>{
698 695
         if(response.data.state == 1){
699 696
           var list = response.data.data.list
700
-          console.log("批号列表",list)
697
+         
701 698
           this.numberList = list
702 699
         }
703 700
       })
@@ -710,7 +707,7 @@ export default {
710 707
          if(response.data.state == 1){
711 708
            var list = response.data.data.list
712 709
            this.form.total =  list.stock_count
713
-           console.log("list23232",list)
710
+          
714 711
          }
715 712
       })
716 713
      },
@@ -723,8 +720,7 @@ export default {
723 720
        this.getlist()
724 721
      },
725 722
      chageNumberlist(val){
726
-       console.log("val2323322",val)
727
-       
723
+      
728 724
        for(let i=0;i<this.numberList.length;i++){
729 725
          if(this.numberList[i].number == val){
730 726
             this.form.warehousing_info_id = this.numberList[i].id
@@ -739,7 +735,7 @@ export default {
739 735
         getWarehouseTotal(params).then(response=>{
740 736
           if(response.data.state == 1){
741 737
             var list =  response.data.data.list
742
-            console.log("档期批次库促",list)
738
+        
743 739
             this.form.total = list.stock_count
744 740
           }
745 741
         })
@@ -753,20 +749,22 @@ export default {
753 749
         }
754 750
         return count
755 751
       },
756
-      changeReason(){
757
-
752
+      changeReason(val){
753
+        this.form.type = val
754
+        this.toDamagedDetail(this.good_id)
758 755
       },
759 756
       toDamagedDetail(good_id){
757
+         this.good_id = good_id
760 758
           var params = {
761 759
             good_id:good_id,
762 760
             warehousing_order:this.form.warehousing_order,
763 761
             type:this.form.type,
764 762
           }
765
-          console.log("para2233232",params)
763
+    
766 764
          getDamageDetailByGoodId(params).then(response=>{
767 765
             if(response.data.state == 1){
768 766
               var list = response.data.data.list
769
-              console.log("list233232",list)
767
+             
770 768
               if (list.length>0){
771 769
                 this.modifyDialogVisible = true
772 770
                 this.good_name = list[0].good_name

+ 39 - 11
src/xt_pages/stock/stockPrint.vue Vedi File

@@ -42,13 +42,18 @@
42 42
                                       <span v-if="getWareInfo(item.xt_warehouse_info)>0">{{getWareInfo(item.xt_warehouse_info)}}{{item.packing_unit}}</span>
43 43
                                    </td>
44 44
                                    <td>
45
-                                        {{getAutoCount(item.id) + getOutCount(item.id)}}
46
-                                       <!-- <span v-if="getWareInfo(item.xt_warehouse_info)>0">{{getWareInfo(item.xt_warehouse_info) - getOverplus(item.xt_warehouse_info) - getCancelInfo(item.cancel_stock_info)}}{{item.packing_unit}}</span> -->
45
+                                      <span v-if="org_id == 9671 || org_id == 10138 || org_id == 10028 || org_id == 9675 || org_id == 4 || org_id == 3877 || org_id == 10243 || org_id == 10088 || org_id== 10245">
46
+                                        <span>
47
+                                          {{getWareInfo(item.xt_warehouse_info) - getOverFlushInfo(item.xt_warehouse_info) + getCancelSotckInfo(item.cancel_stock_info) }}
48
+                                          </span>
49
+                                        </span>
50
+                                        <span v-else>{{getAutoCount(item.id) + getOutCount(item.id)}} </span>
47 51
                                    </td>
48 52
                                   
49 53
                                    <td>
50
-                                     <span v-if="getWareInfo(item.xt_warehouse_info) > 0">{{getWareInfo(item.xt_warehouse_info) - getAutoCount(item.id) - getOutCount(item.id) + getCancelCount(item.id) }}</span> 
51
-                                     <!-- <span v-if="getOverplus(item.xt_warehouse_info)>0">{{getOverplus(item.xt_warehouse_info)}}{{item.packing_unit}}</span>   -->
54
+                                     <span v-if="org_id == 9671 || org_id == 10138 || org_id == 10028 || org_id == 9675 || org_id == 4 || org_id == 3877 || org_id == 10243 || org_id == 10088 || org_id == 10245">{{getOverFlushInfo(item.xt_warehouse_info)}}</span>
55
+                                     <span v-else>{{getWareInfo(item.xt_warehouse_info) - getAutoCount(item.id) - getOutCount(item.id) + getCancelCount(item.id) }}</span>
56
+                                    
52 57
                                    </td>
53 58
                                 </tr>
54 59
                             </tbody>
@@ -97,6 +102,7 @@ export default {
97 102
           outCountList:[],
98 103
           autoCountList:[],
99 104
           cancelCountList:[],
105
+          org_id:0,
100 106
         }
101 107
     },
102 108
     methods:{
@@ -122,10 +128,10 @@ export default {
122 128
         getAllStockList(params).then(response=>{
123 129
          if(response.data.state == 1){
124 130
            var list = response.data.data.list
125
-           console.log("list22222",list)
131
+          //  console.log("list22222",list)
126 132
            this.tableList = list
127 133
            var total = response.data.data.total
128
-           console.log("total",total)
134
+          //  console.log("total",total)
129 135
            this.total = total
130 136
            var manufacturerList = response.data.data.manufacturerList
131 137
            this.manufacturerList = manufacturerList
@@ -199,16 +205,16 @@ export default {
199 205
       getStockDrugCount(params).then(response=>{
200 206
          if(response.data.state == 1){
201 207
            var count = response.data.data.count
202
-           console.log("入库统计",count)
208
+          //  console.log("入库统计",count)
203 209
            this.countList = count
204 210
            var outlist = response.data.data.outList
205
-           console.log("出库数量",outlist)
211
+          //  console.log("出库数量",outlist)
206 212
            this.outCountList = outlist
207 213
            var autoCount = response.data.data.autoCount
208
-           console.log("autoCount",autoCount)
214
+          //  console.log("autoCount",autoCount)
209 215
            this.autoCountList = autoCount
210 216
            var totalCount = response.data.data.totalCount
211
-           console.log("totalcount",totalCount)
217
+          //  console.log("totalcount",totalCount)
212 218
            this.cancelCountList = totalCount
213 219
          }
214 220
       })
@@ -290,9 +296,31 @@ export default {
290 296
        total = ""
291 297
      }
292 298
      return total
299
+   },
300
+   getOverFlushInfo(arr){
301
+     var total = 0
302
+     if(arr.length >0){
303
+      for(let i=0;i<arr.length;i++){
304
+        total += arr[i].stock_count
305
+      }
306
+     }
307
+     return total
308
+   },
309
+   getCancelSotckInfo(arr){
310
+     console.log("2332323232322332",arr)
311
+     var cancle_toal = 0
312
+     if(arr.length >0){
313
+      for(let z=0;z<arr.length;z++){
314
+        cancle_toal += arr[z].count
315
+      }
316
+     }
317
+     console.log("total",cancle_toal)
318
+     return cancle_toal
293 319
    }
294
-    },
320
+   },
295 321
     created(){
322
+      this.org_id =  this.$store.getters.xt_user.org_id
323
+      console.log("机构ID232323323233232",this.org_id)
296 324
       var starttime =  this.$route.query.start_time
297 325
       this.start_time = starttime
298 326
       var endtime =  this.$route.query.end_time

+ 11 - 4
src/xt_pages/stock/stockQuery.vue Vedi File

@@ -341,12 +341,19 @@ export default {
341 341
            this.tableList[i].unit = this.tableList[i].specification_name + "/" + this.tableList[i].packing_unit
342 342
            this.tableList[i].prodect_name = this.getManufacture(this.tableList[i].manufacturer)
343 343
            this.tableList[i].inCount =  this.getWareInfo(this.tableList[i].xt_warehouse_info)
344
-           this.tableList[i].outCount =  this.getAutoCount(this.tableList[i].id) + this.getOutCount(this.tableList[i].id)
345
-          if(this.getWareInfo(this.tableList[i].xt_warehouse_info) > 0){
346
-            this.tableList[i].overplus = this.getWareInfo(this.tableList[i].xt_warehouse_info) - this.getAutoCount(this.tableList[i].id) - this.getOutCount(this.tableList[i].id) + this.getCancelCount(this.tableList[i].id)
344
+
345
+        
346
+          if(this.org_id == 9671 || this.org_id == 10138 || this.org_id == 10028 || this.org_id == 9675 || this.org_id == 4 || this.org_id ==3877 || this.org_id == 10243 || this.org_id == 10088 || this.org_id == 10245){
347
+             this.tableList[i].outCount  = this.getWareInfo(this.tableList[i].xt_warehouse_info) - this.getOverFlushInfo(this.tableList[i].xt_warehouse_info) + this.getCancelSotckInfo(this.tableList[i].cancel_stock_info) 
347 348
           }else{
348
-             this.tableList[i].overplus = 0
349
+            this.tableList[i].outCount =  this.getAutoCount(this.tableList[i].id) + this.getOutCount(this.tableList[i].id)
349 350
           }
351
+          
352
+           if(this.org_id == 9671 || this.org_id == 10138 || this.org_id == 10028 || this.org_id == 9675 || this.org_id == 4 || this.org_id ==3877 || this.org_id == 10243 || this.org_id == 10088 || this.org_id == 10245){
353
+              this.tableList[i].overplus = this.getOverFlushInfo(this.tableList[i].xt_warehouse_info)
354
+           }else{
355
+             this.tableList[i].overplus = this.getWareInfo(this.tableList[i].xt_warehouse_info) - this.getAutoCount(this.tableList[i].id) - this.getOutCount(this.tableList[i].id) + this.getCancelCount(this.tableList[i].id)
356
+           }
350 357
 
351 358
          }
352 359
          const data = this.formatJson(filterVal, this.tableList)