XMLWAN 4 jaren geleden
bovenliggende
commit
72ebbb8aee

+ 2 - 1
src/router/index_路由未分离前.js Bestand weergeven

886
         component: () => import('@/xt_pages/stock/index'),
886
         component: () => import('@/xt_pages/stock/index'),
887
         name: 'config',
887
         name: 'config',
888
         meta: { title: 'config' }
888
         meta: { title: 'config' }
889
-      }
889
+      },
890
+     
890
     ]
891
     ]
891
   },
892
   },
892
   {
893
   {

+ 27 - 1
src/router/modules/selfPreparedMedicine.js Bestand weergeven

61
        hidden:true,
61
        hidden:true,
62
        is_menu:false,
62
        is_menu:false,
63
        meta:{title:'selfStockPrint',noCache:true}
63
        meta:{title:'selfStockPrint',noCache:true}
64
-     }
64
+     },
65
+
66
+     {
67
+      path: '/stock/stockprint',
68
+      component: () => import('@/xt_pages/stock/stockPrint'),
69
+      name: 'stockqueryprint',
70
+      hidden: true,
71
+      is_menu: false,
72
+      meta: { title: 'stockprint', noCache: true }
73
+     },
74
+
75
+     {
76
+      path: '/stock/in/detail/print',
77
+      component: () => import('@/xt_pages/stock/stockInOrderDetailPrint'),
78
+      name: 'stockInDetailPrint',
79
+      hidden: true,
80
+      is_menu: false,
81
+      meta: { title: 'stockInDetailPrint',noCache: true }
82
+    },
83
+    {
84
+      path: '/stock/out/detail',
85
+      component: () => import('@/xt_pages/stock/stockOutOrderDetailPrint'),
86
+      name: 'stockOutDetailPrint',
87
+      hidden: true,
88
+      is_menu: false,
89
+      meta: { title: 'stockOutDetailPrint',noCache: true }
90
+    },
65
   ]
91
   ]
66
 }
92
 }

+ 36 - 1
src/router/modules/stock.js Bestand weergeven

233
         title: '出库打印',
233
         title: '出库打印',
234
         noCache: true
234
         noCache: true
235
       }
235
       }
236
-    }
236
+    },
237
+
238
+    {
239
+      path: '/stock/drugStockInOrderDetailPrint',
240
+      component: () => import('@/xt_pages/stock/drugs/drugStockInOrderDetailPrint'),
241
+      hidden: true,
242
+      is_menu: false,
243
+      name: 'drugInOrderDetailPrint',
244
+      meta: {
245
+        title: '药品入库单打印',
246
+        noCache: true
247
+      }
248
+    },
249
+    {
250
+      path: '/stock/drugStockOutOrderDetailPrint',
251
+      component: () => import('@/xt_pages/stock/drugs/drugStockOutOrderDetailPrint'),
252
+      hidden: true,
253
+      is_menu: false,
254
+      name: 'drugOutOrderDetailPrint',
255
+      meta: {
256
+        title: '药品入库单打印',
257
+        noCache: true
258
+      }
259
+    },
260
+
261
+    {
262
+      path: '/stock/drugQueryPrint',
263
+      component: () => import('@/xt_pages/stock/drugs/drugQueryPrint'),
264
+      hidden: true,
265
+      is_menu: false,
266
+      name: 'drugQueryPrint',
267
+      meta: {
268
+        title: '药品入库单打印',
269
+        noCache: true
270
+      }
271
+    },
237
   ]
272
   ]
238
 }
273
 }

+ 44 - 2
src/xt_pages/dialysis/template/DialysisPrintOrderTwentyFour.vue Bestand weergeven

728
                     <td width='50'>
728
                     <td width='50'>
729
                         <div class="under-line">
729
                         <div class="under-line">
730
                             &nbsp;<span v-if="afterdialysis.sealing_fluid_dispose.indexOf('肝素')>-1">
730
                             &nbsp;<span v-if="afterdialysis.sealing_fluid_dispose.indexOf('肝素')>-1">
731
-                                {{ afterdialysis.sealing_fluid_dispose ? getSealingFluidDispose(afterdialysis.sealing_fluid_dispose).replace(/[^0-9]/ig,"") : '' }}
731
+                                {{ afterdialysis.sealing_fluid_dispose ? getSealingFluidDispose(afterdialysis.sealing_fluid_dispose).replace(/[^\d.]/g,"") : '' }}
732
                             </span>
732
                             </span>
733
                         </div>
733
                         </div>
734
                     </td>
734
                     </td>
741
                     <td width='50'>
741
                     <td width='50'>
742
                         <div class="under-line">
742
                         <div class="under-line">
743
                             &nbsp;<span v-if="afterdialysis.sealing_fluid_dispose.indexOf('+NS')>-1">
743
                             &nbsp;<span v-if="afterdialysis.sealing_fluid_dispose.indexOf('+NS')>-1">
744
-                                {{ afterdialysis.sealing_fluid_dispose ? getSealingFluidDisposetwo(afterdialysis.sealing_fluid_dispose).replace(/[^0-9]/ig,"") : '' }}
744
+                                {{ afterdialysis.sealing_fluid_dispose ? getSealingFluidDisposetwo(afterdialysis.sealing_fluid_dispose).replace(/[^\d.]/g,"") : '' }}
745
                             </span>
745
                             </span>
746
                         </div>
746
                         </div>
747
                     </td>
747
                     </td>
1547
         if(arr[i] == "肝素10ml"){
1547
         if(arr[i] == "肝素10ml"){
1548
           strname = "肝素10ml"
1548
           strname = "肝素10ml"
1549
         }
1549
         }
1550
+        if(arr[i] == "肝素1.1ml"){
1551
+          strname = "肝素1.1ml"
1552
+        }
1553
+        if(arr[i] == "肝素1.2ml"){
1554
+          strname = "肝素1.2ml"
1555
+        }
1556
+       if(arr[i] == "肝素1.3ml"){
1557
+          strname = "肝素1.3ml"
1558
+        }
1559
+        if(arr[i] == "肝素1.4ml"){
1560
+          strname = "肝素1.4ml"
1561
+        }
1562
+       if(arr[i] == "肝素1.5ml"){
1563
+          strname = "肝素1.5ml"
1564
+        }
1565
+       if(arr[i] == "肝素1.6ml"){
1566
+          strname = "肝素1.6ml"
1567
+        }
1568
+       if(arr[i] == "肝素1.7ml"){
1569
+          strname = "肝素1.7ml"
1570
+        }
1550
       }
1571
       }
1551
       return strname
1572
       return strname
1552
     },
1573
     },
1564
         if(arr[i] == "+NS10ml"){
1585
         if(arr[i] == "+NS10ml"){
1565
           strname = "+NS10ml"
1586
           strname = "+NS10ml"
1566
         }
1587
         }
1588
+        if(arr[i] == "+NS1.1ml"){
1589
+          strname = "+NS1.1ml"
1590
+        }
1591
+        if(arr[i] == "+NS1.2ml"){
1592
+          strname = "+NS1.2ml"
1593
+        }
1594
+       if(arr[i] == "+NS1.3ml"){
1595
+          strname = "+NS1.3ml"
1596
+        }
1597
+       if(arr[i] == "+NS1.4ml"){
1598
+          strname = "+NS1.4ml"
1599
+        }
1600
+       if(arr[i] == "+NS1.5ml"){
1601
+          strname = "+NS1.5ml"
1602
+        }
1603
+       if(arr[i] == "+NS1.6ml"){
1604
+          strname = "+NS1.6ml"
1605
+        }
1606
+      if(arr[i] == "+NS1.7ml"){
1607
+          strname = "+NS1.7ml"
1608
+        }
1567
       }
1609
       }
1568
       return strname
1610
       return strname
1569
     },
1611
     },

+ 3 - 3
src/xt_pages/stock/detail/cancelStockDetail.vue Bestand weergeven

8
       type="primary"
8
       type="primary"
9
       >打印
9
       >打印
10
     </el-button>
10
     </el-button>
11
-    <!-- <el-button
11
+    <el-button
12
       style="float: right;margin-right:10px"
12
       style="float: right;margin-right:10px"
13
       size="small"
13
       size="small"
14
       icon="el-icon-printer"
14
       icon="el-icon-printer"
15
       @click="exportList"
15
       @click="exportList"
16
       type="primary"
16
       type="primary"
17
       >导出
17
       >导出
18
-    </el-button> -->
18
+    </el-button>
19
     <div class="cell clearfix">
19
     <div class="cell clearfix">
20
       <el-input
20
       <el-input
21
         size="small"
21
         size="small"
575
         excel.export_json_to_excel({
575
         excel.export_json_to_excel({
576
            header: tHeader,
576
            header: tHeader,
577
            data,
577
            data,
578
-           filename: '耗材库明细'
578
+           filename: '耗材退库明细'
579
          })
579
          })
580
           this.downloadLoading = false
580
           this.downloadLoading = false
581
         })
581
         })

+ 1 - 0
src/xt_pages/stock/detail/print.vue Bestand weergeven

171
             var stockTotal = response.data.data.stockTotal
171
             var stockTotal = response.data.data.stockTotal
172
             console.log("stocktOTl",stockTotal)
172
             console.log("stocktOTl",stockTotal)
173
             this.stockTotal = stockTotal
173
             this.stockTotal = stockTotal
174
+            console.log("导出数据",response.data.data.list)
174
             for (let i = 0; i < response.data.data.list.length; i++) {
175
             for (let i = 0; i < response.data.data.list.length; i++) {
175
               if (this.type == 1) {
176
               if (this.type == 1) {
176
                 if (response.data.data.list[i].query_warehousing_info.length > 0) {
177
                 if (response.data.data.list[i].query_warehousing_info.length > 0) {

+ 3 - 3
src/xt_pages/stock/detail/salesReturnDetail.vue Bestand weergeven

9
       >打印
9
       >打印
10
     </el-button>
10
     </el-button>
11
 
11
 
12
-    <!-- <el-button
12
+    <el-button
13
       style="float: right;margin-right:10px"
13
       style="float: right;margin-right:10px"
14
       size="small"
14
       size="small"
15
       icon="el-icon-printer"
15
       icon="el-icon-printer"
16
       @click="exportList"
16
       @click="exportList"
17
       type="primary"
17
       type="primary"
18
       >导出
18
       >导出
19
-    </el-button> -->
19
+    </el-button>
20
     <div class="cell clearfix">
20
     <div class="cell clearfix">
21
       <el-input
21
       <el-input
22
         size="small"
22
         size="small"
576
         excel.export_json_to_excel({
576
         excel.export_json_to_excel({
577
            header: tHeader,
577
            header: tHeader,
578
            data,
578
            data,
579
-           filename: '耗材出库明细'
579
+           filename: '耗材退货明细'
580
          })
580
          })
581
           this.downloadLoading = false
581
           this.downloadLoading = false
582
         })
582
         })

+ 115 - 46
src/xt_pages/stock/detail/stockInDetail.vue Bestand weergeven

9
       >打印
9
       >打印
10
     </el-button>
10
     </el-button>
11
 
11
 
12
-    <!-- <el-button
12
+    <el-button
13
       style="float: right;margin-right:10px"
13
       style="float: right;margin-right:10px"
14
       size="small"
14
       size="small"
15
       icon="el-icon-printer"
15
       icon="el-icon-printer"
16
       @click="exportList"
16
       @click="exportList"
17
       type="primary"
17
       type="primary"
18
       >导出
18
       >导出
19
-    </el-button> -->
19
+    </el-button>
20
 
20
 
21
     <div class="cell clearfix">
21
     <div class="cell clearfix">
22
       <el-input
22
       <el-input
201
   deleteCancelStock,
201
   deleteCancelStock,
202
   GetAllConfig,
202
   GetAllConfig,
203
   getStockDetail,
203
   getStockDetail,
204
-  getPrintStockGood
204
+  getPrintStockGood,
205
+  
205
 } from "@/api/stock";
206
 } from "@/api/stock";
206
 
207
 
207
 export default {
208
 export default {
232
     this.GetConfigInfo();
233
     this.GetConfigInfo();
233
     this.fetchAllAdminUsers();
234
     this.fetchAllAdminUsers();
234
     this.goodUnit = this.$store.getters.good_unit
235
     this.goodUnit = this.$store.getters.good_unit
236
+
237
+    this.getPrintStockGood()
235
   },
238
   },
236
   data() {
239
   data() {
237
     return {
240
     return {
264
       selectedTableData: [],
267
       selectedTableData: [],
265
       dealer: [],
268
       dealer: [],
266
       tableList:[],
269
       tableList:[],
267
-      goodUnit:[]
270
+      goodUnit:[],
271
+      stockTotal:[]
268
     };
272
     };
269
   },
273
   },
270
   methods: {
274
   methods: {
271
     changeType: function(val) {
275
     changeType: function(val) {
272
       this.order_type = val;
276
       this.order_type = val;
273
       this.GetCancelStock();
277
       this.GetCancelStock();
278
+      this.getPrintStockGood()
274
     },
279
     },
275
     changeManufacturer: function(val) {
280
     changeManufacturer: function(val) {
276
       this.manufacturer_id = val;
281
       this.manufacturer_id = val;
277
       this.GetCancelStock();
282
       this.GetCancelStock();
283
+      this.getPrintStockGood()
278
     },
284
     },
279
     changeDealer: function(val) {
285
     changeDealer: function(val) {
280
       this.dealer_id = val;
286
       this.dealer_id = val;
281
       this.GetCancelStock();
287
       this.GetCancelStock();
288
+      this.getPrintStockGood()
282
     },
289
     },
283
     getTypeName: function(row) {
290
     getTypeName: function(row) {
284
       let name = "";
291
       let name = "";
388
             var obj = response.data.data.list[i];
395
             var obj = response.data.data.list[i];
389
             obj["is_total"] = 0;
396
             obj["is_total"] = 0;
390
             this.cancelStockDate.push(obj);
397
             this.cancelStockDate.push(obj);
391
-            this.tableList.push(obj)
398
+            // this.tableList.push(obj)
392
           }
399
           }
393
           this.cancelStockDate.push({
400
           this.cancelStockDate.push({
394
             warehousing_order: "合计",
401
             warehousing_order: "合计",
444
     handleSizeChange(val) {
451
     handleSizeChange(val) {
445
       this.limit = val;
452
       this.limit = val;
446
       this.GetCancelStock();
453
       this.GetCancelStock();
454
+      this.getPrintStockGood()
447
     },
455
     },
448
     handleCurrentChange(val) {
456
     handleCurrentChange(val) {
449
       this.page = val;
457
       this.page = val;
450
       this.GetCancelStock();
458
       this.GetCancelStock();
459
+      this.getPrintStockGood()
451
     },
460
     },
452
     startTimeChange(val) {
461
     startTimeChange(val) {
453
       var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
462
       var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
456
         this.start_time = "";
465
         this.start_time = "";
457
       } else {
466
       } else {
458
         this.GetCancelStock();
467
         this.GetCancelStock();
468
+        this.getPrintStockGood()
459
       }
469
       }
460
     },
470
     },
461
     endTimeChange(val) {
471
     endTimeChange(val) {
465
         this.end_time = "";
475
         this.end_time = "";
466
       } else {
476
       } else {
467
         this.GetCancelStock();
477
         this.GetCancelStock();
478
+        this.getPrintStockGood()
468
       }
479
       }
469
     },
480
     },
470
     getTimestamp(time) {
481
     getTimestamp(time) {
625
         }
636
         }
626
       });
637
       });
627
     },
638
     },
