Browse Source

11月14日 库存扣减更新

XMLWAN 3 years ago
parent
commit
4be45a1af5

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

970
     params: params
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 View File

50
     //   name: 'drugDamaged',
50
     //   name: 'drugDamaged',
51
     //   meta: { title: 'drugDamaged', noCache: true }
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
     //   path: '/stock/drugs/drugWarning',
60
     //   path: '/stock/drugs/drugWarning',
61
     //   component: () => import('@/xt_pages/stock/drugs/drugWarning'),
61
     //   component: () => import('@/xt_pages/stock/drugs/drugWarning'),
62
     //   name: 'drugWarning',
62
     //   name: 'drugWarning',
63
     //   meta: { title: 'drugWarning', noCache: true }
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
       path: '/stock/drugs/inventoryPrint',
72
       path: '/stock/drugs/inventoryPrint',
73
       component: () => import('@/xt_pages/stock/drugs/inventoryPrint'),
73
       component: () => import('@/xt_pages/stock/drugs/inventoryPrint'),

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

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

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

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

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

45
               <td style="line-height: 50px">
45
               <td style="line-height: 50px">
46
                 <span> {{getManufacturerList(item.manufacturer)}}</span>
46
                 <span> {{getManufacturerList(item.manufacturer)}}</span>
47
               </td>
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
               <td>
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
              </td> 
61
              </td> 
53
             </tr>
62
             </tr>
54
             </tbody>
63
             </tbody>
346
         }
355
         }
347
         return count
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
         getCount(drug_id,min_number,max_unit,min_unit){
358
         getCount(drug_id,min_number,max_unit,min_unit){
367
         var total= 0
359
         var total= 0
368
         var str = ""
360
         var str = ""
506
          }
498
          }
507
         return max_str + min_str
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
     created() {
531
     created() {

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

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

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

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

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

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

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

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

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

10
         </div>
10
         </div>
11
         <div class="app-container" style="background-color: white;">
11
         <div class="app-container" style="background-color: white;">
12
             <div id="print_content">
12
             <div id="print_content">
13
-                <div class="printTitle">库存盘点核单数</div>
14
-                <div style="float:right;">调价日期:{{getTime(this.tableData[0].start_time)}}</div>
13
+              
15
                 <table class="printTable" border="1">
14
                 <table class="printTable" border="1">
16
                     <tr>
15
                     <tr>
17
                         <td>序号</td>
16
                         <td>序号</td>
18
-                        <td>耗材名称</td>
17
+                        <td>名称</td>
19
                         <td>规格</td>
18
                         <td>规格</td>
19
+                        <td>批号</td>
20
+                        <td>生产日期</td>
21
+                        <td>有效日期</td>
22
+                        <td>生产企业</td>
23
+                        <td>国药准字</td>
20
                         <td>单位</td>
24
                         <td>单位</td>
21
-                        <td>零售价</td>
22
-                        <td>当前库存</td>
23
-                        <td>盘点数</td>
24
-                        <td>亏损金额</td>
25
+                        <td>库存量</td>
25
                     </tr>
26
                     </tr>
26
                     <tr v-for="(item,index) in tableData" :key="index">
27
                     <tr v-for="(item,index) in tableData" :key="index">
27
                         <td>{{index+1}}</td>
28
                         <td>{{index+1}}</td>
28
                         <td>{{item.good_name}}</td>
29
                         <td>{{item.good_name}}</td>
29
                         <td>{{item.specification_name}}</td>
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
                         <td>{{item.warehousing_unit}}</td>
36
                         <td>{{item.warehousing_unit}}</td>
31
-                        <td>{{item.packing_price}}</td>
32
-                        <td></td>
33
-                        <td>{{item.count}}</td>
34
                         <td></td>
37
                         <td></td>
35
                     </tr>
38
                     </tr>
36
                 </table>
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
             </div>
41
             </div>
49
         </div>
42
         </div>
50
     </div>
43
     </div>
54
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
47
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
55
 const moment = require('moment');
48
 const moment = require('moment');
56
 import { uParseTime } from '@/utils/tools'
49
 import { uParseTime } from '@/utils/tools'
57
-import { getInventoryPrintList } from "@/api/stock"
50
+import { getInventoryExportList } from "@/api/stock"
58
 export default {
51
 export default {
59
     components:{
52
     components:{
60
         BreadCrumb
53
         BreadCrumb
68
           ],
61
           ],
69
           ids:"",
62
           ids:"",
70
           tableData:[],
63
           tableData:[],
64
+          manufacturerList:[],
71
         }
65
         }
72
     },
66
     },
