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