春风项目四线(合箱线、总装线)
hdy
2024-01-24 41570480eac58895b5b0fabe6ad9237444746de7
提交 | 用户 | 时间
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     <!-- 添加或修改配瓦规则对话框 -->
55542c 252     <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="1000px" 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>
babd27 276         <el-form-item label="轴参数位置" prop="axisParameterNoPosition">
J 277           <el-input v-model="form.axisParameterNoPosition" placeholder="请输入轴参数位置" />
2df134 278         </el-form-item>
babd27 279         <el-form-item label="颈参数位置" prop="neckParameterPosition">
J 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>
291         <el-form-item label="创建用户" prop="createUser">
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>
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         ],
369       }
370     };
371   },
372   created() {
373     this.getList();
374   },
375   methods: {
376     /** 查询配瓦规则列表 */
377     getList() {
378       this.loading = true;
379       listTileMatchRules(this.queryParams).then(response => {
380         this.tileMatchRulesList = response.rows;
381         this.total = response.total;
382         this.loading = false;
383       });
384     },
385     // 取消按钮
386     cancel() {
387       this.open = false;
388       this.reset();
389     },
390     // 表单重置
391     reset() {
392       this.form = {
393         id: null,
394         productSeries: null,
395         scanObject1: null,
396         scanObject2: null,
397         axisName: null,
398         neckName: null,
399         tileName: null,
400         axisParameterNoPosition: null,
401         neckParameterPosition: null,
402         axisValue: null,
403         neckValue: null,
404         tileColor: null,
405         createUser: null,
406         createTime: null,
407         updateUser: null,
408         updateTime: null,
409         state: null
410       };
411       this.resetForm("form");
412     },
413     /** 搜索按钮操作 */
414     handleQuery() {
415       this.queryParams.pageNum = 1;
416       this.getList();
417     },
418     /** 重置按钮操作 */
419     resetQuery() {
420       this.resetForm("queryForm");
421       this.handleQuery();
422     },
423     // 多选框选中数据
424     handleSelectionChange(selection) {
425       this.ids = selection.map(item => item.id)
426       this.single = selection.length!==1
427       this.multiple = !selection.length
428     },
429     /** 新增按钮操作 */
430     handleAdd() {
431       this.reset();
432       this.open = true;
433       this.titleName = "添加配瓦规则";
434     },
435     /** 修改按钮操作 */
436     handleUpdate(row) {
437       this.reset();
438       const id = row.id || this.ids
439       getTileMatchRules(id).then(response => {
440         this.form = response.data;
441         this.open = true;
442         this.titleName = "修改配瓦规则";
443       });
444     },
445     /** 提交按钮 */
446     submitForm() {
447       this.$refs["form"].validate(valid => {
448         if (valid) {
449           if (this.form.id != null) {
450             updateTileMatchRules(this.form).then(response => {
451               this.$modal.msgSuccess("修改成功");
452               this.open = false;
453               this.getList();
454             });
455           } else {
456             addTileMatchRules(this.form).then(response => {
457               this.$modal.msgSuccess("新增成功");
458               this.open = false;
459               this.getList();
460             });
461           }
462         }
463       });
464     },
465     /** 删除按钮操作 */
466     handleDelete(row) {
467       const ids = row.id || this.ids;
468       this.$modal.confirm('是否确认删除配瓦规则编号为"' + ids + '"的数据项?').then(function() {
469         return delTileMatchRules(ids);
470       }).then(() => {
471         this.getList();
472         this.$modal.msgSuccess("删除成功");
473       }).catch(() => {});
474     },
475     /** 导出按钮操作 */
476     handleExport() {
477       this.download('da/tileMatchRules/export', {
478         ...this.queryParams
479       }, `tileMatchRules_${new Date().getTime()}.xlsx`)
480     }
481   }
482 };
483 </script>