Commit 60b3b70d authored by 黄奎's avatar 黄奎

票务提成修改

parent 09c8bed2
<style> <style>
.flightPerformance .fpTable th { .flightPerformance .fpTable th {
border-bottom: 1px solid #d1d1d1; border-bottom: 1px solid #d1d1d1;
border-right: 1px solid #d1d1d1; border-right: 1px solid #d1d1d1;
background: #E6E6E6; background: #e6e6e6;
height: 40px; height: 40px;
font-size: 14px; font-size: 14px;
color: #333; color: #333;
} }
.flightPerformance .fpTable { .flightPerformance .fpTable {
width: 1000px; width: 1000px;
margin-bottom: 30px; margin-bottom: 30px;
border-collapse: collapse; border-collapse: collapse;
} }
.flightPerformance .creatName { .flightPerformance .creatName {
color: green; color: green;
font-weight: bold; font-weight: bold;
margin-right: 10px; margin-right: 10px;
} }
.flightPerformance .fpTable tr { .flightPerformance .fpTable tr {
background: #fff; background: #fff;
text-align: center; text-align: center;
height: 40px; height: 40px;
} }
.flightPerformance .fpTable tr td { .flightPerformance .fpTable tr td {
font-size: 12px; font-size: 12px;
border: 1px solid #E5E5E5; border: 1px solid #e5e5e5;
} }
.flightPerformance .fpTable tbody tr:last-child {
border-bottom: 2px solid #333;
}
.flightPerformance .fpTable tbody tr:last-child {
border-bottom: 2px solid #333;
}
</style> </style>
<template> <template>
...@@ -44,35 +43,68 @@ ...@@ -44,35 +43,68 @@
<li> <li>
<span> <span>
<em>操作人</em> <em>操作人</em>
<el-select v-model="msg.CreateBy" filterable :placeholder="$t('system.ph_in')"> <el-select
v-model="msg.CreateBy"
filterable
:placeholder="$t('system.ph_in')"
>
<el-option :label="$t('pub.unlimitedSel')" :value="0"></el-option> <el-option :label="$t('pub.unlimitedSel')" :value="0"></el-option>
<el-option v-for="item in EmployeeList" :label="item.EmName" :value="item.EmployeeId" <el-option
:key="item.EmployeeId"></el-option> v-for="item in EmployeeList"
:label="item.EmName"
:value="item.EmployeeId"
:key="item.EmployeeId"
></el-option>
</el-select> </el-select>
</span> </span>
</li> </li>
<li> <li>
<span> <span>
<em>月份</em> <em>月份</em>
<el-date-picker v-model='msg.QMonth' value-format="yyyy-MM" type="month"></el-date-picker> <el-date-picker
v-model="msg.QMonth"
value-format="yyyy-MM"
type="month"
></el-date-picker>
</span> </span>
</li> </li>
<li style="line-height:34px;font-size:14px;">
单买机票计算方式:<span style="color:red;">(售价-成本价)&nbsp;X&nbsp;{{singlePercent}}</span>
</li>
<li> <li>
<input type="button" class="hollowFixedBtn" @click="getList()" :value="$t('pub.searchBtn')" /> <input
<input type="button" class="hollowFixedBtn" @click="DownLoad()" value="导出" /> type="button"
class="hollowFixedBtn"
@click="getList()"
:value="$t('pub.searchBtn')"
/>
<input
type="button"
class="hollowFixedBtn"
@click="DownLoad()"
value="导出"
/>
</li> </li>
</ul> </ul>
</div> </div>
<table class="fpTable" border="0" cellspacing="0" cellpadding="0" v-loading="loading" <table
v-for="(item,index) in dataList.resultList" :key="index"> class="fpTable"
<tbody v-for="(subItem,subIndex) in item.TicketList" :key="subIndex"> border="0"
<tr v-if="subIndex==0"> cellspacing="0"
cellpadding="0"
v-loading="loading"
v-for="(item, index) in dataList.resultList"
:key="index"
>
<tbody v-for="(subItem, subIndex) in item.TicketList" :key="subIndex">
<tr v-if="subIndex == 0">
<td colspan="6"> <td colspan="6">
<span class="creatName">{{item.CreateByName}}</span> <span class="creatName">{{ item.CreateByName }}</span>
{{msg.QMonth}} {{ msg.QMonth }}
提成数据</td> 提成数据
</td>
</tr> </tr>
<tr v-if="index==0&&subIndex==0"> <tr v-if="index == 0 && subIndex == 0">
<th>序号</th> <th>序号</th>
<th>公司</th> <th>公司</th>
<th>团号</th> <th>团号</th>
...@@ -80,185 +112,262 @@ ...@@ -80,185 +112,262 @@
<th>金额</th> <th>金额</th>
<th>小计</th> <th>小计</th>
</tr> </tr>
<template v-for="(childItem,childIndex) in subItem.SubList" > <template v-for="(childItem, childIndex) in subItem.SubList">
<tr :key="childIndex"> <tr :key="childIndex">
<td width="10%"> <td width="10%">
{{childIndex+1}} {{ childIndex + 1 }}
</td> </td>
<td width="20%" :rowspan="subItem.SubList.length+1" style="border-bottom:2px solid black" <td
v-if="childIndex==0"> width="20%"
{{subItem.OutBranchName}} :rowspan="subItem.SubList.length + 1"
style="border-bottom:2px solid black"
v-if="childIndex == 0"
>
{{ subItem.OutBranchName }}
</td> </td>
<td width="30%"> <td width="30%">
<template v-if="childItem.TCID>0"> <template v-if="childItem.TCID > 0">
<a style="color:blue;cursor:pointer" @click='goUrlT("RegistrationList",childItem.TCID,"报名清单")'> <template v-if="childItem.TicketType==2">
({{childItem.TCID}}){{childItem.TCNUM}} <a style="color:blue;cursor:pointer" @click="goUrlT('TicketManager', childItem.TCID, '票务关闭')">{{ childItem.TCNUM }}</a>
</template>
<template v-if="childItem.TicketType==1">
<a style="color:blue;cursor:pointer" @click="goUrlT('RegistrationList', childItem.TCID, '报名清单')">({{ childItem.TCID }}){{ childItem.TCNUM }}
</a> </a>
</template>
</template> </template>
<template v-else> <template v-else>
{{childItem.TCNUM}} {{childItem.TCNUM}}
</template> </template>
</td> </td>
<td width="10%">{{childItem.TicketNum}}</td> <td width="10%">{{ childItem.TicketNum }}</td>
<td width="10%" :rowspan="subItem.SubList.length+1" style="border-bottom:2px solid black" <!--单卖机票-->
v-if="childIndex==0">{{dataList.UnitPrice}}</td> <template v-if="childItem.TicketType == 2">
<td width="10%">{{childItem.TicketNum*dataList.UnitPrice}}</td> <td width="10%">
</tr> {{ childItem.SalePrice - childItem.CostPrice }}
<tr v-if="childIndex==subItem.SubList.length-1" :key="childIndex+500"> </td>
<td></td> <td width="10%">
<td style="font-weight:bold;">合计</td> {{
<td style="color:red;"> childItem.TicketNum *(childItem.SalePrice - childItem.CostPrice) *singlePercent
{{getPeopleCount(subItem.SubList)}} }}
</td> </td>
<td style="color:red;"> </template>
{{getCount(subItem.SubList)}} <template v-else>
</td> <td
width="10%"
:rowspan="subItem.SubList.length + 1"
style="border-bottom:2px solid black"
v-if="childIndex == 0"
>
{{ dataList.UnitPrice }}
</td>
<td width="10%">
{{ childItem.TicketNum * dataList.UnitPrice }}
</td>
</template>
</tr> </tr>
<template v-if="childItem.TicketType == 2">
<tr
v-if="childIndex == subItem.SubList.length - 1"
:key="childIndex + 500">
<td></td>
<td style="font-weight:bold;">合计</td>
<td style="color:red;">
{{ getPeopleCount(subItem.SubList) }}
</td>
<td>
</td>
<td style="color:red;">
{{ getSingleCount(subItem.SubList) }}
</td>
</tr>
</template>
<template v-else>
<tr
v-if="childIndex == subItem.SubList.length - 1"
:key="childIndex + 500"
>
<td></td>
<td style="font-weight:bold;">合计</td>
<td style="color:red;">
{{ getPeopleCount(subItem.SubList) }}
</td>
<td style="color:red;">
{{ getCount(subItem.SubList) }}
</td>
</tr>
</template>
</template> </template>
<tr v-if="subIndex==item.TicketList.length-1"> <tr v-if="subIndex == item.TicketList.length - 1">
<td></td> <td></td>
<td></td> <td></td>
<td style="font-weight:bold;">总计</td> <td style="font-weight:bold;">总计</td>
<td> <td>
<span style="color:red;">{{getTotalNum(item.TicketList)}}</span> <span style="color:red;">{{ getTotalNum(item.TicketList) }}</span>
</td>
<td>{{ dataList.UnitPrice }}</td>
<td>
<span style="color:red;">{{ getTotalCount(item.TicketList) }}</span>
</td> </td>
<td>{{dataList.UnitPrice}}</td>
<td><span style="color:red;">{{getTotalCount(item.TicketList)}}</span></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
msg: { msg: {
LineId: 0, //线路编号 LineId: 0, //线路编号
OutBranchId: -1, //出团公司 OutBranchId: -1, //出团公司
AirLineID: 0, //航空公司编号 AirLineID: 0, //航空公司编号
CreateBy: 0, //操作人 CreateBy: 0, //操作人
QMonth: '', //月份 QMonth: "" //月份
}, },
loading: false, //单机票百分比
dataList: {}, singlePercent:0.1,
//航空公司下拉 loading: false,
airlineList: [], dataList: {},
//操作人下拉 //航空公司下拉
EmployeeList: [], airlineList: [],
} //操作人下拉
EmployeeList: []
};
},
mounted() {
this.getEmployeeList();
if (this.$route.query.UserId) {
this.msg.CreateBy = Number(this.$route.query.UserId);
}
if (this.$route.query.Periods) {
var str = this.$route.query.Periods;
this.msg.QMonth = str.substring(0, 4) + "-" + str.substring(4);
} else {
let date = new Date(),
y = date.getFullYear(),
m =
date.getMonth() < 10
? "0" + (date.getMonth() + 1)
: date.getMonth() + 1;
this.msg.QMonth = y + "-" + m;
}
this.initAirlines();
this.getList();
},
methods: {
//单卖机票计算
getSingleCount(list) {
let count = 0;
list.forEach(x => {
count += x.TicketNum*(x.SalePrice-x.CostPrice)*this.singlePercent;
});
return count;
},
//页面跳转
goUrlT(path, obj, title) {
this.$router.push({
name: path,
query: {
id: obj,
blank: "y",
tab: title
}
});
},
//获取列表数据
getList() {
this.loading = true;
this.apipost("AirTicket_get_GetTicketPerformance", this.msg, res => {
this.loading = false;
if (res.data.resultCode == 1) {
this.dataList = res.data.data;
} else {
this.Error(res.data.message);
}
});
}, },
mounted() { //获取没个的人数
this.getEmployeeList(); getPeopleCount(subList) {
if (this.$route.query.UserId) { let count = 0;
this.msg.CreateBy = Number(this.$route.query.UserId); subList.forEach(x => {
} count += x.TicketNum;
if (this.$route.query.Periods) { });
var str = this.$route.query.Periods; return count;
this.msg.QMonth = str.substring(0, 4) + "-" + str.substring(4);
} else {
let date = new Date(),
y = date.getFullYear(),
m = date.getMonth() < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
this.msg.QMonth = y + '-' + m;
}
this.initAirlines();
this.getList()
}, },
methods: { //计算小计
//页面跳转 getCount(list) {
goUrlT(path, obj, title) { let count = 0;
this.$router.push({ list.forEach(x => {
name: path, count += x.TicketNum;
query: { });
"id": obj, return count * this.dataList.UnitPrice;
blank: 'y', },
tab: title //计算总计
getTotalCount(list) {
let count = 0;
list.forEach(x => {
x.SubList.forEach(y => {
if(y.TicketType!=2)
{
count += y.TicketNum * this.dataList.UnitPrice;
} }
}) else
}, {
//获取列表数据 count += y.TicketNum*(y.SalePrice-y.CostPrice)*this.singlePercent;
getList() {
this.loading = true;
this.apipost("AirTicket_get_GetTicketPerformance", this.msg, res => {
this.loading = false;
if (res.data.resultCode == 1) {
this.dataList = res.data.data;
} else {
this.Error(res.data.message);
} }
}); });
}, });
//获取没个的人数 return count ;
getPeopleCount(subList) { },
let count = 0; //获取总计人数
subList.forEach(x => { getTotalNum(list) {
count += x.TicketNum; let count = 0;
}); list.forEach(x => {
return count; x.SubList.forEach(y => {
}, count += y.TicketNum;
//计算小计
getCount(list) {
let count = 0;
list.forEach(x => {
count += x.TicketNum;
}); });
return count * this.dataList.UnitPrice; });
}, return count;
//计算总计 },
getTotalCount(list) { //初始化航空公司下拉
let count = 0; initAirlines() {
list.forEach(x => { this.apipost(
x.SubList.forEach(y => { "airline_post_GetList",
count += y.TicketNum {},
}) res => {
}) if (res.data.resultCode == 1) {
return count * this.dataList.UnitPrice; this.airlineList = res.data.data;
}, }
//获取总计人数 },
getTotalNum(list) { err => {}
let count = 0; );
list.forEach(x => { },
x.SubList.forEach(y => { //根据当前员工所在部门获取该部门及子部门员工信息
count += y.TicketNum getEmployeeList() {
}) this.apipost(
}) "admin_get_GetEmployeeByUserDepartmentId",
return count; {},
}, res => {
//初始化航空公司下拉 if (res.data.resultCode == 1) {
initAirlines() { this.EmployeeList = res.data.data;
this.apipost( }
"airline_post_GetList", {}, },
res => { err => {}
if (res.data.resultCode == 1) { );
this.airlineList = res.data.data; },
} //下载业绩数据
}, DownLoad() {
err => {} this.loading = true;
); var fileName = "机票业绩下载" + this.msg.QMonth + ".xls";
}, this.GetLocalFile(
//根据当前员工所在部门获取该部门及子部门员工信息 "AirTicket_get_DownLoadGetTicketPerformance",
getEmployeeList() { this.msg,
this.apipost( fileName,
"admin_get_GetEmployeeByUserDepartmentId", {}, res => {
res => { this.loading = false;
if (res.data.resultCode == 1) { }
this.EmployeeList = res.data.data; );
}
},
err => {}
);
},
//下载业绩数据
DownLoad() {
this.loading = true;
var fileName = "机票业绩下载" + this.msg.QMonth + ".xls";
this.GetLocalFile("AirTicket_get_DownLoadGetTicketPerformance", this.msg, fileName,
res => {
this.loading = false;
});
}
} }
} }
};
</script> </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