XMLWAN 3 years ago
parent
commit
8a80fbd2e8

+ 16 - 0
src/api/drug/drug_stock.js View File

@@ -493,3 +493,19 @@ export function getAutoDrugDetail(params) {
493 493
     params: params
494 494
   })
495 495
 }
496
+
497
+export function getDrugOrderInPrint(params) {
498
+  return request({
499
+    url: '/api/drug/getdrugorderinprint',
500
+    method: 'get',
501
+    params: params
502
+  })
503
+}
504
+
505
+export function getDrugOutOrderDetailPrint(params) {
506
+  return request({
507
+    url: '/api/drug/getdrugoutorderdetailprint',
508
+    method: 'get',
509
+    params: params
510
+  })
511
+}

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

@@ -665,3 +665,11 @@ export function getExportStockList(params) {
665 665
     params: params
666 666
   })
667 667
 }
668
+
669
+export function getOutExportList(params) {
670
+  return request({
671
+    url: '/api/stock/getoutexprotlist',
672
+    method: 'get',
673
+    params: params
674
+  })
675
+}

+ 1 - 3
src/xt_pages/management/components/QualityForm.vue View File

@@ -58,9 +58,7 @@
58 58
     </el-row>
59 59
     <el-row style="display: flex;align-items: center;">
60 60
       <el-col :span="2">
61
-        <el-checkbox v-model="checkAllStatus" @change="changeCheck"
62
-          >全选</el-checkbox
63
-        >
61
+        <el-checkbox v-model="checkAllStatus" @change="changeCheck">全选</el-checkbox>
64 62
       </el-col>
65 63
       <el-col :span="3">
66 64
         <el-button size="small" @click="BatchDelete" v-show="show"

+ 123 - 5
src/xt_pages/stock/drugs/drugBatchNumber.vue View File

@@ -6,7 +6,7 @@
6 6
     <div class="app-container ">
7 7
       <div class="cell clearfix">
8 8
        药品名称:<span>{{this.$route.query.drug_name}}</span>&nbsp;
9
-       库存:&nbsp;
9
+       库存:{{getCountTwo(this.$route.query.drug_id,this.$route.query.min_number,this.$route.query.max_unit,this.$route.query.min_unit)}}&nbsp;
10 10
        规格:<span>{{this.$route.query.unit}}</span>&nbsp;
11 11
        厂家:<span>{{this.$route.query.manufacturer}}</span>&nbsp;
12 12
       </div>
@@ -105,7 +105,7 @@
105 105
 <script>
106 106
   import { uParseTime } from '@/utils/tools'
107 107
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
108
-  import { getBatchOrderDetail } from '@/api/drug/drug_stock'
108
+  import { getBatchOrderDetail,getDrugCountList } from '@/api/drug/drug_stock'
109 109
   import SettingDialog from './settingDialog/index'
110 110
   import { getDictionaryDataConfig } from "@/utils/data";
111 111
   export default {
@@ -114,7 +114,8 @@
114 114
       var drugCategory = getDictionaryDataConfig('system','drug_category')
115 115
       this.drugCategory.push(...drugCategory)
116 116
       this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
117
-       this.getlist()
117
+      this.getlist()
118
+      this.getDrugCountList()
118 119
     },
119 120
     components: {
120 121
       SettingDialog,
@@ -150,7 +151,12 @@
150 151
         ],
151 152
         drugTypeList:[],
152 153
         tableList:[],
153
-        manufacturerList:[]
154
+        manufacturerList:[],
155
+        countList:[],
156
+        outCountList:[],
157
+        autoCountList:[],
158
+        minCount:[],
159
+        drugOutList:[],
154 160
       }
155 161
     },
156 162
     methods:{
@@ -196,7 +202,119 @@
196 202
     endTimeChange(val){
197 203
       this.end_time = val
198 204
       this.getlist()
199
-    }
205
+    },
206
+     getDrugCountList(){
207
+         var params = {
208
+          keyword: this.keywords,
209
+          start_time:this.start_time,
210
+          end_time:this.end_time,
211
+         }
212
+      getDrugCountList(params).then(response=>{
213
+          if(response.data.state == 1){
214
+            var countlist =  response.data.data.countList
215
+            console.log("入库数据",countlist)
216
+            this.countList = countlist
217
+            var outcountlist = response.data.data.outCountList
218
+            console.log("出库数据",outcountlist)
219
+            this.outCountList = outcountlist
220
+            var aucountlist = response.data.data.auCountList
221
+            console.log("自动数据",aucountlist)
222
+            this.autoCountList = aucountlist
223
+             var minCount = response.data.data.minCount
224
+            console.log("minCount",minCount)
225
+            this.minCount = minCount
226
+            var info = response.data.data.info
227
+            for(let i=0;i<info.length;i++){
228
+              if(info[i].count_unit == info[i].max_unit){
229
+                 info[i].count = info[i].count * info[i].min_number
230
+              }
231
+            }
232
+            console.log("info2222222",info)
233
+            this.drugOutList = info
234
+          }
235
+        })
236
+      },
237
+      getInCount(id){
238
+        var count = ""
239
+        for(let i=0;i<this.countList.length;i++){
240
+           if(id == this.countList[i].drug_id){
241
+             count = this.countList[i].count
242
+           }
243
+        }
244
+        return count
245
+      },
246
+
247
+      getOutCount(id){
248
+        var count = ""
249
+        for(let i=0;i<this.outCountList.length;i++){
250
+           if(id == this.outCountList[i].drug_id){
251
+               count = this.outCountList[i].count
252
+           }
253
+        }
254
+        return count
255
+      },
256
+      getAutoCount(id){
257
+        var count= ""
258
+        for(let i=0;i<this.autoCountList.length;i++){
259
+          if(id == this.autoCountList[i].drug_id){
260
+            count = this.autoCountList[i].count
261
+          }
262
+        }
263
+        return count
264
+      },
265
+         getMinCount(id){
266
+        var count=""
267
+        for(let i=0;i<this.minCount.length;i++){
268
+          if(id == this.minCount[i].drug_id){
269
+            count = this.minCount[i].count
270
+          }
271
+        }
272
+        return count
273
+      },
274
+      getCount(drug_id,min_number,max_unit,min_unit){
275
+        var count= 0
276
+        var str = ""
277
+        var min_str = ""
278
+        for(let i=0;i<this.drugOutList.length;i++){
279
+          if(drug_id == this.drugOutList[i].drug_id){
280
+             count += parseInt(this.drugOutList[i].count)
281
+          }
282
+        }
283
+        if(parseInt(count/min_number)!=0){
284
+          str = parseInt(count/min_number)+ max_unit
285
+        }
286
+        if((count%min_number)!=0){
287
+          min_str =  count%min_number + min_unit
288
+        }
289
+        return str + min_str
290
+      },
291
+
292
+      getCountOne(drug_id){
293
+        var count= 0
294
+        for(let i=0;i<this.drugOutList.length;i++){
295
+          if(drug_id == this.drugOutList[i].drug_id){
296
+             count += parseInt(this.drugOutList[i].count)
297
+          }
298
+        }
299
+        return count
300
+      },
301
+     getCountTwo(drug_id,min_number,max_unit,min_unit){
302
+       var total_count = 0
303
+       var out_count = 0
304
+       var count = 0
305
+       var str = ""
306
+       var str_min = ""
307
+       total_count = this.getInCount(drug_id) * min_number
308
+       out_count = this.getCountOne(drug_id)
309
+       count = total_count-out_count
310
+       if(parseInt(count/min_number)!=0){
311
+         str = parseInt(count/min_number) + max_unit
312
+       }
313
+       if((count%min_number)!=0){
314
+         str_min = count%min_number + min_unit
315
+       }
316
+       return str+str_min
317
+     }
200 318
     }
201 319
   }
202 320
 </script>

+ 177 - 43
src/xt_pages/stock/drugs/drugQueryPrint.vue View File

@@ -15,46 +15,41 @@
15 15
             <tbody>
16 16
             <tr>
17 17
               <td style="line-height: 50px" width="50">序号</td>
18
-              <td style="line-height: 50px" width="250">药品名称</td>
19
-              <td style="line-height: 50px" width="250">规格型号</td>
20
-              <td style="line-height: 50px" width="50">单位</td>
18
+              <td style="line-height: 50px" width="100">药品类型</td>
19
+              <td style="line-height: 50px" width="150">药品名称</td>
20
+              <td style="line-height: 50px" width="150">规格型号&单位</td>
21
+              <td style="line-height: 50px" width="50">进货单价</td>
22
+              <td  style="line-height: 50px" width="50">厂家</td>
21 23
               <td style="line-height: 50px" width="80">入库数量</td>
22 24
               <td style="line-height: 50px" width="80">出库数量</td>
23
-              <td style="line-height: 50px" width="80">入库退货</td>
24
-              <td style="line-height: 50px" width="80">出库退库</td>
25
-              <td style="line-height: 50px" width="80">剩余库存</td>
26
-              <td style="line-height:50px" width="80">单价</td>
27
-           
25
+              <td style="line-height:50px" width="80">剩余库存量</td>    
28 26
             </tr>
29 27
 
30
-            <tr v-for="(item,index) in WarehouseInfo.warehouseInfoDate" :key="item.id">
28
+            <tr v-for="(item,index) in tableList" :key="item.id">
31 29
               <td style="line-height: 50px">&nbsp;
32 30
                 {{index+1}}
33 31
               </td>
34 32
               <td style="line-height: 50px">
35
-                <span> {{ item.drug_name }}</span>
33
+                <span> {{getDrugType(item.drug_type)}}</span>
36 34
               </td>
37 35
               <td style="line-height: 50px">
38
-                   <span>{{ item.drug_spec }}</span>
36
+                <span> {{ item.drug_name }}</span>
39 37
               </td>
40 38
               <td style="line-height: 50px">
41
-                <span>{{getUnit(item.id)}}</span>
39
+                   <span> {{item.dose + item.dose_unit +"*"+item.min_number+item.min_unit+"/"+item.max_unit}}</span>
42 40
               </td>
43
-            
41
+             
44 42
               <td style="line-height: 50px">
45
-                  <span>{{ stockInCount(item) }}</span>
43
+                  <span>{{item.last_price }}</span>
46 44
               </td>
47 45
               <td style="line-height: 50px">
48
-                  <span>{{ stockOutCount(item) }}</span>
46
+                <span> {{getManufacturerList(item.manufacturer)}}</span>
49 47
               </td>
50
-              <td> <span>{{ salesReturnCount(item) }}</span ></td>
51
-              <td> <span>{{ cancelStockCount(item) }}</span></td>
48
+              <td><span>{{getInCount(item.drug_id)}}{{item.max_unit}}</span ></td>
49
+              <td><span>{{getCount(item.drug_id,item.min_number,item.max_unit,item.min_unit)}}</span></td>
52 50
               <td>
53
-                <span>{{stockInCount(item) -salesReturnCount(item) -stockOutCount(item) +cancelStockCount(item)}}</span>
51
+                <span>{{getCountTwo(item.drug_id,item.min_number,item.max_unit,item.min_unit)}}</span>
54 52
              </td> 
55
-              <td style="line-height:50px">
56
-                  {{item.last_price}}
57
-              </td>
58 53
             </tr>
59 54
             </tbody>
60 55
           </table>
@@ -72,7 +67,7 @@
72 67
   import { jsGetAge, uParseTime } from '@/utils/tools'
73 68
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
74 69
   import print from 'print-js'
75
-  import { getAllDrugStockQueryList } from '@/api/drug/drug_stock'
70
+  import { getAllDrugStockQueryList,getDrugStockList,getDrugCountList } from '@/api/drug/drug_stock'
76 71
   import { getDictionaryDataConfig } from "@/utils/data";
