XMLWAN 3 年之前
父節點
當前提交
8a80fbd2e8

+ 16 - 0
src/api/drug/drug_stock.js 查看文件

493
     params: params
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 查看文件

665
     params: params
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 查看文件

58
     </el-row>
58
     </el-row>
59
     <el-row style="display: flex;align-items: center;">
59
     <el-row style="display: flex;align-items: center;">
60
       <el-col :span="2">
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
       </el-col>
62
       </el-col>
65
       <el-col :span="3">
63
       <el-col :span="3">
66
         <el-button size="small" @click="BatchDelete" v-show="show"
64
         <el-button size="small" @click="BatchDelete" v-show="show"

+ 123 - 5
src/xt_pages/stock/drugs/drugBatchNumber.vue 查看文件

6
     <div class="app-container ">
6
     <div class="app-container ">
7
       <div class="cell clearfix">
7
       <div class="cell clearfix">
8
        药品名称:<span>{{this.$route.query.drug_name}}</span>&nbsp;
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
        规格:<span>{{this.$route.query.unit}}</span>&nbsp;
10
        规格:<span>{{this.$route.query.unit}}</span>&nbsp;
11
        厂家:<span>{{this.$route.query.manufacturer}}</span>&nbsp;
11
        厂家:<span>{{this.$route.query.manufacturer}}</span>&nbsp;
12
       </div>
12
       </div>
105
 <script>
105
 <script>
106
   import { uParseTime } from '@/utils/tools'
106
   import { uParseTime } from '@/utils/tools'
107
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
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
   import SettingDialog from './settingDialog/index'
109
   import SettingDialog from './settingDialog/index'
110
   import { getDictionaryDataConfig } from "@/utils/data";
110
   import { getDictionaryDataConfig } from "@/utils/data";
111
   export default {
111
   export default {
114
       var drugCategory = getDictionaryDataConfig('system','drug_category')
114
       var drugCategory = getDictionaryDataConfig('system','drug_category')
115
       this.drugCategory.push(...drugCategory)
115
       this.drugCategory.push(...drugCategory)
116
       this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
116
       this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
117
-       this.getlist()
117
+      this.getlist()
118
+      this.getDrugCountList()
118
     },
119
     },
119
     components: {
120
     components: {
120
       SettingDialog,
121
       SettingDialog,
150
         ],
151
         ],
151
         drugTypeList:[],
152
         drugTypeList:[],
152
         tableList:[],
153
         tableList:[],
153
-        manufacturerList:[]
154
+        manufacturerList:[],
155
+        countList:[],
156
+        outCountList:[],
157
+        autoCountList:[],
158
+        minCount:[],
159
+        drugOutList:[],
154
       }
160
       }
155
     },
161
     },