73
     methods:{
67
     methods:{
81
             scanStyles: false
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
         getTime(val) {
78
         getTime(val) {
97
          if(val < 0){
79
          if(val < 0){
98
             return ""
80
             return ""
103
             return uParseTime(val, '{y}-{m}-{d}')
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
     created(){
108
     created(){
109
-      this.ids  = this.$route.query.ids
110
-      this.getInventoryPrintList()
109
+      this.getlist()
111
     }
110
     }
112
 }
111
 }
113
 </script>
112
 </script>

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

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

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

42
                                       <span v-if="getWareInfo(item.xt_warehouse_info)>0">{{getWareInfo(item.xt_warehouse_info)}}{{item.packing_unit}}</span>
42
                                       <span v-if="getWareInfo(item.xt_warehouse_info)>0">{{getWareInfo(item.xt_warehouse_info)}}{{item.packing_unit}}</span>
43
                                    </td>
43
                                    </td>
44
                                    <td>
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
                                    </td>
51
                                    </td>
48
                                   
52
                                   
49
                                    <td>
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
                                    </td>
57
                                    </td>
53
                                 </tr>
58
                                 </tr>
54
                             </tbody>
59
                             </tbody>
97
           outCountList:[],
102
           outCountList:[],
98
           autoCountList:[],
103
           autoCountList:[],
99
           cancelCountList:[],
104
           cancelCountList:[],
105
+          org_id:0,
100
         }
106
         }
101
     },
107
     },
102
     methods:{
108
     methods:{
122
         getAllStockList(params).then(response=>{
128
         getAllStockList(params).then(response=>{
123
          if(response.data.state == 1){
129
          if(response.data.state == 1){
124
            var list = response.data.data.list
130
            var list = response.data.data.list
125
-           console.log("list22222",list)
131
+          //  console.log("list22222",list)
126
            this.tableList = list
132
            this.tableList = list
127
            var total = response.data.data.total
133
            var total = response.data.data.total
128
-           console.log("total",total)
134
+          //  console.log("total",total)
129
            this.total = total
135
            this.total = total
130
            var manufacturerList = response.data.data.manufacturerList
136
            var manufacturerList = response.data.data.manufacturerList
131
            this.manufacturerList = manufacturerList
137
            this.manufacturerList = manufacturerList
199
       getStockDrugCount(params).then(response=>{
205
       getStockDrugCount(params).then(response=>{
200
          if(response.data.state == 1){
206
          if(response.data.state == 1){
201
            var count = response.data.data.count
207
            var count = response.data.data.count
202
-           console.log("入库统计",count)
208
+          //  console.log("入库统计",count)
203
            this.countList = count
209
            this.countList = count
204
            var outlist = response.data.data.outList
210
            var outlist = response.data.data.outList
205
-           console.log("出库数量",outlist)
211
+          //  console.log("出库数量",outlist)
206
            this.outCountList = outlist
212
            this.outCountList = outlist
207
            var autoCount = response.data.data.autoCount
213
            var autoCount = response.data.data.autoCount
208
-           console.log("autoCount",autoCount)
214
+          //  console.log("autoCount",autoCount)
209
            this.autoCountList = autoCount
215
            this.autoCountList = autoCount
210
            var totalCount = response.data.data.totalCount
216
            var totalCount = response.data.data.totalCount
211
-           console.log("totalcount",totalCount)
217
+          //  console.log("totalcount",totalCount)
212
            this.cancelCountList = totalCount
218
            this.cancelCountList = totalCount
213
          }
219
          }
214
       })
220
       })
290
        total = ""
296
        total = ""
291
      }
297
      }
292
      return total
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
     created(){
321
     created(){
322
+      this.org_id =  this.$store.getters.xt_user.org_id
323
+      console.log("机构ID232323323233232",this.org_id)
296
       var starttime =  this.$route.query.start_time
324
       var starttime =  this.$route.query.start_time
297
       this.start_time = starttime
325
       this.start_time = starttime
298
       var endtime =  this.$route.query.end_time
326
       var endtime =  this.$route.query.end_time

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

341
            this.tableList[i].unit = this.tableList[i].specification_name + "/" + this.tableList[i].packing_unit
341
            this.tableList[i].unit = this.tableList[i].specification_name + "/" + this.tableList[i].packing_unit
342
            this.tableList[i].prodect_name = this.getManufacture(this.tableList[i].manufacturer)
342
            this.tableList[i].prodect_name = this.getManufacture(this.tableList[i].manufacturer)
343
            this.tableList[i].inCount =  this.getWareInfo(this.tableList[i].xt_warehouse_info)
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
           }else{
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
          const data = this.formatJson(filterVal, this.tableList)
359
          const data = this.formatJson(filterVal, this.tableList)