hdy
2024-07-10 a4362dfe3e0e9c6fad426685da0065455799d018
提交 | 用户 | 时间
0cceb6 1 <template>
Y 2   <div class="app-container">
3     <el-card class="box-card">
4       <div class="headClass">
5         <div style="display: flex;height: 20px">
6           <div>
7             <span style="font-size: large; font-weight: bold; text-decoration: underline; margin-bottom: 10px">返修记录报表</span>
8           </div>
9           <div style="margin-left: 30%">
10             <el-form :inline="true" :model="queryParams" class="myFrom" size="mini">
11               <el-form-item label="返修标识">
12                 <el-input v-model="queryParams.repairIdentification" placeholder="返修标识"></el-input>
13               </el-form-item>
14               <el-form-item label="箱体编码">
15                 <el-input v-model="queryParams.boxCode" placeholder="箱体编码">
16                 </el-input>
17               </el-form-item>
18               <el-form-item>
19                 <el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
20               </el-form-item>
21               <el-form-item>
22                 <el-button type="primary" icon="el-icon-download" style="background-color: #6dbf6d" @click="exportReport">导出报表</el-button>
23               </el-form-item>
24             </el-form>
25           </div>
26         </div>
27         <div style="margin-top: 10px">
28           <el-table
29             style="width: 100%;"
30             border height="190"
31             v-loading="loading"
32             highlight-current-row
33             :data="orderSchedulingList"
34             @selection-change="handleSelectionChange"
35             @current-change="handleCurrentChange">
36             <el-table-column
37               type="index"
38               width="50"></el-table-column>
39             <el-table-column type="selection" width="55" align="center" />
40             <el-table-column label="返修标识" align="center" prop="repairIdentification" />
41             <el-table-column label="箱体编码" align="center" prop="boxCode" />
42             <el-table-column label="工序编码" align="center" prop="processesCode" />
43             <el-table-column label="原结果" align="center" prop="originalResult" />
44             <el-table-column label="返修结果" align="center" prop="repairResults" />
45             <el-table-column label="创建用户" align="center" prop="createUser" />
46           </el-table>
47         </div>
48       </div>
49       <pagination
50         v-show="total>0"
51         :total="total"
52         :page.sync="queryParams.pageNum"
53         :limit.sync="queryParams.pageSize"
54         @pagination="getMainList"
55       />
56     </el-card>
57
58     <div>
59       <el-tabs type="border-card">
60         <el-tab-pane>
61           <span slot="label"><i class="el-icon-date"></i>拧紧数据</span>
62           <report1 :list1 = this.list1></report1>
63         </el-tab-pane>
64         <el-tab-pane>
65           <span slot="label"><i class="el-icon-date"></i>相机检测</span>
66           <report2 :list2 = this.list2></report2>
67         </el-tab-pane>
68         <el-tab-pane>
69           <span slot="label"><i class="el-icon-date"></i>外漏检测</span>
70           <report3 :list3 = this.list3></report3>
71         </el-tab-pane>
72         <el-tab-pane>
73           <span slot="label"><i class="el-icon-date"></i>机油加注</span>
74           <report4 :list4 = this.list4></report4>
75         </el-tab-pane>
76         <el-tab-pane>
77           <span slot="label"><i class="el-icon-date"></i>工位结果</span>
78           <report5 :list5 = this.list5></report5>
79         </el-tab-pane>
80       </el-tabs>
81     </div>
82   </div>
83 </template>
84
85 <script>
86 import { listRepairRecord, getRepairData } from "@/api/main/rm/repairRecord/repairRecord";
87 import {getFollowReport, listOrderScheduling} from "../../../../api/main/bs/orderScheduling/orderScheduling";
88 import report1 from "../../da/followReport/report1";
89 import report2 from "../../da/followReport/report2";
90 import report3 from "../../da/followReport/report3";
91 import report4 from "../../da/followReport/report4";
92 import report5 from "../../da/followReport/report5";
93
94 export default {
95   name: "RepairData",
96   dicts: ['qualified_status'],
97   components: { report1, report2, report3, report4, report5,},
98   data() {
99     return {
100       loading: false,
101       total: 0,
102       orderSchedulingList: [],
103       list1: [],
104       list2: [],
105       list3: [],
106       list4: [],
107       list5: [],
108       // 查询参数
109       queryParams: {
110         pageNum: 1,
111         pageSize: 10,
112         orderNo: null,
113         boxCode: null,
114         repairIdentification: null,
115         engineNo: null,
116         productType: null,
117         model: null,
118         productionStatus: null,
119         workingHours: null,
120         currentWorkstation: null,
121         qualityStatus: null,
122         whetherOrPrint: null,
123         report10: null,
124         report20: null,
125         combinedBoxTime: null,
126         finalAssemblyTime: null,
127         operator: null,
128         operateTime: null,
129         status: null,
130         spareField1: null,
131         spareField2: null,
132         spareField3: null,
133         spareField4: null,
134         createUser: null,
135         updateUser: null,
136         remarks: null,
137         dateConditions: [],
138         engineNoList: [],
139         engineNoListExcel: []
140       },
141       multipleSelection: [],
142       multipleSelectionExcel: [],
143       currentRow: null
144     }
145   },
146
147   created() {
148     let workOrderNo = this.$route.query.workOrderNo;
149     this.queryParams.orderNo = workOrderNo
150     this.getMainList();
151     this.getChildList();
152   },
153   methods: {
154     toggleSelection(rows) {
155       if (rows) {
156         rows.forEach(row => {
157           this.$refs.multipleTable.toggleRowSelection(row);
158         });
159       } else {
160         this.$refs.multipleTable.clearSelection();
161       }
162     },
163     handleSelectionChange(val) {
164       this.multipleSelectionExcel = val;
165       console.log('MMMMM--',this.multipleSelectionExcel)
166       if (this.multipleSelectionExcel !== null && this.multipleSelectionExcel.length > 0){
167         this.queryParams.engineNoListExcel = []
168         this.multipleSelectionExcel.forEach(x => {
169           this.queryParams.engineNoListExcel.push(x.boxCode)
170
171         })
172       }else {
173         this.queryParams.engineNoListExcel = []
174       }
175       console.log('this.handleSelectionChange ',this.queryParams.engineNoListExcel )
176     },
177     handleCurrentChange(val) {
178       this.currentRow = val;
179       //查询选中行数据
180       this.queryParams.engineNoList = []
181       this.queryParams.engineNoList.push(this.currentRow.boxCode)
182       this.getChildList()
183       console.log('handleCurrentChange',this.queryParams.engineNoList)
184       console.log('handleCurrentChange222',this.queryParams.engineNoListExcel)
185     },
186     //导出
187     exportReport(){
188       if (this.queryParams.engineNoListExcel.length === 0){
189         this.$message.error("请勾选需要导出的数据")
190       }else {
191         this.queryParams.engineNoList = []
192         this.download('rm/repairRecord/exportRepair', {
193           ...this.queryParams
194         }, `返修记录报表_${new Date().getTime()}.xlsx`)
195       }
196
197     },
198     /** 查询订单排产列表 */
199     getMainList() {
200       this.loading = true;
201       console.log(this.queryParams)
202       listRepairRecord(this.queryParams).then(response => {
203         this.orderSchedulingList = response.rows;
204         this.total = response.total;
205         this.loading = false;
206       });
207     },
208     getChildList(){
209       getRepairData(this.queryParams).then(response => {
210         this.list1 = response.data.list1;
211         console.log('list111111',this.list1)
212         this.list2 = response.data.list2;
213         this.list3 = response.data.list3;
214         this.list4 = response.data.list4;
215         this.list5 = response.data.list5;
216
217       });
218     },
219     getList(){
220       this.getMainList()
221       this.getChildList()
222     }
223     // handleCurrentChange(val) {
224     //   this.multipleSelection = val;
225     //   console.log('this.multipleSelection ',this.multipleSelection )
226     // }
227   }
228 };
229 </script>
230 <style scoped>
231 .headClass {
232   height: 200px;
233 }
234 ::v-deep .el-table--scrollable-x .el-table__body-wrapper {
235   z-index: 3;
236 }
237 ::v-deep .el-table__body-wrapper::-webkit-scrollbar {
238   height: 6px;
239 }
240 ::v-deep .el-form .myFrom .el-form--inline{
241   height: 20px;
242 }
243 ::v-deep .el-card__body {
244   padding: 10px 15px 10px 15px;
245 }
246 .app-container{
247   height: 625px;
248 }
249 </style>