156
     methods:{
162
     methods:{
196
     endTimeChange(val){
202
     endTimeChange(val){
197
       this.end_time = val
203
       this.end_time = val
198
       this.getlist()
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
 </script>
320
 </script>

+ 177 - 43
src/xt_pages/stock/drugs/drugQueryPrint.vue 查看文件

15
             <tbody>
15
             <tbody>
16
             <tr>
16
             <tr>
17
               <td style="line-height: 50px" width="50">序号</td>
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
               <td style="line-height: 50px" width="80">入库数量</td>
23
               <td style="line-height: 50px" width="80">入库数量</td>
22
               <td style="line-height: 50px" width="80">出库数量</td>
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
             </tr>
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
               <td style="line-height: 50px">&nbsp;
29
               <td style="line-height: 50px">&nbsp;
32
                 {{index+1}}
30
                 {{index+1}}
33
               </td>
31
               </td>
34
               <td style="line-height: 50px">
32
               <td style="line-height: 50px">
35
-                <span> {{ item.drug_name }}</span>
33
+                <span> {{getDrugType(item.drug_type)}}</span>
36
               </td>
34
               </td>
37
               <td style="line-height: 50px">
35
               <td style="line-height: 50px">
38
-                   <span>{{ item.drug_spec }}</span>
36
+                <span> {{ item.drug_name }}</span>
39
               </td>
37
               </td>
40
               <td style="line-height: 50px">
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
               </td>
40
               </td>
43
-            
41
+             
44
               <td style="line-height: 50px">
42
               <td style="line-height: 50px">
45
-                  <span>{{ stockInCount(item) }}</span>
43
+                  <span>{{item.last_price }}</span>
46
               </td>
44
               </td>
47
               <td style="line-height: 50px">
45
               <td style="line-height: 50px">
48
-                  <span>{{ stockOutCount(item) }}</span>
46
+                <span> {{getManufacturerList(item.manufacturer)}}</span>
49
               </td>
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
               <td>
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
              </td> 
52
              </td> 
55
-              <td style="line-height:50px">
56
-                  {{item.last_price}}
57
-              </td>
58
             </tr>
53
             </tr>
59
             </tbody>
54
             </tbody>
60
           </table>
55
           </table>
72
   import { jsGetAge, uParseTime } from '@/utils/tools'
67
   import { jsGetAge, uParseTime } from '@/utils/tools'
73
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
68
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
74
   import print from 'print-js'
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
   import { getDictionaryDataConfig } from "@/utils/data";
71
   import { getDictionaryDataConfig } from "@/utils/data";
77
   import {getBaseDrugLibList} from '@/api/data'
72
   import {getBaseDrugLibList} from '@/api/data'
78
   export default {
73
   export default {
113
         is_use:"",
108
         is_use:"",
114
         is_charge:"",
109
         is_charge:"",
115
         is_inject:"",
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
     methods: {
122
     methods: {
230
       getDictionaryDataConfig(module, filed_name) {
234
       getDictionaryDataConfig(module, filed_name) {
231
         return getDictionaryDataConfig(module, filed_name)
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
     created() {
388
     created() {
258
-      this.GetAllDrugStockQueryList()
389
+      // this.GetAllDrugStockQueryList()
259
       var drugCategory = getDictionaryDataConfig('system','drug_category')
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 查看文件

6
     <div class="app-container ">
6
     <div class="app-container ">
7
       <div class="cell clearfix">
7
       <div class="cell clearfix">
8
        药品名称:<span>{{this.$route.query.drug_name}}</span>&nbsp;
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
        规格:<span>{{this.$route.query.unit}}</span>&nbsp;
10
        规格:<span>{{this.$route.query.unit}}</span>&nbsp;
11
        厂家:<span>{{this.$route.query.manufacturer}}</span>&nbsp;
11
        厂家:<span>{{this.$route.query.manufacturer}}</span>&nbsp;
12
 
12
 
64
         </el-table-column>
64
         </el-table-column>
65
         <el-table-column prop="drug_type" label="出入库方式" width="180" align="center">
65
         <el-table-column prop="drug_type" label="出入库方式" width="180" align="center">
66
            <template slot-scope="scope">
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
            </template>
70
            </template>
70
         </el-table-column>
71
         </el-table-column>
71
         <el-table-column prop="drug_name" label="出/入库单据编码" align="center">
72
         <el-table-column prop="drug_name" label="出/入库单据编码" align="center">
72
            <template slot-scope="scope">
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
              <span v-if="scope.row.drug_way == 4">{{scope.row.warehousing_order}}</span>
75
              <span v-if="scope.row.drug_way == 4">{{scope.row.warehousing_order}}</span>
75
             
76
             
76
            </template>
77
            </template>
82
         </el-table-column>
83
         </el-table-column>
83
          <el-table-column prop="drug_name" label="出入库数量" align="center">
84
          <el-table-column prop="drug_name" label="出入库数量" align="center">
84
            <template slot-scope="scope">
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
            </template>
88
            </template>
88
         </el-table-column>
89
         </el-table-column>
89
          <el-table-column prop="drug_name" label="剩余库存量" align="center">
90
          <el-table-column prop="drug_name" label="剩余库存量" align="center">
90
            <template slot-scope="scope">
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
              <span></span>
94
              <span></span>
95
            </template>
95
            </template>
96
         </el-table-column>
96
         </el-table-column>
97
         <el-table-column prop="drug_name" label="进/出货单价" align="center">
97
         <el-table-column prop="drug_name" label="进/出货单价" align="center">
98
            <template slot-scope="scope">
98
            <template slot-scope="scope">
99
              <span v-if="scope.row.drug_way == 4"> {{scope.row.price}}</span>
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
            </template>
101
            </template>
102
         </el-table-column>
102
         </el-table-column>
103
          <el-table-column prop="drug_name" label="有效期" align="center">
103
          <el-table-column prop="drug_name" label="有效期" align="center">
104
            <template slot-scope="scope">
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
            </template>
107
            </template>
108
         </el-table-column>
108
         </el-table-column>
109
         <el-table-column prop="drug_name" label="批号" align="center">
109
         <el-table-column prop="drug_name" label="批号" align="center">
110
            <template slot-scope="scope">
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
              <span v-if="scope.row.drug_way == 4">{{scope.row.number}}</span>
112
              <span v-if="scope.row.drug_way == 4">{{scope.row.number}}</span>
113
            </template>
113
            </template>
114
         </el-table-column>
114
         </el-table-column>
115
         <el-table-column prop="drug_name" label="生产商" align="center">
115
         <el-table-column prop="drug_name" label="生产商" align="center">
116
            <template slot-scope="scope">
116
            <template slot-scope="scope">
117
              <span v-if="scope.row.drug_way == 4"> {{getManufacturer(scope.row.manufacturer)}}</span>
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
            </template>
119
            </template>
120
         </el-table-column>
120
         </el-table-column>
121
        </el-table>
121
        </el-table>
198
           {id:0,name:"全部"},
198
           {id:0,name:"全部"},
199
           {id:1,name:"手动出库"},
199
           {id:1,name:"手动出库"},
200
           {id:2,name:"自动出库"},
200
           {id:2,name:"自动出库"},
201
-          {id:3,name:"手动入库"},
201
+          {id:3,name:"采购入库"},
202
 
202
 
203
         ],
203
         ],
204
         outList:[],
204
         outList:[],
205
         countList:[],
205
         countList:[],
206
         outCountList:[],
206
         outCountList:[],
207
         autoCountList:[],
207
         autoCountList:[],
208
+        drugOutList:[],
209
+        total:0,
208
       }
210
       }
209
     },
211
     },
210
     methods:{
212
     methods:{
226
                list[i].drug_way = 4
228
                list[i].drug_way = 4
227
                this.tableList.push(list[i])
229
                this.tableList.push(list[i])
228
             }
230
             }
229
-           
230
             var total = response.data.data.total
231
             var total = response.data.data.total
231
             this.total = total
232
             this.total = total
232
             var manufacturerList = response.data.data.manufacturerList
233
             var manufacturerList = response.data.data.manufacturerList
245
              stock_type:this.stock_type,  
246
              stock_type:this.stock_type,  
246
            }
247
            }
247
           console.log("出库数据",params)
248
           console.log("出库数据",params)
249
+
248
          getOutDrugStockFlow(params).then(response=>{
250
          getOutDrugStockFlow(params).then(response=>{
249
             if(response.data.state == 1){
251
             if(response.data.state == 1){
250
                var outList = response.data.data.outList
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
                   outList[i].drug_way = 2
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
        handleSizeChange(val) {
269
        handleSizeChange(val) {
260
         this.limit = val
270
         this.limit = val
261
         this.getlist()
271
         this.getlist()
272
+        this.getOutList()
262
       },
273
       },
263
       handleCurrentChange(val) {
274
       handleCurrentChange(val) {
264
         this.page = val
275
         this.page = val
265
         this.getlist()
276
         this.getlist()
277
+        this.getOutList()
266
       },
278
       },
267
         
279
         
268
     startTimeChange: function(val) {
280
     startTimeChange: function(val) {
282
         this.end_time = "";
294
         this.end_time = "";
283
       } else {
295
       } else {
284
         this.getlist();
296
         this.getlist();
297
+        this.getOutList()
285
       }
298
       }
286
      },
299
      },
287
      getManufacturer(id){
300
      getManufacturer(id){
320
             var aucountlist = response.data.data.auCountList
333
             var aucountlist = response.data.data.auCountList
321
             console.log("自动数据",aucountlist)
334
             console.log("自动数据",aucountlist)
322
             this.autoCountList = aucountlist
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
         return (new Date(time)).getTime() / 1000
379
         return (new Date(time)).getTime() / 1000
356
       },
380
       },
357
       changeDrug(val){
381
       changeDrug(val){
358
-        
359
-        var arr = []
382
+       this.tableList = []
383
+        if(val == 0){
384
+         this.getlist()
385
+         this.getOutList()
386
+        }
360
         if(val == 3){
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
 </script>
450
 </script>

+ 9 - 20
src/xt_pages/stock/drugs/drugStockInOrder.vue 查看文件

192
         border
192
         border
193
         highlight-current-row
193
         highlight-current-row
194
         v-loading="Warehouse.loading"
194
         v-loading="Warehouse.loading"
195
-        ref="multipleTable"
195
+        ref="multipleTableOne"
196
         @selection-change="select"
196
         @selection-change="select"
197
         :row-style="{ color: '#303133' }"
197
         :row-style="{ color: '#303133' }"
198
         :header-cell-style="{
198
         :header-cell-style="{
359
       </span>
359
       </span>
360
     </el-dialog>
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
   </div>
363
   </div>
380
 </template>
364
 </template>
717
       }
701
       }
718
     },
702
     },
719
     select(selection) {
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
       this.selectedTableData = selection;
711
       this.selectedTableData = selection;
723
     },
712
     },
724
     batchDelete() {
713
     batchDelete() {
808
         return getDictionaryDataConfig(module, filed_name)
797
         return getDictionaryDataConfig(module, filed_name)
809
       },
798
       },
810
     drugPrint(){
799
     drugPrint(){
811
-      if(this.order_id == 0){
800
+      if(this.order_id == ""){
812
          this.$message.error("请选择入库单")
801
          this.$message.error("请选择入库单")
813
       }else{
802
       }else{
814
         this.$router.push({path:"/stock/drugStockInOrderDetailPrint?id="+this.order_id})
803
         this.$router.push({path:"/stock/drugStockInOrderDetailPrint?id="+this.order_id})

+ 56 - 26
src/xt_pages/stock/drugs/drugStockInOrderDetailPrint.vue 查看文件

7
     </div>
7
     </div>
8
     <div class="app-container ">
8
     <div class="app-container ">
9
       <div id="dialysis-print-box">
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
           <div style="font-size:22px;font-weight:bold;text-align:center;">{{ orgName }}</div>
11
           <div style="font-size:22px;font-weight:bold;text-align:center;">{{ orgName }}</div>
12
           <div class="order-title" style="font-size:18px;padding-top:0;">药品入库登记表</div>
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
           <div style="float: right;margin-bottom: 1px;">{{getDateTwo()}}</div>
15
           <div style="float: right;margin-bottom: 1px;">{{getDateTwo()}}</div>
16
 
16
 
17
           <table class="print-table" border="1">
17
           <table class="print-table" border="1">
32
               <td style="line-height:18px;" width="60">验收<br>结论</td>
32
               <td style="line-height:18px;" width="60">验收<br>结论</td>
33
             </tr>
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
               <td style="line-height: 18px">
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
               </td>
38
               </td>
39
               <td style="line-height: 18px">{{ item.remark }}</td>
39
               <td style="line-height: 18px">{{ item.remark }}</td>
40
               <td style="line-height: 18px">
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
               </td>
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
               <td style="line-height: 18px">
44
               <td style="line-height: 18px">
46
-                <span>{{item.drug.max_unit}}</span>
45
+                <span>{{item.max_unit}}</span>
47
               </td>
46
               </td>
48
               <td style="line-height:18px">
47
               <td style="line-height:18px">
49
                   {{item.price}}
48
                   {{item.price}}
63
             </tr>
62
             </tr>
64
             <tr>
63
             <tr>
65
               <td>合计</td>
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
             </tr>
66
             </tr>
68
             </tbody>
67
             </tbody>
69
           </table>
68
           </table>
72
             <div style="width:50px;">审批:</div><div style="width:100px;"></div>
71
             <div style="width:50px;">审批:</div><div style="width:100px;"></div>
73
             <div style="width:50px;">会计:</div><div style="width:100px;"><span v-if='orgId == 10024'>徐立琼</span></div>
72
             <div style="width:50px;">会计:</div><div style="width:100px;"><span v-if='orgId == 10024'>徐立琼</span></div>
74
             <div style="width:50px;">审核:</div><div style="width:100px;"><span v-if='orgId == 10024'>徐立琼</span></div>
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
           </div>
75
           </div>
77
           <div style="display:flex;margin-top:1px;float:right;" v-if="orgId !=10024">
76
           <div style="display:flex;margin-top:1px;float:right;" v-if="orgId !=10024">
78
             <div style="width:50px;">审批:</div><div style="width:100px;"></div>
77
             <div style="width:50px;">审批:</div><div style="width:100px;"></div>
79
             <div style="width:80px;">药材主任:</div><div style="width:100px;"></div>
78
             <div style="width:80px;">药材主任:</div><div style="width:100px;"></div>
80
             <div style="width:50px;">会计:</div><div style="width:100px;"></div>
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
           </div>
81
           </div>
83
         </div>
82
         </div>
84
 
83
 
95
   import { jsGetAge, uParseTime } from '@/utils/tools'
94
   import { jsGetAge, uParseTime } from '@/utils/tools'
96
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
95
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
97
   import print from 'print-js'
96
   import print from 'print-js'
98
-  import {getDrugWarehouseInfoList} from "@/api/drug/drug_stock";
97
+  import {getDrugWarehouseInfoList,getDrugOrderInPrint} from "@/api/drug/drug_stock";
99
   import {getBaseDrugLibList} from '@/api/data'
98
   import {getBaseDrugLibList} from '@/api/data'
100
   import { fetchAllAdminUsers } from "@/api/doctor";
99
   import { fetchAllAdminUsers } from "@/api/doctor";
101
   export default {
100
   export default {
140
         keywords:"",
139
         keywords:"",
141
         orgName:'',
140
         orgName:'',
142
         orgId:'',
141
         orgId:'',
143
-        adminUserOptions:[]
142
+        adminUserOptions:[],
143
+        tableList:[],
144
+        manufacturerList:[],
145
+        warehouseList:[]
144
       }
146
       }
145
     },
147
     },
146
     methods: {
148
     methods: {
261
         }
263
         }
262
         return name
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
       getManufacturer(id){
267
       getManufacturer(id){
274
         let name = ""
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
         return name
274
         return name
327
         }
321
         }
328
         return name;
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
     created() {
361
     created() {
332
       this.orgName = this.$store.getters.xt_user.org.org_name;
362
       this.orgName = this.$store.getters.xt_user.org.org_name;
334
       this.fetchAllAdminUsers()
364
       this.fetchAllAdminUsers()
335
       this.GetConfigInfo()
365
       this.GetConfigInfo()
336
       const order_id = this.$route.query.id;
366
       const order_id = this.$route.query.id;
337
-      this.GetOrderDetail(order_id);
338
       this.getList()
367
       this.getList()
368
+      this.getDrugOrderInPrint(order_id)
339
 
369
 
340
     }
370
     }
341
 
371
 

+ 7 - 2
src/xt_pages/stock/drugs/drugStockOutOrder.vue 查看文件

200
           style="width: 100%"
200
           style="width: 100%"
201
           border
201
           border
202
           highlight-current-row
202
           highlight-current-row
203
-          ref="multipleTable"
203
+          ref="multipleTableOne"
204
           @selection-change="select"
204
           @selection-change="select"
205
           :row-style="{ color: '#303133' }"
205
           :row-style="{ color: '#303133' }"
206
           :header-cell-style="{
206
           :header-cell-style="{
654
       }
654
       }
655
     },
655
     },
656
     select(selection) {
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
       this.selectedTableData = selection;
663
       this.selectedTableData = selection;
659
     },
664
     },
660
     batchDelete() {
665
     batchDelete() {

+ 56 - 15
src/xt_pages/stock/drugs/drugStockOutOrderDetailPrint.vue 查看文件

7
     </div>
7
     </div>
8
     <div class="app-container ">
8
     <div class="app-container ">
9
       <div id="dialysis-print-box">
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
          <div class="order-yy-name" style="font-size:22px;font-weight:bold;letter-spacing:0px;">{{orgName}}</div>
11
          <div class="order-yy-name" style="font-size:22px;font-weight:bold;letter-spacing:0px;">{{orgName}}</div>
12
           <div class="order-title" style="font-weight:500;font-size:18px;">药品出库登记表</div>
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
           <div style="float: right;margin-bottom: 1px;">{{getDateTwo()}}</div>
15
           <div style="float: right;margin-bottom: 1px;">{{getDateTwo()}}</div>
16
 
16
 
17
           <table class="print-table" border="1">
17
           <table class="print-table" border="1">
28
               <td style="line-height: 50px" width="">有效日期</td>
28
               <td style="line-height: 50px" width="">有效日期</td>
29
             </tr>
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
               <td style="line-height: 50px">
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
               </td>
34
               </td>
35
               <td style="line-height: 50px">
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
               </td>
37
               </td>
38
               <td style="line-height: 50px">
38
               <td style="line-height: 50px">
39
-                <span>{{item.drug.max_unit}}</span>
39
+                <span>{{item.max_unit}}</span>
40
               </td>
40
               </td>
41
 
41
 
42
               <td style="line-height: 50px">
42
               <td style="line-height: 50px">
43
                   {{item.count}}
43
                   {{item.count}}
44
               </td>
44
               </td>
45
               <td style="line-height:50px">
45
               <td style="line-height:50px">
46
-                  {{item.drug.last_price}}
46
+                  {{item.last_price}}
47
               </td>
47
               </td>
48
              <td  style="line-height:50px">
48
              <td  style="line-height:50px">
49
-                {{(item.count * item.drug.last_price).toFixed(2)}}
49
+                {{(item.count * item.last_price).toFixed(2)}}
50
              </td>
50
              </td>
51
              <td>{{getNumber(item.drug_id)}}</td>
51
              <td>{{getNumber(item.drug_id)}}</td>
52
              <td>{{getProductDate(item.drug_id)}}</td>
52
              <td>{{getProductDate(item.drug_id)}}</td>
55
              <tr>
55
              <tr>
56
                <td style="line-height:50px">合计</td>
56
                <td style="line-height:50px">合计</td>
57
                <td colspan="7"></td>
57
                <td colspan="7"></td>
58
-               <td>{{allPrice.toFixed(2)}}</td>
58
+               <td>{{getAllPrince(it.id).toFixed(2)}}</td>
59
              </tr>
59
              </tr>
60
             </tbody>
60
             </tbody>
61
           </table>
61
           </table>
91
   import { jsGetAge, uParseTime } from '@/utils/tools'
91
   import { jsGetAge, uParseTime } from '@/utils/tools'
92
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
92
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
93
   import print from 'print-js'
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
   import {getBaseDrugLibList} from '@/api/data'
95
   import {getBaseDrugLibList} from '@/api/data'
96
   export default {
96
   export default {
97
     name: 'dialysisPrintOrder',
97
     name: 'dialysisPrintOrder',
130
         keywords:"",
130
         keywords:"",
131
         orgId:'',
131
         orgId:'',
132
         orgName:"",
132
         orgName:"",
133
-        drugOrderList:[]
133
+        drugOrderList:[],
134
+        manufactureList:[],
135
+        tableList:[],
136
+        loading:false,
137
+        warehouseList:[]
134
       }
138
       }
135
     },
139
     },
136
     methods: {
140
     methods: {
304
           return uParseTime(val, '{y}-{m}-{d}')
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
     created() {
351
     created() {
309
       this.orgName = this.$store.getters.xt_user.org.org_name;
352
       this.orgName = this.$store.getters.xt_user.org.org_name;
310
       const order_id = this.$route.query.id;
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 查看文件

113
         </el-table-column>
113
         </el-table-column>
114
         <el-table-column prop="drug_name" label="入库数量" align="center">
114
         <el-table-column prop="drug_name" label="入库数量" align="center">
115
            <template slot-scope="scope">
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
            </template>
118
            </template>
119
         </el-table-column>
119
         </el-table-column>
120
         <el-table-column prop="drug_name" label="出库数量" align="center">
120
         <el-table-column prop="drug_name" label="出库数量" align="center">
121
            <template slot-scope="scope">
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
            </template>
124
            </template>
125
         </el-table-column>
125
         </el-table-column>
126
         <el-table-column prop="drug_name" label="剩余库存量" align="center">
126
         <el-table-column prop="drug_name" label="剩余库存量" align="center">
127
            <template slot-scope="scope">
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
            </template>
130
            </template>
131
         </el-table-column>
131
         </el-table-column>
132
         <el-table-column prop="drug_name" label="操作" align="center" width="200px">
132
         <el-table-column prop="drug_name" label="操作" align="center" width="200px">
227
         keyword:"",
227
         keyword:"",
228
         drug_type:0,
228
         drug_type:0,
229
         minCount:[],
229
         minCount:[],
230
-        drugOutList:[]
230
+        drugOutList:[],
231
+        
231
       }
232
       }
232
     },
233
     },
233
     methods: {
234
     methods: {
342
       },
343
       },
343
       handleSizeChange(val) {
344
       handleSizeChange(val) {
344
         this.limit = val
345
         this.limit = val
345
-        // this.GetAllDrugStockQueryList()
346
+     
346
         this.getlist()
347
         this.getlist()
347
       },
348
       },
348
       handleCurrentChange(val) {
349
       handleCurrentChange(val) {
349
         this.page = val
350
         this.page = val
350
-        // this.GetAllDrugStockQueryList()
351
+       
351
         this.getlist()
352
         this.getlist()
352
       },
353
       },
353
       calculate: function(val) {
354
       calculate: function(val) {
361
         this.$message.error("开始时间不能大于结束时间");
362
         this.$message.error("开始时间不能大于结束时间");
362
         this.start_time = "";
363
         this.start_time = "";
363
       } else {
364
       } else {
364
-        // this.GetAllDrugStockQueryList();
365
+     
365
         this.getlist()
366
         this.getlist()
366
       }
367
       }
367
     },
368
     },
421
         this.$refs.dialog.show()
422
         this.$refs.dialog.show()
422
       },
