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