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