77 72
   import {getBaseDrugLibList} from '@/api/data'
78 73
   export default {
@@ -113,6 +108,15 @@
113 108
         is_use:"",
114 109
         is_charge:"",
115 110
         is_inject:"",
111
+        tableList:[],
112
+        manufacturerList:[],
113
+        loading:false,
114
+        drugType:[],
115
+        countList:[],
116
+        outCountList:[],
117
+        autoCountList:[],
118
+        minCount:[],
119
+        drugOutList:[],
116 120
       }
117 121
     },
118 122
     methods: {
@@ -230,35 +234,165 @@
230 234
       getDictionaryDataConfig(module, filed_name) {
231 235
         return getDictionaryDataConfig(module, filed_name)
232 236
       },
233
-      getList() {
234
-        let params = {
235
-          page: this.page,
236
-          limit: this.limit,
237
-          keyword: this.keywords,
238
-          is_use: this.is_use,
239
-          is_charge: this.is_charge,
240
-          is_inject: this.is_inject
237
+      getlist(){
238
+        const params = {
239
+          page: this.$route.query.page,
240
+          limit:this.$route.query.limit,
241
+          keyword: this.$route.query.keyword,
242
+          drug_type:this.$route.drug_type,
243
+          start_time:this.$route.start_time,
244
+          end_time:this.$route.end_time,
241 245
         }
242
-        getBaseDrugLibList(params).then(response => {
243
-          if (response.data.state == 0) {
244
-            this.$message.error(response.data.msg)
245
-            return false
246
-          } else {
247
-            this.total = response.data.data.total
248
-            this.list = []
249
-            for (let i = 0; i < response.data.data.list.length; i++) {
250
-              this.list.push(response.data.data.list[i])
246
+        console.log("parasm222222",params)
247
+        getDrugStockList(params).then(response=>{
248
+          if(response.data.state == 1){
249
+             var list = response.data.data.list
250
+             console.log("list99999",list)
251
+             this.tableList = list
252
+             this.manufacturerList = response.data.data.manufacturerList
253
+             this.loading = false
254
+           }
255
+        })
256
+      },
257
+      getManufacturerList(id){
258
+        var name = ""
259
+        for(let i=0;i<this.manufacturerList.length;i++){
260
+          if(id == this.manufacturerList[i].id){
261
+             name = this.manufacturerList[i].manufacturer_name
262
+          }
263
+        }
264
+        return name
265
+      },
266
+      getDrugCountList(){
267
+         var params = {
268
+          keyword: this.$route.query.keywords,
269
+          start_time:this.$route.query.start_time,
270
+          end_time:this.$route.query.end_time,
271
+         }
272
+        getDrugCountList(params).then(response=>{
273
+          if(response.data.state == 1){
274
+            var countlist =  response.data.data.countList
275
+            console.log("入库数据",countlist)
276
+            this.countList = countlist
277
+            var outcountlist = response.data.data.outCountList
278
+            console.log("出库数据",outcountlist)
279
+            this.outCountList = outcountlist
280
+            var aucountlist = response.data.data.auCountList
281
+            console.log("自动数据",aucountlist)
282
+            this.autoCountList = aucountlist
283
+            var minCount = response.data.data.minCount
284
+            console.log("minCount",minCount)
285
+            this.minCount = minCount
286
+            var info = response.data.data.info
287
+            for(let i=0;i<info.length;i++){
288
+              if(info[i].count_unit == info[i].max_unit){
289
+                 info[i].count = info[i].count * info[i].min_number
290
+              }
251 291
             }
252
-            console.log("list222222",this.list)
292
+            console.log("info2222222",info)
293
+            this.drugOutList = info
253 294
           }
254 295
         })
255 296
       },
297
+     getInCount(id){
298
+        var count = ""
299
+        for(let i=0;i<this.countList.length;i++){
300
+           if(id == this.countList[i].drug_id){
301
+             count = this.countList[i].count
302
+           }
303
+        }
304
+        return count
305
+      },
306
+
307
+      getOutCount(id){
308
+        var count = ""
309
+        for(let i=0;i<this.outCountList.length;i++){
310
+           if(id == this.outCountList[i].drug_id){
311
+               count = this.outCountList[i].count
312
+           }
313
+        }
314
+        return count
315
+      },
316
+      getAutoCount(id){
317
+        var count= ""
318
+        for(let i=0;i<this.autoCountList.length;i++){
319
+          if(id == this.autoCountList[i].drug_id){
320
+            count = this.autoCountList[i].count
321
+          }
322
+        }
323
+        return count
324
+      },
325
+      getMinCount(id){
326
+        var count=""
327
+        for(let i=0;i<this.minCount.length;i++){
328
+          if(id == this.minCount[i].drug_id){
329
+            count = this.minCount[i].count
330
+          }
331
+        }
332
+        return count
333
+      },
334
+      getCount(drug_id,min_number,max_unit,min_unit){
335
+        var count= 0
336
+        var str = ""
337
+        var min_str = ""
338
+        for(let i=0;i<this.drugOutList.length;i++){
339
+          if(drug_id == this.drugOutList[i].drug_id){
340
+             count += parseInt(this.drugOutList[i].count)
341
+          }
342
+        }
343
+        if(parseInt(count/min_number)!=0){
344
+          str = parseInt(count/min_number)+ max_unit
345
+        }
346
+        if((count%min_number)!=0){
347
+          min_str =  count%min_number + min_unit
348
+        }
349
+        return str + min_str
350
+      },
351
+
352
+      getCountOne(drug_id){
353
+        var count= 0
354
+        for(let i=0;i<this.drugOutList.length;i++){
355
+          if(drug_id == this.drugOutList[i].drug_id){
356
+             count += parseInt(this.drugOutList[i].count)
357
+          }
358
+        }
359
+        return count
360
+      },
361
+     getCountTwo(drug_id,min_number,max_unit,min_unit){
362
+       var total_count = 0
363
+       var out_count = 0
364
+       var count = 0
365
+       var str = ""
366
+       var str_min = ""
367
+       total_count = this.getInCount(drug_id) * min_number
368
+       out_count = this.getCountOne(drug_id)
369
+       count = total_count-out_count
370
+       if(parseInt(count/min_number)!=0){
371
+         str = parseInt(count/min_number) + max_unit
372
+       }
373
+       if((count%min_number)!=0){
374
+         str_min = count%min_number + min_unit
375
+       }
376
+       return str+str_min
377
+     },
378
+     getDrugType(id){
379
+       var name = ""
380
+       for(let i=0;i<this.drugType.length;i++){
381
+         if(id == this.drugType[i].id){
382
+            name = this.drugType[i].name
383
+         }
384
+       }
385
+       return name
386
+     }
256 387
     },
257 388
     created() {
258
-      this.GetAllDrugStockQueryList()
389
+      // this.GetAllDrugStockQueryList()
259 390
       var drugCategory = getDictionaryDataConfig('system','drug_category')
260
-      this.drugCategory.push(...drugCategory)
261
-      this.getList()
391
+      var drugType = getDictionaryDataConfig('system','drug_type')
392
+      console.log("222343",drugType)
393
+      this.drugType.push(...drugType)
394
+      this.getlist()
395
+      this.getDrugCountList()
262 396
     }
263 397
 
264 398
   }

+ 105 - 35
src/xt_pages/stock/drugs/drugStockFlow.vue View File

@@ -6,7 +6,7 @@
6 6
     <div class="app-container ">
7 7
       <div class="cell clearfix">
8 8
        药品名称:<span>{{this.$route.query.drug_name}}</span>&nbsp;
9
-       库存:&nbsp;
9
+       库存: {{getCountTwo(this.$route.query.drug_id,this.$route.query.min_number,this.$route.query.max_unit,this.$route.query.min_unit)}}
10 10
        规格:<span>{{this.$route.query.unit}}</span>&nbsp;
11 11
        厂家:<span>{{this.$route.query.manufacturer}}</span>&nbsp;
12 12
 
@@ -64,13 +64,14 @@
64 64
         </el-table-column>
65 65
         <el-table-column prop="drug_type" label="出入库方式" width="180" align="center">
66 66
            <template slot-scope="scope">
67
-             <span v-if="scope.row.drug_way == 4">手动入库</span>
68
-             <span v-if="scope.row.drug_way == 2">手动出库</span>
67
+             <span v-if="scope.row.drug_way == 4">采购入库</span>
68
+             <span v-if="scope.row.drug_way == 2">自动出库</span>
69
+             <span v-if="scope.row.drug_way == 1">手动出库</span>
69 70
            </template>
70 71
         </el-table-column>
71 72
         <el-table-column prop="drug_name" label="出/入库单据编码" align="center">
72 73
            <template slot-scope="scope">
73
-             <span v-if="scope.row.drug_way == 2"> {{scope.row.warehouse_out_order_number}}</span>
74
+             <span v-if="scope.row.drug_way == 2 || scope.row.drug_way ==1"> {{scope.row.warehouse_out_order_number}}</span>
74 75
              <span v-if="scope.row.drug_way == 4">{{scope.row.warehousing_order}}</span>
75 76
             
76 77
            </template>
@@ -82,40 +83,39 @@
82 83
         </el-table-column>
83 84
          <el-table-column prop="drug_name" label="出入库数量" align="center">
84 85
            <template slot-scope="scope">
85
-             <span v-if="scope.row.drug_way == 4"> {{scope.row.warehousing_count}}</span>
86
-             <span v-if="scope.row.drug_way == 2">{{scope.row.count}}</span>
86
+             <span v-if="scope.row.drug_way == 4"> {{scope.row.warehousing_count}}{{scope.row.max_unit}}</span>
87
+             <span v-if="scope.row.drug_way == 2 || scope.row.drug_way == 1">{{scope.row.count}}{{scope.row.max_unit}}</span>
87 88
            </template>
88 89
         </el-table-column>
89 90
          <el-table-column prop="drug_name" label="剩余库存量" align="center">
90 91
            <template slot-scope="scope">
91
-             <!-- <span v-if="scope.row.drug_way == 4"> {{scope.row.stock_max_numbe}}{{scope.row.max_unit}}{{scope.row.stock_min_number}}{{scope.row.min_unit}}</span>
92
-             <span v-if="scope.row.drug_way == 2">{{scope.row.count}}</span> -->
93
-              {{getInCount(scope.row.drug_id) - getOutCount(scope.row.drug_id) - getAutoCount(scope.row.drug_id)}}
92
+               {{getCountTwo(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}
93
+              <!-- {{getInCount(scope.row.drug_id) - getOutCount(scope.row.drug_id) - getAutoCount(scope.row.drug_id)}} -->
94 94
              <span></span>
95 95
            </template>
96 96
         </el-table-column>
97 97
         <el-table-column prop="drug_name" label="进/出货单价" align="center">
98 98
            <template slot-scope="scope">
99 99
              <span v-if="scope.row.drug_way == 4"> {{scope.row.price}}</span>
100
-             <span v-if="scope.row.drug_way == 2">{{scope.row.price}}</span>
100
+             <span v-if="scope.row.drug_way == 2 || scope.row.drug_way == 1">{{scope.row.price}}</span>
101 101
            </template>
102 102
         </el-table-column>
103 103
          <el-table-column prop="drug_name" label="有效期" align="center">
104 104
            <template slot-scope="scope">
105
-             <span v-if="scope.row.drug_way == 4"> {{getTime(scope.row.expiry_date)}}</span>
106
-             <span v-if="scope.row.drug_way == 2">{{getTime(scope.row.expiry_date)}}</span>
105
+             <span v-if="scope.row.drug_way == 4"> {{getTime(scope.row.expiry_date,"{y}-{h}-{d}")}}</span>
106
+             <span v-if="scope.row.drug_way == 2 || scope.row.drug_way == 1">{{getTime(scope.row.expiry_date,"{y}-{h}-{d}")}}</span>
107 107
            </template>
108 108
         </el-table-column>
109 109
         <el-table-column prop="drug_name" label="批号" align="center">
110 110
            <template slot-scope="scope">
111
-             <span v-if="scope.row.drug_way == 2"> {{scope.row.number}}</span>
111
+             <span v-if="scope.row.drug_way == 2 || scope.row.drug_way ==1"> {{scope.row.number}}</span>
112 112
              <span v-if="scope.row.drug_way == 4">{{scope.row.number}}</span>
113 113
            </template>
114 114
         </el-table-column>
115 115
         <el-table-column prop="drug_name" label="生产商" align="center">
116 116
            <template slot-scope="scope">
117 117
              <span v-if="scope.row.drug_way == 4"> {{getManufacturer(scope.row.manufacturer)}}</span>
118
-             <span v-if="scope.row.drug_way == 2">{{getManufacturer(scope.row.manufacturer)}}</span>
118
+             <span v-if="scope.row.drug_way == 2 || scope.row.drug_way == 1">{{getManufacturer(scope.row.manufacturer)}}</span>
119 119
            </template>
120 120
         </el-table-column>
121 121
        </el-table>
@@ -198,13 +198,15 @@
198 198
           {id:0,name:"全部"},
199 199
           {id:1,name:"手动出库"},
200 200
           {id:2,name:"自动出库"},
201
-          {id:3,name:"手动入库"},
201
+          {id:3,name:"采购入库"},
202 202
 
203 203
         ],
204 204
         outList:[],
205 205
         countList:[],
206 206
         outCountList:[],
207 207
         autoCountList:[],
208
+        drugOutList:[],
209
+        total:0,
208 210
       }
209 211
     },
210 212
     methods:{
@@ -226,7 +228,6 @@
226 228
                list[i].drug_way = 4
227 229
                this.tableList.push(list[i])
228 230
             }
229
-           
230 231
             var total = response.data.data.total
231 232
             this.total = total
232 233
             var manufacturerList = response.data.data.manufacturerList
@@ -245,24 +246,35 @@
245 246
              stock_type:this.stock_type,  
246 247
            }
247 248
           console.log("出库数据",params)
249
+
248 250
          getOutDrugStockFlow(params).then(response=>{
249 251
             if(response.data.state == 1){
250 252
                var outList = response.data.data.outList
251
-               for(let i=0;i<outList.length;i++){
253
+               console.log("outlist",outList)
254
+
255
+              for(let i=0;i<outList.length;i++){
256
+                if(outList[i].is_sys == 1){
252 257
                   outList[i].drug_way = 2
253
-                  this.tableList.push(outList[i])
254
-               }
255
-              console.log("列表数据",this.tableList)
258
+                }
259
+                if(outList.is_sys == 0){
260
+                  outList[i].drug_way = 1
261
+                }
262
+                this.tableList.push(outList[i])
263
+              }
264
+              this.total = response.data.data.total
265
+              console.log("出库列表数据",this.tableList)
256 266
             }
257 267
          })
258 268
        },
259 269
        handleSizeChange(val) {
260 270
         this.limit = val
261 271
         this.getlist()
272
+        this.getOutList()
262 273
       },
263 274
       handleCurrentChange(val) {
264 275
         this.page = val
265 276
         this.getlist()
277
+        this.getOutList()
266 278
       },
267 279
         
268 280
     startTimeChange: function(val) {
@@ -282,6 +294,7 @@
282 294
         this.end_time = "";
283 295
       } else {
284 296
         this.getlist();
297
+        this.getOutList()
285 298
       }
286 299
      },
287 300
      getManufacturer(id){
@@ -320,6 +333,17 @@
320 333
             var aucountlist = response.data.data.auCountList
321 334
             console.log("自动数据",aucountlist)
322 335
             this.autoCountList = aucountlist
336
+             var minCount = response.data.data.minCount
337
+            console.log("minCount",minCount)
338
+            this.minCount = minCount
339
+            var info = response.data.data.info
340
+            for(let i=0;i<info.length;i++){
341
+              if(info[i].count_unit == info[i].max_unit){
342
+                 info[i].count = info[i].count * info[i].min_number
343
+              }
344
+            }
345
+            console.log("info2222222",info)
346
+            this.drugOutList = info
323 347
           }
324 348
         })