628
-    exportList(){
639
+   getPrintStockGood(){
640
+     const params = {
641
+       start_time:this.start_time,
642
+       end_time:this.end_time,
643
+       type:1,
644
+     }
645
+   
646
+     getPrintStockGood(params).then(response=>{
647
+        if(response.data.state == 1){
648
+          var stockTotal =  response.data.data.stockTotal
649
+        
650
+          this.stockTotal = stockTotal
651
+          var list =  response.data.data.list
652
+         
653
+          for(let i=0;i<list.length;i++){
654
+            if (list[i].query_warehousing_info.length > 0) {
655
+               this.tableList.push(list[i])
656
+             }
657
+          }
658
+         
629
        
659
        
630
-     let dataInfo = {}
631
-     this.tableList.forEach((item, index) => {
632
-     let { good_id } = item
633
-     if (!dataInfo[good_id]) {
634
-        dataInfo[good_id] = {
635
-        child: [],
636
-        good_id: item.good_id,
637
-        count:0,
638
-        total:0,
639
-        price:0.0,
640
-        remark:""
641
-      }
642
-      }
660
+       
661
+        }
643
      })
662
      })
644
-     let list = Object.values(dataInfo)
645
-    
646
-     list.map(item=>{
647
-     for(let i=0;i<this.tableList.length;i++){
648
-       if(item.good_id == this.tableList[i].good_id){
649
-           item.child.push(this.tableList[i])
650
-         }
663
+   },
664
+
665
+    calCount(stock) {
666
+        let total = 0
667
+        var array = []
668
+        array = stock.query_warehousing_info
669
+        for (let i = 0; i < array.length; i++) {
670
+         total = total + array[i].warehousing_count
651
         }
671
         }
652
-      })
672
+        return total
673
+      },
653
 
674
 
654
-     for(let k=0;k<list.length;k++){
655
-       for(let z=0;z<list[k].child.length;z++){
656
-          if(list[k].good_id == list[k].child[z].good_id){
657
-             list[k].count += list[k].child[z].warehousing_count
658
-             list[k].price = list[k].child[0].price
659
-             list[k].remark = list[k].child[0].remark
675
+     calTotal(stock) {
676
+       var array = []
677
+       array = stock.query_warehousing_info
678
+        let total_price = 0.0
679
+        for (let i = 0; i < array.length; i++) {
680
+         total_price = total_price + array[i].warehousing_count * array[i].price  
681
+        }
682
+        return  Math.floor(total_price * 100) / 100
683
+      }, 
684
+      calTotalPrice() {
685
+        var amountPrice = 0
686
+        for (let i = 0; i < this.tableList.length; i++) {
687
+          var obj = this.tableList[i]
688
+          var len = 0
689
+          len = obj.query_warehousing_info.length
690
+          let total_price = 0.0
691
+          for (let a = 0; a < len; a++) {
692
+           total_price = total_price + obj.query_warehousing_info[a].total_price   
660
           }
693
           }
694
+
695
+          amountPrice = amountPrice +  Math.floor(total_price* 100) / 100
696
+        }
697
+        return Math.floor(amountPrice* 100) / 100
698
+      }, 
699
+      getStockCount(id){
700
+        
701
+        var count = ""
702
+        for(let i=0;i<this.stockTotal.length;i++){
703
+            if(id == this.stockTotal[i].good_id){
704
+              count = this.stockTotal[i].count
705
+            }
706
+        }
707
+        return count
708
+      },
709
+      getTotal: function(price, total) {
710
+        var m = 0, r1, r2
711
+        var s1 = price.toString()
712
+        var s2 = total.toString()
713
+        try {
714
+          m += s1.split('.')[1].length
715
+        } catch (e) {
716
+
717
+        }
718
+        try {
719
+        } catch (e) {
720
+          m += s2.split('.')[1].length
721
+        }
722
+        r1 = Number(price.toString().replace('.', ''))
723
+        r2 = Number(total.toString().replace('.', ''))
724
+        return r1 * r2 / Math.pow(10, m)
725
+      },
726
+    
727
+    exportList(){
728
+       var obj = {index:"合计",total:0}
729
+       obj.total = this.calTotalPrice()
730
+      for(let i=0;i<this.tableList.length;i++){
731
+        this.tableList[i].index = i+1
732
+        this.tableList[i].min_unit = this.getUnit(this.tableList[i].good_unit)
733
+        this.tableList[i].count = this.calCount(this.tableList[i])
734
+        this.tableList[i].total = this.calTotal(this.tableList[i])
735
+        this.tableList[i].price = this.tableList[i].query_warehousing_info[0].price
736
+        this.tableList[i].remark = this.tableList[i].query_warehousing_info[0].remark
737
+
661
        }
738
        }
662
-     }
739
+       this.tableList.push(obj)
740
+       console.log("数据222222",this.tableList)
663
     
741
     
664
-      
665
-      for(let i=0;i<list.length;i++){
666
-          list[i].index = i+1
667
-          list[i].drug_name =  this.typeNameOne(list[i].good_id) 
668
-          list[i].drug_spec =  this.specificationName(list[i].good_id)
669
-          list[i].min_unit = this.getUnit(list[i].child[0].GoodInfo.good_unit)
670
-          list[i].total = list[i].price * list[i].count
671
-        }
672
        import('@/vendor/Export2Excel').then(excel => {
742
        import('@/vendor/Export2Excel').then(excel => {
673
        const tHeader = ['序号','耗材名称', '规格型号', '单位','数量','出货价','总价','备注']
743
        const tHeader = ['序号','耗材名称', '规格型号', '单位','数量','出货价','总价','备注']
674
-       const filterVal = ['index','drug_name', 'drug_spec', 'min_unit','count','price','total','remark']
744
+       const filterVal = ['index','good_name', 'specification_name', 'min_unit','count','price','total','remark']
745
+       
746
+       const data = this.formatJson(filterVal, this.tableList)
675
        
747
        
676
-       const data = this.formatJson(filterVal, list)
677
-       console.log("data",data)
678
-      
679
         excel.export_json_to_excel({
748
         excel.export_json_to_excel({
680
            header: tHeader,
749
            header: tHeader,
681
            data,
750
            data,

+ 113 - 16
src/xt_pages/stock/detail/stockOutDetail.vue Bestand weergeven

8
       type="primary"
8
       type="primary"
9
       >打印
9
       >打印
10
     </el-button>
10
     </el-button>
11
-     <!-- <el-button
11
+     <el-button
12
       style="float: right;margin-right:10px"
12
       style="float: right;margin-right:10px"
13
       size="small"
13
       size="small"
14
       icon="el-icon-printer"
14
       icon="el-icon-printer"
15
       @click="exportList"
15
       @click="exportList"
16
       type="primary"
16
       type="primary"
17
       >导出
17
       >导出
18
-    </el-button> -->
18
+    </el-button>
19
     <div class="cell clearfix">
19
     <div class="cell clearfix">
20
       <el-input
20
       <el-input
21
         size="small"
21
         size="small"
195
 <script>
195
 <script>
196
 import { uParseTime } from "@/utils/tools";
196
 import { uParseTime } from "@/utils/tools";
197
 import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
197
 import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
198
-import { deleteCancelStock, GetAllConfig, getStockDetail } from "@/api/stock";
198
+import { deleteCancelStock, GetAllConfig, getStockDetail,getPrintStockGood } from "@/api/stock";
199
 
199
 
200
 export default {
200
 export default {
201
   name: "stockOutDetail",
201
   name: "stockOutDetail",
225
     this.GetConfigInfo();
225
     this.GetConfigInfo();
226
     this.fetchAllAdminUsers();
226
     this.fetchAllAdminUsers();
227
     this.goodUnit = this.$store.getters.good_unit
227
     this.goodUnit = this.$store.getters.good_unit
228
+    this.getPrintStockGood()
228
   },
229
   },
229
   data() {
230
   data() {
230
     return {
231
     return {
256
       selectedTableData: [],
257
       selectedTableData: [],
257
       dealer: [],
258
       dealer: [],
258
       goodUnit:[],
259
       goodUnit:[],
259
-      tableList:[]
260
+      tableList:[],
261
+      stockTotal:[]
260
     };
262
     };
261
   },
263
   },
262
   methods: {
264
   methods: {
263
     changeType: function(val) {
265
     changeType: function(val) {
264
       this.order_type = val;
266
       this.order_type = val;
265
       this.GetCancelStock();
267
       this.GetCancelStock();
268
+      this.getPrintStockGood()
266
     },
269
     },
267
     changeManufacturer: function(val) {
270
     changeManufacturer: function(val) {
268
       this.manufacturer_id = val;
271
       this.manufacturer_id = val;
269
       this.GetCancelStock();
272
       this.GetCancelStock();
273
+      this.getPrintStockGood()
270
     },
274
     },
271
     getTypeName: function(row) {
275
     getTypeName: function(row) {
272
       let name = "";
276
       let name = "";
328
             var obj = response.data.data.list[i];
332
             var obj = response.data.data.list[i];
329
             obj["is_total"] = 0;
333
             obj["is_total"] = 0;
330
             this.cancelStockDate.push(obj);
334
             this.cancelStockDate.push(obj);
331
-            this.tableList.push(obj)
335
+            
332
           }
336
           }
333
           this.cancelStockDate.push({
337
           this.cancelStockDate.push({
334
             warehouse_out_order_number: "合计",
338
             warehouse_out_order_number: "合计",
372
             var obj = response.data.data.list[i];
376
             var obj = response.data.data.list[i];
373
             obj["is_total"] = 0;
377
             obj["is_total"] = 0;
374
             this.cancelStockDate.push(obj);
378
             this.cancelStockDate.push(obj);
375
-            this.tableList.push(obj)
379
+           
376
           }
380
           }
377
           this.cancelStockDate.push({
381
           this.cancelStockDate.push({
378
             warehouse_out_order_number: "合计",
382
             warehouse_out_order_number: "合计",
429
     handleSizeChange(val) {
433
     handleSizeChange(val) {
430
       this.limit = val;
434
       this.limit = val;
431
       this.GetCancelStock();
435
       this.GetCancelStock();
436
+      this.getPrintStockGood()
432
     },
437
     },
433
     handleCurrentChange(val) {
438
     handleCurrentChange(val) {
434
       this.page = val;
439
       this.page = val;
435
       this.GetCancelStock();
440
       this.GetCancelStock();
441
+      this.getPrintStockGood()
436
     },
442
     },
437
     startTimeChange(val) {
443
     startTimeChange(val) {
438
       var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
444
       var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
441
         this.start_time = "";
447
         this.start_time = "";
442
       } else {
448
       } else {
443
         this.GetCancelStock();
449
         this.GetCancelStock();
450
+        this.getPrintStockGood()
444
       }
451
       }
445
     },
452
     },
446
     endTimeChange(val) {
453
     endTimeChange(val) {
450
         this.end_time = "";
457
         this.end_time = "";
451
       } else {
458
       } else {
452
         this.GetCancelStock();
459
         this.GetCancelStock();
460
+        this.getPrintStockGood()
453
       }
461
       }
454
     },
462
     },
455
     getTimestamp(time) {
463
     getTimestamp(time) {
617
         }
625
         }
618
       });
626
       });
619
     },
627
     },
628
+    getPrintStockGood(){
629
+      const params = {
630
+        start_time:this.start_time,
631
+        end_time:this.end_time,
632
+        type:3,
633
+      }
634
+      console.log("params",params)
635
+      getPrintStockGood(params).then(response=>{
636
+          if(response.data.state == 1){
637
+            var stockTotal =  response.data.data.stockTotal
638
+            console.log("stockTotal",stockTotal)
639
+            this.stockTotal = stockTotal
640
+            var list =  response.data.data.list
641
+            console.log("导出数据",list)
642
+            for(let i=0;i<list.length;i++){
643
+              if (list[i].query_warehouseout_info.length > 0) {
644
+                this.tableList.push(list[i])
645
+              }
646
+            }
647
+          console.log("表哥",this.tableList)
648
+          }
649
+      })
650
+    },
651
+     calCount(stock) {
652
+        let total = 0
653
+        var array = []
654
+        array = stock.query_warehousing_info
655
+        for (let i = 0; i < array.length; i++) {
656
+         total = total + array[i].warehousing_count
657
+        }
658
+        return total
659
+      },
660
+
661
+     calTotal(stock) {
662
+       var array = []
663
+       array = stock.query_warehousing_info
664
+        let total_price = 0.0
665
+        for (let i = 0; i < array.length; i++) {
666
+         total_price = total_price + array[i].warehousing_count * array[i].price  
667
+        }
668
+        return  Math.floor(total_price * 100) / 100
669
+      }, 
670
+      calTotalPrice() {
671
+        var amountPrice = 0
672
+        for (let i = 0; i < this.tableList.length; i++) {
673
+          var obj = this.tableList[i]
674
+          var len = 0
675
+          len = obj.query_warehouseout_info.length
676
+          let total_price = 0.0
677
+          for (let a = 0; a < len; a++) {
678
+           total_price = total_price + obj.query_warehouseout_info[a].total_price   
679
+          }
680
+
681
+          amountPrice = amountPrice +  Math.floor(total_price* 100) / 100
682
+        }
683
+        return Math.floor(amountPrice* 100) / 100
684
+      }, 
685
+      getStockCount(id){
686
+        
687
+        var count = ""
688
+        for(let i=0;i<this.stockTotal.length;i++){
689
+            if(id == this.stockTotal[i].good_id){
690
+              count = this.stockTotal[i].count
691
+            }
692
+        }
693
+        return count
694
+      },
695
+      getTotal: function(price, total) {
696
+        var m = 0, r1, r2
697
+        var s1 = price.toString()
698
+        var s2 = total.toString()
699
+        try {
700
+          m += s1.split('.')[1].length
701
+        } catch (e) {
702
+
703
+        }
704
+        try {
705
+        } catch (e) {
706
+          m += s2.split('.')[1].length
707
+        }
708
+        r1 = Number(price.toString().replace('.', ''))
709
+        r2 = Number(total.toString().replace('.', ''))
710
+        return r1 * r2 / Math.pow(10, m)
711
+      },
712
+   
713
+
620
      exportList(){
714
      exportList(){
621
      
715
      
622
-        for(let i=0;i<this.tableList.length;i++){
623
-          this.tableList[i].index = i+1
624
-          this.tableList[i].drug_name =  this.typeNameOne(this.tableList[i].good_id) 
625
-          this.tableList[i].drug_spec =  this.specificationName(this.tableList[i].good_id)
626
-          this.tableList[i].min_unit = this.getUnit(this.tableList[i].GoodInfo.good_unit)
627
-          this.tableList[i].total_price = this.getTotal(this.tableList[i].price,this.tableList[i].count)
628
-         
629
-        }
716
+      var obj = {index:"合计",total:0}
717
+       obj.total = this.calTotalPrice()
718
+       for(let i=0;i<this.tableList.length;i++){
719
+        this.tableList[i].index = i+1
720
+        this.tableList[i].min_unit = this.getUnit(this.tableList[i].good_unit)
721
+        this.tableList[i].count = this.getStockCount(this.tableList[i].id)
722
+        this.tableList[i].price = this.tableList[i].query_warehouseout_info[0].price
723
+        this.tableList[i].total = (this.getStockCount(this.tableList[i].id) * this.tableList[i].query_warehouseout_info[0].price).toFixed(2)
724
+        this.tableList[i].remark = this.tableList[i].query_warehouseout_info[0].remark
725
+       }
726
+       this.tableList.push(obj)
630
        import('@/vendor/Export2Excel').then(excel => {
727
        import('@/vendor/Export2Excel').then(excel => {
631
        const tHeader = ['序号','耗材名称', '规格型号', '单位','数量','出货价','总价','备注']
728
        const tHeader = ['序号','耗材名称', '规格型号', '单位','数量','出货价','总价','备注']
632
-       const filterVal = ['index','drug_name', 'drug_spec', 'min_unit','count','price','total_price','remark']
729
+       const filterVal = ['index','good_name', 'specification_name', 'min_unit','count','price','total','remark']
633
        
730
        
634
 
731
 
635
       
732
       
636
 
733
 
637
        const data = this.formatJson(filterVal, this.tableList)
734
        const data = this.formatJson(filterVal, this.tableList)
638
        console.log("data",data)
735
        console.log("data",data)
639
-       
736
+     
640
         excel.export_json_to_excel({
737
         excel.export_json_to_excel({
641
            header: tHeader,
738
            header: tHeader,
642
            data,
739
            data,

+ 52 - 4
src/xt_pages/stock/drugs/components/drugInOrder.vue Bestand weergeven

366
           var drugInOrder = response.data.data.detail
366
           var drugInOrder = response.data.data.detail
367
           console.log("drug3434444",drugInOrder)
367
           console.log("drug3434444",drugInOrder)
368
           this.cancelStockDate = drugInOrder
368
           this.cancelStockDate = drugInOrder
369
-          this.tableList = drugInOrder
369
+           let objInfo = {}
370
+          drugInOrder.forEach((item,index)=>{
371
+             let { drug_id } = item
372
+             if(!objInfo[drug_id]){
373
+               objInfo[drug_id] = {
374
+                 drug_id,
375
+                 child:[],
376
+                 drug_name:item.drug_name,
377
+                 drug_spec:item.drug_spec,
378
+                 min_unit:item.min_unit,
379
+                 warehousing_count:0,
380
+                 price:item.price,
381
+                 remark:item.remark,
382
+                 total_price:0
383
+               }
384
+             }
385
+          })
386
+          let list = Object.values(objInfo);
387
+          console.log("list22333333",list)
388
+         for(let i=0;i<drugInOrder.length;i++){
389
+            list.map(item=>{
390
+              if(drugInOrder[i].drug_id == item.drug_id){
391
+                 item.child.push(drugInOrder[i])
392
+              }
393
+            })
394
+          }
395
+          console.log("list2334444",list)
396
+          for(let i=0;i<list.length;i++){
397
+            for(let j=0;j<list[i].child.length;j++){
398
+              if(list[i].child[j].warehousing_count!=null || list[i].child[j].warehousing_count != "" || list[i].child[j].warehousing_count!=0){
399
+                list[i].warehousing_count += list[i].child[j].warehousing_count
400
+                
401
+              }
402
+            }
403
+          }
404
+          for(let i=0;i<list.length;i++){
405
+            list[i].total_price = list[i].warehousing_count * list[i].price  
406
+          }
407
+          console.log("list666666666",list)
408
+          this.tableList = list
370
           var total = response.data.data.total
409
           var total = response.data.data.total
371
           this.total = total
410
           this.total = total
372
         }
411
         }
392
           this.tableList[i].index = i+1
431
           this.tableList[i].index = i+1
393
         }
432
         }
394
        import('@/vendor/Export2Excel').then(excel => {
433
        import('@/vendor/Export2Excel').then(excel => {
395
-       const tHeader = ['序号','药品名称', '规格型号', '单位','数量','单价','备注']
396
-       const filterVal = ['index','drug_name', 'drug_spec', 'min_unit','warehousing_count','price','remark']
397
-       
434
+       const tHeader = ['序号','药品名称', '规格型号', '单位','数量','单价','总价','备注']
435
+       const filterVal = ['index','drug_name', 'drug_spec', 'min_unit','warehousing_count','price','total_price','remark']
436
+       console.log("表格22222222",this.tableList)
437
+       let obj = {'index':'合计','total_price':0}
438
+       for(let i=0;i<this.tableList.length;i++){
439
+         obj.total_price += this.tableList[i].price * this.tableList[i].warehousing_count
440
+       }
441
+       for(let j=0;j<this.tableList.length;j++){
442
+         this.tableList[j].total_price = this.tableList[j].total_price.toFixed(2)
443
+       }
444
+       obj.total_price = obj.total_price.toFixed(2)
445
+       this.tableList.push(obj)
398
        const data = this.formatJson(filterVal, this.tableList)
446
        const data = this.formatJson(filterVal, this.tableList)
399
        console.log("data",data)
447
        console.log("data",data)
400
        
448
        

+ 51 - 4
src/xt_pages/stock/drugs/components/drugOutDetail.vue Bestand weergeven

388
           var order = response.data.data.order
388
           var order = response.data.data.order
389
           console.log("出库数据",order)
389
           console.log("出库数据",order)
390
           this.tableData = order
390
           this.tableData = order
391
-          this.tableList = order
391
+           let objInfo = {}
392
+          order.forEach((item,index)=>{
393
+             let { drug_id } = item
394
+             if(!objInfo[drug_id]){
395
+               objInfo[drug_id] = {
396
+                 drug_id,
397
+                 child:[],
398
+                 drug_name:item.drug_name,
399
+                 drug_spec:item.drug_spec,
400
+                 min_unit:item.min_unit,
401
+                 count:0,
402
+                 price:item.price,
403
+                 remark:item.remark,
404
+                 total_price:0,
405
+               }
406
+             }
407
+          })
408
+          let list = Object.values(objInfo);
409
+          console.log("list2334444",list)
410
+          for(let i=0;i<order.length;i++){
411
+            list.map(item=>{
412
+              if(order[i].drug_id == item.drug_id){
413
+                 item.child.push(order[i])
414
+              }
415
+            })
416
+          }
417
+          
418
+          console.log("list22333333",list)
419
+          for(let i=0;i<list.length;i++){
420
+            for(let j=0;j<list[i].child.length;j++){
421
+              if(list[i].child[j].count!=null || list[i].child[j].count != "" || list[i].child[j].count!=0){
422
+                list[i].count += list[i].child[j].count
423
+              }
424
+            }
425
+          }
426
+          for(let i=0;i<list.length;i++){
427
+             list[i].total_price = list[i].count * list[i].price
428
+          }
429
+          console.log("list666666666",list)
430
+          this.tableList = list
392
           var total = response.data.data.total
431
           var total = response.data.data.total
393
           this.total = total
432
           this.total = total
394
         } 
433
         } 
414
           this.tableList[i].index = i+1
453
           this.tableList[i].index = i+1
415
         }
454
         }
416
        import('@/vendor/Export2Excel').then(excel => {
455
        import('@/vendor/Export2Excel').then(excel => {
417
-       const tHeader = ['序号','药品名称', '规格型号', '单位','数量','单价','备注']
418
-       const filterVal = ['index','drug_name', 'drug_spec', 'min_unit','count','price','remark']
419
-       
456
+       const tHeader = ['序号','药品名称', '规格型号', '单位','数量','单价','总价','备注']
457
+       const filterVal = ['index','drug_name', 'drug_spec', 'min_unit','count','price','total_price','remark']
458
+       let obj = {'index':'合计','total_price':0}
459
+       for(let i=0;i<this.tableList.length;i++){
460
+         obj.total_price += this.tableList[i].price * this.tableList[i].count
461
+       }
462
+       for(let j=0;j<this.tableList.length;j++){
463
+          this.tableList[j].total_price = this.tableList[j].total_price.toFixed(2)
464
+       }
465
+       obj.total_price = obj.total_price.toFixed(2)
466
+       this.tableList.push(obj)
420
        const data = this.formatJson(filterVal, this.tableList)
467
        const data = this.formatJson(filterVal, this.tableList)
421
        console.log("data",data)
468
        console.log("data",data)
422
        
469
        

+ 42 - 9
src/xt_pages/stock/drugs/drugOutOrderPrint.vue Bestand weergeven

22
               <td style="line-height: 50px" width="50">单位</td>
22
               <td style="line-height: 50px" width="50">单位</td>
23
               <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>
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>
25
               <td style="line-height:50px" width="80">总价</td>
27
               <td style="line-height: 50px" width="">备 注</td>
26
               <td style="line-height: 50px" width="">备 注</td>
28
             </tr>
27
             </tr>
48
                   {{item.price}}
47
                   {{item.price}}
49
               </td>
48
               </td>
50
               <td style="line-height:50px">
49
               <td style="line-height:50px">
51
-                  {{item.price}}
52
-              </td>
53
-              <td style="line-height:50px">
54
-                  {{item.total_price}}
50
+                  {{(item.count * item.price).toFixed(2)}}
55
               </td>
51
               </td>
56
               <td style="line-height: 50px">
52
               <td style="line-height: 50px">
57
                  {{item.remark}}
53
                  {{item.remark}}
63
             <tbody>
59
             <tbody>
64
             <tr>
60
             <tr>
65
               <td width="633" style="line-height: 50px">合计</td>
61
               <td width="633" style="line-height: 50px">合计</td>
66
-              <td width="80" style="line-height: 50px">{{getTotal()}}</td>
62
+              <td width="80" style="line-height: 50px">{{getTotal().toFixed(2)}}</td>
67
               <td></td>
63
               <td></td>
68
             </tr>
64
             </tr>
69
 
65
 
171
       getDrugOutDetail(params).then(response=>{
167
       getDrugOutDetail(params).then(response=>{
172
         if(response.data.state == 1){
168
         if(response.data.state == 1){
173
           var drugInOrder = response.data.data.order
169
           var drugInOrder = response.data.data.order
174
-          console.log("drug3434444",drugInOrder)
175
-          this.cancelStockDate = drugInOrder
170
+          console.log("出库数据22",drugInOrder)
171
+          let objInfo = {}
172
+          drugInOrder.forEach((item,index)=>{
173
+             let { drug_id } = item
174
+             if(!objInfo[drug_id]){
175
+               objInfo[drug_id] = {
176
+                 drug_id,
177
+                 child:[],
178
+                 drug_name:item.drug_name,
179
+                 drug_spec:item.drug_spec,
180
+                 min_unit:item.min_unit,
181
+                 count:0,
182
+                 price:item.price,
183
+                 remark:item.remark,
184
+                 total_price:"",
185
+               }
186
+             }
187
+          })
188
+          let list = Object.values(objInfo);
189
+          console.log("list2334444",list)
190
+          for(let i=0;i<drugInOrder.length;i++){
191
+            list.map(item=>{
192
+              if(drugInOrder[i].drug_id == item.drug_id){
193
+                 item.child.push(drugInOrder[i])
194
+              }
195
+            })
196
+          }
197
+          
198
+          console.log("list22333333",list)
199
+            for(let i=0;i<list.length;i++){
200
+            for(let j=0;j<list[i].child.length;j++){
201
+              if(list[i].child[j].count!=null || list[i].child[j].count != "" || list[i].child[j].count!=0){
202
+                list[i].count += list[i].child[j].count
203
+              }
204
+            }
205
+          }
206
+          console.log("list666666666",list)
207
+          this.cancelStockDate = list
208
+        
176
         }
209
         }
177
       })  
210
       })  
178
       },
211
       },
179
       getTotal(){
212
       getTotal(){
180
          var total = 0
213
          var total = 0
181
          for(let i=0;i<this.cancelStockDate.length;i++){
214
          for(let i=0;i<this.cancelStockDate.length;i++){
182
-            total += this.cancelStockDate[i].total_price
215
+            total += this.cancelStockDate[i].price * this.cancelStockDate[i].count
183
          }
216
          }
184
          return total
217
          return total
185
       }
218
       }

+ 42 - 3
src/xt_pages/stock/drugs/drugPrint.vue Bestand weergeven

22
               <td style="line-height: 50px" width="50">单位</td>
22
               <td style="line-height: 50px" width="50">单位</td>
23
               <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>
24
               <td style="line-height:50px" width="80">单价</td>
25
+              <td style="line-height:50px" width="80">总价</td>
25
               <td style="line-height: 50px" width="">备 注</td>
26
               <td style="line-height: 50px" width="">备 注</td>
26
             </tr>
27
             </tr>
27
 
28
 
45
               <td style="line-height:50px">
46
               <td style="line-height:50px">
46
                   {{item.price}}
47
                   {{item.price}}
47
               </td>
48
               </td>
49
+              <td style="line-height:50px">
50
+                 {{(item.warehousing_count*item.price).toFixed(2)}}
51
+              </td>
48
               <td style="line-height: 50px">
52
               <td style="line-height: 50px">
49
                  {{item.remark}}
53
                  {{item.remark}}
50
               </td>
54
               </td>
55
             <tbody>
59
             <tbody>
56
             <tr>
60
             <tr>
57
               <td width="633" style="line-height: 50px">合计</td>
61
               <td width="633" style="line-height: 50px">合计</td>
58
-              <td width="80" style="line-height: 50px">{{getTotal()}}</td>
62
+              <td width="80" style="line-height: 50px">{{getTotal().toFixed(2)}}</td>
59
               <td></td>
63
               <td></td>
60
             </tr>
64
             </tr>
61
 
65
 
164
         if(response.data.state == 1){
168
         if(response.data.state == 1){
165
           var drugInOrder = response.data.data.detail
169
           var drugInOrder = response.data.data.detail
166
           console.log("drug3434444",drugInOrder)
170
           console.log("drug3434444",drugInOrder)
167
-          this.cancelStockDate = drugInOrder
171
+
172
+          let objInfo = {}
173
+          drugInOrder.forEach((item,index)=>{
174
+             let { drug_id } = item
175
+             if(!objInfo[drug_id]){
176
+               objInfo[drug_id] = {
177
+                 drug_id,
178
+                 child:[],
179
+                 drug_name:item.drug_name,
180
+                 drug_spec:item.drug_spec,
181
+                 min_unit:item.min_unit,
182
+                 warehousing_count:0,
183
+                 price:item.price,
184
+                 remark:item.remark,
185
+               }
186
+             }
187
+          })
188
+          let list = Object.values(objInfo);
189
+          console.log("list22333333",list)
190
+         for(let i=0;i<drugInOrder.length;i++){
191
+            list.map(item=>{
192
+              if(drugInOrder[i].drug_id == item.drug_id){
193
+                 item.child.push(drugInOrder[i])
194
+              }
195
+            })
196
+          }
197
+          console.log("list2334444",list)
198
+          for(let i=0;i<list.length;i++){
199
+            for(let j=0;j<list[i].child.length;j++){
200
+              if(list[i].child[j].warehousing_count!=null || list[i].child[j].warehousing_count != "" || list[i].child[j].warehousing_count!=0){
201
+                list[i].warehousing_count += list[i].child[j].warehousing_count
202
+              }
203
+            }
204
+          }
205
+          console.log("list666666666",list)
206
+          this.cancelStockDate = list
168
           var total = response.data.data.total
207
           var total = response.data.data.total
169
           this.total = total
208
           this.total = total
170
         }
209
         }
174
       getTotal(){
213
       getTotal(){
175
         var total = 0
214
         var total = 0
176
         for(let i=0;i<this.cancelStockDate.length;i++){
215
         for(let i=0;i<this.cancelStockDate.length;i++){
177
-           total += this.cancelStockDate[i].price
216
+           total += this.cancelStockDate[i].price*this.cancelStockDate[i].warehousing_count
178
         }
217
         }
179
         return total
218
         return total
180
       }
219
       }

+ 419 - 0
src/xt_pages/stock/drugs/drugQueryPrint.vue Bestand weergeven

1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+      <el-button :loading="loading" size="small" icon="el-icon-printer" @click="printThisPage" type="primary">打印
6
+      </el-button>
7
+    </div>
8
+    <div class="app-container ">
9
+      <div id="dialysis-print-box">
10
+        <div class="dialysis-print-order">
11
+          <div class="order-title">药品管理查询表</div>
12
+          <div style="float: right;margin-bottom: 10px;">{{getDateTwo()}}</div>
13
+
14
+          <table class="print-table" border="1">
15
+            <tbody>
16
+            <tr>
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>
21
+              <td style="line-height: 50px" width="80">入库数量</td>
22
+              <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
+           
28
+            </tr>
29
+
30
+            <tr v-for="(item,index) in WarehouseInfo.warehouseInfoDate" :key="item.id">
31
+              <td style="line-height: 50px">&nbsp;
32
+                {{index+1}}
33
+              </td>
34
+              <td style="line-height: 50px">
35
+                <span> {{ item.drug_name }}</span>
36
+              </td>
37
+              <td style="line-height: 50px">
38
+                   <span>{{ item.drug_spec }}</span>
39
+              </td>
40
+              <td style="line-height: 50px">
41
+                <span>{{getUnit(item.id)}}</span>
42
+              </td>
43
+            
44
+              <td style="line-height: 50px">
45
+                  <span>{{ stockInCount(item) }}</span>
46
+              </td>
47
+              <td style="line-height: 50px">
48
+                  <span>{{ stockOutCount(item) }}</span>
49
+              </td>
50
+              <td> <span>{{ salesReturnCount(item) }}</span ></td>
51
+              <td> <span>{{ cancelStockCount(item) }}</span></td>
52
+              <td>
53
+                <span>{{stockInCount(item) -salesReturnCount(item) -stockOutCount(item) +cancelStockCount(item)}}</span>
54
+             </td> 
55
+              <td style="line-height:50px">
56
+                  {{item.last_price}}
57
+              </td>
58
+            </tr>
59
+            </tbody>
60
+          </table>
61
+        
62
+        </div>
63
+
64
+      </div>
65
+
66
+    </div>
67
+  </div>
68
+
69
+</template>
70
+
71
+<script>
72
+  import { jsGetAge, uParseTime } from '@/utils/tools'
73
+  import BreadCrumb from '@/xt_pages/components/bread-crumb'
74
+  import print from 'print-js'
75
+  import { getAllDrugStockQueryList } from '@/api/drug/drug_stock'
76
+  import { getDictionaryDataConfig } from "@/utils/data";
77
+  import {getBaseDrugLibList} from '@/api/data'
78
+  export default {
79
+    name: 'dialysisPrintOrder',
80
+    components: {
81
+      BreadCrumb
82
+
83
+    },
84
+    data() {
85
+      return {
86
+        crumbs: [
87
+          { path: false, name: '出入库明细' },
88
+          { path: false, name: '打印单' }
89
+        ],
90
+        keywords: '',
91
+        total: 0,
92
+        multipleSelection: [],
93
+        signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
94
+        start_time: '',
95
+        end_time: '',
96
+        page: 1,
97
+        limit: 10000,
98
+        goodType: [],
99
+        goodInfo: [],
100
+        tempArr: [],
101
+        sameRowArr: [],
102
+        WarehouseInfo: {
103
+          loading: false,
104
+          warehouseInfoDate: []
105
+        },
106
+        tableData:[],
107
+        drug_category:0,
108
+        drugCategory:[],
109
+        drug_category:"",
110
+        start_time:"",
111
+        end_time:"",
112
+        list:[],
113
+        is_use:"",
114
+        is_charge:"",
115
+        is_inject:"",
116
+      }
117
+    },
118
+    methods: {
119
+      getDateTwo(){
120
+        var ptime = Math.round(new Date().getTime() / 1000)
121
+        return "打印单日期:"+uParseTime(ptime, '{y}-{m}-{d}')
122
+      },
123
+      getTime(value, temp) {
124
+        if (value == 0) {
125
+          return ''
126
+        }
127
+        if (value != undefined) {
128
+          return uParseTime(value, temp)
129
+        }
130
+        return ''
131
+      },
132
+      printThisPage() {
133
+        var ptime = Math.round(new Date().getTime() / 1000)
134
+        this.print_time = uParseTime(ptime, '{y}-{m}-{d} {h}:{i}')
135
+        const style = '@media print {.dialysis-print-order{width:960px;margin:0 auto}.dialysis-print-order .order-yy-name{margin:auto;text-align:center;font-size:20px;letter-spacing:5px}.dialysis-print-order .order-title{margin:auto;font-weight:600;text-align:center;font-size:22px;padding:10px 20px 20px 20px}.dialysis-print-order .table-box{width:100%;line-height:23px;font-size:14px}.dialysis-print-order .print-table{width:100%;text-align:center;border-collapse:collapse;line-height:25px;font-size:14px}.dialysis-print-order .print-table-no{width:100%;text-align:center;border-collapse:collapse;font-size:14px}.dialysis-print-order .under-line{border-bottom:1px solid #999;width:95%;text-align:center;margin-left:2px}.dialysis-print-order .title-box{text-align:center;font-size:16px;border:1px solid #666}.dialysis-print-order .radio-lebel-box{font-weight:400;cursor:pointer}.dialysis-print-order .radio-no{opacity:0;outline:0;position:absolute;margin:0;width:0;height:0;z-index:-1}.dialysis-print-order .radio-inner{white-space:nowrap;cursor:pointer;outline:0;display:inline-block;line-height:1;position:relative;vertical-align:middle}.dialysis-print-order .radio-fang{display:inline-block;position:relative;border:1px solid #000;box-sizing:border-box;width:14px;height:14px;background-color:#fff;z-index:1;transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46)}.dialysis-print-order .is-checked-radio::after{content:"√";font-size:15px}}.dialysis-print-order .print-table-no tr td { padding: 8px 5px; line-height: 25px; }.es-img{height: 20px; }.advice-name{text-align: left;}.advice-children{display:flex;} .dialysis-print-order .print-table tr td{padding: 0px 0px;} .print-template-two tr {line-height: 30px;}   .title-box-pro{border: 0 #fff;line-height: 40px;height: 40px;text-align: left;padding-left: 10px !important;}  .text-align-left{text-align: left !important;padding-left:10px !important;font-size: 14px !important;line-height: 25px;}'
136
+        printJS({
137
+          printable: 'dialysis-print-box',
138
+          type: 'html',
139
+          style: style,
140
+          scanStyles: false
141
+        })
142
+      },
143
+   
144
+      getUnit(id){
145
+        var name = ""
146
+        for(let i=0;i<this.list.length;i++){
147
+          if(this.list[i].id == id){
148
+            name = this.list[i].min_unit
149
+          }
150
+        }
151
+        return name
152
+      },
153
+   
154
+       GetAllDrugStockQueryList() {
155
+        const Params = {
156
+          page: this.page,
157
+          limit: this.limit,
158
+          keyword: this.$route.query.keyword,
159
+          drug_category:this.$route.query.drug_category,
160
+          start_time:this.$route.query.start_time,
161
+          end_time:this.$route.query.end_time,
162
+        }
163
+        console.log("parasm22222",Params)
164
+        this.WarehouseInfo.warehouseInfoDate = []
165
+        getAllDrugStockQueryList(Params).then(response => {
166
+          if (response.data.state == 0) {
167
+            
168
+            this.$message.error(response.data.msg)
169
+            return false
170
+          } else {
171
+            
172
+            this.total = response.data.data.total
173
+            var arr = []
174
+            for (let i = 0; i < response.data.data.list.length; i++) {
175
+              this.WarehouseInfo.warehouseInfoDate.push(response.data.data.list[i])
176
+              
177
+            }
178
+            console.log("数据源头",this.WarehouseInfo.warehouseInfoDate)
179
+          }
180
+        })
181
+      },
182
+     getSpecificationName: function(id) {
183
+        let name = ''
184
+        for (let i = 0; i < this.goodInfo.length; i++) {
185
+          if (this.goodInfo[i].id == id) {
186
+            name = this.goodInfo[i].specification_name
187
+          }
188
+        }
189
+        return name
190
+      },
191
+      getTypeName: function(id) {
192
+        let name = ''
193
+        for (let i = 0; i < this.goodType.length; i++) {
194
+          if (this.goodType[i].id == id) {
195
+            name = this.goodType[i].type_name
196
+          }
197
+        }
198
+        return name
199
+      },
200
+      stockInCount: function(row) {
201
+        let total = 0
202
+        for (let i = 0; i < row.query_drug_warehousing_info.length; i++) {
203
+          total = total + row.query_drug_warehousing_info[i].warehousing_count
204
+        }
205
+        return total
206
+      },
207
+      salesReturnCount: function(row) {
208
+        let total = 0
209
+
210
+        for (let i = 0; i < row.query_drug_sales_return_info.length; i++) {
211
+          total = total + row.query_drug_sales_return_info[i].count
212
+        }
213
+        return total
214
+      },
215
+      stockOutCount: function(row) {
216
+        let total = 0
217
+
218
+        for (let i = 0; i < row.query_drug_warehouseout_info.length; i++) {
219
+          total = total + row.query_drug_warehouseout_info[i].count
220
+        }
221
+        return total
222
+      },
223
+      cancelStockCount: function(row) {
224
+        let total = 0
225
+        for (let i = 0; i < row.query_drug_cancel_stock_info.length; i++) {
226
+          total = total + row.query_drug_cancel_stock_info[i].count
227
+        }
228
+        return total
229
+      },
230
+      getDictionaryDataConfig(module, filed_name) {
231
+        return getDictionaryDataConfig(module, filed_name)
232
+      },
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
241
+        }
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])
251
+            }
252
+            console.log("list222222",this.list)
253
+          }
254
+        })
255
+      },
256
+    },
257
+    created() {
258
+      this.GetAllDrugStockQueryList()
259
+      var drugCategory = getDictionaryDataConfig('system','drug_category')
260
+      this.drugCategory.push(...drugCategory)
261
+      this.getList()
262
+    }
263
+
264
+  }
265
+</script>
266
+
267
+<style>
268
+  .dialysis-print-order {
269
+    width: 960px;
270
+    margin: 0 auto
271
+  }
272
+
273
+  .dialysis-print-order .order-yy-name {
274
+    margin: auto;
275
+    text-align: center;
276
+    font-size: 20px;
277
+    letter-spacing: 5px;
278
+  }
279
+
280
+  .dialysis-print-order .order-title {
281
+    margin: auto;
282
+    font-weight: 600;
283
+    text-align: center;
284
+    font-size: 22px;
285
+    padding: 10px 20px 20px 20px;
286
+  }
287
+
288
+  .dialysis-print-order .table-box {
289
+
290
+    width: 100%;
291
+    line-height: 23px;
292
+    font-size: 14px;
293
+  }
294
+
295
+  .dialysis-print-order .print-table {
296
+    width: 100%;
297
+    text-align: center;
298
+    border-collapse: collapse;
299
+    line-height: 40px;
300
+    font-size: 14px;
301
+  }
302
+
303
+  .dialysis-print-order .print-table-no {
304
+    width: 100%;
305
+    text-align: center;
306
+    border-collapse: collapse;
307
+    font-size: 14px;
308
+  }
309
+
310
+  .dialysis-print-order .under-line {
311
+    border-bottom: 1px solid #999;
312
+    width: 95%;
313
+    text-align: center;
314
+    margin-left: 2px;
315
+
316
+
317
+  }
318
+
319
+  .dialysis-print-order .title-box {
320
+    text-align: center;
321
+    font-size: 16px;
322
+  }
323
+
324
+  .dialysis-print-order .radio-lebel-box {
325
+    font-weight: 400;
326
+    cursor: pointer;
327
+  }
328
+
329
+  .dialysis-print-order .radio-no {
330
+    opacity: 0;
331
+    outline: none;
332
+    position: absolute;
333
+    margin: 0;
334
+    width: 0;
335
+    height: 0;
336
+    z-index: -1;
337
+  }
338
+
339
+  .dialysis-print-order .radio-inner {
340
+    white-space: nowrap;
341
+    cursor: pointer;
342
+    outline: none;
343
+    display: inline-block;
344
+    line-height: 1;
345
+    position: relative;
346
+    vertical-align: middle;
347
+  }
348
+
349
+  .dialysis-print-order .radio-fang {
350
+    display: inline-block;
351
+    position: relative;
352
+    border: 1px solid #000;
353
+    box-sizing: border-box;
354
+    width: 14px;
355
+    height: 14px;
356
+    background-color: #fff;
357
+    z-index: 1;
358
+    transition: border-color .25s cubic-bezier(.71, -.46, .29, 1.46), background-color .25s cubic-bezier(.71, -.46, .29, 1.46);
359
+  }
360
+
361
+  .dialysis-print-order .is-checked-radio::after {
362
+    content: "√";
363
+    font-size: 15px;
364
+  }
365
+
366
+
367
+  .dialysis-print-order .print-table-no tr td {
368
+    padding: 8px 5px;
369
+    line-height: 25px;
370
+  }
371
+
372
+  .dialysis-print-order .print-table tr td {
373
+    padding: 1px 1px;
374
+    /*line-height: 25px;*/
375
+  }
376
+
377
+  .es-img {
378
+    height: 25px;
379
+  }
380
+
381
+  .advice-name {
382
+    text-align: left;
383
+  }
384
+
385
+  .advice-children {
386
+    display: flex;
387
+  }
388
+
389
+  .title-box-pro {
390
+    border: 0 #fff;
391
+    line-height: 25px;
392
+    height: 25px;
393
+    text-align: left;
394
+    padding-left: 10px !important;
395
+  }
396
+
397
+  .title-box-pro-tr {
398
+    border: 0 #fff;
399
+  }
400
+
401
+  .text-align-left {
402
+    text-align: left !important;
403
+    padding-left: 10px !important;
404
+    font-size: 14px !important;
405
+    line-height: 25px;
406
+  }
407
+
408
+  .print-table-tr-new td {
409
+    line-height: 20px !important;
410
+  }
411
+
412
+  .border-top-solid {
413
+    border: solid 1px #000;
414
+  }
415
+
416
+  .print-template-two tr {
417
+    line-height: 30px;
418
+  }
419
+</style>

+ 8 - 3
src/xt_pages/stock/drugs/drugStockInOrderDetail.vue Bestand weergeven

14
       <div class="filter-container">
14
       <div class="filter-container">
15
         <span style="font-size: 18px;color: #606266">入库单详情</span>
15
         <span style="font-size: 18px;color: #606266">入库单详情</span>
16
         <el-row style="float:right;">
16
         <el-row style="float:right;">
17
-          <span style="color: #606266"
18
-            >入库单号: {{ WarehouseInfo.warehouse.warehousing_order }}</span
19
-          >
17
+          <span style="color: #606266">入库单号: {{ WarehouseInfo.warehouse.warehousing_order }}</span>&nbsp;&nbsp;
18
+          <span><el-button size="small" type="primary" @click="printOrder">打印</el-button></span>
20
         </el-row>
19
         </el-row>
21
       </div>
20
       </div>
22
 
21
 
243
     },
242
     },
244
     editRecord: function() {
243
     editRecord: function() {
245
       this.$emit("edit-record");
244
       this.$emit("edit-record");
245
+    },
246
+    printOrder(){
247
+      this.$router.push({
248
+        name: "drugInOrderDetailPrint",
249
+        query: { id: this.$route.query.id }
250
+      });
246
     }
251
     }
247
   }
252
   }
248
 };
253
 };

+ 382 - 0
src/xt_pages/stock/drugs/drugStockInOrderDetailPrint.vue Bestand weergeven

1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+      <el-button :loading="loading" size="small" icon="el-icon-printer" @click="printThisPage" type="primary">打印
6
+      </el-button>
7
+    </div>
8
+    <div class="app-container ">
9
+      <div id="dialysis-print-box">
10
+        <div class="dialysis-print-order">
11
+          <div class="order-title">药品入库登记表</div>
12
+         
13
+          <div style="float: right;margin-bottom: 10px;">{{getDateTwo()}}</div>
14
+
15
+          <table class="print-table" border="1">
16
+            <tbody>
17
+            <tr>
18
+              <td style="line-height: 50px" width="50">序号</td>
19
+              <td style="line-height: 50px" width="250">药品名称</td>
20
+              <td style="line-height: 50px" width="250">规格型号</td>
21
+              <td style="line-height: 50px" width="50">单位</td>
22
+              <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
+            </tr>
26
+
27
+            <tr v-for="(item,index) in WarehouseInfo.warehouseInfoDate" :key="item.id">
28
+              <td style="line-height: 50px">&nbsp;
29
+                {{index+1}}
30
+              </td>
31
+              <td style="line-height: 50px">
32
+                 <span v-if="item.drug_id != 0">{{item.drug.drug_name}}</span>
33
+              </td>
34
+              <td style="line-height: 50px">
35
+                 <span v-if="item.drug_id != 0">{{item.drug?item.drug.drug_spec:''}}</span>
36
+              </td>
37
+              <td style="line-height: 50px">
38
+                <span>{{getUnit(item.drug_id)}}</span>
39
+              </td>
40
+            
41
+              <td style="line-height: 50px">
42
+                   <span>{{ item.warehousing_count }}</span>
43
+              </td>
44
+              <td style="line-height:50px">
45
+                  {{item.price}}
46
+              </td>
47
+             <td style="line-height:50px">
48
+                <span>{{(item.warehousing_count * item.price).toFixed(2)}}</span>
49
+             </td>
50
+            </tr>
51
+            <tr>
52
+              <td>合计</td>
53
+              <td colspan="5"></td>
54
+              <td>{{allPrice.toFixed(2)}}</td>
55
+            </tr>
56
+            </tbody>
57
+          </table>
58
+        
59
+
60
+          <div style="display:flex;margin-top:20px;float:right;">
61
+            <div style="width:50px;">审批:</div><div style="width:100px;"></div>
62
+            <div style="width:80px;">药材主任:</div><div style="width:100px;"></div>
63
+            <div style="width:50px;">会计:</div><div style="width:100px;"></div>
64
+            <div style="width:50px;">审核:</div><div style="width:100px;"></div>
65
+            <div style="width:70px;">制单人:</div><div style="width:100px;"></div>
66
+          </div>
67
+        </div>
68
+
69
+      </div>
70
+
71
+    </div>
72
+  </div>
73
+
74
+</template>
75
+
76
+<script>
77
+  import { getPrintStockGood } from '@/api/stock'
78
+  import { getDataConfig } from '@/utils/data'
79
+  import { jsGetAge, uParseTime } from '@/utils/tools'
80
+  import BreadCrumb from '@/xt_pages/components/bread-crumb'
81
+  import print from 'print-js'
82
+  import {getDrugWarehouseInfoList} from "@/api/drug/drug_stock";
83
+  import {getBaseDrugLibList} from '@/api/data'
84
+  export default {
85
+    name: 'dialysisPrintOrder',
86
+    components: {
87
+      BreadCrumb
88
+
89
+    },
90
+    data() {
91
+      return {
92
+        crumbs: [
93
+          { path: false, name: '出入库明细' },
94
+          { path: false, name: '打印单' }
95
+        ],
96
+        isEdit: 0,
97
+        checked: false,
98
+        signAndWeighBoxPatients: "sign-and-weigh-box-patients",
99
+        goodType: [],
100
+        goodInfo: [],
101
+        manufacturer: [],
102
+        dealer: [],
103
+        Warehouse: {
104
+          loading: false,
105
+          warehouseDate: [],
106
+          tableCurrentIndex: ""
107
+        },
108
+
109
+        WarehouseInfo: {
110
+          loading: false,
111
+          warehouseInfoDate: [],
112
+          warehouse: {}
113
+        },
114
+        allPrice:0,
115
+        start_time:"",
116
+        end_time:"",
117
+        list:[],
118
+        is_use:"",
119
+        is_charge:"",
120
+        is_inject:"",
121
+        page:1,
122
+        limit:10000,
123
+        keywords:""
124
+      }
125
+    },
126
+    methods: {
127
+      getDateOne(){
128
+        return "入库日期: "+this.start_time +"~"+this.end_time
129
+      },
130
+      getDateTwo(){
131
+        var ptime = Math.round(new Date().getTime() / 1000)
132
+        return "打印单日期:"+uParseTime(ptime, '{y}-{m}-{d}')
133
+      },
134
+      getTime(value, temp) {
135
+        if (value == 0) {
136
+          return ''
137
+        }
138
+        if (value != undefined) {
139
+          return uParseTime(value, temp)
140
+        }
141
+        return ''
142
+      },
143
+     
144
+      printThisPage() {
145
+        var ptime = Math.round(new Date().getTime() / 1000)
146
+        this.print_time = uParseTime(ptime, '{y}-{m}-{d} {h}:{i}')
147
+        const style = '@media print {.dialysis-print-order{width:960px;margin:0 auto}.dialysis-print-order .order-yy-name{margin:auto;text-align:center;font-size:20px;letter-spacing:5px}.dialysis-print-order .order-title{margin:auto;font-weight:600;text-align:center;font-size:22px;padding:10px 20px 20px 20px}.dialysis-print-order .table-box{width:100%;line-height:23px;font-size:14px}.dialysis-print-order .print-table{width:100%;text-align:center;border-collapse:collapse;line-height:25px;font-size:14px}.dialysis-print-order .print-table-no{width:100%;text-align:center;border-collapse:collapse;font-size:14px}.dialysis-print-order .under-line{border-bottom:1px solid #999;width:95%;text-align:center;margin-left:2px}.dialysis-print-order .title-box{text-align:center;font-size:16px;border:1px solid #666}.dialysis-print-order .radio-lebel-box{font-weight:400;cursor:pointer}.dialysis-print-order .radio-no{opacity:0;outline:0;position:absolute;margin:0;width:0;height:0;z-index:-1}.dialysis-print-order .radio-inner{white-space:nowrap;cursor:pointer;outline:0;display:inline-block;line-height:1;position:relative;vertical-align:middle}.dialysis-print-order .radio-fang{display:inline-block;position:relative;border:1px solid #000;box-sizing:border-box;width:14px;height:14px;background-color:#fff;z-index:1;transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46)}.dialysis-print-order .is-checked-radio::after{content:"√";font-size:15px}}.dialysis-print-order .print-table-no tr td { padding: 8px 5px; line-height: 25px; }.es-img{height: 20px; }.advice-name{text-align: left;}.advice-children{display:flex;} .dialysis-print-order .print-table tr td{padding: 0px 0px;} .print-template-two tr {line-height: 30px;}   .title-box-pro{border: 0 #fff;line-height: 40px;height: 40px;text-align: left;padding-left: 10px !important;}  .text-align-left{text-align: left !important;padding-left:10px !important;font-size: 14px !important;line-height: 25px;}'
148
+        printJS({
149
+          printable: 'dialysis-print-box',
150
+          type: 'html',
151
+          style: style,
152
+          scanStyles: false
153
+        })
154
+      },
155
+   
156
+      getUnit(id){
157
+        var name = ""
158
+        for(let i=0;i<this.goodUnit.length;i++){
159
+          if(this.goodUnit[i].id == id){
160
+            name = this.goodUnit[i].name
161
+          }
162
+        }
163
+        return name
164
+      },
165
+      GetOrderDetail: function(order_id) {
166
+        const params = {
167
+          id: order_id
168
+        };
169
+      getDrugWarehouseInfoList(params).then(response => {
170
+        if (response.data.state == 0) {
171
+          this.$message.error(response.data.msg);
172
+          return false;
173
+        } else {
174
+          for (let i = 0; i < response.data.data.info.length; i++) {
175
+            this.WarehouseInfo.warehouseInfoDate.push(response.data.data.info[i]);
176
+          }
177
+          console.log("数据源",this.WarehouseInfo.warehouseInfoDate)
178
+          var total_price = 0
179
+          for(let i=0;i<this.WarehouseInfo.warehouseInfoDate.length;i++){
180
+            total_price += this.WarehouseInfo.warehouseInfoDate[i].warehousing_count * this.WarehouseInfo.warehouseInfoDate[i].price
181
+          }
182
+          console.log("total_price",total_price)
183
+          this.allPrice = total_price
184
+          this.WarehouseInfo.warehouse = response.data.data.warehousing;
185
+        }
186
+      });
187
+    },
188
+     getList() {
189
+        let params = {
190
+          page: this.page,
191
+          limit: this.limit,
192
+          keyword: this.keywords,
193
+          is_use: this.is_use,
194
+          is_charge: this.is_charge,
195
+          is_inject: this.is_inject
196
+        }
197
+        getBaseDrugLibList(params).then(response => {
198
+          if (response.data.state == 0) {
199
+            this.$message.error(response.data.msg)
200
+            return false
201
+          } else {
202
+            this.total = response.data.data.total
203
+            this.list = []
204
+            for (let i = 0; i < response.data.data.list.length; i++) {
205
+              this.list.push(response.data.data.list[i])
206
+            }
207
+            console.log("list222222",this.list)
208
+          }
209
+        })
210
+      },
211
+      getUnit(id){
212
+        var name = ""
213
+        for(let i=0;i<this.list.length;i++){
214
+          if(this.list[i].id == id){
215
+            name = this.list[i].min_unit
216
+          }
217
+        }
218
+        return name
219
+      },
220
+    },
221
+    created() {
222
+      const order_id = this.$route.query.id;
223
+      this.GetOrderDetail(order_id);
224
+      this.getList()
225
+    }
226
+
227
+  }
228
+</script>
229
+
230
+<style>
231
+  .dialysis-print-order {
232
+    width: 960px;
233
+    margin: 0 auto
234
+  }
235
+
236
+  .dialysis-print-order .order-yy-name {
237
+    margin: auto;
238
+    text-align: center;
239
+    font-size: 20px;
240
+    letter-spacing: 5px;
241
+  }
242
+
243
+  .dialysis-print-order .order-title {
244
+    margin: auto;
245
+    font-weight: 600;
246
+    text-align: center;
247
+    font-size: 22px;
248
+    padding: 10px 20px 20px 20px;
249
+  }
250
+
251
+  .dialysis-print-order .table-box {
252
+
253
+    width: 100%;
254
+    line-height: 23px;
255
+    font-size: 14px;
256
+  }
257
+
258
+  .dialysis-print-order .print-table {
259
+    width: 100%;
260
+    text-align: center;
261
+    border-collapse: collapse;
262
+    line-height: 40px;
263
+    font-size: 14px;
264
+  }
265
+
266
+  .dialysis-print-order .print-table-no {
267
+    width: 100%;
268
+    text-align: center;
269
+    border-collapse: collapse;
270
+    font-size: 14px;
271
+  }
272
+
273
+  .dialysis-print-order .under-line {
274
+    border-bottom: 1px solid #999;
275
+    width: 95%;
276
+    text-align: center;
277
+    margin-left: 2px;
278
+
279
+
280
+  }
281
+
282
+  .dialysis-print-order .title-box {
283
+    text-align: center;
284
+    font-size: 16px;
285
+  }
286
+
287
+  .dialysis-print-order .radio-lebel-box {
288
+    font-weight: 400;
289
+    cursor: pointer;
290
+  }
291
+
292
+  .dialysis-print-order .radio-no {
293
+    opacity: 0;
294
+    outline: none;
295
+    position: absolute;
296
+    margin: 0;
297
+    width: 0;
298
+    height: 0;
299
+    z-index: -1;
300
+  }
301
+
302
+  .dialysis-print-order .radio-inner {
303
+    white-space: nowrap;
304
+    cursor: pointer;
305
+    outline: none;
306
+    display: inline-block;
307
+    line-height: 1;
308
+    position: relative;
309
+    vertical-align: middle;
310
+  }
311
+
312
+  .dialysis-print-order .radio-fang {
313
+    display: inline-block;
314
+    position: relative;
315
+    border: 1px solid #000;
316
+    box-sizing: border-box;
317
+    width: 14px;
318
+    height: 14px;
319
+    background-color: #fff;
320
+    z-index: 1;
321
+    transition: border-color .25s cubic-bezier(.71, -.46, .29, 1.46), background-color .25s cubic-bezier(.71, -.46, .29, 1.46);
322
+  }
323
+
324
+  .dialysis-print-order .is-checked-radio::after {
325
+    content: "√";
326
+    font-size: 15px;
327
+  }
328
+
329
+
330
+  .dialysis-print-order .print-table-no tr td {
331
+    padding: 8px 5px;
332
+    line-height: 25px;
333
+  }
334
+
335
+  .dialysis-print-order .print-table tr td {
336
+    padding: 1px 1px;
337
+    /*line-height: 25px;*/
338
+  }
339
+
340
+  .es-img {
341
+    height: 25px;
342
+  }
343
+
344
+  .advice-name {
345
+    text-align: left;
346
+  }
347
+
348
+  .advice-children {
349
+    display: flex;
350
+  }
351
+
352
+  .title-box-pro {
353
+    border: 0 #fff;
354
+    line-height: 25px;
355
+    height: 25px;
356
+    text-align: left;
357
+    padding-left: 10px !important;
358
+  }
359
+
360
+  .title-box-pro-tr {
361
+    border: 0 #fff;
362
+  }
363
+
364
+  .text-align-left {
365
+    text-align: left !important;
366
+    padding-left: 10px !important;
367
+    font-size: 14px !important;
368
+    line-height: 25px;
369
+  }
370
+
371
+  .print-table-tr-new td {
372
+    line-height: 20px !important;
373
+  }
374
+
375
+  .border-top-solid {
376
+    border: solid 1px #000;
377
+  }
378
+
379
+  .print-template-two tr {
380
+    line-height: 30px;
381
+  }
382
+</style>

+ 8 - 4
src/xt_pages/stock/drugs/drugStockOutOrderDetail.vue Bestand weergeven

11
       <div class="filter-container">
11
       <div class="filter-container">
12
         <span style="font-size: 18px;color: #606266">出库单详情</span>
12
         <span style="font-size: 18px;color: #606266">出库单详情</span>
13
         <el-row style="float:right;">
13
         <el-row style="float:right;">
14
-          <span style="color: #606266">{{warehousingOutInfo.info.warehouse_out_order_number}}</span>
14
+          <span style="color: #606266">{{warehousingOutInfo.info.warehouse_out_order_number}}</span>&nbsp;&nbsp;
15
+          <span><el-button size="small" type="primary" @click="printOrder">打印</el-button></span>
15
         </el-row>
16
         </el-row>
16
       </div>
17
       </div>
17
 
18
 
253
           }
254
           }
