春风项目四线(合箱线、总装线)
jiang
2024-01-25 db79796f5d19d403b9c32503e71488609ae35985
提交 | 用户 | 时间
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">
0e4e86 214           <template slot-scope="scope">
J 215             <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.state"/>
216           </template>
2df134 217         </el-table-column>
J 218         <el-table-column fixed="right" width="200" label="操作" align="center" class-name="small-padding fixed-width">
219           <template slot-scope="scope">
220             <el-button
221               size="mini"
222               type="success"
223               plain
224               style="width: 72px"
225               icon="el-icon-edit"
226               @click="handleUpdate(scope.row)"
227               v-hasPermi="['da:tileMatchRules:edit']"
228             >修改</el-button>
229             <el-button
230               size="mini"
231               type="danger"
232               plain
233               style="width: 72px"
234               icon="el-icon-delete"
235               @click="handleDelete(scope.row)"
236               v-hasPermi="['da:tileMatchRules:remove']"
237             >删除</el-button>
238           </template>
239         </el-table-column>
240       </el-table>
241     </el-card>
242
243     <pagination
244       v-show="total>0"
245       :total="total"
246       :page.sync="queryParams.pageNum"
247       :limit.sync="queryParams.pageSize"
248       @pagination="getList"
249     />
250
251     <!-- 添加或修改配瓦规则对话框 -->
db7979 252     <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="650px" append-to-body>
2df134 253       <span slot="title">
J 254         <i class="el-icon-s-order"></i>
255         {{titleName}}
256       </span>
55542c 257       <el-form ref="form"  inline :model="form" :rules="rules" label-width="80px">
2df134 258         <el-form-item label="产品系列" prop="productSeries">
J 259           <el-input v-model="form.productSeries" placeholder="请输入产品系列" />
260         </el-form-item>
261         <el-form-item label="扫码对象1" prop="scanObject1">
262           <el-input v-model="form.scanObject1" placeholder="请输入扫码对象1" />
263         </el-form-item>
264         <el-form-item label="扫码对象2" prop="scanObject2">
265           <el-input v-model="form.scanObject2" placeholder="请输入扫码对象2" />
266         </el-form-item>
267         <el-form-item label="轴名称" prop="axisName">
268           <el-input v-model="form.axisName" placeholder="请输入轴名称" />
269         </el-form-item>
270         <el-form-item label="颈名称" prop="neckName">
271           <el-input v-model="form.neckName" placeholder="请输入颈名称" />
272         </el-form-item>
273         <el-form-item label="瓦名称" prop="tileName">
274           <el-input v-model="form.tileName" placeholder="请输入瓦名称" />
275         </el-form-item>
db7979 276         <el-form-item label="轴参数位置" prop="axisParameterNoPosition"  label-width="120">
J 277           <el-input v-model="form.axisParameterNoPosition" placeholder="请输入轴参数位置"  />
2df134 278         </el-form-item>
db7979 279         <el-form-item label="颈参数位置" prop="neckParameterPosition"  label-width="120">
babd27 280           <el-input v-model="form.neckParameterPosition" placeholder="请输入颈参数位置" />
2df134 281         </el-form-item>
J 282         <el-form-item label="轴值" prop="axisValue">
283           <el-input v-model="form.axisValue" placeholder="请输入轴值" />
284         </el-form-item>
285         <el-form-item label="颈值" prop="neckValue">
286           <el-input v-model="form.neckValue" placeholder="请输入颈值" />
287         </el-form-item>
288         <el-form-item label="瓦颜色" prop="tileColor">
289           <el-input v-model="form.tileColor" placeholder="请输入瓦颜色" />
290         </el-form-item>
db7979 291 <!--        <el-form-item label="创建用户" prop="createUser">-->
J 292 <!--          <el-input v-model="form.createUser" placeholder="请输入创建用户" />-->
293 <!--        </el-form-item>-->
294 <!--        <el-form-item label="更改用户" prop="updateUser">-->
295 <!--          <el-input v-model="form.updateUser" placeholder="请输入更改用户" />-->
296 <!--        </el-form-item>-->
2df134 297         <el-form-item label="状态" prop="state">
55542c 298           <el-select v-model="form.state"  placeholder="请选择状态" >
0e4e86 299             <el-option
J 300               v-for="dict in dict.type.sys_normal_disable"
301               :key="dict.value"
302               :label="dict.label"
55542c 303               :value="dict.value"
0e4e86 304             ></el-option>
J 305           </el-select>
2df134 306         </el-form-item>
J 307       </el-form>
308       <div slot="footer" class="dialog-footer">
309         <el-button type="primary" @click="submitForm">确 定</el-button>
310         <el-button @click="cancel">取 消</el-button>
311       </div>
312     </el-dialog>
313   </div>
314 </template>
315
316 <script>
317 import { listTileMatchRules, getTileMatchRules, delTileMatchRules, addTileMatchRules, updateTileMatchRules } from "@/api/main/bs/tileMatchRules/tileMatchRules";
318
319 export default {
320   name: "TileMatchRules",
0e4e86 321   dicts: ['subscription_type', 'sys_yes_no', 'data_type','sys_normal_disable'],
2df134 322   data() {
J 323     return {
324       // 遮罩层
325       loading: true,
326       titleName: "",
327       // 选中数组
328       ids: [],
329       // 非单个禁用
330       single: true,
331       // 非多个禁用
332       multiple: true,
333       // 显示搜索条件
334       showSearch: true,
335       // 总条数
336       total: 0,
337       // 配瓦规则表格数据
338       tileMatchRulesList: [],
339       // 弹出层标题
340       title: "",
341       // 是否显示弹出层
342       open: false,
343       // 查询参数
344       queryParams: {
345         pageNum: 1,
346         pageSize: 10,
347         productSeries: null,
348         scanObject1: null,
349         scanObject2: null,
350         axisName: null,
351         neckName: null,
352         tileName: null,
353         axisParameterNoPosition: null,
354         neckParameterPosition: null,
355         axisValue: null,
356         neckValue: null,
357         tileColor: null,
358         createUser: null,
359         updateUser: null,
360         state: null
361       },
362       // 表单参数
363       form: {},
364       // 表单校验
365       rules: {
366         id: [
367           { required: true, message: "主键id不能为空", trigger: "blur" }
368         ],
db7979 369         productSeries: [
J 370           { required: true, message: "产品系列不能为空", trigger: "blur" }
371         ],
372         axisName: [
373           { required: true, message: "轴名称不能为空", trigger: "blur" }
374         ],
375         neckName: [
376           { required: true, message: "颈名称不能为空", trigger: "blur" }
377         ],
378         tileName: [
379           { required: true, message: "瓦名称不能为空", trigger: "blur" }
380         ],
381         axisParameterNoPosition: [
382           { required: true, message: "轴参数位置不能为空", trigger: "blur" }
383         ],
384         neckParameterPosition: [
385           { required: true, message: "颈参数位置不能为空", trigger: "blur" }
386         ],
387         axisValue: [
388           { required: true, message: "轴值不能为空", trigger: "blur" }
389         ],
390         neckValue: [
391           { required: true, message: "颈值不能为空", trigger: "blur" }
392         ],
393         tileColor: [
394           { required: true, message: "瓦值不能为空", trigger: "blur" }
395         ],
396         state: [
397           { required: true, message: "状态不能为空", trigger: "blur" }
398         ]
2df134 399       }
J 400     };
401   },
402   created() {
403     this.getList();
404   },
405   methods: {
406     /** 查询配瓦规则列表 */
407     getList() {
408       this.loading = true;
409       listTileMatchRules(this.queryParams).then(response => {
410         this.tileMatchRulesList = response.rows;
411         this.total = response.total;
412         this.loading = false;
413       });
414     },
415     // 取消按钮
416     cancel() {
417       this.open = false;
418       this.reset();
419     },
420     // 表单重置
421     reset() {
422       this.form = {
423         id: null,
424         productSeries: null,
425         scanObject1: null,
426         scanObject2: null,
427         axisName: null,
428         neckName: null,
429         tileName: null,
430         axisParameterNoPosition: null,
431         neckParameterPosition: null,
432         axisValue: null,
433         neckValue: null,
434         tileColor: null,
435         createUser: null,
436         createTime: null,
437         updateUser: null,
438         updateTime: null,
439         state: null
440       };
441       this.resetForm("form");
442     },
443     /** 搜索按钮操作 */
444     handleQuery() {
445       this.queryParams.pageNum = 1;
446       this.getList();
447     },
448     /** 重置按钮操作 */
449     resetQuery() {
450       this.resetForm("queryForm");
451       this.handleQuery();
452     },
453     // 多选框选中数据
454     handleSelectionChange(selection) {
455       this.ids = selection.map(item => item.id)
456       this.single = selection.length!==1
457       this.multiple = !selection.length
458     },
459     /** 新增按钮操作 */
460     handleAdd() {
461       this.reset();
462       this.open = true;
463       this.titleName = "添加配瓦规则";
464     },
465     /** 修改按钮操作 */
466     handleUpdate(row) {
467       this.reset();
468       const id = row.id || this.ids
469       getTileMatchRules(id).then(response => {
470         this.form = response.data;
471         this.open = true;
472         this.titleName = "修改配瓦规则";
473       });
474     },
475     /** 提交按钮 */
476     submitForm() {
477       this.$refs["form"].validate(valid => {
478         if (valid) {
479           if (this.form.id != null) {
480             updateTileMatchRules(this.form).then(response => {
481               this.$modal.msgSuccess("修改成功");
482               this.open = false;
483               this.getList();
484             });
485           } else {
486             addTileMatchRules(this.form).then(response => {
487               this.$modal.msgSuccess("新增成功");
488               this.open = false;
489               this.getList();
490             });
491           }
492         }
493       });
494     },
495     /** 删除按钮操作 */
496     handleDelete(row) {
497       const ids = row.id || this.ids;
498       this.$modal.confirm('是否确认删除配瓦规则编号为"' + ids + '"的数据项?').then(function() {
499         return delTileMatchRules(ids);
500       }).then(() => {
501         this.getList();
502         this.$modal.msgSuccess("删除成功");
503       }).catch(() => {});
504     },
505     /** 导出按钮操作 */
506     handleExport() {
507       this.download('da/tileMatchRules/export', {
508         ...this.queryParams
509       }, `tileMatchRules_${new Date().getTime()}.xlsx`)
510     }
511   }
512 };
513 </script>