Commit 145e4d99 authored by youjie's avatar youjie

no message

parent 615e6302
......@@ -5,6 +5,8 @@
:class="{'_active':item.id==msg.EmpType}"
@click="getTemplateList(item)"
>{{item.name}}</li>
<button class="hollowFixedBtn" style="right: 185px;" @click="clickTheRules(1)">提成限制</button>
<button class="normalBtn" style="position: absolute; right: 90px;top: 9px;" @click="clickTheRules()">提成规则</button>
<input type="button" class="hollowFixedBtn" value="新增" @click="AddMsg"/>
</ul>
<template>
......@@ -283,6 +285,27 @@
<el-button size="small" type="danger" @click="RulesOk('form')" :loading="ruleLoading">确 定</el-button>
</span>
</el-dialog>
<!-- 设置限制 -->
<el-dialog :title="titleName" :visible.sync="TheRulesVisible" width="300px">
<el-form ref="form" :model="TheRulesForm" :rules="rules" :label-width="titleName.indexOf('限制')!=-1?'80px':'120px'">
<div v-if="titleName.indexOf('限制')!=-1" class="ImpressionTicketing-msgbox bottom0 line-heigh">
<el-form-item :label="TheRulesForm.SNO =='1'?'限制金额':'限制条数'" prop="Content">
<el-input-number :min="0" v-model="TheRulesForm.Content" clearable></el-input-number>
</el-form-item>
</div>
<div v-else class="ImpressionTicketing-msgbox bottom0" v-for="(item,index) in TheRulesData">
<el-form-item :label="item.Name+':'">
<span style="margin-left: 10px;">{{item.Content}}
<i style="margin-left: 5px;">{{item.SNO==2?' RMB':' 条'}}</i>
</span>
</el-form-item>
</div>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="TheRulesVisible = false,ruleLoading = false">取 消</el-button>
<el-button size="small" type="danger" @click="titleName.indexOf('限制')!=-1?OkTheRules('form'):TheRulesVisible = false" :loading="ruleLoading">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
......@@ -323,6 +346,11 @@
message: "请输入比例",
trigger: "blur"
}],
Content: [{
required: true,
message: "请输入限制",
trigger: "blur"
}],
},
EmpList:[//参与人
{EmployeeId:''}
......@@ -378,7 +406,7 @@
},
ruleLoading: false,
ruleVisible:false,
titleName:'',
titleName:'标题',
loading: false,
titleList:[
{name:'引流规则',id:'2'},
......@@ -390,6 +418,15 @@
},
hintStart:'',
hintEnd:'',
TheRulesVisible: false,
TheRulesForm:{
Name:'',
SNO:2,
Content:''
},
TheRulesData:[
]
}
},
created() {},
......@@ -399,6 +436,56 @@
this.getEmployeeList()
},
methods: {
// 点击确定
OkTheRules(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
let data = {
SNO:this.TheRulesForm.SNO==1?2:1,
Content:this.TheRulesForm.Content,
}
this.ruleLoading = true
this.crmapipost(
'/api/commission/SetCommissionLimit', data,
res => {
if (res.data.resultCode == 1) {
this.resetForm('form')
// this.getList();
this.TheRulesVisible = false;
this.ruleLoading = false
this.Success(res.data.message)
} else {
this.Error(res.data.message)
}
},
err => {}
)
}
});
},
GetCommissionLimit() {
this.crmapipost(
'/api/commission/GetCommissionLimit', {},
res => {
if (res.data.resultCode == 1) {
this.TheRulesData = res.data.data
} else {
this.Error(res.data.message)
}
},
err => {}
)
},
clickTheRules(type){
this.TheRulesVisible = true
if(type==1){
this.titleName = this.TheRulesForm.SNO==1?'销售提成限制':'引流提成限制'
}else{
this.titleName = '提成规则'
this.ruleLoading = false
this.GetCommissionLimit()
}
},
// 添加规则
addRule(row,index,type){
if(type==1){
......@@ -536,6 +623,7 @@
getTemplateList(item){
this.msg.EmpType = item.id
this.form.EmpType = this.msg.EmpType
this.TheRulesForm.SNO = Number(this.msg.EmpType)
this.dataList = []
this.getList()
},
......@@ -684,4 +772,7 @@
font-size: 13px;
margin-left: 5px;
}
/deep/.line-heigh .el-input-number{
line-height: 32px;
}
</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