XMLWAN 3 years ago
parent
commit
685c79d176

+ 2 - 2
src/xt_pages/dialysis/dialysisDoctorAdvice.vue View File

@@ -513,7 +513,7 @@ export default {
513 513
             var config = resp.data.config
514 514
             console.log("config222222",config.is_open)
515 515
             let project_config = resp.data.project_config
516
-            console.log('project_config',resp.data.hisAdvices)
516
+            console.log('project_config',)
517 517
             if(project_config.is_open == 1){
518 518
               this.project = resp.data.project
519 519
               resp.data.hisAdvices.map((item,index) => {
@@ -618,7 +618,7 @@ export default {
618 618
              this.show = false
619 619
              this.showOne  = true
620 620
             var schedules =  resp.data.hisAdvices
621
-          
621
+            console.log("hhhhhhhh22323232323232",schedules)
622 622
             let arr = []
623 623
             let newArr = []
624 624
             let newSchedules = []

+ 3 - 0
src/xt_pages/stock/Dialog/goodInfoDailog.vue View File

@@ -371,6 +371,9 @@
371 371
           good_name: [
372 372
             { required: true, message: '请输入耗材名称', trigger: 'blur' }
373 373
           ],
374
+          packing_unit:[
375
+            {required:true,message:"请输入包装单位",trigger:'blur'}
376
+          ],
374 377
           good_kind: [
375 378
             { required: true, message: '请选择耗材种类', trigger: 'change' }
376 379
           ],

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

@@ -653,15 +653,16 @@ export default {
653 653
       const params = {
654 654
         id: order_id
655 655
       };
656
-   
656
+      console.log("parasm222222222",params)
657
+      this.WarehouseInfo.warehouseInfoDate = []
657 658
       getDrugWarehouseInfoList(params).then(response => {
658 659
         if (response.data.state == 0) {
659 660
           this.$message.error(response.data.msg);
660 661
           return false;
661 662
         } else {
663
+          console.log("hhhhhhhhhh",response.data.data.info)
662 664
           for (let i = 0; i < response.data.data.info.length; i++) {
663 665
             this.showOne = true
664
-            this.WarehouseInfo.warehouseInfoDate = []
665 666
             this.WarehouseInfo.warehouseInfoDate.push(response.data.data.info[i]);
666 667
             console.log("列表详情",this.WarehouseInfo.warehouseInfoDate)
667 668
           }

+ 40 - 15
src/xt_pages/stock/stockBatchNumber.vue View File

@@ -5,9 +5,10 @@
5 5
     </div>
6 6
     <div class="app-container ">
7 7
       <div class="cell clearfix">
8
-       耗材名称:{{this.$route.query.good_name}}
9
-       <!-- 库存:
10
-       厂家: -->
8
+        耗材名称:{{this.$route.query.good_name}} &nbsp;
9
+        库存:{{getInCount(this.$route.query.id)}} &nbsp;
10
+        规格:{{this.$route.query.specification_name}} &nbsp;
11
+        厂家:{{this.$route.query.manufacturer}} 
11 12
       </div>
12 13
       <div class="cell clearfix">
13 14
         <span>日期查询:</span>
@@ -115,11 +116,12 @@
115 116
   import { uParseTime } from '@/utils/tools'
116 117
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
117 118
   import {getStockInList} from "@/api/drug/drug_stock";
119
+  import {getStockDrugCount} from "@/api/stock"
118 120
   export default {
119 121
     name: 'stockIn',
120 122
     created() {
121 123
       this.getlist()
122
-    //   this.getOutList()
124
+      this.getStockDrugCount()
123 125
     },
124 126
     components: {
125 127
       BreadCrumb
@@ -162,7 +164,10 @@
162 164
           {id:2,name:"自动出库"},
163 165
           {id:3,name:"入库"},
164 166
         ],
165
-      
167
+        countList:[],
168
+        outCountList:[],
169
+        autoCountList:[],
170
+        keywords:"",
166 171
       }
167 172
     },
168 173
     methods:{
@@ -236,23 +241,43 @@
236 241
            console.log("入库数据",this.tableList)
237 242
            var manufacturerList = response.data.data.manufacturerList
238 243
            this.manufacturerList = manufacturerList
239
-
240
-          // var outlist =  response.data.data.outList
241
-          // console.log("outlist",outlist)
242
-          // for(let i=0;i<outlist.length;i++){
243
-          //     outlist[i].stock_way = 2
244
-          //     this.tableList.push(outlist[i])
245
-          // }
246
-          
247
-           
248 244
          }
249 245
       })
250 246
      },
247
+    getInCount(id){
248
+      var count= ""
249
+      for(let i=0;i<this.countList.length;i++){
250
+          if(id == this.countList[i].good_id){
251
+              count = this.countList[i].count
252
+          }
253
+        }
254
+        return count
255
+     },
251 256
      getTimestamp(time) {
252 257
       // 把时间日期转成时间戳
253 258
       return new Date(time).getTime() / 1000;
254 259
      },
255
-     
260
+    getStockDrugCount(){
261
+        var params ={
262
+          keywords: this.keywords,
263
+          start_time:this.start_time,
264
+          end_time:this.end_time,
265
+        }
266
+      getStockDrugCount(params).then(response=>{
267
+         if(response.data.state == 1){
268
+           var count = response.data.data.count
269
+           console.log("详情入库统计",count)
270
+           this.countList = count
271
+           var outlist = response.data.data.outList
272
+           console.log("详情出库数量",outlist)
273
+          
274
+           this.outCountList = outlist
275
+           var autoCount = response.data.data.autoCount
276
+           console.log("详情自动出库",autoCount)
277
+           this.autoCountList = autoCount
278
+         }
279
+      })
280
+    },
256 281
 
257 282
     }
258 283
   }

+ 65 - 20
src/xt_pages/stock/stockFlow.vue View File

@@ -5,10 +5,10 @@
5 5
     </div>
6 6
     <div class="app-container ">
7 7
       <div class="cell clearfix">
8
-       耗材名称:{{this.$route.query.good_name}}
9
-       库存:{{getInCount(this.$route.query.id)}}
10
-       <!-- 厂家:{{this.$route.query.manufacturer}}
11
-       规格: -->
8
+       耗材名称:{{this.$route.query.good_name}} &nbsp;
9
+       库存:{{getInCount(this.$route.query.id)}} &nbsp;
10
+       规格:{{this.$route.query.specification_name}} &nbsp;
11
+       厂家:{{this.$route.query.manufacturer}} 
12 12
       </div>
13 13
       <div class="cell clearfix">
14 14
         <span>日期查询:</span>
@@ -39,15 +39,15 @@
39 39
               @change="endTimeChange"
40 40
           ></el-date-picker>
41 41
 
42
-        <!-- <span>出入库方式:</span> -->
43
-        <!-- <el-select v-model="stock_type" style="width:160px;margin-right:10px;" placeholder="请选择" @change="changeDrug">
42
+        <span>出入库方式:</span>
43
+         <el-select v-model="stock_type" style="width:160px;margin-right:10px;" placeholder="请选择" @change="changeDrug">
44 44
             <el-option
45 45
               v-for="(item,index) in stockType"
46 46
               :key="index"
47 47
               :label="item.name"
48 48
               :value="item.id">
49 49
             </el-option>
50
-        </el-select> -->
50
+        </el-select>
51 51
         
52 52
         
53 53
       </div>
@@ -63,13 +63,14 @@
63 63
         </el-table-column>
64 64
         <el-table-column prop="drug_type" label="出入库方式" width="180" align="center">
65 65
            <template slot-scope="scope">
66
-             <span v-if="scope.row.stock_way == 4">入库</span>
67
-             <span v-if="scope.row.stock_way == 2">出库</span>
66
+             <span v-if="scope.row.stock_way == 4">采购入库</span>
67
+             <span v-if="scope.row.stock_way == 3">手动出库</span>
68
+             <span v-if="scope.row.stock_way == 2">自动出库</span>
68 69
            </template>
69 70
         </el-table-column>
70 71
         <el-table-column prop="drug_name" label="出/入库单据编码" align="center">
71 72
            <template slot-scope="scope">
72
-             <span v-if="scope.row.stock_way == 2"> {{scope.row.warehouse_out_order_number}}</span>
73
+             <span v-if="scope.row.stock_way == 2 || scope.row.stock_way == 3"> {{scope.row.warehouse_out_order_number}}</span>
73 74
              <span v-if="scope.row.stock_way == 4">{{scope.row.warehousing_order}}</span>
74 75
             
75 76
            </template>
@@ -82,7 +83,7 @@
82 83
          <el-table-column prop="drug_name" label="入库数量"  align="center">
83 84
            <template slot-scope="scope">
84 85
              <span v-if="scope.row.stock_way == 4 && scope.row.warehousing_count!=0"> {{scope.row.warehousing_count}}</span>
85
-             <span v-if="scope.row.stock_way == 2 && scope.row.count!=0">{{scope.row.count}}</span>
86
+             <span v-if="(scope.row.stock_way == 2 || scope.row.stock_way == 3) && scope.row.count!=0">{{scope.row.count}}</span>
86 87
            </template>
87 88
         </el-table-column>
88 89
          <el-table-column prop="drug_name" label="剩余库存量"  align="center">
@@ -94,25 +95,25 @@
94 95
         <el-table-column prop="drug_name" label="进/出货单价"  align="center">
95 96
            <template slot-scope="scope">
96 97
              <span v-if="scope.row.stock_way == 4"> {{scope.row.price}}</span>
97
-             <span v-if="scope.row.stock_way == 2">{{scope.row.price}}</span>
98
+             <span v-if="scope.row.stock_way == 2 || scope.row.stock_way == 3">{{scope.row.price}}</span>
98 99
            </template>
99 100
         </el-table-column>
100 101
          <el-table-column prop="drug_name" label="有效期" align="center">
101 102
            <template slot-scope="scope" >
102 103
              <span v-if="scope.row.stock_way == 4"> {{getTime(scope.row.expiry_date)}}</span>
103
-             <span v-if="scope.row.stock_way == 2">{{getTime(scope.row.expiry_date)}}</span>
104
+             <span v-if="scope.row.stock_way == 2 || scope.row.stock_way == 3">{{getTime(scope.row.expiry_date)}}</span>
104 105
            </template>
105 106
         </el-table-column>
106 107
         <el-table-column prop="drug_name" label="批号" align="center">
107 108
            <template slot-scope="scope" >
108 109
              <span v-if="scope.row.stock_way == 2"> {{scope.row.number}}</span>
109
-             <span v-if="scope.row.stock_way == 4">{{scope.row.number}}</span>
110
+             <span v-if="scope.row.stock_way == 4 || scope.row.stock_way == 3">{{scope.row.number}}</span>
110 111
            </template>
111 112
         </el-table-column>
112 113
         <el-table-column prop="drug_name" label="生产商" align="center">
113 114
            <template slot-scope="scope">
114 115
              <span v-if="scope.row.stock_way == 4"> {{getManufacturer(scope.row.manufacturer)}}</span>
115
-             <span v-if="scope.row.stock_way == 2">{{getManufacturer(scope.row.manufacturer)}}</span>
116
+             <span v-if="scope.row.stock_way == 2 || scope.row.stock_way == 3">{{getManufacturer(scope.row.manufacturer)}}</span>
116 117
            </template>
117 118
         </el-table-column>
118 119
        </el-table>
@@ -135,7 +136,7 @@
135 136
 <script>
136 137
   import { uParseTime } from '@/utils/tools'
137 138
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
138
-  import {getStockInList} from "@/api/drug/drug_stock";
139
+  import {getStockInList,getStockOutList} from "@/api/drug/drug_stock";
139 140
   import {getStockDrugCount} from "@/api/stock"
140 141
   export default {
141 142
     name: 'stockIn',
@@ -143,7 +144,7 @@
143 144
      
144 145
       this.getlist()
145 146
       this.getStockDrugCount()
146
-
147
+      this.getStockOutList()
147 148
     },
148 149
     components: {
149 150
       BreadCrumb
@@ -182,9 +183,9 @@
182 183
         manufacturerList:[],
183 184
         stockType:[
184 185
           {id:0,name:"全部"},
185
-          {id:1,name:"手动出库"},
186
+          {id:3,name:"手动出库"},
186 187
           {id:2,name:"自动出库"},
187
-          {id:3,name:"入库"},
188
+          {id:4,name:"采购入库"},
188 189
         ],
189 190
         countList:[],
190 191
         outCountList:[],
@@ -199,10 +200,12 @@
199 200
        handleSizeChange(val) {
200 201
         this.limit = val
201 202
         this.getlist()
203
+        this.getStockOutList()
202 204
       },
203 205
       handleCurrentChange(val) {
204 206
         this.page = val
205 207
         this.getlist()
208
+        this.getStockOutList()
206 209
       },
207 210
         
208 211
     startTimeChange: function(val) {
@@ -213,6 +216,7 @@
213 216
         this.start_time = "";
214 217
       } else {
215 218
         this.getlist()
219
+        this.getStockOutList()
216 220
       }
217 221
     },
218 222
     endTimeChange: function(val) {
@@ -222,6 +226,7 @@
222 226
         this.end_time = "";
223 227
       } else {
224 228
        this.getlist()
229
+       this.getStockOutList()
225 230
       }
226 231
      },
227 232
      getManufacturer(id){
@@ -250,7 +255,8 @@
250 255
           page:this.page,
251 256
           id:this.$route.query.id,
252 257
           start_time:this.start_time,
253
-          end_time:this.end_time, 
258
+          end_time:this.end_time,
259
+          is_sys:this.stockType 
254 260
         } 
255 261
       getStockInList(params).then(response=>{
256 262
          if(response.data.state == 1){
@@ -267,6 +273,33 @@
267 273
          }
268 274
       })
269 275
      },
276
+    getStockOutList(){
277
+       var params= {
278
+          limit:this.limit,
279
+          page:this.page,
280
+          id:this.$route.query.id,
281
+          start_time:this.start_time,
282
+          end_time:this.end_time, 
283
+          is_sys:this.stockType 
284
+        } 
285
+      getStockOutList(params).then(response=>{
286
+        if(response.data.state == 1){
287
+          var outList = response.data.data.outList
288
+          console.log("outList990-0000990",outList)
289
+           for(let i=0;i<outList.length;i++){
290
+             if(outList[i].is_sys == 0){
291
+                outList[i].stock_way = 2
292
+             }
293
+             if(outList[i].is_sys == 1){
294
+                outList[i].stock_way = 3
295
+             }
296
+             this.tableList.push(outList[i])
297
+           }
298
+          var total = response.data.data.total
299
+          this.total = total
300
+        }  
301
+      })
302
+    },
270 303
     getStockDrugCount(){
271 304
         var params ={
272 305
           keywords: this.keywords,
@@ -280,6 +313,7 @@
280 313
            this.countList = count
281 314
            var outlist = response.data.data.outList
282 315
            console.log("详情出库数量",outlist)
316
+          
283 317
            this.outCountList = outlist
284 318
            var autoCount = response.data.data.autoCount
285 319
            console.log("详情自动出库",autoCount)
@@ -319,6 +353,17 @@
319 353
       // 把时间日期转成时间戳
320 354
       return new Date(time).getTime() / 1000;
321 355
      },
356
+     changeDrug(val){
357
+       this.tableList= []
358
+       if(val == 4 || val == 0){
359
+        this.getlist()
360
+       }
361
+       if(val == 2 || val == 3 || val == 0){
362
+        this.getStockOutList()
363
+       }
364
+      
365
+      
366
+     }
322 367
     }
323 368
   }
