admin
2024-10-15 6d313a4a6f9f9d7ea65ec50ab0d4491e595edb97
提交 | 用户 | 时间
e57a89 1 <template>
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">
768498 5       <el-form-item label="工单编号" prop="workOrderNo">
e57a89 6         <el-input
768498 7           v-model="queryParams.workOrderNo"
A 8           placeholder="请输入工单编号"
e57a89 9           clearable
10           @keyup.enter.native="handleQuery"
11         />
12       </el-form-item>
768498 13       <el-form-item label-width="100px" label="总成序列号" prop="sfcCode">
e57a89 14         <el-input
768498 15           v-model="queryParams.sfcCode"
A 16           placeholder="请输入总成序列号"
17           clearable
18           @keyup.enter.native="handleQuery"
19         />
20       </el-form-item>
21       <el-form-item label="参数编码" prop="paramCode">
22         <el-input
23           v-model="queryParams.paramCode"
24           placeholder="请输入参数编码"
25           clearable
26           @keyup.enter.native="handleQuery"
27         />
28       </el-form-item>
29       <el-form-item label="工序" prop="locationCode">
30         <el-input
31           v-model="queryParams.locationCode"
32           placeholder="请输入工序"
33           clearable
34           @keyup.enter.native="handleQuery"
35         />
36       </el-form-item>
37       <el-form-item label="产品编码" prop="productCode">
38         <el-input
39           v-model="queryParams.productCode"
40           placeholder="请输入产品编码"
e57a89 41           clearable
42           @keyup.enter.native="handleQuery"
43         />
44       </el-form-item>
45       <el-form-item style="float: right">
46         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
47         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
48       </el-form-item>
49     </el-form>
50     </el-card>
51     <el-card style="margin-top: 10px" class="box-card">
52     <el-row :gutter="10" class="mb8">
53       <el-col :span="1.5">
54         <el-button
55           type="primary"
56           plain
57           icon="el-icon-plus"
58           size="mini"
59           @click="handleAdd"
60           v-hasPermi="['main:paramCollection:add']"
61         >新增</el-button>
62       </el-col>
63       <el-col :span="1.5">
64         <el-button
65           type="success"
66           plain
67           icon="el-icon-edit"
68           size="mini"
69           :disabled="single"
70           @click="handleUpdate"
71           v-hasPermi="['main:paramCollection:edit']"
72         >修改</el-button>
73       </el-col>
74       <el-col :span="1.5">
75         <el-button
76           type="danger"
77           plain
78           icon="el-icon-delete"
79           size="mini"
80           :disabled="multiple"
81           @click="handleDelete"
82           v-hasPermi="['main:paramCollection:remove']"
83         >删除</el-button>
84       </el-col>
85       <el-col :span="1.5">
86         <el-button
87           type="warning"
88           plain
89           icon="el-icon-download"
90           size="mini"
91           @click="handleExport"
92           v-hasPermi="['main:paramCollection:export']"
93         >导出</el-button>
94       </el-col>
95       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
96     </el-row>
97
98     <el-table v-loading="loading" border :data="paramCollectionList" @selection-change="handleSelectionChange" v-if="paramCollectionList.length > 0">
99       <el-table-column type="selection" width="55" align="center" />
768498 100       <el-table-column label="工单编号" width="100" align="center" prop="workOrderNo"></el-table-column>
A 101       <el-table-column label="总成序列号" align="center" width="290" prop="sfcCode" ></el-table-column>
102       <el-table-column label="产品编号" align="center" width="100" prop="productCode"></el-table-column>
b64ed2 103 <!--      <el-table-column label="产线编号" align="center" prop="productionLine"></el-table-column>-->
104       <el-table-column label="工序编号" align="center" prop="locationCode"></el-table-column>
105 <!--      <el-table-column label="设备编号" align="center" prop="equipmentNo"></el-table-column>-->
768498 106       <el-table-column label="参数编码" width="190" align="center" prop="paramCode"></el-table-column>
b64ed2 107       <el-table-column label="参数名称" width="150" align="center" prop="paramName"></el-table-column>
768498 108       <el-table-column label="参数值" width="330" align="center" prop="paramValue"></el-table-column>
49c784 109 <!--      <el-table-column label="参数上限" align="center" prop="paramUpper"></el-table-column>
110       <el-table-column label="参数下限" align="center" prop="paramLower"></el-table-column>-->
e57a89 111       <el-table-column label="采集时间" align="center" prop="collectionTime" width="160">
112         <template slot-scope="scope">
113           <span>{{ parseTime(scope.row.collectionTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
114         </template>
115       </el-table-column>
49c784 116 <!--      <el-table-column label="状态" align="center" prop="state"></el-table-column>
e57a89 117       <el-table-column label="单位" align="center" prop="unit"></el-table-column>
118       <el-table-column label="类型" align="center" prop="type"></el-table-column>
119       <el-table-column fixed="right" width="200" label="操作" align="center" class-name="small-padding fixed-width" >
120         <template slot-scope="scope">
121           <el-button
122             size="mini"
123             type="success"
124             plain
125             style="width: 72px"
126             icon="el-icon-edit"
127             @click="handleUpdate(scope.row)"
128             v-hasPermi="['main:paramCollection:edit']"
129           >修改</el-button>
130           <el-button
131             size="mini"
132             type="danger"
133             plain
134             style="width: 72px"
135             icon="el-icon-delete"
136             @click="handleDelete(scope.row)"
137             v-hasPermi="['main:paramCollection:remove']"
138           >删除</el-button>
139         </template>
49c784 140       </el-table-column>-->
e57a89 141     </el-table>
142       <el-empty v-else>
143         <span slot="description">暂无数据</span>
144       </el-empty>
145     </el-card>
146
147     <pagination
148       v-show="total>0"
149       :total="total"
150       :page.sync="queryParams.pageNum"
151       :limit.sync="queryParams.pageSize"
152       @pagination="getList"
153     />
154
155     <!-- 添加或修改设备产品过程参数采集对话框 -->
156     <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="500px" append-to-body>
157       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
158         <el-form-item label="工单编号" prop="workOrderNo">
159           <el-input v-model="form.workOrderNo" type="textarea" placeholder="请输入内容" />
160         </el-form-item>
161         <el-form-item label="总成序列号" prop="sfcCode">
162           <el-input v-model="form.sfcCode" type="textarea" placeholder="请输入内容" />
163         </el-form-item>
164         <el-form-item label="产品编号" prop="productCode">
165           <el-input v-model="form.productCode" type="textarea" placeholder="请输入内容" />
166         </el-form-item>
167         <el-form-item label="产线编号" prop="productionLine">
168           <el-input v-model="form.productionLine" type="textarea" placeholder="请输入内容" />
169         </el-form-item>
170         <el-form-item label="工位编号" prop="locationCode">
171           <el-input v-model="form.locationCode" type="textarea" placeholder="请输入内容" />
172         </el-form-item>
173         <el-form-item label="设备编号" prop="equipmentNo">
174           <el-input v-model="form.equipmentNo" type="textarea" placeholder="请输入内容" />
175         </el-form-item>
176         <el-form-item label="参数编码" prop="paramCode">
177           <el-input v-model="form.paramCode" type="textarea" placeholder="请输入内容" />
178         </el-form-item>
179         <el-form-item label="参数值" prop="paramValue">
180           <el-input v-model="form.paramValue" type="textarea" placeholder="请输入内容" />
181         </el-form-item>
182         <el-form-item label="参数上限" prop="paramUpper">
183           <el-input v-model="form.paramUpper" type="textarea" placeholder="请输入内容" />
184         </el-form-item>
185         <el-form-item label="参数下限" prop="paramLower">
186           <el-input v-model="form.paramLower" type="textarea" placeholder="请输入内容" />
187         </el-form-item>
188         <el-form-item label="标准值" prop="paramStandard">
189           <el-input v-model="form.paramStandard" type="textarea" placeholder="请输入内容" />
190         </el-form-item>
191         <el-form-item label="状态" prop="state">
192           <el-input v-model="form.state" placeholder="请输入状态" />
193         </el-form-item>
194         <el-form-item label="参数名称" prop="paramName">
195           <el-input v-model="form.paramName" placeholder="请输入参数名称" />
196         </el-form-item>
197         <el-form-item label="单位" prop="unit">
198           <el-input v-model="form.unit" placeholder="请输入单位" />
199         </el-form-item>
200         <el-form-item label="类型" prop="type">
201           <el-select v-model="form.type" placeholder="请选择类型">
202           </el-select>
203         </el-form-item>
204       </el-form>
205       <div slot="footer" class="dialog-footer">
206         <el-button type="primary" @click="submitForm">确 定</el-button>
207         <el-button @click="cancel">取 消</el-button>
208       </div>
209     </el-dialog>
210   </div>
211 </template>
212
213 <script>
214 import { listParamCollection, getParamCollection, delParamCollection, addParamCollection, updateParamCollection } from "@/api/main/da/paramCollection/paramCollection";
215
216 export default {
217   name: "ParamCollection",
218   data() {
219     return {
220       // 遮罩层
221       loading: true,
222       // 选中数组
223       ids: [],
224       // 非单个禁用
225       single: true,
226       // 非多个禁用
227       multiple: true,
228       // 显示搜索条件
229       showSearch: true,
230       // 总条数
231       total: 0,
232       // 设备产品过程参数采集表格数据
233       paramCollectionList: [],
234       // 弹出层标题
235       title: "",
236       // 是否显示弹出层
237       open: false,
238       // 查询参数
239       queryParams: {
240         pageNum: 1,
241         pageSize: 10,
242         workOrderNo: null,
243         sfcCode: null,
244         productCode: null,
245         productionLine: null,
246         locationCode: null,
247         equipmentNo: null,
248         paramCode: null,
249       },
250       // 表单参数
251       form: {},
252       // 表单校验
253       rules: {
254         id: [
255           { required: true, message: "主键id不能为空", trigger: "blur" }
256         ],
257         workOrderNo: [
258           { required: true, message: "工单编号不能为空", trigger: "blur" }
259         ],
260         sfcCode: [
261           { required: true, message: "总成序列号不能为空", trigger: "blur" }
262         ],
263         productCode: [
264           { required: true, message: "产品编号不能为空", trigger: "blur" }
265         ],
266         productionLine: [
267           { required: true, message: "产线编号不能为空", trigger: "blur" }
268         ],
269         locationCode: [
270           { required: true, message: "工位编号不能为空", trigger: "blur" }
271         ],
272         paramCode: [
273           { required: true, message: "参数编码不能为空", trigger: "blur" }
274         ],
275         paramValue: [
276           { required: true, message: "参数值不能为空", trigger: "blur" }
277         ],
278       }
279     };
280   },
281   created() {
282     this.getList();
283   },
284   methods: {
285     /** 查询设备产品过程参数采集列表 */
286     getList() {
287       this.loading = true;
288       listParamCollection(this.queryParams).then(response => {
289         this.paramCollectionList = response.rows;
290         this.total = response.total;
291         this.loading = false;
292       });
293     },
294     // 取消按钮
295     cancel() {
296       this.open = false;
297       this.reset();
298     },
299     // 表单重置
300     reset() {
301       this.form = {
302         id: null,
303         workOrderNo: null,
304         sfcCode: null,
305         productCode: null,
306         productionLine: null,
307         locationCode: null,
308         equipmentNo: null,
309         paramCode: null,
310         paramValue: null,
311         paramUpper: null,
312         paramLower: null,
313         paramStandard: null,
314         collectionTime: null,
315         spareField1: null,
316         spareField2: null,
317         createUser: null,
318         createTime: null,
319         updateUser: null,
320         updateTime: null,
321         state: null,
322         paramName: null,
323         unit: null,
324         type: 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       getParamCollection(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             updateParamCollection(this.form).then(response => {
366               this.$modal.msgSuccess("修改成功");
367               this.open = false;
368               this.getList();
369             });
370           } else {
371             addParamCollection(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 delParamCollection(ids);
385       }).then(() => {
386         this.getList();
387         this.$modal.msgSuccess("删除成功");
388       }).catch(() => {});
389     },
390     /** 导出按钮操作 */
391     handleExport() {
392       this.download('main/paramCollection/export', {
393         ...this.queryParams
394       }, `paramCollection_${new Date().getTime()}.xlsx`)
395     }
396   }
397 };
398 </script>