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