254
         })
255
         })
255
         this.sameRowArr = sameRowArr
256
         this.sameRowArr = sameRowArr
256
-
257
-
258
-
257
+      },
258
+      printOrder(){
259
+        this.$router.push({
260
+          name: "drugOutOrderDetailPrint",
261
+          query: { id: this.$route.query.id }
262
+        });
259
       }
263
       }
260
     }
264
     }
261
   }
265
   }

+ 374 - 0
src/xt_pages/stock/drugs/drugStockOutOrderDetailPrint.vue Bestand weergeven

1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+      <el-button :loading="loading" size="small" icon="el-icon-printer" @click="printThisPage" type="primary">打印
6
+      </el-button>
7
+    </div>
8
+    <div class="app-container ">
9
+      <div id="dialysis-print-box">
10
+        <div class="dialysis-print-order">
11
+         <div class="order-yy-name">{{orgname}}</div>
12
+          <div class="order-title">药品出库登记表</div>
13
+         
14
+          <div style="float: right;margin-bottom: 10px;">{{getDateTwo()}}</div>
15
+
16
+          <table class="print-table" border="1">
17
+            <tbody>
18
+            <tr>
19
+              <td style="line-height: 50px" width="50">序号</td>
20
+              <td style="line-height: 50px" width="250">药品名称</td>
21
+              <td style="line-height: 50px" width="250">规格型号</td>
22
+              <td style="line-height: 50px" width="50">单位</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="">总价</td>
26
+            </tr>
27
+
28
+            <tr v-for="(item,index) in warehousingOutInfo.warehousingOutData" :key="item.id">
29
+              <td style="line-height: 50px">&nbsp;
30
+                {{index+1}}
31
+              </td>
32
+              <td style="line-height: 50px">
33
+                <span v-if="item.drug_id != 0">{{item.drug.drug_name}}</span>
34
+              </td>
35
+              <td style="line-height: 50px">
36
+                  <span v-if="item.drug_id != 0">{{item.drug?item.drug.drug_spec:''}}</span>
37
+              </td>
38
+              <td style="line-height: 50px">
39
+                <span>{{getUnit(item.drug_id)}}</span>
40
+              </td>
41
+            
42
+              <td style="line-height: 50px">
43
+                  {{item.count}}
44
+              </td>
45
+              <td style="line-height:50px">
46
+                  {{item.price}}
47
+              </td>
48
+             <td  style="line-height:50px">
49
+                {{(item.count * item.price).toFixed(2)}}
50
+             </td>
51
+            </tr>
52
+             <tr>
53
+               <td style="line-height:50px">合计</td>
54
+               <td colspan="5"></td>
55
+               <td>{{allPrice.toFixed(2)}}</td>
56
+             </tr>
57
+            </tbody>
58
+          </table>
59
+        
60
+
61
+          <div style="display:flex;margin-top:20px;float:right;">
62
+            <div style="width:50px;">审批:</div><div style="width:100px;"></div>
63
+            <div style="width:80px;">药材主任:</div><div style="width:100px;"></div>
64
+            <div style="width:50px;">会计:</div><div style="width:100px;"></div>
65
+            <div style="width:50px;">审核:</div><div style="width:100px;"></div>
66
+            <div style="width:70px;">制单人:</div><div style="width:100px;"></div>
67
+          </div>
68
+        </div>
69
+
70
+      </div>
71
+
72
+    </div>
73
+  </div>
74
+
75
+</template>
76
+
77
+<script>
78
+  import { getPrintStockGood } from '@/api/stock'
79
+  import { getDataConfig } from '@/utils/data'
80
+  import { jsGetAge, uParseTime } from '@/utils/tools'
81
+  import BreadCrumb from '@/xt_pages/components/bread-crumb'
82
+  import print from 'print-js'
83
+  import {  getDrugWarehouseOutInfo } from '@/api/drug/drug_stock'
84
+  import {getBaseDrugLibList} from '@/api/data'
85
+  export default {
86
+    name: 'dialysisPrintOrder',
87
+    components: {
88
+      BreadCrumb
89
+
90
+    },
91
+    data() {
92
+      return {
93
+        crumbs: [
94
+          { path: false, name: '出入库明细' },
95
+          { path: false, name: '打印单' }
96
+        ],
97
+        isEdit: 0,
98
+        checked: false,
99
+        signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
100
+        goodType: [],
101
+        goodInfo: [],
102
+        manufacturer: [],
103
+        dealer: [],
104
+
105
+        warehousingOutInfo: {
106
+          loading: false,
107
+          warehousingOutData: [],
108
+          info: {}
109
+        },
110
+        allPrice:0,
111
+        start_time:"",
112
+        end_time:"",
113
+        list:[],
114
+        is_use:"",
115
+        is_charge:"",
116
+        is_inject:"",
117
+        page:1,
118
+        limit:10000,
119
+        keywords:""
120
+      }
121
+    },
122
+    methods: {
123
+      getDateTwo(){
124
+        var ptime = Math.round(new Date().getTime() / 1000)
125
+        return "打印单日期:"+uParseTime(ptime, '{y}-{m}-{d}')
126
+      },
127
+      getTime(value, temp) {
128
+        if (value == 0) {
129
+          return ''
130
+        }
131
+        if (value != undefined) {
132
+          return uParseTime(value, temp)
133
+        }
134
+        return ''
135
+      },
136
+      printThisPage() {
137
+        var ptime = Math.round(new Date().getTime() / 1000)
138
+        this.print_time = uParseTime(ptime, '{y}-{m}-{d} {h}:{i}')
139
+        const style = '@media print {.dialysis-print-order{width:960px;margin:0 auto}.dialysis-print-order .order-yy-name{margin:auto;text-align:center;font-size:20px;letter-spacing:5px}.dialysis-print-order .order-title{margin:auto;font-weight:600;text-align:center;font-size:22px;padding:10px 20px 20px 20px}.dialysis-print-order .table-box{width:100%;line-height:23px;font-size:14px}.dialysis-print-order .print-table{width:100%;text-align:center;border-collapse:collapse;line-height:25px;font-size:14px}.dialysis-print-order .print-table-no{width:100%;text-align:center;border-collapse:collapse;font-size:14px}.dialysis-print-order .under-line{border-bottom:1px solid #999;width:95%;text-align:center;margin-left:2px}.dialysis-print-order .title-box{text-align:center;font-size:16px;border:1px solid #666}.dialysis-print-order .radio-lebel-box{font-weight:400;cursor:pointer}.dialysis-print-order .radio-no{opacity:0;outline:0;position:absolute;margin:0;width:0;height:0;z-index:-1}.dialysis-print-order .radio-inner{white-space:nowrap;cursor:pointer;outline:0;display:inline-block;line-height:1;position:relative;vertical-align:middle}.dialysis-print-order .radio-fang{display:inline-block;position:relative;border:1px solid #000;box-sizing:border-box;width:14px;height:14px;background-color:#fff;z-index:1;transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46)}.dialysis-print-order .is-checked-radio::after{content:"√";font-size:15px}}.dialysis-print-order .print-table-no tr td { padding: 8px 5px; line-height: 25px; }.es-img{height: 20px; }.advice-name{text-align: left;}.advice-children{display:flex;} .dialysis-print-order .print-table tr td{padding: 0px 0px;} .print-template-two tr {line-height: 30px;}   .title-box-pro{border: 0 #fff;line-height: 40px;height: 40px;text-align: left;padding-left: 10px !important;}  .text-align-left{text-align: left !important;padding-left:10px !important;font-size: 14px !important;line-height: 25px;}'
140
+        printJS({
141
+          printable: 'dialysis-print-box',
142
+          type: 'html',
143
+          style: style,
144
+          scanStyles: false
145
+        })
146
+      },
147
+   
148
+      getUnit(id){
149
+        var name = ""
150
+        for(let i=0;i<this.goodUnit.length;i++){
151
+          if(this.goodUnit[i].id == id){
152
+            name = this.goodUnit[i].name
153
+          }
154
+        }
155
+        return name
156
+      },
157
+    GetOrderDetail: function(order_id) {
158
+            const params = {
159
+            'id': order_id
160
+            }
161
+            getDrugWarehouseOutInfo(params).then(response => {
162
+            if (response.data.state == 0) {
163
+
164
+                this.$message.error(response.data.msg)
165
+                return false
166
+            } else {
167
+              for (let i = 0; i < response.data.data.list.length; i++) {
168
+                this.warehousingOutInfo.warehousingOutData.push(response.data.data.list[i])
169
+               }
170
+               var total_price = 0
171
+               for(let i=0;i<this.warehousingOutInfo.warehousingOutData.length;i++){
172
+                 total_price += this.warehousingOutInfo.warehousingOutData[i].count * this.warehousingOutInfo.warehousingOutData[i].price
173
+               }
174
+               this.allPrice = total_price
175
+               this.warehousingOutInfo.info = response.data.data.info
176
+               this.handleSpanTempArr()
177
+            }
178
+            })
179
+        },
180
+        getList() {
181
+        let params = {
182
+          page: this.page,
183
+          limit: this.limit,
184
+          keyword: this.keywords,
185
+          is_use: this.is_use,
186
+          is_charge: this.is_charge,
187
+          is_inject: this.is_inject
188
+        }
189
+        getBaseDrugLibList(params).then(response => {
190
+          if (response.data.state == 0) {
191
+            this.$message.error(response.data.msg)
192
+            return false
193
+          } else {
194
+            this.total = response.data.data.total
195
+            this.list = []
196
+            for (let i = 0; i < response.data.data.list.length; i++) {
197
+              this.list.push(response.data.data.list[i])
198
+            }
199
+            console.log("list222222",this.list)
200
+          }
201
+        })
202
+      },
203
+      getUnit(id){
204
+        var name = ""
205
+        for(let i=0;i<this.list.length;i++){
206
+          if(this.list[i].id == id){
207
+            name = this.list[i].min_unit
208
+          }
209
+        }
210
+        return name
211
+      },
212
+    },
213
+    created() {
214
+      const order_id = this.$route.query.id
215
+      this.GetOrderDetail(order_id)
216
+      this.getList()
217
+    }
218
+
219
+  }
220
+</script>
221
+
222
+<style>
223
+  .dialysis-print-order {
224
+    width: 960px;
225
+    margin: 0 auto
226
+  }
227
+
228
+  .dialysis-print-order .order-yy-name {
229
+    margin: auto;
230
+    text-align: center;
231
+    font-size: 20px;
232
+    letter-spacing: 5px;
233
+  }
234
+
235
+  .dialysis-print-order .order-title {
236
+    margin: auto;
237
+    font-weight: 600;
238
+    text-align: center;
239
+    font-size: 22px;
240
+    padding: 10px 20px 20px 20px;
241
+  }
242
+
243
+  .dialysis-print-order .table-box {
244
+
245
+    width: 100%;
246
+    line-height: 23px;
247
+    font-size: 14px;
248
+  }
249
+
250
+  .dialysis-print-order .print-table {
251
+    width: 100%;
252
+    text-align: center;
253
+    border-collapse: collapse;
254
+    line-height: 40px;
255
+    font-size: 14px;
256
+  }
257
+
258
+  .dialysis-print-order .print-table-no {
259
+    width: 100%;
260
+    text-align: center;
261
+    border-collapse: collapse;
262
+    font-size: 14px;
263
+  }
264
+
265
+  .dialysis-print-order .under-line {
266
+    border-bottom: 1px solid #999;
267
+    width: 95%;
268
+    text-align: center;
269
+    margin-left: 2px;
270
+
271
+
272
+  }
273
+
274
+  .dialysis-print-order .title-box {
275
+    text-align: center;
276
+    font-size: 16px;
277
+  }
278
+
279
+  .dialysis-print-order .radio-lebel-box {
280
+    font-weight: 400;
281
+    cursor: pointer;
282
+  }
283
+
284
+  .dialysis-print-order .radio-no {
285
+    opacity: 0;
286
+    outline: none;
287
+    position: absolute;
288
+    margin: 0;
289
+    width: 0;
290
+    height: 0;
291
+    z-index: -1;
292
+  }
293
+
294
+  .dialysis-print-order .radio-inner {
295
+    white-space: nowrap;
296
+    cursor: pointer;
297
+    outline: none;
298
+    display: inline-block;
299
+    line-height: 1;
300
+    position: relative;
301
+    vertical-align: middle;
302
+  }
303
+
304
+  .dialysis-print-order .radio-fang {
305
+    display: inline-block;
306
+    position: relative;
307
+    border: 1px solid #000;
308
+    box-sizing: border-box;
309
+    width: 14px;
310
+    height: 14px;
311
+    background-color: #fff;
312
+    z-index: 1;
313
+    transition: border-color .25s cubic-bezier(.71, -.46, .29, 1.46), background-color .25s cubic-bezier(.71, -.46, .29, 1.46);
314
+  }
315
+
316
+  .dialysis-print-order .is-checked-radio::after {
317
+    content: "√";
318
+    font-size: 15px;
319
+  }
320
+
321
+
322
+  .dialysis-print-order .print-table-no tr td {
323
+    padding: 8px 5px;
324
+    line-height: 25px;
325
+  }
326
+
327
+  .dialysis-print-order .print-table tr td {
328
+    padding: 1px 1px;
329
+    /*line-height: 25px;*/
330
+  }
331
+
332
+  .es-img {
333
+    height: 25px;
334
+  }
335
+
336
+  .advice-name {
337
+    text-align: left;
338
+  }
339
+
340
+  .advice-children {
341
+    display: flex;
342
+  }
343
+
344
+  .title-box-pro {
345
+    border: 0 #fff;
346
+    line-height: 25px;
347
+    height: 25px;
348
+    text-align: left;
349
+    padding-left: 10px !important;
350
+  }
351
+
352
+  .title-box-pro-tr {
353
+    border: 0 #fff;
354
+  }
355
+
356
+  .text-align-left {
357
+    text-align: left !important;
358
+    padding-left: 10px !important;
359
+    font-size: 14px !important;
360
+    line-height: 25px;
361
+  }
362
+
363
+  .print-table-tr-new td {
364
+    line-height: 20px !important;
365
+  }
366
+
367
+  .border-top-solid {
368
+    border: solid 1px #000;
369
+  }
370
+
371
+  .print-template-two tr {
372
+    line-height: 30px;
373
+  }
374
+</style>

