feat(vertexAwardConfig): 添加体系奖项配置列表

This commit is contained in:
woody 2025-07-10 13:41:14 +08:00
parent d7ede8ce75
commit 4f113e8178
7 changed files with 375 additions and 7 deletions

View File

@ -1,9 +1,4 @@
/*
* @Descripttion:
* @version:
* @Author: kBank
* @Date: 2023-03-21 09:00:28
*/
import request from '@/utils/request' import request from '@/utils/request'
// 统计 // 统计
export function getstaAmountBox(params) { export function getstaAmountBox(params) {

8
src/api/enums.js Normal file
View File

@ -0,0 +1,8 @@
import request from '@/utils/request'
export function getVertexAwardBonusOptions() {
return request({
url: `/system/pub/enums/vertex-bonus-items`,
method: 'get'
})
}

24
src/api/vertex.js Normal file
View File

@ -0,0 +1,24 @@
import request from '@/utils/request'
export function getVertexAwardConfiguration() {
return request({
url: '/system/manage/vertex-bonus/list',
method: 'get'
})
}
export function saveVertexAwardConfiguration(data) {
return request({
url: '/system/manage/vertex-bonus/save',
method: 'post',
data
})
}
export function delVertexAwardConfiguration(pkId) {
return request({
url: `/system/manage/vertex-bonus/${pkId}`,
method: 'delete'
})
}

View File

@ -96,7 +96,7 @@ export default {
that.getJScountry() that.getJScountry()
// //
that.getLanguages() that.getLanguages()
that.getSystem() // that.getSystem()
}, 10) }, 10)
this.systemItem = localStorage.getItem('systemItem') || 2 this.systemItem = localStorage.getItem('systemItem') || 2

View File

@ -1681,6 +1681,12 @@ export const constantRoutes = [
name: 'GroupConfigurationList', name: 'GroupConfigurationList',
component: () => import('@/views/configManage/systemconfiguration/groupConfiguration'), component: () => import('@/views/configManage/systemconfiguration/groupConfiguration'),
meta: { title: '区域体系分组' } meta: { title: '区域体系分组' }
},
{
path: 'vertexAwardConfiguration',
name: 'VertexAwardConfiguration',
component: () => import('@/views/configManage/systemconfiguration/VertexAwardConfiguration'),
meta: { title: '体系奖项配置' }
} }
] ]
}, },

View File

