Commit 9caf2d4a authored by 罗超's avatar 罗超

调整提成直接制单,并设定提成查看权限

parent 0b1b4c4a
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
"less": "^3.9.0", "less": "^3.9.0",
"less-loader": "^4.1.0", "less-loader": "^4.1.0",
"node-notifier": "^5.1.2", "node-notifier": "^5.1.2",
"optimize-css-assets-webpack-plugin": "^5.0.1", "optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0", "ora": "^1.2.0",
"portfinder": "^1.0.13", "portfinder": "^1.0.13",
"postcss-import": "^11.0.0", "postcss-import": "^11.0.0",
......
...@@ -43,7 +43,8 @@ export default { ...@@ -43,7 +43,8 @@ export default {
pageSize: 20, pageSize: 20,
ParentId: 0, ParentId: 0,
OrderStr: "RB_Branch_Id asc", OrderStr: "RB_Branch_Id asc",
BName:-1 BName:-1,
RB_Branch_Id:-1
}, },
total: 0, total: 0,
currentPage: 1, currentPage: 1,
...@@ -56,7 +57,8 @@ export default { ...@@ -56,7 +57,8 @@ export default {
loading: true, loading: true,
CompanyList:[], CompanyList:[],
dataListTwo: [], dataListTwo: [],
stringPerons:'' stringPerons:'',
userInfo: {}
}; };
}, },
methods: { methods: {
...@@ -133,7 +135,17 @@ export default { ...@@ -133,7 +135,17 @@ export default {
data.forEach(x => { data.forEach(x => {
x.disabled = false; x.disabled = false;
}); });
this.CompanyList = data;
if(this.userInfo.RB_Branch_id!=0){
this.CompanyList = data.filter(x=>{
if(x.BName==this.userInfo.BranchName){
return x
}else
return false
})
}else{
this.CompanyList = data;
}
this.initColums(); this.initColums();
} else { } else {
} }
...@@ -347,6 +359,10 @@ export default { ...@@ -347,6 +359,10 @@ export default {
}, },
getList() { getList() {
this.loading = true; this.loading = true;
if(this.userInfo.RB_Branch_id!=0){
this.msg.RB_Branch_Id=this.userInfo.RB_Branch_id
}
this.apipost( this.apipost(
"sellcommission_GetDetailsList", "sellcommission_GetDetailsList",
this.msg, this.msg,
...@@ -406,7 +422,7 @@ export default { ...@@ -406,7 +422,7 @@ export default {
this.msg.ParentId = this.$route.query.ParentId; this.msg.ParentId = this.$route.query.ParentId;
let dt=new Date() let dt=new Date()
this.stringPerons=(dt.getMonth()==0?(dt.getFullYear()-1):dt.getFullYear())+''+(dt.getMonth().toString().length<2?'0':'')+(dt.getMonth()==0?12:dt.getMonth()); this.stringPerons=(dt.getMonth()==0?(dt.getFullYear()-1):dt.getFullYear())+''+(dt.getMonth().toString().length<2?'0':'')+(dt.getMonth()==0?12:dt.getMonth());
console.log(this.stringPerons) this.userInfo = this.getLocalStorage();
this.getList(); this.getList();
this.getCompanyList(); this.getCompanyList();
}, },
......
<style> <style>
.CM_look{ .CM_look {
padding:4px!important; padding: 4px !important;
position: relative; position: relative;
top:1px; top: 1px;
} }
.TCommission-finance {
font-size: 12px;
text-decoration: underline;
cursor: pointer;
margin-right: 5px;
}
</style> </style>
<template> <template>
<div class="flexOne"> <div class="flexOne">
...@@ -13,106 +19,175 @@ ...@@ -13,106 +19,175 @@
<input type="button" class="normalBtn" @click="generateTable" value="生成提成报表"/> <input type="button" class="normalBtn" @click="generateTable" value="生成提成报表"/>
</li> </li>
</ul> </ul>
</div> --> </div>-->
<table class="singeRowTable" border="0" cellspacing="0" cellpadding="0"> <table class="singeRowTable" border="0" cellspacing="0" cellpadding="0">
<tr> <tr>
<th>期数</th> <th>期数</th>
<th>提成总金额</th> <th v-if="userInfo.RB_Branch_id==0 || userInfo.RB_Branch_id==49">提成总金额</th>
<th>{{$t('admin.admin_czPerson')}}</th> <th>{{$t('admin.admin_czPerson')}}</th>
<th>所属公司提成</th>
<th>财务单据</th>
<th>日期</th> <th>日期</th>
<th>{{$t('system.table_operation')}}</th> <th>{{$t('system.table_operation')}}</th>
</tr> </tr>
<tr v-for="(item,index) in dataList" :key="index"> <tr v-for="(item,index) in dataList" :key="index">
<td>{{item.periods}}</td> <td>{{item.periods}}</td>
<td>{{item.sumPrice}}</td> <td
v-if="userInfo.RB_Branch_id==0 || userInfo.RB_Branch_id==49"
>{{item.sumPrice.toFixed(2)}}</td>
<td>{{item.createByStr}}</td> <td>{{item.createByStr}}</td>
<td>{{item.branchMoney.toFixed(2)}}</td>
<td>
<span
class="TCommission-finance"
v-for="(fno, i) in item.financialsArray"
:key="i"
@click="goUrl2(fno)"
>{{fno}}</span>
</td>
<td>{{item.createStr}}</td> <td>{{item.createStr}}</td>
<td> <td>
<!-- <el-tooltip class="item" effect="dark" content="取消" placement="top">
<el-button type="danger" icon="el-icon-delete" circle></el-button>
</el-tooltip> -->
<el-tooltip class="item" effect="dark" content="查看" placement="top"> <el-tooltip class="item" effect="dark" content="查看" placement="top">
<el-button type="primary" class="CM_look" @click="goUrl('CommissionDetail',item.id)" icon="iconfont icon-chakan" circle></el-button> <el-button
type="primary"
class="CM_look"
@click="goUrl('CommissionDetail',item.id)"
icon="iconfont icon-chakan"
title="查看"
circle
></el-button>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="制单" placement="top">
<el-button
type="primary"
class="CM_look"
@click="generalFinancacls"
icon="el-icon-plus"
title="制单"
circle
></el-button>
</el-tooltip> </el-tooltip>
</td> </td>
</tr> </tr>
</table> </table>
<!-- 分页 --> <!-- 分页 -->
<el-pagination background @current-change="handleCurrentChange" :current-page.sync="currentPage" <el-pagination
layout="total,prev, pager, next, jumper" :page-size='msg.PageSize' :total='total'> background
</el-pagination> @current-change="handleCurrentChange"
:current-page.sync="currentPage"
layout="total,prev, pager, next, jumper"
:page-size="msg.PageSize"
:total="total"
></el-pagination>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
msg: { msg: {
PageIndex: 1, PageIndex: 1,
PageSize: 20 PageSize: 20
}, },
loading:false, loading: false,
//数据源 //数据源
dataList:[], dataList: [],
total:0, total: 0,
currentPage: 1, currentPage: 1,
} userInfo: {}
}, };
mounted() { },
mounted() {
this.getList();
this.userInfo = this.getLocalStorage();
},
methods: {
handleCurrentChange(val) {
this.msg.PageIndex = val;
this.getList(); this.getList();
}, },
methods: { goUrl(path, id) {
handleCurrentChange(val) { this.$router.push({
this.msg.PageIndex = val; path: path,
this.getList(); query: {
}, ParentId: id,
goUrl(path,id) { blank: "y",
this.$router.push({ tab: "报价详情"
path: path,
query: {
ParentId:id,
blank: 'y',
tab: '报价详情'
}
});
},
//获取数据
getList() {
this.loading = true;
this.apipost(
"sellcommission_GetPageList",
this.msg,
res => {
this.loading = false;
if(res.data.resultCode==1){
this.dataList = res.data.data.pageData;
this.total = res.data.data.count;
}else{
this.Error(res.data.message);
}
},
null
);
},
//生成提成报表
generateTable(){
let msg = {
UserId: 0
} }
this.apipost( });
"sellcommission_SetGenerateCommission",msg, },
res => { //获取数据
if(res.data.resultCode==1){ getList() {
this.getList(); this.loading = true;
this.Success('报表生成成功') this.apipost(
}else{ "sellcommission_GetPageList",
this.Error(res.data.message); this.msg,
res => {
this.loading = false;
if (res.data.resultCode == 1) {
this.dataList = res.data.data.pageData;
this.total = res.data.data.count;
this.dataList.forEach(x => {
if (x.financials && x.financials.length > 0) {
x.financialsArray = x.financials.split(",");
} }
}, });
null } else {
); this.Error(res.data.message);
}
},
null
);
},
goUrl2(id) {
this.$router.push({
path: "/FinancialDocumentsDetail",
query: {
id,
blank: "y",
tab: id + "单据详情"
} }
});
},
//生成提成报表
generateTable() {
let msg = {
UserId: 0
};
this.apipost(
"sellcommission_SetGenerateCommission",
msg,
res => {
if (res.data.resultCode == 1) {
this.getList();
this.Success("报表生成成功");
} else {
this.Error(res.data.message);
}
},
null
);
},
generalFinancacls(){
let query = {
blank: "y",
tab: "新增付款单据",
Type:2,
IsUploadPic:1
}
if(this.userInfo.RB_Branch_id==0) {
query.id=28
query.Name="总部销售提成单"
}else{
query.id=30
query.Name="分公司销售提成单"
}
this.$router.push({
path: "/addFinancialDocuments",
query
});
} }
} }
};
</script> </script>
This diff is collapsed.
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