PrintModalOrder.vue
5.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
:confirmLoading="confirmLoading"
:maskClosable="false"
switchFullscreen
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭"
okText="打印完成"
>
<a-card :bordered="false" :class="{ abcdefg: true }">
<div class="no-print" style="text-align: right">
<a-button v-print="'#printContent'" ghost type="primary">打印</a-button>
</div>
<section ref="print" id="printContent" class="abcdefg">
<div style="text-align: center">
<p style="font-size: 24px; font-weight: 800">领料单</p>
</div>
<div style="height: 1px; border-top: 1px solid #000000; margin-bottom: 30px"></div>
<!--签字-->
<a-table
v-if="!loading"
ref="table"
size="middle"
bordered
rowKey="id"
:scroll="{ x: true }"
:indentSize="30"
:columns="columns"
:dataSource="dataSource"
:loading="loading"
:pagination="false"
:defaultExpandAllRows="true"
>
</a-table>
<a-row style="margin-top: 20px">
<a-col :span="12">
<span> 承接人 : {{ this.workMan }} </span>
</a-col>
<a-col :span="12">
<span> 下单日期 : {{ this.workOrderDate }}</span>
</a-col>
</a-row>
</section>
</a-card>
</j-modal>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue, formatDate, filterObj } from '@/utils/util'
export default {
name: 'PrintModalOrder',
components: {},
props: {},
data() {
return {
title: '领料单',
width: 800,
visible: false,
workMan: '',
workOrderDate: '',
// 表头
columns: [
{
title: '物料编号',
align: 'center',
dataIndex: 'partNumber',
},
{
title: '品名',
align: 'center',
dataIndex: 'productName',
},
{
title: '型号',
align: 'center',
dataIndex: 'type',
},
{
title: '规格',
align: 'center',
dataIndex: 'spec',
},
{
title: '数量',
align: 'center',
dataIndex: 'operNumber',
},
],
dataSource: [],
confirmLoading: false,
loading: false,
url: {
list: '/work_order/tblWorkOrder/listOrderByMainIdNoPage',
},
/* 排序参数 */
isorter: {
column: 'createTime',
order: 'desc',
},
/* 筛选参数 */
filters: {},
/* 查询条件-请不要在queryParam中声明非字符串值的属性 */
queryParam: {},
model: {},
}
},
created() {},
methods: {
open(record) {
this.visible = true
this.loading = true
this.queryParam['id'] = record.id
var params = this.getQueryParams() //查询条件
this.loading = true
getAction(this.url.list, params)
.then((res) => {
if (res.success) {
//update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
this.dataSource = res.result.records || res.result
this.workMan = res.result[0].workMan
this.workOrderDate = res.result[0].workOrderDate
//update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
} else {
this.$message.warning(res.message)
}
})
.finally(() => {
this.loading = false
})
},
getQueryParams() {
//获取查询条件
let sqp = {}
var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters)
param.field = this.getQueryField()
return filterObj(param)
},
getQueryField() {
//TODO 字段权限控制
var str = 'id,'
this.columns.forEach(function (value) {
str += ',' + value.dataIndex
})
return str
},
close() {
this.$emit('close')
this.visible = false
},
handleOk() {
const that = this
that.visible = false
that.$emit('ok')
},
handleCancel() {
this.close()
},
},
}
</script>
<style scoped>
/*update_begin author:scott date:20191203 for:打印机打印的字体模糊问题 */
* {
color: #000000 !important;
-webkit-tap-highlight-color: #000000 !important;
}
/*update_end author:scott date:20191203 for:打印机打印的字体模糊问题 */
.abcdefg .ant-card-body {
margin-left: 0%;
margin-right: 0%;
margin-bottom: 1%;
border: 0px solid black;
min-width: 800px;
color: #000000 !important;
}
.explain {
text-align: left;
margin-left: 50px;
color: #000000 !important;
}
.explain .ant-input,
.sign .ant-input {
font-weight: bolder;
text-align: center;
border-left-width: 0px !important;
border-top-width: 0px !important;
border-right-width: 0px !important;
}
.explain div {
margin-bottom: 10px;
}
/* you can make up upload button and sample style by using stylesheets */
.ant-upload-select-picture-card i {
font-size: 32px;
color: #999;
}
.ant-upload-select-picture-card .ant-upload-text {
margin-top: 8px;
color: #666;
}
</style>