统计报表 表格表头显示调整

menu1.0
郭承 2 months ago
parent d60bf45bad
commit 1407bb8239

@ -83,14 +83,23 @@
<el-table-column prop='hours' label="预计拍照" width="100px" align="center">
<template slot-scope="scope">
<span>{{ scope.row.hours.length * 2 }}</span>
<!-- <el-tooltip placement="top">
<div slot="content">{{scope.row.hours.length}}</div>
<span>{{ scope.row.hours.length * 2 }}</span>
</el-tooltip> -->
</template>
</el-table-column>
<el-table-column prop='total' label="拍照总数" width="100px" align="center"></el-table-column>
<el-table-column prop='presets' label="多出数量" width="100px" align="center">
<template #default="{ row }">
<el-tooltip placement="top" popper-class="eltooltip">
<div slot="content">{{handlePresetsMany(row).txt}}</div>
<span>{{handlePresetsMany(row).number}}</span>
</el-tooltip>
</template>
</el-table-column>
<el-table-column prop='total' label="拍照总数" width="100px"
align="center"></el-table-column>
<el-table-column prop='presets' label="多出图片" :formatter="handlePresetsMany"
min-width="35%"></el-table-column>
<el-table-column prop='presets' label="缺少图片" :formatter="handlePresetsFew"
min-width="65%"></el-table-column>
<el-table-column prop='' label='缺少数量' width="100px" :formatter="countLackPicture" align="center"></el-table-column>
<el-table-column prop='presets' label="缺少图片详细时间点" :formatter="handlePresetsFew" min-width="65%"></el-table-column>
</el-table>
</template>
@ -196,31 +205,30 @@ export default {
},
methods: {
//
handlePresetsMany(row, column, cellValue) {
handlePresetsMany(row) {
let result = {txt: "" , number: 0};
if (row.wrongCount == 0) {
return "无";
return result;
} else {
var txt = "";
row.hours.forEach(data => {
if (data.base < data.timeList.length) {
let hour = parseInt(data.hour.substring(11, 13));
txt += hour + "点" + data.wrongDetail + "张 , ";
return;
result.txt += hour + "点" + data.wrongDetail + "张 , ";
result.number += data.timeList.length - data.base;
}
});
if ("" == txt) {
return "无";
} else {
return txt;
}
if (result.txt=="") {
result.txt = "无";
}
return result;
},
//
handlePresetsFew(row, column, cellValue) {
if (row.wrongCount == 0) {
return "无";
} else {
var txt = "";
let txt = "";
row.hours.forEach(data => {
if (data.base > data.timeList.length) {
let hour = data.hour.substring(11, 13);
@ -237,12 +245,11 @@ export default {
}
});
if (xi == 0) {
txt += hour + ":00点少1张 , ";
txt += hour + ":00 , ";
}
if (da == 0) {
txt += hour + ":30点少1张 , ";
txt += hour + ":30 , ";
}
return;
}
});
if ("" == txt) {
@ -252,6 +259,20 @@ export default {
}
}
},
//
countLackPicture(row, column, cellValue){
let number = 0;
if (row.wrongCount == 0) {
return number;
} else {
row.hours.forEach(data => {
if (data.base > data.timeList.length) {
number += data.base - data.timeList.length;
}
});
}
return number;
},
setDefaultImage(e) {
e.target.src = defaultImage;
},
@ -390,6 +411,7 @@ export default {
a.presetList = presetList;
});
this.picList = dataList;
console.log(dataList);
this.loading = false;
// console.log(res.data);
}).catch((err) => {
@ -605,5 +627,10 @@ export default {
}
}
}
}
.eltooltip{
max-width:50%;
}
</style>
Loading…
Cancel
Save