Commit ecf7c4f1 authored by 黄奎's avatar 黄奎
parents 866736a2 f5e18382
...@@ -120,4 +120,13 @@ export function getSellCommissionForOrderList(data) { ...@@ -120,4 +120,13 @@ export function getSellCommissionForOrderList(data) {
}); });
} }
// 财务工作台 获取周期提成 创建提成
export function setSellCommissionInfo(data) {
return request({
url: '/SellCommission/SetSellCommissionInfo',
method: 'post',
data
});
}
...@@ -118,9 +118,21 @@ ...@@ -118,9 +118,21 @@
department:[], department:[],
ClassList:[], ClassList:[],
allClassList:[], allClassList:[],
see_tcdetailed:false
}
},
created() {
let userinfo = this.getLocalStorage();
userinfo.ActionMenuList.map(x=>{//判断权限
if(x.FunctionCode == "see_tcdetailed"){//判断是否可以查看其他明细
this.see_tcdetailed = true;
}
})
if(this.see_tcdetailed == false){
console.log(userinfo)
this.msg.UserId = userinfo.Id
} }
}, },
created() {},
mounted() { mounted() {
console.log(this.$route.query) console.log(this.$route.query)
if(this.$route.query && this.$route.query.id){ if(this.$route.query && this.$route.query.id){
......
...@@ -1629,7 +1629,7 @@ ...@@ -1629,7 +1629,7 @@
if(!this.msg.InvoiceRemark){ if(!this.msg.InvoiceRemark){
this.msg.InvoiceRemark = '' this.msg.InvoiceRemark = ''
} }
if (id || id === 0) { if (id || id === 0) {
if (!this.orderObj && id > 0) { if (!this.orderObj && id > 0) {
this.msg.RB_Branch_Id = this.msg.RB_Branch_Id this.msg.RB_Branch_Id = this.msg.RB_Branch_Id
...@@ -1645,10 +1645,13 @@ ...@@ -1645,10 +1645,13 @@
if(!this.$route.query.companyID&&userInfo.Group_Id==100000){ if(!this.$route.query.companyID&&userInfo.Group_Id==100000){
this.msg.RB_Branch_Id = 4 this.msg.RB_Branch_Id = 4
} }
if(this.orderObj ){//6.21号新加 校区的id
this.msg.RB_Branch_Id = this.orderObj.School_Id
}
if (this.orderObj && this.orderObj.companyIDList && this.orderObj.companyIDList.length > 0) { if (this.orderObj && this.orderObj.companyIDList && this.orderObj.companyIDList.length > 0) {
this.msg.RB_Branch_Id = this.orderObj.companyIDList[0]; this.msg.RB_Branch_Id = this.orderObj.companyIDList[0];
} else if (this.$route.query.companyID) { } else if (this.$route.query.companyID) {
if(this.$route.query.companyID!=='undefined'){ if(this.$route.query.companyID!=='undefined'){
this.msg.RB_Branch_Id = parseInt(this.$route.query.companyID); this.msg.RB_Branch_Id = parseInt(this.$route.query.companyID);
}else { }else {
...@@ -1657,6 +1660,7 @@ ...@@ -1657,6 +1660,7 @@
} }
} }
this.admin_get_DepartmentGetList(this.msg.RB_Branch_Id); this.admin_get_DepartmentGetList(this.msg.RB_Branch_Id);
this.get_GetInvoiceTypeEnumList() this.get_GetInvoiceTypeEnumList()
this.msg.PayDate = this.msg.PayDate; this.msg.PayDate = this.msg.PayDate;
...@@ -1832,12 +1836,14 @@ ...@@ -1832,12 +1836,14 @@
} }
}) })
let Status=false; let Status=false;
if(this.$route.query.companyID!=='-1' && this.$route.query.companyID!==undefined){ if(this.$route.query.companyID!=='-1' && this.$route.query.companyID!==undefined){
Status=true; Status=true;
data.forEach(x=>{ data.forEach(x=>{
x.disabled = true; x.disabled = true;
}) })
} }
if (this.orderObj && this.orderObj.companyIDList && this.orderObj.companyIDList.length>0) { if (this.orderObj && this.orderObj.companyIDList && this.orderObj.companyIDList.length>0) {
Status=true; Status=true;
this.orderObj.companyIDList.forEach(x=>{ this.orderObj.companyIDList.forEach(x=>{
......
...@@ -41,9 +41,27 @@ ...@@ -41,9 +41,27 @@
<div class="page-body salesCommission"> <div class="page-body salesCommission">
<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 class="col-3"> <div style="margin-right: 20px;" v-if='iscMaker==true'>
<q-input filled v-model="msg.Name" @keyup.enter.native="msg.PageIndex = 1,getList()" label="周期名称" /> <div class="block">
<span style="margin-right: 5px;">校区</span>
<el-select v-model="msg.SchoolId" filterable @change="handleCurrentChanges(1)">
<el-option value="-1" label="不限"></el-option>
<el-option v-for='item in CompanyList' :label='item.SName' :value='item.SId' :key='item.SId'></el-option>
</el-select>
</div>
</div>
<div class="col-3" v-if='isgenerate==true'>
<div class="block" style="display:flex">
<span style="margin-right: 5px;">选择月份</span>
<el-date-picker
v-model="value2"
type="month"
placeholder="选择月">
</el-date-picker>
<q-btn :loading="loading1" color="primary" size="11px" label="生成提成" @click="scCommission" style="margin-left:10px"/>
</div>
</div> </div>
</div> </div>
</div> </div>
<template > <template >
...@@ -56,6 +74,13 @@ ...@@ -56,6 +74,13 @@
<el-table-column prop="Id" label="ID" ></el-table-column> <el-table-column prop="Id" label="ID" ></el-table-column>
<el-table-column prop="Periods" label="周期" ></el-table-column> <el-table-column prop="Periods" label="周期" ></el-table-column>
<el-table-column prop="SumPrice" label="提成总金额" > </el-table-column> <el-table-column prop="SumPrice" label="提成总金额" > </el-table-column>
<el-table-column prop="SchooldCommission" label="校区提成总金额" >
<template slot-scope="scope">
<div style="display: flex;flex-wrap: wrap;" v-if='scope.row.SchooldCommission>=0'>
{{scope.row.SchooldCommission>=0?scope.row.SchooldCommission:'-'}}
</div>
</template>
</el-table-column>
<el-table-column prop="FrIdList" label="财务单据" > <el-table-column prop="FrIdList" label="财务单据" >
<template slot-scope="scope"> <template slot-scope="scope">
<div style="display: flex;flex-wrap: wrap;" v-if='scope.row.FrIdList.length>0'> <div style="display: flex;flex-wrap: wrap;" v-if='scope.row.FrIdList.length>0'>
...@@ -74,8 +99,8 @@ ...@@ -74,8 +99,8 @@
<i class="iconfont icon-sousuo" <i class="iconfont icon-sousuo"
@click="goUrl('CommissionDetail',scope.row.Id)"></i> @click="goUrl('CommissionDetail',scope.row.Id)"></i>
</el-tooltip> </el-tooltip>
<el-tooltip class="item" effect="dark" content="制单" placement="top"> <el-tooltip class="item" effect="dark" content="制单" placement="top" v-if='iscMaker==true'>
<i class="iconfont icon-add" <i class="iconfont icon-add" v-if='iscMaker==true'
@click="generalFinancacls(scope.row)"></i> @click="generalFinancacls(scope.row)"></i>
</el-tooltip> </el-tooltip>
</div> </div>
...@@ -84,8 +109,8 @@ ...@@ -84,8 +109,8 @@
</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" :current-page.sync="msg.pageIndex" <el-pagination background @current-change="handleCurrentChanges" layout="total,prev, pager, next, jumper" :current-page.sync="msg.PageSize"
:page-size="msg.pageSize" :total='total'> :page-size="msg.PageSize" :total='total'>
</el-pagination> </el-pagination>
</div> </div>
...@@ -94,12 +119,16 @@ ...@@ -94,12 +119,16 @@
</div> </div>
</template> </template>
<script> <script>
import {
getSchoolDropdown
} from '../../api/school/index'
import { import {
GetClassTypePageList, GetClassTypePageList,
} from '../../api/system/index'; } from '../../api/system/index';
import{ import{
getSellCommissionPeriodsPageList, getSellCommissionPeriodsPageList,
setSellCommissionRule setSellCommissionRule,
setSellCommissionInfo
} from '../../api/finance/index' } from '../../api/finance/index'
export default { export default {
meta: { meta: {
...@@ -110,35 +139,82 @@ ...@@ -110,35 +139,82 @@
data() { data() {
return { return {
loading: false, loading: false,
loading1: false,
value2:'',
//列表数据参数 //列表数据参数
msg: { msg: {
PageIndex: 1, PageIndex: 1,
PageSize: 20, PageSize: 20,
Name:'', Name:'',
SchoolId:'-1'
}, },
pageCount: 0, pageCount: 0,
persistent: false, persistent: false,
listData:{}, listData:{},
tableData:[], tableData:[],
total:0 total:0,
CompanyList:[],
isgenerate:false,//是否有生成的权限
iscMaker:false,//是否有制单的权限
} }
}, },
created() {}, created() {
let userinfo = this.getLocalStorage();
userinfo.ActionMenuList.map(x=>{//判断权限
if(x.FunctionCode == "Generate_Commission"){//判断是否有生成的权限
this.isgenerate = true;
}
if(x.FunctionCode == "Commission_maker"){//判断是否有制单的权限
this.iscMaker = true;
}
})
var myDate=new Date();
myDate.setMonth(myDate.getMonth()-1);
this.value2 = myDate.getFullYear() + "-" + (myDate.getMonth()+1)
},
mounted() { mounted() {
this.getList();//获取提成周期列表 this.getList();//获取提成周期列表
this.getBranchList()
}, },
methods: { methods: {
getList(){ getList(){
this.loading = true; this.loading = true;
getSellCommissionPeriodsPageList(this.msg).then(res => { getSellCommissionPeriodsPageList(this.msg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.tableData = res.Data.PageData this.tableData = res.Data.PageData
this.total = res.Data.Count this.total = res.Data.Count
} }
})
},
scCommission(){//生成提成
if(this.loading1 == false){
this.loading1= true;
setSellCommissionInfo({Month:this.value2}).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '生成提成成功',
position: 'top'
})
this.getList()
}
this.loading1= false;
}).catch(err=>{
this.loading1= false;
})
}
},
getBranchList(){//获取校区
getSchoolDropdown({}).then(res => {
this.CompanyList = res.Data;
}).catch(() => {
}) })
}, },
goUrl(path, id ) { goUrl(path, id ) {
this.$router.push({ this.$router.push({
path: '/financial/' + path, path: '/financial/' + path,
...@@ -158,33 +234,66 @@ ...@@ -158,33 +234,66 @@
}) })
}, },
generalFinancacls(item) { generalFinancacls(item) {
if (item.FrIdList && item.FrIdList.length > 0) { if(this.msg.SchoolId == -1){
this.Error("请不要多次制单!") if(item.SumPrice>0){
return; this.tishi(item.SumPrice)
}else{
this.$message.error('提成总金额为0')
}
}else{
if(item.SchooldCommission>0){
this.goaddFinancial(item.SchooldCommission)
}else{
this.$message.error('校区提成总金额为0')
}
} }
},
goaddFinancial(Money){
let School_Id = 0;
let obj = { let obj = {
CostType: 16, CostType: 316,
Money: item.SumPrice, Money: Money,
CurrencyId: 21, CurrencyId: 21,
XSTC: 1, XSTC: 1,
} School_Id:this.msg.SchoolId == -1?0:this.msg.SchoolId,
let query = { }
blank: "y", let query = {
tab: "新增付款单据", blank: "y",
Type: 2, tab: "新增付款单据",
IsUploadPic: 1, Type: 2,
Name:'总部销售提成单', IsUploadPic: 1,
id:28, Name:'销售提成单',
orderObj: JSON.stringify(obj) id:143,
} orderObj: JSON.stringify(obj)
}
this.$router.push({
path: "/financial/financalDocument/addFinancialDocuments", this.$router.push({
query path: "/financial/financalDocument/addFinancialDocuments",
}); query
});
},
tishi(Money){
let that = this
this.$q.dialog({
title: "销售制单",
message: "你正在进行所有校区一起制单操作?",
persistent: true,
cancel: {
label: "取消",
flat: true
},
ok: {
label: "确认",
flat: true,
focus: true
}
}).onOk(() => {
this.goaddFinancial(Money)
});
}, },
handleCurrentChanges(val){ handleCurrentChanges(val){
console.log(val)
this.msg.PageIndex= val; this.msg.PageIndex= val;
this.getList() this.getList()
}, },
......
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