提交 | 用户 | 时间
|
fd2207
|
1 |
<template> |
懒 |
2 |
<div class="app-container"> |
|
3 |
<el-card class="box-card"> |
|
4 |
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
131e8c
|
5 |
<el-form-item label-width="100" label="发动机编码" prop="sfcCode"> |
W |
6 |
<el-input v-model="queryParams.sfcCode" placeholder="请输入发动机编码" clearable @keyup.enter.native="handleQuery"/> |
|
7 |
</el-form-item> |
fd2207
|
8 |
<el-form-item label="入站时间" prop="inboundTime"> |
懒 |
9 |
<el-date-picker clearable |
|
10 |
v-model="queryParams.inboundTime" |
|
11 |
type="date" |
|
12 |
value-format="yyyy-MM-dd" |
|
13 |
placeholder="请选择入站时间"> |
|
14 |
</el-date-picker> |
|
15 |
</el-form-item> |
|
16 |
<el-form-item label="出站时间" prop="outboundTime"> |
|
17 |
<el-date-picker clearable |
|
18 |
v-model="queryParams.outboundTime" |
|
19 |
type="date" |
|
20 |
value-format="yyyy-MM-dd" |
|
21 |
placeholder="请选择出站时间"> |
|
22 |
</el-date-picker> |
|
23 |
</el-form-item> |
|
24 |
<el-form-item style="float: right"> |
|
25 |
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
|
26 |
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
|
27 |
</el-form-item> |
|
28 |
</el-form> |
|
29 |
</el-card> |
|
30 |
<el-card style="margin-top: 10px" class="box-card"> |
|
31 |
<el-row :gutter="10" class="mb8"> |
|
32 |
<el-col :span="1.5"> |
|
33 |
<el-button |
|
34 |
type="primary" |
|
35 |
plain |
|
36 |
icon="el-icon-plus" |
|
37 |
size="mini" |
|
38 |
@click="handleAdd" |
|
39 |
v-hasPermi="['da:passingStationCollection:add']" |
|
40 |
>新增</el-button> |
|
41 |
</el-col> |
|
42 |
<el-col :span="1.5"> |
|
43 |
<el-button |
|
44 |
type="success" |
|
45 |
plain |
|
46 |
icon="el-icon-edit" |
|
47 |
size="mini" |
|
48 |
:disabled="single" |
|
49 |
@click="handleUpdate" |
|
50 |
v-hasPermi="['da:passingStationCollection:edit']" |
|
51 |
>修改</el-button> |
|
52 |
</el-col> |
|
53 |
<el-col :span="1.5"> |
|
54 |
<el-button |
|
55 |
type="danger" |
|
56 |
plain |
|
57 |
icon="el-icon-delete" |
|
58 |
size="mini" |
|
59 |
:disabled="multiple" |
|
60 |
@click="handleDelete" |
|
61 |
v-hasPermi="['da:passingStationCollection:remove']" |
|
62 |
>删除</el-button> |
|
63 |
</el-col> |
|
64 |
<el-col :span="1.5"> |
|
65 |
<el-button |
|
66 |
type="warning" |
|
67 |
plain |
|
68 |
icon="el-icon-download" |
|
69 |
size="mini" |
|
70 |
@click="handleExport" |
|
71 |
v-hasPermi="['da:passingStationCollection:export']" |
|
72 |
>导出</el-button> |
|
73 |
</el-col> |
|
74 |
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
|
75 |
</el-row> |
|
76 |
|
|
77 |
<el-table v-loading="loading" border :data="passingStationCollectionList" @selection-change="handleSelectionChange" v-if="passingStationCollectionList.length > 0"> |
|
78 |
<el-table-column type="selection" width="55" align="center" /> |
|
79 |
<el-table-column label="工单编号" align="center" prop="workOrderNo"> |
|
80 |
</el-table-column> |
131e8c
|
81 |
<el-table-column label="发动机编码" align="center" prop="sfcCode" width="150"> |
fd2207
|
82 |
</el-table-column> |
懒 |
83 |
<el-table-column label="产品编号" align="center" prop="productCode"> |
|
84 |
</el-table-column> |
|
85 |
<el-table-column label="产线编号" align="center" prop="productionLine"> |
|
86 |
</el-table-column> |
|
87 |
<el-table-column label="工位编号" align="center" prop="locationCode"> |
|
88 |
</el-table-column> |
131e8c
|
89 |
<el-table-column label="入站时间" align="center" prop="inboundTime" width="160"> |
fd2207
|
90 |
<template slot-scope="scope"> |
629c9f
|
91 |
<span>{{ parseTime(scope.row.inboundTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> |
fd2207
|
92 |
</template> |
懒 |
93 |
</el-table-column> |
131e8c
|
94 |
<el-table-column label="出站时间" align="center" prop="outboundTime" width="160"> |
fd2207
|
95 |
<template slot-scope="scope"> |
629c9f
|
96 |
<span>{{ parseTime(scope.row.outboundTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> |
fd2207
|
97 |
</template> |
懒 |
98 |
</el-table-column> |
629c9f
|
99 |
|
fd2207
|
100 |
<el-table-column label="是否合格" align="center" prop="outRsSign"> |
懒 |
101 |
</el-table-column> |
|
102 |
<el-table-column label="NG原因" align="center" prop="outMsgSign"> |
|
103 |
</el-table-column> |
|
104 |
<el-table-column label="采集时间" align="center" prop="collectionTime" width="180"> |
|
105 |
<template slot-scope="scope"> |
629c9f
|
106 |
<span>{{ parseTime(scope.row.collectionTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> |
fd2207
|
107 |
</template> |
懒 |
108 |
</el-table-column> |
8876c2
|
109 |
<!-- <el-table-column label="节拍时间" align="center" prop="beatTime">--> |
W |
110 |
<!-- </el-table-column>--> |
fd2207
|
111 |
<el-table-column fixed="right" label="操作" width="200" align="center" class-name="small-padding fixed-width"> |
懒 |
112 |
<template slot-scope="scope"> |
|
113 |
<el-button |
|
114 |
size="mini" |
|
115 |
type="success" |
|
116 |
plain |
|
117 |
style="width: 72px" |
|
118 |
icon="el-icon-edit" |
|
119 |
@click="handleUpdate(scope.row)" |
|
120 |
v-hasPermi="['da:passingStationCollection:edit']" |
|
121 |
>修改</el-button> |
|
122 |
<el-button |
|
123 |
size="mini" |
|
124 |
type="danger" |
|
125 |
plain |
|
126 |
style="width: 72px" |
|
127 |
icon="el-icon-delete" |
|
128 |
@click="handleDelete(scope.row)" |
|
129 |
v-hasPermi="['da:passingStationCollection:remove']" |
|
130 |
>删除</el-button> |
|
131 |
</template> |
|
132 |
</el-table-column> |
|
133 |
</el-table> |
|
134 |
<el-empty v-else> |
|
135 |
<span slot="description">暂无数据</span> |
|
136 |
</el-empty> |
|
137 |
</el-card> |
|
138 |
|
|
139 |
<pagination |
|
140 |
v-show="total>0" |
|
141 |
:total="total" |
|
142 |
:page.sync="queryParams.pageNum" |
|
143 |
:limit.sync="queryParams.pageSize" |
|
144 |
@pagination="getList" |
|
145 |
/> |
|
146 |
|
|
147 |
<!-- 添加或修改产品过站采集对话框 --> |
55542c
|
148 |
<el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="1000px" append-to-body> |
J |
149 |
<el-form ref="form" inline :model="form" :rules="rules" label-width="120px"> |
fd2207
|
150 |
<el-form-item label="工单编号" prop="workOrderNo"> |
懒 |
151 |
<el-input v-model="form.workOrderNo" type="textarea" placeholder="请输入内容" /> |
|
152 |
</el-form-item> |
131e8c
|
153 |
<el-form-item label="发动机编码" prop="sfcCode"> |
fd2207
|
154 |
<el-input v-model="form.sfcCode" type="textarea" placeholder="请输入内容" /> |
懒 |
155 |
</el-form-item> |
|
156 |
<el-form-item label="产品编号" prop="productCode"> |
|
157 |
<el-input v-model="form.productCode" type="textarea" placeholder="请输入内容" /> |
|
158 |
</el-form-item> |
|
159 |
<el-form-item label="产线编号" prop="productionLine"> |
|
160 |
<el-input v-model="form.productionLine" type="textarea" placeholder="请输入内容" /> |
|
161 |
</el-form-item> |
|
162 |
<el-form-item label="工位编号" prop="locationCode"> |
|
163 |
<el-input v-model="form.locationCode" type="textarea" placeholder="请输入内容" /> |
|
164 |
</el-form-item> |
|
165 |
<el-form-item label="设备编号" prop="equipmentNo"> |
|
166 |
<el-input v-model="form.equipmentNo" type="textarea" placeholder="请输入内容" /> |
|
167 |
</el-form-item> |
|
168 |
<el-form-item label="入站时间" prop="inboundTime"> |
|
169 |
<el-date-picker clearable |
|
170 |
v-model="form.inboundTime" |
|
171 |
type="date" |
|
172 |
value-format="yyyy-MM-dd" |
|
173 |
placeholder="请选择入站时间"> |
|
174 |
</el-date-picker> |
|
175 |
</el-form-item> |
|
176 |
<el-form-item label="出站时间" prop="outboundTime"> |
|
177 |
<el-date-picker clearable |
|
178 |
v-model="form.outboundTime" |
|
179 |
type="date" |
|
180 |
value-format="yyyy-MM-dd" |
|
181 |
placeholder="请选择出站时间"> |
|
182 |
</el-date-picker> |
|
183 |
</el-form-item> |
|
184 |
<el-form-item label="是否合格" prop="outRsSign"> |
|
185 |
<el-input v-model="form.outRsSign" placeholder="请输入出站是否合格" /> |
|
186 |
</el-form-item> |
|
187 |
<el-form-item label="NG原因" prop="outMsgSign"> |
|
188 |
<el-input v-model="form.outMsgSign" type="textarea" placeholder="请输入内容" /> |
|
189 |
</el-form-item> |
|
190 |
<el-form-item label="采集时间" prop="collectionTime"> |
|
191 |
<el-date-picker clearable |
|
192 |
v-model="form.collectionTime" |
|
193 |
type="date" |
|
194 |
value-format="yyyy-MM-dd" |
|
195 |
placeholder="请选择采集时间"> |
|
196 |
</el-date-picker> |
|
197 |
</el-form-item> |
8876c2
|
198 |
<!-- <el-form-item label="节拍时间" prop="beatTime">--> |
W |
199 |
<!-- <el-input v-model="form.beatTime" placeholder="请输入节拍时间" />--> |
|
200 |
<!-- </el-form-item>--> |
fd2207
|
201 |
</el-form> |
懒 |
202 |
<div slot="footer" class="dialog-footer"> |
|
203 |
<el-button type="primary" @click="submitForm">确 定</el-button> |
|
204 |
<el-button @click="cancel">取 消</el-button> |
|
205 |
</div> |
|
206 |
</el-dialog> |
|
207 |
</div> |
|
208 |
</template> |
|
209 |
|
|
210 |
<script> |
|
211 |
import { listPassingStationCollection, getPassingStationCollection, delPassingStationCollection, addPassingStationCollection, updatePassingStationCollection } from "@/api/main/da/passingStationCollection/passingStationCollection"; |
|
212 |
|
|
213 |
export default { |
|
214 |
name: "PassingStationCollection", |
|
215 |
data() { |
|
216 |
return { |
|
217 |
// 遮罩层 |
|
218 |
loading: true, |
|
219 |
// 选中数组 |
|
220 |
ids: [], |
|
221 |
// 非单个禁用 |
|
222 |
single: true, |
|
223 |
// 非多个禁用 |
|
224 |
multiple: true, |
|
225 |
// 显示搜索条件 |
|
226 |
showSearch: true, |
|
227 |
// 总条数 |
|
228 |
total: 0, |
|
229 |
// 产品过站采集表格数据 |
|
230 |
passingStationCollectionList: [], |
|
231 |
// 弹出层标题 |
|
232 |
title: "", |
|
233 |
// 是否显示弹出层 |
|
234 |
open: false, |
|
235 |
// 查询参数 |
|
236 |
queryParams: { |
|
237 |
pageNum: 1, |
|
238 |
pageSize: 10, |
|
239 |
workOrderNo: null, |
|
240 |
sfcCode: null, |
|
241 |
productCode: null, |
|
242 |
productionLine: null, |
|
243 |
locationCode: null, |
|
244 |
equipmentNo: null, |
|
245 |
inboundTime: null, |
|
246 |
outboundTime: null, |
|
247 |
}, |
|
248 |
// 表单参数 |
|
249 |
form: {}, |
|
250 |
// 表单校验 |
|
251 |
rules: { |
|
252 |
id: [ |
|
253 |
{ required: true, message: "主键id不能为空", trigger: "blur" } |
|
254 |
], |
|
255 |
} |
|
256 |
}; |
|
257 |
}, |
|
258 |
created() { |
|
259 |
this.getList(); |
|
260 |
}, |
|
261 |
methods: { |
|
262 |
/** 查询产品过站采集列表 */ |
|
263 |
getList() { |
|
264 |
this.loading = true; |
|
265 |
listPassingStationCollection(this.queryParams).then(response => { |
|
266 |
this.passingStationCollectionList = response.rows; |
|
267 |
this.total = response.total; |
|
268 |
this.loading = false; |
|
269 |
}); |
|
270 |
}, |
|
271 |
// 取消按钮 |
|
272 |
cancel() { |
|
273 |
this.open = false; |
|
274 |
this.reset(); |
|
275 |
}, |
|
276 |
// 表单重置 |
|
277 |
reset() { |
|
278 |
this.form = { |
|
279 |
id: null, |
|
280 |
workOrderNo: null, |
|
281 |
sfcCode: null, |
|
282 |
productCode: null, |
|
283 |
productionLine: null, |
|
284 |
locationCode: null, |
|
285 |
equipmentNo: null, |
|
286 |
inboundTime: null, |
|
287 |
outboundTime: null, |
|
288 |
inRsSign: null, |
|
289 |
inMsgSign: null, |
|
290 |
outRsSign: null, |
|
291 |
outMsgSign: null, |
|
292 |
collectionTime: null, |
|
293 |
spareField1: null, |
|
294 |
spareField2: null, |
|
295 |
createUser: null, |
|
296 |
createTime: null, |
|
297 |
updateUser: null, |
|
298 |
updateTime: null, |
|
299 |
beatTime: null |
|
300 |
}; |
|
301 |
this.resetForm("form"); |
|
302 |
}, |
|
303 |
/** 搜索按钮操作 */ |
|
304 |
handleQuery() { |
|
305 |
this.queryParams.pageNum = 1; |
|
306 |
this.getList(); |
|
307 |
}, |
|
308 |
/** 重置按钮操作 */ |
|
309 |
resetQuery() { |
|
310 |
this.resetForm("queryForm"); |
|
311 |
this.handleQuery(); |
|
312 |
}, |
|
313 |
// 多选框选中数据 |
|
314 |
handleSelectionChange(selection) { |
|
315 |
this.ids = selection.map(item => item.id) |
|
316 |
this.single = selection.length!==1 |
|
317 |
this.multiple = !selection.length |
|
318 |
}, |
|
319 |
/** 新增按钮操作 */ |
|
320 |
handleAdd() { |
|
321 |
this.reset(); |
|
322 |
this.open = true; |
|
323 |
this.title = "添加产品过站采集"; |
|
324 |
}, |
|
325 |
/** 修改按钮操作 */ |
|
326 |
handleUpdate(row) { |
|
327 |
this.reset(); |
|
328 |
const id = row.id || this.ids |
|
329 |
getPassingStationCollection(id).then(response => { |
|
330 |
this.form = response.data; |
|
331 |
this.open = true; |
|
332 |
this.title = "修改产品过站采集"; |
|
333 |
}); |
|
334 |
}, |
|
335 |
/** 提交按钮 */ |
|
336 |
submitForm() { |
|
337 |
this.$refs["form"].validate(valid => { |
|
338 |
if (valid) { |
|
339 |
if (this.form.id != null) { |
|
340 |
updatePassingStationCollection(this.form).then(response => { |
|
341 |
this.$modal.msgSuccess("修改成功"); |
|
342 |
this.open = false; |
|
343 |
this.getList(); |
|
344 |
}); |
|
345 |
} else { |
|
346 |
addPassingStationCollection(this.form).then(response => { |
|
347 |
this.$modal.msgSuccess("新增成功"); |
|
348 |
this.open = false; |
|
349 |
this.getList(); |
|
350 |
}); |
|
351 |
} |
|
352 |
} |
|
353 |
}); |
|
354 |
}, |
|
355 |
/** 删除按钮操作 */ |
|
356 |
handleDelete(row) { |
|
357 |
const ids = row.id || this.ids; |
131e8c
|
358 |
this.$modal.confirm('是否确认删除?').then(function() { |
fd2207
|
359 |
return delPassingStationCollection(ids); |
懒 |
360 |
}).then(() => { |
|
361 |
this.getList(); |
|
362 |
this.$modal.msgSuccess("删除成功"); |
|
363 |
}).catch(() => {}); |
|
364 |
}, |
|
365 |
/** 导出按钮操作 */ |
|
366 |
handleExport() { |
|
367 |
this.download('da/passingStationCollection/export', { |
|
368 |
...this.queryParams |
|
369 |
}, `passingStationCollection_${new Date().getTime()}.xlsx`) |
|
370 |
} |
|
371 |
} |
|
372 |
}; |
|
373 |
</script> |