324 369
 </script>

+ 20 - 4
src/xt_pages/stock/stockInOrder.vue View File

@@ -21,7 +21,7 @@
21 21
           style="width: 400px;"
22 22
           v-model.trim="searchKey"
23 23
           class="filter-item"
24
-          placeholder="单据编码/制单人/厂商"
24
+          placeholder="单据编码/制单人/耗材名称"
25 25
         />
26 26
         <el-button
27 27
           size="small"
@@ -74,6 +74,8 @@
74 74
         <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
75 75
 
76 76
         <el-button size="small" type="primary" @click="toPrint">打印</el-button>
77
+
78
+        <!-- <el-button size="small" type="primary" @click="exportList">导出</el-button> -->
77 79
       </div>
78 80
 
79 81
       <el-table
@@ -638,7 +640,6 @@ export default {
638 640
   name: "stockIn",
639 641
   components: { BreadCrumb, stockInDialog },
640 642
   created() {
641
-
642 643
     var nowDate = new Date();
643 644
     var nowYear = nowDate.getFullYear();
644 645
     var nowMonth = nowDate.getMonth() + 1;
@@ -665,6 +666,8 @@ export default {
665 666
     this.fetchAllAdminUsers();
666 667
     this.GetAllGoodType()
667 668
     this.GetAllGoodInfo()
669
+    // this.getlist()
670
+    
668 671
   },
669 672
   data() {
670 673
 
@@ -1164,8 +1167,6 @@ export default {
1164 1167
           this.tableShow = true
1165 1168
           for (let i = 0; i < response.data.data.info.length; i++) {
1166 1169
             this.WarehouseInfo.warehouseInfoDate.push(response.data.data.info[i]);
1167
-            // response.data.data.info[i].product_date = this.getTime(response.data.data.info[i].product_date,"{y}-{m}-{d}");
1168
-            // response.data.data.info[i].expiry_date = this.getTime(response.data.data.info[i].expiry_date,"{y}-{m}-{d}");
1169 1170
             response.data.data.info[i].price = response.data.data.info[i].price.toString();
1170 1171
             response.data.data.info[i].warehousing_count = response.data.data.info[i].warehousing_count.toString();
1171 1172
 
@@ -1444,6 +1445,21 @@ export default {
1444 1445
       }else{
1445 1446
         this.$router.push("/stock/in/detail/print?id="+this.order_id)
1446 1447
       }
1448
+    },
1449
+    getlist(){
1450
+      var params = {
1451
+        id:this.order_id,
1452
+        start_time:this.start_time,
1453
+        end_time:this.end_time,
1454
+      }
1455
+      getExportStockList().then(response=>{
1456
+
1457
+      })
1458
+    },
1459
+    exportList(){
1460
+      exportList().then(response=>{
1461
+
1462
+      })
1447 1463
     }
1448 1464
   }
1449 1465
 };

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

@@ -43,7 +43,7 @@
43 43
                                     <td style="line-height:18px;">{{ item.remark }}</td>
44 44
                                     <td style="line-height:18px;"><span v-if="item.good_id != 0">{{getSpecificationName(item.good_id)}}</span></td>
45 45
                                     <td style="line-height:18px;">{{ getManufacturer(item.good_id) }}</td>
46
-                                    <td style="line-height:18px;"><span v-if="item.good_id!=0">{{getUnit(item.good_id)}}</span></td>
46
+                                    <td style="line-height:18px;"><span v-if="item.good_id!=0">{{item.GoodInfo.packing_unit}}</span></td>
47 47
                                     <td style="line-height:18px;">{{item.price}}</td>
48 48
                                     <td style="line-height:18px;">{{item.warehousing_count}}</td> 
49 49
                                     <td style="line-height:18px;">{{(item.warehousing_count*item.price).toFixed(2)}}</td>

+ 116 - 50
src/xt_pages/stock/stockPrint.vue View File

@@ -21,34 +21,26 @@
21 21
                         <table class="table">
22 22
                             <thead>
23 23
                                 <tr>
24
-                                    <td width="60">商品编码</td>
25
-                                    <td width="80">耗材名称</td>
26 24
                                     <td width="80">耗材类型</td>
27
-                                    <td width="80">规格型号</td>
25
+                                    <td width="80">耗材名称</td>
26
+                                    <td width="80">规格&单位</td>
27
+                                    <td width="80">进货单价</td>
28
+                                    <td width="80">生产商</td>
28 29
                                     <td width="80">入库数量</td>
29
-                                    <td width="80">进货价</td>
30
-                                    <td width="80">入库退货</td>
31
-                                    <td width="80">实际入库</td>
32 30
                                     <td width="80">出库数量</td>
33
-                                    <td width="80">出库退库</td>
34
-                                    <td width="80">实际出库</td>
35 31
                                     <td width="80">剩余库存</td>
36 32
                                 </tr>
37 33
                             </thead>
38 34
                             <tbody>
39
-                                <tr v-for='(item,index) in WarehouseInfo.warehouseInfoDate' :key="index">
40
-                                    <td>{{item.good_code}}</td>
41
-                                    <td>{{item.good_name}}</td>
42
-                                    <td>{{item.type.type_name}}</td>
43
-                                    <td>{{item.specification_name}}</td>
44
-                                    <td>{{stockInCount(item)}}</td>
45
-                                    <td>{{item.price}}</td>
46
-                                    <td>{{salesReturnCount(item)}}</td>
47
-                                    <td> {{ stockInCount(item) - salesReturnCount(item) }}</td>
48
-                                    <td>{{ stockOutCount(item) }}</td>
49
-                                    <td>{{cancelStockCount(item) }}</td>
50
-                                    <td>{{ stockOutCount(item) - cancelStockCount(item)}}</td>
51
-                                    <td>{{stockInCount(item) -salesReturnCount(item) -stockOutCount(item) +cancelStockCount(item)}}</td>
35
+                                <tr v-for='(item,index) in tableList' :key="index">
36
+                                   <td>{{getGoodType(item.good_type_id)}}</td>
37
+                                   <td>{{item.good_name }}</td>
38
+                                   <td><span>{{item.specification_name }} / {{item.packing_unit}}</span></td>
39
+                                   <td>{{item.price}}</td>
40
+                                   <td>{{getManufacture(item.manufacturer)}}</td>
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>
52 44
                                 </tr>
53 45
                             </tbody>
54 46
                         </table>
@@ -61,7 +53,7 @@
61 53
 
62 54
 <script>
63 55
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
64
-import { getAllStockQueryList } from "@/api/stock";
56
+import { getAllStockList,GetAllGoodType,getStockDrugCount } from "@/api/stock";
65 57
 import print from 'print-js'
66 58
 const moment = require('moment')
67 59
 export default {
@@ -87,8 +79,14 @@ export default {
87 79
           page:"",
88 80
           WarehouseInfo: {
89 81
           loading: false,
90
-          warehouseInfoDate: []
82
+          warehouseInfoDate: [],
91 83
          },
84
+          tableList:[],
85
+          goodType:[],
86
+          manufacturerList:[],
87
+          countList:[],
88
+          outCountList:[],
89
+          autoCountList:[],
92 90
         }
93 91
     },
94 92
     methods:{
@@ -103,39 +101,40 @@ export default {
103 101
           })
104 102
       },
105 103
       getlist(){
106
-         const Params = {
107
-            page: this.page,
108
-            limit: this.limit,
109
-            keyword: this.keywords,
110
-            start_time:this.start_time,
111
-            end_time:this.end_time,
112
-            type_name:this.type_name,
113
-        };
114
-         this.WarehouseInfo.loading = true;
115
-         this.WarehouseInfo.warehouseInfoDate = [];
116
-         getAllStockQueryList(Params).then(response => {
117
-           if (response.data.state == 0) {
118
-            this.WarehouseInfo.loading = false;
104
+        const params = {
105
+          page: this.page,
106
+          limit: this.limit,
107
+          keywords: this.keywords,
108
+          start_time:this.start_time,
109
+          end_time:this.end_time,
110
+          type:this.type_name,
111
+        }
112
+        getAllStockList(params).then(response=>{
113
+         if(response.data.state == 1){
114
+           var list = response.data.data.list
115
+           console.log("list22222",list)
116
+           this.tableList = list
117
+           var total = response.data.data.total
118
+           console.log("total",total)
119
+           this.total = total
120
+           var manufacturerList = response.data.data.manufacturerList
121
+           this.manufacturerList = manufacturerList
122
+         }
123
+       })
124
+      },
125
+      GetAllGoodType() {
126
+        GetAllGoodType().then(response => {
127
+          if (response.data.state == 0) {
119 128
             this.$message.error(response.data.msg);
120 129
             return false;
121 130
           } else {
122
-            this.WarehouseInfo.loading = false;
123
-            this.total = response.data.data.total;
124
-          for (let i = 0; i < response.data.data.list.length; i++) {
125
-            this.WarehouseInfo.warehouseInfoDate.push( response.data.data.list[i]);
126
-          }
127
-          for(let i=0;i<this.WarehouseInfo.warehouseInfoDate.length;i++){
128
-            if(this.WarehouseInfo.warehouseInfoDate[i].query_warehousing_info.length>0){
129
-              this.WarehouseInfo.warehouseInfoDate[i].price = this.WarehouseInfo.warehouseInfoDate[i].query_warehousing_info[0].price
130
-            }else{
131
-              this.WarehouseInfo.warehouseInfoDate[i].price = ""
131
+            for (let i = 0; i < response.data.data.goodType.length; i++) {
132
+              this.goodType.push(response.data.data.goodType[i]);
132 133
             }
133 134
           }
134
-         }
135
-            console.log("打印数据源头",this.WarehouseInfo.warehouseInfoDate)
136
-          });
135
+        });
137 136
       },
138
-       stockInCount: function(row) {
137
+      stockInCount: function(row) {
139 138
       let total = 0;
140 139
       for (let i = 0; i < row.query_warehousing_info.length; i++) {
141 140
         total = total + row.query_warehousing_info[i].warehousing_count;
@@ -163,6 +162,71 @@ export default {
163 162
       }
164 163
       return total;
165 164
     },
165
+    getGoodType(id){
166
+      var name = ""
167
+      for(let i=0;i<this.goodType.length;i++){
168
+        if(id == this.goodType[i].id){
169
+           name = this.goodType[i].type_name
170
+        }
171
+      }
172
+      return name
173
+     },
174
+    getManufacture(id){
175
+       var name = ""
176
+       for(let i=0;i<this.manufacturerList.length;i++){
177
+         if(id == this.manufacturerList[i].id){
178
+           name = this.manufacturerList[i].manufacturer_name
179
+         }
180
+       }
181
+       return name
182
+     },
183
+     getStockDrugCount(){
184
+        var params ={
185
+          keywords: this.keywords,
186
+          start_time:this.start_time,
187
+          end_time:this.end_time,
188
+        }
189
+      getStockDrugCount(params).then(response=>{
190
+         if(response.data.state == 1){
191
+           var count = response.data.data.count
192
+           console.log("入库统计",count)
193
+           this.countList = count
194
+           var outlist = response.data.data.outList
195
+           console.log("出库数量",outlist)
196
+           this.outCountList = outlist
197
+           var autoCount = response.data.data.autoCount
198
+           console.log("autoCount",autoCount)
199
+           this.autoCountList = autoCount
200
+         }
201
+      })
202
+    },
203
+      getInCount(id){
204
+        var count= ""
205
+      for(let i=0;i<this.countList.length;i++){
206
+        if(id == this.countList[i].good_id){
207
+            count = this.countList[i].count
208
+        }
209
+      }
210
+      return count
211
+      },
212
+      getOutCount(id){
213
+        var count = ""
214
+        for(let i=0;i<this.outCountList.length;i++){
215
+          if(id == this.outCountList[i].good_id){
216
+            count = this.outCountList[i].count
217
+          }
218
+        }
219
+        return count
220
+      },
221
+      getAutoCount(id){
222
+        var count= ""
223
+        for(let i=0;i<this.autoCountList.length;i++){
224
+          if(id == this.autoCountList[i].good_id){
225
+            count = this.autoCountList[i].count
226
+          }
227
+        }
228
+        return count
229
+      }
166 230
     },
167 231
     created(){
168 232
       var starttime =  this.$route.query.start_time
@@ -176,6 +240,8 @@ export default {
176 240
       this.page = this.$route.query.page
177 241
       this.limit = this.$route.query.limit
178 242
       this.getlist()
243
+      this.GetAllGoodType()
244
+      this.getStockDrugCount()
179 245
     }
180 246
 }
181 247
 </script>

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

@@ -165,7 +165,6 @@ import {
165 165
 export default {
166 166
   name: "stockIn",
167 167
   created() {
168
-    // this.GetAllStockQuery();
169 168
     this.GetAllGoodInfo();
170 169
     this.GetAllGoodType();
171 170
     this.getlist()
@@ -372,13 +371,22 @@ export default {
372 371
     },
373 372
 
374 373
     exportList(){
375
-
376 374
          import('@/vendor/Export2Excel').then(excel => {
377
-         const tHeader = ['商品编码', '耗材名称', '耗材类型','规格型号','入库数量','进货价','入库退货','实际入库','出库数量','出库退库','实际出库','剩余库存']
378
-         const filterVal = ['good_code', 'good_name', 'type_name','specification_name','stockInCount','price','salesReturnCount','realCount','stockOutCount','cancelStockCount','realOutCount','overplus']
379
-         const data = this.formatJson(filterVal, this.WarehouseInfo.warehouseInfoDate)
380
-         console.log("data",data)
381 375
 
376
+         const tHeader = ['耗材类型', '耗材名称', '规格&单位','规格型号','进货单价','生产商','入库数量','出库数量','库存剩余量']
377
+         const filterVal = ['type_name', 'good_name', 'unit','specification_name','price','prodect_name','inCount','outCount','overplus']
378
+
379
+       
380
+         for(let i=0;i<this.tableList.length;i++){
381
+           this.tableList[i].type_name = this.getGoodType(this.tableList[i].good_type_id)
382
+           this.tableList[i].unit = this.tableList[i].specification_name + "/" + this.tableList[i].packing_unit
383
+           this.tableList[i].prodect_name = this.getManufacture(this.tableList[i].manufacturer)
384
+           this.tableList[i].inCount =  this.getOutCount(this.tableList[i].good_id) + this.getAutoCount(this.tableList[i].good_id)
385
+           this.tableList[i].outCount = this.getOutCount(this.tableList[i].good_id) + this.getAutoCount(this.tableList[i].good_id)
386
+           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)
387
+         }
388
+         console.log("table",this.tableList)
389
+         const data = this.formatJson(filterVal, this.tableList)
382 390
          excel.export_json_to_excel({
383 391
            header: tHeader,
384 392
            data,
@@ -391,7 +399,7 @@ export default {
391 399
         return jsonData.map(v => filterVal.map(j => v[j]));
392 400
       },
393 401
       changeTypeName(){
394
-       this.GetAllStockQuery()
402
+       this.getlist()
395 403
       },
396 404
       toPrint(){
397 405
         this.$router.push("/stock/stockprint?start_time="+this.start_time+"&end_time="+this.end_time+"&keyword="+this.keywords+"&type_name="+this.type_name+"&page="+this.page+"&limit="+this.limit)
@@ -429,7 +437,7 @@ export default {
429 437
         keywords: this.keywords,
430 438
         start_time:this.start_time,
431 439
         end_time:this.end_time,
432
-        type_name:this.type_name,
440
+        type:this.type_name,
433 441
       };
434 442
      console.log("params",params)
435 443
       getAllStockList(params).then(response=>{
@@ -456,16 +464,25 @@ export default {
456 464
     },
457 465
     toClick(val){
458 466
        var manufacturer_name = ""
467
+       var specification_name = ""
459 468
        for(let i=0;i<this.manufacturerList.length;i++){
460 469
           if(val.manufacturer == this.manufacturerList[i].id){
461 470
             manufacturer_name = this.manufacturerList[i].manufacturer_name  
462 471
           }
463 472
        }
464
-      console.log("厂家22222",manufacturer_name)
465
-      this.$router.push({path:"/stock/in/stockflow?id="+val.good_id+"&good_name="+val.good_name+"&manufacturer="+manufacturer_name})
473
+      specification_name = val.specification_name + "/" + val.packing_unit
474
+      this.$router.push({path:"/stock/in/stockflow?id="+val.good_id+"&good_name="+val.good_name+"&manufacturer="+manufacturer_name+"&specification_name="+specification_name})
466 475
     },
467 476
     toClickOne(val){
468
-      this.$router.push({path:"/stock/in/stockbatchnumber?id="+val.good_id+"&good_name="+val.good_name})
477
+       var manufacturer_name = ""
478
+       var specification_name = ""
479
+       for(let i=0;i<this.manufacturerList.length;i++){
480
+          if(val.manufacturer == this.manufacturerList[i].id){
481
+            manufacturer_name = this.manufacturerList[i].manufacturer_name  
482
+          }
483
+       }
484
+      specification_name = val.specification_name + "/" + val.packing_unit
485
+      this.$router.push({path:"/stock/in/stockbatchnumber?id="+val.good_id+"&good_name="+val.good_name+"&manufacturer="+manufacturer_name+"&specification_name="+specification_name})
469 486
     },
470 487
     getStockDrugCount(){
471 488
         var params ={