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
<template>
  <el-table
    ref="multipleTable"
    :data="list5"
    height="259"
    border
    tooltip-effect="dark"
    style="width: 100%"
    @selection-change="handleSelectionChange">
        <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="workOrderNo" width="160">
    </el-table-column>
    <el-table-column label="总成序列号" align="center" prop="sfcCode" width="160">
    </el-table-column>
    <el-table-column label="产品编号" align="center" prop="productCode" width="160">
    </el-table-column>
    <el-table-column label="产线编号" align="center" prop="productionLine" width="160">
    </el-table-column>
    <el-table-column label="工位编号" align="center" prop="locationCode" width="100">
    </el-table-column>
    <el-table-column label="入站时间" align="center" prop="inboundTime" width="160">
      <template slot-scope="scope">
        <span>{{ parseTime(scope.row.inboundTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
      </template>
    </el-table-column>
    <el-table-column label="出站时间" align="center" prop="outboundTime" width="160">
      <template slot-scope="scope">
        <span>{{ parseTime(scope.row.outboundTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
      </template>
    </el-table-column>
 
    <el-table-column label="是否合格" align="center" prop="outRsSign">
    </el-table-column>
    <el-table-column label="NG原因" align="center" prop="outMsgSign">
    </el-table-column>
    <el-table-column label="采集时间" align="center" prop="collectionTime" width="160">
      <template slot-scope="scope">
        <span>{{ parseTime(scope.row.collectionTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
      </template>
    </el-table-column>
    <el-table-column label="节拍时间" align="center" prop="beatTime">
    </el-table-column>
<!--    <el-table-column-->
<!--      type="index"-->
<!--      width="50">-->
<!--    </el-table-column>-->
<!--    <el-table-column-->
<!--      type="selection"-->
<!--      align="center"-->
<!--      width="55">-->
<!--    </el-table-column>-->
<!--    <el-table-column-->
<!--      label="箱体编码"-->
<!--      align="center"-->
<!--      width="160">-->
<!--      <template slot-scope="scope">{{ scope.row.sfcCode }}</template>-->
<!--    </el-table-column>-->
<!--    <el-table-column-->
<!--      prop="name"-->
<!--      align="center"-->
<!--      label="工位"-->
<!--      width="120">-->
<!--      <template slot-scope="scope">{{ scope.row.locationCode }}</template>-->
<!--    </el-table-column>-->
<!--    <el-table-column-->
<!--      prop="address"-->
<!--      align="center"-->
<!--      label="参数名"-->
<!--      show-overflow-tooltip>-->
<!--      <template slot-scope="scope">{{ scope.row.paramName }}</template>-->
<!--    </el-table-column>-->
<!--    <el-table-column-->
<!--      prop="address"-->
<!--      label="采集结果"-->
<!--      align="center"-->
<!--      show-overflow-tooltip>-->
<!--      <template slot-scope="scope">{{ scope.row.paramValue }}</template>-->
<!--    </el-table-column>-->
<!--    <el-table-column-->
<!--      prop="address"-->
<!--      label="单位"-->
<!--      align="center"-->
<!--      show-overflow-tooltip>-->
<!--      <template slot-scope="scope">{{ scope.row.unit }}</template>-->
<!--    </el-table-column>-->
<!--    <el-table-column-->
<!--      prop="address"-->
<!--      label="时间"-->
<!--      align="center"-->
<!--      show-overflow-tooltip>-->
<!--      <template slot-scope="scope">{{ scope.row.createTime }}</template>-->
<!--    </el-table-column>-->
  </el-table>
</template>
 
<script>
export default {
  name: "report5",
  props:['list5'],
  data() {
    return {
      total: '',
      queryParams: {
        pageNum: 5,
        pageSize: 5
      },
      tableData: [{
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-08',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-06',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-07',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }],
      multipleSelection: []
    }
  },
  methods: {
    toggleSelection(rows) {
      if (rows) {
        rows.forEach(row => {
          this.$refs.multipleTable.toggleRowSelection(row);
        });
      } else {
        this.$refs.multipleTable.clearSelection();
      }
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    getList(){
 
    },
    // 日期格式化
    parseTime(time, pattern) {
      if (arguments.length === 0 || !time) {
        return null
      }
      const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
      let date
      if (typeof time === 'object') {
        date = time
      } else {
        if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
          time = parseInt(time)
        } else if (typeof time === 'string') {
          time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.[\d]{3}/gm), '');
        }
        if ((typeof time === 'number') && (time.toString().length === 10)) {
          time = time * 1000
        }
        date = new Date(time)
      }
      const formatObj = {
        y: date.getFullYear(),
        m: date.getMonth() + 1,
        d: date.getDate(),
        h: date.getHours(),
        i: date.getMinutes(),
        s: date.getSeconds(),
        a: date.getDay()
      }
      const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
        let value = formatObj[key]
        // Note: getDay() returns 0 on Sunday
        if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] }
        if (result.length > 0 && value < 10) {
          value = '0' + value
        }
        return value || 0
      })
      return time_str
    }
  }
}
</script>
 
<style scoped>
 
</style>