|
@@ -0,0 +1,170 @@
|
|
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 text-align="center">耗材名称</td>
|
|
22
|
+ <td text-align="center">规格</td>
|
|
23
|
+ <td text-align="center">批号</td>
|
|
24
|
+ <td text-align="center">生产厂商</td>
|
|
25
|
+ <td text-align="center">仓库名称</td>
|
|
26
|
+ <td text-align="center">盘点前数量</td>
|
|
27
|
+ <td text-align="center">盘点后数量</td>
|
|
28
|
+ <td text-align="center">盈亏类型</td>
|
|
29
|
+ <td text-align="center">盘点人</td>
|
|
30
|
+
|
|
31
|
+ </tr>
|
|
32
|
+ <tr v-for="(item,index) in tableList" :key="index">
|
|
33
|
+ <td>{{item.good_name}}</td>
|
|
34
|
+ <td>{{item.specification_name}}</td>
|
|
35
|
+ <td>{{item.batch_number}}</td>
|
|
36
|
+ <td>{{item.manufacturer_name}}</td>
|
|
37
|
+ <td>{{getHouseName(item.storehouse_id)}}</td>
|
|
38
|
+ <td>{{item.befor_count}}</td>
|
|
39
|
+ <td>{{item.after_count}}</td>
|
|
40
|
+ <td>
|
|
41
|
+ <span v-if="item.befor_count > item.after_count">盘亏</span>
|
|
42
|
+ <span v-if="item.befor_count < item.after_count">盘盈</span></td>
|
|
43
|
+ <td><span> {{getName(item.creater)}}</span></td>
|
|
44
|
+
|
|
45
|
+ </tr>
|
|
46
|
+ </tbody>
|
|
47
|
+ </table>
|
|
48
|
+ </div>
|
|
49
|
+ </div>
|
|
50
|
+ </div>
|
|
51
|
+</template>
|
|
52
|
+
|
|
53
|
+<script>
|
|
54
|
+import BreadCrumb from '@/xt_pages/components/bread-crumb'
|
|
55
|
+const moment = require('moment');
|
|
56
|
+import { uParseTime } from '@/utils/tools'
|
|
57
|
+import { getStockInventoryPrintList } from "@/api/stock"
|
|
58
|
+import print from "print-js";
|
|
59
|
+export default {
|
|
60
|
+ components:{
|
|
61
|
+ BreadCrumb
|
|
62
|
+ },
|
|
63
|
+ data(){
|
|
64
|
+ return{
|
|
65
|
+ crumbs: [
|
|
66
|
+ { path: false, name: '库存管理' },
|
|
67
|
+ { path: false, name: '耗材管理' },
|
|
68
|
+ { path: false, name: '耗材盘点打印' },
|
|
69
|
+ ],
|
|
70
|
+ org_name: this.$store.getters.xt_user.org.org_name,
|
|
71
|
+ ids:"",
|
|
72
|
+ tableList:[],
|
|
73
|
+ manufacturerList:[],
|
|
74
|
+ houseList:[],
|
|
75
|
+ doclist:[]
|
|
76
|
+ }
|
|
77
|
+ },
|
|
78
|
+ methods:{
|
|
79
|
+ getName(admin_user_id){
|
|
80
|
+ var user_name = ""
|
|
81
|
+ for(let i=0;i<this.docList.length;i++){
|
|
82
|
+ if(admin_user_id == this.docList[i].admin_user_id){
|
|
83
|
+ user_name = this.docList[i].user_name
|
|
84
|
+ }
|
|
85
|
+ }
|
|
86
|
+ return user_name
|
|
87
|
+ },
|
|
88
|
+ printAction: function() {
|
|
89
|
+ 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;} }';
|
|
90
|
+ printJS({
|
|
91
|
+ printable: 'print_content',
|
|
92
|
+ type: 'html',
|
|
93
|
+ documentTitle: ' ',
|
|
94
|
+ style: style,
|
|
95
|
+ scanStyles: false
|
|
96
|
+ })
|
|
97
|
+ },
|
|
98
|
+ getTime(val) {
|
|
99
|
+ if(val < 0){
|
|
100
|
+ return ""
|
|
101
|
+ }
|
|
102
|
+ if(val == ""){
|
|
103
|
+ return ""
|
|
104
|
+ }else {
|
|
105
|
+ return uParseTime(val, '{y}-{m}-{d}')
|
|
106
|
+ }
|
|
107
|
+ },
|
|
108
|
+ getlist(){
|
|
109
|
+ var params = {
|
|
110
|
+ storehouse_id:this.$route.query.storehouse_id,
|
|
111
|
+ keyword:this.$route.query.keyword,
|
|
112
|
+ limit:this.$route.query.limit,
|
|
113
|
+ page:this.$route.query.page,
|
|
114
|
+ ids:this.$route.query.ids,
|
|
115
|
+ }
|
|
116
|
+ getStockInventoryPrintList(params).then(response=>{
|
|
117
|
+ if(response.data.state == 1){
|
|
118
|
+ var list = response.data.data.list
|
|
119
|
+ console.log("list232332232323",response.data.data.list)
|
|
120
|
+ this.tableList = list
|
|
121
|
+ console.log("list233233232323",this.tableList)
|
|
122
|
+ this.houseList = response.data.data.storeHouseList
|
|
123
|
+
|
|
124
|
+ this.docList = response.data.data.doclist
|
|
125
|
+ }
|
|
126
|
+ })
|
|
127
|
+ },
|
|
128
|
+ getManufacturerName(id){
|
|
129
|
+ var name = ""
|
|
130
|
+ for(let i=0;i<this.manufacturerList.length;i++){
|
|
131
|
+ if(id == this.manufacturerList[i].id){
|
|
132
|
+ name = this.manufacturerList[i].manufacturer_name
|
|
133
|
+ }
|
|
134
|
+ }
|
|
135
|
+ return name
|
|
136
|
+ },
|
|
137
|
+ getHouseName(id){
|
|
138
|
+ var storehouse_name = ""
|
|
139
|
+ for(let i=0;i<this.houseList.length;i++){
|
|
140
|
+ if(id == this.houseList[i].id){
|
|
141
|
+ storehouse_name = this.houseList[i].storehouse_name
|
|
142
|
+ }
|
|
143
|
+ }
|
|
144
|
+ if(storehouse_name == "全部"){
|
|
145
|
+ return ""
|
|
146
|
+ }else{
|
|
147
|
+ return storehouse_name
|
|
148
|
+ }
|
|
149
|
+ }
|
|
150
|
+ },
|
|
151
|
+ created(){
|
|
152
|
+
|
|
153
|
+ this.getlist()
|
|
154
|
+ }
|
|
155
|
+}
|
|
156
|
+</script>
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+<style rel="stylesheet/scss" lang="scss" scoped>
|
|
160
|
+.printTitle{font-size: 22px;text-align: center;}
|
|
161
|
+.flex{display: flex;justify-content: space-between;}
|
|
162
|
+.tableTitle{display: flex;border-top:1px solid #000;border-bottom: 1px solid #000;padding: 10px 0;}
|
|
163
|
+.tableTr{display: flex;border-bottom: 1px dashed #000;padding: 10px 0;}
|
|
164
|
+.tableBottom{display: flex;border-bottom: 1px solid #000;padding: 10px 0;}
|
|
165
|
+.printTable{width:100%;border-collapse: collapse;}
|
|
166
|
+.printTable td{padding:5px;}
|
|
167
|
+.print_head{border: none;display: table-header-group;}
|
|
168
|
+.print_head tr td{text-align: center;border: none;}
|
|
169
|
+.print_body tr td{border:1px solid}
|
|
170
|
+</style>
|