Commit 5e650729 authored by 黄奎's avatar 黄奎
parents bc37f0f8 3ea000c0
......@@ -2130,6 +2130,9 @@ export default {
},
components: {},
mounted() {
let STime = this.getBeforeDate(31,this.getBeforeDate(0,new Date().Format("yyyy-MM-dd")))
let ETime = this.getBeforeDate(0,this.getBeforeDate(0,new Date().Format("yyyy-MM-dd")))
this.productionDate = [STime,ETime]
let allH, allW, cH, cW;
allH = document.documentElement.clientHeight;
allW = document.documentElement.clientWidth;
......
<style lang="less" scoped>
@import "../../assets/css/main.less";
@import "../../assets/css/home/Saleshomepage_1920.css";
.saleChartCont {
width: 100%;
height: 95%;
box-sizing: border-box;
}
.personal {
width: 100%;
height: 100%;
}
.l_title {
width: 100%;
height: 30px
}
.Sale_Share {
color: #83ACFF;
cursor: pointer;
font-size: 12px;
margin-left: 10px;
}
.ShareDisClick {
color: gray;
}
.Sale_UnlessWords {
display: inline-block;
margin: 25px 0 0 80px;
color: #E95252;
}
</style>
<template>
<div class="l_top" style="position: relative;">
<img v-if="data.icon !=null && data.icon !='' " :src="data.icon" alt="" class="tx_img"
:onerror='defaultHeadImg'>
<img v-else src="../../assets/img/default_head_img.jpg" alt="" alt="" class="tx_img">
<div class="p_name">
<span>{{data.emName}}</span>
<span>{{data.postName}}</span>
<div @click="goAnticipate(5)" style="cursor: pointer;">
<div v-if="SumPreferPrice" style="padding: 2px 0 0 0;"><a style="color: #666666;font-size: 14px;font-weight: bold;">{{SumPreferPrice}}</a></div>
<div style="font-size: 14px;color: #333333;" v-if="rankingNum">
<a style="color: #FF8C00;margin-left: 3px;margin-right: 3px;
font-size: 18px;font-weight: bold;">{{rankingNum}}</a
>
</div>
</div>
</div>
<div style="display: flex;justify-content: space-between;">
<!-- <img style="cursor: pointer;" src="../../assets/img/jinbin@2x.png" alt="" class="img" @click="goAnticipate(1)"> -->
<div style="cursor: pointer;cursor: pointer;position: relative;" class="royalty" @click="goAnticipate(1)">
<div class="tc">
<p>
<span></span>
<span>{{data.totalCommission}}</span>
</p>
<p style="color: #BDBDBD;font-size: 13px;padding: 0 0 5px 0;">{{data.periodsName}}<el-tag
v-if="data.peopelBonus" size="mini" type="danger"
effect="dark" style="color: #ffff;position: absolute;left: 70px;bottom: 23px;font-size: 11px;">奖+{{data.peopelBonus}}</el-tag></p>
</div>
<div stye="font-size: 16px;color: #666666;display: block;display: inline-block;">
<span>出境提成</span>
<template v-if="data.comissionGeneralId>0">
<span v-if="data.share==1" class="Sale_Share" style="color:#333;cursor:default;">已确认</span>
<span v-if="data.share==0" @click="tichengDialog=true" class="Sale_Share"
:class="{'ShareDisClick':!isSubmit}">分享并确认</span>
</template>
</div>
</div>
<div style="border-left: 1px solid #eeeeee;width: 1px;"> </div>
<!-- <img style="cursor: pointer;" src="../../assets/img/jinbin@2x.png" alt="" class="img" @click="goAnticipate(2)"> -->
<div style="cursor: pointer;margin-left: 0;" class="royalty" @click="goAnticipate(2)">
<div class="tc">
<p>
<span></span>
<span>{{data.gnSaleCommission}}</span>
</p>
<p style="color: #BDBDBD;font-size: 13px;padding: 0 0 5px 0;">{{data.gnPeriodsName}}期</p>
</div>
<div stye="font-size: 16px;color: #666666;display: block;display: inline-block;">
<span>国内提成</span>
</div>
</div>
<div style="border-left: 1px solid #eeeeee;width: 1px;"> </div>
<!-- <img style="cursor: pointer;" src="../../assets/img/jinbin@2x.png" alt="" class="img" @click="goAnticipate(3)"> -->
<div style="cursor: pointer;margin-left: 0;" class="royalty" @click="goAnticipate(3)">
<div class="tc">
<p>
<span></span>
<span>{{data.dxSaleCommission}}</span>
</p>
<p style="color: #BDBDBD;font-size: 13px;padding: 0 0 5px 0;">{{data.dxPeriodsName}}期</p>
</div>
<div stye="font-size: 16px;color: #666666;display: block;display: inline-block;">
<span>历史单项提成{{pagesTitle}}</span>
</div>
</div>
<el-tooltip class="item" effect="dark" content="预期提成" placement="top" v-if="pagesTitle==1">
<img src="../../assets/img/xiaosouYQ.png" @click="goAnticipate(4)"
style="width: 20px;height: auto; position: absolute;right: -0;top: -13px;cursor: pointer;color: #33B3FF;"></img>
</el-tooltip>
</div>
<!-- 分享业绩 -->
<el-dialog custom-class='w500' title="分享提成" :visible.sync="tichengDialog" center :before-close="resetCommission">
<el-form :model="shareMsg" :rules="rules" ref="shareMsg" label-width="80px">
<el-form-item label="个人宣言" style="margin-bottom:0;" prop="ShareContent">
<el-input type="textarea" rows="6" resize="none" maxlength="100" v-model="shareMsg.ShareContent"
placeholder=""></el-input>
</el-form-item>
</el-form>
<span class="Sale_UnlessWords">
不能少于10个字
</span>
<div slot="footer" class="dialog-footer">
<button class="hollowFixedBtn" @click="tichengDialog=false">取消</button>
<button class="normalBtn" @click="shareCommission">确定</button>
</div>
</el-dialog>
</div>
</template>
<script>
import leftNav from '../public/leftNav.vue'
import moment from 'moment'
export default {
props:['pagesTitle'],
data() {
return {
SumPreferPrice: 0,
rankingNum: 0,
type: 1,
defaultHeadImg: 'this.src="' + require("../../assets/img/default_head_img.jpg") + '"',
style: {
width: 0,
background: "#FFFFFF"
},
data: [],
groupdata: [],
screenWidth: 0,
zoom: 1,
tichengDialog: false,
shareMsg: {
ShareContent: '',
PeriodsId: 0,
totalCommission: 0
},
rules: {
ShareContent: [{
required: true,
message: '请填写个人宣言',
trigger: 'blur'
}]
},
//验证重复提交
isSubmit: true,
CurrentUserInfo: {},
EditBtn: false,
PMMsg: {
RB_Branch_Id: -1,
RB_Department_Id: 0,
EnterID: 0,
tStartDates: [],
qStartDates: [],
GroupBy: "EnterID",
QueryType: 0,
},
}
},
components: {
leftNav
},
watch: {
pagesTitle:{
handler(val, oldVal){
this.pagesTitle = val
},
immediate:true
}
},
methods: {
settStartDates() {
let nowdays = new Date()
let Year = new Date().getFullYear()
let MonthTime = new Date().getMonth() + 1
let MonthDayNum = new Date(Year, 12, 0).getDate();
let date = Year+'-12-'+(MonthDayNum>10?MonthDayNum:'0'+MonthDayNum)
let start = Year+'-01-01'
this.PMMsg.tStartDates = [start, date]
},
initData() {
let userInfo = this.getLocalStorage();
let param = {
RB_Branch_Id:
this.PMMsg.RB_Branch_Id == -1 ? null : this.PMMsg.RB_Branch_Id,
RB_Department_Id:
this.PMMsg.RB_Department_Id == 0 ? null : this.PMMsg.RB_Department_Id,
EnterID: this.PMMsg.EnterID == 0 ? null : this.PMMsg.EnterID,//Number(userInfo.EmployeeId)
QStartDate:
this.PMMsg.tStartDates && this.PMMsg.tStartDates.length == 2
? this.PMMsg.tStartDates[0]
: null,
QEndDate:
this.PMMsg.tStartDates && this.PMMsg.tStartDates.length == 2
? this.PMMsg.tStartDates[1]
: null,
CStartDate:
this.PMMsg.qStartDates && this.PMMsg.qStartDates.length == 2
? this.PMMsg.qStartDates[0]
: null,
CEndDate:
this.PMMsg.qStartDates && this.PMMsg.qStartDates.length == 2
? this.PMMsg.qStartDates[1]
: null,
GroupBy: this.PMMsg.GroupBy,
QueryType: this.PMMsg.QueryType,
};
if (!param.QStartDate) {
param.QStartDate = "2019-01-01";
}
let tableData = []
this.apipost("sellorder_get_sellvolumerankNew", param, (r) => {
r.data.data.forEach((x) => {
x.incomeVal = parseFloat(x.income);
x.avgPrice = parseFloat(x.avgPrice);
});
tableData = r.data.data;
tableData.forEach((item,index)=>{
if(item.EnterID==Number(userInfo.EmployeeId)){
this.rankingNum = index+1
this.SumPreferPrice = item.SumPreferPrice
}
})
});
},
// 销售预期提成
goAnticipate(type){
let userInfo = this.getLocalStorage();
let name
if(type==1){//出境
name = 'TradeTicketUserDetails'
}else if(type==2){//国内
name = 'domesticCommissionUser'
}else if(type==3){//历史单项
name = 'ServiceCommissionUser'
}else if(type==4){//预期提成
name = 'saleExpectedCommission'
}else if(type==5){//排名
name = 'salesVolumeRank'
this.$router.push({
name: name,
query: {
tStartDates: this.PMMsg.tStartDates,
blank: 'y'
}
});
}
if(type!=5){
this.$router.push({
name: name,
query: {
UserId: Number(userInfo.EmployeeId),
isSale: 1,
blank: 'y'
}
});
}
},
//锅炉除开标点符号的字数
getFilteredNum(val) {
//var pattern=new RegExp("[`~%!@#$^=''?~!@#¥……&——‘”“'?*()(),,。.、<>《》\\[\\]【】\\“\\”{}=+-|\/:;;:]");
var pattern = new RegExp("[`~%!@#$^=''?~!@#¥……&——‘”“'?*()(),,。.、<>《》:;; +-=\\s]");
//[]内输入你要过滤的字符,这里基本包含全部的标点符号,\\是转义字符
var rs = "";
for (var i = 0; i < val.length; i++) {
rs += val.substr(i, 1).replace(pattern, '');
}
return rs
},
//确定分享业绩
shareCommission() {
if (this.shareMsg.ShareContent == '') {
this.Error('请填写个人宣言');
return;
}
let FilterNum = this.getFilteredNum(this.shareMsg.ShareContent);
if (FilterNum.length < 10) {
this.Error('字数太少了,再多说点吧!');
return;
} else {
this.shareMsg.PeriodsId = this.data.comissionGeneralId;
this.shareMsg.totalCommission = this.data.totalCommission;
if (this.isSubmit) {
this.isSubmit = false;
this.apipost('customerIndex_post_SetSellComissionGeneralSure', this.shareMsg, res => {
this.isSubmit = true;
if (res.data.resultCode == 1) {
this.Success(res.data.message);
this.iWorkbench();
this.resetCommission();
this.MsgBus.$emit('reSetMSG');
} else {
this.Error(res.data.message);
}
}, err => {})
}
}
},
//关闭重置输入框
resetCommission() {
this.tichengDialog = false;
this.shareMsg.ShareContent = ''
},
iWorkbench() {
this.apipost('customerIndex_post_GetMySelfSellInfo', {}, res => {
if (res.data.resultCode == 1) {
this.data = res.data.data;
} else {
this.$message.error(res.data.message)
}
}, err => {})
},
},
mounted() {
this.settStartDates()
this.iWorkbench() //销售个人工作台接口
// 排名
this.initData()
},
}
</script>
......@@ -53,78 +53,7 @@
<el-row :gutter="20">
<el-col :span="12">
<div class="el-col-div ownScrollbarStyle PersonalData_l">
<div class="l_top" style="position: relative;">
<img v-if="data.icon !=null && data.icon !='' " :src="data.icon" alt="" class="tx_img"
:onerror='defaultHeadImg'>
<img v-else src="../../assets/img/default_head_img.jpg" alt="" alt="" class="tx_img">
<div class="p_name">
<span>{{data.emName}}</span>
<span>{{data.postName}}</span>
<div @click="goAnticipate(5)" style="cursor: pointer;">
<div v-if="SumPreferPrice" style="padding: 2px 0 0 0;"><a style="color: #666666;font-size: 14px;font-weight: bold;">{{SumPreferPrice}}</a></div>
<div style="font-size: 14px;color: #333333;" v-if="rankingNum">
<a style="color: #FF8C00;margin-left: 3px;margin-right: 3px;
font-size: 18px;font-weight: bold;">{{rankingNum}}</a
>
</div>
</div>
</div>
<div style="display: flex;justify-content: space-between;">
<!-- <img style="cursor: pointer;" src="../../assets/img/jinbin@2x.png" alt="" class="img" @click="goAnticipate(1)"> -->
<div style="cursor: pointer;cursor: pointer;position: relative;" class="royalty" @click="goAnticipate(1)">
<div class="tc">
<p>
<span></span>
<span>{{data.totalCommission}}</span>
</p>
<p style="color: #BDBDBD;font-size: 13px;padding: 0 0 5px 0;">{{data.periodsName}}<el-tag
v-if="data.peopelBonus" size="mini" type="danger"
effect="dark" style="color: #ffff;position: absolute;left: 70px;bottom: 23px;font-size: 11px;">奖+{{data.peopelBonus}}</el-tag></p>
</div>
<div stye="font-size: 16px;color: #666666;display: block;display: inline-block;">
<span>出境提成</span>
<template v-if="data.comissionGeneralId>0">
<span v-if="data.share==1" class="Sale_Share" style="color:#333;cursor:default;">已确认</span>
<span v-if="data.share==0" @click="tichengDialog=true" class="Sale_Share"
:class="{'ShareDisClick':!isSubmit}">分享并确认</span>
</template>
</div>
</div>
<div style="border-left: 1px solid #eeeeee;width: 1px;"> </div>
<!-- <img style="cursor: pointer;" src="../../assets/img/jinbin@2x.png" alt="" class="img" @click="goAnticipate(2)"> -->
<div style="cursor: pointer;margin-left: 0;" class="royalty" @click="goAnticipate(2)">
<div class="tc">
<p>
<span></span>
<span>{{data.gnSaleCommission}}</span>
</p>
<p style="color: #BDBDBD;font-size: 13px;padding: 0 0 5px 0;">{{data.gnPeriodsName}}期</p>
</div>
<div stye="font-size: 16px;color: #666666;display: block;display: inline-block;">
<span>国内提成</span>
</div>
</div>
<div style="border-left: 1px solid #eeeeee;width: 1px;"> </div>
<!-- <img style="cursor: pointer;" src="../../assets/img/jinbin@2x.png" alt="" class="img" @click="goAnticipate(3)"> -->
<div style="cursor: pointer;margin-left: 0;" class="royalty" @click="goAnticipate(3)">
<div class="tc">
<p>
<span></span>
<span>{{data.dxSaleCommission}}</span>
</p>
<p style="color: #BDBDBD;font-size: 13px;padding: 0 0 5px 0;">{{data.dxPeriodsName}}期</p>
</div>
<div stye="font-size: 16px;color: #666666;display: block;display: inline-block;">
<span>历史单项提成</span>
</div>
</div>
<el-tooltip class="item" effect="dark" content="预期提成" placement="top">
<img src="../../assets/img/xiaosouYQ.png" @click="goAnticipate(4)"
style="width: 20px;height: auto; position: absolute;right: -0;top: -13px;cursor: pointer;color: #33B3FF;"></img>
</el-tooltip>
</div>
</div>
<rightHead :pagesTitle="1"></rightHead>
<div class="order">
<div class="l_title">
......@@ -579,32 +508,15 @@
</div>
</div>
</div>
<!-- 分享业绩 -->
<el-dialog custom-class='w500' title="分享提成" :visible.sync="tichengDialog" center :before-close="resetCommission">
<el-form :model="shareMsg" :rules="rules" ref="shareMsg" label-width="80px">
<el-form-item label="个人宣言" style="margin-bottom:0;" prop="ShareContent">
<el-input type="textarea" rows="6" resize="none" maxlength="100" v-model="shareMsg.ShareContent"
placeholder=""></el-input>
</el-form-item>
</el-form>
<span class="Sale_UnlessWords">
不能少于10个字
</span>
<div slot="footer" class="dialog-footer">
<button class="hollowFixedBtn" @click="tichengDialog=false">取消</button>
<button class="normalBtn" @click="shareCommission">确定</button>
</div>
</el-dialog>
</div>
</template>
<script>
import leftNav from '../public/leftNav.vue'
import rightHead from '../public/rightHead.vue'
import moment from 'moment'
export default {
data() {
return {
SumPreferPrice: 0,
rankingNum: 0,
type: 1,
defaultHeadImg: 'this.src="' + require("../../assets/img/default_head_img.jpg") + '"',
style: {
......@@ -618,12 +530,6 @@
NotDealCount: 0, //
zoom: 1,
OrderList: [],
tichengDialog: false,
shareMsg: {
ShareContent: '',
PeriodsId: 0,
totalCommission: 0
},
rules: {
ShareContent: [{
required: true,
......@@ -647,7 +553,8 @@
}
},
components: {
leftNav
leftNav,
rightHead
},
watch: {
......@@ -658,95 +565,6 @@
}
},
methods: {
settStartDates() {
let nowdays = new Date()
let Year = new Date().getFullYear()
let MonthTime = new Date().getMonth() + 1
let MonthDayNum = new Date(Year, 12, 0).getDate();
let date = Year+'-12-'+(MonthDayNum>10?MonthDayNum:'0'+MonthDayNum)
let start = Year+'-01-01'
this.PMMsg.tStartDates = [start, date]
},
initData() {
let userInfo = this.getLocalStorage();
let param = {
RB_Branch_Id:
this.PMMsg.RB_Branch_Id == -1 ? null : this.PMMsg.RB_Branch_Id,
RB_Department_Id:
this.PMMsg.RB_Department_Id == 0 ? null : this.PMMsg.RB_Department_Id,
EnterID: this.PMMsg.EnterID == 0 ? null : this.PMMsg.EnterID,//Number(userInfo.EmployeeId)
QStartDate:
this.PMMsg.tStartDates && this.PMMsg.tStartDates.length == 2
? this.PMMsg.tStartDates[0]
: null,
QEndDate:
this.PMMsg.tStartDates && this.PMMsg.tStartDates.length == 2
? this.PMMsg.tStartDates[1]
: null,
CStartDate:
this.PMMsg.qStartDates && this.PMMsg.qStartDates.length == 2
? this.PMMsg.qStartDates[0]
: null,
CEndDate:
this.PMMsg.qStartDates && this.PMMsg.qStartDates.length == 2
? this.PMMsg.qStartDates[1]
: null,
GroupBy: this.PMMsg.GroupBy,
QueryType: this.PMMsg.QueryType,
};
if (!param.QStartDate) {
param.QStartDate = "2019-01-01";
}
let tableData = []
this.apipost("sellorder_get_sellvolumerankNew", param, (r) => {
r.data.data.forEach((x) => {
x.incomeVal = parseFloat(x.income);
x.avgPrice = parseFloat(x.avgPrice);
});
tableData = r.data.data;
tableData.forEach((item,index)=>{
if(item.EnterID==Number(userInfo.EmployeeId)){
this.rankingNum = index+1
this.SumPreferPrice = item.SumPreferPrice
}
})
});
},
// 销售预期提成
goAnticipate(type){
let userInfo = this.getLocalStorage();
let name
if(type==1){
name = 'TradeTicketUserDetails'
}else if(type==2){
name = 'domesticCommissionUser'
}else if(type==3){
name = 'ServiceCommissionUser'
}else if(type==4){
name = 'saleExpectedCommission'
}else if(type==5){
name = 'salesVolumeRank'
this.$router.push({
name: name,
query: {
tStartDates: this.PMMsg.tStartDates,
blank: 'y'
}
});
}
if(type!=5){
this.$router.push({
name: name,
query: {
UserId: Number(userInfo.EmployeeId),
isSale: 1,
blank: 'y'
}
});
}
},
iWorkbench() {
this.apipost('customerIndex_post_GetMySelfSellInfo', {}, res => {
if (res.data.resultCode == 1) {
......@@ -971,51 +789,6 @@
path: path
})
},
//锅炉除开标点符号的字数
getFilteredNum(val) {
//var pattern=new RegExp("[`~%!@#$^=''?~!@#¥……&——‘”“'?*()(),,。.、<>《》\\[\\]【】\\“\\”{}=+-|\/:;;:]");
var pattern = new RegExp("[`~%!@#$^=''?~!@#¥……&——‘”“'?*()(),,。.、<>《》:;; +-=\\s]");
//[]内输入你要过滤的字符,这里基本包含全部的标点符号,\\是转义字符
var rs = "";
for (var i = 0; i < val.length; i++) {
rs += val.substr(i, 1).replace(pattern, '');
}
return rs
},
//确定分享业绩
shareCommission() {
if (this.shareMsg.ShareContent == '') {
this.Error('请填写个人宣言');
return;
}
let FilterNum = this.getFilteredNum(this.shareMsg.ShareContent);
if (FilterNum.length < 10) {
this.Error('字数太少了,再多说点吧!');
return;
} else {
this.shareMsg.PeriodsId = this.data.comissionGeneralId;
this.shareMsg.totalCommission = this.data.totalCommission;
if (this.isSubmit) {
this.isSubmit = false;
this.apipost('customerIndex_post_SetSellComissionGeneralSure', this.shareMsg, res => {
this.isSubmit = true;
if (res.data.resultCode == 1) {
this.Success(res.data.message);
this.iWorkbench();
this.resetCommission();
this.MsgBus.$emit('reSetMSG');
} else {
this.Error(res.data.message);
}
}, err => {})
}
}
},
//关闭重置输入框
resetCommission() {
this.tichengDialog = false;
this.shareMsg.ShareContent = ''
},
GetAuth() {
var actionCode = this.$AuthCode.V_PersonalCenter;
this.CheckUserAuth(actionCode, res => {
......@@ -1026,7 +799,6 @@
},
},
mounted() {
this.settStartDates()
this.GetAuth();
this.CurrentUserInfo = this.getLocalStorage();
var w = document.documentElement.clientWidth || document.body.clientWidth;
......@@ -1042,8 +814,6 @@
this.iWorkbench() //销售个人工作台接口
this.grouplist() //销售首页小组工作台
this.Financial_post_GetNotDealCount(); //待处理财务单据的个数
// 排名
this.initData()
},
}
......
<style lang="less" scoped>
@import "../../assets/css/main.less";
@import "../../assets/css/cssReset.css";
/* @import "../../assets/css/cssReset.css"; */
@import "../../assets/css/home/Saleshomepage_1920.css";
.saleChartCont {
width: 100%;
height: 95%;
box-sizing: border-box;
}
.personal {
width: 100%;
height: 100%;
}
.l_title {
width: 100%;
height: 30px
}
.Sale_Share {
color: #83ACFF;
cursor: pointer;
font-size: 12px;
margin-left: 10px;
}
.ShareDisClick {
color: gray;
}
.Sale_UnlessWords {
display: inline-block;
margin: 25px 0 0 80px;
color: #E95252;
}
.title-Month{
text-align: right;
}
.headerTitle{
display: flex;
}
.headerTitle p{
font-weight: bold;
flex-wrap: nowrap;
}
.headerTitle span{
font-weight: 100;
color: red;
margin-right: 20px;
}
</style>
<template>
<div>
<leftNav></leftNav>
<div class="sale_cont" v-if="CurrentUserInfo.RB_Group_id==2 || EditBtn">
<!-- <div class="Sale_menu">
<ul>
<template v-for="(item ,index) in MonthList">
<li :class="{active:Month==item.Id}" @click="Month=item.Id">{{item.Name}}</li>
</template>
</ul>
</div> -->
<div class="saleChartCont" :style="{zoom:zoom}">
<div class="personal">
<div class="PersonalData" style="height: auto;margin-top: 0;background: none;">
<el-row :gutter="20">
<el-col :span="12">
<div class="el-col-div ownScrollbarStyle PersonalData_l" style="height: auto;background: #fff;">
<rightHead :pagesTitle="2"></rightHead>
</div>
</el-col>
<el-col :span="12" style="background: #fff;">
<div class="el-col-div ownScrollbarStyle PersonalData_l" style="height: 158px;">
<div class="title-Month">
<template v-for="(item ,index) in MonthList">
<input type="button" :key="index"
:class="{'normalBtn':Month==item.Id,'hollowFixedBtn':Month!=item.Id}"
:value="item.Name"
@click="clickActive(item)"></input>
</template>
</div>
<div style="display: flex;align-items: center; justify-content: space-between;
height: 40px;padding: 0 20px;">
<div class="headerTitle">
<p>总订单数:<span></span></p>
<p>总人头数:<span></span></p>
<p>总预期奖金:<span>{{CommissionJJ}}</span></p>
<p>总预期提成:<span>{{CommissionTC}}</span></p>
</div>
</div>
</div>
</el-col>
</el-row>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import leftNav from '../public/leftNav.vue'
import leftNav from '../public/leftNav.vue'
import rightHead from '../public/rightHead.vue'
export default {
data (){
return{
EditBtn: false,
CurrentUserInfo: {},
zoom: 1,
CommissionJJ: 0,
CommissionTC: 0,
msg:{
Month: ''
},
Month: 1,
MonthList:[
{Name:'上月',Id:'0'},
{Name:'当月',Id:'1'},
],
CommissionInfor:{},
YearTime:'',
LastMonthTime: '',
MonthTime: '',
commissionMsg:{
pageIndex: 1,
pageSize: 6,
OrderId: "", //订单id
GuestId: 0, //客人id
EnterId: 0, //业务员id
OrderState: '1', //订单状态
Q_IsCollect: "2", //收款状态
StartTime: "",//报名开始日期
EndTime: "",//报名结束日期
FinishSTime: "",//完结开始时间
FinishETime: "",//完结结束时间
DepartSTime: "",//出发开始
DepartETime: "",//出发结束
TCNUM: "",//团号
ProductName: "",//商品名称
CustomerName: "",//客户名称
LureEmpId: 0,//引流人员
LineId: 0,//线路
TravelType: 0,//跟团类型 1跟团 2当地游
OrderType: "0",//订单类型
IsSelectCRM: 0,//1来源crm
IsMyOrder: 1,//1我的订单
},
isAnnualBonus: false,// 年终奖权限
}
},
components:{
leftNav
leftNav,
rightHead
},
methods:{
clickActive(item){
this.Month = item.Id
if(item.Id==1){
this.msg.Month = this.Year+'-'+(this.MonthTime>10?this.MonthTime:'0'+this.MonthTime)
}else{
this.msg.Month = this.Year+'-'+(this.LastMonthTime>10?this.LastMonthTime:'0'+this.LastMonthTime)
}
// this.getList()
},
// 获取规则列表数据
getList() {
this.apipost("sellcommission_GetTYSaleCommissionRuleList", {}, res => {
this.loading = false;
if (res.data.resultCode == 1) {
this.dataRuleList = res.data.data[0];
this.JapaneseLine.CommissionRateList = this.dataRuleList.AwardRuleList
this.JapaneseProfit.CommissionRateList = this.dataRuleList.ProfitRuleList
this.EuropeLine.CommissionRateList = this.dataRuleList.EuropeAwardRuleList
this.EuropeProfit.CommissionRateList = this.dataRuleList.EuropeProfitRuleList
this.OtherLine.CommissionRateList = this.dataRuleList.OtherAwardRuleList
this.OtherProfit.CommissionRateList = this.dataRuleList.OtherProfitRuleList
this.AnnualBonus.CommissionRateList = this.dataRuleList.BonusRuleList
this.getData()
}else{
this.Error(res.data.message)
}
});
},
// 获取预期数据
getData(){
// 日本欧洲提成
this.apipost('sellcommission_GetTYSaleExpectCommission', this.msg,
res => {
if (res.data.resultCode == 1) {
let data = res.data.data
this.CommissionInfor = data;
// 日本及其他人头奖励
this.JapaneseLine.AvgLureNum = this.CommissionInfor.PeopleNum?this.CommissionInfor.PeopleNum:0
this.JapaneseLine.Commission = this.CommissionInfor.PeopleMoney?this.CommissionInfor.PeopleMoney:0
// 日本及其他提成比例
this.JapaneseProfit.AvgLureNum = this.CommissionInfor.JapanCommission?this.CommissionInfor.JapanCommission:0
this.JapaneseProfit.AvfOrderNum = this.CommissionInfor.JapanOrderNum?this.CommissionInfor.JapanOrderNum:0
this.JapaneseProfit.CommissionRate = this.CommissionInfor.JapanRate?this.CommissionInfor.JapanRate:0
this.JapaneseProfit.Commission = this.CommissionInfor.JapanCommission?this.CommissionInfor.JapanCommission:0
this.JapaneseProfit.CommissionProfit = this.CommissionInfor.JapanProfit?this.CommissionInfor.JapanProfit:0
// 欧洲人头奖励
this.EuropeLine.AvgLureNum = this.CommissionInfor.EuropePNum?this.CommissionInfor.EuropePNum:0
this.EuropeLine.Commission = this.CommissionInfor.EuropeMoney?this.CommissionInfor.EuropeMoney:0
// 欧洲及其他提成比例
this.EuropeProfit.AvgLureNum = this.CommissionInfor.EuropeCommission?this.CommissionInfor.EuropeCommission:0
this.EuropeProfit.AvfOrderNum = this.CommissionInfor.EuropeOrderNum?this.CommissionInfor.EuropeOrderNum:0
this.EuropeProfit.CommissionRate = this.CommissionInfor.EuropeRate?this.CommissionInfor.EuropeRate:0
this.EuropeProfit.Commission = this.CommissionInfor.EuropeCommission?this.CommissionInfor.EuropeCommission:0
this.EuropeProfit.CommissionProfit = this.CommissionInfor.EuropeProfit?this.CommissionInfor.EuropeProfit:0
// 其他人头奖励
this.OtherLine.AvgLureNum = this.CommissionInfor.OtherPNum?this.CommissionInfor.OtherPNum:0
this.OtherLine.Commission = this.CommissionInfor.OtherMoney?this.CommissionInfor.OtherMoney:0
// 其他提成比例
this.OtherProfit.AvgLureNum = this.CommissionInfor.OtherCommission?this.CommissionInfor.OtherCommission:0
this.OtherProfit.AvfOrderNum = this.CommissionInfor.OtherOrderNum?this.CommissionInfor.OtherOrderNum:0
this.OtherProfit.CommissionRate = this.CommissionInfor.OtherRate?this.CommissionInfor.OtherRate:0
this.OtherProfit.Commission = this.CommissionInfor.OtherCommission?this.CommissionInfor.OtherCommission:0
this.OtherProfit.CommissionProfit = this.CommissionInfor.OtherProfit?this.CommissionInfor.OtherProfit:0
// 年终奖
this.AnnualBonus.AvfOrderNum = this.CommissionInfor.BonusNum?this.CommissionInfor.BonusNum:0
this.AnnualBonus.Commission = this.CommissionInfor.BonusPeriods?this.CommissionInfor.BonusPeriods:0
this.GetGNSaleExpectCommission()
}else {
this.Error(res.data.message);
}
this.loading = false
},
err => {this.loading = false}
);
},
GetGNSaleExpectCommission(){
// 国内提成
this.apipost('sellcommission_Post_GetGNSaleExpectCommission', this.msg,
res => {
if (res.data.resultCode == 1) {
this.DomesticLine = res.data.data
this.GNOrderNum = 0
this.GNEopleNum = 0
this.GNCommission = 0
this.DomesticLine.Rlist.forEach(item=>{
this.GNOrderNum+=Number(item.OrderNum)
this.GNEopleNum+=Number(item.PeopleNum)
this.GNCommission+=Number(item.Commission)
})
this.newRlistAll = [
this.DomesticLine.Rlist[2],
this.DomesticLine.Rlist[3],
this.DomesticLine.Rlist[4],
this.DomesticLine.Rlist[0],
this.DomesticLine.Rlist[1]]
this.newRlist = [this.DomesticLine.Rlist[2]]
let arr1 =[this.CommissionInfor.PeopleMoney,this.CommissionInfor.EuropeMoney]
let arr2 =[this.CommissionInfor.SalesCommission,this.CommissionInfor.JapanCommission,this.CommissionInfor.EuropeCommission,this.GNCommission]
this.CommissionJJ = this.CalculatePrice(arr1,0)
this.CommissionTC = this.CalculatePrice(arr2,2)
}
})
},
GetOrderPageList(){
this.commissionMsg.IsMyOrder = '1'
this.apipost('CarSingle_post_GetGuestOrderStatisticsPageList', this.commissionMsg,
res => {
if (res.data.resultCode == 1) {
let data = res.data.data.pageData
if(data.length>5){
for(let i=0;i<5;i++){
this.OrderList.push(data[i])
}
}else{
this.OrderList = data
}
}else {
this.Error(res.data.message);
}
this.loading = false
},
err => {this.loading = false}
)
},
//计算总成本
CalculatePrice(arr1,num) {
var CoastPrice = this.$commonUtils.CaluJsonArraySum2(
arr1,
num
);
return CoastPrice>0?CoastPrice:0
},
GetAuth() {
var actionCode = this.$AuthCode.V_PersonalCenter;
this.CheckUserAuth(actionCode, res => {
if (res.data.resultCode == 1 && res.data.data == 1) {
this.EditBtn = true;
}
});
},
},
mounted(){
this.GetAuth();
this.CurrentUserInfo = this.getLocalStorage();
var w = document.documentElement.clientWidth || document.body.clientWidth;
this.screenWidth = w;
let Width = w - 350
this.zoom = ((Width / (1920 - 350)) * 100).toFixed(0) + '%';
window.onresize = () => {
return (() => {
window.screenWidth = document.body.clientWidth
this.screenWidth = window.screenWidth
})()
}
let userInfo = this.getLocalStorage();
// 年终奖权限 销售, 引流, 市场, 票务 , 票務,总经理,总经理
if(userInfo.PostName.indexOf('销售')||userInfo.PostName.indexOf('引流')||
userInfo.PostName.indexOf('市场,')||userInfo.PostName.indexOf('票务')||
userInfo.PostName.indexOf('票務')||userInfo.PostName.indexOf('总经理')||
userInfo.PostName.indexOf('总经理')){
this.isAnnualBonus = true
}
let nowdays = new Date()
this.Year = new Date().getFullYear()
this.LastMonthTime = new Date().getMonth()
this.MonthTime = new Date().getMonth() + 1
this.msg.Month = this.Year+'-'+(this.MonthTime>10?this.MonthTime:'0'+this.MonthTime)
this.MonthList[0].Name = this.MonthList[0].Name+'('+this.LastMonthTime+'月)'
this.MonthList[1].Name = this.MonthList[1].Name+'('+this.MonthTime+'月)'
//this.Year+'-'+(this.MonthTime>10?this.MonthTime:'0'+this.MonthTime)+'-01'//出发开始
this.commissionMsg.DepartSTime = this.getBeforeDate(93,this.getBeforeDate(0,new Date().Format("yyyy-MM-dd")))
var MonthDayNum = new Date(this.Year, this.MonthTime, 0).getDate(); //计算当月的天数
this.commissionMsg.DepartETime = this.Year+'-'+(this.MonthTime>10?this.MonthTime:'0'+this.MonthTime)+'-'+(MonthDayNum>10?MonthDayNum:'0'+MonthDayNum)//出发结束
},
methods:{
goUrl (path,id) {
this.$router.push({ path: "Details",query:{path,id} })
},
}
}
</script>
\ No newline at end of file
</script>
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