Commit a4c72007 authored by zhengke's avatar zhengke

绑定数据

parent c86358dc
......@@ -376,7 +376,7 @@
CreateBy:'',
OrderId:0
},
userId:0
userId:0,
};
},
methods: {
......
......@@ -12,10 +12,14 @@
<template>
<div>
<ul class="ComDetail_nav clearfix">
<!-- <ul class="ComDetail_nav clearfix">
<li :class="active==1?'_active':''" @click="active=1,commonName='姓名'">按人排序</li>
<li :class="active==2?'_active':''" @click="active=2,commonName='公司名'">按公司排序</li>
</ul>
</ul> -->
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="按人排序" name="first"></el-tab-pane>
<el-tab-pane label="按公司排序" name="second"></el-tab-pane>
</el-tabs>
<table border="0" cellspacing="0" cellpadding="0" class="singeRowTable">
<tr>
<th width="300">{{commonName}}</th>
......@@ -24,30 +28,99 @@
<th width="500">备注</th>
<th>操作</th>
</tr>
<tr>
<td>张三疯</td>
<td>20000</td>
<td>第三期</td>
<td>我是备注我是备注</td>
<tr v-for="item in dataList">
<td>{{item.createByStr}}</td>
<td>{{item.commissionMoney}}</td>
<td>{{item.periods}}</td>
<!-- <td>{{item.ruleName}}</td> -->
<td></td>
<td>
<span class="CD_orderNum">89757</span>
<input type="button" @click="getInfo(item)" class="normalBtn" value="详情"/>
</td>
</tr>
</table>
<!-- 分页 -->
<el-pagination background @current-change="handleCurrentChange" :current-page.sync="currentPage"
layout="total,prev, pager, next, jumper" :page-size='msg.pageSize' :total='total'>
</el-pagination>
</div>
</template>
<script>
export default {
data(){
return{
active:1,
commonName:'姓名'
activeName: "first",
commonName:'姓名',
loading:false,
msg:{
pageIndex: 1,
pageSize: 20,
ParentId:0,
OrderStr:'UserId'
},
total:0,
currentPage: 1,
dataList:[]
}
},methods:{
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
getList(){
this.loading = true;
this.apipost(
"sellcommission_GetDetailsList",
this.msg,
res => {
this.loading = false;
if(res.data.resultCode==1){
this.dataList = res.data.data.pageData;
this.total = res.data.data.count;
console.log(this.dataList,'dataList');
}else{
this.Error(res.data.message);
}
},
null
);
},
//切换排序
handleClick(tab, event) {
if (this.activeName == "first") {
// this.commonName='姓名'
this.msg.OrderStr = 'UserId'
}else {
// this.commonName='公司名'
this.msg.OrderStr = 'RB_Branch_Id'
}
this.getList();
},
//跳转
getInfo(item){
var dateStr = item.periods;
var year = dateStr.substring(0,4);
var month = dateStr.substring(4,6);
var nextMonthFirstDay=new Date(year,month,1);
var oneDay=1000*60*60*24;
var entDay = new Date(nextMonthFirstDay-oneDay).Format("yyyy-MM-dd");
var startDay = year + '-' + month + '-' + '01';
var userId = item.userId;
this.$router.push({
path: 'enrollTotal',
query: {
EmployeeId:userId,
starTime:startDay,
endTime:entDay,
}
});
}
},mounted(){
this.msg.ParentId = this.$route.query.ParentId;
this.getList();
}
}
</script>
......
......@@ -10,37 +10,37 @@
<div class="query-box">
<ul>
<li>
<input type="button" class="normalBtn" value="生成提成报表"/>
<input type="button" class="normalBtn" @click="generateTable" value="生成提成报表"/>
</li>
</ul>
</div>
<table class="singeRowTable" border="0" cellspacing="0" cellpadding="0">
<tr>
<th>期数</th>
<th>总价</th>
<th>提成总金额</th>
<th>操作人</th>
<th>日期</th>
<th>操作</th>
</tr>
<tr>
<td>第一期</td>
<td>8888</td>
<td>张三疯</td>
<td>2019-2-1</td>
<tr v-for="item in dataList">
<td>{{item.periods}}</td>
<td>{{item.sumPrice}}</td>
<td>{{item.createByStr}}</td>
<td>{{item.createStr}}</td>
<td>
<el-tooltip class="item" effect="dark" content="取消" placement="top">
<!-- <el-tooltip class="item" effect="dark" content="取消" placement="top">
<el-button type="danger" icon="el-icon-delete" circle></el-button>
</el-tooltip>
</el-tooltip> -->
<el-tooltip class="item" effect="dark" content="查看" placement="top">
<el-button type="primary" class="CM_look" @click="goUrl('CommissionDetail')" icon="iconfont icon-chakan" circle></el-button>
<el-button type="primary" class="CM_look" @click="goUrl('CommissionDetail',item.id)" icon="iconfont icon-chakan" circle></el-button>
</el-tooltip>
</td>
</tr>
</table>
<!-- 分页 -->
<!-- <el-pagination background @current-change="handleCurrentChange" :current-page.sync="currentPage"
layout="total,prev, pager, next, jumper" :page-size=msg.pageSize :total=total>
</el-pagination> -->
<el-pagination background @current-change="handleCurrentChange" :current-page.sync="currentPage"
layout="total,prev, pager, next, jumper" :page-size='msg.PageSize' :total='total'>
</el-pagination>
</div>
</template>
......@@ -48,23 +48,71 @@
export default {
data() {
return {
msg: {
PageIndex: 1,
PageSize: 20
},
loading:false,
//数据源
dataList:[],
total:0,
currentPage: 1,
}
},
mounted() {
this.getList();
},
methods: {
goUrl(path) {
handleCurrentChange(val) {
this.msg.PageIndex = val;
this.getList();
},
goUrl(path,id) {
this.$router.push({
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){
this.dataList = res.data.data.pageData;
this.total = res.data.data.count;
}else{
this.Error(res.data.message);
}
},
null
);
}
}
}
</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