提交 | 用户 | 时间
|
254a39
|
1 |
<template> |
H |
2 |
<div class="app-container"> |
43909f
|
3 |
<div style="width: 100%"> |
254a39
|
4 |
<el-card class="box-card" > |
43909f
|
5 |
<el-form :model="from" ref="queryForm" :inline="true" > |
254a39
|
6 |
<el-form-item label="箱体码:" prop="scanObject1" > |
H |
7 |
<el-input |
43909f
|
8 |
style="width: 350px" |
H |
9 |
v-model="from.scanObject1" |
254a39
|
10 |
placeholder="请输入箱体码" |
H |
11 |
clearable |
|
12 |
@keyup.enter.native="handleQuery" |
43909f
|
13 |
@input="handleQuery" |
254a39
|
14 |
/> |
H |
15 |
</el-form-item> |
|
16 |
<el-form-item label="曲轴码:" prop="scanObject2" > |
|
17 |
<el-input |
43909f
|
18 |
style="width: 350px" |
H |
19 |
v-model="from.scanObject2" |
254a39
|
20 |
placeholder="请输入曲轴码" |
H |
21 |
clearable |
|
22 |
@keyup.enter.native="handleQuery" |
43909f
|
23 |
@input="handleQuery" |
254a39
|
24 |
/> |
H |
25 |
</el-form-item> |
|
26 |
</el-form> |
43909f
|
27 |
<el-form :model="from" ref="queryForm" :inline="true" > |
H |
28 |
<el-form-item label="机型:" prop="productSeries" > |
e16008
|
29 |
<el-select v-model="from.productSeries" placeholder="" clearable style="width: 105px"> |
43909f
|
30 |
<el-option |
H |
31 |
|
|
32 |
v-for="dict in dict.type.productseries" |
|
33 |
:key="dict.value" |
|
34 |
:label="dict.label" |
|
35 |
:value="dict.value" |
|
36 |
@keyup.enter.native="handleQuery" |
|
37 |
/> |
|
38 |
</el-select> |
254a39
|
39 |
</el-form-item> |
43909f
|
40 |
<el-form-item label="轴名称:" prop="axisName" > |
e16008
|
41 |
<el-select v-model="from.axisName" placeholder="" clearable style="width: 125px"> |
43909f
|
42 |
<el-option |
H |
43 |
v-for="dict in dict.type.axisname" |
|
44 |
:key="dict.value" |
|
45 |
:label="dict.label" |
|
46 |
:value="dict.value" |
|
47 |
@keyup.enter.native="handleQuery" |
|
48 |
/> |
|
49 |
</el-select> |
|
50 |
</el-form-item> |
|
51 |
<el-form-item label="颈名称:" prop="neckName" > |
e16008
|
52 |
<el-select v-model="from.neckName" placeholder="" clearable style="width: 125px"> |
43909f
|
53 |
<el-option |
H |
54 |
v-for="dict in dict.type.neckname" |
|
55 |
:key="dict.value" |
|
56 |
:label="dict.label" |
|
57 |
:value="dict.value" |
|
58 |
@keyup.enter.native="handleQuery" |
|
59 |
/> |
|
60 |
</el-select> |
|
61 |
</el-form-item> |
|
62 |
<el-form-item label="瓦名称:" prop="tileName" > |
e16008
|
63 |
<el-select v-model="from.tileName" placeholder="" clearable style="width: 125px" > |
43909f
|
64 |
<el-option |
H |
65 |
v-for="dict in dict.type.tilename" |
|
66 |
:key="dict.value" |
|
67 |
:label="dict.label" |
|
68 |
:value="dict.value" |
|
69 |
@keyup.enter.native="handleQuery" |
|
70 |
/> |
|
71 |
</el-select> |
|
72 |
</el-form-item> |
|
73 |
<el-button type="primary" icon="el-icon-refresh" @click="handleQuery">查询</el-button> |
|
74 |
</el-form> |
|
75 |
</el-card> |
|
76 |
<!-- <el-col :span="20">--> |
|
77 |
<!-- <el-card class="box-card" >--> |
|
78 |
<!-- <el-form :model="queryParams" ref="queryForm" :inline="true" >--> |
|
79 |
<!-- <el-form-item label="箱体码:" prop="scanObject1" >--> |
|
80 |
<!-- <el-input--> |
|
81 |
<!-- style=""--> |
|
82 |
<!-- v-model="queryParams.scanObject1"--> |
|
83 |
<!-- placeholder="请输入箱体码"--> |
|
84 |
<!-- clearable--> |
|
85 |
<!-- @keyup.enter.native="handleQuery"--> |
|
86 |
<!-- />--> |
|
87 |
<!-- </el-form-item>--> |
|
88 |
<!-- <el-form-item label="曲轴码:" prop="scanObject2" >--> |
|
89 |
<!-- <el-input--> |
|
90 |
<!-- style=""--> |
|
91 |
<!-- v-model="queryParams.scanObject2"--> |
|
92 |
<!-- placeholder="请输入曲轴码"--> |
|
93 |
<!-- clearable--> |
|
94 |
<!-- @keyup.enter.native="handleQuery"--> |
|
95 |
<!-- />--> |
|
96 |
<!-- </el-form-item>--> |
|
97 |
<!-- <el-form-item label="机型:" prop="productSeries" >--> |
|
98 |
<!-- <el-input--> |
|
99 |
<!-- style="width: 160px"--> |
|
100 |
<!-- v-model="queryParams.productSeries"--> |
|
101 |
<!-- clearable--> |
|
102 |
<!-- @keyup.enter.native="handleQuery"--> |
|
103 |
<!-- />--> |
|
104 |
<!-- </el-form-item>--> |
|
105 |
<!-- </el-form>--> |
|
106 |
<!-- </el-card>--> |
|
107 |
<!-- </el-col>--> |
|
108 |
<!-- <el-col :span="4">--> |
|
109 |
<!-- <el-card class="box-card" >--> |
|
110 |
<!-- <el-form :model="queryParams" ref="queryForm" :inline="true" >--> |
|
111 |
<!-- <el-form-item style="margin-left: 1%">--> |
|
112 |
|
|
113 |
<!-- </el-form-item>--> |
|
114 |
<!-- </el-form>--> |
|
115 |
<!-- </el-card>--> |
|
116 |
<!-- </el-col>--> |
254a39
|
117 |
|
H |
118 |
<el-col :span="24" > |
|
119 |
<el-card class="bottom-card"> |
|
120 |
<div slot="header" class="clearfix"> |
|
121 |
<i class="el-icon-tickets"></i> |
|
122 |
<span style="font-weight: bold">当前产品信息</span> |
|
123 |
</div> |
|
124 |
<el-descriptions :column="1" :label-style="{'font-size': '20px'}" border :content-style="{'min-width': '300px'}"> |
|
125 |
<el-descriptions-item label="机型"> |
|
126 |
<span>{{queryParams.productSeries}}</span> |
|
127 |
</el-descriptions-item> |
|
128 |
<el-descriptions-item label="箱体码"> |
|
129 |
<span>{{queryParams.scanObject1}}</span> |
|
130 |
</el-descriptions-item> |
|
131 |
<el-descriptions-item label="曲轴码"> |
|
132 |
<span>{{queryParams.scanObject2}}</span> |
|
133 |
</el-descriptions-item> |
|
134 |
<el-descriptions-item label="轴名称"> |
|
135 |
<span>{{queryParams.axisName}}</span> |
|
136 |
</el-descriptions-item> |
|
137 |
<el-descriptions-item label="颈名称"> |
|
138 |
<span>{{queryParams.neckName}}</span> |
|
139 |
</el-descriptions-item> |
|
140 |
<el-descriptions-item label="瓦名称"> |
|
141 |
<span>{{queryParams.tileName}}</span> |
|
142 |
</el-descriptions-item> |
43909f
|
143 |
<el-descriptions-item label="重量"> |
H |
144 |
<span>{{queryParams.weight}}</span> |
|
145 |
</el-descriptions-item> |
254a39
|
146 |
<el-descriptions-item label="配瓦颜色"> |
43909f
|
147 |
<span style="color: #FFFFFF;" :style="{ backgroundColor: queryParams.tileColor }">{{queryParams.tileColor}}</span> |
254a39
|
148 |
</el-descriptions-item> |
H |
149 |
</el-descriptions> |
|
150 |
<el-divider></el-divider> |
|
151 |
</el-card> |
|
152 |
</el-col> |
|
153 |
</div> |
|
154 |
</div> |
|
155 |
</template> |
|
156 |
<script> |
|
157 |
import VueQr from 'vue-qr' |
|
158 |
import { listTileMatchRules, getTileMatchRules, delTileMatchRules, addTileMatchRules, updateTileMatchRules } from "@/api/main/bs/tileMatchRules/tileMatchRules"; |
|
159 |
export default { |
|
160 |
name: "index", |
43909f
|
161 |
dicts: ['colour_hex','productseries','axisname','neckname','tilename'], |
254a39
|
162 |
components: { |
H |
163 |
VueQr, |
|
164 |
}, |
|
165 |
data(){ |
|
166 |
return{ |
|
167 |
loading: true, |
|
168 |
tileMatchKbList: [], |
|
169 |
qrCode: '', |
|
170 |
// 查询参数 |
43909f
|
171 |
from:{ |
254a39
|
172 |
pageNum: 1, |
H |
173 |
pageSize: 10, |
|
174 |
productSeries: null, |
43909f
|
175 |
scanObject1: null, |
H |
176 |
// scanObject1: 'P0SQ0-01FZ01-1000;T231224116;DBBBBA', |
254a39
|
177 |
scanObject2: 'P0SQ0-041000-1002;T2312020675;DAABBA;S500003', |
43909f
|
178 |
axisName: null, |
H |
179 |
neckName: null, |
|
180 |
tileName: null, |
254a39
|
181 |
axisParameterNoPosition: null, |
H |
182 |
neckParameterPosition: null, |
|
183 |
axisValue: null, |
|
184 |
neckValue: null, |
|
185 |
tileColor: null, |
|
186 |
createUser: null, |
|
187 |
updateUser: null, |
|
188 |
state: null, |
43909f
|
189 |
weight: null, |
H |
190 |
}, |
|
191 |
queryParams: { |
|
192 |
pageNum: 1, |
|
193 |
pageSize: 10, |
|
194 |
productSeries: null, |
|
195 |
scanObject1: null, |
|
196 |
// scanObject1: 'P0SQ0-01FZ01-1000;T231224116;DBBBBA', |
|
197 |
scanObject2: null, |
|
198 |
axisName: null, |
|
199 |
neckName: null, |
|
200 |
tileName: null, |
|
201 |
axisParameterNoPosition: null, |
|
202 |
neckParameterPosition: null, |
|
203 |
axisValue: null, |
|
204 |
neckValue: null, |
|
205 |
tileColor: null, |
|
206 |
createUser: null, |
|
207 |
updateUser: null, |
|
208 |
state: null, |
|
209 |
weight: null, |
254a39
|
210 |
}, |
H |
211 |
} |
|
212 |
}, |
|
213 |
methods:{ |
|
214 |
/** 搜索按钮操作 */ |
|
215 |
handleQuery() { |
43909f
|
216 |
this.clear(); |
H |
217 |
|
|
218 |
if(this.from.scanObject1 !== null && this.from.scanObject2 !== null |
|
219 |
&& this.from.axisName !== null && this.from.axisName !== "" |
|
220 |
&& this.from.neckName !== null && this.from.neckName !== "" |
|
221 |
&& this.from.tileName !== null && this.from.tileName !== "" |
|
222 |
&& this.from.productSeries !== null && this.from.productSeries !== "") |
|
223 |
{ |
|
224 |
this.axisValueextracted(); |
|
225 |
this.neckValueextracted(); |
|
226 |
if(this.queryParams.axisValue !== null && this.queryParams.neckValue !== null){ |
|
227 |
this.insetFromToQueryParams(); |
|
228 |
this.getList(); |
|
229 |
} |
|
230 |
else{ |
|
231 |
const h = this.$createElement; |
|
232 |
this.$message({ |
|
233 |
message: h('p',null, [ |
|
234 |
h('span', null, '警告 '), |
|
235 |
h('i', { style: 'color: black' }, '箱体码或曲轴码输入有误'), |
|
236 |
h()]), |
|
237 |
type: 'error', |
|
238 |
center: true, |
|
239 |
offset:300 |
|
240 |
}); |
|
241 |
} |
|
242 |
} |
|
243 |
else{ |
|
244 |
const h = this.$createElement; |
|
245 |
this.$message({ |
|
246 |
message: h('p',null, [ |
|
247 |
h('span', null, '警告 '), |
|
248 |
h('i', { style: 'color: black' }, '请填写所有搜索条件'), |
|
249 |
h()]), |
|
250 |
type: 'error', |
|
251 |
center: true, |
|
252 |
offset:300 |
|
253 |
}); |
|
254 |
} |
254a39
|
255 |
}, |
43909f
|
256 |
|
H |
257 |
// 取箱体码第三段为配瓦值 |
254a39
|
258 |
axisValueextracted() { |
43909f
|
259 |
const parts1 = this.from.scanObject1.split(";"); |
254a39
|
260 |
if (parts1.length >= 3) { |
H |
261 |
const axisValueextracted = parts1[2].substring(3,4); |
|
262 |
return this.queryParams.axisValue= axisValueextracted; |
43909f
|
263 |
|
254a39
|
264 |
} |
H |
265 |
}, |
43909f
|
266 |
|
H |
267 |
//取曲轴码第三段为配瓦值 |
254a39
|
268 |
neckValueextracted() { |
43909f
|
269 |
const parts2 = this.from.scanObject2.split(";"); |
254a39
|
270 |
if (parts2.length >= 3) { |
H |
271 |
const neckValueextracted = parts2[2].substring(3,4); |
|
272 |
return this.queryParams.neckValue= neckValueextracted; |
|
273 |
} |
|
274 |
}, |
43909f
|
275 |
//取配瓦颜色 |
254a39
|
276 |
getList() { |
H |
277 |
let queryParams = { |
|
278 |
productSeries : this.queryParams.productSeries, |
|
279 |
axisName : this.queryParams.axisName, |
|
280 |
neckName : this.queryParams.neckName, |
|
281 |
tileName : this.queryParams.tileName, |
|
282 |
axisValue: this.queryParams.axisValue, |
|
283 |
neckValue: this.queryParams.neckValue, |
|
284 |
} |
|
285 |
console.log(queryParams) |
|
286 |
listTileMatchRules(queryParams).then(response => { |
|
287 |
this.queryParams.tileColor = response.rows[0].tileColor; |
|
288 |
}); |
|
289 |
}, |
43909f
|
290 |
clear(){ |
H |
291 |
this.queryParams.axisValue=null; |
|
292 |
this.queryParams.neckValue=null; |
|
293 |
}, |
|
294 |
insetFromToQueryParams(){ |
|
295 |
this.queryParams.productSeries=this.from.productSeries; |
|
296 |
this.queryParams.axisName=this.from.axisName; |
|
297 |
this.queryParams.neckName=this.from.neckName; |
|
298 |
this.queryParams.tileName=this.from.tileName; |
|
299 |
this.queryParams.scanObject1=this.from.scanObject1; |
|
300 |
this.queryParams.scanObject2=this.from.scanObject2; |
|
301 |
} |
|
302 |
|
|
303 |
}, |
254a39
|
304 |
} |
H |
305 |
</script> |
|
306 |
|
|
307 |
<style scoped> |
|
308 |
::v-deep .el-form-item__label{ |
|
309 |
font-size: large; |
|
310 |
} |
|
311 |
::v-deep .el-card__body{ |
|
312 |
padding: 15px 20px 0px 20px; |
|
313 |
} |
|
314 |
::v-deep .el-input .el-input--medium .el-input--suffix{ |
|
315 |
width: 200px; |
|
316 |
} |
|
317 |
|
|
318 |
</style> |