web-zk-admin/src/views/configManage/retailLevel/jxpz.vue

590 lines
16 KiB
Vue
Raw Normal View History

2025-03-23 10:03:12 +08:00
<template>
<div class="page">
<topBar
v-if="topList.length > 0"
2025-06-30 13:26:32 +08:00
:top-list="topList"
2025-03-23 10:03:12 +08:00
:moren="moren"
2025-06-30 13:26:32 +08:00
/>
2025-03-23 10:03:12 +08:00
<div class="main">
<div class="maintop">
<div class="mainbtn">
<el-button
2025-06-30 13:26:32 +08:00
v-hasButtons="['AwardAllocationRetailAdd']"
2025-03-23 10:03:12 +08:00
size="small"
class="thebtn1"
@click="adddate()"
2025-06-30 13:26:32 +08:00
>{{ '添加' }}</el-button>
2025-03-23 10:03:12 +08:00
<!-- <el-button size="small" class="thebtn2">
2025-05-26 10:41:35 +08:00
{{ '导出' }}</el-button
2025-03-23 10:03:12 +08:00
> -->
</div>
</div>
<div class="maintable">
<el-table
2025-06-30 13:26:32 +08:00
v-loading="loading"
2025-03-23 10:03:12 +08:00
height="750px"
:data="tableData"
style="width: 100%"
:header-cell-style="{ background: '#EEEEEE' }"
:row-class-name="tableRowClassName"
@selection-change="handleSelectionChange"
>
2025-06-30 13:26:32 +08:00
<el-table-column type="selection" width="55" />
2025-03-23 10:03:12 +08:00
<el-table-column
align="center"
prop="awardsName"
2025-06-30 13:26:32 +08:00
label="奖衔名称"
/>
<el-table-column width="150" align="center" prop="totalCheck" label="累计业绩" />
<el-table-column width="110" align="center" prop="rangeRatio" label="福利级差比例" />
<el-table-column width="110" align="center" prop="monthRepurchaseRatio" label="复购级差比例" />
2025-03-23 10:03:12 +08:00
<el-table-column
align="center"
prop="benefitAvgRatio"
label="福利平均比例"
width="110"
2025-06-30 13:26:32 +08:00
/>
2025-03-23 10:03:12 +08:00
<el-table-column
align="center"
prop="benefitShareRatio"
label="福利加权比例"
width="110"
2025-06-30 13:26:32 +08:00
/>
<el-table-column
align="center"
prop="shareTotalCheck"
label="分红累计业绩"
/>
<el-table-column width="80" align="center" prop="placeDeptNum" label="部门数量" />
<el-table-column width="150" align="center" prop="shareCommunityCheck" label="分红小部门业绩" />
2025-03-23 10:03:12 +08:00
<el-table-column
align="center"
prop="time"
2025-05-26 10:41:35 +08:00
:label="'操作'"
2025-03-23 10:03:12 +08:00
fixed="right"
2025-06-30 13:26:32 +08:00
width="100"
2025-03-23 10:03:12 +08:00
>
<template slot-scope="scope">
<el-button
2025-06-30 13:26:32 +08:00
v-has-buttons="['AwardAllocationRetailEdit']"
2025-03-23 10:03:12 +08:00
type="text"
size="small"
class="button-s"
style="color: #4391fd"
2025-06-30 13:26:32 +08:00
@click.native.prevent="update(scope.row, tableData)"
2025-03-23 10:03:12 +08:00
>
2025-05-26 10:41:35 +08:00
{{ '修改' }}
2025-03-23 10:03:12 +08:00
</el-button>
<el-button
type="text"
size="small"
class="button-s"
style="color: #c73030"
2025-06-30 13:26:32 +08:00
@click.native.prevent="updateState(scope.row, tableData)"
2025-03-23 10:03:12 +08:00
>
<!-- 0启用1禁用 -->
{{
scope.row.enableState == 1
2025-05-26 10:41:35 +08:00
? '启用'
: '禁用'
2025-03-23 10:03:12 +08:00
}}
</el-button>
<!-- <el-button
class="button-s"
@click.native.prevent="deleteRow(scope.row, tableData)"
type="text"
size="small"
style="color: #c73030"
>
删除
</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="getAwardsList"
/>
<el-dialog
:title="dialogTitle"
:visible.sync="updateShow"
width="50%"
center
:close-on-click-modal="false"
:before-close="handleClose"
>
2025-06-30 13:26:32 +08:00
<el-form ref="form" :rules="rules" :model="form" label-width="140px">
<el-row :gutter="20">
<el-col :span="11">
2025-03-23 10:03:12 +08:00
<el-form-item label="奖衔名称" prop="awardsName">
<el-input
v-model="form.awardsName"
clearable
placeholder=""
2025-06-30 13:26:32 +08:00
/>
2025-03-23 10:03:12 +08:00
</el-form-item>
</el-col>
<el-col :span="11">
2025-06-30 13:26:32 +08:00
<el-form-item label="累计业绩" prop="totalCheck">
2025-03-23 10:03:12 +08:00
<el-input
2025-06-30 13:26:32 +08:00
v-model="form.totalCheck"
2025-03-23 10:03:12 +08:00
clearable
placeholder=""
2025-06-30 13:26:32 +08:00
/>
2025-03-23 10:03:12 +08:00
</el-form-item>
</el-col>
<el-col :span="11">
2025-06-30 13:26:32 +08:00
<el-form-item label="福利级差比例" prop="rangeRatio">
2025-03-23 10:03:12 +08:00
<el-input
2025-06-30 13:26:32 +08:00
v-model="form.rangeRatio"
2025-03-23 10:03:12 +08:00
clearable
placeholder=""
2025-06-30 13:26:32 +08:00
/>
2025-03-23 10:03:12 +08:00
</el-form-item>
</el-col>
<el-col :span="11">
2025-06-30 13:26:32 +08:00
<el-form-item label="复购级差比例" prop="monthRepurchaseRatio">
2025-03-23 10:03:12 +08:00
<el-input
2025-06-30 13:26:32 +08:00
v-model="form.monthRepurchaseRatio"
2025-03-23 10:03:12 +08:00
clearable
placeholder=""
2025-06-30 13:26:32 +08:00
/>
2025-03-23 10:03:12 +08:00
</el-form-item>
</el-col>
2025-06-30 13:26:32 +08:00
<el-col :span="11">
2025-03-23 10:03:12 +08:00
<el-form-item label="福利平均比例" prop="benefitAvgRatio">
<el-input
v-model="form.benefitAvgRatio"
2025-06-30 13:26:32 +08:00
clearable
2025-03-23 10:03:12 +08:00
placeholder=""
2025-06-30 13:26:32 +08:00
/>
2025-03-23 10:03:12 +08:00
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="福利加权比例" prop="benefitShareRatio">
<el-input
v-model="form.benefitShareRatio"
clearable
placeholder=""
2025-06-30 13:26:32 +08:00
/>
2025-03-23 10:03:12 +08:00
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="分红累计业绩" prop="shareTotalCheck">
<el-input
v-model="form.shareTotalCheck"
clearable
placeholder=""
/>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="部门数量" prop="placeDeptNum">
<el-input
v-model="form.placeDeptNum"
clearable
placeholder=""
/>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="分红小部门业绩" prop="shareCommunityCheck">
<el-input
v-model="form.shareCommunityCheck"
clearable
placeholder=""
/>
</el-form-item>
</el-col>
2025-03-23 10:03:12 +08:00
<el-col :span="11">
<el-form-item required label="奖衔属性" prop="awardsValue">
2025-06-30 13:26:32 +08:00
<el-select v-model="form.awardsValue" clearable placeholder="">
2025-03-23 10:03:12 +08:00
<el-option
v-for="item in awardsSxList"
:key="item.value"
:label="item.label"
:value="item.value"
2025-06-30 13:26:32 +08:00
/>
2025-03-23 10:03:12 +08:00
</el-select>
</el-form-item>
</el-col>
2025-06-30 13:26:32 +08:00
2025-03-23 10:03:12 +08:00
<el-col :span="12">
<el-form-item label="颜色" prop="color">
2025-06-30 13:26:32 +08:00
<el-color-picker v-model="form.color" />
2025-03-23 10:03:12 +08:00
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button class="cancels" @click="handleClose">
2025-06-30 13:26:32 +08:00
{{ '取消' }}</el-button>
2025-03-23 10:03:12 +08:00
<el-button class="submit" type="primary" @click="onSubmit('form')">{{
2025-05-26 10:41:35 +08:00
'确定'
2025-03-23 10:03:12 +08:00
}}</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
2025-06-30 13:26:32 +08:00
import topBar from '@/components/topBar'
import ImageUpload from '@/components/ImageUpload'
2025-03-23 10:03:12 +08:00
import {
getAwardsList,
getAwardsListChiose,
getRelationList,
getOneAwards,
deleteAwards,
scGenerate,
updateAwards,
updateStatusAwards,
2025-06-30 13:26:32 +08:00
getAwardsValueList
} from '@/api/retailLevel'
import { isLocals } from '@/utils/numberToCurrency'
2025-03-23 10:03:12 +08:00
export default {
2025-06-30 13:26:32 +08:00
name: 'RetailJxpz',
2025-03-23 10:03:12 +08:00
components: {
topBar,
2025-06-30 13:26:32 +08:00
ImageUpload
2025-03-23 10:03:12 +08:00
},
data() {
return {
2025-06-30 13:26:32 +08:00
moren: 'retailJxpz',
2025-03-23 10:03:12 +08:00
topList: [
{
2025-06-08 15:32:44 +08:00
name: '等级配置',
2025-06-30 13:26:32 +08:00
path: 'retailLevel'
2025-03-23 10:03:12 +08:00
},
{
2025-06-08 15:32:44 +08:00
name: '奖衔配置',
2025-06-30 13:26:32 +08:00
path: 'retailJxpz'
2025-03-23 10:03:12 +08:00
},
{
2025-06-08 15:32:44 +08:00
name: '复购极差',
2025-06-30 13:26:32 +08:00
path: 'retailFgjc'
}
2025-03-23 10:03:12 +08:00
],
queryParams: {
pageNum: 1,
2025-06-30 13:26:32 +08:00
pageSize: 50
2025-03-23 10:03:12 +08:00
},
total: 0,
multipleSelection: [],
tableData: [],
loading: false,
updateShow: false,
2025-06-30 13:26:32 +08:00
awardsListChiose: [], // 奖衔选择列表
relationList: [], // 考核选择列表
2025-03-23 10:03:12 +08:00
form: {
2025-06-30 13:26:32 +08:00
awardsName: '', // 奖衔名称
communityCheck: '0', // 小区考核
purchaseCheck: '0', // 复购考核
communityCheckEnd: '0', // 分红考核
globalDividend: '0', // 全球分红
pkCheckAwardsLeft: '', // 左区奖衔
pkCheckAwardsRight: '', // 右区奖衔
relationType: '', // 考核
awardsValue: '', // 奖衔属性
monthRepurchaseRatio: '', // 复购级差比例
color: '',
image: '',
textContent: '',
algebra: '0',
shareCheck: '',
placeDeptNum: '',
totalCheck: '',
rangeRatio: '',
benefitAvgRatio: '',
benefitShareRatio: '',
shareCommunityCheck: '0',
shareCommunityCheckEnd: '0',
shareTotalCheck: ''
2025-03-23 10:03:12 +08:00
},
rules: {
awardsName: [
2025-06-30 13:26:32 +08:00
{ required: true, message: '请输入奖衔名称', trigger: 'blur' }
2025-03-23 10:03:12 +08:00
],
2025-06-30 13:26:32 +08:00
2025-03-23 10:03:12 +08:00
// globalDividend: [
// { required: true, message: "请输入全球分红", trigger: "blur" },
// ],
// pkCheckAwardsLeft: [
// { required: true, message: "请选择左区奖衔", trigger: "change" },
// ],
// pkCheckAwardsRight: [
// { required: true, message: "请选择右区奖衔", trigger: "change" },
// ],
// relationType: [
// { required: true, message: "请选择考核", trigger: "change" },
// ],
2025-06-30 13:26:32 +08:00
color: [{ required: true, message: '请选择颜色', trigger: 'change' }]
2025-03-23 10:03:12 +08:00
// image: [
// { required: true, message: "请选择图片", trigger: "change" },
// ],
},
2025-06-30 13:26:32 +08:00
dialogTitle: '',
addEdit: '',
awardsSxList: [] // 奖衔属性
}
2025-03-23 10:03:12 +08:00
},
created() {
2025-06-30 13:26:32 +08:00
this.getAwardsList()
this.getAwardsListChiose()
this.getRelationList()
this.getAwardsValueList()
2025-03-23 10:03:12 +08:00
},
methods: {
isLocals,
2025-06-30 13:26:32 +08:00
// 奖衔属性
2025-03-23 10:03:12 +08:00
getAwardsValueList() {
getAwardsValueList().then((res) => {
2025-06-30 13:26:32 +08:00
this.awardsSxList = res.data
})
2025-03-23 10:03:12 +08:00
},
2025-06-30 13:26:32 +08:00
// 启用/禁用
2025-03-23 10:03:12 +08:00
updateState(row) {
2025-06-08 15:32:44 +08:00
this.$confirm('确认更改状态?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
2025-06-30 13:26:32 +08:00
type: 'warning'
2025-03-23 10:03:12 +08:00
}).then(() => {
2025-06-30 13:26:32 +08:00
var thestate = ''
2025-03-23 10:03:12 +08:00
if (row.enableState == 0) {
2025-06-30 13:26:32 +08:00
thestate = 1
2025-03-23 10:03:12 +08:00
} else if (row.enableState == 1) {
2025-06-30 13:26:32 +08:00
thestate = 0
2025-03-23 10:03:12 +08:00
}
updateStatusAwards({ pkId: row.pkId, enableState: thestate }).then(
(res) => {
if (res.code == 200) {
this.$message({
message: res.msg,
2025-06-30 13:26:32 +08:00
type: 'success'
})
2025-03-23 10:03:12 +08:00
// 获取列表
2025-06-30 13:26:32 +08:00
this.getAwardsList()
2025-03-23 10:03:12 +08:00
}
}
2025-06-30 13:26:32 +08:00
)
})
2025-03-23 10:03:12 +08:00
},
onSubmit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
2025-06-30 13:26:32 +08:00
let url = ''
2025-03-23 10:03:12 +08:00
if (this.addEdit == 1) {
2025-06-30 13:26:32 +08:00
// 添加
url = scGenerate
2025-03-23 10:03:12 +08:00
} else {
2025-06-30 13:26:32 +08:00
// 修改
url = updateAwards
2025-03-23 10:03:12 +08:00
}
2025-06-30 13:26:32 +08:00
// 修改
2025-03-23 10:03:12 +08:00
url(this.form).then((res) => {
if (res.code == 200) {
2025-06-30 13:26:32 +08:00
this.updateShow = false
2025-03-23 10:03:12 +08:00
this.$message({
message: res.msg,
2025-06-30 13:26:32 +08:00
type: 'success'
})
this.getAwardsList()
this.addEdit = ''
2025-03-23 10:03:12 +08:00
}
2025-06-30 13:26:32 +08:00
})
2025-03-23 10:03:12 +08:00
} else {
2025-06-30 13:26:32 +08:00
return false
2025-03-23 10:03:12 +08:00
}
2025-06-30 13:26:32 +08:00
})
2025-03-23 10:03:12 +08:00
},
2025-06-30 13:26:32 +08:00
// 点击添加
2025-03-23 10:03:12 +08:00
adddate() {
2025-06-30 13:26:32 +08:00
this.dialogTitle = '添加'
this.updateShow = true
this.addEdit = 1
this.$refs['form'].clearValidate()
this.$refs['form'].resetFields()
2025-03-23 10:03:12 +08:00
// scGenerate({}).then(res=>{
// if(res.code==200){
// this.getAwardsList()
// }
// })
},
2025-06-30 13:26:32 +08:00
// 修改
2025-03-23 10:03:12 +08:00
update(row, item) {
2025-06-30 13:26:32 +08:00
this.addEdit = 2
this.updateShow = true
this.dialogTitle = '修改'
2025-03-23 10:03:12 +08:00
getOneAwards(row.pkId).then((res) => {
2025-06-30 13:26:32 +08:00
this.form = res.data
})
2025-03-23 10:03:12 +08:00
},
getAwardsListChiose() {
2025-06-30 13:26:32 +08:00
// 奖衔配置下拉选
2025-03-23 10:03:12 +08:00
getAwardsListChiose().then((res) => {
2025-06-30 13:26:32 +08:00
this.awardsListChiose = res.rows
})
2025-03-23 10:03:12 +08:00
},
2025-06-30 13:26:32 +08:00
// 奖衔列表
2025-03-23 10:03:12 +08:00
getAwardsList() {
2025-06-30 13:26:32 +08:00
this.loading = true
2025-03-23 10:03:12 +08:00
getAwardsList(this.queryParams).then((res) => {
2025-06-30 13:26:32 +08:00
this.tableData = res.rows
this.total = res.total
this.loading = false
})
2025-03-23 10:03:12 +08:00
},
2025-06-30 13:26:32 +08:00
// 关闭弹窗
2025-03-23 10:03:12 +08:00
handleClose() {
2025-06-30 13:26:32 +08:00
this.updateShow = false
this.$refs['form'].clearValidate()
this.$refs['form'].resetFields()
2025-03-23 10:03:12 +08:00
},
2025-06-30 13:26:32 +08:00
// 考核类型枚举列表下拉
2025-03-23 10:03:12 +08:00
getRelationList() {
getRelationList().then((res) => {
2025-06-30 13:26:32 +08:00
this.relationList = res.data
})
2025-03-23 10:03:12 +08:00
},
2025-06-30 13:26:32 +08:00
// 列表展示考核
2025-03-23 10:03:12 +08:00
checkRelation(row) {
2025-06-30 13:26:32 +08:00
let kaohe = ''
2025-03-23 10:03:12 +08:00
if (this.relationList) {
this.relationList.map((item) => {
if (row.relationType == item.value) {
2025-06-30 13:26:32 +08:00
kaohe = item.label
2025-03-23 10:03:12 +08:00
}
2025-06-30 13:26:32 +08:00
})
2025-03-23 10:03:12 +08:00
}
2025-06-30 13:26:32 +08:00
return kaohe
2025-03-23 10:03:12 +08:00
},
2025-06-30 13:26:32 +08:00
// 列表展示左右区奖衔
2025-03-23 10:03:12 +08:00
checkAwards(row) {
2025-06-30 13:26:32 +08:00
let state = ''
2025-03-23 10:03:12 +08:00
if (this.awardsListChiose) {
this.awardsListChiose.map((element) => {
if (row.pkCheckAwardsLeft == element.awardsValue) {
2025-06-30 13:26:32 +08:00
state = element.awardsName
2025-03-23 10:03:12 +08:00
}
2025-06-30 13:26:32 +08:00
})
2025-03-23 10:03:12 +08:00
}
2025-06-30 13:26:32 +08:00
return state
2025-03-23 10:03:12 +08:00
},
checkAwards2(row) {
2025-06-30 13:26:32 +08:00
let state2 = ''
2025-03-23 10:03:12 +08:00
if (this.awardsListChiose) {
this.awardsListChiose.map((element) => {
if (row.pkCheckAwardsRight == element.awardsValue) {
2025-06-30 13:26:32 +08:00
state2 = element.awardsName
2025-03-23 10:03:12 +08:00
}
2025-06-30 13:26:32 +08:00
})
2025-03-23 10:03:12 +08:00
}
2025-06-30 13:26:32 +08:00
return state2
2025-03-23 10:03:12 +08:00
},
handleSelectionChange(val) {
2025-06-30 13:26:32 +08:00
this.multipleSelection = val
2025-03-23 10:03:12 +08:00
},
2025-06-30 13:26:32 +08:00
// 删除
2025-03-23 10:03:12 +08:00
deleteRow(row, item) {
2025-06-08 15:32:44 +08:00
this.$confirm('确定删除?').then((_) => {
2025-03-23 10:03:12 +08:00
deleteAwards(row.pkId).then((res) => {
if (res.code == 200) {
this.$message({
message: res.msg,
2025-06-30 13:26:32 +08:00
type: 'success'
})
this.getAwardsList()
2025-03-23 10:03:12 +08:00
}
2025-06-30 13:26:32 +08:00
})
})
2025-03-23 10:03:12 +08:00
},
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 == 1) {
2025-06-30 13:26:32 +08:00
return 'warning-row'
2025-03-23 10:03:12 +08:00
} else if (rowIndex % 2 == 0) {
2025-06-30 13:26:32 +08:00
return 'success-row'
2025-03-23 10:03:12 +08:00
}
2025-06-30 13:26:32 +08:00
return ''
}
}
}
2025-03-23 10:03:12 +08:00
</script>
<style lang="scss" scoped>
.button-s {
padding: 3px 0;
}
::v-deep .el-date-editor.el-input,
.el-date-editor.el-input__inner {
width: 100%;
}
::v-deep .el-select {
width: 100%;
}
.submit {
width: 209px;
height: 48px;
background: #c8161d;
border-radius: 5px;
color: #fff;
font-size: 18px;
border-color: #c8161d;
margin-left: 20px;
}
.cancels {
width: 209px;
height: 48px;
background: #cccccc;
border-radius: 5px;
color: #fff;
font-size: 18px;
border-color: #ccc;
}
::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: 10px 20px;
background: #f9f9f9;
font-size: 14px;
.main {
//margin-top: 20px;
//background: #ffffff;
//border-radius: 8px;
//box-shadow: 0px 2px 20px 0px rgba(238, 238, 238, 0.5);
background: #f9f9f9;
.maintop {
display: flex;
// padding: 10px 0;
justify-content: space-between;
align-items: center;
.mainbtn {
.thebtn1 {
color: #ffffff;
background: #3181e5;
}
.thebtn2 {
color: #ffffff;
background: #ffad41;
}
}
}
}
}
</style>