BomPrintItemList.vue
5.97 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
210
211
212
213
214
215
216
217
218
219
<template>
<a-card :bordered="false">
<!-- 抽屉 -->
<a-drawer
title="打印列表"
:width="screenWidth"
@close="onClose"
:visible="visible"
>
<!-- 抽屉内容的border -->
<div
:style="{
padding:'10px',
border: '1px solid #e9e9e9',
background: '#fff',
}">
<div class="table-page-search-wrapper">
<a-form layout="inline" :form="form">
<a-form-item label="基础信息:" :labelCol="{span: 6}" :wrapperCol="{span: 14, offset: 1}">
<a-input v-model="queryParam.materialname" disabled></a-input>
</a-form-item>
</a-form>
<a-form layout="inline" :form="form">
<a-form-item label="数量:" :labelCol="{span: 6}" :wrapperCol="{span: 14, offset: 1}">
<a-input v-model="queryParam.qty"></a-input>
</a-form-item>
</a-form>
<a-form-item label="打印机选择:" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group
v-model="identity"
@change="identityChange">
<a-radio value="0">本机打印</a-radio>
<a-radio value="打印机1">打印机1</a-radio>
<a-radio value="打印机2">打印机2</a-radio>
<a-radio value="打印机3">打印机3</a-radio>
</a-radio-group>
</a-form-item>
</div>
<div>
<a-table
ref="table"
rowKey="id"
size="middle"
:columns="columns"
:dataSource="dataSource"
:loading="loading"
>
<span slot="action" slot-scope="text, record">
<a-popconfirm title="确定打印吗?" @confirm="() => elcPrint(record)">
<a>打印</a>
</a-popconfirm>
</span>
<span slot="tradeNum" slot-scope="qty">
{{ numFormat(qty) }}
</span>
</a-table>
</div>
</div>
</a-drawer>
</a-card>
</template>
<script>
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import {bomPartList, pcPrint} from '@/api/api'
export default {
name: 'BomPrintItemList',
mixins: [JeecgListMixin],
data() {
return {
columns: [
{
title: '名称',
dataIndex: 'name',
key: 'name'
}, {
title: '料号',
dataIndex: 'no',
key: 'no'
},
{
title: '图号',
dataIndex: 'drawingNo',
key: 'drawingNo'
}, {
title: '规格',
dataIndex: 'spec',
key: 'spec'
}, {
title: '重量',
dataIndex: 'weight',
key: 'weight'
},
{
title: '数量',
dataIndex: 'qty',
key: 'qty'
}, {
title: '身份编码',
align: 'center',
dataIndex: 'qrCode'
},
{
title: '操作',
dataIndex: 'action',
align: "center",
fixed: "right",
width: 147,
scopedSlots: {customRender: 'action'},
}
],
queryParam: {
name: '',
},
identity: "0",
departIdShow: false,
title: '操作',
visible: false,
params: {
workOrder: '',
bomCode: '',
bnum: '',
inventoryId: ''
},
screenWidth: 1000,
model: {},
view: false,
labelCol: {
xs: {span: 5},
sm: {span: 5}
},
wrapperCol: {
xs: {span: 12},
sm: {span: 12}
},
form: this.$form.createForm(this),
validatorRules: {
itemText: {rules: [{required: true, message: '请输入名称!'}]},
itemValue: {rules: [{required: true, message: '请输入数据值!'}]}
},
}
},
created() {
// 当页面初始化时,根据屏幕大小来给抽屉设置宽度
this.resetScreenSize()
},
methods: {
edit(id, workno) {
this.queryParam.materialname = '工作令:' + workno
let params = {
'ids': id,
'workno': workno,
}
bomPartList(params).then(res => {
if (res.success) {
this.dataSource = res.result
}
})
this.visible = true
},
elcPrint(data) {
if (this.queryParam.qty != '' && this.queryParam.qty != undefined) {
data.qty = this.queryParam.qty;
}
if (this.identity == '0') {
var url = 'http://mts.huahengweld.com/jeecg-boot/jmreport/view/814291355579183104?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2ODMzODU0MjAsInVzZXJuYW1lIjoiY2hlbmFvIn0.gtBLBMdC7risfLQla0k0ZaeDsKv-AsKMkWSTWIh0iRk&name=' + data.name + '&qrCode=' + data.qrCode + '&workno=' + data.workno + '&no=' + data.no + '&weight=' + data.weight + '&qty=' + data.qty + '&spec=' + data.drawingNo;
window.open(url, "newWindow", "toolbar=no,scrollbars=no,menubar=no,screenX=100,screenY=100");
} else {
let params = {
'flag': '1',
'print': this.identity,
'name': data.name,
'spec': data.drawingNo,
'qrcode': data.qrCode,
'weight': data.weight,
'qty': data.qty,
'workno': data.workno,
'u8': data.no,
'principal': 'pc',
}
pcPrint(params).then(res => {
if (res.success) {
this.$message.success(res.message);
}
})
}
},
identityChange(e) {
},
onClose() {
this.visible = false
this.form.resetFields()
this.dataSource = []
},
}
}
</script>
<style lang="less" scoped>
//update--begin--autor:wangshuai-----date:20191204------for:系统管理 数据字典禁用和正常区别开,添加背景颜色 teambition JT-22------
/deep/ .data-rule-invalid {
background: #f4f4f4;
color: #bababa;
}
//update--begin--autor:wangshuai-----date:20191204------for:系统管理 数据字典禁用和正常区别开,添加背景颜色 teambition JT-22------
</style>