+ 24 - 6
src/xt_pages/stock/drugs/query.vue Bestand weergeven

12
         >设置
12
         >设置
13
         </el-button
13
         </el-button
14
         >
14
         >
15
+      <el-button
16
+          size="small"
17
+          class="filter-item"
18
+          type="primary"
19
+          icon="el-icon-search"
20
+          @click="printOrder"
21
+        >打印
22
+      </el-button>
15
       <el-button
23
       <el-button
16
           size="small"
24
           size="small"
17
           class="filter-item"
25
           class="filter-item"
106
             >{{ stockInCount(scope.row) }}</span
114
             >{{ stockInCount(scope.row) }}</span
107
             >
115
             >
108
           </template>
116
           </template>
117
+        </el-table-column>
118
+         <el-table-column label="单价" align="center">
119
+          <template slot-scope="scope">
120
+            <span>{{ scope.row.last_price}}</span
121
+            >
122
+          </template>
109
         </el-table-column>
123
         </el-table-column>
110
         <el-table-column label="入库退货" align="center">
124
         <el-table-column label="入库退货" align="center">
111
           <template slot-scope="scope">
125
           <template slot-scope="scope">
292
             this.total = response.data.data.total
306
             this.total = response.data.data.total
293
             var arr = []
307
             var arr = []