@ -0,0 +1,330 @@
<template>
<div class="page">
<topBar
v-if="topList.length > 0"
:top-list="topList"
:moren="moren"
/>
<!-- <div class="thetopbox">
<el-form label-width="auto">
<el-row :gutter="10">
<el-col :span="4">
<el-form-item label="分组名称" prop="name">
<el-input v-model="queryParams.name" clearable />
</el-form-item>
</el-col>
<el-col :span="4">
<div class="searchbox">
<el-button class="delBtn" @click="handleSearch()">
{{ '搜索' }}</el-button>
<el-button @click="reset"> {{ '重置' }}</el-button>
</div>
</el-col>
</el-row>
</el-form>
</div> -->
<div class="main">
<div class="maintop">
<div class="mainbtn">
<el-button
v-hasButtons="['VertexAwardConfigurationAdd']"
size="small"
class="thebtn1"
@click="handleAdd()"
>添加</el-button>
</div>
</div>
<div class="maintable">
<el-table
v-loading="loading"
height="740px"
style="width: 100%"
:header-cell-style="{ background: '#EEEEEE' }"
:row-class-name="tableRowClassName"
:data="tableData"
>
>
<el-table-column
align="center"
prop="vertexName"
label="体系名称"
/>
<el-table-column
align="center"
prop="bonusItems"
label="奖项名称"
>
<template slot-scope="scope">
<span>
{{ getBonusItemByEnumKey(scope.row.bonusItems) }}
</span>
</template>
</el-table-column>
<el-table-column
align="center"
prop="time"
:label="'操作'"
fixed="right"
>
<template slot-scope="scope">
<el-button
v-hasButtons="['VertexAwardConfigurationDel']"
class="button-s"
type="text"
size="small"
style="color: #c73030"
@click.native.prevent="deleteRow(scope.row)"
>
{{ '删除' }}
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<el-dialog
:close-on-click-modal="false"
:visible.sync="updateDialogVisibe"
title="新增"
width="500px"
@close="handleClose"
>
<el-form ref="formRef" :model="form" :rules="rules" label-width="100px">
<el-form-item label="选择体系" prop="pkVertex">
<el-select v-model="form.pkVertex" placeholder="请选择体系">
<el-option v-for="item in vertexList" :key="item.pkId" :label="item.vertexName" :value="item.pkId" />
</el-select>
</el-form-item>
<el-form-item label="奖项名称" prop="bonusItems">
<el-select v-model="form.bonusItems" placeholder="请选择奖项名称">
<el-option v-for="item in vertexAwardBonusOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
</el-form>
<div class="footer" style="text-align: center; margin-top: 20px">
<el-button @click="updateDialogVisibe = false">取消</el-button>
<el-button type="primary" @click="handleConfirm">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import topBar from '@/components/topBar/checked.vue'
import { topList } from './mixins'
import { getRouters } from '@/api/settle'
import {
getVertexAwardConfiguration,
saveVertexAwardConfiguration,
delVertexAwardConfiguration
} from '@/api/vertex'
import { getVertexAwardBonusOptions } from '@/api/enums'
import { getvertexValue } from '@/api/member'
export default {
name: 'VertexAwardConfiguration',
components: {
topBar
},
data() {
return {
form: {
pkVertex: null,
bonusItems: null
},
rules: {
pkVertex: [{ required: true, message: '请选择体系', trigger: 'change' }],
bonusItems: [{ required: true, message: '请选择奖项名称', trigger: 'change' }]
},
total: 0,
moren: 'vertexAwardConfiguration',
topList: topList,
tableData: [],
loading: false,
queryParams: {
pageNum: 1,
pageSize: 50
},
updateDialogVisibe: false,
vertexAwardBonusOptions: [],
vertexList: []
}
},
created() {
this.getList()
this.getUserRoute()
this.getVertexAwardBonusOptions()
this.getvertexValue()
},
methods: {
getVertexAwardBonusOptions() {
getVertexAwardBonusOptions().then((res) => {
this.vertexAwardBonusOptions = res.data
})
},
getvertexValue() {
getvertexValue().then((res) => {
this.vertexList = res.data
})
},
getBonusItemByEnumKey(enumKey) {
return this.vertexAwardBonusOptions.find((item) => item.value === enumKey)?.label || ''
},
getUserRoute() {
getRouters().then((res) => {
console.log(res.data, 'res.data', this.topList)
res.data.forEach((item) => {
this.topList.forEach((items) => {
if (item.routeName == items.url) {
this.$set(items, 'changed', true)
}
})
})
})
},
// reset() {
// this.queryParams.pageNum = 1
// this.queryParams.name = ''
// this.getList()
// },
// handleSearch() {
// this.queryParams.pageNum = 1
// this.getList()
// },
getList() {
this.loading = true
getVertexAwardConfiguration({
...this.queryParams,
name: this.queryParams.name || undefined
}).then((res) => {
this.tableData = res.rows
this.total = res.total
this.loading = false
})
},
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 == 1) {
return 'warning-row'
} else if (rowIndex % 2 == 0) {
return 'success-row'
}
return ''
},
handleAdd() {
this.updateDialogVisibe = true
},
handleConfirm() {
this.$refs.formRef.validate((valid) => {
if (valid) {
saveVertexAwardConfiguration(this.form).then((res) => {
if (res.code !== 200) return
this.updateDialogVisibe = false
this.getList()
})
}
})
},
deleteRow(row) {
this.$confirm('确定删除该条配置吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delVertexAwardConfiguration(row.pkId).then((res) => {
if (res.code !== 200) return
this.getList()
})
})
},
handleClose() {
this.form.pkVertex = null
this.form.bonusItems = null
}
}
}
</script>
<style lang="scss" scoped>
::v-deep .el-table .warning-row {
background: #f9f9f9;
}
::v-deep .el-table .success-row {
background: #ffffff;
}
::v-deep .el-table thead {
color: #000000;
}
.page {
padding: 20px;
background: #f9f9f9;
font-size: 14px;
.thetopbox {
padding: 0 20px 0px 20px !important;
background: #ffffff;
border-radius: 8px;
.searchbox {
display: flex;
align-items: center;
.searchtitle {
margin-right: 10px;
}
.searchbtn {
background: #08143f;
color: #ffffff;
}
}
}
.main {
//margin-top: 20px;
background: #f9f9f9;
//border-radius: 8px;
//box-shadow: 0px 2px 20px 0px rgba(238, 238, 238, 0.5);
.maintop {
display: flex;
padding: 0px 0;
justify-content: space-between;
align-items: center;
.mainbtn {
.thebtn1 {
background: #3181e5;
color: #ffffff;
width: 68px;
height: 32px;
}
.thebtn2 {
background: #ffad41;
color: #ffffff;
width: 68px;
height: 32px;
}
}
}
.maintable {
// max-height: 550px;
overflow: auto;
margin-top: 10px;
}
}
}
::v-deep .el-range-editor {
width: auto;
}
::v-deep .el-select {
width: 100%;
}
</style>

View File

@ -8,5 +8,10 @@ export const topList = [
name: '区域体系分组', name: '区域体系分组',
path: 'groupConfiguration', path: 'groupConfiguration',
url: 'GroupConfigurationList' url: 'GroupConfigurationList'
},
{
name: '体系奖项配置',
path: 'vertexAwardConfiguration',
url: 'VertexAwardConfiguration'
} }
] ]