全岗位

This commit is contained in:
zhangsir
2024-06-24 20:53:11 +08:00
parent 94de112f49
commit 9c198f52a3

View File

@@ -193,17 +193,17 @@
<span>当前路径</span>
</div>
<div class="otherImg">
<img src="../../assets/images/growth/OtherPath.png" alt="">
<img src="../../assets/images/growth/NoPermissionPath.png" alt="">
<span>其他路径</span>
</div>
<div class="otherImg">
<img src="../../assets/images/growth/NoPermissionPath.png" alt="">
<img src="../../assets/images/growth/OtherPath.png" alt="">
<span>其他路径无权限</span>
</div>
</span>
<el-table :data="gridData" border :span-method="arraySpanMethod" style="width: 100%">
<el-table-column fixed align="center" property="name" width="120" label=""></el-table-column>
<el-table-column align="center" label="band1">
<!-- <el-table :data="pathData.growFullPositionPathBoItemList" border :span-method="arraySpanMethod" style="width: 100%">
<el-table-column fixed align="center" property="bandCodes" width="120" label=""></el-table-column>
<el-table-column align="center" v-for="item in titleList" :label="item.props">
<template slot-scope="scope">
<span v-if="scope.row.marketStatus === 0"><img src="../../assets/images/growth/CurrentPath.png" alt=""></span>
<span v-else-if="scope.row.marketStatus === 1">
@@ -212,46 +212,40 @@
<span v-else><img src="../../assets/images/growth/NoPermissionPath.png" alt=""></span>
</template>
</el-table-column>
<el-table-column align="center" label="band2">
</el-table> -->
<!-- <el-table :data="preparedData" border style="width: 100%">
<el-table-column fixed align="center" property="organizationName" width="120" label=""></el-table-column>
<el-table-column v-for="(column, index) in preparedData.bandCodes" :key="index" :label="column.growId" align="center">
<template slot-scope="scope">
<span v-if="scope.row.saleStatus === 0"><img src="../../assets/images/growth/CurrentPath.png" alt=""></span>
<span v-else-if="scope.row.saleStatus === 1">
<img src="../../assets/images/growth/OtherPath.png" alt="">
<span v-if="scope.row[column.statusKey] == 1">
<div>职位名称{{ scope.row.positionName }}, 组织名称{{ scope.row.organizationName }}</div>
</span>
<span v-else>
<div>职位名称{{ scope.row.positionName }}, 组织名称{{ scope.row.organizationName }}</div>
</span>
<span v-else><img src="../../assets/images/growth/NoPermissionPath.png" alt=""></span>
</template>
</el-table-column>
<el-table-column align="center" label="band3">
<template slot-scope="scope">
<span v-if="scope.row.productStatus === 0"><img src="../../assets/images/growth/CurrentPath.png"
alt=""></span>
<span v-else-if="scope.row.productStatus === 1">
<img src="../../assets/images/growth/OtherPath.png" alt="">
</span>
<span v-else><img src="../../assets/images/growth/NoPermissionPath.png" alt=""></span>
</template>
</el-table-column>
<el-table-column align="center" label="band4">
<template slot-scope="scope">
<span v-if="scope.row.FAEStatusL === 0"><img src="../../assets/images/growth/CurrentPath.png" alt=""></span>
<span v-else-if="scope.row.FAEStatusL === 1">
<img src="../../assets/images/growth/OtherPath.png" alt="">
</span>
<span v-else><img src="../../assets/images/growth/NoPermissionPath.png" alt=""></span>
</template>
</el-table-column>
<el-table-column align="center" label="band5">
<template slot-scope="scope">
<span v-if="scope.row.salesManagement === 0"><img src="../../assets/images/growth/CurrentPath.png"
alt=""></span>
<span v-else-if="scope.row.salesManagement === 1">
<img src="../../assets/images/growth/OtherPath.png" alt="">
</span>
<span v-else><img src="../../assets/images/growth/NoPermissionPath.png" alt=""></span>
</template>
</el-table-column>
</el-table>
</el-table> -->
<div class="table_box">
<div class="title">
<div v-for="title,index in titleList">
<div class="title_item">{{ title.title }}</div>
</div>
</div>
<div class="body" v-for="(item,index) in preparedData">
<div>
<div class="body_left" :title="item.isOtherPosition == 1 ? item.positionName + '(' + item.organizationName + ')' : item.positionName">{{ item.isOtherPosition == 1 ? item.positionName + '(' + item.organizationName + ')' : item.positionName }}</div>
</div>
<div class="body_right">
<div class="body_item" v-for="t,i in item.bandCodes">
<img v-if="(t && t.isMajorPosition) " src="../../assets/images/growth/CurrentPath.png" alt="">
<img v-else-if="(t && t.permission)" src="../../assets/images/growth/NoPermissionPath.png" alt="">
<img v-else-if="!(t && t.permission)" src="../../assets/images/growth/OtherPath.png" alt="">
<span v-else></span>
</div>
</div>
</div>
</div>
</el-dialog>
<el-drawer title="信息概况" :visible="drawer" size="40%">
<div style="padding:0 40px;">
@@ -264,7 +258,7 @@
</div>
</el-drawer>
<el-backtop :bottom="700" :right="200">
<el-backtop :bottom="700" :right="200" visibility-height="700">
<div class="back-to-top">
<div class="img"></div>
<div class="text">继续学习之旅</div>
@@ -409,6 +403,9 @@ export default {
FAEStatusL: 0,
salesManagement: 1
}],
pathData: [],
titleList: [],
preparedData: [],
drawer: false,
activeName: 'first',
};
@@ -440,10 +437,49 @@ export default {
}
})
getFullJobPath().then(res=>{
console.log(res,'res')
if(res.code == 200){
this.pathData = res.data
this.titleList = this.pathData.allBandCodeList
this.preparedData = this.integrateTableData(this.pathData);
this.titleList = this.titleList.map(item=>({
title: item,
}))
this.titleList.unshift({
title: ''
})
// console.log(this.pathData.growFullPositionPathBoItemList,'pathData')
console.log(this.titleList,'titleList')
}
})
},
methods: {
integrateTableData(data) {
const { growFullPositionPathBoItemList, allBandCodeList } = data;
const bandCodeIndexMap = new Map(allBandCodeList.map((code, index) => [code, index]));
const integratedDataMap = new Map();
growFullPositionPathBoItemList.flat().forEach(item => {
const key = `${item.positionName}-${item.organizationName}-${item.isOtherPosition}`;
if (!integratedDataMap.has(key)) {
integratedDataMap.set(key, {
positionName: item.positionName,
organizationName: item.organizationName,
isOtherPosition: item.isOtherPosition,
bandCodes: new Array(allBandCodeList.length).fill(null),
});
}
item.bandCodes.split(',').forEach(code => {
const codeTrimmed = code.trim();
const index = bandCodeIndexMap.get(codeTrimmed);
if (index !== undefined) {
integratedDataMap.get(key).bandCodes[index] = { growId: item.growId, permission: item.permission ,isMajorPosition:item.isMajorPosition };
}
});
});
const integratedDataArray = Array.from(integratedDataMap.values());
console.log(integratedDataArray,'integratedDataArray')
return integratedDataArray;
},
toggleFlag() {
this.flagToggle = this.flagToggle === 2 ? 3 : 2;
this.flagToggleTwo = this.flagToggleTwo === 2 ? 3 : 2;
@@ -682,6 +718,54 @@ export default {
</script>
<style scoped lang="scss">
.table_box{
// width: 100%;
overflow-x: auto;
border: 1px solid #F0F6FC;
border-radius: 4px 4px 0px 0px;
.title{
display: flex;
.title_item{
background: #F0F6FC;
width: 142px;
height: 88px;
line-height: 88px;
text-align: center;
border: 1px solid #F0F6FC;
font-weight: 500;
font-size: 16px;
color: #333333;
}
}
.body{
display: flex;
.body_left{
padding: 0 2px;
width: 142px;
height: 88px;
border: 1px solid #F0F6FC;
line-height: 88px;
text-align: center;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-weight: 500;
font-size: 16px;
color: #333333;
}
.body_right{
display: flex;
.body_item{
width: 142px;
height: 88px;
border: 1px solid #F0F6FC;
line-height: 88px;
text-align: center;
}
}
}
}
.back-to-top{
display: flex;
justify-content: center;