294
             for (let i = 0; i < response.data.data.list.length; i++) {
308
             for (let i = 0; i < response.data.data.list.length; i++) {
295
-              this.WarehouseInfo.warehouseInfoDate.push(
296
-                response.data.data.list[i]
297
-              )
309
+              this.WarehouseInfo.warehouseInfoDate.push(response.data.data.list[i])
298
               arr.push(response.data.data.list[i])
310
               arr.push(response.data.data.list[i])
299
             }
311
             }
300
             console.log("数据源头",arr)
312
             console.log("数据源头",arr)
413
       },
425
       },
414
        exportStock(){
426
        exportStock(){
415
          import('@/vendor/Export2Excel').then(excel => {
427
          import('@/vendor/Export2Excel').then(excel => {
416
-         const tHeader = ['药品名称', '规格名称', '入库数量','入库退货','实际入库','出库数量','出库退库','实际出库','剩余库存']
417
-         const filterVal = ['drug_name', 'drug_spec', 'stockInCount','salesReturnCount','reactCount','stockOutCount','cancelStockCount','reactOutCount','overplusCount']
428
+         const tHeader = ['药品名称', '规格名称', '入库数量','单价','入库退货','实际入库','出库数量','出库退库','实际出库','剩余库存']
429
+         const filterVal = ['drug_name', 'drug_spec', 'stockInCount','last_price','salesReturnCount','reactCount','stockOutCount','cancelStockCount','reactOutCount','overplusCount']
418
        
430
        
419
         
431
         
420
          const data = this.formatJson(filterVal, this.tableData)
432
          const data = this.formatJson(filterVal, this.tableData)
423
          excel.export_json_to_excel({
435
          excel.export_json_to_excel({
424
            header: tHeader,
436
            header: tHeader,
425
            data,
437
            data,
426
-           filename: '自备药查询'
438
+           filename: '药查询'
427
          })
439
          })
428
           this.downloadLoading = false
440
           this.downloadLoading = false
429
         })
441
         })
439
       },
451
       },