423
       },
423
        exportStock(){
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
          import('@/vendor/Export2Excel').then(excel => {
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
          excel.export_json_to_excel({
443
          excel.export_json_to_excel({
433
            header: tHeader,
444
            header: tHeader,
434
            data,
445
            data,
452
       printOrder(){
463
       printOrder(){
453
         this.$router.push({
464
         this.$router.push({
454
           name: "drugQueryPrint",
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
          }
520
          }
510
         }
521
         }
511
         var unit =  val.dose + val.dose_unit +"*"+val.min_number+val.min_unit+"/"+val.max_unit
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
       handleBatch(val){
525
       handleBatch(val){
515
         var manufacturer_name = ""
526
         var manufacturer_name = ""
519
          }
530
          }
520
         }
531
         }
521
         var unit =  val.dose + val.dose_unit +"*"+val.min_number+val.min_unit+"/"+val.max_unit
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
       getDrugCountList(){
535
       getDrugCountList(){
525
          var params = {
536
          var params = {
549
             }
560
             }
550
             console.log("info2222222",info)
561
             console.log("info2222222",info)
551
             this.drugOutList = info
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 查看文件

63
         </el-table-column>
63
         </el-table-column>
64
         <el-table-column prop="drug_name" label="入库单据编码" align="center">
64
         <el-table-column prop="drug_name" label="入库单据编码" align="center">
65
            <template slot-scope="scope" >
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
            </template>
67
            </template>
69
         </el-table-column>
68
         </el-table-column>
70
         <el-table-column prop="drug_name" label="操作日期" align="center">
69
         <el-table-column prop="drug_name" label="操作日期" align="center">
74
         </el-table-column>
73
         </el-table-column>
75
          <el-table-column prop="drug_name" label="有效期" align="center">
74
          <el-table-column prop="drug_name" label="有效期" align="center">
76
            <template slot-scope="scope">
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
            </template>
78
            </template>
80
         </el-table-column>
79
         </el-table-column>
81
          <el-table-column prop="drug_name" label="批号" align="center">
80
          <el-table-column prop="drug_name" label="批号" align="center">
82
            <template slot-scope="scope" >
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
            </template>
83
            </template>
85
         </el-table-column>
84
         </el-table-column>
86
         <el-table-column prop="drug_name" label="入库数量" align="center">
85
         <el-table-column prop="drug_name" label="入库数量" align="center">
87
            <template slot-scope="scope">
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
            </template>
89
            </template>
91
         </el-table-column>
90
         </el-table-column>
92
          <el-table-column prop="drug_name" label="进货价" align="center">
91
          <el-table-column prop="drug_name" label="进货价" align="center">
93
            <template slot-scope="scope">
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
            </template>
94
            </template>
97
         </el-table-column>
95
         </el-table-column>
98
        </el-table>
96
        </el-table>
122
     created() {
120
     created() {
123
       this.getlist()
121
       this.getlist()
124
       this.getStockDrugCount()
122
       this.getStockDrugCount()
123
+      this.packing_unit = this.$route.query.packing_unit
125
     },
124
     },
126
     components: {
125
     components: {
127
       BreadCrumb
126
       BreadCrumb
168
         outCountList:[],
167
         outCountList:[],
169
         autoCountList:[],
168
         autoCountList:[],
170
         keywords:"",
169
         keywords:"",
170
+        packing_unit:""
171
       }
171
       }
172
     },
172
     },
173
     methods:{
173
     methods:{
232
          if(response.data.state == 1){
232
          if(response.data.state == 1){
233
            var list = response.data.data.list
233
            var list = response.data.data.list
234
            console.log("入库数据",list)
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
            this.tableList = list
238
            this.tableList = list
239
            var total = response.data.data.total
239
            var total = response.data.data.total
240
            this.total = total
240
            this.total = total

+ 8 - 6
src/xt_pages/stock/stockFlow.vue 查看文件

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

+ 26 - 31
src/xt_pages/stock/stockInOrder.vue 查看文件

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

+ 23 - 14
src/xt_pages/stock/stockInOrderDetailPrint.vue 查看文件

10
         </div>
10
         </div>
11
         <div class="app-container" style="background-color: white;">
11
         <div class="app-container" style="background-color: white;">
12
             <div id="print_content">
12
             <div id="print_content">
13
-                <div class="print_main_content">
13
+                <div class="print_main_content" v-for="(it,index) in warehousingInfo" :key="index">
14
                     <div class="order_title_panl">
14
                     <div class="order_title_panl">
15
                         <div style="font-size:22px;font-weight:bold;">{{ orgName }}</div>
15
                         <div style="font-size:22px;font-weight:bold;">{{ orgName }}</div>
16
                         <span style="font-weight:500;font-size:18px;">耗材入库登记单</span>
16
                         <span style="font-weight:500;font-size:18px;">耗材入库登记单</span>
17
                     </div>
17
                     </div>
18
                     <div style="display:flex;justify-content: space-between;">
18
                     <div style="display:flex;justify-content: space-between;">
19
                       <div style="text-align:left;margin-bottom:1px;font-size: 18px;">
19
                       <div style="text-align:left;margin-bottom:1px;font-size: 18px;">
20
-                        单据编号:{{WarehouseInfo.warehouse.warehousing_order}}
20
+                        单据编号:{{it.warehousing_order}}
21
                       </div>
21
                       </div>
22
                       <div style="text-align:right;margin-bottom:1px;font-size: 18px;">
22
                       <div style="text-align:right;margin-bottom:1px;font-size: 18px;">
23
                         打印时间:{{time_now}}
23
                         打印时间:{{time_now}}
44
                                 </tr>
44
                                 </tr>
45
                             </thead>
45
                             </thead>
46
                             <tbody>
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
                                     <td style="line-height:18px;"><span v-if="item.good_id != 0">{{getTypeNameOne(item.good_id)}}</span></td>
48
                                     <td style="line-height:18px;"><span v-if="item.good_id != 0">{{getTypeNameOne(item.good_id)}}</span></td>
49
                                     <td style="line-height:18px;">{{ item.remark }}</td>
49
                                     <td style="line-height:18px;">{{ item.remark }}</td>
50
                                     <td style="line-height:18px;"><span v-if="item.good_id != 0">{{getSpecificationName(item.good_id)}}</span></td>
50
                                     <td style="line-height:18px;"><span v-if="item.good_id != 0">{{getSpecificationName(item.good_id)}}</span></td>
71
                             <div style="width:80px;" v-if='orgId != 10024'>药材主任:</div><div style="width:100px;"></div>
71
                             <div style="width:80px;" v-if='orgId != 10024'>药材主任:</div><div style="width:100px;"></div>
72
                             <div style="width:50px;">会计:</div><div style="width:100px;"><span v-if='orgId == 10024'>徐立琼</span></div>
72
                             <div style="width:50px;">会计:</div><div style="width:100px;"><span v-if='orgId == 10024'>徐立琼</span></div>
73
                             <div style="width:50px;">审核:</div><div style="width:100px;"><span v-if='orgId == 10024'>徐立琼</span></div>
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
                        </div>
75
                        </div>
76
                     </div>
76
                     </div>
77
                 </div>
77
                 </div>
131
             list:[],
131
             list:[],
132
             orgName:'',
132
             orgName:'',
133
             orgId:'',
133
             orgId:'',
134
-            adminUserOptions:[]
134
+            adminUserOptions:[],
135
+            warehousingInfo:[]
135
         }
136
         }
136
     },
137
     },
137
     methods:{
138
     methods:{
184
         },
185
         },
185
        
186
        
186
      GetOrderDetail: function(order_id) {
187
      GetOrderDetail: function(order_id) {
188
+
187
         const params = {
189
         const params = {
188
             id: order_id
190
             id: order_id
189
         };
191
         };
192
             this.$message.error(response.data.msg);
194
             this.$message.error(response.data.msg);
193
             return false;
195
             return false;
194
             } else {
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
             var total_price = 0
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
             this.allPrice = total_price
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
       this.orgName = this.$store.getters.xt_user.org.org_name;
345
       this.orgName = this.$store.getters.xt_user.org.org_name;
338
       this.orgId = this.$store.getters.xt_user.org.id;
346
       this.orgId = this.$store.getters.xt_user.org.id;
339
       const order_id = this.$route.query.id;
347
       const order_id = this.$route.query.id;
348
+
340
       this.fetchAllAdminUsers()
349
       this.fetchAllAdminUsers()
341
       this.GetConfigInfo();
350
       this.GetConfigInfo();
342
       this.GetOrderDetail(order_id);
351
       this.GetOrderDetail(order_id);

+ 87 - 70
src/xt_pages/stock/stockOutOrder.vue 查看文件

71
         >
71
         >
72
         <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
72
         <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
73
         <el-button size="small" type="primary" @click="toPrint">打印</el-button>
73
         <el-button size="small" type="primary" @click="toPrint">打印</el-button>
74
+        <el-button size="small" type="primary" @click="toExport">导出</el-button>
74
       </div>
75
       </div>
75
 
76
 
76
       <el-table
77
       <el-table
112
         <el-table-column label="操作" align="center" width="300px">
113
         <el-table-column label="操作" align="center" width="300px">
113
           <template slot-scope="scope">
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
             <el-tooltip
116
             <el-tooltip
131
               class="item"
117
               class="item"
132
               effect="dark"
118
               effect="dark"
178
             style="width: 100%"
164
             style="width: 100%"
179
             border
165
             border
180
             highlight-current-row
166
             highlight-current-row
181
-            ref="multipleTable"
167
+            ref="multipleTableOne"
182
             @selection-change="select"
168
             @selection-change="select"
183
             :row-style="{ color: '#303133' }"
169
             :row-style="{ color: '#303133' }"
184
             :header-cell-style="{
170
             :header-cell-style="{
380
         <span style="font-size: 18px;color: #606266">商品使用明细</span>
366
         <span style="font-size: 18px;color: #606266">商品使用明细</span>
381
       </div>
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
        <el-row :gutter="12" style="margin-top: 10px">
369
        <el-row :gutter="12" style="margin-top: 10px">
389
         <el-table :data="userList" :class="signAndWeighBoxPatients" style="width: 80%"
370
         <el-table :data="userList" :class="signAndWeighBoxPatients" style="width: 80%"
390
                   border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
371
                   border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
669
   GetAllGoodInfoByID,
650
   GetAllGoodInfoByID,
670
   editWarehouseoutInfo,
651
   editWarehouseoutInfo,
671
   getOrderDetailByOrderId,
652
   getOrderDetailByOrderId,
672
-  getOrderDetailById
653
+  getOrderDetailById,
654
+  getOutExportList
673
 } from "@/api/stock";
655
 } from "@/api/stock";
674
 import BreadCrumb from "../components/bread-crumb";
656
 import BreadCrumb from "../components/bread-crumb";
675
 import StockInDialog from './Dialog/stockInDialog'
657
 import StockInDialog from './Dialog/stockInDialog'
701
       (nowDay < 10 ? "0" + nowDay : nowDay);
683
       (nowDay < 10 ? "0" + nowDay : nowDay);
702
     this.GetConfigInfo();
684
     this.GetConfigInfo();
703
     this.GetWarehouseOut();
685
     this.GetWarehouseOut();
704
-   
705
     this.fetchAllAdminUsers();
686
     this.fetchAllAdminUsers();
706
     
687
     
688
+    
707
   },
689
   },
708
   data() {
690
   data() {
709
      var checkGoodId = (rule, value, callback) => {
691
      var checkGoodId = (rule, value, callback) => {
787
       userList:[],
769
       userList:[],
788
       editdialogVisibleTwo:false,
770
       editdialogVisibleTwo:false,
789
       editdialogVisibleThree:false,
771
       editdialogVisibleThree:false,
790
-      order_id:0,
772
+      order_id:"",
791
       warehouse_out_time:"",
773
       warehouse_out_time:"",
774
+      exportList:[]
792
     };
775
     };
793
   },
776
   },
794
   methods: {
777
   methods: {
887
     handleSizeChange(val) {
870
     handleSizeChange(val) {
888
       this.limit = val;
871
       this.limit = val;
889
       this.GetWarehouseOut();
872
       this.GetWarehouseOut();
873
+      
890
     },
874
     },
891
     handleCurrentChange(val) {
875
     handleCurrentChange(val) {
892
       this.page = val;
876
       this.page = val;
893
       this.GetWarehouseOut();
877
       this.GetWarehouseOut();
878
+     
894
     },
879
     },
895
     startTimeChange(val) {
880
     startTimeChange(val) {
896
       var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
881
       var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
899
         this.start_time = "";
884
         this.start_time = "";
900
       } else {
885
       } else {
901
         this.GetWarehouseOut();
886
         this.GetWarehouseOut();
887
+        this.getlist()
902
       }
888
       }
903
      
889
      
904
     },
890
     },
909
         this.end_time = "";
895
         this.end_time = "";
910
       } else {
896
       } else {
911
         this.GetWarehouseOut();
897
         this.GetWarehouseOut();
898
+        this.getlist()
912
       }
899
       }
913
     },
900
     },
914
     getTimestamp(time) {
901
     getTimestamp(time) {
930
           this.goodType = response.data.data.goodType
917
           this.goodType = response.data.data.goodType
931
           this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
918
           this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
932
           this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
919
           this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
920
+          this.getlist()
933
         }
921
         }
934
       });
