yyt
2024-06-26 0cceb649e1dc443c2a91d26d81eacb0867c96db3
提交 | 用户 | 时间
0cceb6 1 <template>
Y 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">
5           <el-form-item label="订单编号" prop="orderNo">
6             <el-input
7               v-model="queryParams.orderNo"
8               placeholder="请输入订单编号"
9               clearable
10               @keyup.enter.native="handleQuery"
11             />
12           </el-form-item>
13           <el-form-item label="机型" prop="model">
14             <el-input
15               v-model="queryParams.model"
16               placeholder="请输入机型"
17               clearable
18               @keyup.enter.native="handleQuery"
19             />
20           </el-form-item>
21           <el-form-item label="生产状态" prop="productionStatus">
22             <el-select v-model="queryParams.productionStatus" placeholder="请选择工单状态" clearable>
23               <el-option
24                 v-for="dict in dict.type.order_scheduling_produce_status"
25                 :key="dict.value"
26                 :label="dict.label"
27                 :value="dict.value"/>
28             </el-select>
29           </el-form-item>
30           <el-form-item style="float: right">
31             <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
32             <el-button type="warning" icon="el-icon-copy-document" size="mini" @click="advancedQuery">高级查询</el-button>
33             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
34           </el-form-item>
35         </el-form>
36       <el-form :model="queryParams" ref="queryParams" size="small" :inline="true" v-show="advancedShowSearch" label-width="68px">
37         <el-form-item label="发动机号" prop="engineNo">
38           <el-input
39             v-model="queryParams.engineNo"
40             placeholder="请输入发动机号"
41             clearable
42             @keyup.enter.native="handleQuery"
43           />
44         </el-form-item>
45         <el-form-item label="质量状态" prop="qualityStatus">
46           <el-select v-model="queryParams.qualityStatus" placeholder="请选择质量状态" clearable>
47             <el-option
48               v-for="dict in dict.type.quality_status"
49               :key="dict.value"
50               :label="dict.label"
51               :value="dict.value"/>
52           </el-select>
53         </el-form-item>
54         <el-form-item label="是否打印" prop="whetherOrPrint">
55           <el-select v-model="queryParams.whetherOrPrint" placeholder="请选择是否打印" clearable>
56             <el-option
57               v-for="dict in dict.type.print_status"
58               :key="dict.value"
59               :label="dict.label"
60               :value="dict.value"/>
61           </el-select>
62         </el-form-item>
63         <br/>
64         <el-form-item label="合箱报工" prop="report10">
65           <el-input
66             v-model="queryParams.report10"
67             placeholder="请输入合箱报工"
68             clearable
69             @keyup.enter.native="handleQuery"
70           />
71         </el-form-item>
72         <el-form-item label="总装报工" prop="report20">
73           <el-input
74             v-model="queryParams.report20"
75             placeholder="请输入总装报工"
76             clearable
77             @keyup.enter.native="handleQuery"
78           />
79         </el-form-item>
80         <el-form-item label="CVT报工" prop="report30">
81           <el-input
82             v-model="queryParams.report30"
83             placeholder="请输入CVT报工"
84             clearable
85             @keyup.enter.native="handleQuery"
86           />
87         </el-form-item>
88         <br/>
89         <el-form-item label="操作时间" prop="operateTime">
90           <el-date-picker
91             v-model="queryParams.dateConditions"
92             type="datetimerange"
93             :picker-options="pickerOptions"
94             value-format="yyyy-MM-dd HH:mm:ss"
95             range-separator="至"
96             start-placeholder="开始日期"
97             end-placeholder="结束日期"
98             align="right">
99           </el-date-picker>
100         </el-form-item>
101       </el-form>
102     </el-card>
103
104     <el-card style="margin-top: 10px" class="box-card">
105         <el-row :gutter="10" class="mb8">
106           <el-col :span="1.5">
107             <el-button
108               type="primary"
109               plain
110               icon="el-icon-plus"
111               size="mini"
112               @click="handleAdd"
113               v-hasPermi="['bs:orderScheduling:add']"
114             >新增</el-button>
115           </el-col>
116           <el-col :span="1.5">
117             <el-button
118               type="success"
119               plain
120               icon="el-icon-edit"
121               size="mini"
122               :disabled="single"
123               @click="handleUpdate"
124               v-hasPermi="['bs:orderScheduling:edit']"
125             >修改</el-button>
126           </el-col>
127           <el-col :span="1.5">
128             <el-button
129               type="danger"
130               plain
131               icon="el-icon-delete"
132               size="mini"
133               :disabled="multiple"
134               @click="handleDelete"
135               v-hasPermi="['bs:orderScheduling:remove']"
136             >删除</el-button>
137           </el-col>
138           <el-col :span="1.5">
139             <el-button
140               type="warning"
141               plain
142               icon="el-icon-download"
143               size="mini"
144               @click="handleExport"
145               v-hasPermi="['bs:orderScheduling:export']"
146             >导出</el-button>
147           </el-col>
148           <el-col :span="1.5">
149             <el-button
150               type="warning"
151               plain
152               icon="el-icon-close"
153               size="mini"
154               @click="handleClose"
155             >关闭</el-button>
156           </el-col>
157           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
158         </el-row>
159
160         <el-table border v-loading="loading" :data="orderSchedulingList" @selection-change="handleSelectionChange">
161           <el-table-column type="selection" width="55" align="center" />
162           <el-table-column label="生产订单" align="center" prop="orderNo" width="130">
163
164           </el-table-column>
165           <el-table-column label="发动机号" align="center" prop="engineNo" width="150">
166
167           </el-table-column>
168           <el-table-column label="产品类型" align="center" prop="productType">
169             <template slot-scope="scope">
170               <dict-tag :options="dict.type.material_type" :value="scope.row.productType"/>
171             </template>
172           </el-table-column>
173           <el-table-column label="机型" align="center" prop="model">
174
175           </el-table-column>
176           <el-table-column label="生产状态" align="center" prop="productionStatus">
177             <template slot-scope="scope">
178               <dict-tag :options="dict.type.order_scheduling_produce_status" :value="scope.row.productionStatus"/>
179             </template>
180           </el-table-column>
181           <el-table-column label="工时" align="center" prop="workingHours">
182
183           </el-table-column>
184           <el-table-column label="当前工位" align="center" prop="currentWorkstation">
185
186           </el-table-column>
187           <el-table-column label="质量状态" align="center" prop="qualityStatus">
188             <template slot-scope="scope">
189               <dict-tag :options="dict.type.quality_status" :value="scope.row.qualityStatus"/>
190             </template>
191           </el-table-column>
192           <el-table-column label="是否打印" align="center" prop="whetherOrPrint">
193             <template slot-scope="scope">
194               <dict-tag :options="dict.type.print_status" :value="scope.row.whetherOrPrint"/>
195             </template>
196           </el-table-column>
197           <el-table-column label="合箱报工" align="center" prop="report10">
198
199           </el-table-column>
200           <el-table-column label="总装报工" align="center" prop="report20">
201
202           </el-table-column>
203           <el-table-column label="CVT报工" align="center" prop="report30">
204
205           </el-table-column>
206           <el-table-column label="合箱上线时间" align="center" prop="boxClosingOnlineTime" width="160">
207             <template slot-scope="scope">
208               <span>{{ parseTime(scope.row.boxClosingOnlineTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
209             </template>
210           </el-table-column>
211           <el-table-column label="合箱下线时间" align="center" prop="closingBoxOfflineTime" width="160">
212             <template slot-scope="scope">
213               <span>{{ parseTime(scope.row.closingBoxOfflineTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
214             </template>
215           </el-table-column>
216           <el-table-column label="总装上线时间" align="center" prop="finalAssemblyLaunchTime" width="160">
217             <template slot-scope="scope">
218               <span>{{ parseTime(scope.row.finalAssemblyLaunchTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
219             </template>
220           </el-table-column>
221           <el-table-column label="总装下线时间" align="center" prop="finalAssemblyOfflineTime" width="160">
222             <template slot-scope="scope">
223               <span>{{ parseTime(scope.row.finalAssemblyOfflineTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
224             </template>
225           </el-table-column>
226           <el-table-column label="CVT上线时间" align="center" prop="cvtLaunchTime" width="160">
227             <template slot-scope="scope">
228               <span>{{ parseTime(scope.row.cvtLaunchTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
229             </template>
230           </el-table-column>
231           <el-table-column label="CVT下线时间" align="center" prop="cvtOfflineTime" width="160">
232             <template slot-scope="scope">
233               <span>{{ parseTime(scope.row.cvtOfflineTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
234             </template>
235           </el-table-column>
236           <el-table-column label="操作人" align="center" prop="operator">
237           </el-table-column>
238           <el-table-column label="操作时间" align="center" prop="operateTime" width="160">
239             <template slot-scope="scope">
240               <span>{{ parseTime(scope.row.operateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
241             </template>
242           </el-table-column>
243
244         </el-table>
245     </el-card>
246
247     <pagination
248       v-show="total>0"
249       :total="total"
250       :page.sync="queryParams.pageNum"
251       :limit.sync="queryParams.pageSize"
252       @pagination="getList"
253     />
254
255     <!-- 添加或修改订单排产对话框 -->
256     <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="700px" append-to-body>
257       <span slot="title">
258         <i class="el-icon-s-order"></i>
259         {{titleName}}
260       </span>
261       <el-form ref="form" inline :model="form" :rules="rules" label-width="80px">
262         <el-form-item label="订单编号" prop="orderNo">
263           <el-input v-model="form.orderNo" placeholder="请输入订单编号" />
264         </el-form-item>
265         <el-form-item label="发动机号" prop="engineNo">
266           <el-input v-model="form.engineNo" placeholder="请输入发动机号" />
267         </el-form-item>
268         <el-form-item label="产品类型" prop="productType">
269           <el-select v-model="form.productType" placeholder="请选择产品类型">
270
271           </el-select>
272         </el-form-item>
273         <el-form-item label="机型" prop="model">
274           <el-input v-model="form.model" placeholder="请输入机型" />
275         </el-form-item>
276
277         <el-form-item label="工时" prop="workingHours">
278           <el-input v-model="form.workingHours" placeholder="请输入工时" />
279         </el-form-item>
280         <el-form-item label="当前工位" prop="currentWorkstation">
281           <el-input v-model="form.currentWorkstation" placeholder="请输入当前工位" />
282         </el-form-item>
283
284         <el-form-item label="是否打印" prop="whetherOrPrint">
285           <el-input v-model="form.whetherOrPrint" placeholder="请输入是否打印" />
286         </el-form-item>
287
288         <el-form-item label="合箱报工" prop="report10">
289           <el-input v-model="form.report10" placeholder="请输入合箱报工" />
290         </el-form-item>
291         <el-form-item label="总装报工" prop="report20">
292           <el-input v-model="form.report20" placeholder="请输入总装报工" />
293         </el-form-item>
294         <el-form-item label="30报工" prop="report20">
295           <el-input v-model="form.report30" placeholder="请输入30报工" />
296         </el-form-item>
297         <el-form-item label="操作人" prop="operator">
298           <el-input v-model="form.operator" placeholder="请输入操作人" />
299         </el-form-item>
300         <el-form-item label="状态" prop="status">
301           <el-radio-group v-model="form.status">
302 <!--            <el-radio-->
303 <!--              v-for="dict in dict.type.${dictType}"-->
304 <!--              :key="dict.value"-->
305 <!--              :label="dict.value"-->
306 <!--            >{{dict.label}}</el-radio>-->
307           </el-radio-group>
308         </el-form-item>
309
310       </el-form>
311       <div slot="footer" class="dialog-footer">
312         <el-button type="primary" @click="submitForm">确 定</el-button>
313         <el-button @click="cancel">取 消</el-button>
314       </div>
315     </el-dialog>
316   </div>
317 </template>
318
319 <script>
320 import { listOrderScheduling, getOrderScheduling, delOrderScheduling, addOrderScheduling, updateOrderScheduling } from "@/api/main/bs/orderScheduling/orderScheduling";
321
322 export default {
323   name: "OrderScheduling",
324   dicts: ['order_scheduling_produce_status','quality_status','print_status','material_type'],
325   data() {
326     return {
327       // 遮罩层
328       loading: true,
329       titleName: "",
330       // 选中数组
331       ids: [],
332       // 非单个禁用
333       single: true,
334       // 非多个禁用
335       multiple: true,
336       advancedShowSearch: false,
337       // 显示搜索条件
338       showSearch: true,
339       // 总条数
340       total: 0,
341       // 订单排产表格数据
342       orderSchedulingList: [],
343       // 弹出层标题
344       title: "",
345       // 是否显示弹出层
346       open: false,
347       // 查询参数
348       queryParams: {
349         pageNum: 1,
350         pageSize: 10,
351         orderNo: null,
352         engineNo: null,
353         productType: null,
354         model: null,
355         productionStatus: null,
356         workingHours: null,
357         currentWorkstation: null,
358         qualityStatus: null,
359         whetherOrPrint: null,
360         report10: null,
361         report20: null,
362         combinedBoxTime: null,
363         finalAssemblyTime: null,
364         operator: null,
365         operateTime: null,
366         status: null,
367         spareField1: null,
368         spareField2: null,
369         spareField3: null,
370         spareField4: null,
371         createUser: null,
372         updateUser: null,
373         remarks: null,
374         dateConditions: [],
375       },
376       // 表单参数
377       form: {},
378       // 表单校验
379       rules: {
380         id: [
381           { required: true, message: "ID不能为空", trigger: "blur" }
382         ],
383       },
384       pickerOptions: {
385         shortcuts: [{
386           text: '最近一周',
387           onClick(picker) {
388             const end = new Date();
389             const start = new Date();
390             start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
391             picker.$emit('pick', [start, end]);
392           }
393         }, {
394           text: '最近一个月',
395           onClick(picker) {
396             const end = new Date();
397             const start = new Date();
398             start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
399             picker.$emit('pick', [start, end]);
400           }
401         }, {
402           text: '最近三个月',
403           onClick(picker) {
404             const end = new Date();
405             const start = new Date();
406             start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
407             picker.$emit('pick', [start, end]);
408           }
409         }]
410       },
411       value1: [new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10)],
412       value2: ''
413     };
414   },
415   created() {
416     let workOrderNo = this.$route.query.workOrderNo;
417     this.queryParams.orderNo = workOrderNo
418     this.getList();
419   },
420   methods: {
421     advancedQuery(){
422       this.advancedShowSearch = (this.advancedShowSearch) ? this.advancedShowSearch = false : this.advancedShowSearch = true;
423     },
424     /** 查询订单排产列表 */
425     getList() {
426       this.loading = true;
427       console.log(this.queryParams)
428       listOrderScheduling(this.queryParams).then(response => {
429         this.orderSchedulingList = response.rows;
430         this.total = response.total;
431         this.loading = false;
432       });
433     },
434     // 取消按钮
435     cancel() {
436       this.open = false;
437       this.reset();
438     },
439     // 表单重置
440     reset() {
441       this.form = {
442         id: null,
443         orderNo: null,
444         engineNo: null,
445         productType: null,
446         model: null,
447         productionStatus: null,
448         workingHours: null,
449         currentWorkstation: null,
450         qualityStatus: null,
451         whetherOrPrint: null,
452         report10: null,
453         report20: null,
454         combinedBoxTime: null,
455         finalAssemblyTime: null,
456         operator: null,
457         operateTime: null,
458         status: null,
459         spareField1: null,
460         spareField2: null,
461         spareField3: null,
462         spareField4: null,
463         createUser: null,
464         createTime: null,
465         updateUser: null,
466         updateTime: null,
467         remarks: null,
468         report30: null,
469         boxClosingOnlineTime: null,
470         closingBoxOfflineTime: null,
471         finalAssemblyLaunchTime: null,
472         finalAssemblyOfflineTime: null,
473         cvtLaunchTime: null,
474         cvtOfflineTime: null
475       };
476       this.resetForm("form");
477     },
478     /** 搜索按钮操作 */
479     handleQuery() {
480       this.queryParams.pageNum = 1;
481       this.getList();
482     },
483     /** 重置按钮操作 */
484     resetQuery() {
485       this.resetForm("queryForm");
486       this.handleQuery();
487     },
488     // 多选框选中数据
489     handleSelectionChange(selection) {
490       this.ids = selection.map(item => item.id)
491       this.single = selection.length!==1
492       this.multiple = !selection.length
493     },
494     /** 新增按钮操作 */
495     handleAdd() {
496       this.reset();
497       this.open = true;
498       this.titleName = "添加订单排产";
499     },
500     /** 修改按钮操作 */
501     handleUpdate(row) {
502       this.reset();
503       const id = row.id || this.ids
504       getOrderScheduling(id).then(response => {
505         this.form = response.data;
506         this.open = true;
507         this.titleName = "修改订单排产";
508       });
509     },
510     /** 提交按钮 */
511     submitForm() {
512       this.$refs["form"].validate(valid => {
513         if (valid) {
514           if (this.form.id != null) {
515             updateOrderScheduling(this.form).then(response => {
516               this.$modal.msgSuccess("修改成功");
517               this.open = false;
518               this.getList();
519             });
520           } else {
521             addOrderScheduling(this.form).then(response => {
522               this.$modal.msgSuccess("新增成功");
523               this.open = false;
524               this.getList();
525             });
526           }
527         }
528       });
529     },
530     /** 删除按钮操作 */
531     handleDelete(row) {
532       const ids = row.id || this.ids;
533       this.$modal.confirm('是否确认删除订单排产编号为"' + ids + '"的数据项?').then(function() {
534         return delOrderScheduling(ids);
535       }).then(() => {
536         this.getList();
537         this.$modal.msgSuccess("删除成功");
538       }).catch(() => {});
539     },
540     /** 导出按钮操作 */
541     handleExport() {
542       this.download('bs/orderScheduling/export', {
543         ...this.queryParams
544       }, `orderScheduling_${new Date().getTime()}.xlsx`)
545     },
546     /** 返回按钮操作 */
547     handleClose() {
548       const obj = { path: "/main/om/productionOrde" };
549       this.$tab.closeOpenPage(obj);
550     }
551   }
552 };
553 </script>