440
       changeDrug(){
452
       changeDrug(){
441
        this.GetAllDrugStockQueryList()
453
        this.GetAllDrugStockQueryList()
454
+      },
455
+      printOrder(){
456
+        this.$router.push({
457
+          name: "drugQueryPrint",
458
+          query: {drug_category:this.drug_category,keyword:this.keywords,start_time:this.start_time,end_time:this.end_time}
459
+        });
442
       }
460
       }
443
     }
461
     }
444
   }
462
   }

+ 8 - 3
src/xt_pages/stock/stockInOrderDetail.vue Bestand weergeven

14
       <div class="filter-container">
14
       <div class="filter-container">
15
         <span style="font-size: 18px;color: #606266">入库单详情</span>
15
         <span style="font-size: 18px;color: #606266">入库单详情</span>
16
         <el-row style="float:right;">
16
         <el-row style="float:right;">
17
-          <span style="color: #606266"
18
-            >入库单号: {{ WarehouseInfo.warehouse.warehousing_order }}</span
19
-          >
17
+          <span style="color: #606266">入库单号: {{ WarehouseInfo.warehouse.warehousing_order }}</span>&nbsp;&nbsp;
18
+          <span><el-button size="small" type="primary" @click="printOrder">打印</el-button></span>
20
         </el-row>
19
         </el-row>
21
       </div>
20
       </div>
22
 
21
 
309
     },
308
     },
310
     editRecord: function() {
309
     editRecord: function() {
311
       this.$emit("edit-record");
310
       this.$emit("edit-record");
311
+    },
312
+    printOrder(){
313
+       this.$router.push({
314
+        name: "stockInDetailPrint",
315
+        query: { id: this.$route.query.id }
316
+      });
312
     }
317
     }
