提交 | 用户 | 时间
|
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="配瓦颜色"> |
5030f3
|
147 |
<!-- <span style="color: #FFFFFF;" :style="{ backgroundColor: queryParams.tileColor }">{{queryParams.tileColor}}</span>--> |
Y |
148 |
<span v-for="(word, index) in queryParams.words" :key="index" :style="{ backgroundColor: queryParams.colors[index],fontSize: '30px',}">{{ word }}</span> |
254a39
|
149 |
</el-descriptions-item> |
H |
150 |
</el-descriptions> |
|
151 |
<el-divider></el-divider> |
|
152 |
</el-card> |
|
153 |
</el-col> |
|
154 |
</div> |
|
155 |
</div> |
|
156 |
</template> |
|
157 |
<script> |
|
158 |
import VueQr from 'vue-qr' |
|
159 |
import { listTileMatchRules, getTileMatchRules, delTileMatchRules, addTileMatchRules, updateTileMatchRules } from "@/api/main/bs/tileMatchRules/tileMatchRules"; |
|
160 |
export default { |
|
161 |
name: "index", |
43909f
|
162 |
dicts: ['colour_hex','productseries','axisname','neckname','tilename'], |
254a39
|
163 |
components: { |
H |
164 |
VueQr, |
|
165 |
}, |
|
166 |
data(){ |
|
167 |
return{ |
|
168 |
loading: true, |
|
169 |
tileMatchKbList: [], |
|
170 |
qrCode: '', |
|
171 |
// 查询参数 |
43909f
|
172 |
from:{ |
254a39
|
173 |
pageNum: 1, |
H |
174 |
pageSize: 10, |
|
175 |
productSeries: null, |
1c7036
|
176 |
//scanObject1: null, |
5030f3
|
177 |
scanObject1: 'ONYL01FZ0120003023123;1206B0026;D2212BA', |
Y |
178 |
scanObject2: 'P0NYK0410001000;T231107031;D2222232;S500003', |
43909f
|
179 |
axisName: null, |
H |
180 |
neckName: null, |
|
181 |
tileName: null, |
254a39
|
182 |
axisParameterNoPosition: null, |
H |
183 |
neckParameterPosition: null, |
|
184 |
axisValue: null, |
|
185 |
neckValue: null, |
|
186 |
tileColor: null, |
|
187 |
createUser: null, |
|
188 |
updateUser: null, |
|
189 |
state: null, |
43909f
|
190 |
weight: null, |
H |
191 |
}, |
|
192 |
queryParams: { |
|
193 |
pageNum: 1, |
|
194 |
pageSize: 10, |
|
195 |
productSeries: null, |
|
196 |
scanObject1: null, |
|
197 |
// scanObject1: 'P0SQ0-01FZ01-1000;T231224116;DBBBBA', |
|
198 |
scanObject2: null, |
|
199 |
axisName: null, |
|
200 |
neckName: null, |
|
201 |
tileName: null, |
|
202 |
axisParameterNoPosition: null, |
|
203 |
neckParameterPosition: null, |
|
204 |
axisValue: null, |
|
205 |
neckValue: null, |
5030f3
|
206 |
tileColor: "", |
Y |
207 |
words: ['一档 .', '二档 .', '三档 .', '四档 .'], |
|
208 |
colors: ['#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF'], |
43909f
|
209 |
createUser: null, |
H |
210 |
updateUser: null, |
|
211 |
state: null, |
|
212 |
weight: null, |
254a39
|
213 |
}, |
H |
214 |
} |
|
215 |
}, |
|
216 |
methods:{ |
|
217 |
/** 搜索按钮操作 */ |
|
218 |
handleQuery() { |
43909f
|
219 |
this.clear(); |
H |
220 |
|
|
221 |
if(this.from.scanObject1 !== null && this.from.scanObject2 !== null |
5030f3
|
222 |
// && this.from.axisName !== null && this.from.axisName !== "" |
Y |
223 |
// && this.from.neckName !== null && this.from.neckName !== "" |
|
224 |
// && this.from.tileName !== null && this.from.tileName !== "" |
43909f
|
225 |
&& this.from.productSeries !== null && this.from.productSeries !== "") |
H |
226 |
{ |
|
227 |
this.axisValueextracted(); |
|
228 |
this.neckValueextracted(); |
|
229 |
if(this.queryParams.axisValue !== null && this.queryParams.neckValue !== null){ |
|
230 |
this.insetFromToQueryParams(); |
|
231 |
this.getList(); |
|
232 |
} |
|
233 |
else{ |
|
234 |
const h = this.$createElement; |
|
235 |
this.$message({ |
|
236 |
message: h('p',null, [ |
|
237 |
h('span', null, '警告 '), |
|
238 |
h('i', { style: 'color: black' }, '箱体码或曲轴码输入有误'), |
|
239 |
h()]), |
|
240 |
type: 'error', |
|
241 |
center: true, |
|
242 |
offset:300 |
|
243 |
}); |
|
244 |
} |
|
245 |
} |
|
246 |
else{ |
|
247 |
const h = this.$createElement; |
|
248 |
this.$message({ |
|
249 |
message: h('p',null, [ |
|
250 |
h('span', null, '警告 '), |
|
251 |
h('i', { style: 'color: black' }, '请填写所有搜索条件'), |
|
252 |
h()]), |
|
253 |
type: 'error', |
|
254 |
center: true, |
|
255 |
offset:300 |
|
256 |
}); |
|
257 |
} |
254a39
|
258 |
}, |
43909f
|
259 |
|
H |
260 |
// 取箱体码第三段为配瓦值 |
254a39
|
261 |
axisValueextracted() { |
43909f
|
262 |
const parts1 = this.from.scanObject1.split(";"); |
254a39
|
263 |
if (parts1.length >= 3) { |
1c7036
|
264 |
//const axisValueextracted = parts1[2].substring(3,4); |
Y |
265 |
const axisValueextracted = parts1[2]; |
254a39
|
266 |
return this.queryParams.axisValue= axisValueextracted; |
43909f
|
267 |
|
254a39
|
268 |
} |
H |
269 |
}, |
43909f
|
270 |
|
H |
271 |
//取曲轴码第三段为配瓦值 |
254a39
|
272 |
neckValueextracted() { |
43909f
|
273 |
const parts2 = this.from.scanObject2.split(";"); |
254a39
|
274 |
if (parts2.length >= 3) { |
1c7036
|
275 |
//const neckValueextracted = parts2[2].substring(3,4); |
Y |
276 |
const neckValueextracted = parts2[2]; |
254a39
|
277 |
return this.queryParams.neckValue= neckValueextracted; |
H |
278 |
} |
|
279 |
}, |
43909f
|
280 |
//取配瓦颜色 |
254a39
|
281 |
getList() { |
H |
282 |
let queryParams = { |
|
283 |
productSeries : this.queryParams.productSeries, |
|
284 |
axisName : this.queryParams.axisName, |
|
285 |
neckName : this.queryParams.neckName, |
|
286 |
tileName : this.queryParams.tileName, |
|
287 |
axisValue: this.queryParams.axisValue, |
|
288 |
neckValue: this.queryParams.neckValue, |
|
289 |
} |
|
290 |
console.log(queryParams) |
|
291 |
listTileMatchRules(queryParams).then(response => { |
5030f3
|
292 |
this.queryParams.words= ['------', '------', '------', '------'] |
Y |
293 |
this.queryParams.colors= ['#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF'] |
|
294 |
for (var i=0;i<response.rows.length;i++){ |
|
295 |
this.queryParams.colors[i]=response.rows[i].tileColor; |
|
296 |
this.queryParams.words[i]=response.rows[i].tileName; |
|
297 |
} |
|
298 |
console.log('颜色:',response) |
254a39
|
299 |
}); |
H |
300 |
}, |
43909f
|
301 |
clear(){ |
H |
302 |
this.queryParams.axisValue=null; |
|
303 |
this.queryParams.neckValue=null; |
|
304 |
}, |
|
305 |
insetFromToQueryParams(){ |
|
306 |
this.queryParams.productSeries=this.from.productSeries; |
|
307 |
this.queryParams.axisName=this.from.axisName; |
|
308 |
this.queryParams.neckName=this.from.neckName; |
|
309 |
this.queryParams.tileName=this.from.tileName; |
|
310 |
this.queryParams.scanObject1=this.from.scanObject1; |
|
311 |
this.queryParams.scanObject2=this.from.scanObject2; |
|
312 |
} |
|
313 |
|
|
314 |
}, |
254a39
|
315 |
} |
H |
316 |
</script> |
|
317 |
|
|
318 |
<style scoped> |
|
319 |
::v-deep .el-form-item__label{ |
|
320 |
font-size: large; |
|
321 |
} |
|
322 |
::v-deep .el-card__body{ |
|
323 |
padding: 15px 20px 0px 20px; |
|
324 |
} |
|
325 |
::v-deep .el-input .el-input--medium .el-input--suffix{ |
|
326 |
width: 200px; |
|
327 |
} |
|
328 |
|
|
329 |
</style> |