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