325 349
       },
@@ -355,26 +379,72 @@
355 379
         return (new Date(time)).getTime() / 1000
356 380
       },
357 381
       changeDrug(val){
358
-        
359
-        var arr = []
382
+       this.tableList = []
383
+        if(val == 0){
384
+         this.getlist()
385
+         this.getOutList()
386
+        }
360 387
         if(val == 3){
361
-          for(let i=0;i<this.tableList.length;i++){
362
-            if(this.tableList[i].drug_way == 4){
363
-
364
-              arr.push(this.tableList[i])
365
-            }
388
+          this.getlist()
389
+        }
390
+        if(val ==1 || val == 2){
391
+           this.getOutList()
392
+        }
393
+       
394
+      },
395
+      getMinCount(id){
396
+        var count=""
397
+        for(let i=0;i<this.minCount.length;i++){
398
+          if(id == this.minCount[i].drug_id){
399
+            count = this.minCount[i].count
366 400
           }
367
-          this.tableList = arr
368 401
         }
369
-        if(val == 1){
370
-          for(let i=0;i<this.tableList.length;i++){
371
-            if(this.tableList[i].drug_way == 2){
372
-              arr.push(this.tableList[i])
373
-            }
402
+        return count
403
+      },
404
+      getCount(drug_id,min_number,max_unit,min_unit){
405
+        var count= 0
406
+        var str = ""
407
+        var min_str = ""
408
+        for(let i=0;i<this.drugOutList.length;i++){
409
+          if(drug_id == this.drugOutList[i].drug_id){
410
+             count += parseInt(this.drugOutList[i].count)
374 411
           }
375
-          this.tableList = arr
376 412
         }
377
-      }
413
+        if(parseInt(count/min_number)!=0){
414
+          str = parseInt(count/min_number)+ max_unit
415
+        }
416
+        if((count%min_number)!=0){
417
+          min_str =  count%min_number + min_unit
418
+        }
419
+        return str + min_str
420
+      },
421
+
422
+     getCountOne(drug_id){
423
+        var count= 0
424
+        for(let i=0;i<this.drugOutList.length;i++){
425
+          if(drug_id == this.drugOutList[i].drug_id){
426
+             count += parseInt(this.drugOutList[i].count)
427
+          }
428
+        }
429
+        return count
430
+      },
431
+     getCountTwo(drug_id,min_number,max_unit,min_unit){
432
+       var total_count = 0
433
+       var out_count = 0
434
+       var count = 0
435
+       var str = ""
436
+       var str_min = ""
437
+       total_count = this.getInCount(drug_id) * min_number
438
+       out_count = this.getCountOne(drug_id)
439
+       count = total_count-out_count
440
+       if(parseInt(count/min_number)!=0){
441
+         str = parseInt(count/min_number) + max_unit
442
+       }
443
+       if((count%min_number)!=0){
444
+         str_min = count%min_number + min_unit
445
+       }
446
+       return str+str_min
447
+     }
378 448
     }
379 449
   }
380 450
 </script>

+ 9 - 20
src/xt_pages/stock/drugs/drugStockInOrder.vue View File

@@ -192,7 +192,7 @@
192 192
         border
193 193
         highlight-current-row
194 194
         v-loading="Warehouse.loading"
195
-        ref="multipleTable"
195
+        ref="multipleTableOne"
196 196
         @selection-change="select"
197 197
         :row-style="{ color: '#303133' }"
198 198
         :header-cell-style="{
@@ -359,22 +359,6 @@
359 359
       </span>
360 360
     </el-dialog>
361 361
 
362
-    
363
-
364
-
365
-      
366
-
367
-      <!-- <el-pagination
368
-        @size-change="handleSizeChange"
369
-        @current-change="handleCurrentChange"
370
-        :page-sizes="[10, 50, 100]"
371
-        :page-size="10"
372
-        background
373
-        style="margin-top:20px;float: right"
374
-        layout="total, sizes, prev, pager, next, jumper"
375
-        :total="total"
376
-      >
377
-      </el-pagination> -->
378 362
 
379 363
   </div>
380 364
 </template>
@@ -717,8 +701,13 @@ export default {
717 701
       }
718 702
     },
719 703
     select(selection) {
720
-      console.log("selection",selection)
721
-      this.order_id = selection[0].id
704
+      // console.log("selection",selection)
705
+      // this.order_id = selection[0].id
706
+      var ids=[]
707
+      for(let i=0;i<selection.length;i++){
708
+         ids.push(selection[i].id)
709
+      }
710
+      this.order_id = ids.join(",")
722 711
       this.selectedTableData = selection;
723 712
     },
