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