web-retail-admin/src/views/configManage/bonus/ydpz.vue

134 lines
2.9 KiB
Vue
Raw Normal View History

2025-03-23 10:03:12 +08:00
<template>
<div class="page">
<topBar
v-if="topList.length > 0"
:top-list="topList"
2025-03-23 10:03:12 +08:00
:moren="moren"
/>
2025-03-23 10:03:12 +08:00
<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="cloudTypeVal" :label="'云代收益'" />
<el-table-column align="center" prop="cloudRatio" :label="'比例'+'(%)'">
2025-03-23 10:03:12 +08:00
<template slot-scope="scope">
<el-input v-model="scope.row.cloudRatio" clearable :disabled="ifupdate" />
2025-03-23 10:03:12 +08:00
</template>
</el-table-column>
</el-table>
</div>
</div>
<div class="footer">
<div style="margin: 0 auto">
2025-05-26 10:41:35 +08:00
<el-button class="thebtn btn1" @click="ifupdate=false"> {{ '修改' }}</el-button>
<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 { getCloudList, updateCloud } from '@/api/bonus'
import { mixin } from './mixins'
2025-03-23 10:03:12 +08:00
export default {
name: 'Ydpz',
2025-03-23 10:03:12 +08:00
components: {
topBar
2025-03-23 10:03:12 +08:00
},
mixins: [mixin],
2025-03-23 10:03:12 +08:00
data() {
return {
moren: 'ydpz',
2025-03-23 10:03:12 +08:00
tableData: [],
ifupdate: true
}
2025-03-23 10:03:12 +08:00
},
created() {
2025-03-23 10:03:12 +08:00
this.getCloudList()
},
methods: {
getCloudList() {
getCloudList().then(res => {
this.tableData = res.rows
})
2025-03-23 10:03:12 +08:00
},
// 保存
savedate() {
2025-03-23 10:03:12 +08:00
this.ifupdate = true
updateCloud({ bonusCloudList: this.tableData }).then(res => {
2025-03-23 10:03:12 +08:00
if (res.code == 200) {
this.$message({
message: res.msg,
type: 'success'
})
2025-03-23 10:03:12 +08:00
} else {
this.$message({
message: res.msg,
type: 'warning'
})
2025-03-23 10:03:12 +08:00
}
this.getCloudList()
})
},
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 == 1) {
return 'warning-row'
2025-03-23 10:03:12 +08:00
} else if (rowIndex % 2 == 0) {
return 'success-row'
2025-03-23 10:03:12 +08:00
}
return ''
}
}
}
2025-03-23 10:03:12 +08:00
</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: 12%!important;
}
::v-deep .el-table .success-row {
background: #ffffff;
}
.page {
padding: 20px;
background: #f9f9f9;
font-size: 14px;
.main {
background: #ffffff;
border-radius: 8px;
box-shadow: 0px 2px 20px 0px rgba(238, 238, 238, 0.5);
}
.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>