724 713
     batchDelete() {
@@ -808,7 +797,7 @@ export default {
808 797
         return getDictionaryDataConfig(module, filed_name)
809 798
       },
810 799
     drugPrint(){
811
-      if(this.order_id == 0){
800
+      if(this.order_id == ""){
812 801
          this.$message.error("请选择入库单")
813 802
       }else{
814 803
         this.$router.push({path:"/stock/drugStockInOrderDetailPrint?id="+this.order_id})

+ 56 - 26
src/xt_pages/stock/drugs/drugStockInOrderDetailPrint.vue View File

@@ -7,11 +7,11 @@
7 7
     </div>
8 8
     <div class="app-container ">
9 9
       <div id="dialysis-print-box">
10
-        <div class="dialysis-print-order">
10
+        <div class="dialysis-print-order" v-for="(it,index) in tableList" :key="index">
11 11
           <div style="font-size:22px;font-weight:bold;text-align:center;">{{ orgName }}</div>
12 12
           <div class="order-title" style="font-size:18px;padding-top:0;">药品入库登记表</div>
13 13
 
14
-          <div style="float: left;margin-bottom: 1px;">单据编号:{{WarehouseInfo.warehouse.warehousing_order}}</div>
14
+          <div style="float: left;margin-bottom: 1px;">单据编号:{{it.warehousing_order}}</div>
15 15
           <div style="float: right;margin-bottom: 1px;">{{getDateTwo()}}</div>
16 16
 
17 17
           <table class="print-table" border="1">
@@ -32,18 +32,17 @@
32 32
               <td style="line-height:18px;" width="60">验收<br>结论</td>
33 33
             </tr>
34 34
 
35
-            <tr v-for="(item,index) in WarehouseInfo.warehouseInfoDate" :key="item.id">
35
+            <tr v-for="(item,i) in it.child" :key="i">
36 36
               <td style="line-height: 18px">
37
-                 <span v-if="item.drug_id != 0">{{item.drug.drug_name}}</span>
37
+                 <span v-if="item.drug_id != 0">{{item.drug_name}}</span>
38 38
               </td>
39 39
               <td style="line-height: 18px">{{ item.remark }}</td>
40 40
               <td style="line-height: 18px">
41
-                 <span v-if="item.drug_id != 0">{{item.drug.dose}}{{item.drug.dose_unit}}*{{item.drug.min_number}}{{item.drug.min_unit}}/{{item.drug.max_unit}}</span>
41
+                 <span v-if="item.drug_id != 0">{{item.dose}}{{item.dose_unit}}*{{item.min_number}}{{item.min_unit}}/{{item.max_unit}}</span>
42 42
               </td>
43
-              <!-- <td style="line-height: 18px">{{ getManufacturer(item.manufacturer) }}</td> -->
44
-              <td style="line-height: 18px">{{ getManufacturer(item.drug.id) }}</td>
43
+              <td style="line-height: 18px">{{ getManufacturer(item.manufacturer) }}</td>
45 44
               <td style="line-height: 18px">
46
-                <span>{{item.drug.max_unit}}</span>
45
+                <span>{{item.max_unit}}</span>
47 46
               </td>
48 47
               <td style="line-height:18px">
49 48
                   {{item.price}}
@@ -63,7 +62,7 @@
63 62
             </tr>
64 63
             <tr>
65 64
               <td>合计</td>
66
-              <td colspan="12" style="text-align:right;">{{allPrice.toFixed(2)}}</td>
65
+              <td colspan="12" style="text-align:right;">{{getAllPrince(it.id).toFixed(2)}}</td>
67 66
             </tr>
68 67
             </tbody>
69 68
           </table>
@@ -72,13 +71,13 @@
72 71
             <div style="width:50px;">审批:</div><div style="width:100px;"></div>
73 72
             <div style="width:50px;">会计:</div><div style="width:100px;"><span v-if='orgId == 10024'>徐立琼</span></div>
74 73
             <div style="width:50px;">审核:</div><div style="width:100px;"><span v-if='orgId == 10024'>徐立琼</span></div>
75
-            <div style="width:70px;">制单人:</div><div style="width:100px;">{{ getXuserName(this.WarehouseInfo.warehouse.creater) }}</div>
74
+            <div style="width:70px;">制单人:</div><div style="width:100px;">{{ getXuserName(it.creater) }}</div>
76 75
           </div>
77 76
           <div style="display:flex;margin-top:1px;float:right;" v-if="orgId !=10024">
78 77
             <div style="width:50px;">审批:</div><div style="width:100px;"></div>
79 78
             <div style="width:80px;">药材主任:</div><div style="width:100px;"></div>
80 79
             <div style="width:50px;">会计:</div><div style="width:100px;"></div>
81
-            <div style="width:70px;">制单人:</div><div style="width:100px;">{{ getXuserName(this.WarehouseInfo.warehouse.creater) }}</div>
80
+            <div style="width:70px;">制单人:</div><div style="width:100px;">{{ getXuserName(it.creater) }}</div>
82 81
           </div>
83 82
         </div>
84 83
 
@@ -95,7 +94,7 @@
95 94
   import { jsGetAge, uParseTime } from '@/utils/tools'
96 95
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
97 96
   import print from 'print-js'
98
-  import {getDrugWarehouseInfoList} from "@/api/drug/drug_stock";
97
+  import {getDrugWarehouseInfoList,getDrugOrderInPrint} from "@/api/drug/drug_stock";
99 98
   import {getBaseDrugLibList} from '@/api/data'
100 99
   import { fetchAllAdminUsers } from "@/api/doctor";
101 100
   export default {
@@ -140,7 +139,10 @@
140 139
         keywords:"",
141 140
         orgName:'',
142 141
         orgId:'',
143
-        adminUserOptions:[]
142
+        adminUserOptions:[],
143
+        tableList:[],
144
+        manufacturerList:[],
145
+        warehouseList:[]
144 146
       }
145 147
     },
146 148
     methods: {
@@ -261,20 +263,12 @@
261 263
         }
262 264
         return name
263 265
       },
264
-      // getManufacturer(id){
265
-      //   let name = ''
266
-      //   this.manufacturer.map(item => {
267
-      //     if(item.id == id){
268
-      //       name = item.manufacturer_name
269
-      //     }
270
-      //   })
271
-      //   return name
272
-      // },
266
+      
273 267
       getManufacturer(id){
274 268
         let name = ""
275
-        for(let i=0;i<this.list.length;i++){
276
-           if(id == this.list[i].id){
277
-              name = this.list[i].manufacturer_name
269
+        for(let i=0;i<this.manufacturerList.length;i++){
270
+           if(id == this.manufacturerList[i].id){
271
+              name = this.manufacturerList[i].manufacturer_name
278 272
            }
279 273
         }
280 274
         return name
@@ -327,6 +321,42 @@
327 321
         }
328 322
         return name;
329 323
       },
324
+      getDrugOrderInPrint(order_id){
325
+          const params = {
326
+            id:order_id
327
+          };
328
+        getDrugOrderInPrint(params).then(response=>{
329
+          if(response.data.state == 1){
330
+           var info = response.data.data.info
331
+           console.log("info22233444444",info)
332
+           var warehousing =  response.data.data.warehousing
333
+           console.log("hhhhshdfh",warehousing)
334
+           this.warehouseList = warehousing
335
+           for(let i=0;i<info.length;i++){
336
+             info[i].child = []
337
+             for(let j=0;j<warehousing.length;j++){
338
+               if(info[i].id == warehousing[j].warehousing_id){
339
+                 info[i].child.push(warehousing[j])
340
+               }
341
+             }
342
+           }
343
+           console.log("infor2222",info)
344
+           this.tableList = info
345
+           var manufacturerList = response.data.data.manufacturerList
346
+           console.log("manufacturerList",manufacturerList)
347
+           this.manufacturerList = manufacturerList
348
+          }
349
+        })
350
+      },
351
+     getAllPrince(id){
352
+        var count = 0
353
+        for(let i=0;i<this.warehouseList.length;i++){
354
+          if(id == this.warehouseList[i].warehousing_id){
355
+             count +=this.warehouseList[i].warehousing_count * this.warehouseList[i].last_price
356
+          }
357
+        }
358
+        return count
359
+      }
330 360
     },
331 361
     created() {
332 362
       this.orgName = this.$store.getters.xt_user.org.org_name;
@@ -334,8 +364,8 @@
334 364
       this.fetchAllAdminUsers()
335 365
       this.GetConfigInfo()
336 366
       const order_id = this.$route.query.id;
337
-      this.GetOrderDetail(order_id);
338 367
       this.getList()
368
+      this.getDrugOrderInPrint(order_id)
339 369
 
340 370
     }
341 371
 

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

@@ -200,7 +200,7 @@
200 200
           style="width: 100%"
201 201
           border
202 202
           highlight-current-row
203
-          ref="multipleTable"
203
+          ref="multipleTableOne"
204 204
           @selection-change="select"
205 205
           :row-style="{ color: '#303133' }"
206 206
           :header-cell-style="{
@@ -654,7 +654,12 @@ export default {
654 654
       }
655 655
     },
656 656
     select(selection) {
657
-      this.order_id = selection[0].id
657
+     
658
+      var ids= []
659
+      for(let i=0;i<selection.length;i++){
660
+         ids.push(selection[i].id)
661
+      }
662
+      this.order_id =  ids.join(",")
658 663
       this.selectedTableData = selection;
659 664
     },
660 665
     batchDelete() {

+ 56 - 15
src/xt_pages/stock/drugs/drugStockOutOrderDetailPrint.vue View File

@@ -7,11 +7,11 @@
7 7
     </div>
8 8
     <div class="app-container ">
9 9
       <div id="dialysis-print-box">
10
-        <div class="dialysis-print-order">
10
+        <div class="dialysis-print-order" v-for="(it,index) in tableList" :key="index">
11 11
          <div class="order-yy-name" style="font-size:22px;font-weight:bold;letter-spacing:0px;">{{orgName}}</div>
12 12
           <div class="order-title" style="font-weight:500;font-size:18px;">药品出库登记表</div>
13 13
 
14
-          <div style="float: left;margin-bottom: 1px;">单据编号:{{warehousingOutInfo.info.warehouse_out_order_number}}</div>
14
+          <div style="float: left;margin-bottom: 1px;">单据编号:{{it.warehouse_out_order_number}}</div>
15 15
           <div style="float: right;margin-bottom: 1px;">{{getDateTwo()}}</div>
16 16
 
17 17
           <table class="print-table" border="1">
@@ -28,25 +28,25 @@
28 28
               <td style="line-height: 50px" width="">有效日期</td>
29 29
             </tr>
30 30
 
31
-            <tr v-for="(item,index) in warehousingOutInfo.warehousingOutData" :key="item.id">
31
+            <tr v-for="(item,i) in it.child" :key="i">
32 32
               <td style="line-height: 50px">
33
-                <span v-if="item.drug_id != 0">{{item.drug.drug_name}}</span>
33
+                <span v-if="item.drug_id != 0">{{item.drug_name}}</span>
34 34
               </td>
35 35
               <td style="line-height: 50px">
36
-                  <span v-if="item.drug_id != 0">{{item.drug.dose}}{{item.drug.dose_unit}}*{{item.drug.min_number}}{{item.drug.min_unit}}/{{item.drug.max_unit}}</span>
36
+                  <span v-if="item.drug_id != 0">{{item.dose}}{{item.dose_unit}}*{{item.min_number}}{{item.min_unit}}/{{item.max_unit}}</span>
37 37
               </td>
38 38
               <td style="line-height: 50px">
39
-                <span>{{item.drug.max_unit}}</span>
39
+                <span>{{item.max_unit}}</span>
40 40
               </td>
41 41
 
42 42
               <td style="line-height: 50px">
43 43
                   {{item.count}}
44 44
               </td>
45 45
               <td style="line-height:50px">
46
-                  {{item.drug.last_price}}
46
+                  {{item.last_price}}
47 47
               </td>
48 48
              <td  style="line-height:50px">
49
-                {{(item.count * item.drug.last_price).toFixed(2)}}
49
+                {{(item.count * item.last_price).toFixed(2)}}
50 50
              </td>
51 51
              <td>{{getNumber(item.drug_id)}}</td>
52 52
              <td>{{getProductDate(item.drug_id)}}</td>
@@ -55,7 +55,7 @@
55 55
              <tr>
56 56
                <td style="line-height:50px">合计</td>
57 57
                <td colspan="7"></td>
58
-               <td>{{allPrice.toFixed(2)}}</td>
58
+               <td>{{getAllPrince(it.id).toFixed(2)}}</td>
59 59
              </tr>
60 60
             </tbody>
61 61
           </table>
@@ -91,7 +91,7 @@
91 91
   import { jsGetAge, uParseTime } from '@/utils/tools'
92 92
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
93 93
   import print from 'print-js'
94
-  import {  getDrugWarehouseOutInfo,getDrugWarehouseOrderInfo } from '@/api/drug/drug_stock'
94
+  import {  getDrugWarehouseOutInfo,getDrugWarehouseOrderInfo,getDrugOutOrderDetailPrint } from '@/api/drug/drug_stock'
95 95
   import {getBaseDrugLibList} from '@/api/data'
96 96
   export default {
97 97
     name: 'dialysisPrintOrder',
@@ -130,7 +130,11 @@
130 130
         keywords:"",
131 131
         orgId:'',
132 132
         orgName:"",
133
-        drugOrderList:[]
133
+        drugOrderList:[],
134
+        manufactureList:[],
135
+        tableList:[],
136
+        loading:false,
137
+        warehouseList:[]
134 138
       }
135 139
     },
136 140
     methods: {
@@ -304,14 +308,51 @@
304 308
           return uParseTime(val, '{y}-{m}-{d}')
305 309
          }
306 310
       },
