提交 | 用户 | 时间
|
9f7aa7
|
1 |
<template> |
吴 |
2 |
<div class="app-container"> |
|
3 |
<div> |
|
4 |
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px"> |
|
5 |
<el-form-item label="工单编号" prop="workOrderNo"> |
|
6 |
<el-input |
|
7 |
v-model="queryParams.workOrderNo" |
|
8 |
placeholder="请输入工单编号" |
|
9 |
clearable |
|
10 |
@keyup.enter.native="handleQuery" |
|
11 |
/> |
|
12 |
</el-form-item> |
|
13 |
<el-form-item label="订单编号" prop="salesOrderCode"> |
|
14 |
<el-input |
|
15 |
v-model="queryParams.salesOrderCode" |
|
16 |
placeholder="请输入订单编号" |
|
17 |
clearable |
|
18 |
@keyup.enter.native="handleQuery" |
|
19 |
/> |
|
20 |
</el-form-item> |
|
21 |
<el-form-item label="产品编号" prop="productCode"> |
|
22 |
<el-input |
|
23 |
v-model="queryParams.productCode" |
|
24 |
placeholder="请输入产品编号" |
|
25 |
clearable |
|
26 |
@keyup.enter.native="handleQuery" |
|
27 |
/> |
|
28 |
</el-form-item> |
|
29 |
<el-form-item label="工单状态" prop="orderStatus"> |
|
30 |
<el-select v-model="queryParams.orderStatus" placeholder="请选择工单状态" clearable> |
|
31 |
<el-option |
|
32 |
v-for="dict in dict.type.order_status" |
|
33 |
:key="dict.value" |
|
34 |
:label="dict.label" |
|
35 |
:value="dict.value" |
|
36 |
/> |
|
37 |
</el-select> |
|
38 |
</el-form-item> |
|
39 |
<el-form-item style="float: right; margin-right: 90px"> |
|
40 |
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
|
41 |
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
|
42 |
</el-form-item> |
|
43 |
</el-form> |
|
44 |
</div> |
|
45 |
|
|
46 |
|
|
47 |
<div style="width: 600px"> |
|
48 |
<el-row :gutter="10" class="mb8" > |
|
49 |
<el-col :span="1.5"> |
|
50 |
<el-button |
|
51 |
type="primary" |
|
52 |
plain |
|
53 |
icon="el-icon-plus" |
|
54 |
size="mini" |
|
55 |
@click="handleAdd" |
|
56 |
v-hasPermi="['main:info:add']" |
|
57 |
>新增</el-button> |
|
58 |
</el-col> |
|
59 |
<el-col :span="1.5"> |
|
60 |
<el-button |
|
61 |
type="success" |
|
62 |
plain |
|
63 |
icon="el-icon-edit" |
|
64 |
size="mini" |
|
65 |
:disabled="single" |
|
66 |
@click="handleUpdate" |
|
67 |
v-hasPermi="['main:info:edit']" |
|
68 |
>修改</el-button> |
|
69 |
</el-col> |
|
70 |
<el-col :span="1.5"> |
|
71 |
<el-button |
|
72 |
type="danger" |
|
73 |
plain |
|
74 |
icon="el-icon-delete" |
|
75 |
size="mini" |
|
76 |
:disabled="multiple" |
|
77 |
@click="handleDelete" |
|
78 |
v-hasPermi="['main:info:remove']" |
|
79 |
>删除</el-button> |
|
80 |
</el-col> |
|
81 |
<el-col :span="1.5"> |
|
82 |
<el-button |
|
83 |
type="warning" |
|
84 |
plain |
|
85 |
icon="el-icon-download" |
|
86 |
size="mini" |
|
87 |
@click="handleExport" |
|
88 |
v-hasPermi="['main:info:export']" |
|
89 |
>导出</el-button> |
|
90 |
</el-col> |
|
91 |
<el-col :span="1.5"> |
|
92 |
<el-button |
|
93 |
type="primary" |
|
94 |
plain |
|
95 |
icon="el-icon-receiving" |
|
96 |
size="mini" |
|
97 |
@click="handleReceive" |
|
98 |
>接收工单</el-button> |
|
99 |
</el-col> |
|
100 |
<el-col :span="1.5"> |
|
101 |
<el-button |
|
102 |
type="primary" |
|
103 |
plain |
|
104 |
:disabled="multiple" |
|
105 |
icon="el-icon-magic-stick" |
|
106 |
size="mini" |
|
107 |
@click="handleCreate" |
|
108 |
>生成</el-button> |
|
109 |
</el-col> |
|
110 |
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>--> |
|
111 |
</el-row> |
|
112 |
</div> |
|
113 |
|
|
114 |
|
|
115 |
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange"> |
|
116 |
<el-table-column type="selection" width="55" align="center" /> |
226f41
|
117 |
<el-table-column label="工单编号" align="center" prop="workOrderNo" width="120"> |
9f7aa7
|
118 |
<template slot-scope="scope"> |
吴 |
119 |
<a style="color: #7099F9" @click="orderDetail(scope.row.workOrderNo)" >{{scope.row.workOrderNo}} |
|
120 |
</a> |
|
121 |
<!-- <div @click="orderDetail(scope.row.workOrderNo)">{{scope.row.workOrderNo}}</div>--> |
|
122 |
</template> |
|
123 |
</el-table-column> |
226f41
|
124 |
<el-table-column label="订单编号" align="center" prop="salesOrderCode" width="120"/> |
吴 |
125 |
<el-table-column label="产品编号" align="center" prop="productCode" width="180"/> |
9f7aa7
|
126 |
<el-table-column label="产线编号" align="center" prop="lineCode" /> |
吴 |
127 |
<el-table-column label="计划数量" align="center" prop="planQty" /> |
|
128 |
<el-table-column label="计划开始时间" align="center" prop="planStartTime" width="120"> |
|
129 |
<template slot-scope="scope"> |
|
130 |
<span>{{ parseTime(scope.row.planStartTime, '{y}-{m}-{d}') }}</span> |
|
131 |
</template> |
|
132 |
</el-table-column> |
|
133 |
<el-table-column label="计划结束时间" align="center" prop="planEndTime" width="120"> |
|
134 |
<template slot-scope="scope"> |
|
135 |
<span>{{ parseTime(scope.row.planEndTime, '{y}-{m}-{d}') }}</span> |
|
136 |
</template> |
|
137 |
</el-table-column> |
|
138 |
<el-table-column label="工单状态" align="center" prop="orderStatus"> |
|
139 |
<template slot-scope="scope"> |
|
140 |
<dict-tag :options="dict.type.order_status" :value="scope.row.orderStatus"/> |
|
141 |
</template> |
|
142 |
</el-table-column> |
|
143 |
<el-table-column label="更新时间" align="center" prop="updateTime" width="180"> |
|
144 |
<template slot-scope="scope"> |
|
145 |
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> |
|
146 |
</template> |
|
147 |
</el-table-column> |
|
148 |
<el-table-column label="更新用户" align="center" prop="updateBy" /> |
|
149 |
<el-table-column label="备注" width="180px" show-overflow-tooltip align="center" prop="remarks" /> |
|
150 |
</el-table> |
|
151 |
|
|
152 |
<pagination |
|
153 |
v-show="total>0" |
|
154 |
:total="total" |
|
155 |
:page.sync="queryParams.pageNum" |
|
156 |
:limit.sync="queryParams.pageSize" |
|
157 |
@pagination="getList" |
|
158 |
/> |
|
159 |
|
|
160 |
<!-- 添加或修改生产工单对话框 --> |
|
161 |
<el-dialog :title="title" :visible.sync="open" width="700px" append-to-body> |
|
162 |
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> |
|
163 |
<el-form-item label="工单编号" prop="workOrderNo"> |
|
164 |
<el-input v-model="form.workOrderNo" placeholder="请输入工单编号" /> |
|
165 |
</el-form-item> |
|
166 |
<el-form-item label="订单编号" prop="salesOrderCode"> |
|
167 |
<el-input v-model="form.salesOrderCode" placeholder="请输入订单编号" /> |
|
168 |
</el-form-item> |
|
169 |
<el-form-item label="产品编号" prop="productCode"> |
|
170 |
<el-input v-model="form.productCode" placeholder="请输入产品编号" /> |
|
171 |
</el-form-item> |
|
172 |
<el-form-item label="产线编号" prop="lineCode"> |
|
173 |
<el-input v-model="form.lineCode" placeholder="请输入产线编号" /> |
|
174 |
</el-form-item> |
|
175 |
<el-form-item label="计划数量" prop="planQty"> |
|
176 |
<el-input v-model="form.planQty" placeholder="请输入计划数量" /> |
|
177 |
</el-form-item> |
|
178 |
<el-form-item label="计划开始时间" prop="planStartTime"> |
|
179 |
<el-date-picker clearable |
|
180 |
v-model="form.planStartTime" |
|
181 |
type="date" |
|
182 |
value-format="yyyy-MM-dd" |
|
183 |
placeholder="请选择计划开始时间"> |
|
184 |
</el-date-picker> |
|
185 |
</el-form-item> |
|
186 |
<el-form-item label="计划结束时间" prop="planEndTime"> |
|
187 |
<el-date-picker clearable |
|
188 |
v-model="form.planEndTime" |
|
189 |
type="date" |
|
190 |
value-format="yyyy-MM-dd" |
|
191 |
placeholder="请选择计划结束时间"> |
|
192 |
</el-date-picker> |
|
193 |
</el-form-item> |
|
194 |
<el-form-item label="工单状态" prop="orderStatus" v-if = updateFlag> |
|
195 |
<el-radio-group v-model="form.orderStatus"> |
|
196 |
<el-radio |
|
197 |
v-for="dict in dict.type.order_status" |
|
198 |
:key="dict.value" |
|
199 |
:label="dict.value" |
|
200 |
>{{dict.label}}</el-radio> |
|
201 |
</el-radio-group> |
|
202 |
</el-form-item> |
|
203 |
<el-form-item label="备注" prop="remarks"> |
|
204 |
<el-input |
|
205 |
type="textarea" |
|
206 |
placeholder="请输入备注" |
|
207 |
v-model="form.remarks" |
|
208 |
maxlength="30" |
|
209 |
show-word-limit |
|
210 |
> |
|
211 |
</el-input> |
|
212 |
</el-form-item> |
|
213 |
</el-form> |
|
214 |
<div slot="footer" class="dialog-footer"> |
|
215 |
<el-button type="primary" @click="submitForm">确 定</el-button> |
|
216 |
<el-button @click="cancel">取 消</el-button> |
|
217 |
</div> |
|
218 |
</el-dialog> |
|
219 |
<el-dialog |
|
220 |
title="工单详情" |
|
221 |
:visible.sync="detailVisible" |
|
222 |
width="80%" |
|
223 |
center> |
|
224 |
<el-table v-loading="detailLoading" :data="schedulingList"> |
|
225 |
<el-table-column label="工单编号" align="center" prop="workOrderNo" /> |
|
226 |
<el-table-column label="总成序列号" width="180px" align="center" prop="sfcCode" /> |
|
227 |
<el-table-column label="产品编码" align="center" prop="productCode" /> |
|
228 |
<el-table-column label="上线时间" align="center" prop="onlineTime" width="180"> |
|
229 |
<template slot-scope="scope"> |
|
230 |
<span>{{ parseTime(scope.row.onlineTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> |
|
231 |
</template> |
|
232 |
</el-table-column> |
|
233 |
<el-table-column label="下线时间" align="center" prop="offlineTime" width="180"> |
|
234 |
<template slot-scope="scope"> |
|
235 |
<span>{{ parseTime(scope.row.offlineTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> |
|
236 |
</template> |
|
237 |
</el-table-column> |
|
238 |
<el-table-column label="质量状态" align="center" prop="qualityStatus"> |
|
239 |
<template slot-scope="scope"> |
|
240 |
<dict-tag :options="dict.type.product_status" :value="scope.row.qualityStatus"/> |
|
241 |
</template> |
|
242 |
</el-table-column> |
|
243 |
<el-table-column label="状态" align="center" prop="status"> |
|
244 |
<template slot-scope="scope"> |
|
245 |
<dict-tag :options="dict.type.status" :value="scope.row.status"/> |
|
246 |
</template> |
|
247 |
</el-table-column> |
|
248 |
<el-table-column label="更新用户" align="center" prop="updateBy" /> |
|
249 |
<el-table-column label="更新时间" align="center" prop="updateTime" width="180"> |
|
250 |
<template slot-scope="scope"> |
|
251 |
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> |
|
252 |
</template> |
|
253 |
</el-table-column> |
|
254 |
<el-table-column label="备注" width="180px" show-overflow-tooltip align="center" prop="remarks" /> |
|
255 |
</el-table> |
|
256 |
|
|
257 |
<pagination |
|
258 |
v-show="detailTotal>0" |
|
259 |
:total="detailTotal" |
|
260 |
:page.sync="queryDetailParams.pageNum" |
|
261 |
:limit.sync="queryDetailParams.pageSize" |
|
262 |
@pagination="getDetail" |
|
263 |
/> |
|
264 |
<span slot="footer" class="dialog-footer"> |
|
265 |
<!-- <el-button @click="detailVisible = false">取 消</el-button>--> |
|
266 |
<!-- <el-button type="primary" @click="detailVisible = false">确 定</el-button>--> |
|
267 |
</span> |
|
268 |
</el-dialog> |
|
269 |
</div> |
|
270 |
|
|
271 |
</template> |
|
272 |
|
|
273 |
<script> |
|
274 |
import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/main/om/info"; |
|
275 |
import {listScheduling} from "@/api/main/om/scheduling"; |
|
276 |
|
|
277 |
export default { |
|
278 |
name: "Info", |
|
279 |
dicts: ['order_status','product_status', 'status'], |
|
280 |
data() { |
|
281 |
return { |
|
282 |
schedulingList: [], |
|
283 |
detailVisible : false, |
|
284 |
addFlag : false, |
|
285 |
updateFlag : false, |
|
286 |
// 遮罩层 |
|
287 |
loading: true, |
|
288 |
detailLoading: true, |
|
289 |
// 选中数组 |
|
290 |
ids: [], |
|
291 |
// 非单个禁用 |
|
292 |
single: true, |
|
293 |
// 非多个禁用 |
|
294 |
multiple: true, |
|
295 |
// 显示搜索条件 |
|
296 |
showSearch: true, |
|
297 |
// 总条数 |
|
298 |
total: 0, |
|
299 |
// 生产工单表格数据 |
|
300 |
infoList: [], |
|
301 |
// 弹出层标题 |
|
302 |
title: "", |
|
303 |
// 是否显示弹出层 |
|
304 |
open: false, |
|
305 |
// 查询参数 |
|
306 |
queryParams: { |
|
307 |
pageNum: 1, |
|
308 |
pageSize: 10, |
|
309 |
workOrderNo: null, |
|
310 |
salesOrderCode: null, |
|
311 |
productCode: null, |
|
312 |
orderStatus: null, |
|
313 |
}, |
|
314 |
queryDetailParams: { |
|
315 |
pageNum: 1, |
|
316 |
pageSize: 10, |
|
317 |
workOrderNo: null, |
|
318 |
}, |
|
319 |
detailTotal: 0, |
|
320 |
// 表单参数 |
|
321 |
form: {}, |
|
322 |
// 表单校验 |
|
323 |
rules: { |
|
324 |
workOrderNo: [ |
|
325 |
{ required: true, message: "工单编号不能为空", trigger: "blur" } |
|
326 |
], |
|
327 |
salesOrderCode: [ |
|
328 |
{ required: true, message: "订单编号不能为空", trigger: "blur" } |
|
329 |
], |
|
330 |
productCode: [ |
|
331 |
{ required: true, message: "产品编号不能为空", trigger: "blur" } |
|
332 |
], |
|
333 |
lineCode: [ |
|
334 |
{ required: true, message: "产线编号不能为空", trigger: "blur" } |
|
335 |
], |
|
336 |
planQty: [ |
|
337 |
{ required: true, message: "计划数量不能为空", trigger: "blur" } |
|
338 |
], |
|
339 |
planStartTime: [ |
|
340 |
{ required: true, message: "计划开始时间不能为空", trigger: "blur" } |
|
341 |
], |
|
342 |
planEndTime: [ |
|
343 |
{ required: true, message: "计划结束时间不能为空", trigger: "blur" } |
|
344 |
], |
|
345 |
} |
|
346 |
}; |
|
347 |
}, |
|
348 |
created() { |
|
349 |
this.getList(); |
|
350 |
}, |
|
351 |
methods: { |
|
352 |
orderDetail(workOrderNo){ |
|
353 |
console.log('000',workOrderNo) |
|
354 |
this.detailVisible = true |
|
355 |
this.queryDetailParams.params = {} |
|
356 |
this.queryDetailParams.workOrderNo = workOrderNo |
|
357 |
this.getDetail() |
|
358 |
}, |
|
359 |
getDetail(){ |
|
360 |
listScheduling(this.queryDetailParams).then(response => { |
|
361 |
this.schedulingList = response.rows; |
|
362 |
this.detailTotal = response.total; |
|
363 |
this.detailLoading = false; |
|
364 |
}); |
|
365 |
}, |
|
366 |
handleReceive(){ |
|
367 |
this.$message({ |
|
368 |
message: "配置接收方法", |
|
369 |
type: "info" |
|
370 |
}) |
|
371 |
}, |
|
372 |
handleCreate(){ |
|
373 |
this.$message({ |
|
374 |
message: "配置生成方法", |
|
375 |
type: "info" |
|
376 |
}) |
|
377 |
}, |
|
378 |
/** 查询生产工单列表 */ |
|
379 |
getList() { |
|
380 |
this.loading = true; |
|
381 |
listInfo(this.queryParams).then(response => { |
|
382 |
this.infoList = response.rows; |
226f41
|
383 |
this.total = response.total; |
9f7aa7
|
384 |
this.loading = false; |
吴 |
385 |
}); |
|
386 |
}, |
|
387 |
// 取消按钮 |
|
388 |
cancel() { |
|
389 |
this.open = false; |
|
390 |
this.reset(); |
|
391 |
}, |
|
392 |
// 表单重置 |
|
393 |
reset() { |
|
394 |
this.form = { |
|
395 |
id: null, |
|
396 |
workOrderNo: null, |
|
397 |
salesOrderCode: null, |
|
398 |
productCode: null, |
|
399 |
lineCode: null, |
|
400 |
planQty: null, |
|
401 |
planStartTime: null, |
|
402 |
planEndTime: null, |
|
403 |
orderStatus: null, |
|
404 |
createTime: null, |
|
405 |
updateTime: null, |
|
406 |
createBy: null, |
|
407 |
updateBy: null, |
|
408 |
remarks: null, |
|
409 |
delFlag: null, |
|
410 |
}; |
|
411 |
this.resetForm("form"); |
|
412 |
this.addFlag = false |
|
413 |
this.updateFlag = false |
|
414 |
}, |
|
415 |
/** 搜索按钮操作 */ |
|
416 |
handleQuery() { |
|
417 |
console.log('111') |
|
418 |
this.queryParams.pageNum = 1; |
|
419 |
this.getList(); |
|
420 |
}, |
|
421 |
/** 重置按钮操作 */ |
|
422 |
resetQuery() { |
|
423 |
this.resetForm("queryForm"); |
|
424 |
this.handleQuery(); |
|
425 |
}, |
|
426 |
// 多选框选中数据 |
|
427 |
handleSelectionChange(selection) { |
|
428 |
this.ids = selection.map(item => item.id) |
|
429 |
this.single = selection.length!==1 |
|
430 |
this.multiple = !selection.length |
|
431 |
}, |
|
432 |
/** 新增按钮操作 */ |
|
433 |
handleAdd() { |
|
434 |
this.reset(); |
|
435 |
this.addFlag = true |
|
436 |
this.open = true; |
|
437 |
this.title = "添加生产工单"; |
|
438 |
}, |
|
439 |
/** 修改按钮操作 */ |
|
440 |
handleUpdate(row) { |
|
441 |
this.reset(); |
|
442 |
this.updateFlag = true |
|
443 |
const id = row.id || this.ids |
|
444 |
getInfo(id).then(response => { |
|
445 |
this.form = response.data; |
|
446 |
this.open = true; |
|
447 |
this.title = "修改生产工单"; |
|
448 |
}); |
|
449 |
}, |
|
450 |
/** 提交按钮 */ |
|
451 |
submitForm() { |
|
452 |
this.$refs["form"].validate(valid => { |
|
453 |
if (valid) { |
|
454 |
if (this.form.id != null) { |
|
455 |
updateInfo(this.form).then(response => { |
|
456 |
this.$modal.msgSuccess("修改成功"); |
|
457 |
this.open = false; |
|
458 |
this.getList(); |
|
459 |
}); |
|
460 |
} else { |
|
461 |
addInfo(this.form).then(response => { |
|
462 |
this.$modal.msgSuccess("新增成功"); |
|
463 |
this.open = false; |
|
464 |
this.getList(); |
|
465 |
}); |
|
466 |
} |
|
467 |
} |
|
468 |
}); |
|
469 |
}, |
|
470 |
/** 删除按钮操作 */ |
|
471 |
handleDelete(row) { |
|
472 |
const ids = row.id || this.ids; |
|
473 |
this.$modal.confirm('是否确认删除?').then(function() { |
|
474 |
return delInfo(ids); |
|
475 |
}).then(() => { |
|
476 |
this.getList(); |
|
477 |
this.$modal.msgSuccess("删除成功"); |
|
478 |
}).catch(() => {}); |
|
479 |
}, |
|
480 |
/** 导出按钮操作 */ |
|
481 |
handleExport() { |
|
482 |
this.download('main/info/export', { |
|
483 |
...this.queryParams |
|
484 |
}, `info_${new Date().getTime()}.xlsx`) |
|
485 |
} |
|
486 |
} |
|
487 |
}; |
|
488 |
</script> |
226f41
|
489 |
<style> |
吴 |
490 |
.table-wrapper { |
|
491 |
width: 100%; |
|
492 |
} |
|
493 |
</style> |