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