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