Commit 021b4496 authored by 罗超's avatar 罗超

调整返佣显示和修改服务人员BUG

parent cac8dfc1
<style> <style>
.delAssist { .delAssist {
position: absolute; position: absolute;
right: -16px; right: -16px;
top: -12px; top: -12px;
display: inline-block; display: inline-block;
background: red; background: red;
border-radius: 50%; border-radius: 50%;
color: #fff; color: #fff;
width: 20px; width: 20px;
height: 20px; height: 20px;
text-align: center; text-align: center;
line-height: 20px; line-height: 20px;
cursor: pointer; cursor: pointer;
} }
.studentAssitTable { .studentAssitTable {
width: 100%; width: 100%;
text-align: center; text-align: center;
} }
.studentAssitTable td { .studentAssitTable td {
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
border: 1px solid #f2f2f2; border: 1px solid #f2f2f2;
} }
.studentAssitTable th { .studentAssitTable th {
height: 40px; height: 40px;
background-color: #f2f2f2; background-color: #f2f2f2;
} }
</style> </style>
<template> <template>
<div> <div>
<!--课程顾问 或有教师权限--> <!--课程顾问 或有教师权限-->
<template v-if="userInfo.IsCourseConsultant == 1||isHaveTeacherEdit||isHaveXueManager"> <template
<q-btn label="新增" color="accent q-mb-lg" size="sm" @click="isShowAdd = true" /> v-if="
userInfo.IsCourseConsultant == 1 ||
isHaveTeacherEdit ||
isHaveXueManager
"
>
<q-btn
label="新增"
color="accent q-mb-lg"
size="sm"
@click="isShowAdd = true"
/>
</template> </template>
<template v-else> <template v-else>
<span class="text-grey-4">抱歉,你没有权限邀请其他服务人员</span> <span class="text-grey-4">抱歉,你没有权限邀请其他服务人员</span>
</template> </template>
<q-btn label="取消" style="margin-left:20px;" v-if="isShowAdd" flat color="grey-10 q-mb-lg" size="sm" <q-btn
@click="isShowAdd = false" /> label="取消"
style="margin-left:20px;"
v-if="isShowAdd"
flat
color="grey-10 q-mb-lg"
size="sm"
@click="isShowAdd = false"
/>
<template v-if="isShowAdd"> <template v-if="isShowAdd">
<div class="row wrap"> <div class="row wrap">
<q-select filled stack-label option-label="Name" @input="changeData" v-model="AssitMsg.AssistType" <q-select
option-value="Id" :options="AssistDropList" label="角色" dense class="col-6 q-pb-lg q-pr-lg" emit-value filled
map-options /> stack-label
<q-select filled dense v-if="AssitMsg.AssistType == 2" v-model="AssitMsg.AssistId" :options="RoleListData" option-label="Name"
option-label="EmployeeName" class="col-6 q-pb-lg" option-value="Id" emit-value map-options /> @input="changeData"
<q-select filled dense v-if="AssitMsg.AssistType == 4" v-model="AssitMsg.AssistId" v-model="AssitMsg.AssistType"
:options="TeacherList" option-label="EmployeeName" class="col-6 q-pb-lg" option-value="Id" emit-value option-value="Id"
map-options /> :options="AssistDropList"
<q-select filled dense v-else v-model="AssitMsg.AssistId" @filter="filterEmployee" use-input label="角色"
:options="myEmployeeList" option-label="EmployeeName" class="col-6 q-pb-lg" option-value="Id" emit-value dense
map-options /> use-input
class="col-6 q-pb-lg q-pr-lg"
emit-value
map-options
/>
<q-select
filled
dense
v-if="AssitMsg.AssistType == 2"
v-model="AssitMsg.AssistId"
:options="RoleListData"
option-label="EmployeeName"
class="col-6 q-pb-lg"
option-value="Id"
emit-value
use-input
map-options
/>
<q-select
filled
dense
v-else-if="AssitMsg.AssistType == 4"
v-model="AssitMsg.AssistId"
:options="TeacherList"
option-label="EmployeeName"
class="col-6 q-pb-lg"
option-value="Id"
emit-value
use-input
map-options
/>
<q-select
filled
dense
v-else
v-model="AssitMsg.AssistId"
@filter="filterEmployee"
use-input
:options="myEmployeeList"
option-label="EmployeeName"
class="col-6 q-pb-lg"
option-value="Id"
emit-value
map-options
/>
<i class="iconfont icon-close delAssist"></i> <i class="iconfont icon-close delAssist"></i>
</div> </div>
<div class="row wrap" style="margin-bottom:10px;float:right;"> <div class="row wrap" style="margin-bottom:10px;float:right;">
<q-btn label="保存" color="accent q-mb-lg" size="md" @click="saveAssit()" /> <q-btn
label="保存"
color="accent q-mb-lg"
size="md"
@click="saveAssit()"
/>
</div> </div>
</template> </template>
<div v-if="dataList.length > 0"> <div v-if="dataList.length > 0">
<table class="studentAssitTable" style="border:1px solid #f2f2f2;border-collapse:collapse;" cellspacing="0" <table
cellpadding="0"> class="studentAssitTable"
style="border:1px solid #f2f2f2;border-collapse:collapse;"
cellspacing="0"
cellpadding="0"
>
<tr> <tr>
<th style="width:180px;">角色</th> <th style="width:180px;">角色</th>
<th style="width:180px;">人员</th> <th style="width:180px;">人员</th>
...@@ -73,18 +144,57 @@ ...@@ -73,18 +144,57 @@
<td>{{ item.AssistTypeName }}</td> <td>{{ item.AssistTypeName }}</td>
<td>{{ item.AssistName }}</td> <td>{{ item.AssistName }}</td>
<td> <td>
<template v-if="userInfo.IsCourseConsultant == 1||isHaveTeacherEdit||isHaveXueManager"> <template
<div v-if="userInfo.IsCourseConsultant == 1&&(item.AssistType == 2 ||item.AssistType == 3)"> v-if="
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="修改" userInfo.IsCourseConsultant == 1 ||
@click="getEditInfo(item)"></q-btn> isHaveTeacherEdit ||
<q-btn flat size="xs" icon="delete" color="negative" style="font-weight:400" label="删除" isHaveXueManager
@click="deleteAssits(item.Id)" /> "
>
<div
v-if="
userInfo.IsCourseConsultant == 1 &&
(item.AssistType == 2 || item.AssistType == 3)
"
>
<q-btn
flat
size="xs"
icon="edit"
color="accent"
style="font-weight:400"
label="修改"
@click="getEditInfo(item)"
></q-btn>
<q-btn
flat
size="xs"
icon="delete"
color="negative"
style="font-weight:400"
label="删除"
@click="deleteAssits(item.Id)"
/>
</div> </div>
<div v-if="isHaveTeacherEdit &&item.AssistType ==4"> <div v-if="isHaveTeacherEdit && item.AssistType == 4">
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="修改" <q-btn
@click="getEditInfo(item)"></q-btn> flat
<q-btn flat size="xs" icon="delete" color="negative" style="font-weight:400" label="删除" size="xs"
@click="deleteAssits(item.Id)" /> icon="edit"
color="accent"
style="font-weight:400"
label="修改"
@click="getEditInfo(item)"
></q-btn>
<q-btn
flat
size="xs"
icon="delete"
color="negative"
style="font-weight:400"
label="删除"
@click="deleteAssits(item.Id)"
/>
</div> </div>
</template> </template>
</td> </td>
...@@ -94,223 +204,219 @@ ...@@ -94,223 +204,219 @@
</div> </div>
</template> </template>
<script> <script>
import { import {
GetAssistTypeList, GetAssistTypeList,
SetStudentAssist, SetStudentAssist,
GetStudentAssistList, GetStudentAssistList,
RemoveStudentAssist RemoveStudentAssist
} from "../../../api/sale/sale"; } from "../../../api/sale/sale";
import { import { queryEmployee } from "../../../api/users/user";
queryEmployee import { mapState } from "vuex";
} from "../../../api/users/user";
import {
mapState
} from "vuex";
export default { export default {
meta: { meta: {
title: "" title: ""
},
components: {},
props: {
saveObj: {
type: Object,
default: null
}, },
components: {}, BelongType: {
props: { type: Number,
saveObj: { default: null
type: Object, }
default: null },
data() {
return {
isShowAdd: false,
AssitMsg: {
StuId: 1, //学员编号
Id: 0, //编号
AssistId: "", //员工编号
AssistType: "" //类型
},
msg: {
StuId: 1
}, },
BelongType: { isShowEdit: false,
type: Number, dataList: [],
default: null page_Count: 0,
AssistDropList: [], //下拉数据
RoleListData: [], //课程顾问下拉数据
TeacherList: [], //教师列表
employeeList: [],
myEmployeeList: [],
userInfo: {}
};
},
created() {
this.userInfo = this.getLocalStorage();
if (this.saveObj && this.saveObj.StuId) {
this.AssitMsg.StuId = this.saveObj.StuId;
this.msg.StuId = this.saveObj.StuId;
}
},
computed: mapState({
isHaveTeacherEdit(state) {
if (
state.user.userInfo &&
state.user.userInfo.ActionMenuList &&
state.user.userInfo.ActionMenuList.length > 0
) {
let action = state.user.userInfo.ActionMenuList.find(x => {
if (x.FunctionCode == "Query_TeacherAssist") {
return x;
}
});
if (action) {
return true;
}
} }
return false;
}
}),
mounted() {
this.getList();
this.GetAssistTypeList();
},
methods: {
//获取协助人员
GetAssistTypeList() {
this.AssistDropList = [];
GetAssistTypeList({}).then(res => {
if (res.Code == 1) {
let template = res.Data;
template.forEach(x => {
if (this.userInfo.IsCourseConsultant == 1) {
if (x.Id != 1) {
this.AssistDropList.push(x);
}
if (x.Id == 4 && this.isHaveTeacherEdit) {
this.AssistDropList.push(x);
}
} else if (this.userInfo.IsCourseConsultant == 0) {
if (this.isHaveTeacherEdit) {
if (x.Id == 4) {
this.AssistDropList.push(x);
}
}
}
});
}
});
}, },
data() { changeData() {
return { var queryObj = {
isShowAdd: false, IsLeave: 1,
AssitMsg: { UserRole: 0,
StuId: 1, //学员编号 AccountTypeStr: ""
Id: 0, //编号
AssistId: "", //员工编号
AssistType: "" //类型
},
msg: {
StuId: 1
},
isShowEdit: false,
dataList: [],
page_Count: 0,
AssistDropList: [], //下拉数据
RoleListData: [], //课程顾问下拉数据
TeacherList: [], //教师列表
employeeList: [],
myEmployeeList: [],
userInfo: {}
}; };
}, if (this.AssitMsg.AssistType == 2) {
created() { queryObj.UserRole = 2;
this.userInfo = this.getLocalStorage(); queryEmployee(queryObj).then(res => {
if (this.saveObj && this.saveObj.StuId) { this.RoleListData = res.Data;
this.AssitMsg.StuId = this.saveObj.StuId; });
this.msg.StuId = this.saveObj.StuId; }
if (this.AssitMsg.AssistType == 4) {
queryObj.AccountTypeStr = "2";
queryEmployee(queryObj).then(res => {
this.TeacherList = res.Data;
});
} else {
queryObj.UserRole = 0;
queryEmployee(queryObj).then(res => {
this.employeeList = res.Data;
this.myEmployeeList = res.Data;
});
} }
}, },
computed: mapState({ //筛选员工
isHaveTeacherEdit(state) { filterEmployee(val, update, abort) {
if ( update(() => {
state.user.userInfo && this.myEmployeeList = this.employeeList.filter(
state.user.userInfo.ActionMenuList && v => v.EmployeeName.indexOf(val) > -1
state.user.userInfo.ActionMenuList.length > 0 );
) { });
let action = state.user.userInfo.ActionMenuList.find(x => {
if (x.FunctionCode == "Query_TeacherAssist") {
return x;
}
});
if (action) {
return true;
}
}
return false;
},
}),
mounted() {
this.getList();
this.GetAssistTypeList();
}, },
methods: { //保存协同人员
//获取协助人员 saveAssit() {
GetAssistTypeList() { SetStudentAssist(this.AssitMsg)
this.AssistDropList = []; .then(res => {
GetAssistTypeList({}).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
let template = res.Data; this.$q.notify({
template.forEach(x => { icon: "iconfont icon-chenggong",
if (this.userInfo.IsCourseConsultant == 1) { color: "accent",
if (x.Id != 1) { timeout: 2000,
this.AssistDropList.push(x); message: "数据保存成功!",
} position: "top"
if (x.Id == 4 && this.isHaveTeacherEdit) {
this.AssistDropList.push(x);
}
} else if (this.userInfo.IsCourseConsultant == 0) {
if (this.isHaveTeacherEdit) {
if (x.Id == 4) {
this.AssistDropList.push(x);
}
}
}
}); });
this.$emit("success");
this.getList();
this.isShowAdd = false;
this.clearMsg();
} }
}); })
}, .catch(() => {});
changeData() { },
var queryObj = { clearMsg() {
IsLeave: 1, this.AssitMsg.Id = 0;
UserRole: 0, this.AssitMsg.AssistId = 1;
AccountTypeStr: "", this.AssitMsg.AssistType = 1;
}; },
if (this.AssitMsg.AssistType == 2) { //获取数据
queryObj.UserRole = 2; getList() {
queryEmployee(queryObj).then(res => { GetStudentAssistList(this.msg)
this.RoleListData = res.Data; .then(res => {
}); if (res.Code == 1) {
} this.dataList = res.Data;
if (this.AssitMsg.AssistType == 4) { }
queryObj.AccountTypeStr = "2" })
queryEmployee(queryObj).then(res => { .catch(() => {});
this.TeacherList = res.Data; },
}); //删除协同
} else { deleteAssits(Id) {
queryObj.UserRole = 0; let that = this;
queryEmployee(queryObj).then(res => { this.$q
this.employeeList = res.Data; .dialog({
this.myEmployeeList = res.Data; title: "提示信息",
}); message: "是否确定删除?",
} cancel: true,
}, persistent: true,
//筛选员工 ok: "确定",
filterEmployee(val, update, abort) { cancel: "取消"
update(() => { })
this.myEmployeeList = this.employeeList.filter( .onOk(() => {
v => v.EmployeeName.indexOf(val) > -1 RemoveStudentAssist({
); Id: Id
}); }).then(res => {
}, that.$q.notify({
//保存协同人员 icon: "iconfont icon-chenggong",
saveAssit() { timeout: 2000,
SetStudentAssist(this.AssitMsg) message: res.Message,
.then(res => { position: "top"
if (res.Code == 1) {
this.$q.notify({
icon: "iconfont icon-chenggong",
color: "accent",
timeout: 2000,
message: "数据保存成功!",
position: "top"
});
this.$emit("success");
this.getList();
this.isShowAdd = false;
this.clearMsg();
}
})
.catch(() => {});
},
clearMsg() {
this.AssitMsg.Id = 0;
this.AssitMsg.AssistId = 1;
this.AssitMsg.AssistType = 1;
},
//获取数据
getList() {
GetStudentAssistList(this.msg)
.then(res => {
if (res.Code == 1) {
this.dataList = res.Data;
}
})
.catch(() => {});
},
//删除协同
deleteAssits(Id) {
let that = this;
this.$q
.dialog({
title: "提示信息",
message: "是否确定删除?",
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消"
})
.onOk(() => {
RemoveStudentAssist({
Id: Id
}).then(res => {
that.$q.notify({
icon: "iconfont icon-chenggong",
timeout: 2000,
message: res.Message,
position: "top"
});
that.getList();
}); });
}) that.getList();
.onCancel(() => {}); });
}, })
//获取修改数据 .onCancel(() => {});
getEditInfo(obj) { },
this.AssitMsg.Id = obj.Id; //获取修改数据
this.AssitMsg.AssistId = obj.AssistId; getEditInfo(obj) {
this.AssitMsg.AssistType = obj.AssistType; this.AssitMsg.Id = obj.Id;
this.isShowAdd = true; this.AssitMsg.AssistId = obj.AssistId;
}, this.AssitMsg.AssistType = obj.AssistType;
getGuwenEditInfo(obj) { this.isShowAdd = true;
this.getRole(); this.changeData();
this.AssitMsg.Id = obj.Id; },
this.AssitMsg.AssistId = obj.AssistId; getGuwenEditInfo(obj) {
this.AssitMsg.AssistType = obj.AssistType; this.getRole();
this.isShowAdd = true; this.AssitMsg.Id = obj.Id;
} this.AssitMsg.AssistId = obj.AssistId;
this.AssitMsg.AssistType = obj.AssistType;
this.isShowAdd = true;
} }
}; }
</script> };
\ No newline at end of file </script>
<style scoped> <style scoped>
@import "../css/cssReset.css"; @import "../css/cssReset.css";
.January{ .January {
background-color: #B3E5FC; background-color: #b3e5fc;
} }
.February{ .February {
background-color: #C8E6C9; background-color: #c8e6c9;
} }
.March{ .March {
background-color: #FFCCD2; background-color: #ffccd2;
} }
.April{ .April {
background-color: #F8DDE0; background-color: #f8dde0;
} }
.May{ .May {
background-color: #E1BEE7; background-color: #e1bee7;
} }
.June{ .June {
background-color: #D1C4E9; background-color: #d1c4e9;
} }
.July{ .July {
background-color: #C5CAE9; background-color: #c5cae9;
} }
.August{ .August {
background-color: #F0F4C3; background-color: #f0f4c3;
} }
.September{ .September {
background-color: #FFF9C4; background-color: #fff9c4;
} }
.October{ .October {
background-color: #FFECB3; background-color: #ffecb3;
} }
.November{ .November {
background-color: #FFE0B2; background-color: #ffe0b2;
} }
.December{ .December {
background-color: #FFCCBC; background-color: #ffccbc;
} }
.singeRowTable tr:nth-child(2n + 1) { .singeRowTable tr:nth-child(2n + 1) {
background: none; background: none;
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
border: 1px solid #d2d2d2; border: 1px solid #d2d2d2;
} }
.SubtotalBj { .SubtotalBj {
background-color: #A5A5A5; background-color: #a5a5a5;
} }
.stulistNumber { .stulistNumber {
...@@ -121,8 +121,15 @@ ...@@ -121,8 +121,15 @@
<div class="col-3"> <div class="col-3">
<q-field filled dense> <q-field filled dense>
<template v-slot:control> <template v-slot:control>
<el-date-picker v-model="dateArray[0]" style="width:100%" value-format="yyyy-MM" @change="resetSearch()" <el-date-picker
size="small" type="month" placeholder="选择开始年月"> v-model="dateArray[0]"
style="width:100%"
value-format="yyyy-MM"
@change="resetSearch()"
size="small"
type="month"
placeholder="选择开始年月"
>
</el-date-picker> </el-date-picker>
</template> </template>
</q-field> </q-field>
...@@ -130,20 +137,35 @@ ...@@ -130,20 +137,35 @@
<div class="col-3"> <div class="col-3">
<q-field filled dense> <q-field filled dense>
<template v-slot:control> <template v-slot:control>
<el-date-picker v-model="dateArray[1]" style="width:100%" value-format="yyyy-MM" @change="resetSearch()" <el-date-picker
size="small" type="month" placeholder="选择结束年月"> v-model="dateArray[1]"
style="width:100%"
value-format="yyyy-MM"
@change="resetSearch()"
size="small"
type="month"
placeholder="选择结束年月"
>
</el-date-picker> </el-date-picker>
</template> </template>
</q-field> </q-field>
</div> </div>
</div> </div>
</div> </div>
<div class="page-search row items-center" style="justify-content: space-between;"> <div
<div></div> class="page-search row items-center"
<q-btn  color="primary" size="11px" label="导出" @click="tcexport" style="margin-left:10px"/> style="justify-content: space-between;"
>
<div></div>
<q-btn
color="primary"
size="11px"
label="导出"
@click="tcexport"
style="margin-left:10px"
/>
</div> </div>
<div style="width: 100%;margin-top: 20px"> <div style="width: 100%;margin-top: 20px">
<div style="width: 100%;overflow-x: auto;"> <div style="width: 100%;overflow-x: auto;">
<table <table
...@@ -171,18 +193,33 @@ ...@@ -171,18 +193,33 @@
style="min-width: 500px;" style="min-width: 500px;"
v-for="(item, index) in RListlength" v-for="(item, index) in RListlength"
:key="index" :key="index"
:class="item.Month.slice(6)==1?'January': :class="
(item.Month.slice(6)==2?'February': item.Month.slice(6) == 1
(item.Month.slice(6)==3?'March': ? 'January'
(item.Month.slice(6)==4?'April': : item.Month.slice(6) == 2
(item.Month.slice(6)==5?'May': ? 'February'
(item.Month.slice(6)==6?'June': : item.Month.slice(6) == 3
(item.Month.slice(6)==7?'July': ? 'March'
(item.Month.slice(6)==7?'August': : item.Month.slice(6) == 4
(item.Month.slice(6)==7?'September': ? 'April'
(item.Month.slice(5)==10?'October': : item.Month.slice(6) == 5
(item.Month.slice(5)==11?'November': ? 'May'
(item.Month.slice(5)==12?'December':'')))))))))))" : item.Month.slice(6) == 6
? 'June'
: item.Month.slice(6) == 7
? 'July'
: item.Month.slice(6) == 7
? 'August'
: item.Month.slice(6) == 7
? 'September'
: item.Month.slice(5) == 10
? 'October'
: item.Month.slice(5) == 11
? 'November'
: item.Month.slice(5) == 12
? 'December'
: ''
"
> >
<span v-if="item.Month.slice(5) < 10">{{ <span v-if="item.Month.slice(5) < 10">{{
item.Month.slice(6) item.Month.slice(6)
...@@ -208,7 +245,7 @@ ...@@ -208,7 +245,7 @@
v-for="(item, index) in dataList" v-for="(item, index) in dataList"
:key="index" :key="index"
v-if="dataList && dataList.length > 0" v-if="dataList && dataList.length > 0"
:class="item.RoleName=='小计'? 'SubtotalBj' : ''" :class="item.RoleName == '小计' ? 'SubtotalBj' : ''"
> >
<td style=" border: 1px solid #d2d2d2;"> <td style=" border: 1px solid #d2d2d2;">
{{ item.DeptName }} {{ item.DeptName }}
...@@ -219,14 +256,16 @@ ...@@ -219,14 +256,16 @@
<td> <td>
{{ item.EmpName }} {{ item.EmpName }}
</td> </td>
<td v-for="(x, y) in titlelist" :key="y" <td v-for="(x, y) in titlelist" :key="y">
>
<div v-if="item.MonthList[x.index]"> <div v-if="item.MonthList[x.index]">
<div v-if="x.Id == 1"> <div v-if="x.Id == 1">
<span>{{ item.MonthList[x.index].Achievement }}</span> <span>{{ item.MonthList[x.index].Achievement }}</span>
</div> </div>
<div v-if="x.Id == 2" style="padding: 7px;"> <div v-if="x.Id == 2" style="padding: 7px;">
<span>{{ item.MonthList[x.index].Rate }}</span> <span
>{{ item.MonthList[x.index].Rate
}}{{ item.MonthList[x.index].Rate ? "%" : "" }}</span
>
</div> </div>
<div v-if="x.Id == 3" style="padding: 3px;"> <div v-if="x.Id == 3" style="padding: 3px;">
<span>{{ item.MonthList[x.index].Rebate }}</span> <span>{{ item.MonthList[x.index].Rebate }}</span>
...@@ -295,7 +334,7 @@ export default { ...@@ -295,7 +334,7 @@ export default {
dataList: [], //列表数据 dataList: [], //列表数据
dateArray: [], //日期数组 dateArray: [], //日期数组
RListlength: 0, RListlength: 0,
titlelist: [], titlelist: []
}; };
}, },
created() {}, created() {},
...@@ -309,18 +348,23 @@ export default { ...@@ -309,18 +348,23 @@ export default {
this.getList(); //获取数据 this.getList(); //获取数据
}, },
methods: { methods: {
tcexport(){//导出 tcexport() {
var msg = JSON.parse(JSON.stringify(this.msg)); //导出
EduDownLoad("/SellAchievements/GetSellAchievementsRankStatToExcel", msg, "业绩提成排名.xls") var msg = JSON.parse(JSON.stringify(this.msg));
EduDownLoad(
"/SellAchievements/GetSellAchievementsRankStatToExcel",
msg,
"业绩提成排名.xls"
);
}, },
resetSearch() { resetSearch() {
if(!this.dateArray[0]||!this.dateArray[1]){ if (!this.dateArray[0] || !this.dateArray[1]) {
this.$q.notify({ this.$q.notify({
type: 'negative', type: "negative",
position: "top", position: "top",
message: `请选择开始和结束时间` message: `请选择开始和结束时间`
}) });
return return;
} }
this.msg.pageIndex = 1; this.msg.pageIndex = 1;
this.getList(); this.getList();
...@@ -379,27 +423,27 @@ export default { ...@@ -379,27 +423,27 @@ export default {
for (let i = 0; i < this.RListlength.length; i++) { for (let i = 0; i < this.RListlength.length; i++) {
let obj = [ let obj = [
{ {
Name: "业绩", Name: "一般业绩",
Id: 1, Id: 1,
index: i index: i
}, },
{ {
Name: "业绩比例", Name: "返佣总额",
Id: 2, Id: 3,
index: i index: i
}, },
{ {
Name: "订单返佣", Name: "业绩比例",
Id: 3, Id: 2,
index: i index: i
}, },
{ {
Name: "提成", Name: "销售提成",
Id: 4, Id: 4,
index: i index: i
}, },
{ {
Name: "返佣金额", Name: "销售佣金",
Id: 5, Id: 5,
index: i index: i
}, },
...@@ -409,7 +453,7 @@ export default { ...@@ -409,7 +453,7 @@ export default {
index: i index: i
}, },
{ {
Name: "合计", Name: "销售收入合计",
Id: 7, Id: 7,
index: i index: i
} }
...@@ -420,7 +464,7 @@ export default { ...@@ -420,7 +464,7 @@ export default {
.catch(() => { .catch(() => {
this.loading = false; this.loading = false;
}); });
}, }
} }
}; };
</script> </script>
......
<style> <style>
.baseSet_Title { .baseSet_Title {
width: 120px !important; width: 120px !important;
padding: 18px 0 0 16px; padding: 18px 0 0 16px;
text-align: right; text-align: right;
} }
.CommissionDetail .border-bottom { .CommissionDetail .border-bottom {
padding-bottom: 5px; padding-bottom: 5px;
margin-bottom: 5px; margin-bottom: 5px;
} }
.CommissionDetail .text-bottom { .CommissionDetail .text-bottom {
height: 32px; height: 32px;
line-height: 32px; line-height: 32px;
margin-bottom: 10px; margin-bottom: 10px;
} }
.CommissionDetail ._icon_btn i.icon-sousuo { .CommissionDetail ._icon_btn i.icon-sousuo {
background-color: #47bf8c; background-color: #47bf8c;
} }
.CommissionDetail ._icon_btn i { .CommissionDetail ._icon_btn i {
width: 26px; width: 26px;
height: 26px; height: 26px;
display: inline-block; display: inline-block;
color: white !important; color: white !important;
border-radius: 50%; border-radius: 50%;
text-align: center; text-align: center;
line-height: 26px; line-height: 26px;
margin-right: 10px; margin-right: 10px;
cursor: pointer; cursor: pointer;
outline: none; outline: none;
} }
.CommissionDetail .el-table td, .CommissionDetail .el-table td,
.el-table th { .el-table th {
padding: 5px 0; padding: 5px 0;
} }
</style> </style>
<template> <template>
<div class="page-body CommissionDetail"> <div class="page-body CommissionDetail">
<div class="page-search row items-center"> <div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md"> <div class="col row wrap q-mr-lg q-col-gutter-md">
<div style="margin-right: 10px;"> <div style="margin-right: 10px;">
<q-btn color="primary" size="11px" label="返回" @click="goreturn" style="margin-left:10px" /> <q-btn
color="primary"
size="11px"
label="返回"
@click="goreturn"
style="margin-left:10px"
/>
</div> </div>
<div class="col row wrap q-mr-lg q-col-gutter-md"> <div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3" v-if="isShowFrom"> <div class="col-3" v-if="isShowFrom">
<q-select filled stack-label :disable="!isShowFrom" input-debounce="0" option-value="Id" @input="getlaiyuan" <q-select
option-label="Name" v-model="msg.OrderSourceType" :options="customFromList" label="来源" dense filled
emit-value map-options> stack-label
:disable="!isShowFrom"
input-debounce="0"
option-value="Id"
@input="getlaiyuan"
option-label="Name"
v-model="msg.OrderSourceType"
:options="customFromList"
label="返佣类型"
dense
emit-value
map-options
>
</q-select> </q-select>
</div> </div>
<div class="col-3" v-if="msg.OrderSourceType == 1 || msg.OrderSourceType == 3"> <div
<q-select filled stack-label clearable v-model="msg.UserDept" dense :options="DepartmentList" class="col-3"
use-input @input="getList(),getEmployeeList()" label="部门" @filter="filterEmployee" option-label="DeptName" v-if="msg.OrderSourceType == 1 || msg.OrderSourceType == 3"
option-value="DeptId" emit-value map-options> >
<q-select
filled
stack-label
clearable
v-model="msg.UserDept"
dense
:options="DepartmentList"
use-input
@input="getList(), getEmployeeList()"
label="部门"
@filter="filterEmployee"
option-label="DeptName"
option-value="DeptId"
emit-value
map-options
>
<template v-slot:no-option> <template v-slot:no-option>
<q-item> <q-item>
<q-item-section class="text-grey">未找到相关数据</q-item-section> <q-item-section class="text-grey"
>未找到相关数据</q-item-section
>
</q-item> </q-item>
</template> </template>
</q-select> </q-select>
</div> </div>
<div class="col-3" v-if="msg.OrderSourceType == 1 || msg.OrderSourceType == 3"> <div
<q-select filled stack-label clearable v-model="msg.OrderSourceId" dense :options="myEmployeeList" class="col-3"
use-input @input="getList" label="人员" @filter="filterEmployee" option-label="EmployeeName" v-if="msg.OrderSourceType == 1 || msg.OrderSourceType == 3"
option-value="Id" emit-value map-options> >
<q-select
filled
stack-label
clearable
v-model="msg.OrderSourceId"
dense
:options="myEmployeeList"
use-input
@input="getList"
label="人员"
@filter="filterEmployee"
option-label="EmployeeName"
option-value="Id"
emit-value
map-options
>
<template v-slot:no-option> <template v-slot:no-option>
<q-item> <q-item>
<q-item-section class="text-grey">未找到相关数据</q-item-section> <q-item-section class="text-grey"
>未找到相关数据</q-item-section
>
</q-item> </q-item>
</template> </template>
</q-select> </q-select>
</div> </div>
<div class="col-3" v-if="msg.OrderSourceType == 2"> <div class="col-3" v-if="msg.OrderSourceType == 2">
<q-select filled stack-label v-model="msg.OrderSourceId" clearable dense :options="customList" <q-select
use-input @input="getList" label="关联同行" @filter="filterFn" option-label="CustomerName" filled
option-value="CustomerId" emit-value map-options> stack-label
v-model="msg.OrderSourceId"
clearable
dense
:options="customList"
use-input
@input="getList"
label="关联同行"
@filter="filterFn"
option-label="CustomerName"
option-value="CustomerId"
emit-value
map-options
>
<template v-slot:no-option> <template v-slot:no-option>
<q-item> <q-item>
<q-item-section class="text-grey">未找到相关数据</q-item-section> <q-item-section class="text-grey"
>未找到相关数据</q-item-section
>
</q-item> </q-item>
</template> </template>
</q-select> </q-select>
</div> </div>
<div class="col-3" v-if="msg.OrderSourceType == 4"> <div class="col-3" v-if="msg.OrderSourceType == 4">
<q-select filled clearable stack-label v-model="msg.OrderSourceId" dense :options="InvitationList" <q-select
use-input @input="getList" label="转介人" @filter="filterFnStudent" option-label="StuName" filled
option-value="StuId" emit-value map-options> clearable
stack-label
v-model="msg.OrderSourceId"
dense
:options="InvitationList"
use-input
@input="getList"
label="转介人"
@filter="filterFnStudent"
option-label="StuName"
option-value="StuId"
emit-value
map-options
>
<template v-slot:no-option> <template v-slot:no-option>
<q-item> <q-item>
<q-item-section class="text-grey">未找到相关数据</q-item-section> <q-item-section class="text-grey"
>未找到相关数据</q-item-section
>
</q-item> </q-item>
</template> </template>
</q-select> </q-select>
</div> </div>
<div class="col-3" style="float:right;"> <div class="col-3" style="float:right;">
<q-btn color="accent" class="q-mr-md" size="sm" icon="download" style="margin-top:6px;" @click="DownLoadCommissionUserList" label="下载" /> <q-btn
color="accent"
class="q-mr-md"
size="sm"
icon="download"
style="margin-top:6px;"
@click="DownLoadCommissionUserList"
label="下载"
/>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<template> <template>
<el-table ref="filterTable" :data="tableData" v-loading="loading" <el-table
:header-cell-style="{ backgroundColor: '#f5f6f7', color: '#a8a8b3' }" border style="width: 100%"> ref="filterTable"
:data="tableData"
v-loading="loading"
:header-cell-style="{ backgroundColor: '#f5f6f7', color: '#a8a8b3' }"
border
style="width: 100%"
>
<el-table-column prop="SchoolName" label="校区"></el-table-column> <el-table-column prop="SchoolName" label="校区"></el-table-column>
<el-table-column prop="UserDeptName" label="部门"></el-table-column> <el-table-column prop="UserDeptName" label="部门"></el-table-column>
<el-table-column prop="UserName" label="人员" :filters="UserNamelist" :filter-method="filterHandler"> <el-table-column
prop="UserName"
label="人员"
:filters="UserNamelist"
:filter-method="filterHandler"
>
</el-table-column> </el-table-column>
<el-table-column prop="OrderSourceTypeName" label="类型"></el-table-column> <el-table-column label="类型">
<el-table-column prop="StudentCount" label="学生数量" sortable :sort-method="StudentCount"></el-table-column> <template slot-scope="scope">
<el-table-column prop="CommissionMoeny" label="提成金额" sortable :sort-method="CommissionMoeny"></el-table-column> {{
scope.row.OrderSourceType == 1 || scope.row.OrderSourceType == 3
? "员工"
: ""
}}
{{ scope.row.OrderSourceType == 2 ? "同业" : "" }}
{{ scope.row.OrderSourceType == 4 ? "学员" : "" }}
</template>
</el-table-column>
<el-table-column
prop="StudentCount"
label="学生数量"
sortable
:sort-method="StudentCount"
></el-table-column>
<el-table-column
prop="CommissionMoeny"
label="提成金额"
sortable
:sort-method="CommissionMoeny"
></el-table-column>
<el-table-column label="操作"> <el-table-column label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="_icon_btn"> <div class="_icon_btn">
<el-tooltip class="item" effect="dark" content="查看" placement="top"> <el-tooltip
<i class="iconfont icon-sousuo" class="item"
@click="goUrl('returnPassbook/returnpassbookStatistics', scope.row)"></i> effect="dark"
content="查看"
placement="top"
>
<i
class="iconfont icon-sousuo"
@click="
goUrl('returnPassbook/returnpassbookStatistics', scope.row)
"
></i>
</el-tooltip> </el-tooltip>
</div> </div>
</template> </template>
...@@ -127,324 +259,324 @@ ...@@ -127,324 +259,324 @@
</div> </div>
</template> </template>
<script> <script>
import { import { GetClassTypePageList } from "../../../api/system/index";
GetClassTypePageList, import { GetStudentList } from "../../../api/course/class";
} from '../../../api/system/index'; import { getCommissionUserList } from "../../../api/finance/index";
import { import { getStudentDorpDownList } from "../../../api/school/index";
GetStudentList,
} from '../../../api/course/class';
import {
getCommissionUserList,
} from '../../../api/finance/index'
import {
getStudentDorpDownList
} from "../../../api/school/index";
import { import { getDeptList } from "../../../api/system/dept";
getDeptList
} from '../../../api/system/dept'
import { import { queryEmployee } from "../../../api/users/user";
queryEmployee import { CreateTypeList, GetCustomerList } from "../../../api/sale/sale";
} from '../../../api/users/user' import { EduDownLoad } from "../../../api/common/common";
import { import { mapState } from "vuex";
CreateTypeList, export default {
GetCustomerList meta: {
} from '../../../api/sale/sale' title: "销售提成详情"
import { },
EduDownLoad props: {},
} from "../../../api/common/common"; components: {},
import { data() {
mapState return {
} from "vuex"; loading: false,
export default { //列表数据参数
meta: { msg: {
title: "销售提成详情" BatchId: 0,
}, SchoolId: "-1",
props: {}, Status: "-2",
components: {}, OrderSourceType: "-1",
data() { OrderSourceId: "",
return { Q_SelectNormal: "2",
loading: false, UserDept: ""
//列表数据参数 },
msg: { pageCount: 0,
BatchId: 0, persistent: false,
SchoolId: '-1', tableData: [],
Status: '-2', StatusList: [
OrderSourceType: '-1', {
OrderSourceId: '', Id: "-2",
Q_SelectNormal: '2', Name: "不限"
UserDept: "",
}, },
pageCount: 0, {
persistent: false, Id: "-1",
tableData: [], Name: "不返佣"
StatusList: [{ },
Id: '-2', {
Name: '不限' Id: "0",
}, { Name: "待返佣"
Id: '-1', },
Name: '不返佣' {
}, { Id: "1",
Id: '0', Name: "已返佣到账户"
Name: '待返佣' },
}, { {
Id: '1', Id: "2",
Name: '已返佣到账户' Name: "佣金已提现"
}, {
Id: '2',
Name: '佣金已提现'
}, ],
see_tcdetailed: false,
customFromList: [],
UserNamelist: [],
employeeList: [],
myEmployeeList: [],
TransListData: [], //转介人数据
MyTransListData: [],
customList: [], //同行列表
allCustomList: [], //所有同行列表
InvitationList: [], //学员下拉数据
AllInvitationList: [],
isShowFrom: true,
DepartmentList: [], //部门列表
}
},
computed: mapState({
//是否有下载权限
isReturnperiods(state) {
if (state.user.userInfo && state.user.userInfo.ActionMenuList && state.user.userInfo.ActionMenuList.length >
0) {
let action = state.user.userInfo.ActionMenuList.find(x => {
if (x.FunctionCode == "Edit_Returnperiods") {
return x;
}
});
return action && action.FunctionCode;
} }
return false; ],
see_tcdetailed: false,
customFromList: [],
UserNamelist: [],
employeeList: [],
myEmployeeList: [],
TransListData: [], //转介人数据
MyTransListData: [],
customList: [], //同行列表
allCustomList: [], //所有同行列表
InvitationList: [], //学员下拉数据
AllInvitationList: [],
isShowFrom: true,
DepartmentList: [] //部门列表
};
},
computed: mapState({
//是否有下载权限
isReturnperiods(state) {
if (
state.user.userInfo &&
state.user.userInfo.ActionMenuList &&
state.user.userInfo.ActionMenuList.length > 0
) {
let action = state.user.userInfo.ActionMenuList.find(x => {
if (x.FunctionCode == "Edit_Returnperiods") {
return x;
}
});
return action && action.FunctionCode;
} }
}), return false;
created() { }
this.getCustomFrom(); }),
this.queryDeptList(); created() {
this.getEmployeeList() this.getCustomFrom();
this.getStudentDorpDown() this.queryDeptList();
this.GetCustomerList() this.getEmployeeList();
this.getStudentList(); //学员下拉 this.getStudentDorpDown();
if(! this.isReturnperiods){ this.GetCustomerList();
this.msg.OrderSourceType = 2; this.getStudentList(); //学员下拉
if (!this.isReturnperiods) {
this.msg.OrderSourceType = 2;
}
},
mounted() {
if (this.$route.query && this.$route.query.id) {
this.msg.BatchId = this.$route.query.id;
}
if (this.$route.query.ReFinanceId2) {
this.msg.UserDept = this.$route.query.ReFinanceId2;
}
if (this.$route.query && this.$route.query.ReFinanceId2 == 0) {
this.msg.OrderSourceType = 4;
this.isShowFrom = false;
}
this.getList();
},
methods: {
getList() {
this.loading = true;
let msg = JSON.parse(JSON.stringify(this.msg));
if (msg.OrderSourceId == "" || msg.OrderSourceId == null) {
msg.OrderSourceId = 0;
} }
getCommissionUserList(msg).then(res => {
if (res.Code == 1) {
this.loading = false;
this.tableData = res.Data;
this.UserNamelist = [];
this.tableData.forEach(x => {
let obj3 = {
text: x.UserName,
value: x.UserName
};
this.UserNamelist.push(obj3);
});
this.UserNamelist = this.unique(this.UserNamelist);
}
});
}, },
mounted() { //现在
if (this.$route.query && this.$route.query.id) { DownLoadCommissionUserList() {
this.msg.BatchId = this.$route.query.id this.loading = true;
} var msg = JSON.parse(JSON.stringify(this.msg));
if (this.$route.query.ReFinanceId2) { EduDownLoad(
this.msg.UserDept = this.$route.query.ReFinanceId2; "/CustomerCommission/DownLoadCommissionUserList",
} msg,
if (this.$route.query && this.$route.query.ReFinanceId2 == 0) { "用户返佣.xls",
this.msg.OrderSourceType = 4; res => {
this.isShowFrom = false; this.loading = false;
}
);
},
getlaiyuan() {
if (this.msg.OrderSourceType == -1) {
this.msg.OrderSourceId = 0;
} else {
this.msg.OrderSourceId = "";
} }
this.getList() this.msg.UserDept = "";
this.getList();
}, },
methods: { //获取部门列表
getList() { queryDeptList() {
this.loading = true; var qMsg = {};
let msg = JSON.parse(JSON.stringify(this.msg)) getDeptList(qMsg).then(res => {
if (msg.OrderSourceId == '' || msg.OrderSourceId == null) { if (res.Code == 1) {
msg.OrderSourceId = 0 this.DepartmentList = res.Data;
} }
getCommissionUserList(msg).then(res => { });
if (res.Code == 1) { },
this.loading = false; //获取客户来源
this.tableData = res.Data; getCustomFrom() {
this.UserNamelist = []; CreateTypeList({}).then(res => {
this.tableData.forEach(x => { if (res.Code == 1) {
let obj3 = { let obj = {
text: x.UserName, Name: "不限",
value: x.UserName Id: "-1"
};
if (this.isReturnperiods) {
this.customFromList = res.Data;
this.customFromList.unshift(obj);
} else {
res.Data.forEach(data => {
if (data.Id == 2) {
this.customFromList.push(data);
} }
this.UserNamelist.push(obj3) });
})
this.UserNamelist = this.unique(this.UserNamelist)
}
})
},
//现在
DownLoadCommissionUserList() {
this.loading = true;
var msg = JSON.parse(JSON.stringify(this.msg));
EduDownLoad(
"/CustomerCommission/DownLoadCommissionUserList",
msg,
"用户返佣.xls", res => {
this.loading = false;
} }
this.customFromList.forEach(data => {
if (data.Id == 1 || data.Id == 3) {
data.Name = "员工";
} else if (data.Id == 2) {
data.Name = "同业";
} else if (data.Id == 4) {
data.Name = "学员";
}
});
}
});
},
//筛选转介人
filterStudent(val, update, abort) {
update(() => {
this.MyTransListData = this.TransListData.filter(
v => v.StuName.indexOf(val) > -1
); );
}, });
getlaiyuan() { },
if (this.msg.OrderSourceType == -1) { unique(arr, Name) {
this.msg.OrderSourceId = 0 //数组去重
const res = new Map();
return arr.filter(list => !res.has(list.text) && res.set(list.text, 1));
},
//筛选员工
filterEmployee(val, update, abort) {
update(() => {
this.myEmployeeList = this.employeeList.filter(
v => v.EmployeeName.indexOf(val) > -1
);
});
},
//获取员工列表
getEmployeeList() {
queryEmployee({
IsLeave: 1,
Dept_Id: this.msg.UserDept
}).then(res => {
this.employeeList = res.Data;
this.myEmployeeList = res.Data;
});
},
//获取转介人下拉
getStudentDorpDown() {
getStudentDorpDownList().then(res => {
if (res.Code == 1) {
this.TransListData = res.Data;
this.MyTransListData = res.Data;
}
});
},
//获取客户下拉数据
GetCustomerList() {
let msg = {
QCreateBy: 0
};
GetCustomerList(msg).then(res => {
if (res.Code == 1) {
this.customList = res.Data;
this.allCustomList = res.Data;
}
});
},
//筛选客户
filterFn(val, update) {
update(() => {
if (val === "") {
this.customList = JSON.parse(JSON.stringify(this.allCustomList));
} else { } else {
this.msg.OrderSourceId = '' const needle = val.toLowerCase();
this.customList = this.allCustomList.filter(
v => v.CustomerName.toLowerCase().indexOf(needle) > -1
);
} }
this.msg.UserDept=""; });
this.getList(); },
}, //获取学员下拉信息
//获取部门列表 getStudentList() {
queryDeptList() { var qMsg = {
var qMsg = {}; SchoolId: this.msg.SchoolId
getDeptList(qMsg).then(res => { };
if (res.Code == 1) { GetStudentList(qMsg).then(res => {
this.DepartmentList = res.Data; if (res.Code == 1) {
} var jsonData = res.Data;
}); if (jsonData && jsonData.length > 0) {
}, this.AllInvitationList = JSON.parse(JSON.stringify(jsonData));
//获取客户来源 this.InvitationList = JSON.parse(JSON.stringify(jsonData));
getCustomFrom() {
CreateTypeList({}).then(res => {
if (res.Code == 1) {
let obj = {
Name: '不限',
Id: '-1'
}
if(this.isReturnperiods){
this.customFromList = res.Data;
this.customFromList.unshift(obj);
}else{
res.Data.forEach(data=>{
if(data.Id ==2){
this.customFromList.push(data);
}
})
}
} }
}) }
}, });
//筛选转介人 },
filterStudent(val, update, abort) { filterFnStudent(val, update) {
update(() => { update(() => {
this.MyTransListData = this.TransListData.filter( if (val === "") {
v => v.StuName.indexOf(val) > -1 this.InvitationList = JSON.parse(
JSON.stringify(this.AllInvitationList)
); );
}); } else {
}, const needle = val.toLowerCase();
unique(arr, Name) { //数组去重 this.InvitationList = this.AllInvitationList.filter(
const res = new Map(); v => v.StuName.toLowerCase().indexOf(needle) > -1
return arr.filter(
(list) => !res.has(list.text) && res.set(list.text, 1)
);
},
//筛选员工
filterEmployee(val, update, abort) {
update(() => {
this.myEmployeeList = this.employeeList.filter(
v => v.EmployeeName.indexOf(val) > -1
); );
});
},
//获取员工列表
getEmployeeList() {
queryEmployee({
IsLeave: 1,
Dept_Id: this.msg.UserDept
}).then(res => {
this.employeeList = res.Data;
this.myEmployeeList = res.Data;
})
},
//获取转介人下拉
getStudentDorpDown() {
getStudentDorpDownList().then(res => {
if (res.Code == 1) {
this.TransListData = res.Data;
this.MyTransListData = res.Data;
}
})
},
//获取客户下拉数据
GetCustomerList() {
let msg = {
QCreateBy: 0
} }
GetCustomerList(msg).then(res => { });
if (res.Code == 1) {
this.customList = res.Data;
this.allCustomList = res.Data;
}
})
},
//筛选客户
filterFn(val, update) {
update(() => {
if (val === "") {
this.customList = JSON.parse(JSON.stringify(this.allCustomList));
} else {
const needle = val.toLowerCase();
this.customList = this.allCustomList.filter(
(v) => v.CustomerName.toLowerCase().indexOf(needle) > -1
);
}
});
},
//获取学员下拉信息
getStudentList() {
var qMsg = {
SchoolId: this.msg.SchoolId
};
GetStudentList(qMsg).then(res => {
if (res.Code == 1) {
var jsonData = res.Data;
if (jsonData && jsonData.length > 0) {
this.AllInvitationList = JSON.parse(JSON.stringify(jsonData));
this.InvitationList = JSON.parse(JSON.stringify(jsonData));
}
}
})
},
filterFnStudent(val, update) {
update(() => {
if (val === '') {
this.InvitationList = JSON.parse(JSON.stringify(this.AllInvitationList))
} else {
const needle = val.toLowerCase()
this.InvitationList = this.AllInvitationList.filter(v => v.StuName.toLowerCase().indexOf(needle) > -1)
}
})
},
goUrl(path, row) {
this.$router.push({
path: '/financial/' + path,
query: {
preriodId: this.$route.query.id,
CommissionType: this.$route.query.CommissionType,
OrderSourceType: row.OrderSourceType,
OrderSourceId: row.OrderSourceId,
blank: 'y',
}
})
},
filterHandler(value, row, column) {
const property = column['property'];
return row[property] === value;
},
StudentCount(a, b, c) {
return a.StudentCount - b.StudentCount;
},
CommissionMoeny(a, b) {
return a.CommissionMoeny - b.CommissionMoeny;
},
goreturn() {
this.$router.go(-1);
}
}, },
goUrl(path, row) {
this.$router.push({
path: "/financial/" + path,
query: {
preriodId: this.$route.query.id,
CommissionType: this.$route.query.CommissionType,
OrderSourceType: row.OrderSourceType,
OrderSourceId: row.OrderSourceId,
blank: "y"
}
});
},
filterHandler(value, row, column) {
const property = column["property"];
return row[property] === value;
},
StudentCount(a, b, c) {
return a.StudentCount - b.StudentCount;
},
CommissionMoeny(a, b) {
return a.CommissionMoeny - b.CommissionMoeny;
},
goreturn() {
this.$router.go(-1);
}
} }
};
</script> </script>
<style lang="sass"> <style lang="sass">
@import url('~assets/css/table.sass') @import url('~assets/css/table.sass')
</style> </style>
\ No newline at end of file
<style> <style>
.baseSet_Title { .baseSet_Title {
width: 120px !important; width: 120px !important;
padding: 18px 0 0 16px; padding: 18px 0 0 16px;
text-align: right; text-align: right;
} }
.cycleOrderList .border-bottom {
padding-bottom: 5px; .cycleOrderList .border-bottom {
margin-bottom: 5px; padding-bottom: 5px;
} margin-bottom: 5px;
}
.cycleOrderList .text-bottom { .cycleOrderList .text-bottom {
height: 32px; height: 32px;
line-height: 32px; line-height: 32px;
margin-bottom: 10px; margin-bottom: 10px;
} }
.cycleOrderList ._icon_btn i.icon-sousuo { .cycleOrderList ._icon_btn i.icon-sousuo {
background-color: #47bf8c; background-color: #47bf8c;
} }
.cycleOrderList ._icon_btn i { .cycleOrderList ._icon_btn i {
width: 30px; width: 30px;
height: 30px; height: 30px;
display: inline-block; display: inline-block;
color: white !important; color: white !important;
border-radius: 50%; border-radius: 50%;
text-align: center; text-align: center;
line-height: 30px; line-height: 30px;
margin-right: 10px; margin-right: 10px;
cursor: pointer; cursor: pointer;
outline: none; outline: none;
} }
.cycleOrderList .el-table td, .cycleOrderList .el-table td,
.el-table th { .el-table th {
padding: 5px 0; padding: 5px 0;
} }
</style> </style>
<template> <template>
<div class="page-body cycleOrderList"> <div class="page-body cycleOrderList">
<div class="page-search row items-center"> <div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md"> <div class="col row wrap q-mr-lg q-col-gutter-md">
<q-select v-if="!isNormal" @input="resetSearch" filled stack-label option-value="Id" option-label="Name" <q-select
use-input v-model="msg.Status" :options="StatusList" label="状态" dense class="col-3" emit-value map-options> v-if="!isNormal"
@input="resetSearch"
filled
stack-label
option-value="Id"
option-label="Name"
use-input
v-model="msg.Status"
:options="StatusList"
label="状态"
dense
class="col-3"
emit-value
map-options
>
</q-select> </q-select>
<div class="col-3" v-if="!isNormal"> <div class="col-3" v-if="!isNormal">
<q-select filled stack-label @input="resetSearch()" option-value="Id" option-label="BatchName" <q-select
v-model="msg.BatchId" :options="PeriodsList" label="周期" dense emit-value map-options /> filled
stack-label
@input="resetSearch()"
option-value="Id"
option-label="BatchName"
v-model="msg.BatchId"
:options="PeriodsList"
label="周期"
dense
emit-value
map-options
/>
</div> </div>
<div class="col-3"> <div class="col-3">
<q-select filled stack-label use-input input-debounce="0" option-value="ClassId" @input="getList" <q-select
option-label="ClassName" v-model="msg.ClassId" :options="ClassList" label="班级" dense emit-value map-options filled
@filter="filterFnbanji"> stack-label
use-input
input-debounce="0"
option-value="ClassId"
@input="getList"
option-label="ClassName"
v-model="msg.ClassId"
:options="ClassList"
label="班级"
dense
emit-value
map-options
@filter="filterFnbanji"
>
<template v-slot:no-option> <template v-slot:no-option>
<q-item> <q-item>
<q-item-section class="text-grey">未找到相关数据</q-item-section> <q-item-section class="text-grey"
>未找到相关数据</q-item-section
>
</q-item> </q-item>
</template> </template>
</q-select> </q-select>
</div> </div>
<template v-if="isReturnperiods"> <template v-if="isReturnperiods">
<q-select v-if="!isNormal" @input="resetSearch" filled stack-label option-value="Id" option-label="Name" <q-select
use-input v-model="msg.CommissionType" :options="CommissionList" label="类型" dense class="col-3" emit-value v-if="!isNormal"
map-options></q-select> @input="resetSearch"
<q-select v-if="!isNormal" @input="resetSearch" filled stack-label option-value="Id" option-label="Name" filled
use-input v-model="msg.Q_SelectNormal" :options="SelectNormal" label="返佣情况" dense class="col-3" emit-value stack-label
map-options></q-select> option-value="Id"
<q-select class="col-3" filled stack-label input-debounce="0" v-if="!isEdit" option-value="Id" option-label="Name"
@input="getlaiyuan" option-label="Name" v-model="msg.OrderSourceType" :options="customFromList" label="来源" use-input
dense emit-value map-options></q-select> v-model="msg.CommissionType"
:options="CommissionList"
label="类型"
dense
class="col-3"
emit-value
map-options
></q-select>
<q-select
v-if="!isNormal"
@input="resetSearch"
filled
stack-label
option-value="Id"
option-label="Name"
use-input
v-model="msg.Q_SelectNormal"
:options="SelectNormal"
label="返佣情况"
dense
class="col-3"
emit-value
map-options
></q-select>
<q-select
class="col-3"
filled
stack-label
input-debounce="0"
v-if="!isEdit"
option-value="Id"
@input="getlaiyuan"
option-label="Name"
v-model="msg.OrderSourceType"
:options="customFromList"
label="返佣类型"
dense
emit-value
map-options
></q-select>
<div class="col-3" v-if="msg.OrderSourceType == 1 || msg.OrderSourceType == 3"> <div
<q-select filled clearable stack-label v-model="msg.OrderSourceId" dense :options="myEmployeeList" use-input class="col-3"
@input="getList" label="人员" @filter="filterEmployee" option-label="EmployeeName" option-value="Id" v-if="msg.OrderSourceType == 1 || msg.OrderSourceType == 3"
emit-value map-options> >
<q-select
filled
clearable
stack-label
v-model="msg.OrderSourceId"
dense
:options="myEmployeeList"
use-input
@input="getList"
label="人员"
@filter="filterEmployee"
option-label="EmployeeName"
option-value="Id"
emit-value
map-options
>
<template v-slot:no-option> <template v-slot:no-option>
<q-item> <q-item>
<q-item-section class="text-grey">未找到相关数据</q-item-section> <q-item-section class="text-grey"
>未找到相关数据</q-item-section
>
</q-item> </q-item>
</template> </template>
</q-select> </q-select>
</div> </div>
<div class="col-3" v-if="msg.OrderSourceType == 2"> <div class="col-3" v-if="msg.OrderSourceType == 2">
<q-select filled clearable stack-label v-model="msg.OrderSourceId" dense :options="customList" use-input <q-select
@input="getList" label="关联同行" @filter="filterFn" option-label="CustomerName" option-value="CustomerId" filled
emit-value map-options> clearable
stack-label
v-model="msg.OrderSourceId"
dense
:options="customList"
use-input
@input="getList"
label="关联同行"
@filter="filterFn"
option-label="CustomerName"
option-value="CustomerId"
emit-value
map-options
>
<template v-slot:no-option> <template v-slot:no-option>
<q-item> <q-item>
<q-item-section class="text-grey">未找到相关数据</q-item-section> <q-item-section class="text-grey"
>未找到相关数据</q-item-section
>
</q-item> </q-item>
</template> </template>
</q-select> </q-select>
</div> </div>
<div class="col-3" v-if="msg.OrderSourceType == 4"> <div class="col-3" v-if="msg.OrderSourceType == 4">
<q-select filled clearable stack-label v-model="msg.OrderSourceId" dense :options="InvitationList" use-input <q-select
@input="getList" label="转介人" @filter="filterFnStudent" option-label="StuName" option-value="StuId" filled
emit-value map-options> clearable
stack-label
v-model="msg.OrderSourceId"
dense
:options="InvitationList"
use-input
@input="getList"
label="转介人"
@filter="filterFnStudent"
option-label="StuName"
option-value="StuId"
emit-value
map-options
>
<template v-slot:no-option> <template v-slot:no-option>
<q-item> <q-item>
<q-item-section class="text-grey">未找到相关数据</q-item-section> <q-item-section class="text-grey"
>未找到相关数据</q-item-section
>
</q-item> </q-item>
</template> </template>
</q-select> </q-select>
</div> </div>
<div class="col-3"> <div class="col-3">
<q-input filled dense v-model="msg.OrderId" @keyup.enter.native="resetSearch()" label="订单号" /> <q-input
filled
dense
v-model="msg.OrderId"
@keyup.enter.native="resetSearch()"
label="订单号"
/>
</div> </div>
</template> </template>
</div> </div>
</div> </div>
<div class="page-search row items-center" style="justify-content: space-between;"> <div
class="page-search row items-center"
style="justify-content: space-between;"
>
<span style="font-size: 20px;font-weight: 400;"> <span style="font-size: 20px;font-weight: 400;">
提成统计 提成统计
<span style="font-size: 16px;">(提成总计:{{ TotalCommission }})</span> <span style="font-size: 16px;">(提成总计:{{ TotalCommission }})</span>
</span> </span>
<q-btn v-if="!isNormal" color="primary" size="11px" label="导出" @click="tcexport" style="margin-left:10px" /> <q-btn
v-if="!isNormal"
color="primary"
size="11px"
label="导出"
@click="tcexport"
style="margin-left:10px"
/>
</div> </div>
<template> <template>
<el-table ref="filterTable" :data="tableData" v-loading="loading" <el-table
:header-cell-style="{ backgroundColor: '#f5f6f7', color: '#a8a8b3' }" border style="width: 100%"> ref="filterTable"
<el-table-column prop="SchoolName" label="校区" width="150"></el-table-column> :data="tableData"
<el-table-column prop="OrderSourceTypeName" label="来源"></el-table-column> v-loading="loading"
:header-cell-style="{ backgroundColor: '#f5f6f7', color: '#a8a8b3' }"
border
style="width: 100%"
>
<el-table-column
prop="SchoolName"
label="校区"
width="150"
></el-table-column>
<el-table-column prop="OrderSourceTypeName" label="返佣类型">
<template slot-scope="scope">
{{
scope.row.OrderSourceType == 1 || scope.row.OrderSourceType == 3
? "员工"
: ""
}}
{{ scope.row.OrderSourceType == 2 ? "同业" : "" }}
{{ scope.row.OrderSourceType == 4 ? "学员" : "" }}
</template>
</el-table-column>
<el-table-column prop="UserName" label="人员"></el-table-column> <el-table-column prop="UserName" label="人员"></el-table-column>
<el-table-column width="170" prop="ClassName" label="班级信息"> <el-table-column width="170" prop="ClassName" label="班级信息">
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
<span style="cursor: pointer;text-decoration: underline;" <span
@click="goUrlclass('/course/classManage', scope.row.ClassName)">{{ scope.row.ClassName }}</span> style="cursor: pointer;text-decoration: underline;"
@click="goUrlclass('/course/classManage', scope.row.ClassName)"
>{{ scope.row.ClassName }}</span
>
</div> </div>
<div>班号:{{ scope.row.ClassNo }}</div> <div>班号:{{ scope.row.ClassNo }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="OrderId" label="订单号"> <el-table-column prop="OrderId" label="订单号">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.OrderType == 1" style="cursor: pointer;text-decoration: underline;" <div
@click="goUrlorderList('/sale/orderStatistics', scope.row)">{{ scope.row.OrderId }}</div> v-if="scope.row.OrderType == 1"
<div v-else-if="scope.row.OrderType == 2" style="cursor: pointer;text-decoration: underline;" style="cursor: pointer;text-decoration: underline;"
@click="goUrlorderList('/sale/studyOrderStatistics', scope.row)">{{ scope.row.OrderId }}</div> @click="goUrlorderList('/sale/orderStatistics', scope.row)"
>
{{ scope.row.OrderId }}
</div>
<div
v-else-if="scope.row.OrderType == 2"
style="cursor: pointer;text-decoration: underline;"
@click="goUrlorderList('/sale/studyOrderStatistics', scope.row)"
>
{{ scope.row.OrderId }}
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="StuName" label="学生"></el-table-column> <el-table-column prop="StuName" label="学生"></el-table-column>
...@@ -148,9 +323,15 @@ ...@@ -148,9 +323,15 @@
<span v-if="scope.row.CommissionType == 2">幸福存折</span> <span v-if="scope.row.CommissionType == 2">幸福存折</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="130" prop="CommissionMoeny" label="返佣/存折金额"> <el-table-column
width="130"
prop="CommissionMoeny"
label="返佣/存折金额"
>
<template slot-scope="scope"> <template slot-scope="scope">
<div>{{ scope.row.CommissionMoeny ? scope.row.CommissionMoeny : '-' }}</div> <div>
{{ scope.row.CommissionMoeny ? scope.row.CommissionMoeny : "-" }}
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="Status" label="状态"> <el-table-column prop="Status" label="状态">
...@@ -162,411 +343,459 @@ ...@@ -162,411 +343,459 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="BatchName" label="期数"></el-table-column> <el-table-column prop="BatchName" label="期数"></el-table-column>
<el-table-column prop="Remark" width="200" label="备注"></el-table-column> <el-table-column
prop="Remark"
width="200"
label="备注"
></el-table-column>
</el-table> </el-table>
<div style="margin-top: 10px;text-align: center;"> <div style="margin-top: 10px;text-align: center;">
<el-pagination background @current-change="handleCurrentChanges" layout="total,prev, pager, next, jumper" <el-pagination
:current-page.sync="msg.PageIndex" :page-size="msg.PageSize" :total="total"></el-pagination> background
@current-change="handleCurrentChanges"
layout="total,prev, pager, next, jumper"
:current-page.sync="msg.PageIndex"
:page-size="msg.PageSize"
:total="total"
></el-pagination>
</div> </div>
</template> </template>
</div> </div>
</template> </template>
<script> <script>
import { import {
getSchoolDropdown, getSchoolDropdown,
getClassDropDownList, getClassDropDownList,
getStudentDorpDownList getStudentDorpDownList
} from '../../../api/school/index' } from "../../../api/school/index";
import { import { queryEmployee } from "../../../api/users/user";
queryEmployee import { GetStudentList } from "../../../api/course/class";
} from '../../../api/users/user' import { CreateTypeList, GetCustomerList } from "../../../api/sale/sale";
import { import {
GetStudentList, getCommissionStatistics,
} from '../../../api/course/class'; getCommissionPeriodsList
import { } from "../../../api/finance/index";
CreateTypeList, import { EduDownLoad } from "../../../api/common/common";
GetCustomerList import { mapState } from "vuex";
} from '../../../api/sale/sale' export default {
import { meta: {
getCommissionStatistics, title: "业绩提成统计"
getCommissionPeriodsList, },
} from '../../../api/finance/index' props: {},
import { components: {},
EduDownLoad, data() {
} from '../../../api/common/common'; return {
import { loading: false,
mapState //列表数据参数
} from "vuex"; msg: {
export default { PageIndex: 1,
meta: { PageSize: 10,
title: "业绩提成统计" SchoolId: "-1",
}, BatchId: "0",
props: {}, Status: "-2",
components: {}, OrderSourceType: "-1",
data() { OrderSourceId: 0,
return { Q_SelectNormal: "-1",
loading: false, CommissionType: "-1",
//列表数据参数 ClassId: 0,
msg: { OrderId: "",
PageIndex: 1, UnionCashOutId: 0
PageSize: 10, },
SchoolId: '-1', StatusList: [
BatchId: '0', {
Status: '-2', Id: "-2",
OrderSourceType: '-1', Name: "不限"
OrderSourceId: 0,
Q_SelectNormal: '-1',
CommissionType: '-1',
ClassId: 0,
OrderId: '',
UnionCashOutId: 0,
}, },
StatusList: [{ {
Id: '-2', Id: "-1",
Name: '不限' Name: "不返佣"
}, { },
Id: '-1', {
Name: '不返佣' Id: "0",
}, { Name: "待返佣"
Id: '0', },
Name: '待返佣' {
}, { Id: "1",
Id: '1', Name: "已返佣到账户"
Name: '已返佣到账户' },
}, { {
Id: '2', Id: "2",
Name: '佣金已提现' Name: "佣金已提现"
}, ],
SelectNormal: [{
Id: '-1',
Name: '不限'
}, {
Id: '1',
Name: '非不返佣的'
}, {
Id: '2',
Name: '已返佣'
}, ],
CommissionList: [{
Id: '-1',
Name: '不限'
}, {
Id: '1',
Name: '返佣'
}, {
Id: '2',
Name: '幸福存折'
}, ],
pageCount: 0,
listData: {},
tableData: [],
total: 0,
company: [],
department: [],
ClassList: [],
allClassList: [],
returnString: [], //默认岗位
see_tcdetailed: false,
schoolList: [],
DeptList: [], // 部门下拉
PeriodsList: [], //周期列表
TotalCommission: 0,
ChangeLog: '',
customFromList: [],
TransListData: [], //转介人数据
MyTransListData: [],
customList: [], //同行列表
allCustomList: [], //所有同行列表
InvitationList: [], //学员下拉数据
AllInvitationList: [],
isNormal: false,
employeeList: [],
myEmployeeList: [],
isEdit: false
}
},
computed: mapState({
//是否有下载权限
isReturnperiods(state) {
if (state.user.userInfo && state.user.userInfo.ActionMenuList && state.user.userInfo.ActionMenuList.length >
0) {
let action = state.user.userInfo.ActionMenuList.find(x => {
if (x.FunctionCode == "Edit_Returnperiods") {
return x;
}
});
return action && action.FunctionCode;
} }
return false; ],
} SelectNormal: [
}), {
created() { Id: "-1",
let userinfo = this.getLocalStorage(); Name: "不限"
userinfo.ActionMenuList.map(x => { //判断权限 },
if (x.FunctionCode == "see_tcdetailed") { //判断是否可以查看其他明细 {
this.see_tcdetailed = true; Id: "1",
Name: "非不返佣的"
},
{
Id: "2",
Name: "已返佣"
} }
}) ],
if (this.see_tcdetailed == false) { CommissionList: [
this.msg.UserId = userinfo.Id {
} Id: "-1",
}, Name: "不限"
mounted() { },
if (this.$route.query && this.$route.query.OrderId) { {
this.msg.OrderId = this.$route.query.OrderId Id: "1",
} Name: "返佣"
if (this.$route.query && this.$route.query.preriodId) { },
this.msg.BatchId = (this.$route.query.preriodId).toString() {
} Id: "2",
if (this.$route.query && this.$route.query.UnionCashOutId) { //提现ID Name: "幸福存折"
this.msg.UnionCashOutId = this.$route.query.UnionCashOutId }
} ],
if (this.$route.query && this.$route.query.OrderSourceType) { //来源 pageCount: 0,
this.msg.OrderSourceType = parseInt(this.$route.query.OrderSourceType) listData: {},
} tableData: [],
if (this.$route.query && this.$route.query.OrderSourceId) { //人员ID total: 0,
this.msg.OrderSourceId = parseInt(this.$route.query.OrderSourceId) company: [],
department: [],
ClassList: [],
allClassList: [],
returnString: [], //默认岗位
see_tcdetailed: false,
schoolList: [],
DeptList: [], // 部门下拉
PeriodsList: [], //周期列表
TotalCommission: 0,
ChangeLog: "",
customFromList: [],
TransListData: [], //转介人数据
MyTransListData: [],
customList: [], //同行列表
allCustomList: [], //所有同行列表
InvitationList: [], //学员下拉数据
AllInvitationList: [],
isNormal: false,
employeeList: [],
myEmployeeList: [],
isEdit: false
};
},
computed: mapState({
//是否有下载权限
isReturnperiods(state) {
if (
state.user.userInfo &&
state.user.userInfo.ActionMenuList &&
state.user.userInfo.ActionMenuList.length > 0
) {
let action = state.user.userInfo.ActionMenuList.find(x => {
if (x.FunctionCode == "Edit_Returnperiods") {
return x;
}
});
return action && action.FunctionCode;
} }
if (this.$route.query && this.$route.query.CommissionType) { return false;
this.msg.CommissionType = parseInt(this.$route.query.CommissionType); }
this.msg.Q_SelectNormal = 2 }),
this.isNormal = true created() {
let userinfo = this.getLocalStorage();
userinfo.ActionMenuList.map(x => {
//判断权限
if (x.FunctionCode == "see_tcdetailed") {
//判断是否可以查看其他明细
this.see_tcdetailed = true;
} }
if (this.$route.query && this.$route.query.iSFromDash == 1) { });
this.isEdit = true; if (this.see_tcdetailed == false) {
this.msg.UserId = userinfo.Id;
}
},
mounted() {
if (this.$route.query && this.$route.query.OrderId) {
this.msg.OrderId = this.$route.query.OrderId;
}
if (this.$route.query && this.$route.query.preriodId) {
this.msg.BatchId = this.$route.query.preriodId.toString();
}
if (this.$route.query && this.$route.query.UnionCashOutId) {
//提现ID
this.msg.UnionCashOutId = this.$route.query.UnionCashOutId;
}
if (this.$route.query && this.$route.query.OrderSourceType) {
//来源
this.msg.OrderSourceType = parseInt(this.$route.query.OrderSourceType);
}
if (this.$route.query && this.$route.query.OrderSourceId) {
//人员ID
this.msg.OrderSourceId = parseInt(this.$route.query.OrderSourceId);
}
if (this.$route.query && this.$route.query.CommissionType) {
this.msg.CommissionType = parseInt(this.$route.query.CommissionType);
this.msg.Q_SelectNormal = 2;
this.isNormal = true;
}
if (this.$route.query && this.$route.query.iSFromDash == 1) {
this.isEdit = true;
}
if (this.$route.query && this.$route.query.Status) {
this.msg.Status = this.$route.query.Status;
this.isNormal = false;
this.msg.Q_SelectNormal = "-1";
}
this.getList();
this.setClass();
this.getBranchList();
this.getPeriodList();
this.getCustomFrom(); //来源
this.getEmployeeList();
this.getStudentDorpDown();
this.GetCustomerList();
this.getStudentList(); //学员下拉
},
methods: {
resetSearch() {
this.msg.PageIndex = 1;
this.getList();
},
getList() {
this.loading = true;
let msg = JSON.parse(JSON.stringify(this.msg));
if (msg.OrderSourceId == "" || msg.OrderSourceId == null) {
msg.OrderSourceId = 0;
} }
if (this.$route.query && this.$route.query.Status) { getCommissionStatistics(this.msg).then(res => {
this.msg.Status = this.$route.query.Status; if (res.Code == 1) {
this.isNormal = false; this.loading = false;
this.msg.Q_SelectNormal = '-1' this.tableData = res.Data.PageData.List;
this.TotalCommission = res.Data.PageData.TotalCommission;
this.total = res.Data.Count;
}
});
},
unique(arr, Name) {
//数组去重
const res = new Map();
return arr.filter(list => !res.has(list.text) && res.set(list.text, 1));
},
getlaiyuan() {
if (this.msg.OrderSourceType == -1) {
this.msg.OrderSourceId = 0;
} else {
this.msg.OrderSourceId = "";
} }
this.getList() this.getList();
this.setClass()
this.getBranchList()
this.getPeriodList()
this.getCustomFrom() //来源
this.getEmployeeList()
this.getStudentDorpDown()
this.GetCustomerList()
this.getStudentList(); //学员下拉
}, },
methods: { //获取客户来源
resetSearch() { getCustomFrom() {
this.msg.PageIndex = 1; CreateTypeList({}).then(res => {
this.getList() if (res.Code == 1) {
}, let obj = {
getList() { Name: "不限",
this.loading = true; Id: "-1"
let msg = JSON.parse(JSON.stringify(this.msg)) };
if (msg.OrderSourceId == '' || msg.OrderSourceId == null) { this.customFromList = res.Data;
msg.OrderSourceId = 0 this.customFromList.forEach(data => {
if (data.Id == 1 || data.Id == 3) {
data.Name = "员工";
} else if (data.Id == 2) {
data.Name = "同业";
} else if (data.Id == 4) {
data.Name = "学员";
}
});
this.customFromList.unshift(obj);
} }
getCommissionStatistics(this.msg).then(res => { });
if (res.Code == 1) { },
this.loading = false; //筛选转介人
this.tableData = res.Data.PageData.List filterStudent(val, update, abort) {
this.TotalCommission = res.Data.PageData.TotalCommission update(() => {
this.total = res.Data.Count this.MyTransListData = this.TransListData.filter(
} v => v.StuName.indexOf(val) > -1
})
},
unique(arr, Name) { //数组去重
const res = new Map();
return arr.filter(
(list) => !res.has(list.text) && res.set(list.text, 1)
); );
}, });
getlaiyuan() { },
if (this.msg.OrderSourceType == -1) { //筛选员工
this.msg.OrderSourceId = 0 filterEmployee(val, update, abort) {
update(() => {
if (val === "") {
this.myEmployeeList = this.employeeList;
} else { } else {
this.msg.OrderSourceId = '' const needle = val.toLowerCase();
this.myEmployeeList = this.employeeList.filter(
v => v.EmployeeName.toLowerCase().indexOf(needle) > -1
);
} }
this.getList() });
}, },
//获取客户来源 //获取员工列表
getCustomFrom() { getEmployeeList() {
CreateTypeList({}).then(res => { queryEmployee({
if (res.Code == 1) { IsLeave: 1
let obj = { }).then(res => {
Name: '不限', this.employeeList = res.Data;
Id: '-1' this.myEmployeeList = res.Data;
} });
this.customFromList = res.Data; },
this.customFromList.unshift(obj); //获取转介人下拉
} getStudentDorpDown() {
}) getStudentDorpDownList().then(res => {
}, if (res.Code == 1) {
//筛选转介人 this.TransListData = res.Data;
filterStudent(val, update, abort) { this.MyTransListData = res.Data;
update(() => { }
this.MyTransListData = this.TransListData.filter( });
v => v.StuName.indexOf(val) > -1 },
//获取客户下拉数据
GetCustomerList() {
let msg = {
QCreateBy: 0
};
GetCustomerList(msg).then(res => {
if (res.Code == 1) {
this.customList = res.Data;
this.allCustomList = res.Data;
}
});
},
//筛选客户
filterFn(val, update) {
update(() => {
if (val === "") {
this.customList = JSON.parse(JSON.stringify(this.allCustomList));
} else {
const needle = val.toLowerCase();
this.customList = this.allCustomList.filter(
v => v.CustomerName.toLowerCase().indexOf(needle) > -1
); );
});
},
//筛选员工
filterEmployee(val, update, abort) {
update(() => {
if (val === '') {
this.myEmployeeList = this.employeeList
} else {
const needle = val.toLowerCase();
this.myEmployeeList = this.employeeList.filter(v => v.EmployeeName.toLowerCase().indexOf(needle) > -1);
}
})
},
//获取员工列表
getEmployeeList() {
queryEmployee({
IsLeave: 1
}).then(res => {
this.employeeList = res.Data;
this.myEmployeeList = res.Data;
})
},
//获取转介人下拉
getStudentDorpDown() {
getStudentDorpDownList().then(res => {
if (res.Code == 1) {
this.TransListData = res.Data;
this.MyTransListData = res.Data;
}
})
},
//获取客户下拉数据
GetCustomerList() {
let msg = {
QCreateBy: 0
} }
GetCustomerList(msg).then(res => { });
if (res.Code == 1) { },
this.customList = res.Data; handleCurrentChanges(val) {
this.allCustomList = res.Data; this.msg.PageIndex = val;
} this.getList();
}) },
}, //选择班级
//筛选客户 setClass(item) {
filterFn(val, update) { this.isShowClass = true;
update(() => { getClassDropDownList({
if (val === "") { CourseId: 0,
this.customList = JSON.parse(JSON.stringify(this.allCustomList)); IsAddDefault: 1 //添加默认选项
} else { }).then(res => {
const needle = val.toLowerCase(); if (res.Code == 1) {
this.customList = this.allCustomList.filter( var jsonData = res.Data;
(v) => v.CustomerName.toLowerCase().indexOf(needle) > -1 let obj = {
); ClassId: 0,
} ClassName: "不限"
}); };
}, jsonData.unshift(obj);
handleCurrentChanges(val) { if (jsonData && jsonData.length > 0) {
this.msg.PageIndex = val; this.ClassList = JSON.parse(JSON.stringify(jsonData));
this.getList() this.allClassList = JSON.parse(JSON.stringify(jsonData));
},
//选择班级
setClass(item) {
this.isShowClass = true;
getClassDropDownList({
CourseId: 0,
IsAddDefault: 1, //添加默认选项
}).then(res => {
if (res.Code == 1) {
var jsonData = res.Data;
let obj = {
ClassId: 0,
ClassName: '不限'
}
jsonData.unshift(obj)
if (jsonData && jsonData.length > 0) {
this.ClassList = JSON.parse(JSON.stringify(jsonData));
this.allClassList = JSON.parse(JSON.stringify(jsonData));;
}
}
});
},
//筛选班级
filterFnbanji(val, update) {
update(() => {
if (val === '') {
this.ClassList = JSON.parse(JSON.stringify(this.allClassList))
} else {
const needle = val.toLowerCase()
this.ClassList = this.allClassList.filter(v => v.ClassName.toLowerCase().indexOf(needle) > -1)
} }
}) }
}, });
getBranchList() { //获取校区 },
getSchoolDropdown({}).then(res => { //筛选班级
filterFnbanji(val, update) {
update(() => {
if (val === "") {
this.ClassList = JSON.parse(JSON.stringify(this.allClassList));
} else {
const needle = val.toLowerCase();
this.ClassList = this.allClassList.filter(
v => v.ClassName.toLowerCase().indexOf(needle) > -1
);
}
});
},
getBranchList() {
//获取校区
getSchoolDropdown({})
.then(res => {
this.schoolList = res.Data; this.schoolList = res.Data;
var obj = { var obj = {
SName: '全部', SName: "全部",
SId: '-1' SId: "-1"
} };
this.schoolList.unshift(obj); this.schoolList.unshift(obj);
}).catch(() => {})
},
//获取学员下拉信息
getStudentList() {
var qMsg = {
SchoolId: this.msg.SchoolId
};
GetStudentList(qMsg).then(res => {
if (res.Code == 1) {
var jsonData = res.Data;
if (jsonData && jsonData.length > 0) {
this.AllInvitationList = JSON.parse(JSON.stringify(jsonData));
this.InvitationList = JSON.parse(JSON.stringify(jsonData));
}
}
}) })
}, .catch(() => {});
filterFnStudent(val, update) { },
update(() => { //获取学员下拉信息
if (val === '') { getStudentList() {
this.InvitationList = JSON.parse(JSON.stringify(this.AllInvitationList)) var qMsg = {
} else { SchoolId: this.msg.SchoolId
const needle = val.toLowerCase() };
this.InvitationList = this.AllInvitationList.filter(v => v.StuName.toLowerCase().indexOf(needle) > -1) GetStudentList(qMsg).then(res => {
} if (res.Code == 1) {
}) var jsonData = res.Data;
}, if (jsonData && jsonData.length > 0) {
getPeriodList() { //获取周期下拉列表 this.AllInvitationList = JSON.parse(JSON.stringify(jsonData));
getCommissionPeriodsList({}).then(res => { this.InvitationList = JSON.parse(JSON.stringify(jsonData));
if (res.Code == 1) {
this.PeriodsList = res.Data
let obj = {
BatchName: '不限',
Id: '0'
}
this.PeriodsList.unshift(obj)
} }
})
},
tcexport() { //导出
var msg = JSON.parse(JSON.stringify(this.msg));
let text = '用户返佣/存折明细.xls'
if (msg.CommissionType == 1) {
text = '用户返佣.xls'
} }
if (msg.CommissionType == 2) { });
text = '幸福存折明细.xls' },
filterFnStudent(val, update) {
update(() => {
if (val === "") {
this.InvitationList = JSON.parse(
JSON.stringify(this.AllInvitationList)
);
} else {
const needle = val.toLowerCase();
this.InvitationList = this.AllInvitationList.filter(
v => v.StuName.toLowerCase().indexOf(needle) > -1
);
}
});
},
getPeriodList() {
//获取周期下拉列表
getCommissionPeriodsList({}).then(res => {
if (res.Code == 1) {
this.PeriodsList = res.Data;
let obj = {
BatchName: "不限",
Id: "0"
};
this.PeriodsList.unshift(obj);
} }
EduDownLoad("/CustomerCommission/GetCommissionStatisticsToExcel", msg, text) });
},
goUrlclass(path, Names) { //班级
let Name = encodeURI(Names)
this.OpenNewUrl(path, {
ClassName: Name,
});
},
goUrlorderList(path, row) { //订单跳转
this.OpenNewUrl(path, {
OrderId: row.OrderId,
});
},
}, },
tcexport() {
//导出
var msg = JSON.parse(JSON.stringify(this.msg));
let text = "用户返佣/存折明细.xls";
if (msg.CommissionType == 1) {
text = "用户返佣.xls";
}
if (msg.CommissionType == 2) {
text = "幸福存折明细.xls";
}
EduDownLoad(
"/CustomerCommission/GetCommissionStatisticsToExcel",
msg,
text
);
},
goUrlclass(path, Names) {
//班级
let Name = encodeURI(Names);
this.OpenNewUrl(path, {
ClassName: Name
});
},
goUrlorderList(path, row) {
//订单跳转
this.OpenNewUrl(path, {
OrderId: row.OrderId
});
}
} }
};
</script> </script>
<style lang="sass"> <style lang="sass">
@import url('~assets/css/table.sass') @import url('~assets/css/table.sass')
</style> </style>
\ No newline at end of file
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