web-zk-admin/src/views/configManage/bonus/fdfh.vue

207 lines
4.5 KiB
Vue
Raw Normal View History

2025-03-23 10:03:12 +08:00
<template>
<div class="page">
<topBar
v-if="topList.length > 0"
:topList="topList"
:moren="moren"
></topBar>
<div class="main">
<div class="maintable">
<el-table
:data="tableData"
style="width: 100%"
:header-cell-style="{ background: '#EEEEEE' }"
:row-class-name="tableRowClassName"
>
<el-table-column
width="200px"
align="center"
prop="awardsName"
2025-05-26 10:41:35 +08:00
:label="'真实奖衔'"
2025-03-23 10:03:12 +08:00
>
</el-table-column>
2025-05-26 10:41:35 +08:00
<el-table-column align="center" prop="coachAlgebra" :label="'辅导代数'">
2025-03-23 10:03:12 +08:00
<template slot-scope="scope">
<el-input clearable
:disabled="ifupdate"
v-model="scope.row.coachAlgebra"
></el-input>
</template>
</el-table-column>
2025-05-26 10:41:35 +08:00
<el-table-column align="center" prop="coachRatio" :label="'辅导比例' +'(%)'">
2025-03-23 10:03:12 +08:00
<template slot-scope="scope">
<el-input clearable
:disabled="ifupdate"
v-model="scope.row.coachRatio"
></el-input>
</template>
</el-table-column>
<el-table-column
align="center"
prop="abonusRatio"
2025-05-26 10:41:35 +08:00
:label="'分红比例' +'(%)'"
2025-03-23 10:03:12 +08:00
>
<template slot-scope="scope">
<el-input clearable
:disabled="ifupdate"
v-model="scope.row.abonusRatio"
></el-input>
</template>
</el-table-column>
</el-table>
</div>
</div>
<div class="footer">
<div style="margin: 0 auto">
<el-button class="thebtn btn1" @click="ifupdate = false"
2025-05-26 10:41:35 +08:00
>{{'修改'}}</el-button
2025-03-23 10:03:12 +08:00
>
2025-05-26 10:41:35 +08:00
<el-button class="thebtn btn2" @click="savedate">{{ '保存' }}</el-button>
2025-03-23 10:03:12 +08:00
</div>
</div>
</div>
</template>
<script>
import topBar from "@/components/topBar";
import { getcoachBonusList, updateCoachBonus } from "@/api/bonus";
export default {
name: "Fdfh",
components: {
topBar,
},
data() {
return {
moren: "fdfh",
topList: [
{
2025-06-08 15:32:44 +08:00
name: '奖项配置',
2025-03-23 10:03:12 +08:00
path: "bonus",
},
{
2025-06-08 15:32:44 +08:00
name: '直推配置',
2025-03-23 10:03:12 +08:00
path: "ztpz",
},
{
2025-06-08 15:32:44 +08:00
name: '拓展配置',
2025-03-23 10:03:12 +08:00
path: "kzpz",
},
{
2025-06-08 15:32:44 +08:00
name: '辅导分红',
2025-03-23 10:03:12 +08:00
path: "fdfh",
},
{
2025-06-08 15:32:44 +08:00
name: '服务补贴',
2025-03-23 10:03:12 +08:00
path: "fwbt",
},
{
2025-06-08 15:32:44 +08:00
name: '奖金扣项',
2025-03-23 10:03:12 +08:00
path: "jjkx",
},
{
2025-06-08 15:32:44 +08:00
name: '云代配置',
2025-03-23 10:03:12 +08:00
path: "ydpz",
},
{
2025-06-08 15:32:44 +08:00
name: '环球积分',
2025-03-23 10:03:12 +08:00
path: "hqjf",
},
{
2025-06-08 15:32:44 +08:00
name: '车奖积分',
2025-03-23 10:03:12 +08:00
path: "njjf",
},
],
tableData: [],
ifupdate: true,
};
},
created() {
this.getcoachBonusList();
},
methods: {
getcoachBonusList() {
getcoachBonusList().then((res) => {
this.tableData = res.rows;
});
},
//保存
savedate() {
this.ifupdate = true;
updateCoachBonus({awardsList:this.tableData}).then((res) => {
if (res.code == 200) {
this.$message({
message: res.msg,
type: "success",
});
} else {
this.$message({
message: res.msg,
type: "warning",
});
}
this.getcoachBonusList();
});
},
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 == 1) {
return "warning-row";
} else if (rowIndex % 2 == 0) {
return "success-row";
}
return "";
},
},
};
</script>
<style lang="scss" scoped>
::v-deep .el-table thead {
color: #000000;
}
::v-deep .el-table .warning-row {
background: #f9f9f9;
}
::v-deep .el-input__inner {
width: 160px !important;
}
::v-deep .el-table .success-row {
background: #ffffff;
}
.page {
padding: 20px 20px 36px 20px;
background: #f9f9f9;
font-size: 14px;
.main {
background: #ffffff;
box-shadow: 0px 2px 20px 0px rgba(238, 238, 238, 0.5);
border-radius: 8px;
.maintable {
max-height: 710px;
overflow: auto;
}
}
.footer {
display: flex;
margin-top: 20px;
.thebtn {
width: 120px;
height: 48px;
color: #ffffff;
font-size: 14px;
font-weight: bold;
}
.btn1 {
background: #4391fd;
margin-right: 80px;
}
.btn2 {
background: #ffad41;
}
}
}
</style>