|
@@ -5,20 +5,18 @@
|
|
|
<el-form label-width="50px">
|
|
|
<div class="royaltypg-hand-search">
|
|
|
<el-form-item label="公司">
|
|
|
- <el-select v-model="value" placeholder="请选择公司">
|
|
|
- <el-option v-for="(iten,index) in corporationArr" :key="index" :label="iten.companyName" :value="iten.id"></el-option>
|
|
|
+ <el-select @change="Corporationchange" v-model="value" placeholder="请选择公司">
|
|
|
+ <el-option v-for="(iten,index) in CorporationOption" :key="index" :label="iten.companyName" :value="iten.companyId"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="部门">
|
|
|
- <el-select v-model="value" placeholder="请选择部门">
|
|
|
- <el-option label="区域一" value="shanghai"></el-option>
|
|
|
- <el-option label="区域二" value="beijing"></el-option>
|
|
|
+ <el-select @change="depchange" v-model="depvalue" placeholder="请选择部门">
|
|
|
+ <el-option v-for="(item,index) in depOption" :key="index" :label="item.depName" :value="item.depId"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="人员">
|
|
|
- <el-select v-model="value" placeholder="请选择人员">
|
|
|
- <el-option label="区域一" value="shanghai"></el-option>
|
|
|
- <el-option label="区域二" value="beijing"></el-option>
|
|
|
+ <el-select v-model="uservalue" placeholder="请选择人员">
|
|
|
+ <el-option v-for="(item,index) in userOption" :key="index" :label="item.cnName" :value="item.id"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="日期">
|
|
@@ -33,54 +31,77 @@
|
|
|
:picker-options="pickerOptions">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label-width="80px" label="发放统计">
|
|
|
+ <!-- <el-form-item label-width="80px" label="发放统计">
|
|
|
<el-select v-model="value" placeholder="请选择人员">
|
|
|
<el-option label="区域一" value="shanghai"></el-option>
|
|
|
<el-option label="区域二" value="beijing"></el-option>
|
|
|
</el-select>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
<div style="margin-left: 10px;">
|
|
|
- <el-button @click="addcost" type="primary">主要按钮</el-button>
|
|
|
+ <el-button @click="ComputeRoyalties" type="primary">查 询</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<div class="royaltypg-table">
|
|
|
<el-table
|
|
|
+ height="750"
|
|
|
:data="tableData"
|
|
|
border
|
|
|
style="width: 100%">
|
|
|
<el-table-column
|
|
|
prop="date"
|
|
|
label="序号"
|
|
|
- width="180">
|
|
|
+ width="50">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.$index + 1 }}
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="name"
|
|
|
+ prop="teamName"
|
|
|
label="团名"
|
|
|
- width="180">
|
|
|
+ width="400">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="name"
|
|
|
+ prop="visitDate"
|
|
|
label="结束日期"
|
|
|
- width="180">
|
|
|
+ width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{processingdate(scope.row.visitDate)}}
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="name"
|
|
|
+ prop="teamLvStr"
|
|
|
label="级别"
|
|
|
- width="180">
|
|
|
+ width="80">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="name"
|
|
|
- label="提成明细"
|
|
|
- width="180">
|
|
|
+ prop="temp"
|
|
|
+ label="提成明细">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-popover
|
|
|
+ placement="top-start"
|
|
|
+ title="明细"
|
|
|
+ width="700"
|
|
|
+ trigger="hover">
|
|
|
+ <div class="temp-ul">
|
|
|
+ <div class="temp-li" v-for="(item,index) in scope.row.chiArr" :key="index">
|
|
|
+ {{ item }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <span slot="reference">{{scope.row.temp}}</span>
|
|
|
+ </el-popover>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="name"
|
|
|
+ prop="price"
|
|
|
label="提成金额 "
|
|
|
width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ processingprice(scope.row.price)+ ' 元' }}
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
+ <!-- <el-table-column
|
|
|
prop="name"
|
|
|
label="本团是否亏损或无利润"
|
|
|
width="180">
|
|
@@ -88,9 +109,12 @@
|
|
|
<el-table-column
|
|
|
prop="address"
|
|
|
label="发放月份">
|
|
|
- </el-table-column>
|
|
|
+ </el-table-column> -->
|
|
|
</el-table>
|
|
|
- <div class="block">
|
|
|
+ <div class="numpice">
|
|
|
+ 该时间段提成总额: {{ numpices }} 元
|
|
|
+ </div>
|
|
|
+ <!-- <div class="block">
|
|
|
<el-pagination
|
|
|
@size-change="handleSizeChange"
|
|
|
@current-change="handleCurrentChange"
|
|
@@ -100,7 +124,7 @@
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
|
:total="400">
|
|
|
</el-pagination>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -139,29 +163,31 @@ export default {
|
|
|
},
|
|
|
cost:0,
|
|
|
value:'',
|
|
|
+ depvalue:'',
|
|
|
+ uservalue:'',
|
|
|
value2:[],
|
|
|
- corporationArr:[],
|
|
|
- tableData: [{
|
|
|
- date: '2016-05-02',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1518 弄'
|
|
|
- }, {
|
|
|
- date: '2016-05-04',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1517 弄'
|
|
|
- }, {
|
|
|
- date: '2016-05-01',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1519 弄'
|
|
|
- }, {
|
|
|
- date: '2016-05-03',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1516 弄'
|
|
|
- }],
|
|
|
- currentPage4: 4
|
|
|
+ CorporationOption:[],
|
|
|
+ depOption:[],
|
|
|
+ userOption:[],
|
|
|
+ tableData: [],
|
|
|
+ currentPage4: 4,
|
|
|
+ numpices:0
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
+ //处理日期
|
|
|
+ processingdate(vals){
|
|
|
+ vals=vals+""
|
|
|
+ return vals.split(' ')[0]
|
|
|
+ },
|
|
|
+ //处理金额
|
|
|
+ processingprice(val){
|
|
|
+ if(Number(val)){
|
|
|
+ return val.toFixed(2);
|
|
|
+ }else{
|
|
|
+ return val
|
|
|
+ }
|
|
|
+ },
|
|
|
handleSizeChange(val) {
|
|
|
console.log(`每页 ${val} 条`);
|
|
|
},
|
|
@@ -173,37 +199,114 @@ export default {
|
|
|
console.log(this.cost)
|
|
|
},1000,true),
|
|
|
//获取公司
|
|
|
- GetAuth() {
|
|
|
- var url = "/api/System/GetAuth"
|
|
|
+ daraSource(){
|
|
|
+ var url = "/api/register/daraSource"
|
|
|
var that = this
|
|
|
this.$axios({
|
|
|
method: 'post',
|
|
|
url: url,
|
|
|
headers: {
|
|
|
- Authorization: 'Bearer ' + that.token
|
|
|
+ Authorization: 'Bearer '
|
|
|
+ }
|
|
|
+ }).then(function (res) {
|
|
|
+ if(res.data.code==200){
|
|
|
+ that.CorporationOption=res.data.data;
|
|
|
+ console.log(that.CorporationOption)
|
|
|
+ }else{
|
|
|
+ that.$message({
|
|
|
+ message: res.data.msg,
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //公司切换
|
|
|
+ Corporationchange(val){
|
|
|
+ this.depOption=[];
|
|
|
+ this.depvalue='';
|
|
|
+ this.userOption=[];
|
|
|
+ this.uservalue='';
|
|
|
+ for(let i=0;i<this.CorporationOption.length;i++){
|
|
|
+ if(val==this.CorporationOption[i].companyId){
|
|
|
+ this.depOption=this.CorporationOption[i].subDep;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //部门切换
|
|
|
+ depchange(val){
|
|
|
+ this.userOption=[];
|
|
|
+ this.uservalue='';
|
|
|
+ this.QueryUserByDepart(val)
|
|
|
+ },
|
|
|
+ //获取员工
|
|
|
+ QueryUserByDepart(val){
|
|
|
+ var url = "/api/System/QueryUserByDepart"
|
|
|
+ var that = this
|
|
|
+ this.$axios({
|
|
|
+ method: 'post',
|
|
|
+ url: url,
|
|
|
+ headers: {
|
|
|
+ Authorization: 'Bearer '
|
|
|
},
|
|
|
- data: {
|
|
|
- pageSize:10,
|
|
|
- currentPage: 1,
|
|
|
- moduleId:17
|
|
|
+ data:{
|
|
|
+ departId:val,
|
|
|
}
|
|
|
}).then(function (res) {
|
|
|
- if (res.data.code == 200) {
|
|
|
- that.corporationArr=res.data.data.companyDataResult;
|
|
|
+ if(res.data.code==200){
|
|
|
+ that.userOption=res.data.data
|
|
|
}else{
|
|
|
that.$message({
|
|
|
- message:res.data.msg,
|
|
|
- duration:1000,
|
|
|
- type:"error"
|
|
|
+ message: res.data.msg,
|
|
|
+ type: 'warning'
|
|
|
});
|
|
|
}
|
|
|
- }).catch(function (error) {
|
|
|
- that.$message.error('加载失败,稍后尝试,如若失败请联系信息部!');
|
|
|
- });
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //处理时间
|
|
|
+ getdate(val){
|
|
|
+ var date=new Date(val);
|
|
|
+ var y=date.getFullYear();
|
|
|
+ var m=date.getMonth()+1<10?'0'+(date.getMonth()+1):date.getMonth()+1;
|
|
|
+ var d=date.getDate()<10?'0'+date.getDate():date.getDate();
|
|
|
+ return y+'-'+m+'-'+d
|
|
|
+ },
|
|
|
+ //提成结算
|
|
|
+ ComputeRoyalties(){
|
|
|
+ if(this.uservalue==""||this.value2.length<=0){
|
|
|
+ this.$message({
|
|
|
+ message:"请选择查询条件",
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var url = "/api/Financial/ComputeRoyalties"
|
|
|
+ var that = this
|
|
|
+ this.$axios({
|
|
|
+ method: 'post',
|
|
|
+ url: url,
|
|
|
+ headers: {
|
|
|
+ Authorization: 'Bearer '
|
|
|
+ },
|
|
|
+ data:{
|
|
|
+ userId:that.uservalue,
|
|
|
+ startDate:that.getdate(this.value2[0]),
|
|
|
+ endDate:that.getdate(this.value2[1])
|
|
|
+ }
|
|
|
+ }).then(function (res) {
|
|
|
+ if(res.data.code==200){
|
|
|
+ that.tableData=res.data.data.resultArr;
|
|
|
+ that.numpices=res.data.data.totalPrice;
|
|
|
+ }else{
|
|
|
+ that.$message({
|
|
|
+ message: res.data.msg,
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
},
|
|
|
mounted(){
|
|
|
- this.GetAuth()
|
|
|
+ this.daraSource()
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -232,4 +335,18 @@ export default {
|
|
|
margin-top: 15px;
|
|
|
text-align: center;
|
|
|
}
|
|
|
+.temp-li{
|
|
|
+ border-top: 1px solid #EBEEF5;
|
|
|
+ border-right: 1px solid #EBEEF5;
|
|
|
+ border-left: 1px solid #EBEEF5;
|
|
|
+ padding: 10px;
|
|
|
+}
|
|
|
+.temp-li:nth-last-child(1){
|
|
|
+ border-bottom: 1px solid #EBEEF5;
|
|
|
+}
|
|
|
+.numpice{
|
|
|
+ text-align: right;
|
|
|
+ font-size:14px ;
|
|
|
+ color: #555;
|
|
|
+}
|
|
|
</style>
|