Commit 2e8aa449 authored by Mac's avatar Mac

销售提成的页面提交

parent 543cc8d0
......@@ -70,4 +70,21 @@ export function getStockOutPageList(data) {
data
});
}
// 财务流程 销售提成规则
export function getSellCommissionRuleList(data) {
return request({
url: '/SellCommission/GetSellCommissionRuleList',
method: 'post',
data
});
}
// 财务流程 保存销售提成规则
export function setSellCommissionRule(data) {
return request({
url: '/SellCommission/SetSellCommissionRule',
method: 'post',
data
});
}
<style>
.baseSet_Title {
width: 120px !important;
padding: 18px 0 0 16px;
text-align: right;
}
.CommissionDetail .border-bottom {
/* border-bottom: 1px dashed #EEE; */
padding-bottom: 5px;
margin-bottom: 5px;
}
.CommissionDetail .text-bottom{
height: 32px;line-height: 32px; margin-bottom: 10px;
}
</style>
<template>
<div class="page-body CommissionDetail">
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3">
</div>
</div>
</div>
<template >
<el-table
ref="filterTable"
:data="tableData"
border
style="width: 100%">
<el-table-column prop="xiaoqu" label="公司" :filters="company" :filter-method="filterHandler"></el-table-column>
<el-table-column prop="bumen" label="部门" :filters="department" :filter-method="filterHandler"></el-table-column>
<el-table-column prop="name" label="姓名" sortable> </el-table-column>
<el-table-column prop="gstic" label="提成金额" sortable :sort-method="fn2"> </el-table-column>
<el-table-column prop="ewaijine" label="额外奖励" sortable> </el-table-column>
<el-table-column prop="qishu" label="额外扣除" sortable> </el-table-column>
<el-table-column label="操作" >
<template slot-scope="scope">
<el-tooltip class="item" effect="dark" content="查看" placement="top">
<i class="iconfont icon-sousuo"
@click="goUrl('CommissionDetail',Id)"></i>
</el-tooltip>
</template>
</el-table-column>
</el-table>
</template>
</div>
</template>
<script>
import {
GetClassTypePageList,
} from '../../api/system/index';
import{
getSellCommissionRuleList,
setSellCommissionRule
} from '../../api/finance/index'
export default {
meta: {
title: "销售提成详情"
},
props: {},
components: {},
data() {
return {
loading: false,
//列表数据参数
msg: {
pageIndex: 1,
pageSize: 99
},
pageCount: 0,
persistent: false,
listData:{},
tableData:[
{xiaoqu:'微途科技1',bumen:'销售部1',name:'徐总',gstic:'1.00',ewaijine:'0.00',riqi:'2019-03-15','qishu':'20190211'},
{xiaoqu:'微途科技2',bumen:'销售部2',name:'徐总',gstic:'12.00',ewaijine:'0.00',riqi:'2019-03-15','qishu':'20190215'},
{xiaoqu:'微途科技3',bumen:'销售部3',name:'徐总',gstic:'7.00',ewaijine:'0.00',riqi:'2019-03-15','qishu':'20190216'},
{xiaoqu:'微途科技3',bumen:'销售部3',name:'徐总',gstic:'9.00',ewaijine:'0.00',riqi:'2019-03-15','qishu':'20190218'},
],
company:[],
department:[],
}
},
created() {},
mounted() {
// this.getRuleList();//获取规则
this.company =[];
this.tableData.forEach(x=>{
let obj={
text:x.xiaoqu,
value:x.xiaoqu
}
let obj2={
text:x.bumen,
value:x.bumen
}
this.company.push(obj)
this.department.push(obj2)
})
this.company = this.unique(this.company)
this.department = this.unique( this.department)
},
methods: {
unique(Arr){
var hash = {};
Arr = Arr.reduce(function(arr, current) {
hash[current.text]
? ""
: (hash[current.text] = true && arr.push(current));
return arr;
}, []);
return Arr;
},
getRuleList(){
this.loading = true;
getSellCommissionRuleList({}).then(res => {
if (res.Code == 1) {
this.listData = res.Data
this.GetClassTypePageList();//获取班级类型列表数据
}
})
},
goUrl(path, id ) {
this.$router.push({
path: '/financial/' + path,
query: {
"id": id,
blank: 'y',
tab: '单据详情'
}
})
},
filterHandler(value, row, column) {
const property = column['property'];
return row[property] === value;
},
fn2(a,b){
return a.gstic - b.gstic;
}
},
}
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
</style>
\ No newline at end of file
<style>
.baseSet_Title {
width: 120px !important;
padding: 18px 0 0 16px;
text-align: right;
}
.salesCommission .border-bottom {
/* border-bottom: 1px dashed #EEE; */
padding-bottom: 5px;
margin-bottom: 5px;
}
.salesCommission .text-bottom{
height: 32px;line-height: 32px; margin-bottom: 10px;
}
</style>
<template>
<div class="page-body salesCommission">
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3">
</div>
</div>
</div>
<template >
<el-table
ref="filterTable"
:data="tableData"
border
style="width: 100%">
<el-table-column prop="qishu" label="期数" sortable ></el-table-column>
<el-table-column prop="alljine" label="提成总金额" width="180"></el-table-column>
<el-table-column prop="caoren" label="操作人" > </el-table-column>
<el-table-column prop="gstic" label="所属公司提成" > </el-table-column>
<el-table-column prop="caiwudanj" label="财务单据" > </el-table-column>
<el-table-column prop="riqi" label="日期" > </el-table-column>
<el-table-column label="操作" >
<template slot-scope="scope">
<el-tooltip class="item" effect="dark" content="查看" placement="top">
<i class="iconfont icon-sousuo"
@click="goUrl('CommissionDetail',Id)"></i>
</el-tooltip>
</template>
</el-table-column>
</el-table>
</template>
</div>
</template>
<script>
import {
GetClassTypePageList,
} from '../../api/system/index';
import{
getSellCommissionRuleList,
setSellCommissionRule
} from '../../api/finance/index'
export default {
meta: {
title: "销售提成列表"
},
props: {},
components: {},
data() {
return {
loading: false,
//列表数据参数
msg: {
pageIndex: 1,
pageSize: 99
},
pageCount: 0,
persistent: false,
listData:{},
tableData:[
{qishu:'201902',alljine:'10223',caoren:'徐总',gstic:'0.00',caiwudanj:2019,riqi:'2019-03-15'}
],
}
},
created() {},
mounted() {
// this.getRuleList();//获取规则
},
methods: {
getRuleList(){
this.loading = true;
getSellCommissionRuleList({}).then(res => {
if (res.Code == 1) {
this.listData = res.Data
this.GetClassTypePageList();//获取班级类型列表数据
}
})
},
goUrl(path, id ) {
this.$router.push({
path: '/financial/' + path,
query: {
"id": id,
blank: 'y',
tab: '单据详情'
}
})
},
},
}
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
</style>
\ No newline at end of file
<style>
.baseSet_Title {
width: 120px !important;
padding: 18px 0 0 16px;
text-align: right;
}
.salesRules .border-bottom {
/* border-bottom: 1px dashed #EEE; */
padding-bottom: 5px;
margin-bottom: 5px;
}
.salesRules .text-bottom{
height: 32px;line-height: 32px; margin-bottom: 10px;
}
</style>
<template>
<div class="page-body salesRules">
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3">
<q-input filled v-model="listData.FirstRate" :min='0' :max='100' @input="getFirsrate" label="首次发放比例" type="number"/>
</div>
</div>
</div>
<template >
<q-table :loading="loading" :pagination="tabeMsg" no-data-label="暂无相关数据" flat class="sticky-column-table"
separator="horizontal" :data="dataList" :columns="columns" row-key="name">
<template v-slot:top="props">
<q-space />
<div class="page-option">
<q-btn color="accent" size="sm" icon="add" @click="preservation()" ref="addBtn" label="保存规则" />
</div>
</template>
<template v-slot:body="props">
<q-tr :props="props">
<template v-for="col in props.cols">
<q-td v-if="col.name=='CTypeName'">
{{col.value}}
</q-td>
<q-td v-if="col.name == 'EnrollType'">
<div v-for="item in col.value">
<div class="text-bottom">
{{item.EnrollType==1?'初次':'续班'}}
</div>
</div>
</q-td>
<q-td v-if="col.name == 'SalesRate'">
<div v-for="(item,index) in col.value" :key='index'>
<div class="border-bottom">
<el-input v-model="item.SalesRate" style='width:180px' type="number" :min='1' :max='100' placeholder="请输入内容" @blur='xiaoshou(props.pageIndex,index)' size="small">
<template slot="append">%</template>
</el-input>
</div>
</div>
</q-td>
<q-td v-if="col.name == 'assistant'" style="width: 100px;text-align: center;">
<div v-for="item in col.value">
<div class="text-bottom" >
{{100-item.SalesRate}}%
</div>
</div>
</q-td>
<q-td v-if="col.name == 'TeacherRate'">
<div v-for="(item,index) in col.value" :key='index'>
<div class="border-bottom">
<span style="margin-right: 10px;">其中( 老师:</span>
<el-input v-model="item.TeacherRate" style='width:180px' type="number" :min='0' :max='100' placeholder="请输入内容" @blur='teacherinput(props.pageIndex,index)' size="small">
<template slot="append">%</template>
</el-input>
</div>
</div>
</q-td>
<q-td v-if="col.name == 'AssistantRate'">
<div v-for="(item,index) in col.value" :key='index'>
<div class="border-bottom">
<span style="margin-right: 10px;">助教:</span>
<el-input v-model="item.AssistantRate" style='width:180px' type="number" :min='0' :max='100' placeholder="请输入内容" @blur='assistantinput(props.pageIndex,index)' size="small">
<template slot="append">%</template>
</el-input>
<span style="margin-left: 10px;"></span>
</div>
</div>
</q-td>
</template>
</q-tr>
</template>
<template v-slot:bottom>
<q-pagination class="full-width justify-end" v-model="tabeMsg.pageIndex" color="primary" :max="1"
:input="true" @input="changePage" />
</template>
</q-table>
</template>
</div>
</template>
<script>
import {
GetClassTypePageList,
} from '../../api/system/index';
import{
getSellCommissionRuleList,
setSellCommissionRule
} from '../../api/finance/index'
export default {
meta: {
title: "销售提成规则"
},
props: {},
components: {},
data() {
return {
columns: [
{
name: 'CTypeName',
label: '班级类型',
field: 'CTypeName',
align: 'left'
},
{
name: 'EnrollType',
label: '报名类型',
align: 'left',
field: 'EnrollType',
field: row => row.List
},
{
name: 'SalesRate',
label: '销售提成比例',
align: 'left',
field: 'SalesRate',
field: row => row.List
},
{
name: 'assistant',
label: '(老师+助教总提成)',
align: 'left',
field: 'assistant',
field: row => row.List
},
{
name: 'TeacherRate',
label: '',
align: 'left',
field: 'TeacherRate',
field: row => row.List
},
{
name: 'AssistantRate',
label: '',
align: 'left',
field: 'AssistantRate',
field: row => row.List
},
],
loading: false,
dataList: [], //列表数据
//列表数据参数
tabeMsg: {
pageIndex: 1,
pageSize: 99
},
pageCount: 0,
persistent: false,
listData:{},
}
},
created() {},
mounted() {
this.getRuleList();//获取规则
},
methods: {
getRuleList(){
this.loading = true;
getSellCommissionRuleList({}).then(res => {
if (res.Code == 1) {
this.listData = res.Data
this.GetClassTypePageList();//获取班级类型列表数据
}
})
},
//获取班级类型列表数据
GetClassTypePageList() {
GetClassTypePageList(this.tabeMsg).then(res => {
this.loading = false;
if (res.Code == 1) {
this.dataList = res.Data.PageData;
this.dataList.forEach((x,i)=>{
x.List=[]
this.listData.List.forEach(j=>{
if(x.CTypeId == j.ClassType){
x.List.push(j)
}
})
//如果没有相同的但是 班级类型又有 给予默认的值
//注 由于 JavaScript 的限制,Vue 不能检测以下变动的数组:这里使用this.$set方法
if(x.List && x.List.length==0){
let obj = {
CTypeName:x.CTypeName,
CTypeId:x.CTypeId,
List:[
{Id:0,ClassType:x.CTypeId,EnrollType:2,SalesRate:1,TeacherRate:0,AssistantRate:0},
{Id:0,ClassType:x.CTypeId,EnrollType:1,SalesRate:1,TeacherRate:0,AssistantRate:0},
]
}
this.$set(this.dataList,i,obj)
}
})
}
})
},
xiaoshou(pageIndex,index){
let that = this
if(that.dataList[pageIndex].List[index].SalesRate=='' || that.dataList[pageIndex].List[index].SalesRate<0){
that.dataList[pageIndex].List[index].SalesRate = 1
}else if(that.dataList[pageIndex].List[index].SalesRate>100){
that.dataList[pageIndex].List[index].SalesRate = 100
}
},
teacherinput(pageIndex,index){//老师输入的时候input
if(this.dataList[pageIndex].List[index].TeacherRate==''){
this.dataList[pageIndex].List[index].TeacherRate = 100 - this.dataList[pageIndex].List[index].AssistantRate
}else if(this.dataList[pageIndex].List[index].TeacherRate>100 || this.dataList[pageIndex].List[index].TeacherRate<0){
this.dataList[pageIndex].List[index].TeacherRate = 0;
this.dataList[pageIndex].List[index].AssistantRate = 100;
}else{
this.dataList[pageIndex].List[index].AssistantRate = 100 - this.dataList[pageIndex].List[index].TeacherRate
}
},
assistantinput(pageIndex,index){//助教输入的时候input
if(this.dataList[pageIndex].List[index].AssistantRate==''){
this.dataList[pageIndex].List[index].AssistantRate = 100 - this.dataList[pageIndex].List[index].TeacherRate
}else if(this.dataList[pageIndex].List[index].AssistantRate>100 || this.dataList[pageIndex].List[index].AssistantRate < 0){
this.dataList[pageIndex].List[index].AssistantRate = 0;
this.dataList[pageIndex].List[index].TeacherRate = 100;
}else{
this.dataList[pageIndex].List[index].TeacherRate = 100 - this.dataList[pageIndex].List[index].AssistantRate
}
},
getFirsrate(){
if(this.listData.FirstRate>100){
this.listData.FirstRate = 100
}else if(this.listData.FirstRate<0){
this.listData.FirstRate = 0
}
},
preservation() {//保存规则
console.log( this.listData)
let addMsg = {
FirstRate:this.listData.FirstRate,
List:[],
}
this.dataList.forEach(x=>{
x.List.forEach(j=>{
addMsg.List.push(j)
})
})
console.log(addMsg)
setSellCommissionRule(addMsg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
}
})
},
changePage(){
}
},
}
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
</style>
\ No newline at end of file
......@@ -237,6 +237,23 @@ const routes = [{
component: () =>
import("pages/financial/CompanyAccount.vue")
},
{
path: "/financial/salesRules", //销售提成规则
component: () =>
import("pages/financial/salesRules.vue")
},
{
path: "/financial/salesCommission", //销售提成列表
component: () =>
import("pages/financial/salesCommission.vue")
},
{
path: "/financial/CommissionDetail", //销售提成详情
component: () =>
import("pages/financial/CommissionDetail.vue")
},
{
path: "/financial/TeamRevenueReport", //营收报表
component: () =>
......@@ -810,6 +827,8 @@ const routes = [{
component: () =>
import("pages/financial/financalDocument/PrintPageN.vue")
},
{
path: '/AssetsShenpi', //资产管理审批
name: 'AssetsShenpi',
......
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