春风项目四线(合箱线、总装线)
jiang
2024-01-30 79370218e152be17382e792c3cab98e2f1a5a587
提交 | 用户 | 时间
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">
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>
162d0b 88         <br/>
1391b3 89         <el-form-item label="操作时间" prop="operateTime">
90           <el-date-picker
d2b752 91             v-model="queryParams.dateConditions"
1391b3 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>
d9cf6b 102     </el-card>
J 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>
2907ad 148           <el-col :span="1.5">
J 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>
d9cf6b 157           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
J 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" />
5f7e70 162           <el-table-column label="生产订单" align="center" prop="orderNo" width="130">
2aea64 163
d9cf6b 164           </el-table-column>
749044 165           <el-table-column label="发动机号" align="center" prop="engineNo" width="150">
2aea64 166
d9cf6b 167           </el-table-column>
J 168           <el-table-column label="产品类型" align="center" prop="productType">
a5f938 169             <template slot-scope="scope">
C 170               <dict-tag :options="dict.type.material_type" :value="scope.row.productType"/>
171             </template>
d9cf6b 172           </el-table-column>
J 173           <el-table-column label="机型" align="center" prop="model">
2aea64 174
d9cf6b 175           </el-table-column>
J 176           <el-table-column label="生产状态" align="center" prop="productionStatus">
04cd5a 177             <template slot-scope="scope">
178               <dict-tag :options="dict.type.order_scheduling_produce_status" :value="scope.row.productionStatus"/>
179             </template>
d9cf6b 180           </el-table-column>
J 181           <el-table-column label="工时" align="center" prop="workingHours">
2aea64 182
d9cf6b 183           </el-table-column>
J 184           <el-table-column label="当前工位" align="center" prop="currentWorkstation">
2aea64 185
d9cf6b 186           </el-table-column>
J 187           <el-table-column label="质量状态" align="center" prop="qualityStatus">
1391b3 188             <template slot-scope="scope">
189               <dict-tag :options="dict.type.quality_status" :value="scope.row.qualityStatus"/>
190             </template>
d9cf6b 191           </el-table-column>
J 192           <el-table-column label="是否打印" align="center" prop="whetherOrPrint">
1391b3 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">
2aea64 198
d9cf6b 199           </el-table-column>
1391b3 200           <el-table-column label="总装报工" align="center" prop="report20">
2aea64 201
d9cf6b 202           </el-table-column>
1391b3 203           <el-table-column label="CVT报工" align="center" prop="report30">
d9cf6b 204
J 205           </el-table-column>
797845 206           <el-table-column label="合箱上线时间" align="center" prop="boxClosingOnlineTime" width="160">
793702 207
d9cf6b 208           </el-table-column>
797845 209           <el-table-column label="合箱下线时间" align="center" prop="closingBoxOfflineTime" width="160">
793702 210
d9cf6b 211           </el-table-column>
797845 212           <el-table-column label="总装上线时间" align="center" prop="finalAssemblyLaunchTime" width="160">
793702 213
797845 214           </el-table-column>
215           <el-table-column label="总装下线时间" align="center" prop="finalAssemblyOfflineTime" width="160">
793702 216
797845 217           </el-table-column>
218           <el-table-column label="CVT上线时间" align="center" prop="cvtLaunchTime" width="160">
793702 219
797845 220           </el-table-column>
221           <el-table-column label="CVT下线时间" align="center" prop="cvtOfflineTime" width="160">
793702 222
797845 223           </el-table-column>
d9cf6b 224           <el-table-column label="操作人" align="center" prop="operator">
J 225           </el-table-column>
749044 226           <el-table-column label="操作时间" align="center" prop="operateTime" width="160">
2aea64 227           </el-table-column>
J 228
d9cf6b 229         </el-table>
J 230     </el-card>
231
232     <pagination
233       v-show="total>0"
234       :total="total"
235       :page.sync="queryParams.pageNum"
236       :limit.sync="queryParams.pageSize"
237       @pagination="getList"
238     />
239
240     <!-- 添加或修改订单排产对话框 -->
55542c 241     <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="700px" append-to-body>
d9cf6b 242       <span slot="title">
J 243         <i class="el-icon-s-order"></i>
244         {{titleName}}
245       </span>
55542c 246       <el-form ref="form" inline :model="form" :rules="rules" label-width="80px">
2aea64 247         <el-form-item label="订单编号" prop="orderNo">
J 248           <el-input v-model="form.orderNo" placeholder="请输入订单编号" />
d9cf6b 249         </el-form-item>
J 250         <el-form-item label="发动机号" prop="engineNo">
251           <el-input v-model="form.engineNo" placeholder="请输入发动机号" />
252         </el-form-item>
2aea64 253         <el-form-item label="产品类型" prop="productType">
J 254           <el-select v-model="form.productType" placeholder="请选择产品类型">
c33ba1 255
2aea64 256           </el-select>
J 257         </el-form-item>
d9cf6b 258         <el-form-item label="机型" prop="model">
J 259           <el-input v-model="form.model" placeholder="请输入机型" />
2aea64 260         </el-form-item>
c33ba1 261
d9cf6b 262         <el-form-item label="工时" prop="workingHours">
J 263           <el-input v-model="form.workingHours" placeholder="请输入工时" />
264         </el-form-item>
265         <el-form-item label="当前工位" prop="currentWorkstation">
266           <el-input v-model="form.currentWorkstation" placeholder="请输入当前工位" />
2aea64 267         </el-form-item>
c33ba1 268
d9cf6b 269         <el-form-item label="是否打印" prop="whetherOrPrint">
J 270           <el-input v-model="form.whetherOrPrint" placeholder="请输入是否打印" />
271         </el-form-item>
db7979 272
1391b3 273         <el-form-item label="合箱报工" prop="report10">
274           <el-input v-model="form.report10" placeholder="请输入合箱报工" />
d9cf6b 275         </el-form-item>
1391b3 276         <el-form-item label="总装报工" prop="report20">
277           <el-input v-model="form.report20" placeholder="请输入总装报工" />
278         </el-form-item>
279         <el-form-item label="30报工" prop="report20">
280           <el-input v-model="form.report30" placeholder="请输入30报工" />
d9cf6b 281         </el-form-item>
J 282         <el-form-item label="操作人" prop="operator">
283           <el-input v-model="form.operator" placeholder="请输入操作人" />
2aea64 284         </el-form-item>
J 285         <el-form-item label="状态" prop="status">
286           <el-radio-group v-model="form.status">
287 <!--            <el-radio-->
288 <!--              v-for="dict in dict.type.${dictType}"-->
289 <!--              :key="dict.value"-->
290 <!--              :label="dict.value"-->
291 <!--            >{{dict.label}}</el-radio>-->
292           </el-radio-group>
293         </el-form-item>
c33ba1 294
d9cf6b 295       </el-form>
J 296       <div slot="footer" class="dialog-footer">
297         <el-button type="primary" @click="submitForm">确 定</el-button>
298         <el-button @click="cancel">取 消</el-button>
299       </div>
300     </el-dialog>
301   </div>
302 </template>
303
304 <script>
305 import { listOrderScheduling, getOrderScheduling, delOrderScheduling, addOrderScheduling, updateOrderScheduling } from "@/api/main/bs/orderScheduling/orderScheduling";
306
307 export default {
308   name: "OrderScheduling",
a5f938 309   dicts: ['order_scheduling_produce_status','quality_status','print_status','material_type'],
d9cf6b 310   data() {
J 311     return {
312       // 遮罩层
313       loading: true,
314       titleName: "",
315       // 选中数组
316       ids: [],
317       // 非单个禁用
318       single: true,
319       // 非多个禁用
320       multiple: true,
1391b3 321       advancedShowSearch: false,
d9cf6b 322       // 显示搜索条件
J 323       showSearch: true,
324       // 总条数
325       total: 0,
326       // 订单排产表格数据
327       orderSchedulingList: [],
328       // 弹出层标题
329       title: "",
330       // 是否显示弹出层
331       open: false,
332       // 查询参数
333       queryParams: {
334         pageNum: 1,
335         pageSize: 10,
2aea64 336         orderNo: null,
d9cf6b 337         engineNo: null,
J 338         productType: null,
339         model: null,
340         productionStatus: null,
341         workingHours: null,
342         currentWorkstation: null,
343         qualityStatus: null,
344         whetherOrPrint: null,
345         report10: null,
346         report20: null,
2aea64 347         combinedBoxTime: null,
J 348         finalAssemblyTime: null,
d9cf6b 349         operator: null,
d2b752 350         operateTime: null,
2aea64 351         status: null,
J 352         spareField1: null,
353         spareField2: null,
354         spareField3: null,
355         spareField4: null,
356         createUser: null,
357         updateUser: null,
d2b752 358         remarks: null,
359         dateConditions: [],
d9cf6b 360       },
J 361       // 表单参数
362       form: {},
363       // 表单校验
364       rules: {
2aea64 365         id: [
J 366           { required: true, message: "ID不能为空", trigger: "blur" }
367         ],
1391b3 368       },
369       pickerOptions: {
370         shortcuts: [{
371           text: '最近一周',
372           onClick(picker) {
373             const end = new Date();
374             const start = new Date();
375             start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
376             picker.$emit('pick', [start, end]);
377           }
378         }, {
379           text: '最近一个月',
380           onClick(picker) {
381             const end = new Date();
382             const start = new Date();
383             start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
384             picker.$emit('pick', [start, end]);
385           }
386         }, {
387           text: '最近三个月',
388           onClick(picker) {
389             const end = new Date();
390             const start = new Date();
391             start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
392             picker.$emit('pick', [start, end]);
393           }
394         }]
395       },
396       value1: [new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10)],
397       value2: ''
d9cf6b 398     };
J 399   },
400   created() {
5f7e70 401     let workOrderNo = this.$route.query.workOrderNo;
402     this.queryParams.orderNo = workOrderNo
d9cf6b 403     this.getList();
J 404   },
405   methods: {
1391b3 406     advancedQuery(){
407       this.advancedShowSearch = (this.advancedShowSearch) ? this.advancedShowSearch = false : this.advancedShowSearch = true;
408     },
d9cf6b 409     /** 查询订单排产列表 */
J 410     getList() {
411       this.loading = true;
d2b752 412       console.log(this.queryParams)
d9cf6b 413       listOrderScheduling(this.queryParams).then(response => {
J 414         this.orderSchedulingList = response.rows;
415         this.total = response.total;
416         this.loading = false;
417       });
418     },
419     // 取消按钮
420     cancel() {
421       this.open = false;
422       this.reset();
423     },
424     // 表单重置
425     reset() {
426       this.form = {
2aea64 427         id: null,
J 428         orderNo: null,
d9cf6b 429         engineNo: null,
J 430         productType: null,
431         model: null,
432         productionStatus: null,
433         workingHours: null,
434         currentWorkstation: null,
435         qualityStatus: null,
436         whetherOrPrint: null,
437         report10: null,
438         report20: null,
2aea64 439         combinedBoxTime: null,
J 440         finalAssemblyTime: null,
d9cf6b 441         operator: null,
2aea64 442         operateTime: null,
J 443         status: null,
444         spareField1: null,
445         spareField2: null,
446         spareField3: null,
447         spareField4: null,
448         createUser: null,
449         createTime: null,
450         updateUser: null,
451         updateTime: null,
1391b3 452         remarks: null,
797845 453         report30: null,
454         boxClosingOnlineTime: null,
455         closingBoxOfflineTime: null,
456         finalAssemblyLaunchTime: null,
457         finalAssemblyOfflineTime: null,
458         cvtLaunchTime: null,
459         cvtOfflineTime: null
d9cf6b 460       };
J 461       this.resetForm("form");
462     },
463     /** 搜索按钮操作 */
464     handleQuery() {
1de44b 465       this.queryParams.pageNum = 1;
466       this.getList();
d9cf6b 467     },
J 468     /** 重置按钮操作 */
469     resetQuery() {
470       this.resetForm("queryForm");
471       this.handleQuery();
472     },
473     // 多选框选中数据
474     handleSelectionChange(selection) {
2aea64 475       this.ids = selection.map(item => item.id)
d9cf6b 476       this.single = selection.length!==1
J 477       this.multiple = !selection.length
478     },
479     /** 新增按钮操作 */
480     handleAdd() {
481       this.reset();
482       this.open = true;
483       this.titleName = "添加订单排产";
484     },
485     /** 修改按钮操作 */
486     handleUpdate(row) {
487       this.reset();
2aea64 488       const id = row.id || this.ids
J 489       getOrderScheduling(id).then(response => {
d9cf6b 490         this.form = response.data;
J 491         this.open = true;
492         this.titleName = "修改订单排产";
493       });
494     },
495     /** 提交按钮 */
496     submitForm() {
497       this.$refs["form"].validate(valid => {
498         if (valid) {
2aea64 499           if (this.form.id != null) {
d9cf6b 500             updateOrderScheduling(this.form).then(response => {
J 501               this.$modal.msgSuccess("修改成功");
502               this.open = false;
503               this.getList();
504             });
505           } else {
506             addOrderScheduling(this.form).then(response => {
507               this.$modal.msgSuccess("新增成功");
508               this.open = false;
509               this.getList();
510             });
511           }
512         }
513       });
514     },
515     /** 删除按钮操作 */
516     handleDelete(row) {
2aea64 517       const ids = row.id || this.ids;
J 518       this.$modal.confirm('是否确认删除订单排产编号为"' + ids + '"的数据项?').then(function() {
519         return delOrderScheduling(ids);
d9cf6b 520       }).then(() => {
J 521         this.getList();
522         this.$modal.msgSuccess("删除成功");
523       }).catch(() => {});
524     },
525     /** 导出按钮操作 */
526     handleExport() {
527       this.download('bs/orderScheduling/export', {
528         ...this.queryParams
529       }, `orderScheduling_${new Date().getTime()}.xlsx`)
2907ad 530     },
J 531     /** 返回按钮操作 */
532     handleClose() {
fec0b1 533       const obj = { path: "/main/om/productionOrde" };
2907ad 534       this.$tab.closeOpenPage(obj);
d9cf6b 535     }
J 536   }
537 };
538 </script>