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