922
       });
935
     },
923
     },
1001
       }
989
       }
1002
     },
990
     },
1003
     select(selection) {
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
       this.warehouse_out_time = selection[0].warehouse_out_time
998
       this.warehouse_out_time = selection[0].warehouse_out_time
1007
       this.selectedTableData = selection;
999
       this.selectedTableData = selection;
1000
+      this.getlist()
1008
     },
1001
     },
1009
     batchDelete() {
1002
     batchDelete() {
1010
       if (this.selectedTableData.length <= 0) {
1003
       if (this.selectedTableData.length <= 0) {
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
     handleSearch(val){
1051
     handleSearch(val){
1067
       this.tableList = []
1052
       this.tableList = []
1071
       this.GetTotalCount(val.warehouse_out_time)
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
         const params = {
1060
         const params = {
1098
           'id': id
1061
           'id': id
1099
         }
1062
         }
1100
         getOrderDetailByOrderId(params).then(response=>{
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
       getTypeName: function(id) {
1075
       getTypeName: function(id) {
1113
         let name = ''
1076
         let name = ''
1527
          })
1490
          })
1528
       },
1491
       },
1529
       toPrint(){
1492
       toPrint(){
1530
-        if(this.order_id == 0){
1493
+        if(this.order_id == ""){
1531
           this.$message.error("请选择出库单")
1494
           this.$message.error("请选择出库单")
1532
         }else{
1495
         }else{
1533
             this.$router.push({path:"/stock/out/detail/print?id="+this.order_id+"&warehouse_out_time="+this.warehouse_out_time})
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
 </script>
1556
 </script>

+ 1 - 1
src/xt_pages/stock/stockOutOrderAdd.vue 查看文件

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

+ 28 - 49
src/xt_pages/stock/stockOutOrderDetailPrint.vue 查看文件

10
         </div>
10
         </div>
11
         <div class="app-container" style="background-color: white;">
11
         <div class="app-container" style="background-color: white;">
12
             <div id="print_content">
12
             <div id="print_content">
13
-                <div class="print_main_content">
13
+                <div class="print_main_content" v-for="(it,index) in tableList" :key="index">
14
                     <div class="order_title_panl">
14
                     <div class="order_title_panl">
15
                         <div style="font-size:22px;font-weight:bold;">{{ orgName }}</div>
15
                         <div style="font-size:22px;font-weight:bold;">{{ orgName }}</div>
16
                         <span class="main_title">耗材出库登记单</span>
16
                         <span class="main_title">耗材出库登记单</span>
17
                     </div>
17
                     </div>
18
                     <div style="display:flex;justify-content: space-between;">
18
                     <div style="display:flex;justify-content: space-between;">
19
                       <div style="text-align:left;margin-bottom:1px;font-size: 18px;">
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
                       </div>
21
                       </div>
23
                       <div style="text-align:right;margin-bottom:1px;font-size: 18px;">
22
                       <div style="text-align:right;margin-bottom:1px;font-size: 18px;">
24
                         打印日期:{{time_now}}
23
                         打印日期:{{time_now}}
31
                                     <td width="80">耗材名称</td>
30
                                     <td width="80">耗材名称</td>
32
                                     <td width="80">规格型号</td>
31
                                     <td width="80">规格型号</td>
33
                                     <td width="80">单位</td>
32
                                     <td width="80">单位</td>
34
-                                    <td width="80">出数量</td>
33
+                                    <td width="80">出数量</td>
35
                                     <td width="80">出库价格</td>
34
                                     <td width="80">出库价格</td>
36
                                     <td width="80">总价</td>
35
                                     <td width="80">总价</td>
37
                                     <td width="80">批号</td>
36
                                     <td width="80">批号</td>
40
                                 </tr>
39
                                 </tr>
41
                             </thead>
40
                             </thead>
42
                             <tbody>
41
                             <tbody>
43
-                                <tr v-for='(item,index) in tableList' :key="index">
42
+                                <tr v-for='(item,index) in it.child' :key="index">
44
                                     <td><span v-if="item.good_id != 0">{{item.good_name}}</span></td>
43
                                     <td><span v-if="item.good_id != 0">{{item.good_name}}</span></td>
45
                                     <td><span v-if="item.good_id != 0">{{item.specification_name}}</span></td>
44
                                     <td><span v-if="item.good_id != 0">{{item.specification_name}}</span></td>
46
                                     <td><span v-if="item.good_id!=0">{{item.packing_unit}}</span></td>
45
                                     <td><span v-if="item.good_id!=0">{{item.packing_unit}}</span></td>
48
                                     <td>{{item.price}}</td>
47
                                     <td>{{item.price}}</td>
49
                                     <td>{{((getOutStockCount(item.good_id) +getWarehouseOutInfoCount(item.warehouse_out_id,item.good_id))*item.price).toFixed(2)}}</td>
48
                                     <td>{{((getOutStockCount(item.good_id) +getWarehouseOutInfoCount(item.warehouse_out_id,item.good_id))*item.price).toFixed(2)}}</td>
50
                                     <td>{{getNumber(item.good_id)}}</td>
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
                                 </tr>
52
                                 </tr>
54
                                 <tr>
53
                                 <tr>
55
                                   <td>合计</td>
54
                                   <td>合计</td>
96
           crumbs: [
95
           crumbs: [
97
             { path: false, name: '库存管理' },
96
             { path: false, name: '库存管理' },
98
             { path: false, name: '耗材管理' },
97
             { path: false, name: '耗材管理' },
99
-            { path: false, name: '库单打印' },
98
+            { path: false, name: '库单打印' },
100
           ],
99
           ],
101
            isEdit: 0,
100
            isEdit: 0,
102
             checked: false,
101
             checked: false,
125
             orgId:'',
124
             orgId:'',
126
             orgName:'',
125
             orgName:'',
127
             orderInList:[],
126
             orderInList:[],
128
-            tableList:[]
127
+            tableList:[],
128
+            orderList:[]
129
         }
129
         }
130
     },
130
     },
131
     methods:{
131
     methods:{
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
        GetTotalCount(time){
156
        GetTotalCount(time){
187
           var params = {
157
           var params = {
188
            warehouse_out_time:time
158
            warehouse_out_time:time
278
       },
248
       },
279
 
249
 
280
       getWarehouseOutInfoCount(warehouse_out_id,good_id){
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
       getWarehouseOrderInfoList(){
260
       getWarehouseOrderInfoList(){
339
         const params = {
309
         const params = {
340
           'id': id
310
           'id': id
341
         }
311
         }
312
+        console.log("paramsssss",params)
342
         getOrderDetailByOrderId(params).then(response=>{
313
         getOrderDetailByOrderId(params).then(response=>{
343
            if(response.data.state == 1){
314
            if(response.data.state == 1){
315
+             var order = response.data.data.order
316
+             console.log("order22222",order)
344
              var list = response.data.data.list
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
              console.log("详情打印222222",list)
327
              console.log("详情打印222222",list)
328
+             this.tableList = order
346
              var total_price = 0
329
              var total_price = 0
347
              for(let i=0;i<list.length;i++){
330
              for(let i=0;i<list.length;i++){
348
                total_price += response.data.data.list[i].price * response.data.data.list[i].count
331
                total_price += response.data.data.list[i].price * response.data.data.list[i].count
349
-               this.tableList.push(list[i])
350
              }
332
              }
351
              this.allPrice =  total_price
333
              this.allPrice =  total_price
352
            }
334
            }
360
       const order_id = this.$route.query.id;
342
       const order_id = this.$route.query.id;
361
       const warehouse_out_time = this.$route.query.warehouse_out_time;
343
       const warehouse_out_time = this.$route.query.warehouse_out_time;
362
       this.GetConfigInfo();
344
       this.GetConfigInfo();
363
-      // this.GetOrderDetail(order_id);
364
       this.GetTotalCount(warehouse_out_time);
345
       this.GetTotalCount(warehouse_out_time);
365
       this.GetOrderDetailOne(order_id)
346
       this.GetOrderDetailOne(order_id)
366
       this.getList()
347
       this.getList()
367
-      //获取所有入库单
368
-      this.getWarehouseOrderInfoList()
369
     }
348
     }
370
 }
349
 }
371
 </script>
350
 </script>

+ 2 - 2
src/xt_pages/stock/stockPrint.vue 查看文件

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

+ 5 - 5
src/xt_pages/stock/stockQuery.vue 查看文件

103
         </el-table-column>
103
         </el-table-column>
104
        <el-table-column label="入库数量" align="center">
104
        <el-table-column label="入库数量" align="center">
105
          <template slot-scope="scope">
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
          </template>
107
          </template>
108
        </el-table-column>
108
        </el-table-column>
109
        <el-table-column label="出库数量" align="center">
109
        <el-table-column label="出库数量" align="center">
110
          <template slot-scope="scope">
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
          </template>
113
          </template>
114
        </el-table-column>
114
        </el-table-column>
115
       
115
       
116
        <el-table-column label="剩余库存量" align="center">
116
        <el-table-column label="剩余库存量" align="center">
117
          <template slot-scope="scope">
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
          </template>
119
          </template>
120
        </el-table-column>
120
        </el-table-column>
121
        <el-table-column label="操作" align="center" width="260px">
121
        <el-table-column label="操作" align="center" width="260px">
471
           }
471
           }
472
        }
472
        }
473
       specification_name = val.specification_name + "/" + val.packing_unit
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
     toClickOne(val){
476
     toClickOne(val){
477
        var manufacturer_name = ""
477
        var manufacturer_name = ""
482
           }
482
           }
483
        }
483
        }
484
       specification_name = val.specification_name + "/" + val.packing_unit
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
     getStockDrugCount(){
487
     getStockDrugCount(){
488
         var params ={
488
         var params ={