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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
<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.orderNo" placeholder="订单编号"></el-input>
              </el-form-item>
              <el-form-item label="箱体编码">
                <el-input v-model="queryParams.engineNo" 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="orderNo" width="130">
 
            </el-table-column>
            <el-table-column label="箱体编码" align="center" prop="engineNo" width="150">
 
            </el-table-column>
            <el-table-column label="产品类型" align="center" prop="productType">
              <template slot-scope="scope">
                <dict-tag :options="dict.type.material_type" :value="scope.row.productType"/>
              </template>
            </el-table-column>
            <el-table-column label="机型" align="center" prop="model">
 
            </el-table-column>
            <el-table-column label="生产状态" align="center" prop="productionStatus">
              <template slot-scope="scope">
                <dict-tag :options="dict.type.order_scheduling_produce_status" :value="scope.row.productionStatus"/>
              </template>
            </el-table-column>
            <el-table-column label="工时" align="center" prop="workingHours">
 
            </el-table-column>
            <el-table-column label="当前工位" align="center" prop="currentWorkstation">
 
            </el-table-column>
            <el-table-column label="质量状态" align="center" prop="qualityStatus">
              <template slot-scope="scope">
                <dict-tag :options="dict.type.quality_status" :value="scope.row.qualityStatus"/>
              </template>
            </el-table-column>
            <el-table-column label="合箱上线时间" align="center" prop="boxClosingOnlineTime" width="160">
            </el-table-column>
            <el-table-column label="合箱下线时间" align="center" prop="closingBoxOfflineTime" width="160">
            </el-table-column>
            <el-table-column label="总装上线时间" align="center" prop="finalAssemblyLaunchTime" width="160">
            </el-table-column>
            <el-table-column label="总装下线时间" align="center" prop="finalAssemblyOfflineTime" width="160">
            </el-table-column>
            <el-table-column label="CVT上线时间" align="center" prop="cvtLaunchTime" width="160">
            </el-table-column>
            <el-table-column label="CVT下线时间" align="center" prop="cvtOfflineTime" width="160">
            </el-table-column>
            <el-table-column label="操作人" align="center" prop="operator">
 
            </el-table-column>
            <el-table-column label="操作时间" align="center" prop="operateTime" width="160">
 
            </el-table-column>
          </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 report1 from "./report1";
import {listOrderScheduling, getFollowReport} from "../../../../api/main/bs/orderScheduling/orderScheduling";
import report2 from "./report2";
import report3 from "./report3";
import report4 from "./report4";
import report5 from "./report5";
export default {
  name: "index",
  components: { report1, report2, report3, report4, report5,},
  dicts: ['order_scheduling_produce_status','quality_status','print_status','material_type'],
  data() {
    return {
      loading: false,
      total: 0,
      orderSchedulingList: [],
      list1: [],
      list2: [],
      list3: [],
      list4: [],
      list5: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        orderNo: 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.engineNo)
 
        })
      }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.engineNo)
      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('bs/orderScheduling/exportFollow', {
          ...this.queryParams
        }, `追溯报表_${new Date().getTime()}.xlsx`)
      }
 
    },
    /** 查询订单排产列表 */
    getMainList() {
      this.loading = true;
      console.log(this.queryParams)
      listOrderScheduling(this.queryParams).then(response => {
        this.orderSchedulingList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    getChildList(){
      getFollowReport(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>