cl
2024-07-04 5b544fc8d6029a71669b3992c5cfea9a044aaf3f
提交 | 用户 | 时间
0ca254 1 <template>
A 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">
5           <el-form-item label="工单编号" prop="workOrderNo">
6             <el-input
7               v-model="queryParams.workOrderNo"
8               placeholder="请输入工单编号"
9               clearable
10               @keyup.enter.native="handleQuery"
11             />
12           </el-form-item>
13           <el-form-item label="总成序列号" prop="sfcCode">
14             <el-input
15               v-model="queryParams.sfcCode"
16               placeholder="请输入总成序列号"
17               clearable
18               @keyup.enter.native="handleQuery"
19             />
20           </el-form-item>
21           <el-form-item label="产品编号" prop="productCode">
22             <el-input
23               v-model="queryParams.productCode"
24               placeholder="请输入产品编号"
25               clearable
26               @keyup.enter.native="handleQuery"
27             />
28           </el-form-item>
29           <el-form-item label="产线编号" prop="productionLine">
30             <el-input
31               v-model="queryParams.productionLine"
32               placeholder="请输入产线编号"
33               clearable
34               @keyup.enter.native="handleQuery"
35             />
36           </el-form-item>
37           <el-form-item label="工位编号" prop="locationCode">
38             <el-input
39               v-model="queryParams.locationCode"
40               placeholder="请输入工位编号"
41               clearable
42               @keyup.enter.native="handleQuery"
43             />
44           </el-form-item>
45           <el-form-item label="设备编号" prop="equipmentNo">
46             <el-input
47               v-model="queryParams.equipmentNo"
48               placeholder="请输入设备编号"
49               clearable
50               @keyup.enter.native="handleQuery"
51             />
52           </el-form-item>
53           <el-form-item label="参数编码" prop="paramCode">
54             <el-input
55               v-model="queryParams.paramCode"
56               placeholder="请输入参数编码"
57               clearable
58               @keyup.enter.native="handleQuery"
59             />
60           </el-form-item>
61           <el-form-item label="参数值" prop="paramValue">
62             <el-input
63               v-model="queryParams.paramValue"
64               placeholder="请输入参数值"
65               clearable
66               @keyup.enter.native="handleQuery"
67             />
68           </el-form-item>
69           <el-form-item label="参数上限" prop="paramUpper">
70             <el-input
71               v-model="queryParams.paramUpper"
72               placeholder="请输入参数上限"
73               clearable
74               @keyup.enter.native="handleQuery"
75             />
76           </el-form-item>
77           <el-form-item label="参数下限" prop="paramLower">
78             <el-input
79               v-model="queryParams.paramLower"
80               placeholder="请输入参数下限"
81               clearable
82               @keyup.enter.native="handleQuery"
83             />
84           </el-form-item>
85           <el-form-item label="标准值" prop="paramStandard">
86             <el-input
87               v-model="queryParams.paramStandard"
88               placeholder="请输入标准值"
89               clearable
90               @keyup.enter.native="handleQuery"
91             />
92           </el-form-item>
93           <el-form-item label="预留字段1" prop="moduleCode">
94             <el-input
95               v-model="queryParams.moduleCode"
96               placeholder="请输入预留字段1"
97               clearable
98               @keyup.enter.native="handleQuery"
99             />
100           </el-form-item>
101           <el-form-item label="预留字段2" prop="spareField2">
102             <el-input
103               v-model="queryParams.spareField2"
104               placeholder="请输入预留字段2"
105               clearable
106               @keyup.enter.native="handleQuery"
107             />
108           </el-form-item>
109           <el-form-item label="创建用户" prop="createUser">
110             <el-input
111               v-model="queryParams.createUser"
112               placeholder="请输入创建用户"
113               clearable
114               @keyup.enter.native="handleQuery"
115             />
116           </el-form-item>
117           <el-form-item label="更改用户" prop="updateUser">
118             <el-input
119               v-model="queryParams.updateUser"
120               placeholder="请输入更改用户"
121               clearable
122               @keyup.enter.native="handleQuery"
123             />
124           </el-form-item>
125           <el-form-item label="状态" prop="state">
126             <el-input
127               v-model="queryParams.state"
128               placeholder="请输入状态"
129               clearable
130               @keyup.enter.native="handleQuery"
131             />
132           </el-form-item>
133           <el-form-item label="参数名称" prop="paramName">
134             <el-input
135               v-model="queryParams.paramName"
136               placeholder="请输入参数名称"
137               clearable
138               @keyup.enter.native="handleQuery"
139             />
140           </el-form-item>
141           <el-form-item label="单位" prop="unit">
142             <el-input
143               v-model="queryParams.unit"
144               placeholder="请输入单位"
145               clearable
146               @keyup.enter.native="handleQuery"
147             />
148           </el-form-item>
149           <el-form-item label="参数集编码" prop="parameterSetCode">
150             <el-input
151               v-model="queryParams.parameterSetCode"
152               placeholder="请输入参数集编码"
153               clearable
154               @keyup.enter.native="handleQuery"
155             />
156           </el-form-item>
157           <el-form-item label="参数集名称" prop="parameterSetName">
158             <el-input
159               v-model="queryParams.parameterSetName"
160               placeholder="请输入参数集名称"
161               clearable
162               @keyup.enter.native="handleQuery"
163             />
164           </el-form-item>
165           <el-form-item label="工序编号" prop="processesCode">
166             <el-input
167               v-model="queryParams.processesCode"
168               placeholder="请输入工序编号"
169               clearable
170               @keyup.enter.native="handleQuery"
171             />
172           </el-form-item>
173           <el-form-item label="工序名称" prop="processesName">
174             <el-input
175               v-model="queryParams.processesName"
176               placeholder="请输入工序名称"
177               clearable
178               @keyup.enter.native="handleQuery"
179             />
180           </el-form-item>
181           <el-form-item style="float: right">
182             <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
183             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
184           </el-form-item>
185         </el-form>
186     </el-card>
187
188     <el-card style="margin-top: 10px" class="box-card">
189         <el-row :gutter="10" class="mb8">
190           <el-col :span="1.5">
191             <el-button
192               type="primary"
193               plain
194               icon="el-icon-plus"
195               size="mini"
196               @click="handleAdd"
197               v-hasPermi="['da:paramCollectionTemp:add']"
198             >新增</el-button>
199           </el-col>
200           <el-col :span="1.5">
201             <el-button
202               type="success"
203               plain
204               icon="el-icon-edit"
205               size="mini"
206               :disabled="single"
207               @click="handleUpdate"
208               v-hasPermi="['da:paramCollectionTemp:edit']"
209             >修改</el-button>
210           </el-col>
211           <el-col :span="1.5">
212             <el-button
213               type="danger"
214               plain
215               icon="el-icon-delete"
216               size="mini"
217               :disabled="multiple"
218               @click="handleDelete"
219               v-hasPermi="['da:paramCollectionTemp:remove']"
220             >删除</el-button>
221           </el-col>
222           <el-col :span="1.5">
223             <el-button
224               type="warning"
225               plain
226               icon="el-icon-download"
227               size="mini"
228               @click="handleExport"
229               v-hasPermi="['da:paramCollectionTemp:export']"
230             >导出</el-button>
231           </el-col>
232           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
233         </el-row>
234
235         <el-table border v-loading="loading" :data="paramCollectionTempList" @selection-change="handleSelectionChange">
236           <el-table-column type="selection" width="55" align="center" />
237           <el-table-column label="主键id" align="center" prop="id" />
238           <el-table-column label="工单编号" align="center" prop="workOrderNo">
239           </el-table-column>
240           <el-table-column label="总成序列号" align="center" prop="sfcCode">
241           </el-table-column>
242           <el-table-column label="产品编号" align="center" prop="productCode">
243           </el-table-column>
244           <el-table-column label="产线编号" align="center" prop="productionLine">
245           </el-table-column>
246           <el-table-column label="工位编号" align="center" prop="locationCode">
247           </el-table-column>
248           <el-table-column label="设备编号" align="center" prop="equipmentNo">
249           </el-table-column>
250           <el-table-column label="参数编码" align="center" prop="paramCode">
251           </el-table-column>
252           <el-table-column label="参数值" align="center" prop="paramValue">
253           </el-table-column>
254           <el-table-column label="参数上限" align="center" prop="paramUpper">
255           </el-table-column>
256           <el-table-column label="参数下限" align="center" prop="paramLower">
257           </el-table-column>
258           <el-table-column label="标准值" align="center" prop="paramStandard">
259           </el-table-column>
260           <el-table-column label="采集时间" align="center" prop="collectionTime">
261           </el-table-column>
262           <el-table-column label="预留字段1" align="center" prop="moduleCode">
263           </el-table-column>
264           <el-table-column label="预留字段2" align="center" prop="spareField2">
265           </el-table-column>
266           <el-table-column label="创建用户" align="center" prop="createUser">
267           </el-table-column>
268           <el-table-column label="更改用户" align="center" prop="updateUser">
269           </el-table-column>
270           <el-table-column label="状态" align="center" prop="state">
271           </el-table-column>
272           <el-table-column label="参数名称" align="center" prop="paramName">
273           </el-table-column>
274           <el-table-column label="单位" align="center" prop="unit">
275           </el-table-column>
276           <el-table-column label="类型" align="center" prop="type">
277           </el-table-column>
278           <el-table-column label="参数集编码" align="center" prop="parameterSetCode">
279           </el-table-column>
280           <el-table-column label="参数集名称" align="center" prop="parameterSetName">
281           </el-table-column>
282           <el-table-column label="工序编号" align="center" prop="processesCode">
283           </el-table-column>
284           <el-table-column label="工序名称" align="center" prop="processesName">
285           </el-table-column>
286           <el-table-column fixed="right" width="200" label="操作" align="center" class-name="small-padding fixed-width">
287             <template slot-scope="scope">
288               <el-button
289                 size="mini"
290                 type="success"
291                 plain
292                 style="width: 72px"
293                 icon="el-icon-edit"
294                 @click="handleUpdate(scope.row)"
295                 v-hasPermi="['da:paramCollectionTemp:edit']"
296               >修改</el-button>
297               <el-button
298                 size="mini"
299                 type="danger"
300                 plain
301                 style="width: 72px"
302                 icon="el-icon-delete"
303                 @click="handleDelete(scope.row)"
304                 v-hasPermi="['da:paramCollectionTemp:remove']"
305               >删除</el-button>
306             </template>
307           </el-table-column>
308         </el-table>
309     </el-card>
310
311     <pagination
312       v-show="total>0"
313       :total="total"
314       :page.sync="queryParams.pageNum"
315       :limit.sync="queryParams.pageSize"
316       @pagination="getList"
317     />
318
319     <!-- 添加或修改设备产品过程参数采集临时表对话框 -->
320     <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="500px" append-to-body>
321       <span slot="title">
322         <i class="el-icon-s-order"></i>
323         {{titleName}}
324       </span>
325       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
326         <el-form-item label="工单编号" prop="workOrderNo">
327           <el-input v-model="form.workOrderNo" placeholder="请输入工单编号" />
328         </el-form-item>
329         <el-form-item label="总成序列号" prop="sfcCode">
330           <el-input v-model="form.sfcCode" placeholder="请输入总成序列号" />
331         </el-form-item>
332         <el-form-item label="产品编号" prop="productCode">
333           <el-input v-model="form.productCode" placeholder="请输入产品编号" />
334         </el-form-item>
335         <el-form-item label="产线编号" prop="productionLine">
336           <el-input v-model="form.productionLine" placeholder="请输入产线编号" />
337         </el-form-item>
338         <el-form-item label="工位编号" prop="locationCode">
339           <el-input v-model="form.locationCode" placeholder="请输入工位编号" />
340         </el-form-item>
341         <el-form-item label="设备编号" prop="equipmentNo">
342           <el-input v-model="form.equipmentNo" placeholder="请输入设备编号" />
343         </el-form-item>
344         <el-form-item label="参数编码" prop="paramCode">
345           <el-input v-model="form.paramCode" placeholder="请输入参数编码" />
346         </el-form-item>
347         <el-form-item label="参数值" prop="paramValue">
348           <el-input v-model="form.paramValue" placeholder="请输入参数值" />
349         </el-form-item>
350         <el-form-item label="参数上限" prop="paramUpper">
351           <el-input v-model="form.paramUpper" placeholder="请输入参数上限" />
352         </el-form-item>
353         <el-form-item label="参数下限" prop="paramLower">
354           <el-input v-model="form.paramLower" placeholder="请输入参数下限" />
355         </el-form-item>
356         <el-form-item label="标准值" prop="paramStandard">
357           <el-input v-model="form.paramStandard" placeholder="请输入标准值" />
358         </el-form-item>
359         <el-form-item label="预留字段1" prop="moduleCode">
360           <el-input v-model="form.moduleCode" placeholder="请输入预留字段1" />
361         </el-form-item>
362         <el-form-item label="预留字段2" prop="spareField2">
363           <el-input v-model="form.spareField2" placeholder="请输入预留字段2" />
364         </el-form-item>
365         <el-form-item label="创建用户" prop="createUser">
366           <el-input v-model="form.createUser" placeholder="请输入创建用户" />
367         </el-form-item>
368         <el-form-item label="更改用户" prop="updateUser">
369           <el-input v-model="form.updateUser" placeholder="请输入更改用户" />
370         </el-form-item>
371         <el-form-item label="状态" prop="state">
372           <el-input v-model="form.state" placeholder="请输入状态" />
373         </el-form-item>
374         <el-form-item label="参数名称" prop="paramName">
375           <el-input v-model="form.paramName" placeholder="请输入参数名称" />
376         </el-form-item>
377         <el-form-item label="单位" prop="unit">
378           <el-input v-model="form.unit" placeholder="请输入单位" />
379         </el-form-item>
380         <el-form-item label="参数集编码" prop="parameterSetCode">
381           <el-input v-model="form.parameterSetCode" placeholder="请输入参数集编码" />
382         </el-form-item>
383         <el-form-item label="参数集名称" prop="parameterSetName">
384           <el-input v-model="form.parameterSetName" placeholder="请输入参数集名称" />
385         </el-form-item>
386         <el-form-item label="工序编号" prop="processesCode">
387           <el-input v-model="form.processesCode" placeholder="请输入工序编号" />
388         </el-form-item>
389         <el-form-item label="工序名称" prop="processesName">
390           <el-input v-model="form.processesName" placeholder="请输入工序名称" />
391         </el-form-item>
392       </el-form>
393       <div slot="footer" class="dialog-footer">
394         <el-button type="primary" @click="submitForm">确 定</el-button>
395         <el-button @click="cancel">取 消</el-button>
396       </div>
397     </el-dialog>
398   </div>
399 </template>
400
401 <script>
402 import { listParamCollectionTemp, getParamCollectionTemp, delParamCollectionTemp, addParamCollectionTemp, updateParamCollectionTemp } from "@/api/main/da/paramCollectionTemp/paramCollectionTemp";
403
404 export default {
405   name: "ParamCollectionTemp",
406   data() {
407     return {
408       // 遮罩层
409       loading: true,
410       titleName: "",
411       // 选中数组
412       ids: [],
413       // 非单个禁用
414       single: true,
415       // 非多个禁用
416       multiple: true,
417       // 显示搜索条件
418       showSearch: true,
419       // 总条数
420       total: 0,
421       // 设备产品过程参数采集临时表表格数据
422       paramCollectionTempList: [],
423       // 弹出层标题
424       title: "",
425       // 是否显示弹出层
426       open: false,
427       // 查询参数
428       queryParams: {
429         pageNum: 1,
430         pageSize: 10,
431         workOrderNo: null,
432         sfcCode: null,
433         productCode: null,
434         productionLine: null,
435         locationCode: null,
436         equipmentNo: null,
437         paramCode: null,
438         paramValue: null,
439         paramUpper: null,
440         paramLower: null,
441         paramStandard: null,
442         collectionTime: null,
443         moduleCode: null,
444         spareField2: null,
445         createUser: null,
446         updateUser: null,
447         state: null,
448         paramName: null,
449         unit: null,
450         type: null,
451         parameterSetCode: null,
452         parameterSetName: null,
453         processesCode: null,
454         processesName: null
455       },
456       // 表单参数
457       form: {},
458       // 表单校验
459       rules: {
460         id: [
461           { required: true, message: "主键id不能为空", trigger: "blur" }
462         ],
463       }
464     };
465   },
466   created() {
467     this.getList();
468   },
469   methods: {
470     /** 查询设备产品过程参数采集临时表列表 */
471     getList() {
472       this.loading = true;
473       listParamCollectionTemp(this.queryParams).then(response => {
474         this.paramCollectionTempList = 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 = {
487         id: null,
488         workOrderNo: null,
489         sfcCode: null,
490         productCode: null,
491         productionLine: null,
492         locationCode: null,
493         equipmentNo: null,
494         paramCode: null,
495         paramValue: null,
496         paramUpper: null,
497         paramLower: null,
498         paramStandard: null,
499         collectionTime: null,
500         moduleCode: null,
501         spareField2: null,
502         createUser: null,
503         createTime: null,
504         updateUser: null,
505         updateTime: null,
506         state: null,
507         paramName: null,
508         unit: null,
509         type: null,
510         parameterSetCode: null,
511         parameterSetName: null,
512         processesCode: null,
513         processesName: null
514       };
515       this.resetForm("form");
516     },
517     /** 搜索按钮操作 */
518     handleQuery() {
519       this.queryParams.pageNum = 1;
520       this.getList();
521     },
522     /** 重置按钮操作 */
523     resetQuery() {
524       this.resetForm("queryForm");
525       this.handleQuery();
526     },
527     // 多选框选中数据
528     handleSelectionChange(selection) {
529       this.ids = selection.map(item => item.id)
530       this.single = selection.length!==1
531       this.multiple = !selection.length
532     },
533     /** 新增按钮操作 */
534     handleAdd() {
535       this.reset();
536       this.open = true;
537       this.titleName = "添加设备产品过程参数采集临时表";
538     },
539     /** 修改按钮操作 */
540     handleUpdate(row) {
541       this.reset();
542       const id = row.id || this.ids
543       getParamCollectionTemp(id).then(response => {
544         this.form = response.data;
545         this.open = true;
546         this.titleName = "修改设备产品过程参数采集临时表";
547       });
548     },
549     /** 提交按钮 */
550     submitForm() {
551       this.$refs["form"].validate(valid => {
552         if (valid) {
553           if (this.form.id != null) {
554             updateParamCollectionTemp(this.form).then(response => {
555               this.$modal.msgSuccess("修改成功");
556               this.open = false;
557               this.getList();
558             });
559           } else {
560             addParamCollectionTemp(this.form).then(response => {
561               this.$modal.msgSuccess("新增成功");
562               this.open = false;
563               this.getList();
564             });
565           }
566         }
567       });
568     },
569     /** 删除按钮操作 */
570     handleDelete(row) {
571       const ids = row.id || this.ids;
572       this.$modal.confirm('是否确认删除设备产品过程参数采集临时表编号为"' + ids + '"的数据项?').then(function() {
573         return delParamCollectionTemp(ids);
574       }).then(() => {
575         this.getList();
576         this.$modal.msgSuccess("删除成功");
577       }).catch(() => {});
578     },
579     /** 导出按钮操作 */
580     handleExport() {
581       this.download('da/paramCollectionTemp/export', {
582         ...this.queryParams
583       }, `paramCollectionTemp_${new Date().getTime()}.xlsx`)
584     }
585   }
586 };
587 </script>