313
   }
318
   }
314
 };
319
 };

+ 311 - 0
src/xt_pages/stock/stockInOrderDetailPrint.vue Bestand weergeven

1
+<template>
2
+    <div class="main-contain">
3
+        <div class="position">
4
+        <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+        <el-row style="float:right;">
6
+            <el-col :span="24">
7
+            <el-button size="small" icon="el-icon-printer" type="primary" @click="printAction">打印</el-button>
8
+            </el-col>
9
+        </el-row>
10
+        </div>
11
+        <div class="app-container" style="background-color: white;">
12
+            <div id="print_content">
13
+                <div class="print_main_content">
14
+                    <div class="order_title_panl">
15
+                        <span class="main_title">耗材入库登记单</span>
16
+                    </div>
17
+                    <div style="text-align:right;margin-bottom:20px;font-size: 18px;">
18
+                      打印时间:{{time_now}}
19
+                    </div>
20
+                    <div class="table_panel">
21
+                        <table class="table">
22
+                            <thead>
23
+                                <tr>
24
+                                    <td width="80">耗材名称</td>
25
+                                    <td width="80">规格型号</td>
26
+                                    <td width="80">单位</td>
27
+                                     <td width="80">进货价</td>
28
+                                    <td width="80">入库数量</td> 
29
+                                    <td width="80">总价</td>
30
+                                </tr>
31
+                            </thead>
32
+                            <tbody>
33
+                                <tr v-for='(item,index) in WarehouseInfo.warehouseInfoDate' :key="index">
34
+                                    <td><span v-if="item.good_id != 0">{{getTypeNameOne(item.good_id)}}</span></td>
35
+                                    <td><span v-if="item.good_id != 0">{{getSpecificationName(item.good_id)}}</span></td>
36
+                                    <td><span v-if="item.good_id!=0">{{getUnit(item.good_id)}}</span></td>
37
+                                    <td>{{item.price}}</td>
38
+                                    <td>{{item.warehousing_count}}</td> 
39
+                                    <td>{{(item.warehousing_count*item.price).toFixed(2)}}</td>
40
+                                </tr>
41
+                                <tr>
42
+                                  <td>合计</td>
43
+                                  <td colspan="4"></td>
44
+                                  <td>{{allPrice.toFixed(2)}}</td>
45
+                               </tr>
46
+                            </tbody>
47
+                        </table>
48
+
49
+                        <div style="display:flex;margin-top:20px;float:right;">
50
+                            <div style="width:50px;">审批:</div><div style="width:100px;"></div>
51
+                            <div style="width:80px;">药材主任:</div><div style="width:100px;"></div>
52
+                            <div style="width:50px;">会计:</div><div style="width:100px;"></div>
53
+                            <div style="width:50px;">审核:</div><div style="width:100px;"></div>
54
+                            <div style="width:70px;">制单人:</div><div style="width:100px;"></div>
55
+                       </div>
56
+                    </div>
57
+                </div>
58
+            </div>
59
+        </div>
60
+    </div>
61
+</template>
62
+
63
+<script>
64
+import BreadCrumb from '@/xt_pages/components/bread-crumb'
65
+import {
66
+  GetAllConfig,
67
+  getWarehouseInfoList,
68
+  getGoodInfoList
69
+} from "@/api/stock";
70
+import print from 'print-js'
71
+const moment = require('moment')
72
+export default {
73
+    components:{
74
+        BreadCrumb
75
+    },
76
+    data(){
77
+        return{
78
+          crumbs: [
79
+            { path: false, name: '库存管理' },
80
+            { path: false, name: '耗材管理' },
81
+            { path: false, name: '入库单打印' },
82
+          ],
83
+            isEdit: 0,
84
+            checked: false,
85
+            signAndWeighBoxPatients: "sign-and-weigh-box-patients",
86
+            goodType: [],
87
+            goodInfo: [],
88
+            manufacturer: [],
89
+            dealer: [],
90
+            Warehouse: {
91
+                loading: false,
92
+                warehouseDate: [],
93
+                tableCurrentIndex: ""
94
+            },
95
+
96
+            WarehouseInfo: {
97
+                loading: false,
98
+                warehouseInfoDate: [],
99
+                warehouse: {}
100
+            },
101
+            time_now:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
102
+            allPrice:0,
103
+            page: 1,
104
+            limit: 10000,
105
+            keyword: "",
106
+            is_use:"",
107
+            good_kind:"",
108
+            is_charge:"",
109
+            list:[]
110
+        }
111
+    },
112
+    methods:{
113
+      printAction: function() {
114
+          const style = '@media print { .print_main_content { background-color: white; width:960px;  margin:0 auto; padding: 0 0 20px 0; } .order_title_panl { text-align: center; } .main_title { font-size: 18px; line-height: 40px; font-weight: 500; } .table_panel { } .table { width: 100%; border: 1px solid; border-collapse: collapse; padding: 2px; } thead tr td { border: 1px solid; text-align: center; font-size: 16px; padding: 15px 5px; } tbody tr td { border: 1px solid; text-align: center; font-size: 16px; padding: 10px 5px; white-space: pre-line;} .proj { padding: 5px 0; text-align: left; } .proj_title { font-size: 16px; font-weight: 500; line-height: 25px; } .proj_item { font-size: 15px; line-height: 20px; } .zone_name { font-weight: 500; } }'
115
+          printJS({
116
+          printable: 'print_content',
117
+          type: 'html',
118
+          documentTitle: '  ',
119
+          style: style,
120
+          scanStyles: false
121
+          })
122
+      },
123
+      
124
+        GetConfigInfo: function() {
125
+        GetAllConfig().then(response => {
126
+            if (response.data.state == 0) {
127
+            this.$message.error(response.data.msg);
128
+            return false;
129
+            } else {
130
+            this.manufacturer = response.data.data.manufacturer;
131
+            this.dealer = response.data.data.dealer;
132
+            this.goodInfo = response.data.data.goodInfo;
133
+            this.goodType = response.data.data.goodType;
134
+            }
135
+        });
136
+        },
137
+       
138
+     GetOrderDetail: function(order_id) {
139
+        const params = {
140
+            id: order_id
141
+        };
142
+        getWarehouseInfoList(params).then(response => {
143
+            if (response.data.state == 0) {
144
+            this.$message.error(response.data.msg);
145
+            return false;
146
+            } else {
147
+             var obj = ""
148
+            for (let i = 0; i < response.data.data.info.length; i++) {
149
+                this.WarehouseInfo.warehouseInfoDate.push(response.data.data.info[i]);
150
+            }
151
+            this.WarehouseInfo.warehouse = response.data.data.warehousing;
152
+            var total_price = 0
153
+            for(let i=0;i<this.WarehouseInfo.warehouseInfoDate.length;i++){
154
+               total_price += this.WarehouseInfo.warehouseInfoDate[i].warehousing_count * this.WarehouseInfo.warehouseInfoDate[i].price   
155
+            }
156
+            this.allPrice = total_price
157
+            console.log("total_price",total_price)
158
+            console.log("数据222222222",this.WarehouseInfo.warehouseInfoDate)
159
+            }
160
+        });
161
+       },
162
+      
163
+    getSpecificationName: function(id) {
164
+      let name = "";
165
+      for (let i = 0; i < this.goodInfo.length; i++) {
166
+        if (this.goodInfo[i].id == id) {
167
+          name = this.goodInfo[i].specification_name;
168
+        }
169
+      }
170
+      return name;
171
+    },
172
+    getTypeName: function(id) {
173
+      let name = "";
174
+      for (let i = 0; i < this.goodType.length; i++) {
175
+        if (this.goodType[i].id == id) {
176
+          name = this.goodType[i].type_name;
177
+        }
178
+      }
179
+      return name;
180
+    },
181
+    getTypeNameOne:function(id){
182
+      let name = "";
183
+      for (let i = 0; i < this.goodInfo.length; i++) {
184
+        if (this.goodInfo[i].id == id) {
185
+          name = this.goodInfo[i].good_name;
186
+        }
187
+      }
188
+      return name;
189
+     },
190
+     getList() {
191
+        this.goodInfo.loading = true
192
+        let params = {
193
+          page: this.page,
194
+          limit: this.limit,
195
+          keyword: this.keywords,
196
+          is_use:this.is_use,
197
+          good_kind:this.good_kind,
198
+          is_charge: this.is_charge,
199
+        }
200
+        getGoodInfoList(params).then(response => {
201
+          if (response.data.state == 0) {
202
+           
203
+            this.$message.error(response.data.msg)
204
+            return false
205
+          } else {
206
+            this.list = []
207
+            for (let i = 0; i < response.data.data.list.length; i++) {
208
+              this.list.push(response.data.data.list[i])
209
+            }
210
+            console.log("list22222",this.list)
211
+          }
212
+        })
213
+      },
214
+      getUnit(id){
215
+        var name = ""
216
+        for(let i=0;i<this.list.length;i++){
217
+          if(id == this.list[i].id){
218
+             name = this.list[i].good_unit
219
+          }
220
+        }
221
+        return this.getGoodUnit(name)
222
+      },
223
+      getGoodUnit(id){
224
+        for (let i = 0; i <this.$store.getters.good_unit.length; i++ ){
225
+          if(id == this.$store.getters.good_unit[i].id){
226
+
227
+            return this.$store.getters.good_unit[i].name
228
+          }
229
+        }
230
+        return ""
231
+      },
232
+    },
233
+    created(){
234
+
235
+      const order_id = this.$route.query.id;
236
+      this.GetConfigInfo();
237
+      this.GetOrderDetail(order_id);
238
+      this.getList()
239
+    }
240
+}
241
+</script>
242
+
243
+
244
+<style rel="stylesheet/scss" lang="scss" scoped>
245
+.print_main_content {
246
+  background-color: white;
247
+  max-width: 1500px;
248
+  margin: 0 auto;
249
+  padding: 0 0 20px 0;
250
+
251
+  .order_title_panl {
252
+    text-align: center;
253
+
254
+    .main_title {
255
+      font-size: 18px;
256
+      line-height: 40px;
257
+      font-weight: 500;
258
+    }
259
+  }
260
+  .table_panel {
261
+    .table {
262
+      width: 100%;
263
+      border: 1px solid;
264
+      border-collapse: collapse;
265
+      padding: 2px;
266
+      
267
+
268
+      thead {
269
+        tr {
270
+          td {
271
+            border: 1px solid;
272
+            text-align: center;
273
+            font-size: 18px;
274
+            padding: 15px 5px;
275
+          }
276
+        }
277
+      }
278
+      tbody {
279
+        tr {
280
+          td {
281
+            border: 1px solid;
282
+            text-align: center;
283
+            font-size: 18px;
284
+            padding: 10px 5px;
285
+            white-space: pre-line;
286
+            .proj {
287
+              padding: 5px 0;
288
+              text-align: left;
289
+
290
+              .proj_title {
291
+                font-size: 16px;
292
+                font-weight: 500;
293
+                line-height: 25px;
294
+              }
295
+
296
+              .proj_item {
297
+                font-size: 15px;
298
+                line-height: 20px;
299
+
300
+                .zone_name {
301
+                  font-weight: 500;
302
+                }
303
+              }
304
+            }
305
+          }
306
+        }
307
+      }
308
+    }
309
+  }
310
+}
311
+</style>

+ 11 - 2
src/xt_pages/stock/stockOutOrderDetail.vue Bestand weergeven

11
       <div class="filter-container">
11
       <div class="filter-container">
12
         <span style="font-size: 18px;color: #606266">出库单详情</span>
12
         <span style="font-size: 18px;color: #606266">出库单详情</span>
13
         <el-row style="float:right;">
13
         <el-row style="float:right;">
14
-          <span style="color: #606266">{{warehousingOutInfo.info.warehouse_out_order_number}}</span>
14
+          <span style="color: #606266">{{warehousingOutInfo.info.warehouse_out_order_number}}</span>&nbsp;&nbsp;
15
+          <span><el-button size="small" type="primary" @click="printOrder">打印</el-button></span>
15
         </el-row>
16
         </el-row>
16
       </div>
17
       </div>
17
 
18
 
230
               this.warehousingOutInfo.warehousingOutData.push(response.data.data.list[i])
231
               this.warehousingOutInfo.warehousingOutData.push(response.data.data.list[i])
231
             }
232
             }
232
             this.warehousingOutInfo.info = response.data.data.info
233
             this.warehousingOutInfo.info = response.data.data.info
234
+          
233
             console.log("数据源头9999999999",this.warehousingOutInfo.warehousingOutData)
235
             console.log("数据源头9999999999",this.warehousingOutInfo.warehousingOutData)
234
             this.handleSpanTempArr()
236
             this.handleSpanTempArr()
235
           }
237
           }
340
             }
342
             }
341
          }
343
          }
342
          return count
344
          return count
343
-      }
345
+      },
346
+
347
+     printOrder(){
348
+       this.$router.push({
349
+        name: "stockOutDetailPrint",
350
+        query: { id: this.$route.query.id,warehouse_out_time:this.$route.query.warehouse_out_time }
351
+      });
352
+    }
344
     }
353
     }
345
   }
354
   }
346
 </script>
355
 </script>

+ 326 - 0
src/xt_pages/stock/stockOutOrderDetailPrint.vue Bestand weergeven

