春风项目四线(合箱线、总装线)
yyt
2024-06-03 5030f3d30ccc1bd16db371c6970a48103aff9191
提交 | 用户 | 时间
5030f3 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="产品SN号" prop="sfcCode">
6             <el-input
7               v-model="queryParams.sfcCode"
8               placeholder="请输入产品SN号"
9               clearable
10               @keyup.enter.native="handleQuery"
11             />
12           </el-form-item>
13           <el-form-item label="托盘号" prop="palletNo">
14             <el-input
15               v-model="queryParams.palletNo"
16               placeholder="请输入托盘号"
17               clearable
18               @keyup.enter.native="handleQuery"
19             />
20           </el-form-item>
21           <el-form-item label="曲轴码" prop="crankshaftNo">
22             <el-input
23               v-model="queryParams.crankshaftNo"
24               placeholder="请输入曲轴码"
25               clearable
26               @keyup.enter.native="handleQuery"
27             />
28           </el-form-item>
29           <el-form-item label="状态" prop="state">
30             <el-input
31               v-model="queryParams.state"
32               placeholder="请输入状态"
33               clearable
34               @keyup.enter.native="handleQuery"
35             />
36           </el-form-item>
37           <el-form-item label="连杆码" prop="connectingrodNo">
38             <el-input
39               v-model="queryParams.connectingrodNo"
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:tileMatchMiddleware: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:tileMatchMiddleware: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:tileMatchMiddleware: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:tileMatchMiddleware: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="tileMatchMiddlewareList" @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="产品SN号" align="center" prop="sfcCode">
103           </el-table-column>
104           <el-table-column label="托盘号" align="center" prop="palletNo">
105           </el-table-column>
106           <el-table-column label="曲轴码" align="center" prop="crankshaftNo">
107           </el-table-column>
108           <el-table-column label="状态" align="center" prop="state">
109           </el-table-column>
110           <el-table-column label="备注" align="center" prop="remarks">
111           </el-table-column>
112           <el-table-column label="连杆码" align="center" prop="connectingrodNo">
113           </el-table-column>
114           <el-table-column label="气缸编号" align="center" prop="cylinder">
115           </el-table-column>
116           <el-table-column fixed="right" width="200" label="操作" align="center" class-name="small-padding fixed-width">
117             <template slot-scope="scope">
118               <el-button
119                 size="mini"
120                 type="success"
121                 plain
122                 style="width: 72px"
123                 icon="el-icon-edit"
124                 @click="handleUpdate(scope.row)"
125                 v-hasPermi="['da:tileMatchMiddleware:edit']"
126               >修改</el-button>
127               <el-button
128                 size="mini"
129                 type="danger"
130                 plain
131                 style="width: 72px"
132                 icon="el-icon-delete"
133                 @click="handleDelete(scope.row)"
134                 v-hasPermi="['da:tileMatchMiddleware:remove']"
135               >删除</el-button>
136             </template>
137           </el-table-column>
138         </el-table>
139     </el-card>
140
141     <pagination
142       v-show="total>0"
143       :total="total"
144       :page.sync="queryParams.pageNum"
145       :limit.sync="queryParams.pageSize"
146       @pagination="getList"
147     />
148
149     <!-- 添加或修改活塞连杆配瓦中间对话框 -->
150     <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="500px" append-to-body>
151       <span slot="title">
152         <i class="el-icon-s-order"></i>
153         {{titleName}}
154       </span>
155       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
156         <el-form-item label="产品SN号" prop="sfcCode">
157           <el-input v-model="form.sfcCode" placeholder="请输入产品SN号" />
158         </el-form-item>
159         <el-form-item label="托盘号" prop="palletNo">
160           <el-input v-model="form.palletNo" placeholder="请输入托盘号" />
161         </el-form-item>
162         <el-form-item label="曲轴码" prop="crankshaftNo">
163           <el-input v-model="form.crankshaftNo" placeholder="请输入曲轴码" />
164         </el-form-item>
165         <el-form-item label="状态" prop="state">
166           <el-input v-model="form.state" placeholder="请输入状态" />
167         </el-form-item>
168         <el-form-item label="备注" prop="remarks">
169           <el-input v-model="form.remarks" placeholder="请输入备注" />
170         </el-form-item>
171         <el-form-item label="连杆码" prop="connectingrodNo">
172           <el-input v-model="form.connectingrodNo" placeholder="请输入连杆码" />
173         </el-form-item>
174         <el-form-item label="气缸编号" prop="cylinder">
175           <el-input v-model="form.cylinder" placeholder="请输入气缸编号" />
176         </el-form-item>
177       </el-form>
178       <div slot="footer" class="dialog-footer">
179         <el-button type="primary" @click="submitForm">确 定</el-button>
180         <el-button @click="cancel">取 消</el-button>
181       </div>
182     </el-dialog>
183   </div>
184 </template>
185
186 <script>
187 import { listTileMatchMiddleware, getTileMatchMiddleware, delTileMatchMiddleware, addTileMatchMiddleware, updateTileMatchMiddleware } from "@/api/main/da/tileMatchMiddleware/tileMatchMiddleware";
188
189 export default {
190   name: "TileMatchMiddleware",
191   data() {
192     return {
193       // 遮罩层
194       loading: true,
195       titleName: "",
196       // 选中数组
197       ids: [],
198       // 非单个禁用
199       single: true,
200       // 非多个禁用
201       multiple: true,
202       // 显示搜索条件
203       showSearch: true,
204       // 总条数
205       total: 0,
206       // 活塞连杆配瓦中间表格数据
207       tileMatchMiddlewareList: [],
208       // 弹出层标题
209       title: "",
210       // 是否显示弹出层
211       open: false,
212       // 查询参数
213       queryParams: {
214         pageNum: 1,
215         pageSize: 10,
216         sfcCode: null,
217         palletNo: null,
218         crankshaftNo: null,
219         state: null,
220         remarks: null,
221         connectingrodNo: null,
222         cylinder: null
223       },
224       // 表单参数
225       form: {},
226       // 表单校验
227       rules: {
228         id: [
229           { required: true, message: "ID不能为空", trigger: "blur" }
230         ],
231       }
232     };
233   },
234   created() {
235     this.getList();
236   },
237   methods: {
238     /** 查询活塞连杆配瓦中间列表 */
239     getList() {
240       this.loading = true;
241       listTileMatchMiddleware(this.queryParams).then(response => {
242         this.tileMatchMiddlewareList = response.rows;
243         this.total = response.total;
244         this.loading = false;
245       });
246     },
247     // 取消按钮
248     cancel() {
249       this.open = false;
250       this.reset();
251     },
252     // 表单重置
253     reset() {
254       this.form = {
255         id: null,
256         sfcCode: null,
257         palletNo: null,
258         crankshaftNo: null,
259         state: null,
260         remarks: null,
261         connectingrodNo: null,
262         cylinder: null
263       };
264       this.resetForm("form");
265     },
266     /** 搜索按钮操作 */
267     handleQuery() {
268       this.queryParams.pageNum = 1;
269       this.getList();
270     },
271     /** 重置按钮操作 */
272     resetQuery() {
273       this.resetForm("queryForm");
274       this.handleQuery();
275     },
276     // 多选框选中数据
277     handleSelectionChange(selection) {
278       this.ids = selection.map(item => item.id)
279       this.single = selection.length!==1
280       this.multiple = !selection.length
281     },
282     /** 新增按钮操作 */
283     handleAdd() {
284       this.reset();
285       this.open = true;
286       this.titleName = "添加活塞连杆配瓦中间";
287     },
288     /** 修改按钮操作 */
289     handleUpdate(row) {
290       this.reset();
291       const id = row.id || this.ids
292       getTileMatchMiddleware(id).then(response => {
293         this.form = response.data;
294         this.open = true;
295         this.titleName = "修改活塞连杆配瓦中间";
296       });
297     },
298     /** 提交按钮 */
299     submitForm() {
300       this.$refs["form"].validate(valid => {
301         if (valid) {
302           if (this.form.id != null) {
303             updateTileMatchMiddleware(this.form).then(response => {
304               this.$modal.msgSuccess("修改成功");
305               this.open = false;
306               this.getList();
307             });
308           } else {
309             addTileMatchMiddleware(this.form).then(response => {
310               this.$modal.msgSuccess("新增成功");
311               this.open = false;
312               this.getList();
313             });
314           }
315         }
316       });
317     },
318     /** 删除按钮操作 */
319     handleDelete(row) {
320       const ids = row.id || this.ids;
321       this.$modal.confirm('是否确认删除活塞连杆配瓦中间编号为"' + ids + '"的数据项?').then(function() {
322         return delTileMatchMiddleware(ids);
323       }).then(() => {
324         this.getList();
325         this.$modal.msgSuccess("删除成功");
326       }).catch(() => {});
327     },
328     /** 导出按钮操作 */
329     handleExport() {
330       this.download('da/tileMatchMiddleware/export', {
331         ...this.queryParams
332       }, `tileMatchMiddleware_${new Date().getTime()}.xlsx`)
333     }
334   }
335 };
336 </script>