admin
2024-07-23 01beb5de6b270341bf1ffd7a4319035ebbff31a0
提交 | 用户 | 时间
5966d6 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">
768498 5           <el-form-item label-width="1" label="检验记录编号" prop="recordId">
5966d6 6             <el-input
A 7               v-model="queryParams.recordId"
768498 8               placeholder="请输入检验记录编号"
5966d6 9               clearable
A 10               @keyup.enter.native="handleQuery"
11             />
12           </el-form-item>
13           <el-form-item label="站点编号" prop="stationCode">
14             <el-input
15               v-model="queryParams.stationCode"
16               placeholder="请输入检测站点编号"
17               clearable
18               @keyup.enter.native="handleQuery"
19             />
20           </el-form-item>
21           <el-form-item label="pack码" prop="productNum">
22             <el-input
23               v-model="queryParams.productNum"
24               placeholder="请输入产品序列号-pack码"
25               clearable
26               @keyup.enter.native="handleQuery"
27             />
28           </el-form-item>
29           <el-form-item label="整体结果 " prop="totalResult">
30             <el-input
31               v-model="queryParams.totalResult"
32               placeholder="请输入整体结果 "
33               clearable
34               @keyup.enter.native="handleQuery"
35             />
36           </el-form-item>
37           <el-form-item label="工单号" prop="workOrderNo">
38             <el-input
39               v-model="queryParams.workOrderNo"
40               placeholder="请输入工单号"
41               clearable
42               @keyup.enter.native="handleQuery"
43             />
44           </el-form-item>
45 <!--          <el-form-item label="供应商类型" prop="supplierType">-->
46 <!--            <el-select v-model="queryParams.supplierType" placeholder="请选择供应商类型" clearable>-->
47 <!--              <el-option-->
48 <!--                v-for="dict in dict.type.${dictType}"-->
49 <!--                :key="dict.value"-->
50 <!--                :label="dict.label"-->
51 <!--                :value="dict.value"-->
52 <!--              />-->
53 <!--            </el-select>-->
54 <!--          </el-form-item>-->
55           <el-form-item label="状态编码" prop="resultCode">
56             <el-input
57               v-model="queryParams.resultCode"
58               placeholder="请输入状态编码"
59               clearable
60               @keyup.enter.native="handleQuery"
61             />
62           </el-form-item>
63           <el-form-item style="float: right">
64             <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
65             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
66           </el-form-item>
67         </el-form>
68     </el-card>
69
70     <el-card style="margin-top: 10px" class="box-card">
71         <el-row :gutter="10" class="mb8">
768498 72 <!--          <el-col :span="1.5">-->
A 73 <!--            <el-button-->
74 <!--              type="primary"-->
75 <!--              plain-->
76 <!--              icon="el-icon-plus"-->
77 <!--              size="mini"-->
78 <!--              @click="handleAdd"-->
79 <!--              v-hasPermi="['da:testDeviceInterface:add']"-->
80 <!--            >新增</el-button>-->
81 <!--          </el-col>-->
82 <!--          <el-col :span="1.5">-->
83 <!--            <el-button-->
84 <!--              type="success"-->
85 <!--              plain-->
86 <!--              icon="el-icon-edit"-->
87 <!--              size="mini"-->
88 <!--              :disabled="single"-->
89 <!--              @click="handleUpdate"-->
90 <!--              v-hasPermi="['da:testDeviceInterface:edit']"-->
91 <!--            >修改</el-button>-->
92 <!--          </el-col>-->
93 <!--          <el-col :span="1.5">-->
94 <!--            <el-button-->
95 <!--              type="danger"-->
96 <!--              plain-->
97 <!--              icon="el-icon-delete"-->
98 <!--              size="mini"-->
99 <!--              :disabled="multiple"-->
100 <!--              @click="handleDelete"-->
101 <!--              v-hasPermi="['da:testDeviceInterface:remove']"-->
102 <!--            >删除</el-button>-->
103 <!--          </el-col>-->
5966d6 104           <el-col :span="1.5">
A 105             <el-button
106               type="warning"
107               plain
108               icon="el-icon-download"
109               size="mini"
110               @click="handleExport"
111               v-hasPermi="['da:testDeviceInterface:export']"
112             >导出</el-button>
113           </el-col>
114           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
115         </el-row>
116
117         <el-table border v-loading="loading" :data="testDeviceInterfaceList" @selection-change="handleSelectionChange">
118           <el-table-column type="selection" width="55" align="center" />
768498 119           <el-table-column label="检验记录编号" width="100" :show-overflow-tooltip='true' align="center" prop="recordId">
5966d6 120           </el-table-column>
768498 121           <el-table-column label="站点编号" width="100" align="center" prop="stationCode">
5966d6 122           </el-table-column>
768498 123           <el-table-column label="pack码" width="230" :show-overflow-tooltip='true' align="center" prop="productNum">
5966d6 124           </el-table-column>
768498 125           <el-table-column label="整体结果" width="100" align="center" prop="totalResult">
5966d6 126           </el-table-column>
768498 127           <el-table-column label="工单号" width="100" align="center" prop="workOrderNo">
5966d6 128           </el-table-column>
768498 129 <!--          <el-table-column label="供应商类型" align="center" prop="supplierType">-->
A 130 <!--          </el-table-column>-->
131           <el-table-column label="入参" width="300" :show-overflow-tooltip='true' align="center" prop="checkList">
5966d6 132           </el-table-column>
768498 133 <!--          <el-table-column label="状态编码" width="100" align="center" prop="resultCode">-->
A 134 <!--          </el-table-column>-->
135 <!--          <el-table-column label="返回信息" width="100" align="center" prop="resultMessage">-->
136 <!--          </el-table-column>-->
137 <!--          <el-table-column label="出参" width="100" align="center" prop="resultData">-->
138 <!--          </el-table-column>-->
5966d6 139           <el-table-column label="创建用户" align="center" prop="createUser">
A 140           </el-table-column>
768498 141           <el-table-column label="创建时间" width="160" align="center" prop="createTime">
5966d6 142           </el-table-column>
A 143           <el-table-column label="更改用户" align="center" prop="updateUser">
144           </el-table-column>
768498 145           <el-table-column label="更改时间" width="160" align="center" prop="updateTime">
5966d6 146           </el-table-column>
768498 147 <!--          <el-table-column fixed="right" width="200" label="操作" align="center" class-name="small-padding fixed-width">-->
A 148 <!--            <template slot-scope="scope">-->
149 <!--              <el-button-->
150 <!--                size="mini"-->
151 <!--                type="success"-->
152 <!--                plain-->
153 <!--                style="width: 72px"-->
154 <!--                icon="el-icon-edit"-->
155 <!--                @click="handleUpdate(scope.row)"-->
156 <!--                v-hasPermi="['da:testDeviceInterface:edit']"-->
157 <!--              >修改</el-button>-->
158 <!--              <el-button-->
159 <!--                size="mini"-->
160 <!--                type="danger"-->
161 <!--                plain-->
162 <!--                style="width: 72px"-->
163 <!--                icon="el-icon-delete"-->
164 <!--                @click="handleDelete(scope.row)"-->
165 <!--                v-hasPermi="['da:testDeviceInterface:remove']"-->
166 <!--              >删除</el-button>-->
167 <!--            </template>-->
168 <!--          </el-table-column>-->
5966d6 169         </el-table>
A 170     </el-card>
171
172     <pagination
173       v-show="total>0"
174       :total="total"
175       :page.sync="queryParams.pageNum"
176       :limit.sync="queryParams.pageSize"
177       @pagination="getList"
178     />
179
180     <!-- 添加或修改测试设备接口数据对话框 -->
181     <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="500px" append-to-body>
182       <span slot="title">
183         <i class="el-icon-s-order"></i>
184         {{titleName}}
185       </span>
186       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
187         <el-form-item label="检验记录编号,由各设备按自定规则生成,唯一编码" prop="recordId">
188           <el-input v-model="form.recordId" placeholder="请输入检验记录编号,由各设备按自定规则生成,唯一编码" />
189         </el-form-item>
190         <el-form-item label="检测站点编号" prop="stationCode">
191           <el-input v-model="form.stationCode" placeholder="请输入检测站点编号" />
192         </el-form-item>
193         <el-form-item label="产品序列号-pack码" prop="productNum">
194           <el-input v-model="form.productNum" placeholder="请输入产品序列号-pack码" />
195         </el-form-item>
196         <el-form-item label="整体结果 " prop="totalResult">
197           <el-input v-model="form.totalResult" placeholder="请输入整体结果 " />
198         </el-form-item>
199         <el-form-item label="工单号" prop="workOrderNo">
200           <el-input v-model="form.workOrderNo" placeholder="请输入工单号" />
201         </el-form-item>
202 <!--        <el-form-item label="供应商类型" prop="supplierType">-->
203 <!--          <el-select v-model="form.supplierType" placeholder="请选择供应商类型">-->
204 <!--            <el-option-->
205 <!--              v-for="dict in dict.type.${dictType}"-->
206 <!--              :key="dict.value"-->
207 <!--              :label="dict.label"-->
208 <!--              :value="dict.value"-->
209 <!--            ></el-option>-->
210 <!--          </el-select>-->
211 <!--        </el-form-item>-->
212         <el-form-item label="入参-参数列表" prop="checkList">
213           <el-input v-model="form.checkList" placeholder="请输入入参-参数列表" />
214         </el-form-item>
215         <el-form-item label="状态编码" prop="resultCode">
216           <el-input v-model="form.resultCode" placeholder="请输入状态编码" />
217         </el-form-item>
218         <el-form-item label="接口的返回信息,当fail时会有报错信息" prop="resultMessage">
219           <el-input v-model="form.resultMessage" placeholder="请输入接口的返回信息,当fail时会有报错信息" />
220         </el-form-item>
221         <el-form-item label="出参-参数列表" prop="resultData">
222           <el-input v-model="form.resultData" placeholder="请输入出参-参数列表" />
223         </el-form-item>
224         <el-form-item label="备注" prop="remarks">
225           <el-input v-model="form.remarks" placeholder="请输入备注" />
226         </el-form-item>
227       </el-form>
228       <div slot="footer" class="dialog-footer">
229         <el-button type="primary" @click="submitForm">确 定</el-button>
230         <el-button @click="cancel">取 消</el-button>
231       </div>
232     </el-dialog>
233   </div>
234 </template>
235
236 <script>
237 import { listTestDeviceInterface, getTestDeviceInterface, delTestDeviceInterface, addTestDeviceInterface, updateTestDeviceInterface } from "@/api/main/da/testDeviceInterface/testDeviceInterface";
238
239 export default {
240   name: "TestDeviceInterface",
241   data() {
242     return {
243       // 遮罩层
244       loading: true,
245       titleName: "",
246       // 选中数组
247       ids: [],
248       // 非单个禁用
249       single: true,
250       // 非多个禁用
251       multiple: true,
252       // 显示搜索条件
253       showSearch: true,
254       // 总条数
255       total: 0,
256       // 测试设备接口数据表格数据
257       testDeviceInterfaceList: [],
258       // 弹出层标题
259       title: "",
260       // 是否显示弹出层
261       open: false,
262       // 查询参数
263       queryParams: {
264         pageNum: 1,
265         pageSize: 10,
266         recordId: null,
267         stationCode: null,
268         productNum: null,
269         totalResult: null,
270         workOrderNo: null,
271         supplierType: null,
272         resultCode: null,
273       },
274       // 表单参数
275       form: {},
276       // 表单校验
277       rules: {
278         id: [
279           { required: true, message: "id不能为空", trigger: "blur" }
280         ],
281       }
282     };
283   },
284   created() {
285     this.getList();
286   },
287   methods: {
288     /** 查询测试设备接口数据列表 */
289     getList() {
290       this.loading = true;
291       listTestDeviceInterface(this.queryParams).then(response => {
292         this.testDeviceInterfaceList = response.rows;
293         this.total = response.total;
294         this.loading = false;
295       });
296     },
297     // 取消按钮
298     cancel() {
299       this.open = false;
300       this.reset();
301     },
302     // 表单重置
303     reset() {
304       this.form = {
305         id: null,
306         recordId: null,
307         stationCode: null,
308         productNum: null,
309         totalResult: null,
310         workOrderNo: null,
311         supplierType: null,
312         checkList: null,
313         resultCode: null,
314         resultMessage: null,
315         resultData: null,
316         remarks: null,
317         createUser: null,
318         createTime: null,
319         updateUser: null,
320         updateTime: null,
321         spareField1: null,
322         spareField2: null,
323         spareField3: null,
324         spareField4: 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.titleName = "添加测试设备接口数据";
349     },
350     /** 修改按钮操作 */
351     handleUpdate(row) {
352       this.reset();
353       const id = row.id || this.ids
354       getTestDeviceInterface(id).then(response => {
355         this.form = response.data;
356         this.open = true;
357         this.titleName = "修改测试设备接口数据";
358       });
359     },
360     /** 提交按钮 */
361     submitForm() {
362       this.$refs["form"].validate(valid => {
363         if (valid) {
364           if (this.form.id != null) {
365             updateTestDeviceInterface(this.form).then(response => {
366               this.$modal.msgSuccess("修改成功");
367               this.open = false;
368               this.getList();
369             });
370           } else {
371             addTestDeviceInterface(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 delTestDeviceInterface(ids);
385       }).then(() => {
386         this.getList();
387         this.$modal.msgSuccess("删除成功");
388       }).catch(() => {});
389     },
390     /** 导出按钮操作 */
391     handleExport() {
392       this.download('da/testDeviceInterface/export', {
393         ...this.queryParams
394       }, `testDeviceInterface_${new Date().getTime()}.xlsx`)
395     }
396   }
397 };
398 </script>