311
+
312
+      getDrugOutOrderDetailPrint(order_id){
313
+        var params = {
314
+          id:order_id
315
+        }
316
+        getDrugOutOrderDetailPrint(params).then(response=>{
317
+          if(response.data.state ==1){
318
+             var info = response.data.data.info
319
+             console.log("info",info)
320
+            var warehousing = response.data.data.warehousing
321
+            console.log("ware2232",warehousing)
322
+            this.warehouseList = warehousing
323
+            for(let i=0;i<info.length;i++){
324
+               info[i].child = []
325
+              for(let j=0;j<warehousing.length;j++){
326
+                if(info[i].id == warehousing[j].warehouse_out_id){
327
+                    info[i].child.push(warehousing[j])
328
+                }
329
+              }
330
+            }
331
+            
332
+            var manufacturerList = response.data.data.manufacturerList
333
+            console.log("manufacturelist",manufacturerList)
334
+            this.manufactureList = manufacturerList
335
+            console.log("列表",info)
336
+            this.tableList = info
337
+            this.loading = false
338
+          }
339
+        })
340
+      },
341
+      getAllPrince(id){
342
+        var count = 0
343
+        for(let i=0;i<this.warehouseList.length;i++){
344
+          if(id == this.warehouseList[i].warehouse_out_id){
345
+             count +=this.warehouseList[i].count * this.warehouseList[i].last_price
346
+          }
347
+        }
348
+        return count
349
+      }
307 350
     },
308 351
     created() {
309 352
       this.orgName = this.$store.getters.xt_user.org.org_name;
310 353
       const order_id = this.$route.query.id;
311
-      this.orgId = this.$store.getters.xt_user.org.id;
312
-      this.GetOrderDetail(order_id);
313
-      this.getList()
314
-      this.getDrugWarehouseOrderInfo()
354
+      this.orgId = this.$store.getters.xt_user.org.id;  
355
+      this.getDrugOutOrderDetailPrint(order_id)
315 356
     }
316 357
 
317 358
   }

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

@@ -113,20 +113,20 @@
113 113
         </el-table-column>
114 114
         <el-table-column prop="drug_name" label="入库数量" align="center">
115 115
            <template slot-scope="scope">
116
-             {{getInCount(scope.row.drug_id)}}
117
-              <!-- {{getInCount(scope.row.drug_id)}}{{scope.row.max_unit}} -->
116
+             <!-- {{getInCount(scope.row.drug_id)}} -->
117
+              {{getInCount(scope.row.drug_id)}}{{scope.row.max_unit}}
118 118
            </template>
119 119
         </el-table-column>
120 120
         <el-table-column prop="drug_name" label="出库数量" align="center">
121 121
            <template slot-scope="scope">
122
-             {{getOutCount(scope.row.drug_id) + getAutoCount(scope.row.drug_id)}}
123
-             <!-- {{getCount(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}} -->
122
+             <!-- {{getOutCount(scope.row.drug_id) + getAutoCount(scope.row.drug_id)}} -->
123
+             {{getCount(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}
124 124
            </template>
125 125
         </el-table-column>
126 126
         <el-table-column prop="drug_name" label="剩余库存量" align="center">
127 127
            <template slot-scope="scope">
128
-            {{getInCount(scope.row.drug_id) - getOutCount(scope.row.drug_id) - getAutoCount(scope.row.drug_id)}}
129
-            <!-- {{getCountTwo(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}} -->
128
+            <!-- {{getInCount(scope.row.drug_id) - getOutCount(scope.row.drug_id) - getAutoCount(scope.row.drug_id)}} -->
129
+            {{getCountTwo(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}
130 130
            </template>
131 131
         </el-table-column>
132 132
         <el-table-column prop="drug_name" label="操作" align="center" width="200px">
@@ -227,7 +227,8 @@ import { min } from 'moment'
227 227
         keyword:"",
228 228
         drug_type:0,
229 229
         minCount:[],
230
-        drugOutList:[]
230
+        drugOutList:[],
231
+        
231 232
       }
232 233
     },
233 234
     methods: {
@@ -342,12 +343,12 @@ import { min } from 'moment'
342 343
       },
343 344
       handleSizeChange(val) {
344 345
         this.limit = val
345
-        // this.GetAllDrugStockQueryList()
346
+     
346 347
         this.getlist()
347 348
       },
348 349
       handleCurrentChange(val) {
349 350
         this.page = val
350
-        // this.GetAllDrugStockQueryList()
351
+       
351 352
         this.getlist()
352 353
       },
353 354
       calculate: function(val) {
@@ -361,7 +362,7 @@ import { min } from 'moment'
361 362
         this.$message.error("开始时间不能大于结束时间");
362 363
         this.start_time = "";
363 364
       } else {
364
-        // this.GetAllDrugStockQueryList();
365
+     
365 366
         this.getlist()
366 367
       }
367 368
     },
@@ -421,14 +422,24 @@ import { min } from 'moment'
421 422
         this.$refs.dialog.show()
422 423
       },
423 424
        exportStock(){
425
+
426
+         for(let i=0;i<this.tableList.length;i++){
427
+           this.tableList[i].index = i+1
428
+           this.tableList[i].drug_type_name = this.getDrugType(this.tableList[i].drug_type)
429
+           this.tableList[i].unit = this.tableList[i].dose + this.tableList[i].dose_unit +"*"+this.tableList[i].min_number+this.tableList[i].min_unit+"/"+this.tableList[i].max_unit
430
+           this.tableList[i].manufacturer_name = this.getManufacturerList(this.tableList[i].manufacturer)
431
+           this.tableList[i].inCount =  this.getInCount(this.tableList[i].drug_id) + this.tableList[i].max_unit
432
+           this.tableList[i].outCount = this.getCount(this.tableList[i].drug_id,this.tableList[i].min_number,this.tableList[i].max_unit,this.tableList[i].min_unit)
433
+           this.tableList[i].overplusCount = this.getCountTwo(this.tableList[i].drug_id,this.tableList[i].min_number,this.tableList[i].max_unit,this.tableList[i].min_unit)
434
+         }
435
+       
436
+         console.log("2322323232",this.tableList)
424 437
          import('@/vendor/Export2Excel').then(excel => {
425
-         const tHeader = ['药品名称', '规格名称', '入库数量','单价','入库退货','实际入库','出库数量','出库退库','实际出库','剩余库存']
426
-         const filterVal = ['drug_name', 'drug_spec', 'stockInCount','last_price','salesReturnCount','reactCount','stockOutCount','cancelStockCount','reactOutCount','overplusCount']
438
+         const tHeader = ['序号', '药品类型', '药品名称','规格型号&单位','进货单价','厂家','入库数量','出库数量','剩余库存量']
439
+         const filterVal = ['index', 'drug_type_name', 'drug_name','unit','last_price','manufacturer_name','inCount','outCount','overplusCount']
427 440
        
428 441
         
429
-         const data = this.formatJson(filterVal, this.tableData)
430
-        //  console.log("data",data)
431
-        
442
+         const data = this.formatJson(filterVal, this.tableList)
432 443
          excel.export_json_to_excel({
433 444
            header: tHeader,
434 445
            data,
@@ -452,7 +463,7 @@ import { min } from 'moment'
452 463
       printOrder(){
453 464
         this.$router.push({
454 465
           name: "drugQueryPrint",
455
-          query: {drug_category:this.drug_category,keyword:this.keywords,start_time:this.start_time,end_time:this.end_time,page:this.page,limit:this.limit}
466
+          query: {drug_type:this.drug_type,keyword:this.keywords,start_time:this.start_time,end_time:this.end_time,page:this.page,limit:this.limit}
456 467
         });
457 468
       },
458 469
  
@@ -509,7 +520,7 @@ import { min } from 'moment'
509 520
          }
510 521
         }
511 522
         var unit =  val.dose + val.dose_unit +"*"+val.min_number+val.min_unit+"/"+val.max_unit
512
-        this.$router.push({path:'/drugstock/in/drugstockflow?drug_id='+val.drug_id+"&drug_name="+val.drug_name+"&manufacturer="+manufacturer_name+"&unit="+unit})
523
+        this.$router.push({path:'/drugstock/in/drugstockflow?drug_id='+val.drug_id+"&drug_name="+val.drug_name+"&manufacturer="+manufacturer_name+"&unit="+unit+"&min_number="+val.min_number+"&max_unit="+val.max_unit+"&min_unit="+val.min_unit})
513 524
       },
514 525
       handleBatch(val){
515 526
         var manufacturer_name = ""
@@ -519,7 +530,7 @@ import { min } from 'moment'
519 530
          }
520 531
         }
521 532
         var unit =  val.dose + val.dose_unit +"*"+val.min_number+val.min_unit+"/"+val.max_unit
522
-        this.$router.push({path:'/drugstock/in/drugbatchnumber?drug_id='+val.drug_id+"&drug_name="+val.drug_name+"&manufacturer="+manufacturer_name+"&unit="+unit})
533
+        this.$router.push({path:'/drugstock/in/drugbatchnumber?drug_id='+val.drug_id+"&drug_name="+val.drug_name+"&manufacturer="+manufacturer_name+"&unit="+unit+"&min_number="+val.min_number+"&max_unit="+val.max_unit+"&min_unit="+val.min_unit})
523 534
       },
524 535
       getDrugCountList(){
525 536
          var params = {
@@ -549,13 +560,6 @@ import { min } from 'moment'
549 560
             }
550 561
             console.log("info2222222",info)
551 562
             this.drugOutList = info
552
-            var arr = []
553
-            for(let i=0;i<this.drugOutList.length;i++){
554
-              if(this.drugOutList[i].drug_id == 1197){
555
-                arr.push(this.drugOutList[i])
556
-              }
557
-            }
558
-            console.log("arrr",arr)
559 563
           }
560 564
         })
561 565
       },

+ 12 - 12
src/xt_pages/stock/stockBatchNumber.vue View File

@@ -63,8 +63,7 @@
63 63
         </el-table-column>
64 64
         <el-table-column prop="drug_name" label="入库单据编码" align="center">
65 65
            <template slot-scope="scope" >
66
-             <span v-if="scope.row.stock_way == 2"> {{scope.row.warehouse_out_order_number}}</span>
67
-             <span v-if="scope.row.stock_way == 4">{{scope.row.warehousing_order}}</span>
66
+             <span >{{scope.row.warehousing_order}}</span>
68 67
            </template>
69 68
         </el-table-column>
70 69
         <el-table-column prop="drug_name" label="操作日期" align="center">
@@ -74,25 +73,24 @@
74 73
         </el-table-column>
75 74
          <el-table-column prop="drug_name" label="有效期" align="center">
76 75
            <template slot-scope="scope">
77
-             <span v-if="scope.row.stock_way == 4 && scope.row.warehousing_count!=0"> {{scope.row.warehousing_count}}</span>
78
-             <span v-if="scope.row.stock_way == 2 && scope.row.count!=0">{{scope.row.count}}</span>
76
+             <span> {{getTime(scope.row.expiry_date)}}</span>
77
+          
79 78
            </template>
80 79
         </el-table-column>
81 80
          <el-table-column prop="drug_name" label="批号" align="center">
82 81
            <template slot-scope="scope" >
83
-             <span v-if="scope.row.stock_way == 4">{{scope.row.number}} </span>
82
+             <span>{{scope.row.number}} </span>
84 83
            </template>
85 84
         </el-table-column>
86 85
         <el-table-column prop="drug_name" label="入库数量" align="center">
87 86
            <template slot-scope="scope">
88
-             <span v-if="scope.row.stock_way == 4"> {{scope.row.warehousing_count}}</span>
89
-             <span v-if="scope.row.stock_way == 2">{{scope.row.count}}</span>
87
+             <span> {{scope.row.warehousing_count}}{{packing_unit}}</span>
88
+           
90 89
            </template>
91 90
         </el-table-column>
92 91
          <el-table-column prop="drug_name" label="进货价" align="center">
93 92
            <template slot-scope="scope">
94
-             <span v-if="scope.row.stock_way == 4"> {{scope.row.price}}</span>
95
-             <span v-if="scope.row.stock_way == 2">{{scope.row.price}}</span>
93
+             <span> {{scope.row.price}}</span>
96 94
            </template>
97 95
         </el-table-column>
98 96
        </el-table>
@@ -122,6 +120,7 @@
122 120
     created() {
123 121
       this.getlist()
124 122
       this.getStockDrugCount()
123
+      this.packing_unit = this.$route.query.packing_unit
125 124
     },
