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