Commit 10f8db20 authored by 黄奎's avatar 黄奎

页面修改

parent 52707802
<template> <template>
<div class="Feedback"> <div class="Feedback">
<ul style="overflow: initial!important"> <ul style="overflow: initial!important">
<!-- <li>
<span>
<em>公司</em>
</span>
<el-select filterable v-model="obj.BranchId" >
<el-option label="不限" :value='-1'></el-option>
<el-option v-for="item in companyList" :label='item.BName' :value='item.Id' :key='item.Id'>
</el-option>
</el-select>
</li>
<li>
<span>
<em>线路</em>
</span>
<el-select filterable v-model="obj.LineId" >
<el-option label="不限" :value='0'></el-option>
<el-option v-for="item in LineList" :label='item.LineName' :value='item.LineID' :key='item.LineID'></el-option>
</el-select>
</li> -->
<li style="float:right;margin-bottom:10px"> <li style="float:right;margin-bottom:10px">
<!-- <input <input type="button" class="hollowFixedBtn" value="新增" @click="addRule">
type="button"
class="hollowFixedBtn"
value="查询"
@click="getList()"
> -->
<input
type="button"
class="hollowFixedBtn"
value="新增"
@click="addRule"
>
</li> </li>
</ul> </ul>
<table class="singeRowTable" border="0" cellspacing="0" cellpadding="0" v-loading="loading"> <table class="singeRowTable" border="0" cellspacing="0" cellpadding="0" v-loading="loading">
...@@ -69,24 +37,18 @@ ...@@ -69,24 +37,18 @@
<td colspan="12" align="center">暂无数据</td> <td colspan="12" align="center">暂无数据</td>
</tr> </tr>
</table> </table>
<el-dialog <el-dialog title="提成规则" :visible.sync="ruleVisible" width="400px">
title="提成规则"
:visible.sync="ruleVisible"
width="400px">
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<!-- <el-form-item label="线路" prop="LineIdList">
<el-select class="multiple_input" filterable value-key="item" v-model="form.LineIdList" @change="getLine">
<el-option v-for="item in LineList" :label='item.LineName' :value='item' :key='item.LineID'></el-option>
</el-select>
</el-form-item> -->
<el-form-item label="人员" prop="EmployeeId"> <el-form-item label="人员" prop="EmployeeId">
<el-select class="multiple_input" filterable v-model="form.EmployeeId" > <el-select class="multiple_input" filterable v-model="form.EmployeeId">
<el-option v-for="item in EmployeeList" :label="item.EmName" <el-option v-for="item in EmployeeList" :label="item.EmName" :value="item.EmployeeId"
:value="item.EmployeeId" :key="item.EmployeeId"></el-option> :key="item.EmployeeId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="占比" prop="CommissionPercent"> <el-form-item label="占比" prop="CommissionPercent">
<el-input class="w220" @keyup.native="checkPrice(form,'CommissionPercent')" v-model="form.CommissionPercent"></el-input> <el-input class="w220" @keyup.native="checkPrice(form,'CommissionPercent')" v-model="form.CommissionPercent">
</el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
...@@ -98,58 +60,45 @@ ...@@ -98,58 +60,45 @@
</template> </template>
<script> <script>
import moment from "moment" import moment from "moment"
import { constants } from 'fs'; import {
export default { constants
} from 'fs';
export default {
name: 'Feedback', name: 'Feedback',
data (){ data() {
return{ return {
allzb:100, allzb: 100,
obj:{ dataList: [],
BranchId:-1, loading: false,
LineId:0, ruleVisible: false,
}, form: {
dataList:[], LineName: '出境日本线',
loading:false, LineID: 14,
dateList:[], EmployeeId: '',
LineList:[], CommissionPercent: 0,
companyList:[], },
ruleVisible:false, EmployeeList: [],
form:{ rules: {
// LineIdList:[], EmployeeId: [{
LineName:'出境日本线', required: true,
LineID:14, message: '请选择参与人员',
EmployeeId:'', trigger: 'change'
CommissionPercent:0, }],
}, CommissionPercent: [{
departmentMsg: { required: true,
RB_Group_Id: '0', message: "请输入占比",
RB_Branch_Id:'-1', trigger: "blur"
Status:'0', }],
ParentId:'-1', },
Tier:'0', }
}, },
LineTeamList:[], created() {},
EmployeeList:[], mounted() {
rules:{
EmployeeId: [
{ required: true, message: '请选择参与人员', trigger: 'change' }
],
CommissionPercent: [{ required: true, message: "请输入占比", trigger: "blur" }],
},
departmentList:[]
}
},
created(){
},
mounted(){
this.getList(); this.getList();
this.getEmployeeList(); this.getEmployeeList();
this.getLineList();
}, },
methods:{ methods: {
Delete(item) { Delete(item) {
this.$confirm("是否删除? 删除后不可恢复", "提示", { this.$confirm("是否删除? 删除后不可恢复", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
...@@ -157,11 +106,13 @@ export default { ...@@ -157,11 +106,13 @@ export default {
type: "warning" type: "warning"
}) })
.then(() => { .then(() => {
this.apipost('OPCommission_RemoveOPCommission', {ID:item.Id}, res => { this.apipost('OPCommission_RemoveOPCommission', {
ID: item.Id
}, res => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.Success(res.data.message) this.Success(res.data.message)
this.getList() this.getList()
}else{ } else {
this.Error(res.data.message) this.Error(res.data.message)
} }
...@@ -169,43 +120,43 @@ export default { ...@@ -169,43 +120,43 @@ export default {
}) })
.catch(() => {}); .catch(() => {});
}, },
addRule(){ addRule() {
this.ruleVisible=true; this.ruleVisible = true;
this.form={ this.form = {
LineName:'出境日本线', LineName: '出境日本线',
LineID:14, LineID: 14,
EmployeeId:'', EmployeeId: '',
CommissionPercent:0, CommissionPercent: 0,
} }
}, },
SetRules(item){ SetRules(item) {
this.ruleVisible=true; this.ruleVisible = true;
this.form={ this.form = {
LineName:'出境日本线', LineName: '出境日本线',
LineID:14, LineID: 14,
EmployeeId:item.EmployeeId, EmployeeId: item.EmployeeId,
CommissionPercent:item.CommissionPercent, CommissionPercent: item.CommissionPercent,
Id:item.Id Id: item.Id
} }
}, },
RulesOk(formName){ RulesOk(formName) {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
let num=0; let num = 0;
let newnum=0; let newnum = 0;
if(this.form.Id){ if (this.form.Id) {
this.dataList.forEach(item=>{ this.dataList.forEach(item => {
item.OPCommissionList.forEach(com=>{ item.OPCommissionList.forEach(com => {
if(com.Id!=this.form.Id){ if (com.Id != this.form.Id) {
num+=com.CommissionPercent; num += com.CommissionPercent;
} }
}) })
}) })
newnum=100-num; newnum = 100 - num;
}else{ } else {
newnum=this.allzb; newnum = this.allzb;
} }
if(Number(this.form.CommissionPercent)>newnum || Number(this.form.CommissionPercent)==0){ if (Number(this.form.CommissionPercent) > newnum || Number(this.form.CommissionPercent) == 0) {
this.Error("请输入正确的占比!"); this.Error("请输入正确的占比!");
return; return;
} }
...@@ -214,24 +165,19 @@ export default { ...@@ -214,24 +165,19 @@ export default {
res => { res => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.getList(); this.getList();
this.ruleVisible=false; this.ruleVisible = false;
this.Success(res.data.message) this.Success(res.data.message)
}else{ } else {
this.Error(res.data.message) this.Error(res.data.message)
} }
}, },
err => { err => {}
}
) )
} else { } else {}
}
}); });
}, },
getEmployeeList () { getEmployeeList() {
let userInfo = this.getLocalStorage() let userInfo = this.getLocalStorage()
let msg = { let msg = {
GroupId: userInfo.RB_Group_id, GroupId: userInfo.RB_Group_id,
...@@ -247,65 +193,40 @@ export default { ...@@ -247,65 +193,40 @@ export default {
this.EmployeeList = res.data.data this.EmployeeList = res.data.data
} }
}, },
err => { err => {}
}
) )
}, },
getList() {
getLineList() { this.loading = true;
this.apipost("line_post_GetAllList_V2", {LineDirection: 0}, res => {
if (res.data.resultCode == 1) {
this.LineList = res.data.data;
}
});
},
linkageDepartment(){
this.departmentMsg.RB_Branch_Id=this.form.BranchId;
this.departmentList=[];
this.form.DepartmentId=-1;
this.getDepartment();
},
getDepart(id){
this.form.DepartmentId= id;
this.$forceUpdate();
},
getDepartment() {
this.apipost('admin_get_DepartmentGetList', this.departmentMsg, res => {
if(res.data.resultCode == 1) {
this.departmentList = res.data.data;
}
}, err => {})
},
getList(){
this.loading=true;
this.apipost("OPCommission_GetPageList", {}, res => { this.apipost("OPCommission_GetPageList", {}, res => {
this.loading=false; this.loading = false;
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.dataList = res.data.data; this.dataList = res.data.data;
// allzb // allzb
let num=0; let num = 0;
this.dataList.forEach(item=>{ this.dataList.forEach(item => {
item.OPCommissionList.forEach(com=>{ item.OPCommissionList.forEach(com => {
num+=com.CommissionPercent; num += com.CommissionPercent;
}) })
}) })
this.allzb=100-num; this.allzb = 100 - num;
} }
}); });
}, },
} }
} }
</script> </script>
<style> <style>
.Feedback ul>li{ .Feedback ul>li {
display: inline-block; display: inline-block;
font-size: 12px; font-size: 12px;
color: #666; color: #666;
margin: 20px 30px 0px 0; margin: 20px 30px 0px 0;
} }
.Feedback .singeRowTable{
.Feedback .singeRowTable {
margin-top: 20px; margin-top: 20px;
} }
</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