1
+<template>
2
+    <div class="main-contain">
3
+        <div class="position">
4
+        <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+        <el-row style="float:right;">
6
+            <el-col :span="24">
7
+            <el-button size="small" icon="el-icon-printer" type="primary" @click="printAction">打印</el-button>
8
+            </el-col>
9
+        </el-row>
10
+        </div>
11
+        <div class="app-container" style="background-color: white;">
12
+            <div id="print_content">
13
+                <div class="print_main_content">
14
+                    <div class="order_title_panl">
15
+                        <span class="main_title">耗材出库登记单</span>
16
+                    </div>
17
+                    <div style="text-align:right;margin-bottom:20px;font-size: 18px;">
18
+                      打印时间:{{time_now}}
19
+                    </div>
20
+                    <div class="table_panel">
21
+                        <table class="table">
22
+                            <thead>
23
+                                <tr>
24
+                                    <td width="80">耗材名称</td>
25
+                                    <td width="80">规格型号</td>
26
+                                    <td width="80">单位</td>
27
+                                     <td width="80">出货价</td>
28
+                                    <td width="80">出库数量</td> 
29
+                                    <td width="80">总价</td>
30
+                                </tr>
31
+                            </thead>
32
+                            <tbody>
33
+                                <tr v-for='(item,index) in warehousingOutInfo.warehousingOutData' :key="index">
34
+                                    <td><span v-if="item.good_id != 0">{{getTypeNameOne(item.good_id)}}</span></td>
35
+                                    <td><span v-if="item.good_id != 0">{{getSpecificationName(item.good_id)}}</span></td>
36
+                                    <td><span v-if="item.good_id!=0">{{getUnit(item.good_id)}}</span></td>
37
+                                    <td>{{item.price}}</td>
38
+                                    <td>{{getOutStockCount(item.good_id)}}</td> 
39
+                                    <td>{{(getOutStockCount(item.good_id)*item.price).toFixed(2)}}</td>
40
+                                </tr>
41
+                                <tr>
42
+                                  <td>合计</td>
43
+                                  <td colspan="4"></td>
44
+                                  <td>{{allPrice.toFixed(2)}}</td>
45
+                               </tr>
46
+                            </tbody>
47
+                        </table>
48
+
49
+                        <div style="display:flex;margin-top:20px;float:right;">
50
+                            <div style="width:50px;">审批:</div><div style="width:100px;"></div>
51
+                            <div style="width:80px;">药材主任:</div><div style="width:100px;"></div>
52
+                            <div style="width:50px;">会计:</div><div style="width:100px;"></div>
53
+                            <div style="width:50px;">审核:</div><div style="width:100px;"></div>
54
+                            <div style="width:70px;">制单人:</div><div style="width:100px;"></div>
55
+                       </div>
56
+                    </div>
57
+                </div>
58
+            </div>
59
+        </div>
60
+    </div>
61
+</template>
62
+
63
+<script>
64
+import BreadCrumb from '@/xt_pages/components/bread-crumb'
65
+import { GetAllConfig,getWarehouseOutInfo,GetOutStockTotalCount,getGoodInfoList } from "@/api/stock";
66
+import print from 'print-js'
67
+const moment = require('moment')
68
+export default {
69
+    components:{
70
+        BreadCrumb
71
+    },
72
+    data(){
73
+        return{
74
+          crumbs: [
75
+            { path: false, name: '库存管理' },
76
+            { path: false, name: '耗材管理' },
77
+            { path: false, name: '入库单打印' },
78
+          ],
79
+           isEdit: 0,
80
+            checked: false,
81
+            signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
82
+            goodType: [],
83
+            goodInfo: [],
84
+            manufacturer: [],
85
+            dealer: [],
86
+
87
+            warehousingOutInfo: {
88
+            loading: false,
89
+            warehousingOutData: [],
90
+            info: {}
91
+            },
92
+            stockCount:[],
93
+            time_now:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
94
+            allPrice:0,
95
+            page: 1,
96
+            limit: 10000,
97
+            keyword: "",
98
+            is_use:"",
99
+            good_kind:"",
100
+            is_charge:"",
101
+            list:[]
102
+        }
103
+    },
104
+    methods:{
105
+      printAction: function() {
106
+          const style = '@media print { .print_main_content { background-color: white; width:960px;  margin:0 auto; padding: 0 0 20px 0; } .order_title_panl { text-align: center; } .main_title { font-size: 18px; line-height: 40px; font-weight: 500; } .table_panel { } .table { width: 100%; border: 1px solid; border-collapse: collapse; padding: 2px; } thead tr td { border: 1px solid; text-align: center; font-size: 16px; padding: 15px 5px; } tbody tr td { border: 1px solid; text-align: center; font-size: 16px; padding: 10px 5px; white-space: pre-line;} .proj { padding: 5px 0; text-align: left; } .proj_title { font-size: 16px; font-weight: 500; line-height: 25px; } .proj_item { font-size: 15px; line-height: 20px; } .zone_name { font-weight: 500; } }'
107
+          printJS({
108
+          printable: 'print_content',
109
+          type: 'html',
110
+          documentTitle: '  ',
111
+          style: style,
112
+          scanStyles: false
113
+          })
114
+      },
115
+
116
+        GetConfigInfo() {
117
+            GetAllConfig().then(response => {
118
+            if (response.data.state == 0) {
119
+                this.$message.error(response.data.msg)
120
+                return false
121
+            } else {
122
+                this.manufacturer = response.data.data.manufacturer
123
+                this.dealer = response.data.data.dealer
124
+                this.goodInfo = response.data.data.goodInfo
125
+                this.goodType = response.data.data.goodType
126
+            }
127
+            })
128
+        },
129
+       GetOrderDetail: function(order_id) {
130
+        const params = {
131
+          'id': order_id
132
+        }
133
+        getWarehouseOutInfo(params).then(response => {
134
+          if (response.data.state == 0) {
135
+
136
+            this.$message.error(response.data.msg)
137
+            return false
138
+          } else {
139
+           
140
+            for (let i = 0; i < response.data.data.list.length; i++) {
141
+              this.warehousingOutInfo.warehousingOutData.push(response.data.data.list[i])
142
+            }
143
+            this.warehousingOutInfo.info = response.data.data.info
144
+            console.log("数据源头9999999999",this.warehousingOutInfo.warehousingOutData)
145
+            var total_price = 0
146
+            for(let i=0;i<this.warehousingOutInfo.warehousingOutData.length;i++){
147
+              total_price += this.getOutStockCount(this.warehousingOutInfo.warehousingOutData[i].good_id)*this.warehousingOutInfo.warehousingOutData[i].price
148
+            }
149
+           this.allPrice = total_price
150
+          }
151
+        })
152
+      },
153
+
154
+       GetTotalCount(time){
155
+          var params = {
156
+           warehouse_out_time:time
157
+          }
158
+        GetOutStockTotalCount(params).then(response=>{
159
+           if(response.data.state == 1){
160
+              var stockCount = response.data.data.stockCount
161
+              console.log("stockCount",stockCount)
162
+              this.stockCount = stockCount
163
+           }
164
+        })
165
+      },
166
+      
167
+       getSpecificationName: function(id) {
168
+        let name = ''
169
+        for (let i = 0; i < this.goodInfo.length; i++) {
170
+          if (this.goodInfo[i].id == id) {
171
+            name = this.goodInfo[i].specification_name
172
+          }
173
+        }
174
+        return name
175
+      },
176
+       getTypeName: function(id) {
177
+        let name = ''
178
+        for (let i = 0; i < this.goodType.length; i++) {
179
+          if (this.goodType[i].id == id) {
180
+            name = this.goodType[i].type_name
181
+          }
182
+        }
183
+        return name
184
+      },
185
+       getTypeNameOne: function(id) {
186
+        let name = ''
187
+        for (let i = 0; i < this.goodInfo.length; i++) {
188
+          if (this.goodInfo[i].id == id) {
189
+            name = this.goodInfo[i].good_name
190
+          }
191
+        }
192
+        return name
193
+      },
194
+      getOutStockCount(id){
195
+         var count = 0 
196
+         for(let i=0;i<this.stockCount.length;i++){
197
+            if(id == this.stockCount[i].good_id){
198
+              count = this.stockCount[i].count
199
+            }
200
+         }
201
+         return count
202
+      },
203
+       getList() {
204
+        this.goodInfo.loading = true
205
+        let params = {
206
+          page: this.page,
207
+          limit: this.limit,
208
+          keyword: this.keywords,
209
+          is_use:this.is_use,
210
+          good_kind:this.good_kind,
211
+          is_charge: this.is_charge,
212
+        }
213
+        getGoodInfoList(params).then(response => {
214
+          if (response.data.state == 0) {
215
+            this.$message.error(response.data.msg)
216
+            return false
217
+          } else {
218
+            this.list = []
219
+            for (let i = 0; i < response.data.data.list.length; i++) {
220
+              this.list.push(response.data.data.list[i])
221
+            }
222
+            console.log("list22222",this.list)
223
+          }
224
+        })
225
+      },
226
+      getUnit(id){
227
+        var name = ""
228
+        for(let i=0;i<this.list.length;i++){
229
+          if(id == this.list[i].id){
230
+             name = this.list[i].good_unit
231
+          }
232
+        }
233
+        return this.getGoodUnit(name)
234
+      },
235
+      getGoodUnit(id){
236
+        for (let i = 0; i <this.$store.getters.good_unit.length; i++ ){
237
+          if(id == this.$store.getters.good_unit[i].id){
238
+
239
+            return this.$store.getters.good_unit[i].name
240
+          }
241
+        }
242
+        return ""
243
+      },
244
+      
245
+    },
246
+    created(){
247
+
248
+      const order_id = this.$route.query.id;
249
+      const warehouse_out_time = this.$route.query.warehouse_out_time
250
+      this.GetConfigInfo()
251
+      this.GetOrderDetail(order_id)
252
+      this.GetTotalCount(warehouse_out_time)
253
+      this.getList()
254
+    }
255
+}
256
+</script>
257
+
258
+
259
+<style rel="stylesheet/scss" lang="scss" scoped>
260
+.print_main_content {
261
+  background-color: white;
262
+  max-width: 1500px;
263
+  margin: 0 auto;
264
+  padding: 0 0 20px 0;
265
+
266
+  .order_title_panl {
267
+    text-align: center;
268
+
269
+    .main_title {
270
+      font-size: 18px;
271
+      line-height: 40px;
272
+      font-weight: 500;
273
+    }
274
+  }
275
+  .table_panel {
276
+    .table {
277
+      width: 100%;
278
+      border: 1px solid;
279
+      border-collapse: collapse;
280
+      padding: 2px;
281
+      
282
+
283
+      thead {
284
+        tr {
285
+          td {
286
+            border: 1px solid;
287
+            text-align: center;
288
+            font-size: 18px;
289
+            padding: 15px 5px;
290
+          }
291
+        }
292
+      }
293
+      tbody {
294
+        tr {
295
+          td {
296
+            border: 1px solid;
297
+            text-align: center;
298
+            font-size: 18px;
299
+            padding: 10px 5px;
300
+            white-space: pre-line;
301
+            .proj {
302
+              padding: 5px 0;
303
+              text-align: left;
304
+
305
+              .proj_title {
306
+                font-size: 16px;
307
+                font-weight: 500;
308
+                line-height: 25px;
309
+              }
310
+
311
+              .proj_item {
312
+                font-size: 15px;
313
+                line-height: 20px;
314
+
315
+                .zone_name {
316
+                  font-weight: 500;
317
+                }
318
+              }
319
+            }
320
+          }
321
+        }
322
+      }
323
+    }
324
+  }
325
+}
326
+</style>

+ 9 - 0
src/xt_pages/stock/stockPrint.vue Bestand weergeven

26
                                     <td width="80">耗材类型</td>
26
                                     <td width="80">耗材类型</td>
27
                                     <td width="80">规格型号</td>
27
                                     <td width="80">规格型号</td>
28
                                     <td width="80">入库数量</td>
28
                                     <td width="80">入库数量</td>
29
+                                    <td width="80">进货价</td>
29
                                     <td width="80">入库退货</td>
30
                                     <td width="80">入库退货</td>
30
                                     <td width="80">实际入库</td>
31
                                     <td width="80">实际入库</td>
31
                                     <td width="80">出库数量</td>
32
                                     <td width="80">出库数量</td>
41
                                     <td>{{item.type.type_name}}</td>
42
                                     <td>{{item.type.type_name}}</td>
42
                                     <td>{{item.specification_name}}</td>
43
                                     <td>{{item.specification_name}}</td>
43
                                     <td>{{stockInCount(item)}}</td>
44
                                     <td>{{stockInCount(item)}}</td>
45
+                                    <td>{{item.price}}</td>
44
                                     <td>{{salesReturnCount(item)}}</td>
46
                                     <td>{{salesReturnCount(item)}}</td>
45
                                     <td> {{ stockInCount(item) - salesReturnCount(item) }}</td>
47
                                     <td> {{ stockInCount(item) - salesReturnCount(item) }}</td>
46
                                     <td>{{ stockOutCount(item) }}</td>
48
                                     <td>{{ stockOutCount(item) }}</td>
122
           for (let i = 0; i < response.data.data.list.length; i++) {
124
           for (let i = 0; i < response.data.data.list.length; i++) {
123
             this.WarehouseInfo.warehouseInfoDate.push( response.data.data.list[i]);
125
             this.WarehouseInfo.warehouseInfoDate.push( response.data.data.list[i]);
124
           }
126
           }
127
+          for(let i=0;i<this.WarehouseInfo.warehouseInfoDate.length;i++){
128
+            if(this.WarehouseInfo.warehouseInfoDate[i].query_warehousing_info.length>0){
129
+              this.WarehouseInfo.warehouseInfoDate[i].price = this.WarehouseInfo.warehouseInfoDate[i].query_warehousing_info[0].price
130
+            }else{
131
+              this.WarehouseInfo.warehouseInfoDate[i].price = ""
132
+            }
133
+          }
125
          }
134
          }
126
             console.log("打印数据源头",this.WarehouseInfo.warehouseInfoDate)
135
             console.log("打印数据源头",this.WarehouseInfo.warehouseInfoDate)
127
           });
136
           });

+ 20 - 3
src/xt_pages/stock/stockQuery.vue Bestand weergeven

100
             <span>{{getUnit(scope.row.good_unit)}}</span>
100
             <span>{{getUnit(scope.row.good_unit)}}</span>
101
           </template>
101
           </template>
102
         </el-table-column>
102
         </el-table-column>
103
+        <el-table-column label="进货价" align="center">
104
+          <template slot-scope="scope">
105
+            <span v-if="scope.row.query_warehousing_info.length>0">{{scope.row.query_warehousing_info[0].price?scope.row.query_warehousing_info[0].price:""}}</span>
106
+          </template>
107
+        </el-table-column>
103
         <el-table-column label="入库数量" align="center">
108
         <el-table-column label="入库数量" align="center">
104
           <template slot-scope="scope">
109
           <template slot-scope="scope">
105
             <span
110
             <span
259
             this.WarehouseInfo.warehouseInfoDate[i].realOutCount =  this.stockOutCount(this.WarehouseInfo.warehouseInfoDate[i]) -  this.cancelStockCount(this.WarehouseInfo.warehouseInfoDate[i])
264
             this.WarehouseInfo.warehouseInfoDate[i].realOutCount =  this.stockOutCount(this.WarehouseInfo.warehouseInfoDate[i]) -  this.cancelStockCount(this.WarehouseInfo.warehouseInfoDate[i])
260
 
265
 
261
             this.WarehouseInfo.warehouseInfoDate[i].overplus = this.stockInCount(this.WarehouseInfo.warehouseInfoDate[i]) -this.salesReturnCount(this.WarehouseInfo.warehouseInfoDate[i]) - this.stockOutCount(this.WarehouseInfo.warehouseInfoDate[i]) + this.cancelStockCount(this.WarehouseInfo.warehouseInfoDate[i])
266
             this.WarehouseInfo.warehouseInfoDate[i].overplus = this.stockInCount(this.WarehouseInfo.warehouseInfoDate[i]) -this.salesReturnCount(this.WarehouseInfo.warehouseInfoDate[i]) - this.stockOutCount(this.WarehouseInfo.warehouseInfoDate[i]) + this.cancelStockCount(this.WarehouseInfo.warehouseInfoDate[i])
267
+
268
+            if(this.WarehouseInfo.warehouseInfoDate[i].query_warehousing_info.length>0){
269
+              this.WarehouseInfo.warehouseInfoDate[i].price = this.WarehouseInfo.warehouseInfoDate[i].query_warehousing_info[0].price
270
+              this.WarehouseInfo.warehouseInfoDate[i].all_price = (this.stockInCount(this.WarehouseInfo.warehouseInfoDate[i]) * this.WarehouseInfo.warehouseInfoDate[i].query_warehousing_info[0].price).toFixed(2)
271
+            }else{
272
+             this.WarehouseInfo.warehouseInfoDate[i].price = ""
273
+             this.WarehouseInfo.warehouseInfoDate[i].all_price = ""
274
+            }
275
+
276
+
262
          }
277
          }
263
         
278
         
264
         console.log("数据2222222",this.WarehouseInfo.warehouseInfoDate)
279
         console.log("数据2222222",this.WarehouseInfo.warehouseInfoDate)
368
     },
383
     },
369
 
384
 
370
     exportList(){
385
     exportList(){
386
+         console.log("2222222",this.WarehouseInfo.warehouseInfoDate)
371
          import('@/vendor/Export2Excel').then(excel => {
387
          import('@/vendor/Export2Excel').then(excel => {
372
-         const tHeader = ['商品编码', '耗材名称', '耗材类型','规格型号','入库数量','入库退货','实际入库','出库数量','出库退库','实际出库','剩余库存']
373
-         const filterVal = ['good_code', 'good_name', 'type_name','specification_name','stockInCount','salesReturnCount','realCount','stockOutCount','cancelStockCount','realOutCount','overplus'] 
388
+         const tHeader = ['商品编码', '耗材名称', '耗材类型','规格型号','入库数量','进货价','入库退货','实际入库','出库数量','出库退库','实际出库','剩余库存']
389
+         const filterVal = ['good_code', 'good_name', 'type_name','specification_name','stockInCount','price','salesReturnCount','realCount','stockOutCount','cancelStockCount','realOutCount','overplus'] 
374
          const data = this.formatJson(filterVal, this.WarehouseInfo.warehouseInfoDate)
390
          const data = this.formatJson(filterVal, this.WarehouseInfo.warehouseInfoDate)
375
-      
391
+         console.log("data",data)
392
+         
376
          excel.export_json_to_excel({
393
          excel.export_json_to_excel({
377
            header: tHeader,
394
            header: tHeader,
378
            data,
395
            data,