Commit de5bbf9f authored by 黄奎's avatar 黄奎

页面修改

parent 7e5cc45b
......@@ -142,7 +142,34 @@
<el-table :data="tableData" style="width: 100%" ref="table" :fit='true'
:default-sort="{prop: 'date', order: 'descending'}">
<template v-for="(item, index) in tableHeader">
<template v-if="index=='EmployeeName'">
<template v-if="item.label=='员工'">
<el-table-column :prop="item.prop" :label="item.label" fixed="left" width="70" :key="index">
</el-table-column>
</template>
<template v-if="item.label=='合计回单'||item.label=='合计到访'||item.label=='合计转化率'">
<el-table-column :prop="item.prop" :label="item.label" fixed="right" sortable width="70" :key="index">
</el-table-column>
</template>
<template v-if="item.SubList&&item.SubList.length>0">
<template v-if="item.label!='合计'">
<el-table-column :label="item.label" width="70" :key="index">
<template v-for="(subItem,subIndex) in item.SubList">
<el-table-column :prop="subItem.prop" :label="subItem.label" width="70" :key="subIndex">
</el-table-column>
</template>
</el-table-column>
</template>
<template v-else>
<el-table-column :label="item.label" :key="index" fixed="right">
<template v-for="(subItem,subIndex) in item.SubList">
<el-table-column :prop="subItem.prop" :label="subItem.label" fixed="right" :key="subIndex">
</el-table-column>
</template>
</el-table-column>
</template>
</template>
<!-- <template v-if="index=='EmployeeName'">
<el-table-column :prop="index" :label="item" fixed="left" width="70" :key="index">
</el-table-column>
</template>
......@@ -153,7 +180,7 @@
<template v-else>
<el-table-column :prop="index" :label="item" sortable width="80" :key="index">
</el-table-column>
</template>
</template> -->
</template>
</el-table>
</div>
......@@ -177,12 +204,11 @@
dateList: [],
dataList: [],
EmployeeList: [],
tableHeader: {
EmployeeName: "员工",
},
tableData: [{
tableHeader: [{
prop: "EmployeeName",
label: "员工"
}],
tableData: [],
pickerOptions0: {
disabledDate(time) {
return time.getTime() > Date.now() - 8.64e6
......@@ -253,17 +279,49 @@
var tempArray = res.Data;
if (tempArray && tempArray.length > 0) {
tempArray.forEach((item, index) => {
if (item.subList && item.subList.length > 0) {
item.subList.forEach((subItem, subIndex) => {
this.tableHeader['ClueCount' + subIndex] = subItem.ChannelName + "回单";
this.tableHeader['VisitCount' + subIndex] = subItem.ChannelName + "到访";
this.tableHeader['Rates' + subIndex] = subItem.ChannelName + "转化率";
})
if (index == 0) {
if (item.subList && item.subList.length > 0) {
item.subList.forEach((subItem, subIndex) => {
if (subItem.ChannelName == '合计') {
this.tableHeader.push({
prop: 'ClueCount' + subIndex,
label: subItem.ChannelName + "回单"
})
this.tableHeader.push({
prop: 'VisitCount' + subIndex,
label: subItem.ChannelName + "到访"
})
this.tableHeader.push({
prop: 'Rates' + subIndex,
label: subItem.ChannelName + "转化率"
})
} else {
var subData = {
label: subItem.ChannelName,
prop: "",
SubList: [{
prop: 'ClueCount' + subIndex,
label: "回单"
},
{
prop: 'VisitCount' + subIndex,
label: "到访"
},
{
prop: 'Rates' + subIndex,
label: "转化率"
},
]
};
this.tableHeader.push(subData)
}
})
}
}
this.tableData.push(item.dicList)
});
}
this.dataList = res.Data;
}
});
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment