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