懒羊羊
2024-01-09 5a6d6b9f3bb00b93e70d316c0fafcb34ddd0c510
提交 | 用户 | 时间
7b9877 1 <template>
H 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="repairIdentification">
6         <el-input
7           v-model="queryParams.repairIdentification"
8           placeholder="请输入返修标识"
9           clearable
10           @keyup.enter.native="handleQuery"
11         />
12       </el-form-item>
13       <el-form-item label="箱体编码" prop="boxCode">
14         <el-input
15           v-model="queryParams.boxCode"
16           placeholder="请输入箱体编码"
17           clearable
18           @keyup.enter.native="handleQuery"
19         />
20       </el-form-item>
21       <el-form-item style="float: right">
22         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
23         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
24       </el-form-item>
25     </el-form>
26       </el-card>
27     <el-card style="margin-top: 10px"  height="250" class="box-card">
28     <el-row :gutter="10" class="mb8">
29       <el-col :span="1.5">
30         <el-button
31           type="primary"
32           plain
33           icon="el-icon-plus"
34           size="mini"
35           @click="handleAdd"
36           v-hasPermi="['rm:repairData:add']"
37         >新增</el-button>
38       </el-col>
39       <el-col :span="1.5">
40         <el-button
41           type="success"
42           plain
43           icon="el-icon-edit"
44           size="mini"
45           :disabled="single"
46           @click="handleUpdate"
47           v-hasPermi="['rm:repairData:edit']"
48         >修改</el-button>
49       </el-col>
50       <el-col :span="1.5">
51         <el-button
52           type="danger"
53           plain
54           icon="el-icon-delete"
55           size="mini"
56           :disabled="multiple"
57           @click="handleDelete"
58           v-hasPermi="['rm:repairData:remove']"
59         >删除</el-button>
60       </el-col>
61       <el-col :span="1.5">
62         <el-button
63           type="warning"
64           plain
65           icon="el-icon-download"
66           size="mini"
67           @click="handleExport"
68           v-hasPermi="['rm:repairData:export']"
69         >导出</el-button>
70       </el-col>
71       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
72     </el-row>
73
74     <el-table v-loading="loading"  border :data="repairRecordList" @selection-change="handleSelectionChange">
75       <el-table-column type="selection" width="55" align="center" />
76       <el-table-column label="返修标识" align="center" prop="repairIdentification" />
77       <el-table-column label="箱体编码" align="center" prop="boxCode" />
78       <el-table-column label="工序编码" align="center" prop="processesCode" />
79       <el-table-column label="原结果" align="center" prop="originalResult" />
80       <el-table-column label="返修结果" align="center" prop="repairResults" />
81       <el-table-column label="创建用户" align="center" prop="createUser" />
82       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
83         <template slot-scope="scope">
84           <el-button
85             size="mini"
86             type="text"
87             icon="el-icon-edit"
88             @click="handleUpdate(scope.row)"
89             v-hasPermi="['rm:repairData:edit']"
90           >修改</el-button>
91           <el-button
92             size="mini"
93             type="text"
94             icon="el-icon-delete"
95             @click="handleDelete(scope.row)"
96             v-hasPermi="['rm:repairData:remove']"
97           >删除</el-button>
98         </template>
99       </el-table-column>
100     </el-table>
101       <pagination
102         v-show="total>0"
103         :total="total"
104         :page.sync="queryParams.pageNum"
105         :limit.sync="queryParams.pageSize"
106         @pagination="getRepairRecordList"
107       />
108     </el-card>
109     <el-card style="margin-top: 10px" class="box-card">
110       <el-tabs type="border-card" >
111         <el-tab-pane>
112           <span slot="label"> <a class="el-icon-date"></a>拧紧数据</span>
113           <template>
114             <el-table v-loading="loading" border :data="repairDataList" @selection-change="handleSelectionChange">
115               <el-table-column type="selection" width="55" align="center" />
116               <el-table-column label="箱体编码" align="center" prop="boxCode">
117               </el-table-column>
118               <el-table-column label="工位" align="center" prop="station">
119               </el-table-column>
120               <el-table-column label="拧紧次数" align="center" prop="tightenFrequency">
121               </el-table-column>
122               <el-table-column label="拧紧颗数" align="center" prop="tightenPiecesNumber">
123               </el-table-column>
124               <el-table-column label="扭力" align="center" prop="torqueForce">
125               </el-table-column>
126               <el-table-column label="角度" align="center" prop="angle">
127               </el-table-column>
128               <el-table-column label="结果" align="center" prop="result">
129                 <template slot-scope="scope">
130                   <dict-tag :options="dict.type.qualified_status" :value="scope.row.status"/>
131                 </template>
132
133               </el-table-column>
134               <el-table-column label="保存时间" align="center" prop="boxCode">
135               </el-table-column>
136
137             </el-table>
138           </template>
139         </el-tab-pane>
140         <el-tab-pane>
141           <span slot="label"> <b class="el-icon-date"></b>相机检测</span>
142           <el-empty >
143             <span slot="description">暂无数据</span>
144           </el-empty>
145         </el-tab-pane>
146         <el-tab-pane>
5a6d6b 147           <span slot="label"> <b class="el-icon-date"></b>外漏检测</span>
7b9877 148           <el-empty >
H 149             <span slot="description">暂无数据</span>
150           </el-empty>
151         </el-tab-pane>
152         <el-tab-pane>
5a6d6b 153           <span slot="label"> <b class="el-icon-date"></b>机轴加注</span>
7b9877 154           <el-empty >
H 155             <span slot="description">暂无数据</span>
156           </el-empty>
157         </el-tab-pane>
158         <el-tab-pane>
5a6d6b 159           <span slot="label"> <b class="el-icon-date"></b>工位结果</span>
7b9877 160           <el-empty >
H 161             <span slot="description">暂无数据</span>
162           </el-empty>
163         </el-tab-pane>
164       </el-tabs>
165     </el-card>
166
167
168
169     <!-- 添加或修改返修数据对话框 -->
170     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
171       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
172         <el-form-item label="总成编码" prop="snCode">
173           <el-input v-model="form.snCode" placeholder="请输入总成编码" />
174         </el-form-item>
175         <el-form-item label="箱体编码" prop="boxCode">
176           <el-input v-model="form.boxCode" placeholder="请输入箱体编码" />
177         </el-form-item>
178         <el-form-item label="工序编码" prop="processesCode">
179           <el-input v-model="form.processesCode" placeholder="请输入工序编码" />
180         </el-form-item>
181         <el-form-item label="拧紧次数" prop="tightenFrequency">
182           <el-input v-model="form.tightenFrequency" placeholder="请输入拧紧次数" />
183         </el-form-item>
184         <el-form-item label="拧紧颗数" prop="tightenPiecesNumber">
185           <el-input v-model="form.tightenPiecesNumber" placeholder="请输入拧紧颗数" />
186         </el-form-item>
187         <el-form-item label="扭力" prop="torqueForce">
188           <el-input v-model="form.torqueForce" placeholder="请输入扭力" />
189         </el-form-item>
190         <el-form-item label="角度" prop="angle">
191           <el-input v-model="form.angle" placeholder="请输入角度" />
192         </el-form-item>
193         <el-form-item label="结果" prop="result">
194           <el-input v-model="form.result" placeholder="请输入结果" />
195         </el-form-item>
196         <el-form-item label="创建用户" prop="createUser">
197           <el-input v-model="form.createUser" placeholder="请输入创建用户" />
198         </el-form-item>
199         <el-form-item label="更新用户" prop="updateUser">
200           <el-input v-model="form.updateUser" placeholder="请输入更新用户" />
201         </el-form-item>
202         <el-form-item label="备注" prop="remarks">
203           <el-input v-model="form.remarks" placeholder="请输入备注" />
204         </el-form-item>
205         <el-form-item label="预留字段1" prop="spareField1">
206           <el-input v-model="form.spareField1" placeholder="请输入预留字段1" />
207         </el-form-item>
208         <el-form-item label="预留字段2" prop="spareField2">
209           <el-input v-model="form.spareField2" placeholder="请输入预留字段2" />
210         </el-form-item>
211       </el-form>
212       <div slot="footer" class="dialog-footer">
213         <el-button type="primary" @click="submitForm">确 定</el-button>
214         <el-button @click="cancel">取 消</el-button>
215       </div>
216     </el-dialog>
217   </div>
218 </template>
219
220 <script>
221 import { listRepairRecord, getRepairRecord, delRepairRecord, addRepairRecord, updateRepairRecord } from "@/api/main/rm/repairRecord/repairRecord";
222 import { listRepairData, getRepairData, delRepairData, addRepairData, updateRepairData } from "@/api/main/rm/repairData/repairData";
223
224 export default {
5a6d6b 225   name: "rmRepairData",
7b9877 226   dicts: ['qualified_status'],
H 227   data() {
228     return {
229       // 遮罩层
230       loading: true,
231       // 选中数组
232       ids: [],
233       // 非单个禁用
234       single: true,
235       // 非多个禁用
236       multiple: true,
237       // 显示搜索条件
238       showSearch: true,
239       // 总条数
240       total: 0,
241       // 返修数据表格数据
242       repairDataList: [],
243       repairRecordList: [],
244       // 弹出层标题
245       title: "",
246       // 是否显示弹出层
247       open: false,
248       // 查询参数
249       queryParams: {
250         pageNum: 1,
251         pageSize: 10,
252         snCode: null,
253         boxCode: null,
254         processesCode: null,
255         tightenFrequency: null,
256         tightenPiecesNumber: null,
257         torqueForce: null,
258         angle: null,
259         result: null,
260         createUser: null,
261         updateUser: null,
262         remarks: null,
263         spareField1: null,
264         station: null,
265         spareField2: null
266       },
267       // 表单参数
268       form: {},
269       // 表单校验
270       rules: {
271         id: [
272           { required: true, message: "主键id不能为空", trigger: "blur" }
273         ],
274       }
275     };
276   },
277   created() {
278     this.getList();
279     this.getRepairRecordList();
280   },
281   methods: {
282     /** 查询返修记录列表 */
283     getRepairRecordList() {
284       this.loading = true;
285       listRepairRecord(this.queryParams).then(response => {
286         this.repairRecordList = response.rows;
287         this.total = response.total;
288         this.loading = false;
289       });
290     },
291     /** 查询返修数据列表 */
292     getList() {
293       this.loading = true;
294       listRepairData(this.queryParams).then(response => {
295         this.repairDataList = response.rows;
296         this.total = response.total;
297         this.loading = false;
298       });
299     },
300     // 取消按钮
301     cancel() {
302       this.open = false;
303       this.reset();
304     },
305     // 表单重置
306     reset() {
307       this.form = {
308         id: null,
309         snCode: null,
310         boxCode: null,
311         processesCode: null,
312         tightenFrequency: null,
313         tightenPiecesNumber: null,
314         torqueForce: null,
315         angle: null,
316         result: null,
317         createUser: null,
318         createTime: null,
319         updateTime: null,
320         updateUser: null,
321         remarks: null,
322         spareField1: null,
323         station: null,
324         spareField2: null
325       };
326       this.resetForm("form");
327     },
328     /** 搜索按钮操作 */
329     handleQuery() {
330       this.queryParams.pageNum = 1;
331       this.getList();
332     },
333     /** 重置按钮操作 */
334     resetQuery() {
335       this.resetForm("queryForm");
336       this.handleQuery();
337     },
338     // 多选框选中数据
339     handleSelectionChange(selection) {
340       this.ids = selection.map(item => item.id)
341       this.single = selection.length!==1
342       this.multiple = !selection.length
343     },
344     /** 新增按钮操作 */
345     handleAdd() {
346       this.reset();
347       this.open = true;
348       this.title = "添加返修数据";
349     },
350     /** 修改按钮操作 */
351     handleUpdate(row) {
352       this.reset();
353       const id = row.id || this.ids
354       getRepairData(id).then(response => {
355         this.form = response.data;
356         this.open = true;
357         this.title = "修改返修数据";
358       });
359     },
360     /** 提交按钮 */
361     submitForm() {
362       this.$refs["form"].validate(valid => {
363         if (valid) {
364           if (this.form.id != null) {
365             updateRepairData(this.form).then(response => {
366               this.$modal.msgSuccess("修改成功");
367               this.open = false;
368               this.getList();
369             });
370           } else {
371             addRepairData(this.form).then(response => {
372               this.$modal.msgSuccess("新增成功");
373               this.open = false;
374               this.getList();
375             });
376           }
377         }
378       });
379     },
380     /** 删除按钮操作 */
381     handleDelete(row) {
382       const ids = row.id || this.ids;
383       this.$modal.confirm('是否确认删除返修数据编号为"' + ids + '"的数据项?').then(function() {
384         return delRepairData(ids);
385       }).then(() => {
386         this.getList();
387         this.$modal.msgSuccess("删除成功");
388       }).catch(() => {});
389     },
390     /** 导出按钮操作 */
391     handleExport() {
392       this.download('rm/repairData/export', {
393         ...this.queryParams
394       }, `repairData_${new Date().getTime()}.xlsx`)
395     }
396   }
397 };
398 </script>