huangyw 2 years ago
parent
commit
6795c47628

+ 8 - 0
src/router/modules/drugs.js View File

@@ -76,6 +76,14 @@ export default {
76 76
       is_menu: false,
77 77
       meta: { title: 'inventoryPrint', noCache: true }
78 78
     },
79
+    {
80
+      path: '/stock/drugs/print',
81
+      component: () => import('@/xt_pages/stock/drugs/print'),
82
+      name: 'print',
83
+      hidden: true,
84
+      is_menu: false,
85
+      meta: { title: 'print', noCache: true }
86
+    },
79 87
     // {
80 88
     //   path: '/stock/drugs/stock/return',
81 89
     //   component: () => import('@/xt_pages/stock/drugs/drugSalesReturnOrder'),

+ 13 - 1
src/router/modules/patient.js View File

@@ -226,6 +226,17 @@ export default {
226 226
       noCache: true
227 227
     }
228 228
   },
229
+  {
230
+    path: '/patient/patient/templateSummary/print_1',
231
+    component: () => import('@/xt_pages/user/templateSummaryPrint_1'),
232
+    hidden: true,
233
+    is_menu: false,
234
+    name: 'templateSummary_1',
235
+    meta: {
236
+      title: 'templateSummary_1',
237
+      noCache: true
238
+    }
239
+  },
229 240
   {
230 241
     path: '/patient/patient/hospitalSummary/print',
231 242
     component: () => import('@/xt_pages/user/hospitalSummaryPrint'),
@@ -236,6 +247,7 @@ export default {
236 247
       title: 'templateSummary',
237 248
       noCache: true
238 249
     }
239
-  }
250
+  },
251
+
240 252
   ]
241 253
 }

+ 8 - 0
src/router/modules/stock.js View File

@@ -99,6 +99,14 @@ export default {
99 99
       is_menu: false,
100 100
       meta: { title: 'inventoryPrint', noCache: true }
101 101
     },
102
+    {
103
+      path: '/stock/print_all',
104
+      component: () => import('@/xt_pages/stock/print_all'),
105
+      name: 'print_all',
106
+      hidden: true,
107
+      is_menu: false,
108
+      meta: { title: 'print_all', noCache: true }
109
+    },
102 110
 
103 111
     // {
104 112
     //   path: "/stock/",

+ 136 - 0
src/xt_pages/stock/print_all.vue View File

@@ -0,0 +1,136 @@
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
+
14
+                <table class="printTable" border="0" cellspacing="0" align="center">
15
+                    <thead class="print_head">
16
+                        <tr><td colspan="11">{{org_name}}</td></tr>
17
+                        <tr><td colspan="11">耗材盘点</td></tr>
18
+                    </thead>
19
+                    <tbody class="print_body">
20
+                    <tr>
21
+                        <td>耗材名称</td>
22
+                        <td>规格</td>
23
+                        <td>单位</td>
24
+                        <td>批号</td>
25
+                        <td>生产厂商</td>
26
+                        <td>仓库名称</td>
27
+                        <td>盘点前数量</td> 
28
+                        <td>盘点后数量</td>
29
+                        <td>盈亏类型</td>
30
+                        <td>进货单价</td>
31
+                        <td width="60">总额</td>
32
+                        
33
+                    </tr>
34
+                    <tr v-for="(item,index) in tableData" :key="index">
35
+                        <td>{{item.good_name}}</td>
36
+                        <td>{{item.specification_name}}</td>
37
+                        <td>{{item.packing_unit}}</td>
38
+                        <td>{{item.number}}</td>
39
+                        <td></td>
40
+                        <td></td>
41
+                        <td></td>
42
+                        <td></td>
43
+                        <td></td>
44
+                        <td></td>
45
+                        <td></td>
46
+                    </tr>
47
+                    </tbody>
48
+                </table>
49
+            </div>
50
+        </div>
51
+    </div>
52
+</template>
53
+
54
+<script>
55
+import BreadCrumb from '@/xt_pages/components/bread-crumb'
56
+const moment = require('moment');
57
+import { uParseTime } from '@/utils/tools'
58
+import { getInventoryExportList } from "@/api/stock"
59
+import print from "print-js";
60
+export default {
61
+    components:{
62
+        BreadCrumb
63
+    },
64
+    data(){
65
+        return{
66
+          crumbs: [
67
+            { path: false, name: '库存管理' },
68
+            { path: false, name: '耗材管理' },
69
+            { path: false, name: '耗材盘点打印' },
70
+          ],
71
+          org_name:"",
72
+          ids:"",
73
+          tableData:[],
74
+          manufacturerList:[],
75
+        }
76
+    },
77
+    methods:{
78
+        printAction: function() {
79
+            const style = '@page{size:landscape;margin: 10mm;} @media print { print_content{width:960px;margin:0} .flex{display: flex;justify-content: space-between;} .printTable{width:100%;border-collapse: collapse;border:0px;margin:10px 0;} .printTable thead{text-align:center}.printTable td{padding:5px;} .print_body tr td{border: 1px solid;font-size:12px;border-collapse:collapse;} }';
80
+            printJS({ 
81
+            printable: 'print_content',
82
+            type: 'html',
83
+            documentTitle: '  ',
84
+            style: style,
85
+            scanStyles: false
86
+            })
87
+        },
88
+        getTime(val) {
89
+         if(val < 0){
90
+            return ""
91
+          }
92
+         if(val == ""){
93
+            return ""
94
+          }else {
95
+            return uParseTime(val, '{y}-{m}-{d}')
96
+         }
97
+        },
98
+        getlist(){
99
+        //  getInventoryExportList().then(response=>{
100
+        //    if(response.data.state == 1){
101
+        //      var list =  response.data.data.list
102
+        //      console.log("list233233232323",list)
103
+        //      this.tableData = list
104
+        //      this.manufacturerList = response.data.data.manufacturerList
105
+        //    }
106
+        //  })
107
+        },
108
+        getManufacturerName(id){
109
+           var name = ""
110
+           for(let i=0;i<this.manufacturerList.length;i++){
111
+              if(id == this.manufacturerList[i].id){
112
+                  name = this.manufacturerList[i].manufacturer_name
113
+              }
114
+           }
115
+           return name
116
+        }
117
+    },
118
+    created(){
119
+      this.getlist()
120
+    }
121
+}
122
+</script>
123
+
124
+
125
+<style rel="stylesheet/scss" lang="scss" scoped>
126
+.printTitle{font-size: 22px;text-align: center;}
127
+.flex{display: flex;justify-content: space-between;}
128
+.tableTitle{display: flex;border-top:1px solid #000;border-bottom: 1px solid #000;padding: 10px 0;}
129
+.tableTr{display: flex;border-bottom: 1px dashed #000;padding: 10px 0;}
130
+.tableBottom{display: flex;border-bottom: 1px solid #000;padding: 10px 0;}
131
+.printTable{width:100%;border-collapse: collapse;}
132
+.printTable td{padding:5px;}
133
+.print_head{border: none;display: table-header-group;}
134
+.print_head tr td{text-align: center;border: none;}
135
+.print_body tr td{border:1px solid}
136
+</style>