Commit 145e4d99 authored by youjie's avatar youjie

no message

parent 615e6302
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
:class="{'_active':item.id==msg.EmpType}" :class="{'_active':item.id==msg.EmpType}"
@click="getTemplateList(item)" @click="getTemplateList(item)"
>{{item.name}}</li> >{{item.name}}</li>
<input type="button" class="hollowFixedBtn" value="新增" @click="AddMsg"/> <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> </ul>
<template> <template>
<div <div
...@@ -283,6 +285,27 @@ ...@@ -283,6 +285,27 @@
<el-button size="small" type="danger" @click="RulesOk('form')" :loading="ruleLoading">确 定</el-button> <el-button size="small" type="danger" @click="RulesOk('form')" :loading="ruleLoading">确 定</el-button>
</span> </span>
</el-dialog> </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> </div>
</template> </template>
...@@ -323,6 +346,11 @@ ...@@ -323,6 +346,11 @@
message: "请输入比例", message: "请输入比例",
trigger: "blur" trigger: "blur"
}], }],
Content: [{
required: true,
message: "请输入限制",
trigger: "blur"
}],
}, },
EmpList:[//参与人 EmpList:[//参与人
{EmployeeId:''} {EmployeeId:''}
...@@ -378,7 +406,7 @@ ...@@ -378,7 +406,7 @@
}, },
ruleLoading: false, ruleLoading: false,
ruleVisible:false, ruleVisible:false,
titleName:'', titleName:'标题',
loading: false, loading: false,
titleList:[ titleList:[
{name:'引流规则',id:'2'}, {name:'引流规则',id:'2'},
...@@ -390,6 +418,15 @@ ...@@ -390,6 +418,15 @@
}, },
hintStart:'', hintStart:'',
hintEnd:'', hintEnd:'',
TheRulesVisible: false,
TheRulesForm:{
Name:'',
SNO:2,
Content:''
},
TheRulesData:[
]
} }
}, },
created() {}, created() {},
...@@ -399,6 +436,56 @@ ...@@ -399,6 +436,56 @@
this.getEmployeeList() this.getEmployeeList()
}, },
methods: { 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){ addRule(row,index,type){
if(type==1){ if(type==1){
...@@ -536,6 +623,7 @@ ...@@ -536,6 +623,7 @@
getTemplateList(item){ getTemplateList(item){
this.msg.EmpType = item.id this.msg.EmpType = item.id
this.form.EmpType = this.msg.EmpType this.form.EmpType = this.msg.EmpType
this.TheRulesForm.SNO = Number(this.msg.EmpType)
this.dataList = [] this.dataList = []
this.getList() this.getList()
}, },
...@@ -684,4 +772,7 @@ ...@@ -684,4 +772,7 @@
font-size: 13px; font-size: 13px;
margin-left: 5px; margin-left: 5px;
} }
/deep/.line-heigh .el-input-number{
line-height: 32px;
}
</style> </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