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