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