<el-table-column
v-for="item in confirmHead"
:key="item.label"
:label="item.label"
:prop="item.prop"
:width="item.width"
align="center"
show-overflow-tooltip
>
<template slot-scope="scope">
<span v-if="item.status">
<el-tag v-if="scope.row.qcState == 0" type="danger"
>未验收</el-tag
>
<el-tag v-else type="success">已完成</el-tag>
</span>
<span v-else-if="item.houseListFormat">
<span v-text="houseListFormat(scope.row, scope)"> </span>
</span>
<span v-else>{{ scope.row[item.prop] }}</span>
</template>
</el-table-column>
rowspanLabels: [
"单据状态",
'问题类型',
],
tableHeads: [
{
label: "单据状态",
prop: "qcState",
visible: false,
setting: true,
arry: false,
status: true,
width: "140",
},
{
label: "问题类型",
prop: "problemDesc",
visible: false,
setting: true,
width: "auto",
arry: false,
width: "200",
houseListFormat:true
},
],
methods:{
// // 问题类型数据处理
houseListFormat(row, column) {
var arr = [];
var problemDesc = row.problemDesc.split(",").map(Number);
problemDesc.forEach((itemList) => {
this.qcType.forEach((item) => {
if (itemList == item.qcTypeId) {
return arr.push(item.rmark);
}
});
});
return arr.join(",");
},
}
element+vue之table 动态表格上处理formatter写法
于 2021-11-27 11:41:54 首次发布