春风项目四线(合箱线、总装线)
yyt
2024-06-26 dd44823b3c6cc003de21ea023cea7ea8d85a873c
提交 | 用户 | 时间
dd4482 1 <template>
Y 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="sfcCode">
6             <el-input
7               v-model="queryParams.sfcCode"
8               placeholder="请输入发动机号"
9               clearable
10               @keyup.enter.native="handleQuery"
11             />
12           </el-form-item>
13           <el-form-item label="零件编号" prop="paramCode">
14             <el-input
15               v-model="queryParams.paramCode"
16               placeholder="请输入零件编号"
17               clearable
18               @keyup.enter.native="handleQuery"
19             />
20           </el-form-item>
21           <el-form-item label="零件名称" prop="paramName">
22             <el-input
23               v-model="queryParams.paramName"
24               placeholder="请输入零件名称"
25               clearable
26               @keyup.enter.native="handleQuery"
27             />
28           </el-form-item>
29           <el-form-item label="备注" prop="remarks">
30             <el-input
31               v-model="queryParams.remarks"
32               placeholder="请输入备注"
33               clearable
34               @keyup.enter.native="handleQuery"
35             />
36           </el-form-item>
37           <el-form-item label="工序编号" prop="locationCode">
38             <el-input
39               v-model="queryParams.locationCode"
40               placeholder="请输入工序编号"
41               clearable
42               @keyup.enter.native="handleQuery"
43             />
44           </el-form-item>
45           <el-form-item style="float: right">
46             <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
47             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
48           </el-form-item>
49         </el-form>
50     </el-card>
51
52     <el-card style="margin-top: 10px" class="box-card">
53         <el-row :gutter="10" class="mb8">
54           <el-col :span="1.5">
55             <el-button
56               type="primary"
57               plain
58               icon="el-icon-plus"
59               size="mini"
60               @click="handleAdd"
61               v-hasPermi="['da:tileMatchCollection:add']"
62             >新增</el-button>
63           </el-col>
64           <el-col :span="1.5">
65             <el-button
66               type="success"
67               plain
68               icon="el-icon-edit"
69               size="mini"
70               :disabled="single"
71               @click="handleUpdate"
72               v-hasPermi="['da:tileMatchCollection:edit']"
73             >修改</el-button>
74           </el-col>
75           <el-col :span="1.5">
76             <el-button
77               type="danger"
78               plain
79               icon="el-icon-delete"
80               size="mini"
81               :disabled="multiple"
82               @click="handleDelete"
83               v-hasPermi="['da:tileMatchCollection:remove']"
84             >删除</el-button>
85           </el-col>
86           <el-col :span="1.5">
87             <el-button
88               type="warning"
89               plain
90               icon="el-icon-download"
91               size="mini"
92               @click="handleExport"
93               v-hasPermi="['da:tileMatchCollection:export']"
94             >导出</el-button>
95           </el-col>
96           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
97         </el-row>
98
99         <el-table border v-loading="loading" :data="tileMatchCollectionList" @selection-change="handleSelectionChange">
100           <el-table-column type="selection" width="55" align="center" />
101           <el-table-column label="id" align="center" prop="id" />
102           <el-table-column label="发动机号" align="center" prop="sfcCode">
103 <!--            <template slot-scope="scope">-->
104 <!--              <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.sfcCode"/>-->
105 <!--            </template>-->
106           </el-table-column>
107           <el-table-column label="零件编号" align="center" prop="paramCode">
108 <!--            <template slot-scope="scope">-->
109 <!--              <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.paramCode"/>-->
110 <!--            </template>-->
111           </el-table-column>
112           <el-table-column label="零件名称" align="center" prop="paramName">
113 <!--            <template slot-scope="scope">-->
114 <!--              <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.paramName"/>-->
115 <!--            </template>-->
116           </el-table-column>
117           <el-table-column label="备注" align="center" prop="remarks">
118 <!--            <template slot-scope="scope">-->
119 <!--              <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.remarks"/>-->
120 <!--            </template>-->
121           </el-table-column>
122           <el-table-column label="工序编号" align="center" prop="locationCode">
123 <!--            <template slot-scope="scope">-->
124 <!--              <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.locationCode"/>-->
125 <!--            </template>-->
126           </el-table-column>
127           <el-table-column fixed="right" width="200" label="操作" align="center" class-name="small-padding fixed-width">
128             <template slot-scope="scope">
129               <el-button
130                 size="mini"
131                 type="success"
132                 plain
133                 style="width: 72px"
134                 icon="el-icon-edit"
135                 @click="handleUpdate(scope.row)"
136                 v-hasPermi="['da:tileMatchCollection:edit']"
137               >修改</el-button>
138               <el-button
139                 size="mini"
140                 type="danger"
141                 plain
142                 style="width: 72px"
143                 icon="el-icon-delete"
144                 @click="handleDelete(scope.row)"
145                 v-hasPermi="['da:tileMatchCollection:remove']"
146               >删除</el-button>
147             </template>
148           </el-table-column>
149         </el-table>
150     </el-card>
151
152     <pagination
153       v-show="total>0"
154       :total="total"
155       :page.sync="queryParams.pageNum"
156       :limit.sync="queryParams.pageSize"
157       @pagination="getList"
158     />
159
160     <!-- 添加或修改条码采集对话框 -->
161     <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="500px" append-to-body>
162       <span slot="title">
163         <i class="el-icon-s-order"></i>
164         {{titleName}}
165       </span>
166       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
167         <el-form-item label="发动机号" prop="sfcCode">
168           <el-input v-model="form.sfcCode" placeholder="请输入发动机号" />
169         </el-form-item>
170         <el-form-item label="零件编号" prop="paramCode">
171           <el-input v-model="form.paramCode" placeholder="请输入零件编号" />
172         </el-form-item>
173         <el-form-item label="零件名称" prop="paramName">
174           <el-input v-model="form.paramName" placeholder="请输入零件名称" />
175         </el-form-item>
176         <el-form-item label="备注" prop="remarks">
177           <el-input v-model="form.remarks" placeholder="请输入备注" />
178         </el-form-item>
179         <el-form-item label="工序编号" prop="locationCode">
180           <el-input v-model="form.locationCode" placeholder="请输入工序编号" />
181         </el-form-item>
182       </el-form>
183       <div slot="footer" class="dialog-footer">
184         <el-button type="primary" @click="submitForm">确 定</el-button>
185         <el-button @click="cancel">取 消</el-button>
186       </div>
187     </el-dialog>
188   </div>
189 </template>
190
191 <script>
192 import { listTileMatchCollection, getTileMatchCollection, delTileMatchCollection, addTileMatchCollection, updateTileMatchCollection } from "@/api/main/da/tileMatchCollection/tileMatchCollection";
193
194 export default {
195   name: "TileMatchCollection",
196   data() {
197     return {
198       // 遮罩层
199       loading: true,
200       titleName: "",
201       // 选中数组
202       ids: [],
203       // 非单个禁用
204       single: true,
205       // 非多个禁用
206       multiple: true,
207       // 显示搜索条件
208       showSearch: true,
209       // 总条数
210       total: 0,
211       // 条码采集表格数据
212       tileMatchCollectionList: [],
213       // 弹出层标题
214       title: "",
215       // 是否显示弹出层
216       open: false,
217       // 查询参数
218       queryParams: {
219         pageNum: 1,
220         pageSize: 10,
221         sfcCode: null,
222         paramCode: null,
223         paramName: null,
224         remarks: null,
225         locationCode: null
226       },
227       // 表单参数
228       form: {},
229       // 表单校验
230       rules: {
231         id: [
232           { required: true, message: "id不能为空", trigger: "blur" }
233         ],
234       }
235     };
236   },
237   created() {
238     this.getList();
239   },
240   methods: {
241     /** 查询条码采集列表 */
242     getList() {
243       this.loading = true;
244       listTileMatchCollection(this.queryParams).then(response => {
245         this.tileMatchCollectionList = response.rows;
246         this.total = response.total;
247         this.loading = false;
248       });
249     },
250     // 取消按钮
251     cancel() {
252       this.open = false;
253       this.reset();
254     },
255     // 表单重置
256     reset() {
257       this.form = {
258         id: null,
259         sfcCode: null,
260         paramCode: null,
261         paramName: null,
262         createTime: null,
263         remarks: null,
264         locationCode: null
265       };
266       this.resetForm("form");
267     },
268     /** 搜索按钮操作 */
269     handleQuery() {
270       this.queryParams.pageNum = 1;
271       this.getList();
272     },
273     /** 重置按钮操作 */
274     resetQuery() {
275       this.resetForm("queryForm");
276       this.handleQuery();
277     },
278     // 多选框选中数据
279     handleSelectionChange(selection) {
280       this.ids = selection.map(item => item.id)
281       this.single = selection.length!==1
282       this.multiple = !selection.length
283     },
284     /** 新增按钮操作 */
285     handleAdd() {
286       this.reset();
287       this.open = true;
288       this.titleName = "添加条码采集";
289     },
290     /** 修改按钮操作 */
291     handleUpdate(row) {
292       this.reset();
293       const id = row.id || this.ids
294       getTileMatchCollection(id).then(response => {
295         this.form = response.data;
296         this.open = true;
297         this.titleName = "修改条码采集";
298       });
299     },
300     /** 提交按钮 */
301     submitForm() {
302       this.$refs["form"].validate(valid => {
303         if (valid) {
304           if (this.form.id != null) {
305             updateTileMatchCollection(this.form).then(response => {
306               this.$modal.msgSuccess("修改成功");
307               this.open = false;
308               this.getList();
309             });
310           } else {
311             addTileMatchCollection(this.form).then(response => {
312               this.$modal.msgSuccess("新增成功");
313               this.open = false;
314               this.getList();
315             });
316           }
317         }
318       });
319     },
320     /** 删除按钮操作 */
321     handleDelete(row) {
322       const ids = row.id || this.ids;
323       this.$modal.confirm('是否确认删除条码采集编号为"' + ids + '"的数据项?').then(function() {
324         return delTileMatchCollection(ids);
325       }).then(() => {
326         this.getList();
327         this.$modal.msgSuccess("删除成功");
328       }).catch(() => {});
329     },
330     /** 导出按钮操作 */
331     handleExport() {
332       this.download('da/tileMatchCollection/export', {
333         ...this.queryParams
334       }, `tileMatchCollection_${new Date().getTime()}.xlsx`)
335     }
336   }
337 };
338 </script>