<template>
|
<el-table
|
ref="multipleTable"
|
:data="list5"
|
height="300"
|
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">
|
</el-table-column>
|
<el-table-column label="总成序列号" align="center" prop="sfcCode">
|
</el-table-column>
|
<el-table-column label="产品编号" align="center" prop="productCode">
|
</el-table-column>
|
<el-table-column label="产线编号" align="center" prop="productionLine">
|
</el-table-column>
|
<el-table-column label="工位编号" align="center" prop="locationCode">
|
</el-table-column>
|
<el-table-column label="入站时间" align="center" prop="inboundTime" width="100">
|
<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="100">
|
<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="180">
|
<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>
|