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