126 125
     components: {
127 126
       BreadCrumb
@@ -168,6 +167,7 @@
168 167
         outCountList:[],
169 168
         autoCountList:[],
170 169
         keywords:"",
170
+        packing_unit:""
171 171
       }
172 172
     },
173 173
     methods:{
@@ -232,9 +232,9 @@
232 232
          if(response.data.state == 1){
233 233
            var list = response.data.data.list
234 234
            console.log("入库数据",list)
235
-           for(let i=0;i<list.length;i++){
236
-             list[i].stock_way = 4
237
-           }
235
+          //  for(let i=0;i<list.length;i++){
236
+          //    list[i].stock_way = 4
237
+          //  }
238 238
            this.tableList = list
239 239
            var total = response.data.data.total
240 240
            this.total = total

+ 8 - 6
src/xt_pages/stock/stockFlow.vue View File

@@ -82,14 +82,14 @@
82 82
         </el-table-column>
83 83
          <el-table-column prop="drug_name" label="出入库数量"  align="center">
84 84
            <template slot-scope="scope">
85
-             <span v-if="scope.row.stock_way == 4 && scope.row.warehousing_count!=0"> {{scope.row.warehousing_count}}</span>
86
-             <span v-if="(scope.row.stock_way == 2 || scope.row.stock_way == 3) && scope.row.count!=0">{{scope.row.count}}</span>
85
+             <span v-if="scope.row.stock_way == 4 && scope.row.warehousing_count!=0"> {{scope.row.warehousing_count}}{{packing_unit}}</span>
86
+             <span v-if="(scope.row.stock_way == 2 || scope.row.stock_way == 3) && scope.row.count!=0">{{scope.row.count}}{{packing_unit}}</span>
87 87
            </template>
88 88
         </el-table-column>
89 89
          <el-table-column prop="drug_name" label="剩余库存量"  align="center">
90 90
            <template slot-scope="scope">
91 91
              <!-- <span v-if="scope.row.stock_way == 4 && scope.row.stock_count!=0">{{scope.row.stock_count}} </span> -->
92
-              {{getInCount(scope.row.good_id)- getOutCount(scope.row.good_id) - getAutoCount(scope.row.good_id)}}
92
+              {{getInCount(scope.row.good_id)- getOutCount(scope.row.good_id) - getAutoCount(scope.row.good_id)}}{{packing_unit}}
93 93
            </template>
94 94
         </el-table-column>
95 95
         <el-table-column prop="drug_name" label="进/出货单价"  align="center">
@@ -145,6 +145,7 @@
145 145
       this.getlist()
146 146
       this.getStockDrugCount()
147 147
       this.getStockOutList()
148
+      this.packing_unit = this.$route.query.packing_unit
148 149
     },
149 150
     components: {
150 151
       BreadCrumb
@@ -192,6 +193,7 @@
192 193
         autoCountList:[],
193 194
         keywords:"",
194 195
         obj:{},
196
+        packing_unit:""
195 197
       }
196 198
     },
197 199
     methods:{
@@ -280,7 +282,7 @@
280 282
           id:this.$route.query.id,
281 283
           start_time:this.start_time,
282 284
           end_time:this.end_time, 
283
-          is_sys:this.stockType 
285
+          is_sys:this.stock_type 
284 286
         } 
285 287
       getStockOutList(params).then(response=>{
286 288
         if(response.data.state == 1){
@@ -288,10 +290,10 @@
288 290
           console.log("outList990-0000990",outList)
289 291
            for(let i=0;i<outList.length;i++){
290 292
              if(outList[i].is_sys == 0){
291
-                outList[i].stock_way = 2
293
+                outList[i].stock_way = 3
292 294
              }
293 295
              if(outList[i].is_sys == 1){
294
-                outList[i].stock_way = 3
296
+                outList[i].stock_way = 2
295 297
              }
296 298
              this.tableList.push(outList[i])
297 299
            }

+ 26 - 31
src/xt_pages/stock/stockInOrder.vue View File

@@ -67,8 +67,8 @@
67 67
       <div class="cell clearfix">
68 68
         <el-checkbox
69 69
           style="width: 70px"
70
-          v-model="checked"
71
-          @change="changeAllSelected"
70
+          v-model="checkAllStatus"
71
+          @change="changeCheck"
72 72
           >全选</el-checkbox
73 73
         >
74 74
         <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
@@ -117,20 +117,6 @@
117 117
 
118 118
         <el-table-column label="操作" align="center" width="260px">
119 119
           <template slot-scope="scope">
120
-            <!-- <el-tooltip
121
-              class="item"
122
-              effect="dark"
123
-              content="详情"
124
-              placement="top"
125
-            >
126
-              <el-button
127
-                size="small"
128
-                type="warning"
129
-                icon="el-icon-document"
130
-                @click="handleSearch(scope.row.id)"
131
-              >
132
-              </el-button>
133
-            </el-tooltip> -->
134 120
             <el-tooltip
135 121
               class="item"
136 122
               effect="dark"
@@ -183,13 +169,13 @@
183 169
           border
184 170
           highlight-current-row
185 171
           v-loading="Warehouse.loading"
186
-          ref="multipleTable"
187 172
           @selection-change="select"
188 173
           :row-style="{ color: '#303133' }"
189 174
           :header-cell-style="{
190 175
             backgroundColor: 'rgb(245, 247, 250)',
191 176
             color: '#606266'
192 177
           }"
178
+          fit
193 179
         >
194 180
         <el-table-column label="耗材名称" align="center">
195 181
           <template slot-scope="scope">
@@ -756,21 +742,28 @@ export default {
756 742
         dealer: '',
757 743
         manufacturer: ''
758 744
       },
759
-        isCreated: 1,
760
-        isVisibility: false,
761
-        drug_id:1,
745
+      isCreated: 1,
746
+      isVisibility: false,
747
+      drug_id:1,
762 748
       },
763 749
       drug_id:1,
764 750
       tableShow:false,
765 751
       tableList:[],
766 752
       isVisibility:false,
767 753
       order_id:0,
768
-      exportList:[]
754
+      exportList:[],
755
+      checkAllStatus:false,
769 756
     };
770 757
     
771 758
   
772 759
   },
