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