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