773 760
   methods: {
761
+     changeCheck() {
762
+      this.$refs.multipleTable.clearSelection();
763
+      if (this.checkAllStatus) {
764
+        this.$refs.multipleTable.toggleAllSelection();
765
+      }
766
+    },
774 767
     search: function() {
775 768
       const Params = {
776 769
         page: this.page,
@@ -988,6 +981,7 @@ export default {
988 981
       } else {
989 982
         this.startTime = this.getTimestamp(val);
990 983
         this.GetWarehouse();
984
+        this.getlist()
991 985
       }
992 986
     },
993 987
     endTimeChange(val) {
@@ -997,6 +991,7 @@ export default {
997 991
         this.end_time = "";
998 992
       } else {
999 993
         this.GetWarehouse();
994
+        this.getlist()
1000 995
       }
1001 996
     },
1002 997
     getTimestamp(time) {
@@ -1086,18 +1081,17 @@ export default {
1086 1081
         })
1087 1082
         .catch(() => {});
1088 1083
     },
1089
-    changeAllSelected: function() {
1090
-      console.log("22222",this.checked)
1091
-      this.$refs.multipleTable.clearSelection();
1092
-      if (this.checked) {
1093
-        this.$refs.multipleTable.toggleAllSelection();
1094
-      }
1095
-    },
1084
+   
1096 1085
     select(selection) {
1097
-      this.order_id = selection[0].id
1098 1086
       console.log("selection",selection)
1087
+      var ids= []
1088
+      for(let i=0;i<selection.length;i++){
1089
+        ids.push(selection[i].id)
1090
+      }
1091
+      var str = ids.join(",")
1092
+      this.order_id = str
1099 1093
       this.selectedTableData = selection;
1100
-
1094
+      this.getlist()
1101 1095
     },
1102 1096
     batchDelete() {
1103 1097
       if (this.selectedTableData.length <= 0) {
@@ -1442,7 +1436,7 @@ export default {
1442 1436
       this.propForm.goodType = [];
1443 1437
     },
1444 1438
     toPrint(){
1445
-      if(this.order_id == 0){
1439
+      if(this.order_id == ""){
1446 1440
         this.$message.error("请勾选入库单")
1447 1441
       }else{
1448 1442
         this.$router.push("/stock/in/detail/print?id="+this.order_id)
@@ -1454,6 +1448,7 @@ export default {
1454 1448
         start_time:this.start_time,
1455 1449
         end_time:this.end_time,
1456 1450
       }
1451
+      console.log("params",params)
1457 1452
       getExportStockList(params).then(response=>{
1458 1453
         if(response.data.state == 1){
1459 1454
            var list = response.data.data.list

+ 23 - 14
src/xt_pages/stock/stockInOrderDetailPrint.vue View File

@@ -10,14 +10,14 @@
10 10
         </div>
11 11
         <div class="app-container" style="background-color: white;">
12 12
             <div id="print_content">
13
-                <div class="print_main_content">
13
+                <div class="print_main_content" v-for="(it,index) in warehousingInfo" :key="index">
14 14
                     <div class="order_title_panl">
15 15
                         <div style="font-size:22px;font-weight:bold;">{{ orgName }}</div>
16 16
                         <span style="font-weight:500;font-size:18px;">耗材入库登记单</span>
17 17
                     </div>
18 18
                     <div style="display:flex;justify-content: space-between;">
19 19
                       <div style="text-align:left;margin-bottom:1px;font-size: 18px;">
20
-                        单据编号:{{WarehouseInfo.warehouse.warehousing_order}}
20
+                        单据编号:{{it.warehousing_order}}
21 21
                       </div>
22 22
                       <div style="text-align:right;margin-bottom:1px;font-size: 18px;">
23 23
                         打印时间:{{time_now}}
@@ -44,7 +44,7 @@
44 44
                                 </tr>
45 45
                             </thead>
46 46
                             <tbody>
47
-                                <tr v-for='(item,index) in WarehouseInfo.warehouseInfoDate' :key="index">
47
+                                <tr v-for='(item,index) in it.child' :key="index">
48 48
                                     <td style="line-height:18px;"><span v-if="item.good_id != 0">{{getTypeNameOne(item.good_id)}}</span></td>
49 49
                                     <td style="line-height:18px;">{{ item.remark }}</td>
50 50
                                     <td style="line-height:18px;"><span v-if="item.good_id != 0">{{getSpecificationName(item.good_id)}}</span></td>
@@ -71,7 +71,7 @@
71 71
                             <div style="width:80px;" v-if='orgId != 10024'>药材主任:</div><div style="width:100px;"></div>
72 72
                             <div style="width:50px;">会计:</div><div style="width:100px;"><span v-if='orgId == 10024'>徐立琼</span></div>
73 73
                             <div style="width:50px;">审核:</div><div style="width:100px;"><span v-if='orgId == 10024'>徐立琼</span></div>
74
-                            <div style="width:70px;">制单人:</div><div style="width:100px;">{{ getXuserName(this.WarehouseInfo.warehouse.creater) }}</div>
74
+                            <div style="width:70px;">制单人:</div><div style="width:100px;">{{ getXuserName(it.creater) }}</div>
75 75
                        </div>
76 76
                     </div>
77 77
                 </div>
@@ -131,7 +131,8 @@ export default {
131 131
             list:[],
132 132
             orgName:'',
133 133
             orgId:'',
134
-            adminUserOptions:[]
134
+            adminUserOptions:[],
135
+            warehousingInfo:[]
135 136
         }
136 137
     },
137 138
     methods:{
@@ -184,6 +185,7 @@ export default {
184 185
         },
185 186
        
186 187
      GetOrderDetail: function(order_id) {
188
+
187 189
         const params = {
188 190
             id: order_id
189 191
         };
@@ -192,18 +194,24 @@ export default {
192 194
             this.$message.error(response.data.msg);
193 195
             return false;
194 196
             } else {
195
-             var obj = ""
196
-            for (let i = 0; i < response.data.data.info.length; i++) {
197
-                this.WarehouseInfo.warehouseInfoDate.push(response.data.data.info[i]);
198
-            }
199
-            this.WarehouseInfo.warehouse = response.data.data.warehousing;
197
+             var info = response.data.data.info
198
+             console.log("info2222",info)
199
+             var warehousing = response.data.data.warehousing
200
+             console.log("warehousing",warehousing)
201
+             for(let i=0;i<warehousing.length;i++){
202
+                warehousing[i].child = []
203
+              for(let j=0;j<info.length;j++){
204
+                if(warehousing[i].id == info[j].warehousing_id){
205
+                   warehousing[i].child.push(info[j])
206
+                }
207
+              }
208
+             }
209
+             this.warehousingInfo = warehousing
200 210
             var total_price = 0
201
-            for(let i=0;i<this.WarehouseInfo.warehouseInfoDate.length;i++){
202
-               total_price += this.WarehouseInfo.warehouseInfoDate[i].warehousing_count * this.WarehouseInfo.warehouseInfoDate[i].price   
211
+            for(let i=0;i<info.length;i++){
212
+               total_price += info[i].warehousing_count * info[i].price   
203 213
             }
204 214
             this.allPrice = total_price
205
-            console.log("total_price",total_price)
206
-            console.log("数据222222222",this.WarehouseInfo.warehouseInfoDate)
207 215
             }
208 216
         });
209 217
        },
@@ -337,6 +345,7 @@ export default {
337 345
       this.orgName = this.$store.getters.xt_user.org.org_name;
338 346
       this.orgId = this.$store.getters.xt_user.org.id;
339 347
       const order_id = this.$route.query.id;
348
+
340 349
       this.fetchAllAdminUsers()
341 350
       this.GetConfigInfo();
342 351
       this.GetOrderDetail(order_id);

+ 87 - 70
src/xt_pages/stock/stockOutOrder.vue View File

@@ -71,6 +71,7 @@
71 71
         >
72 72
         <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
73 73
         <el-button size="small" type="primary" @click="toPrint">打印</el-button>
74
+        <el-button size="small" type="primary" @click="toExport">导出</el-button>
74 75
       </div>
75 76
 
76 77
       <el-table
@@ -112,21 +113,6 @@
112 113
         <el-table-column label="操作" align="center" width="300px">
113 114
           <template slot-scope="scope">
114 115
            
115
-            <!-- <el-tooltip
116
-              class="item"
117
-              effect="dark"
118
-              content="详情"
119
-              placement="top"
120
-            >
121
-              <el-button
122
-                size="small"
123
-                type="warning"
124
-                icon="el-icon-document"
125
-                @click="handleSearch(scope.row.id,scope.row)"
126
-              >
127
-              </el-button>
128
-            </el-tooltip> -->
129
-
130 116
             <el-tooltip
131 117
               class="item"
132 118
               effect="dark"
@@ -178,7 +164,7 @@
178 164
             style="width: 100%"
179 165
             border
180 166
             highlight-current-row
181
-            ref="multipleTable"
167
+            ref="multipleTableOne"
182 168
             @selection-change="select"
183 169
             :row-style="{ color: '#303133' }"
184 170
             :header-cell-style="{
@@ -380,11 +366,6 @@
380 366
         <span style="font-size: 18px;color: #606266">商品使用明细</span>
381 367
       </div>
382 368
      
383
-      <!-- <div class="cell clearfix">
384
-        <span style="width: 300px;color: #606266">商品类型: {{type_name}} </span>
385
-        <span style="width: 300px;color: #606266">规格名称: {{specification_name}}</span>
386
-      </div> -->
387
-
388 369
        <el-row :gutter="12" style="margin-top: 10px">
389 370
         <el-table :data="userList" :class="signAndWeighBoxPatients" style="width: 80%"
390 371
                   border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
@@ -669,7 +650,8 @@ import {
669 650
   GetAllGoodInfoByID,
670 651
   editWarehouseoutInfo,
671 652
   getOrderDetailByOrderId,
672
-  getOrderDetailById
653
+  getOrderDetailById,
654
+  getOutExportList
673 655
 } from "@/api/stock";
674 656
 import BreadCrumb from "../components/bread-crumb";
675 657
 import StockInDialog from './Dialog/stockInDialog'
@@ -701,9 +683,9 @@ export default {
701 683
       (nowDay < 10 ? "0" + nowDay : nowDay);
702 684
     this.GetConfigInfo();
703 685
     this.GetWarehouseOut();
704
-   
705 686
     this.fetchAllAdminUsers();
706 687
     
688
+    
707 689
   },
708 690
   data() {
709 691
      var checkGoodId = (rule, value, callback) => {
@@ -787,8 +769,9 @@ export default {
787 769
       userList:[],
788 770
       editdialogVisibleTwo:false,
789 771
       editdialogVisibleThree:false,
790
-      order_id:0,
772
+      order_id:"",
791 773
       warehouse_out_time:"",
774
+      exportList:[]
792 775
     };
793 776
   },
794 777
   methods: {
@@ -887,10 +870,12 @@ export default {
887 870
     handleSizeChange(val) {
888 871
       this.limit = val;
889 872
       this.GetWarehouseOut();
873
+      
890 874
     },
891 875
     handleCurrentChange(val) {
892 876
       this.page = val;
893 877
       this.GetWarehouseOut();
878
+     
894 879
     },
895 880
     startTimeChange(val) {
896 881
       var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
@@ -899,6 +884,7 @@ export default {
899 884
         this.start_time = "";
900 885
       } else {
901 886
         this.GetWarehouseOut();
887
+        this.getlist()
902 888
       }
903 889
      
904 890
     },
@@ -909,6 +895,7 @@ export default {
909 895
         this.end_time = "";
910 896
       } else {
911 897
         this.GetWarehouseOut();
898
+        this.getlist()
912 899
       }
913 900
     },
914 901
     getTimestamp(time) {
@@ -930,6 +917,7 @@ export default {
930 917
           this.goodType = response.data.data.goodType
931 918
           this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
932 919
           this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
920
+          this.getlist()
933 921
         }
934 922
       });
935 923
     },
@@ -1001,10 +989,15 @@ export default {
1001 989
       }
1002 990
     },
1003 991
     select(selection) {
1004
-      console.log("selection",selection)
1005
-      this.order_id = selection[0].id
992
+      var ids = []
993
+      for(let i=0;i<selection.length;i++){
994
+        ids.push(selection[i].id)
995
+      }
996
+      console.log("ids",ids)
997
+      this.order_id = ids.join(",")
1006 998
       this.warehouse_out_time = selection[0].warehouse_out_time
1007 999
       this.selectedTableData = selection;
1000
+      this.getlist()
1008 1001
     },
1009 1002
     batchDelete() {
1010 1003
       if (this.selectedTableData.length <= 0) {
@@ -1053,15 +1046,7 @@ export default {
1053 1046
  
1054 1047
 
1055 1048
     
1056
-    //新增
1057
-    // handleSearch(id,row){ 
1058
-      
1059
-    //   this.warehousingOutInfo.info = []
1060
-    //   this.warehousingOutInfo.warehousingOutData = []
1061
-    //   this.GetOrderDetailOne(id)
1062
-    //   this.GetTotalCount(row.warehouse_out_time)
1063
-      
1064
-    // },
1049
+  
1065 1050
 
1066 1051
     handleSearch(val){
1067 1052
       this.tableList = []
@@ -1071,43 +1056,21 @@ export default {
1071 1056
       this.GetTotalCount(val.warehouse_out_time)
1072 1057
     },
1073 1058
   
1074
-    //获取出库单详情数据
1075
-    // GetOrderDetailOne(id) {
1076
-    //     const params = {
1077
-    //       'id': id
1078
-    //     }
1079
-    //     console.log("#3333333",id)
1080
-    //   getWarehouseOutInfo(params).then(response => {
1081
-    //       if (response.data.state == 0) {
1082
-
1083
-    //         this.$message.error(response.data.msg)
1084
-    //         return false
1085
-    //       } else {
1086
-    //         this.tableShow = true
1087
-    //         for (let i = 0; i < response.data.data.list.length; i++) {
1088
-    //           this.warehousingOutInfo.warehousingOutData.push(response.data.data.list[i])
1089
-    //           console.log("表格00000000",this.tableList)
1090
-    //           this.tableList.push(response.data.data.list[i])
1091
-    //         }
1092
-    //         this.warehousingOutInfo.info = response.data.data.info
1093
-    //       }
1094
-    //     })
1095
-    //  }, 
1096
-     GetOrderDetailOne(id){
1059
+      GetOrderDetailOne(id){
1097 1060
         const params = {
1098 1061
           'id': id
1099 1062
         }
1100 1063
         getOrderDetailByOrderId(params).then(response=>{
1101
-           if(response.data.state == 1){
1102
-             this.tableShow = true
1103
-             var list = response.data.data.list
1104
-             console.log("list22222222",list)
1105
-             for(let i=0;i<list.length;i++){
1106
-               this.tableList.push(list[i])
1107
-             }
1108
-           }
1064
+            if(response.data.state == 1){
1065
+              this.tableShow = true
1066
+              var list = response.data.data.list
1067
+              console.log("list22222222",list)
1068
+              for(let i=0;i<list.length;i++){
1069
+                this.tableList.push(list[i])
1070
+              }
1071
+            }
1109 1072
         })
1110
-     },
1073
+      },
1111 1074
 
1112 1075
       getTypeName: function(id) {
1113 1076
         let name = ''
@@ -1527,13 +1490,67 @@ export default {
1527 1490
          })
1528 1491
       },
1529 1492
       toPrint(){
1530
-        if(this.order_id == 0){
1493
+        if(this.order_id == ""){
1531 1494
           this.$message.error("请选择出库单")
1532 1495
         }else{
1533 1496
             this.$router.push({path:"/stock/out/detail/print?id="+this.order_id+"&warehouse_out_time="+this.warehouse_out_time})
1534 1497
         }
1535
-      
1536
-      }
1498
+      },
1499
+      getlist(){
1500
+         var params = {
1501
+           'id': this.order_id,
1502
+           "start_time":this.start_time,
1503
+           "end_time":this.end_time,
1504
+         }
1505
+        console.log('parasm22',params)
1506
+       getOutExportList(params).then(response=>{
1507
+          if(response.data.state == 1){
1508
+            var list = response.data.data.list
1509
+            var outCount = response.data.data.outCount
1510
+            console.log("outCount",outCount)
1511
+            for(let i=0;i<list.length;i++){
1512
+              for(let j=0;j<this.manufacturer.length;j++){
1513
+                if(list[i].manufacturer == this.manufacturer[j].id){
1514
+                  list[i].manufacturer = this.manufacturer[j].manufacturer_name
1515
+                }
1516
+              }
1517
+              for(let z=0;z<this.dealer.length;z++){
1518
+                 if(list[i].dealer == this.dealer[z].id){
1519
+                   list[i].dealer = this.dealer[z].dealer_name
1520
+                 }
1521
+              }
1522
+              for(let a=0;a<this.goodType.length;a++){
1523
+                 if(list[i].good_type_id == this.goodType[a].id){
1524
+                    list[i].good_type_id = this.goodType[a].type_name
1525
+                 }
1526
+              } 
1527
+            }
1528
+            console.log("导出list222222",list)
1529
+            this.exportList = list
1530
+          }
1531
+        })
1532
+      },
1533
+      toExport(){
1534
+       console.log("列表22222222222",this.exportList)
1535
+        import('@/vendor/Export2Excel').then(excel => {
1536
+        for(let i=0;i<this.exportList.length;i++){
1537
+          this.exportList[i].total_price = this.exportList[i].count * this.exportList[i].price
1538
+        }
1539
+        const tHeader = ['耗材名称', '规格型号', '单位','出库数量','出库价格','总价','批号','生产日期','有效日期']
1540
+        const filterVal = ['good_name', 'specification_name', 'packing_unit','count','price','total_price','number','product_date','expiry_date']
1541
+        console.log("table",this.exportList)
1542
+        const data = this.formatJson(filterVal, this.exportList)
1543
+        excel.export_json_to_excel({
1544
+          header: tHeader,
1545
+          data,
1546
+          filename: '耗材出库单详情'
1547
+        })
1548
+        this.downloadLoading = false
1549
+     })
1550
+    },
1551
+    formatJson(filterVal, jsonData) {
1552
+    return jsonData.map(v => filterVal.map(j => v[j]));
1553
+   },
1537 1554
   }
1538 1555
 };
1539 1556
 </script>

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

@@ -139,7 +139,7 @@
139 139
 
140 140
               <el-form-item style="padding-top: 20px">
141 141
                 <el-input
142
-                  placeholder="请输入商品类型"
142
+                  placeholder="请输入耗材类型"
143 143
                   v-model="scope.row.good_type_id"
144 144
                   :value="typeName(scope.row.good_type_id)"
145 145
                 ></el-input>

+ 28 - 49
src/xt_pages/stock/stockOutOrderDetailPrint.vue View File

@@ -10,15 +10,14 @@
10 10
         </div>
11 11
         <div class="app-container" style="background-color: white;">
12 12
             <div id="print_content">
13
-                <div class="print_main_content">
13
+                <div class="print_main_content" v-for="(it,index) in tableList" :key="index">
14 14
                     <div class="order_title_panl">
15 15
                         <div style="font-size:22px;font-weight:bold;">{{ orgName }}</div>
16 16
                         <span class="main_title">耗材出库登记单</span>
17 17
                     </div>
18 18
                     <div style="display:flex;justify-content: space-between;">
19 19
                       <div style="text-align:left;margin-bottom:1px;font-size: 18px;">
20
-                        <!-- 单据编号:{{warehousingOutInfo.info.warehouse_out_order_number}} -->
21
-                        单据编号: {{tableList[0].warehouse_out_order_number}}
20
+                        单据编号: {{it.warehouse_out_order_number}}
22 21
                       </div>
23 22
                       <div style="text-align:right;margin-bottom:1px;font-size: 18px;">
24 23
                         打印日期:{{time_now}}
@@ -31,7 +30,7 @@
31 30
                                     <td width="80">耗材名称</td>
32 31
                                     <td width="80">规格型号</td>
33 32
                                     <td width="80">单位</td>
34
-                                    <td width="80">出数量</td>
33
+                                    <td width="80">出数量</td>
35 34
                                     <td width="80">出库价格</td>
36 35
                                     <td width="80">总价</td>
37 36
                                     <td width="80">批号</td>
@@ -40,7 +39,7 @@
40 39
                                 </tr>
41 40
                             </thead>
42 41
                             <tbody>
43
-                                <tr v-for='(item,index) in tableList' :key="index">
42
+                                <tr v-for='(item,index) in it.child' :key="index">
44 43
                                     <td><span v-if="item.good_id != 0">{{item.good_name}}</span></td>
45 44
                                     <td><span v-if="item.good_id != 0">{{item.specification_name}}</span></td>
46 45
                                     <td><span v-if="item.good_id!=0">{{item.packing_unit}}</span></td>
@@ -48,8 +47,8 @@
48 47
                                     <td>{{item.price}}</td>
49 48
                                     <td>{{((getOutStockCount(item.good_id) +getWarehouseOutInfoCount(item.warehouse_out_id,item.good_id))*item.price).toFixed(2)}}</td>
50 49
                                     <td>{{getNumber(item.good_id)}}</td>
51
-                                    <td>{{getProductDate(item.good_id)}}</td>
52
-                                    <td>{{getExpiryDate(item.good_id)}}</td>
50
+                                    <td>{{getTime(item.product_date)}}</td>
51
+                                    <td>{{getTime(item.expiry_date)}}</td>
53 52
                                 </tr>
54 53
                                 <tr>
55 54
                                   <td>合计</td>
@@ -96,7 +95,7 @@ export default {
96 95
           crumbs: [
97 96
             { path: false, name: '库存管理' },
98 97
             { path: false, name: '耗材管理' },
99
-            { path: false, name: '库单打印' },
98
+            { path: false, name: '库单打印' },
100 99
           ],
101 100
            isEdit: 0,
102 101
             checked: false,
@@ -125,7 +124,8 @@ export default {
125 124
             orgId:'',
126 125
             orgName:'',
127 126
             orderInList:[],
128
-            tableList:[]
127
+            tableList:[],
128
+            orderList:[]
129 129
         }
130 130
     },
131 131
     methods:{
@@ -153,36 +153,6 @@ export default {
153 153
             }
154 154
             })
155 155
         },
156
-       GetOrderDetail: function(order_id) {
157
-        const params = {
158
-          'id': order_id
159
-        };
160
-        getWarehouseOutInfo(params).then(response => {
161
-          if (response.data.state == 0) {
162
-
163
-            this.$message.error(response.data.msg);
164
-            return false
165
-          } else {
166
-
167
-            for (let i = 0; i < response.data.data.list.length; i++) {
168
-              this.warehousingOutInfo.warehousingOutData.push(response.data.data.list[i])
169
-            }
170
-            this.warehousingOutInfo.info = response.data.data.info;
171
-            console.log("数据源头9999999999",this.warehousingOutInfo.warehousingOutData);
172
-            var total_price = 0;
173
-            for(let i=0;i<this.warehousingOutInfo.warehousingOutData.length;i++){
174
-              total_price += this.warehousingOutInfo.warehousingOutData[i].total_price   
175
-            }
176
-            console.log('this.allPrice',this.allPrice)
177
-           this.allPrice = total_price;
178
-
179
-           var wareoutList =  response.data.data.wareoutList;
180
-           console.log("出库数据",wareoutList);
181
-           this.wareoutList = wareoutList
182
-          }
183
-        })
184
-      },
185
-
186 156
        GetTotalCount(time){
187 157
           var params = {
188 158
            warehouse_out_time:time
@@ -278,13 +248,13 @@ export default {
278 248
       },
279 249
 
280 250
       getWarehouseOutInfoCount(warehouse_out_id,good_id){
281
-        var count = 0;
282
-         for(let i=0;i<this.wareoutList.length;i++){
283
-            if(warehouse_out_id == this.wareoutList[i].warehouse_out_id && good_id == this.wareoutList[i].good_id){
284
-                count = this.wareoutList[i].count
285
-            }
251
+         var count = 0
252
+         for(let i=0;i<this.orderList.length;i++){
253
+          if(this.orderList[i].warehouse_out_id == warehouse_out_id && this.orderList[i].good_id == good_id){
254
+             count += this.orderList[i].count
255
+          } 
286 256
          }
287
-        return count
257
+         return count
288 258
       },
289 259
 
290 260
       getWarehouseOrderInfoList(){
@@ -339,14 +309,26 @@ export default {
339 309
         const params = {
340 310
           'id': id
341 311
         }
312
+        console.log("paramsssss",params)
342 313
         getOrderDetailByOrderId(params).then(response=>{
343 314
            if(response.data.state == 1){
315
+             var order = response.data.data.order
316
+             console.log("order22222",order)
344 317
              var list = response.data.data.list
318
+             this.orderList = list
319
+             for(let i=0;i<order.length;i++){
320
+               order[i].child =[]
321
+               for(let j=0;j<list.length;j++){
322
+                  if(order[i].id == list[j].warehouse_out_id){
323
+                     order[i].child.push(list[j])
324
+                  }
325
+               }
326
+             }
345 327
              console.log("详情打印222222",list)
328
+             this.tableList = order
346 329
              var total_price = 0
347 330
              for(let i=0;i<list.length;i++){
348 331
                total_price += response.data.data.list[i].price * response.data.data.list[i].count
349
-               this.tableList.push(list[i])
350 332
              }
351 333
              this.allPrice =  total_price
352 334
            }
@@ -360,12 +342,9 @@ export default {
360 342
       const order_id = this.$route.query.id;
361 343
       const warehouse_out_time = this.$route.query.warehouse_out_time;
362 344
       this.GetConfigInfo();
363
-      // this.GetOrderDetail(order_id);
364 345
       this.GetTotalCount(warehouse_out_time);
365 346
       this.GetOrderDetailOne(order_id)
366 347
       this.getList()
367
-      //获取所有入库单
368
-      this.getWarehouseOrderInfoList()
369 348
     }
370 349
 }
371 350
 </script>

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

@@ -64,8 +64,8 @@ export default {
64 64
         return{
65 65
           crumbs: [
66 66
             { path: false, name: '库存管理' },
67
-            { path: false, name: '自备药查询' },
68
-            { path: false, name: '自备药打印' },
67
+            { path: false, name: '库存查询' },
68
+            { path: false, name: '库存查询打印' },
69 69
           ],
70 70
           start_time:"",
71 71
           end_time:"",

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

@@ -103,19 +103,19 @@
103 103
         </el-table-column>
104 104
        <el-table-column label="入库数量" align="center">
105 105
          <template slot-scope="scope">
106
-          <span>{{getInCount(scope.row.good_id)}}</span>
106
+          <span>{{getInCount(scope.row.good_id)}}{{scope.row.packing_unit}}</span>
107 107
          </template>
108 108
        </el-table-column>
109 109
        <el-table-column label="出库数量" align="center">
110 110
          <template slot-scope="scope">
111
-           <span>{{getOutCount(scope.row.good_id) + getAutoCount(scope.row.good_id)}}</span>
111
+           <span>{{getOutCount(scope.row.good_id) + getAutoCount(scope.row.good_id)}}{{scope.row.packing_unit}}</span>
112 112
 
113 113
          </template>
114 114
        </el-table-column>
115 115
       
116 116
        <el-table-column label="剩余库存量" align="center">
117 117
          <template slot-scope="scope">
118
-           {{getInCount(scope.row.good_id)- getOutCount(scope.row.good_id) - getAutoCount(scope.row.good_id)}}
118
+           {{getInCount(scope.row.good_id)- getOutCount(scope.row.good_id) - getAutoCount(scope.row.good_id)}}{{scope.row.packing_unit}}
119 119
          </template>
120 120
        </el-table-column>
121 121
        <el-table-column label="操作" align="center" width="260px">
@@ -471,7 +471,7 @@ export default {
471 471
           }
472 472
        }
473 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})
474
+      this.$router.push({path:"/stock/in/stockflow?id="+val.good_id+"&good_name="+val.good_name+"&manufacturer="+manufacturer_name+"&specification_name="+specification_name+"&packing_unit="+val.packing_unit})
475 475
     },
476 476
     toClickOne(val){
477 477
        var manufacturer_name = ""
@@ -482,7 +482,7 @@ export default {
482 482
           }
483 483
        }
484 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})
485
+      this.$router.push({path:"/stock/in/stockbatchnumber?id="+val.good_id+"&good_name="+val.good_name+"&manufacturer="+manufacturer_name+"&specification_name="+specification_name+"&packing_unit="+val.packing_unit})
486 486
     },
487 487
     getStockDrugCount(){
488 488
         var params ={