提交 | 用户 | 时间
|
c74dcb
|
1 |
<template> |
W |
2 |
<el-table |
|
3 |
ref="multipleTable" |
|
4 |
:data="list5" |
238595
|
5 |
height="259" |
c74dcb
|
6 |
border |
W |
7 |
tooltip-effect="dark" |
|
8 |
style="width: 100%" |
|
9 |
@selection-change="handleSelectionChange"> |
|
10 |
<el-table-column |
|
11 |
type="index" |
|
12 |
width="50"> |
|
13 |
</el-table-column> |
|
14 |
<el-table-column type="selection" width="55" align="center" /> |
238595
|
15 |
<el-table-column label="工单编号" align="center" prop="workOrderNo" width="160"> |
c74dcb
|
16 |
</el-table-column> |
238595
|
17 |
<el-table-column label="总成序列号" align="center" prop="sfcCode" width="160"> |
c74dcb
|
18 |
</el-table-column> |
238595
|
19 |
<el-table-column label="产品编号" align="center" prop="productCode" width="160"> |
c74dcb
|
20 |
</el-table-column> |
238595
|
21 |
<el-table-column label="产线编号" align="center" prop="productionLine" width="160"> |
c74dcb
|
22 |
</el-table-column> |
238595
|
23 |
<el-table-column label="工位编号" align="center" prop="locationCode" width="100"> |
c74dcb
|
24 |
</el-table-column> |
238595
|
25 |
<el-table-column label="入站时间" align="center" prop="inboundTime" width="160"> |
c74dcb
|
26 |
<template slot-scope="scope"> |
W |
27 |
<span>{{ parseTime(scope.row.inboundTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> |
|
28 |
</template> |
|
29 |
</el-table-column> |
238595
|
30 |
<el-table-column label="出站时间" align="center" prop="outboundTime" width="160"> |
c74dcb
|
31 |
<template slot-scope="scope"> |
W |
32 |
<span>{{ parseTime(scope.row.outboundTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> |
|
33 |
</template> |
|
34 |
</el-table-column> |
|
35 |
|
|
36 |
<el-table-column label="是否合格" align="center" prop="outRsSign"> |
|
37 |
</el-table-column> |
|
38 |
<el-table-column label="NG原因" align="center" prop="outMsgSign"> |
|
39 |
</el-table-column> |
238595
|
40 |
<el-table-column label="采集时间" align="center" prop="collectionTime" width="160"> |
c74dcb
|
41 |
<template slot-scope="scope"> |
W |
42 |
<span>{{ parseTime(scope.row.collectionTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> |
|
43 |
</template> |
|
44 |
</el-table-column> |
|
45 |
<el-table-column label="节拍时间" align="center" prop="beatTime"> |
|
46 |
</el-table-column> |
|
47 |
<!-- <el-table-column--> |
|
48 |
<!-- type="index"--> |
|
49 |
<!-- width="50">--> |
|
50 |
<!-- </el-table-column>--> |
|
51 |
<!-- <el-table-column--> |
|
52 |
<!-- type="selection"--> |
|
53 |
<!-- align="center"--> |
|
54 |
<!-- width="55">--> |
|
55 |
<!-- </el-table-column>--> |
|
56 |
<!-- <el-table-column--> |
|
57 |
<!-- label="箱体编码"--> |
|
58 |
<!-- align="center"--> |
|
59 |
<!-- width="160">--> |
|
60 |
<!-- <template slot-scope="scope">{{ scope.row.sfcCode }}</template>--> |
|
61 |
<!-- </el-table-column>--> |
|
62 |
<!-- <el-table-column--> |
|
63 |
<!-- prop="name"--> |
|
64 |
<!-- align="center"--> |
|
65 |
<!-- label="工位"--> |
|
66 |
<!-- width="120">--> |
|
67 |
<!-- <template slot-scope="scope">{{ scope.row.locationCode }}</template>--> |
|
68 |
<!-- </el-table-column>--> |
|
69 |
<!-- <el-table-column--> |
|
70 |
<!-- prop="address"--> |
|
71 |
<!-- align="center"--> |
|
72 |
<!-- label="参数名"--> |
|
73 |
<!-- show-overflow-tooltip>--> |
|
74 |
<!-- <template slot-scope="scope">{{ scope.row.paramName }}</template>--> |
|
75 |
<!-- </el-table-column>--> |
|
76 |
<!-- <el-table-column--> |
|
77 |
<!-- prop="address"--> |
|
78 |
<!-- label="采集结果"--> |
|
79 |
<!-- align="center"--> |
|
80 |
<!-- show-overflow-tooltip>--> |
|
81 |
<!-- <template slot-scope="scope">{{ scope.row.paramValue }}</template>--> |
|
82 |
<!-- </el-table-column>--> |
|
83 |
<!-- <el-table-column--> |
|
84 |
<!-- prop="address"--> |
|
85 |
<!-- label="单位"--> |
|
86 |
<!-- align="center"--> |
|
87 |
<!-- show-overflow-tooltip>--> |
|
88 |
<!-- <template slot-scope="scope">{{ scope.row.unit }}</template>--> |
|
89 |
<!-- </el-table-column>--> |
|
90 |
<!-- <el-table-column--> |
|
91 |
<!-- prop="address"--> |
|
92 |
<!-- label="时间"--> |
|
93 |
<!-- align="center"--> |
|
94 |
<!-- show-overflow-tooltip>--> |
|
95 |
<!-- <template slot-scope="scope">{{ scope.row.createTime }}</template>--> |
|
96 |
<!-- </el-table-column>--> |
|
97 |
</el-table> |
|
98 |
</template> |
|
99 |
|
|
100 |
<script> |
|
101 |
export default { |
|
102 |
name: "report5", |
|
103 |
props:['list5'], |
|
104 |
data() { |
|
105 |
return { |
|
106 |
total: '', |
|
107 |
queryParams: { |
|
108 |
pageNum: 5, |
|
109 |
pageSize: 5 |
|
110 |
}, |
|
111 |
tableData: [{ |
|
112 |
date: '2016-05-03', |
|
113 |
name: '王小虎', |
|
114 |
address: '上海市普陀区金沙江路 1518 弄' |
|
115 |
}, { |
|
116 |
date: '2016-05-02', |
|
117 |
name: '王小虎', |
|
118 |
address: '上海市普陀区金沙江路 1518 弄' |
|
119 |
}, { |
|
120 |
date: '2016-05-04', |
|
121 |
name: '王小虎', |
|
122 |
address: '上海市普陀区金沙江路 1518 弄' |
|
123 |
}, { |
|
124 |
date: '2016-05-01', |
|
125 |
name: '王小虎', |
|
126 |
address: '上海市普陀区金沙江路 1518 弄' |
|
127 |
}, { |
|
128 |
date: '2016-05-08', |
|
129 |
name: '王小虎', |
|
130 |
address: '上海市普陀区金沙江路 1518 弄' |
|
131 |
}, { |
|
132 |
date: '2016-05-06', |
|
133 |
name: '王小虎', |
|
134 |
address: '上海市普陀区金沙江路 1518 弄' |
|
135 |
}, { |
|
136 |
date: '2016-05-07', |
|
137 |
name: '王小虎', |
|
138 |
address: '上海市普陀区金沙江路 1518 弄' |
|
139 |
}], |
|
140 |
multipleSelection: [] |
|
141 |
} |
|
142 |
}, |
|
143 |
methods: { |
|
144 |
toggleSelection(rows) { |
|
145 |
if (rows) { |
|
146 |
rows.forEach(row => { |
|
147 |
this.$refs.multipleTable.toggleRowSelection(row); |
|
148 |
}); |
|
149 |
} else { |
|
150 |
this.$refs.multipleTable.clearSelection(); |
|
151 |
} |
|
152 |
}, |
|
153 |
handleSelectionChange(val) { |
|
154 |
this.multipleSelection = val; |
|
155 |
}, |
|
156 |
getList(){ |
|
157 |
|
|
158 |
}, |
|
159 |
// 日期格式化 |
|
160 |
parseTime(time, pattern) { |
|
161 |
if (arguments.length === 0 || !time) { |
|
162 |
return null |
|
163 |
} |
|
164 |
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}' |
|
165 |
let date |
|
166 |
if (typeof time === 'object') { |
|
167 |
date = time |
|
168 |
} else { |
|
169 |
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { |
|
170 |
time = parseInt(time) |
|
171 |
} else if (typeof time === 'string') { |
|
172 |
time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.[\d]{3}/gm), ''); |
|
173 |
} |
|
174 |
if ((typeof time === 'number') && (time.toString().length === 10)) { |
|
175 |
time = time * 1000 |
|
176 |
} |
|
177 |
date = new Date(time) |
|
178 |
} |
|
179 |
const formatObj = { |
|
180 |
y: date.getFullYear(), |
|
181 |
m: date.getMonth() + 1, |
|
182 |
d: date.getDate(), |
|
183 |
h: date.getHours(), |
|
184 |
i: date.getMinutes(), |
|
185 |
s: date.getSeconds(), |
|
186 |
a: date.getDay() |
|
187 |
} |
|
188 |
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => { |
|
189 |
let value = formatObj[key] |
|
190 |
// Note: getDay() returns 0 on Sunday |
|
191 |
if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] } |
|
192 |
if (result.length > 0 && value < 10) { |
|
193 |
value = '0' + value |
|
194 |
} |
|
195 |
return value || 0 |
|
196 |
}) |
|
197 |
return time_str |
|
198 |
} |
|
199 |
} |
|
200 |
} |
|
201 |
</script> |
|
202 |
|
|
203 |
<style scoped> |
|
204 |
|
|
205 |
</style> |