Commit a6f94b0f authored by zhengke's avatar zhengke

no message

parent fd2d95d7
<template>
<div class="page_FProcessManagement">
<div class='query-box'>
<ul>
<li>
<input type="button" class="hollowFixedBtn" value="新增" @click="AddMsg"/>
</li>
</ul>
</div>
<ul class="_nav clearfix">
<li v-for="(item,index) in titleList" :key="index"
:class="{'_active':item.id==msg.EmpType}"
@click="getTemplateList(item)"
>{{item.name}}</li>
</ul>
<template>
<div
class="cm_content"
style="width: 100%;margin-bottom: 35px;margin-top: 30px;"
v-for="(item,index ) in dataList "
:key="index"
>
<table
class="po_content singeRowTable"
style="border:1px solid #E6E6E6;"
cellspacing="0"
cellpadding="0"
v-loading="loading"
>
<tr>
<th width="100" style="min-width: 100px;max-width: 100px;">方案名称</th>
<th width="100" style="min-width: 100px;max-width: 100px;">类型</th>
<th width="100%">提成人员</th>
<th width="150" style="min-width: 150px;max-width: 150px;">创建时间</th>
<th width="150" style="min-width: 150px;max-width: 150px;">操作</th>
</tr>
<tr>
<td>
<span>{{item.Name}}</span>
</td>
<td>
<span>{{item.EmpType==1?'销售':'引流'}}</span>
</td>
<td style="padding: 0 10px;">
<span v-for="(son,sIndex ) in item.EmpList" :key="sIndex">
<span v-if="sIndex<8">{{ son.EmName }}{{item.EmpList.length==sIndex+1?'':'、'}}</span>
</span>
<el-popover
v-if="item.EmpList.length>=9"
placement="top-start"
title="提成人员"
width="400"
trigger="click"
:content="item.EmpListtext">
<el-button slot="reference" style="border: none;" type="text">查看更多</el-button>
</el-popover>
</td>
<td style="padding: 0 10px;">
<span>
{{item.UpdateTime}}
</span>
</td>
<td>
<el-button @click="SetRules(item)" style="padding:4px" type="primary" icon="el-icon-edit" circle>
</el-button>
<el-button @click="Delete(item)" style="padding:4px" type="danger" icon="el-icon-delete" circle></el-button>
</td>
</tr>
</table>
<div style="width:100%;overflow-x: auto;">
<table
class="po_content singeRowTable"
style="border:1px solid #E6E6E6;"
cellspacing="0"
cellpadding="0"
>
<tr>
<td rowspan="2" width="100" style="min-width: 100px;">工资{{textId==1?'利润':'比例'}}</td>
<th style="min-width: 220px;"
v-for="( son , sIndex ) in item.WageRateList"
:key="sIndex"
>{{ son.StartValue }} <span>{{son.EndValue && son.EndValue!=-1?'<业绩<=':'<业绩'}}</span><span v-if="son.EndValue && son.EndValue!=-1">{{ son.EndValue }}</span></th>
</tr>
<tr>
<td style="min-width: 220px;" v-for="( son , sIndex ) in item.WageRateList" :key="sIndex">{{ son.Rate }}%</td>
</tr>
</table>
</div>
<div style="width:100%;overflow-x: auto;">
<table
class="po_content singeRowTable"
style="border:1px solid #E6E6E6;"
cellspacing="0"
cellpadding="0"
>
<tr>
<td rowspan="2" width="100" style="min-width: 100px;">提成{{textId==1?'利润':'比例'}}</td>
<th style="min-width: 220px;"
v-for="( son , sIndex ) in item.CommissionRateList"
:key="sIndex"
>{{ son.StartValue }} <span>{{son.EndValue && son.EndValue!=-1?'<业绩<=':'<业绩'}}</span><span v-if="son.EndValue && son.EndValue!=-1">{{ son.EndValue }}</span></th>
</tr>
<tr>
<td style="min-width: 220px;" v-for="( son , sIndex ) in item.CommissionRateList" :key="sIndex">{{ son.Rate }}%</td>
</tr>
</table>
</div>
<div style="width:100%;overflow-x: auto;">
<table
class="po_content singeRowTable"
style="border:1px solid #E6E6E6;"
cellspacing="0"
cellpadding="0"
>
<tr>
<td rowspan="2" width="100" style="min-width: 100px;">年终{{textId==1?'利润':'比例'}}</td>
<th style="min-width: 220px;"
v-for="( son , sIndex ) in item.BonusRateList"
:key="sIndex"
>{{ son.StartValue }} <span>{{son.EndValue && son.EndValue!=-1?'<业绩<=':'<业绩'}}</span><span v-if="son.EndValue && son.EndValue!=-1">{{ son.EndValue }}</span></th>
</tr>
<tr>
<td style="min-width: 220px;" v-for="( son , sIndex ) in item.BonusRateList" :key="sIndex">{{ son.Rate }}%</td>
</tr>
</table>
</div>
</div>
<div v-if="dataList.length==0"
style="width: 100%;border:1px solid #E6E6E6;display: flex;align-items: center;justify-content: center;height: 60px;margin-top: 30px;"
>暂无数据</div>
</template>
<el-dialog :title="titleName" :visible.sync="ruleVisible" width="750px">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<div class="ImpressionTicketing-msgbox">
<el-form-item label="规则名称" prop="Name">
<el-input v-model="form.Name" clearable></el-input>
</el-form-item>
<el-form-item label="人员" prop="EmployeeId">
<el-select class="multiple_input" filterable multiple v-model="form.EmployeeId"
@change="personnel">
<el-option v-for="item in EmployeeList" :label="item.EmName" :value="item.EmployeeId"
:key="item.EmployeeId"></el-option>
</el-select>
</el-form-item>
</div>
<el-form-item class="ImpressionTicketing-OuterFrame" label="基本工资比列">
<div class="ImpressionTicketing-msgbox"
v-for="(item,index) in form.WageRateList" :key="index">
<div>
<el-form-item
:label="form.WageRateList.length>0?`开始值 ${index+1} `:` ` "
:prop="`WageRateList.${index}.StartValue`"
:rules="rules.StartValue"
label-width="90px"
label-position="left">
<el-input onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" :min="0" :max="99999999"
v-model="item.StartValue" clearable></el-input>
</el-form-item>
</div>
<div>
<el-form-item
:label="form.WageRateList.length>0?`结束值 ${index+1} `:` ` "
:prop="`WageRateList.${index}.EndValue`"
:rules="rules.EndValue"
label-width="90px"
label-position="left">
<el-input onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" :min="0" :max="99999999"
v-model="item.EndValue" clearable></el-input>
</el-form-item>
</div>
<div>
<el-form-item
:label="form.WageRateList.length>0?`金额 ${index+1} `:` ` "
:prop="`WageRateList.${index}.Rate`"
:rules="rules.Rate"
label-width="90px"
label-position="left">
<el-input onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" :min="0" :max="99999999"
v-model="item.Rate"></el-input>
</el-form-item>
</div>
<div class="ImpressionTicketing-msg-but">
<span @click="addRule(item,index,1)" v-if="index==0" class="el-icon-circle-plus-outline itc-outline"></span>
<span @click="deleteRule(item,index,1)" v-else class="el-icon-delete itc-delete"></span>
</div>
</div>
</el-form-item>
<el-form-item class="ImpressionTicketing-OuterFrame" label="提成比列">
<div class="ImpressionTicketing-msgbox" v-for="(item,index) in form.CommissionRateList" :key="index">
<div>
<el-form-item
:label="form.CommissionRateList.length>0?`开始值 ${index+1} `:` ` "
:prop="`CommissionRateList.${index}.StartValue`"
:rules="rules.StartValue"
label-width="90px"
label-position="left">
<el-input onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" :min="0" :max="99999999"
v-model="item.StartValue" clearable></el-input>
</el-form-item>
</div>
<div>
<el-form-item
:label="form.CommissionRateList.length>0?`结束值 ${index+1} `:` ` "
:prop="`CommissionRateList.${index}.EndValue`"
:rules="rules.EndValue"
label-width="90px"
label-position="left">
<el-input onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" :min="0" :max="99999999"
v-model="item.EndValue" clearable></el-input>
</el-form-item>
</div>
<div>
<el-form-item
:label="form.CommissionRateList.length>0?`金额 ${index+1} `:` ` "
:prop="`CommissionRateList.${index}.Rate`"
:rules="rules.Rate"
label-width="90px"
label-position="left">
<el-input onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" :min="0" :max="99999999"
v-model="item.Rate"></el-input>
</el-form-item>
</div>
<div class="ImpressionTicketing-msg-but">
<span @click="addRule(item,index,2)" v-if="index==0" class="el-icon-circle-plus-outline itc-outline"></span>
<span @click="deleteRule(item,index,2)" v-else class="el-icon-delete itc-delete"></span>
</div>
</div>
</el-form-item>
<el-form-item class="ImpressionTicketing-OuterFrame" label="年终比列">
<div class="ImpressionTicketing-msgbox" v-for="(item,index) in form.BonusRateList" :key="index">
<div>
<el-form-item
:label="form.BonusRateList.length>0?`开始值 ${index+1} `:` ` "
:prop="`BonusRateList.${index}.StartValue`"
:rules="rules.StartValue"
label-width="90px"
label-position="left">
<el-input onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" :min="0" :max="99999999"
v-model="item.StartValue" clearable></el-input>
</el-form-item>
</div>
<div>
<el-form-item
:label="form.BonusRateList.length>0?`结束值 ${index+1} `:` ` "
:prop="`BonusRateList.${index}.EndValue`"
:rules="rules.EndValue"
label-width="90px"
label-position="left">
<el-input onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" :min="0" :max="99999999"
v-model="item.EndValue" clearable></el-input>
</el-form-item>
</div>
<div>
<el-form-item
:label="form.BonusRateList.length>0?`金额 ${index+1} `:` ` "
:prop="`BonusRateList.${index}.Rate`"
:rules="rules.Rate"
label-width="90px"
label-position="left">
<el-input onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" :min="0" :max="99999999"
v-model="item.Rate"></el-input>
</el-form-item>
</div>
<div class="ImpressionTicketing-msg-but">
<span @click="addRule(item,index,3)" v-if="index==0" class="el-icon-circle-plus-outline itc-outline"></span>
<span @click="deleteRule(item,index,3)" v-else class="el-icon-delete itc-delete"></span>
</div>
</div>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="ruleVisible = false">取 消</el-button>
<el-button size="small" type="danger" @click="RulesOk('form')" :disabled="ruleLoading">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
value:"",
EmployeeList:[],
rules: {
Name: [{
required: true,
message: '请输入规则名称',
trigger: 'change'
}],
EmployeeId: [{
required: true,
message: '请选择参与人员',
trigger: 'change'
}],
StartValue: [{
required: true,
message: "请输入开始值",
trigger: "blur"
}],
EndValue: [{
required: true,
message: "请输入结束值",
trigger: "blur"
}],
Rate: [{
required: true,
message: "请输入金额",
trigger: "blur"
}],
},
EmpList:[//参与人
{EmployeeId:''}
],
WageRateList://工资阶梯列表
{
StartValue:null,
EndValue:null,
Rate:null
},
CommissionRateList://提成阶梯列表
{
StartValue:null,
EndValue:null,
Rate:null
},
BonusRateList://年终奖阶梯列表
{
StartValue:null,
EndValue:null,
Rate:null
}
,
form:{
Id:0,
Name:'',//规则名称
EmpType:'',//类型 1销售 2引流
EmployeeId:'',
EmpList:[//参与人
{EmployeeId:''}
],
WageRateList:[//工资阶梯列表
{
StartValue:null,
EndValue:null,
Rate:null
}
],
CommissionRateList:[//提成阶梯列表
{
StartValue:null,
EndValue:null,
Rate:null
}
],
BonusRateList:[//年终奖阶梯列表
{
StartValue:null,
EndValue:null,
Rate:null
}
],
},
ruleLoading: false,
ruleVisible:false,
titleName:'',
loading: false,
titleList:[
{name:'引流规则',id:'2'},
{name:'销售规则',id:'1'}
],
textId:'2',
dataList:[],
msg:{
EmpType: '2'
}
}
},
created() {},
mounted() {
this.form.EmpType = this.msg.EmpType
this.getList()
this.getEmployeeList()
},
methods: {
// 添加规则
addRule(row,index,type){
if(type==1){
this.form.WageRateList.push(JSON.parse(JSON.stringify(this.WageRateList)))
}else if(type==2){
this.form.CommissionRateList.push(JSON.parse(JSON.stringify(this.CommissionRateList)))
}else{
this.form.BonusRateList.push(JSON.parse(JSON.stringify(this.BonusRateList)))
}
},
// 删除规则
deleteRule(row,index,type){
if(type==1){
this.form.WageRateList.splice(index,1)
}else if(type==2){
this.form.CommissionRateList.splice(index,1)
}else{
this.form.BonusRateList.splice(index,1)
}
},
AddMsg(){//新增
this.ruleVisible = true
if(this.msg.EmpType=='1'){
this.titleName = '销售规则'
}else{
this.titleName = '引流规则'
}
},
SetRules(item){//编辑
if(this.msg.EmpType=='1'){
this.titleName = '销售规则'
}else{
this.titleName = '引流规则'
}
let list = []
item.EmpList.forEach(x => {
let data = {
EmployeeId: x.EmployeeId
}
list.push(data)
});
this.ruleVisible = true;
this.form = {
Id:item.Id,
Name:item.Name,//规则名称
EmpType:item.EmpType,//类型 1销售 2引流
EmployeeId:item.EmpList.map(x=>x.EmployeeId),
EmpList:list,
WageRateList:item.WageRateList,
CommissionRateList:item.CommissionRateList,
BonusRateList:item.BonusRateList,
}
},
Delete(item){//删除
this.$confirm("是否删除? 删除后不可恢复", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return
this.apipost('ViittoCommission_post_RemoveViittoCommissionRuleService', {
ID: item.Id
}, res => {
if (res.data.resultCode == 1) {
this.Success(res.data.message)
this.getList()
} else {
this.Error(res.data.message)
}
})
})
.catch(() => {});
},
// 点击确定
RulesOk(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.form.EmpType = this.msg.EmpType
let data = {
Id:this.form.Id,
Name:this.form.Name,//规则名称
EmpType:this.form.EmpType,//类型 1销售 2引流
EmpList:this.form.EmpList,
WageRateList:this.form.WageRateList,
CommissionRateList:this.form.CommissionRateList,
BonusRateList:this.form.BonusRateList,
}
this.ruleLoading = true
this.crmapipost(
'/api/Commission/SetCommissionRule', data,
res => {
if (res.data.resultCode == 1) {
this.resetForm('form')
this.getList();
this.ruleVisible = false;
this.ruleLoading = false
this.Success(res.data.message)
} else {
this.resetForm('form')
this.ruleLoading = false
this.Error(res.data.message)
}
},
err => {}
)
}
});
},
// 人员获取
personnel(){
this.form.EmpList= []
for(let i=0;i<this.form.EmployeeId.length;i++){
let data = {
EmployeeId:this.form.EmployeeId[i],
}
this.form.EmpList.push(data)
}
console.log(this.form.EmployeeId,'---==')
},
// 点击tab
getTemplateList(item){
this.msg.EmpType = item.id
this.form.EmpType = this.msg.EmpType
this.dataList = []
this.getList()
},
// 获取列表数据
getList() {
this.loading = true;
this.crmapipost("/api/Commission/GetCommissionRuleList", this.msg, res => {
this.loading = false;
if (res.data.resultCode == 1) {
this.dataList = res.data.data;
}
});
},
// 获取人员列表
getEmployeeList() {
let userInfo = this.getLocalStorage()
let msg = {
GroupId: userInfo.RB_Group_id,
BranchId: '49',
DepartmentId: '-1',
PostId: '-1',
IsLeave: '0'
}
this.apipost(
'admin_get_EmployeeGetList', msg,
res => {
if (res.data.resultCode == 1) {
this.EmployeeList = res.data.data
}
},
err => {}
)
},
// 重置表单
resetForm(formName) {
this.ruleVisible = false;
// 重置表单
this.form = {
id:0,
Name:'',//规则名称
EmpType:'',//类型 1销售 2引流
EmployeeId:'',
EmpList:[//参与人
{EmployeeId:''}
],
WageRateList:[//工资阶梯列表
{
StartValue:null,
EndValue:null,
Rate:null
}
],
CommissionRateList:[//提成阶梯列表
{
StartValue:null,
EndValue:null,
Rate:null
}
],
BonusRateList:[//年终奖阶梯列表
{
StartValue:null,
EndValue:null,
Rate:null
}
],
};
this.$refs[formName].resetFields();
},
}
}
</script>
<style scoped>
.query-box{border: none;padding-left: 0}
._nav li{float: left;font-size: 14px;color: #666666;padding: 15px 10px;background-color: #F1F1F1;cursor: pointer;position: relative;}
._nav li._active{background-color:#FFFFFF;color: #333333 }
._nav li._active::after{content: "";width: 20px;height: 3px;background-color: #E95252;display: inline-block;position: absolute;bottom: 0;left: 38%;}
.page_FProcessManagement .query-box li:last-child{
top: 100px;
}
.ImpressionTicketing-OuterFrame{
padding: 10px 20px 20px 20px;
box-shadow: 0 1px 8px rgb(0 0 0 / 20%), 0 3px 4px rgb(0 0 0 / 14%), 0 3px 3px -2px rgb(0 0 0 / 12%);
}
.ImpressionTicketing-msgbox{
display: flex;
flex-direction: row;
justify-content: space-between;
margin-bottom: 20px;
}
.ImpressionTicketing-msgbox div{
flex: 1;
}
.ImpressionTicketing-msgbox div.ImpressionTicketing-msg-but{
flex: 0 0 auto;
}
.itc-delete{
color: #E95252;
font-size: 16px;
cursor: pointer;
display: inline-block;
padding: 10px;
}
.itc-outline{
color: #409EFF;
font-size: 16px;
cursor: pointer;
display: inline-block;
padding: 10px;
}
.ImpressionTicketing-title{
padding: 0;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment