Commit 39133b03 authored by lixy's avatar lixy

Merge branch 'base-modify' of http://113.105.137.151:22280/youjj/cloud-platform-ui into base-modify

parents 3074373e 22ad0472
......@@ -11,3 +11,5 @@ selenium-debug.log
config/**
**/dev.env.js
/*.json
/.gitignore
<template>
<div id="app">
<router-view></router-view>
<keep-alive>
<router-view />
</keep-alive>
<!-- <router-view></router-view> -->
</div>
</template>
......
......@@ -112,7 +112,7 @@ export function jobs(obj) {
// 添加员工
export function addEditor(obj) {
return fetch({
url: '/api/admin/postion/admin/addUserPostion',
url: '/api/admin/postion/admin/updUserPostion',
method: 'post',
data: obj
});
......@@ -160,3 +160,84 @@ export function getOne(id) {
method: 'get',
});
}
// 员工变更记录
export function findPositionChangeRecord(params) {
return fetch({
url: 'api/admin/postion/admin/findPositionChangeRecord',
method: 'get',
params: params
});
}
// 员工修改
export function updUserChange(params) {
return fetch({
url: 'api/admin/postion/admin/updUserChange',
method: 'post',
data: params
});
}
// 离职后在职
export function updAddPositionChangeRecord(params) {
return fetch({
url: 'api/admin/postion/admin/updAddPositionChangeRecord',
method: 'post',
data: params
});
}
// 信息修改
// export function updUserPostion(params) {
// return fetch({
// url: 'api/admin/postion/admin/updUserPostion',
// method: 'post',
// data: params
// });
// }
// 股东列表
export function stockholderList(query) {
return fetch({
url: 'api/admin/appShareholder/page',
method: 'post',
data: query
});
}
// 新增股东
export function addUserPostion(query) {
return fetch({
url: 'api/admin/appShareholder/addUserPostion',
method: 'post',
data: query
});
}
// 批量导入股东
export function exports(query) {
return fetch({
url: 'api/admin/appShareholder/export',
method: 'post',
data: query
});
}
// 编辑股东信息
export function updUserPostionEditor(query) {
return fetch({
url: 'api/admin/appShareholder/updUserPostion',
method: 'post',
data: query
});
}
// 股东信息变更记录
export function findShareholderChangeRecord(query) {
return fetch({
url: 'api/admin/appShareholder/findShareholderChangeRecord',
method: 'get',
params: query
});
}
\ No newline at end of file
......@@ -30,4 +30,79 @@ export function changeStatus(id) {
url: '/api/app/admin/buy_vehicle/status/' + id,
method: 'POST',
});
}
// 报名列表
export function applyList(params) {
return fetch({
url: 'api/activity/admin/activityLuckyDraw/page',
method: 'POST',
data: params
});
}
// 报名列表导出
export function excel(query) {
return fetch({
url: 'api/activity/admin/activityLuckyDraw/export',
method: 'post',
data: query,
responseType: 'blob'
});
}
// 中奖列表
export function applyListWin(params) {
return fetch({
url: '/api/activity/admin/activityWinningRecord/page',
method: 'POST',
data: params
});
}
// 中奖列表导出
export function excelWin(query) {
return fetch({
url: '/api/activity/admin/activityWinningRecord/export',
method: 'post',
data: query,
responseType: 'blob'
});
}
// 活动数据
export function applyListActive(params) {
return fetch({
url: '/api/activity/admin/activityAttendanceRecord/page',
method: 'POST',
data: params
});
}
// 活动数据
export function excelActive(query) {
return fetch({
url: '/api/activity/admin/activityAttendanceRecord/export',
method: 'post',
data: query,
responseType: 'blob'
});
}
// 奖品设置
export function savePrize(query) {
return fetch({
url: '/api/activity/admin/activityPrize/save',
method: 'post',
data: query
});
}
// 奖品详情
export function infoPrize(query) {
return fetch({
url: 'api/activity/admin/activityPrize/list',
method: 'get',
data: query
});
}
\ No newline at end of file
import fetch from 'utils/fetch';
//获取租车订单
export function page(query) {
return fetch({
url: '/api/order/baseOrder/getOrderList',
method: 'get',
params:query
});
return fetch({
url: '/api/order/baseOrder/getAll',
method: 'get',
params: query
});
}
//获取旅游订单
export function getOrderList(query) {
return fetch({
url: '/api/order/baseOrder/getOrderList',
method: 'get',
params: query
});
}
/**
* 获取所有分公司
*/
export function getAllBranchCompany() {
return fetch({
url: '/vehicle/branchCompany',
method: 'get'
});
return fetch({
url: '/vehicle/branchCompany',
method: 'get'
});
}
//根据大区Id获取分公司列表
export function getAllBranchCompanyByZoneId(query) {
return fetch({
url: '/vehicle/branchCompany/app/unauth/getByZone',
method: 'get',
params:query
});
return fetch({
url: '/vehicle/branchCompany/app/unauth/getByZone',
method: 'get',
params: query
});
}
export function getOrderVehicleCrosstown(query) {
return fetch({
url: '/api/order/orderVehicle/getByOrderId',
method: 'get',
params:query
});
return fetch({
url: '/api/order/orderVehicle/getByOrderId',
method: 'get',
params: query
});
}
/**
......@@ -39,10 +47,10 @@ export function getOrderVehicleCrosstown(query) {
* @param query
*/
export function getOneIllegalRow(id) {
return fetch({
url: '/api/order/orderViolation/getOne/' + id,
method: 'get'
});
return fetch({
url: '/api/order/orderViolation/getOne/' + id,
method: 'get'
});
}
/**
......@@ -54,11 +62,11 @@ detailId:租车订单id
}
*/
export function saveOrderViolation(params) {
return fetch({
url: '/api/order/orderViolation/saveOrderViolation',
method: 'post',
data: params
});
return fetch({
url: '/api/order/orderViolation/saveOrderViolation',
method: 'post',
data: params
});
}
/**
......@@ -66,36 +74,36 @@ export function saveOrderViolation(params) {
* @param query
*/
export function getStep(orderNo) {
return fetch({
url: '/api/order/orderVehicle/getByOrderId?orderNo=' + orderNo,
method: 'get'
});
return fetch({
url: '/api/order/orderVehicle/getByOrderId?orderNo=' + orderNo,
method: 'get'
});
}
export function inquire(query) {
return fetch({
url: '/vehicle/vehicleInfo/rent/back-stage/usable-vehicle',
method: 'get',
params:query
});
return fetch({
url: '/vehicle/vehicleInfo/rent/back-stage/usable-vehicle',
method: 'get',
params: query
});
}
//创建订单
export function addIndent(params) {
return fetch({
url: '/api/order/orderRentVehicle/back-stage/add',
method: 'post',
data:params
});
return fetch({
url: '/api/order/orderRentVehicle/back-stage/add',
method: 'post',
data: params
});
}
//删除订单
export function calculate(no, params) {
return fetch({
url: '/api/order/baseOrder/back-stage/cancel/'+ no,
method: 'post',
data:params
});
return fetch({
url: '/api/order/baseOrder/back-stage/cancel/' + no,
method: 'post',
data: params
});
}
/**
......@@ -103,54 +111,63 @@ export function calculate(no, params) {
* @param {Object} params计算违约价格
*/
export function getViolatePrice(no) {
return fetch({
url: '/api/order/orderRefund/bg-stage/getViolatePrice/'+ no,
method: 'get',
});
return fetch({
url: '/api/order/orderRefund/bg-stage/getViolatePrice/' + no,
method: 'get',
});
}
//创建订单
export function orderStatistics(params) {
return fetch({
url: 'api/order/orderStatistics/order',
method: 'post',
data:params
});
return fetch({
url: 'api/order/orderStatistics/order',
method: 'post',
data: params
});
}
//订单下载
export function downloadExcel(params) {
return fetch({
url: '/api/order/orderStatistics/excel',
method: 'post',
data: params,
responseType: 'blob'
});
return fetch({
url: '/api/order/orderStatistics/excel',
method: 'post',
data: params,
responseType: 'blob'
});
}
//会员订单管理列表
export function pageList(params) {
return fetch({
url: '/api/order/orderMember/page',
method: 'post',
data: params
});
return fetch({
url: '/api/order/orderMember/page',
method: 'post',
data: params
});
}
//会员订单管理导出
export function orderMemberExcel(params) {
return fetch({
url: '/api/order/orderMember/export',
method: 'post',
data: params,
responseType: 'blob'
});
return fetch({
url: '/api/order/orderMember/export',
method: 'post',
data: params,
responseType: 'blob'
});
}
//用户信息
export function user_info(id) {
return fetch({
url: '/api/admin/appUsersManage/user_info/' + id,
method: 'get'
});
}
\ No newline at end of file
return fetch({
url: '/api/admin/appUsersManage/user_info/' + id,
method: 'get'
});
}
//获取订单详情
export function orderDetail(query) {
return fetch({
url: '/api/order/baseOrder/orderDetail',
method: 'get',
params: query
});
}
import fetch from 'utils/fetch';
// 員工業績報表列表
export function getDate(query) {
return fetch({
url: 'api/admin/staff_statistics/page',
method: 'post',
data: query
});
}
// 員工業績報表導出
export function exports(query) {
return fetch({
url: 'api/admin/staff_statistics/export',
method: 'post',
data: query,
responseType: 'blob'
});
}
// 員工業績列表
export function companyList(query) {
return fetch({
url: '/api/order/report/form/list',
method: 'post',
data: query
});
}
// 員工業績導出
export function excel(query) {
return fetch({
url: '/api/order/report/form/excel',
method: 'post',
data: query,
responseType: 'blob'
});
}
// 分公司业绩
export function company_performance(query) {
return fetch({
url: 'api/order/statistics/company_performance',
method: 'post',
data: query
});
}
// 員工業績導出
export function excelExport(query) {
return fetch({
url: 'api/order/statistics/export',
method: 'post',
timeout: '600000',
data: query,
responseType: 'blob'
});
}
\ No newline at end of file
import fetch from 'utils/fetch';
//车辆统计信息列表
export function pageList(params) {
return fetch({
url: '/vehicle/bg-vehicle/count/getAll',
method: 'get',
params: params
});
}
//车辆统计信息导出
export function vehicleInfoExcel(params) {
return fetch({
url: '/vehicle/bg-vehicle/count/app/unauth/export',
method: 'get',
params: params,
responseType: 'blob'
});
}
//订单统计
export function received_statistics(params) {
return fetch({
url: 'api/order/admin/order/received_statistics',
method: 'post',
timeout:'50000',
data: params
});
}
// 订单统计导出
export function excelExport(query) {
return fetch({
url: 'api/order/admin/order/received_statistics/export',
method: 'post',
timeout:'600000',
data: query,
responseType: 'blob'
});
}
\ No newline at end of file
......@@ -17,3 +17,10 @@ export function statistic(param) {
})
}
export function findReserveType(param) {
return fetch({
url: '/vehicle/departure/findReserveType ',
method: 'get',
params: param
})
}
......@@ -123,3 +123,19 @@ export function downloadExcel(query) {
responseType: 'blob'
});
}
export function exportExcel(query) {
return fetch({
url: '/vehicle/VehicleInformationDownload/app/unauth/export',
method: 'get',
responseType: 'blob'
});
}
export function postponeApi(param) {
return fetch({
url: 'api/order/baseOrder/bg/delay-rent-order',
method: 'post',
data: param
});
}
......@@ -191,10 +191,13 @@ export function dayList(day) {
}
// 日历价格设置
export function add_edit(params) {
export function add_edit(params, date) {
return fetch({
url: '/vehicle/admin/vehicle_model/calendar_price/add_edit',
url: '/vehicle/admin/vehicle_model/calendar_price/add_edit/' + date,
method: 'post',
headers: {
'Content-Type': 'application/json;charset=UTF-8'
},
data: params
});
}
......
......@@ -555,11 +555,6 @@ export const asyncRouterMap = [{
component: _import('userManagement/imCustomerServiceManger/cusomterServiceList'),
name: '客服列表',
authority: 'imCustomerServiceManger'
},{
path: 'employeesInput',
component: _import('userManagement/employeesInput'),
name: '员工录入',
authority: 'employeesInput'
}
]
},
......@@ -588,12 +583,12 @@ export const asyncRouterMap = [{
name: '首页精选活动',
authority: 'selectedActivities'
},
// {
// path: 'pushManagement',
// component: _import('appManagement/pushManagement/index'),
// name: '消息推送',
// authority: 'pushManagement'
// }
{
path: 'pushManagement',
component: _import('appManagement/pushManagement/index'),
name: '消息推送',
authority: 'pushManagement'
}
]
},
{
......@@ -647,6 +642,39 @@ export const asyncRouterMap = [{
}
]
},
{
path: '/casual',
component: Layout,
name: '发布会现金活动',
icon: 'setting',
authority: 'casual',
children: [
{
path: 'index',
component: _import('conference/activeData/index'),
name: '活动数据',
authority: 'index'
},
{
path: 'prizeLists',
component: _import('conference/prizeList/prizeLists'),
name: '中奖列表',
authority: 'prizeLists'
},
{
path: 'applyList',
component: _import('conference/apply/applyList'),
name: '报名列表',
authority: 'applyList'
},
{
path: 'awardSet',
component: _import('conference/award/awardSet'),
name: '奖品设置',
authority: 'awardSet'
}
]
},
{
path: '/applyManagements',
component: Layout,
......@@ -730,5 +758,56 @@ export const asyncRouterMap = [{
authority: 'orderStatistics'
}
]
},
{
path: '/financial',
component: Layout,
name: '财务报表',
icon: 'setting',
authority: 'financial',
children: [
{
path: 'staffPerformance',
component: _import('financial/staffPerformance'),
name: '员工业绩报表',
authority: 'staffPerformance'
}, {
path: 'memberPerformance',
component: _import('financial/memberPerformance'),
name: '总公司报表',
authority: 'memberPerformance'
}, {
path: 'branchCompany',
component: _import('financial/branchCompany'),
name: '总公司报表',
authority: 'branchCompany'
}, {
path: 'vehicleStatistics',
component: _import('financial/vehicleStatistics'),
name: '车辆统计',
authority: 'vehicleStatistics'
}
]
},
{
path: '/interior',
component: Layout,
name: '内部人员管理',
icon: 'setting',
authority: 'interior',
children: [
{
path: 'employeesInput',
component: _import('interior/employeesInput'),
name: '员工录入',
authority: 'employeesInput'
},
{
path: 'shareholder',
component: _import('interior/shareholder'),
name: '股东列表',
authority: 'shareholder'
}
]
}
];
......@@ -3,7 +3,7 @@
<div class="filter-container" ref="filter-container">
<el-form ref="queryForm" :inline="inline" :model="listQuery" label-width="60px">
<el-row>
<el-col :span="4">
<el-col :span="6">
<el-form-item label="描述">
<el-input v-model.number="listQuery.popupName" placeholder="请输入描述"></el-input>
</el-form-item>
......
......@@ -399,6 +399,8 @@
const set = this.$refs;
set[formName].validate(valid => {
if (valid) {
console.log(this.form);
editObj(this.form).then(response => {
if (response.status === 200) {
this.bannerDialogVisible = false;
......
This diff is collapsed.
......@@ -382,7 +382,6 @@
this.branchCompany_btn_del = this.elements['branchCompany:btn_del'];
this.branchCompany_btn_add = this.elements['branchCompany:btn_add'];
this.compnay_stock_update = this.elements['compnay:stock:update']
debugger
},
computed: {
...mapGetters([
......
<template>
<div class="app-container calendar-list-container">
<el-form :inline="true" label-width="100px" label-position="right">
<el-form-item label="选择日期">
<el-date-picker v-model="time" type="daterange" placeholder="选择日期范围" @change="changeTime"></el-date-picker>
</el-form-item>
<el-form-item label="手机号">
<el-input v-model="listQuery.phone" placeholder="请输入手机号" clearable style="width:200px"></el-input>
</el-form-item>
<el-form-item label="状态">
<el-select v-model="listQuery.status" clearable placeholder="请选择状态" @change="changeClass">
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-button type="primary" @click="search">搜索</el-button>
<el-button type="primary" @click="clearSearch">清空搜索</el-button>
<el-button type="primary" :loading="excelLoading" @click="downloadExcel">导出</el-button>
</el-form>
<div class="information">
<h4>数据概况.</h4>
<ul>
<li>
<p>{{information.attendNum}}</p>
<p>参与人数(人)</p>
</li>
<li>
<p>{{information.finishNum}}</p>
<p>完成任务数(人)</p>
</li>
<li>
<p>{{information.amount}}</p>
<p>已发放现金总额(元)</p>
</li>
</ul>
</div>
<el-table
:data="tableData"
border
header-align="center"
v-loading="loadingTab"
style="margin-top:20px"
>
<el-table-column label="序号" align="center" width="70">
<template scope="scope">
<span>{{scope.$index+(listQuery.page - 1) * listQuery.limit + 1}}</span>
</template>
</el-table-column>
<el-table-column prop="userName" label="用户名" align="center"></el-table-column>
<el-table-column prop="phone" label="电话" align="center"></el-table-column>
<el-table-column prop="positionName" label="身份" align="center"></el-table-column>
<el-table-column prop="status" label="状态" align="center">
<template scope="scope">
<span>{{scope.row.status == 1 ? '已完成' : '未完成'}}</span>
</template>
</el-table-column>
<el-table-column prop="amount" label="当前金额(元)" align="center"></el-table-column>
<el-table-column prop="inviteNum" label="邀请人数" align="center"></el-table-column>
<el-table-column prop="prizes" label="抽奖礼品" align="center"></el-table-column>
<el-table-column prop="attendTime" label="参加时间" align="center">
<template scope="scope">
<span>{{timeChange(scope.row.attendTime)}}</span>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="listQuery.page"
:page-sizes="[10,20,30, 50]"
:page-size="listQuery.limit"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
style="margin-top:20px"
></el-pagination>
</div>
</template>
<script>
import { formatDate } from 'utils/dateFormattor'
import { applyListActive, excelActive } from 'api/applyManagements'
export default {
created() {
this.getList()
},
data() {
return {
information: {},
excelLoading: false,
loadingTab: false,
tableData: [],
time: '',
total: null, //总页数
options: [
{
id: '',
name: '全部'
},
{
id: 0,
name: '未完成'
},
{
id: 1,
name: '已完成'
}
],
listQuery: {
page: 1,
limit: 10,
startTime: null,
endTime: null,
phone: null,
activityId: 2,
status: ''
}
}
},
methods: {
//时间戳
timeChange(val) {
return formatDate(new Date(val), 'yyyy-MM-dd hh:mm:ss')
},
//列表
getList() {
this.loadingTab = true
applyListActive(this.listQuery).then(data => {
if (data.status == 200) {
this.tableData = data.data.activityAttendanceRecordVos
this.total = data.data.totalCount
this.information = data.data.activityAttendanceRecordTotalVo
} else {
this.$message(data.message)
}
})
setTimeout(() => {
this.loadingTab = false
}, 300)
},
//是否中奖筛选
changeWin() {
this.listQuery.page = 1
this.getList()
},
//搜索
search() {
this.listQuery.page = 1
this.getList()
},
//抽奖类型筛选
changeClass() {
this.listQuery.page = 1
this.getList()
},
//清空搜索
clearSearch() {
this.time = null
this.listQuery = {
page: 1,
limit: 10,
startTime: null,
endTime: null,
phone: null,
activityId: 2
}
},
//导出
downloadExcel() {
this.excelLoading = true
var u = navigator.userAgent,
app = navigator.appVersion
excelActive(this.listQuery, {
responseType: 'arraybuffer'
}).then(res => {
const content = res
const blob = new Blob([content], {
type: 'application/vnd.ms-excel'
})
const fileName = '活动数据.xlsx'
if (u.indexOf('Edge') > -1) {
window.navigator.msSaveBlob(blob, fileName)
} else {
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href) // 释放URL 对象
document.body.removeChild(elink)
}
this.excelLoading = false
})
},
//时间筛选
changeTime(val) {
console.log(val);
this.listQuery.page = 1
if (!!val) {
let value = val.split(' - ')
this.listQuery.startTime = new Date((value[0]+" 00:00:00")).getTime()
this.listQuery.endTime = new Date((value[1]+" 23:59:59")).getTime()
this.getList()
} else {
this.listQuery.startTime = null
this.listQuery.endTime = null
this.getList()
}
},
//页码
handleSizeChange(val) {
this.listQuery.limit = val
this.getList()
},
//分页
handleCurrentChange(val) {
this.listQuery.page = val
this.getList()
}
}
}
</script>
<style scoped>
.information {
border: 1px solid #ccc;
margin: 20px 0;
padding: 10px 20px;
}
.information h4 {
color: #333;
font-size: 16px;
font-weight: normal;
}
.information ul {
padding: 0;
border-top: 1px solid #eee;
padding: 10px 30px;
overflow: hidden;
}
.information li {
list-style: none;
text-align: center;
float: left;
width: 33.33%;
border-right: 1px solid #eee;
}
.information li:last-child {
border: none;
}
</style>
\ No newline at end of file
<template>
<div class="app-container calendar-list-container">
<el-form :inline="true" label-width="100px" label-position="right">
<el-form-item label="日期">
<el-date-picker v-model="time" type="daterange" placeholder="选择日期范围" @change="changeTime"></el-date-picker>
</el-form-item>
<el-form-item label="手机号">
<el-input v-model="listQuery.phone" placeholder="请输入手机号" clearable style="width:200px"></el-input>
</el-form-item>
<el-form-item label="上级手机号">
<el-input v-model="listQuery.parentPhone" placeholder="请输入上级手机号" clearable style="width:200px"></el-input>
</el-form-item>
<el-button type="primary" @click="search">搜索</el-button>
<el-button type="primary" @click="clearSearch">清空搜索</el-button>
<el-button type="primary" :loading="excelLoading" @click="downloadExcel">导出</el-button>
</el-form>
<el-table
:data="tableData"
border
header-align="center"
v-loading="loadingTab"
style="margin-top:20px"
>
<el-table-column label="序号" align="center" width="70">
<template scope="scope">
<span>{{scope.$index+(listQuery.page - 1) * listQuery.limit + 1}}</span>
</template>
</el-table-column>
<el-table-column prop="userName" label="姓名" align="center"></el-table-column>
<el-table-column prop="phone" label="电话" align="center"></el-table-column>
<el-table-column prop="positionName" label="身份" align="center"></el-table-column>
<el-table-column prop="parentName" label="上级姓名" align="center"></el-table-column>
<el-table-column prop="parentPhone" label="上级电话" align="center"></el-table-column>
<el-table-column prop="ticketNum" label="人数" align="center"></el-table-column>
<el-table-column prop="crtTime" label="报名时间" align="center"></el-table-column>
</el-table>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="listQuery.page"
:page-sizes="[10,20,30, 50]"
:page-size="listQuery.limit"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
style="margin-top:20px"
></el-pagination>
</div>
</template>
<script>
import { applyList, excel } from 'api/applyManagements'
export default {
created() {
this.getList()
},
data() {
return {
excelLoading: false,
loadingTab: false,
tableData: [],
time: '',
total: null, //总页数
listQuery: {
page: 1,
limit: 10,
startTime: null,
endTime: null,
phone: null,
activityId: 2,
parentPhone:null
}
}
},
methods: {
//列表
getList() {
this.loadingTab = true
applyList(this.listQuery).then(data => {
if (data.status == 200) {
this.tableData = data.data.data
this.total = data.data.totalCount
} else {
this.$message(data.message)
}
})
setTimeout(() => {
this.loadingTab = false
}, 300)
},
//搜索
search() {
this.listQuery.page = 1
this.getList()
},
//清空搜索
clearSearch() {
this.time = null
this.listQuery = {
page: 1,
limit: 10,
startTime: null,
endTime: null,
phone: null,
activityId: 2
}
this.getList()
},
//导出
downloadExcel() {
this.excelLoading = true
var u = navigator.userAgent,
app = navigator.appVersion
excel(this.listQuery, { responseType: 'arraybuffer' }).then(res => {
const content = res
const blob = new Blob([content], {
type: 'application/vnd.ms-excel'
})
const fileName = '报名列表.xlsx'
if (u.indexOf('Edge') > -1) {
window.navigator.msSaveBlob(blob, fileName)
} else {
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href) // 释放URL 对象
document.body.removeChild(elink)
}
this.excelLoading = false
})
},
//时间筛选
changeTime(val) {
this.listQuery.page = 1
if (!!val) {
let value = val.split(' - ')
this.listQuery.startTime = value[0] + ' 00:00:00'
this.listQuery.endTime = value[1] + ' 23:59:59'
this.getList()
} else {
this.listQuery.startTime = null
this.listQuery.endTime = null
this.getList()
}
},
//页码
handleSizeChange(val) {
this.listQuery.limit = val
this.getList()
},
//分页
handleCurrentChange(val) {
this.listQuery.page = val
this.getList()
}
}
}
</script>
This diff is collapsed.
<template>
<div class="app-container calendar-list-container">
<el-form :inline="true" label-width="100px" label-position="right">
<el-form-item label="日期">
<el-date-picker v-model="time" type="daterange" placeholder="选择日期范围" @change="changeTime"></el-date-picker>
</el-form-item>
<el-form-item label="手机号">
<el-input v-model="listQuery.phone" placeholder="请输入手机号" clearable style="width:200px"></el-input>
</el-form-item>
<el-form-item label="类型">
<el-select v-model="listQuery.prizeType" clearable placeholder="请选择抽奖类型" @change="changeClass">
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-button type="primary" @click="search">搜索</el-button>
<el-button type="primary" @click="clearSearch">清空搜索</el-button>
<el-button type="primary" :loading="excelLoading" @click="downloadExcel">导出</el-button>
</el-form>
<div class="information">
<h4>数据概况.</h4>
<ul>
<li>
<p>{{information.onLineNum}}</p>
<p>线上抽奖触发(次)</p>
</li>
<li>
<p>{{information.onLineWineNum}}</p>
<p>线上中奖个数(个)</p>
</li>
<li>
<p>{{information.localeNum}}</p>
<p>现场抽奖触发(次)</p>
</li>
<li>
<p>{{information.localeWineNum}}</p>
<p>现场中奖个数(个)</p>
</li>
</ul>
</div>
<el-table
:data="tableData"
border
header-align="center"
v-loading="loadingTab"
style="margin-top:20px"
>
<el-table-column label="序号" align="center" width="70">
<template scope="scope">
<span>{{scope.$index+(listQuery.page - 1) * listQuery.limit + 1}}</span>
</template>
</el-table-column>
<el-table-column prop="userName" label="用户名" align="center"></el-table-column>
<el-table-column prop="phone" label="电话" align="center"></el-table-column>
<el-table-column prop="positionName" label="身份" align="center"></el-table-column>
<el-table-column label="发放类型" align="center">
<template scope="scope">
<span>{{scope.row.prizeType == 1 ? '线上' : '现场'}}</span>
</template>
</el-table-column>
<el-table-column prop="prizeName" label="抽奖礼品" align="center"></el-table-column>
<el-table-column prop="expiryDateCode" label="兑换码" align="center">
<template scope="scope">
<span>{{scope.row.expiryDateCode || '无'}}</span>
</template>
</el-table-column>
<el-table-column prop="lotteryTime" label="中奖时间" align="center"></el-table-column>
</el-table>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="listQuery.page"
:page-sizes="[10,20,30, 50]"
:page-size="listQuery.limit"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
style="margin-top:20px"
></el-pagination>
</div>
</template>
<script>
import { applyListWin, excelWin } from 'api/applyManagements'
export default {
created() {
this.getList()
},
data() {
return {
information: {},
excelLoading: false,
loadingTab: false,
tableData: [],
time: '',
total: null, //总页数
options: [
{
id: '',
name: '全部'
},
{
id: 1,
name: '线上'
},
{
id: 2,
name: '现场'
}
],
listQuery: {
page: 1,
limit: 10,
startTime: null,
endTime: null,
phone: null,
activityId: 2,
prizeType: null,
hasWinning: 1
}
}
},
methods: {
//列表
getList() {
this.loadingTab = true
applyListWin(this.listQuery).then(data => {
if (data.status == 200) {
this.tableData = data.data.activityWinningRecords
this.total = data.data.totalCount
if (this.listQuery.page == 1) {
this.information =
data.data.activityWinningRecordTotalVo
}
} else {
this.$message(data.message)
}
})
setTimeout(() => {
this.loadingTab = false
}, 300)
},
//搜索
search() {
this.listQuery.page = 1
this.getList()
},
//抽奖类型筛选
changeClass() {
this.listQuery.page = 1
this.getList()
},
//清空搜索
clearSearch() {
this.time=null
this.listQuery = {
page: 1,
limit: 10,
startTime: null,
endTime: null,
phone: null,
activityId: 2
}
this.getList()
},
//导出
downloadExcel() {
this.excelLoading = true
var u = navigator.userAgent,
app = navigator.appVersion
excelWin(this.listQuery, { responseType: 'arraybuffer' }).then(
res => {
const content = res
const blob = new Blob([content], {
type: 'application/vnd.ms-excel'
})
const fileName = '中奖列表.xlsx'
if (u.indexOf('Edge') > -1) {
window.navigator.msSaveBlob(blob, fileName)
} else {
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href) // 释放URL 对象
document.body.removeChild(elink)
}
this.excelLoading = false
}
)
},
//时间筛选
changeTime(val) {
this.listQuery.page = 1
if (!!val) {
let value = val.split(' - ')
this.listQuery.startTime = value[0] + ' 00:00:00'
this.listQuery.endTime = value[1] + ' 23:59:59'
this.getList()
} else {
this.listQuery.startTime = null
this.listQuery.endTime = null
this.getList()
}
},
//页码
handleSizeChange(val) {
this.listQuery.limit = val
this.getList()
},
//分页
handleCurrentChange(val) {
this.listQuery.page = val
this.getList()
}
}
}
</script>
<style scoped>
.information {
border: 1px solid #ccc;
margin: 20px 0;
padding: 10px 20px;
}
.information h4 {
color: #333;
font-size: 16px;
font-weight: normal;
}
.information ul {
padding: 0;
border-top: 1px solid #eee;
padding: 10px 30px;
overflow: hidden;
}
.information li {
list-style: none;
text-align: center;
float: left;
width: 25%;
border-right: 1px solid #eee;
}
.information li:last-child {
border: none;
}
</style>
\ No newline at end of file
This diff is collapsed.
<template>
<div class="app-container calendar-list-container">
<div class="filter-container">
<el-form :inline="true" label-position="left">
<el-form-item label="统计周期">
<el-date-picker v-model="time" type="daterange" placeholder="请选择统计周期" @change="changeTime"></el-date-picker>
</el-form-item>
<el-form-item label="统计方式">
<el-radio-group v-model="listQuery.statisticalWay" @change="changeType">
<el-radio-button label="1"></el-radio-button>
<el-radio-button label="2"></el-radio-button>
<el-radio-button label="3"></el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="所属公司">
<el-select
v-model="listQuery.companyId"
filterable
placeholder="请选择业绩所属公司"
clearable
@change="changeCompany"
>
<el-option label="全部" value>全部</el-option>
<el-option v-for="item in allCompaniesArr" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-button type="primary" @click="clearSearch">清空搜索</el-button>
<el-button type="primary" :loading="excelLoading" @click="downloadExcel">导出报表</el-button>
</el-form>
<el-table
:data="tableData"
border
style="width: 100%"
header-align="center"
v-loading="loadingTab"
>
<el-table-column
prop="dateStr"
label="时间"
align="center"
width="200"
v-if="listQuery.statisticalWay == 1"
></el-table-column>
<el-table-column
prop="weekOfYear"
label="时间"
align="center"
width="200"
v-else-if="listQuery.statisticalWay == 2"
></el-table-column>
<el-table-column prop="month" label="时间" align="center" width="200" v-else></el-table-column>
<el-table-column prop="companyName" label="公司" align="center"></el-table-column>
<el-table-column prop="memberAmount" label="会员费" align="center"></el-table-column>
<el-table-column prop="rentVehilceAmount" label="租车费" align="center"></el-table-column>
<el-table-column prop="noDeductibleAmount" label="不计免赔费" align="center"></el-table-column>
<el-table-column prop="travelAmount" label="旅游费" align="center"></el-table-column>
<el-table-column prop="rentDays" label="租借天数" align="center"></el-table-column>
<!-- <el-table-column prop="extralAmount" label="其他费用" align="center"></el-table-column> -->
<el-table-column prop="departureNum" label="出车服务次数" align="center"></el-table-column>
<el-table-column prop="arrivalNum" label="收车服务次数" align="center"></el-table-column>
<el-table-column prop="lossSpecifiedAmount" label="定损金额" align="center"></el-table-column>
<el-table-column prop="lateFeeAmount" label="违约金额" align="center"></el-table-column>
<el-table-column label="押金" align="center">
<template scope="scope">
<span>{{ Math.round((scope.row.depositAmount+scope.row.depositRefundAmount)*100)/100}}</span>
</template>
</el-table-column>
<el-table-column prop="depositRefundAmount" label="已退押金" align="center"></el-table-column>
</el-table>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="listQuery.page"
:page-sizes="[10,20,30, 50]"
:page-size="listQuery.limit"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
style="margin-top:20px"
></el-pagination>
</div>
</div>
</template>
<script>
import { company_performance, excelExport } from 'api/statistics'
import { getAll } from 'api/base_info/branch_company'
export default {
created() {
//表格数据
this.getList()
//获取分公司
getAll().then(data => {
this.allCompaniesArr = data.data
})
},
data() {
return {
loadingTab: false,
tableData: [], //表格数据
time: null, //时间
excelLoading: false, //导出loading
allCompaniesArr: [],
total: null,
listQuery: {
statisticalWay: 1, //统计方式
companyId: null, //公司
page: 1,
limit: 10
}
}
},
methods: {
//统计周期筛选
changeTime(val, value) {
this.listQuery.page = 1
if (!!val) {
let value = val.split(' - ')
this.listQuery.startDate = value[0] + ' 00:00:00'
this.listQuery.endDate = value[1] + ' 23:59:59'
this.getList()
} else {
this.listQuery.startDate = null
this.listQuery.endDate = null
this.getList()
}
},
//统计方式筛选
changeType() {
this.listQuery.page = 1
this.getList()
},
//公司筛选
changeCompany() {
this.listQuery.page = 1
this.getList()
},
//清空搜索
clearSearch() {
this.time = null
this.listQuery = {
statisticalWay: 1, //统计方式
companyId: null, //公司
page: 1,
limit: 10
}
},
//导出
downloadExcel() {
this.excelLoading = true
var u = navigator.userAgent,
app = navigator.appVersion
excelExport(this.listQuery, { responseType: 'arraybuffer' }).then(
res => {
const content = res
const blob = new Blob([content], {
type: 'application/vnd.ms-excel'
})
const fileName = '分公司报表.xlsx'
if (u.indexOf('Edge') > -1) {
window.navigator.msSaveBlob(blob, fileName)
} else {
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href) // 释放URL 对象
document.body.removeChild(elink)
}
this.excelLoading = false
}
)
},
//表格数据
getList() {
this.loadingTab = true
company_performance(this.listQuery).then(data => {
if (data.status == 200) {
this.tableData = data.data.data
if (this.listQuery.page == 1) {
this.total = data.data.totalCount
}
window.scrollTo(0, 0)
} else {
this.$message.error(data.message)
}
setTimeout(() => {
this.loadingTab = false
}, 300)
})
},
//分页
handleSizeChange(val) {
this.listQuery.limit = val
this.getList()
},
handleCurrentChange(val) {
this.listQuery.page = val
this.getList()
}
}
}
</script>
<style>
</style>
\ No newline at end of file
<template>
<div class="app-container calendar-list-container" v-loading="loading">
<el-row>
<el-form :inline="true" label-position="left">
<el-form-item label="统计类型">
<el-radio-group v-model="listquery.type" @change="changeType">
<el-radio-button label="0">收入</el-radio-button>
<el-radio-button label="1">支出</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="下单时间">
<el-date-picker v-model="time" type="daterange" placeholder="请选择下单时间" @change="changeTime"></el-date-picker>
</el-form-item>
<el-form-item label="订单类型">
<el-select v-model="listquery.orderType" clearable placeholder="请选择订单类型" @change="changeStaff">
<el-option label="全部" value>全部</el-option>
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="所属公司" v-show="listquery.type == 0">
<el-select
v-model="listquery.companyId"
filterable
placeholder="请选择业绩所属公司"
clearable
@change="changeCompany"
>
<el-option label="全部" value>全部</el-option>
<el-option v-for="item in allCompaniesArr" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="支付方式" v-show="listquery.type == 0">
<el-select
v-model="listquery.paymentMethod"
clearable
placeholder="请选择支付方式"
@change="changeWay"
>
<el-option label="全部" value>全部</el-option>
<el-option v-for="item in payArr" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-button type="primary" @click="clearSearch">清空搜索</el-button>
<el-button type="primary" :loading="excelLoading" @click="downloadExcel">导出报表</el-button>
</el-form>
</el-row>
<div class="information" v-if="listquery.type == 0">
<h4>数据概况</h4>
<ul class="first">
<li>
<p>{{information.orderSum || 0}}</p>
<p>订单总量</p>
</li>
<li>
<p>{{information.totalReceivables || 0}}</p>
<p>应收金额</p>
</li>
<li>
<p>{{information.discount || 0}}</p>
<p>优惠金额</p>
</li>
<li>
<p>{{information.actual || 0}}</p>
<p>实收金额</p>
</li>
</ul>
<!-- <ul v-else class="second">
<li>
<p>{{information.orderSum || 0}}</p>
<p>订单总量</p>
</li>
<li>
<p>{{information.staffNum || 0}}</p>
<p>应退还金额</p>
</li>
<li>
<p>{{information.staffNum || 0}}</p>
<p>实际退还</p>
</li>
</ul>-->
</div>
<!-- :height="tabHeight" -->
<el-table :data="tableData" border style="width: 100%" header-align="center">
<el-table-column prop="crtTime" label="下单日期" align="center" v-if="listquery.type == 0"></el-table-column>
<el-table-column prop="time" label="退款日期" align="center" v-else></el-table-column>
<el-table-column prop="no" label="订单ID" align="center"></el-table-column>
<el-table-column prop="type" label="订单类型" align="center"></el-table-column>
<el-table-column prop="orderAmount" label="应收金额" align="center" v-if="listquery.type == 0"></el-table-column>
<el-table-column prop="refundInstruction" label="退还类型" align="center" v-else></el-table-column>
<el-table-column prop="favorablePrice" label="优惠金额" align="center" v-if="listquery.type == 0"></el-table-column>
<el-table-column prop="refundAmount" label="退还金额" align="center" v-else></el-table-column>
<el-table-column prop="realAmount" label="实收金额" align="center" v-if="listquery.type == 0"></el-table-column>
<el-table-column prop="realname" label="客户名字" align="center"></el-table-column>
<el-table-column prop="username" label="客户手机号" align="center"></el-table-column>
<el-table-column label="邀约人/身份" align="center" v-if="listquery.type == 0">
<template scope="scope">
<span>{{scope.row.parentRealname}} / {{scope.row.positionName}}</span>
</template>
</el-table-column>
<el-table-column prop="parentUsername" label="邀约人手机号" align="center" v-if="listquery.type == 0"></el-table-column>
<el-table-column prop="companyName" label="业绩所属公司" align="center" v-if="listquery.type == 0"></el-table-column>
<el-table-column prop="payWay" label="支付方式" align="center" v-if="listquery.type == 0"></el-table-column>
</el-table>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="listquery.page"
:page-sizes="[10,20,30, 50]"
:page-size="listquery.limit"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
style="margin-top:20px"
></el-pagination>
</div>
</template>
<script>
import { companyList, excel } from 'api/statistics'
import { getAll } from 'api/base_info/branch_company/'
export default {
created() {
this.getList()
this.getCompany()
},
data() {
return {
tabHeight: '800',
loading: false,
total: null,
information: {},
time: [],
allCompaniesArr: [], //公司数据
tableData: [], //表格数据
excelLoading: false, //导出loading
payArr: [
{ id: 1, name: '微信公众号支付' },
{ id: 2, name: '支付宝即时支付' },
{ id: 3, name: '银联' }
],
options: [
{
id: '1',
name: '租车'
},
{
id: '2',
name: '旅游'
},
{
id: '3',
name: '会员'
}
], //身份
listquery: {
startDate: null, //开始日期
endDate: null, //结束日期
orderType: null, //身份
page: 1,
limit: 10,
companyId: null, //业绩所属公司
paymentMethod: null, //支付方式
type: 0
}
}
},
methods: {
handleSizeChange(val) {
this.listquery.limit = val
this.getList()
},
handleCurrentChange(val) {
this.listquery.page = val
this.getList()
},
//清空搜索
clearSearch() {
this.listquery = {
startDate: null,
endDate: null, //结束日期
orderType: null, //身份
page: 1,
limit: 10,
companyId: null, //业绩所属公司
paymentMethod: null, //支付方式
type: this.listquery.type
}
},
//获取分公司
getCompany() {
getAll().then(data => {
this.allCompaniesArr = data.data
})
},
//所属公司筛选
changeCompany() {
this.listquery.page = 1
this.getList()
},
//统计类型筛选
changeType(val) {
this.listquery.page = 1
this.getList()
},
//支付方式筛选
changeWay(val) {
this.listquery.page = 1
this.getList()
},
//时间筛选
changeTime(val, value) {
this.listquery.page = 1
if (!!val) {
let value = val.split(' - ')
this.listquery.startDate = value[0] + ' 00:00:00'
this.listquery.endDate = value[1] + ' 23:59:59'
this.getList()
} else {
this.listquery.startDate = null
this.listquery.endDate = null
this.getList()
}
},
//身份筛选
changeStaff() {
this.listquery.page = 1
this.getList()
},
//列表数据
getList() {
this.loading = true
companyList(this.listquery).then(data => {
if (data.status == 200) {
if (this.listquery.type == 0) {
this.tableData = data.data.achievements.list
this.total = data.data.achievements.total
if (this.listquery.page == 1) {
this.information = {
orderSum: data.data.orderSum, //订单总量
totalReceivables: data.data.totalReceivables, //应收金额
discount: data.data.discount, //优惠金额
actual: data.data.actual //实收金额
}
}
} else {
this.tableData = data.data.list
this.total = data.data.total
}
}
setTimeout(() => {
this.loading = false
}, 300)
})
},
//导出
downloadExcel() {
this.excelLoading = true
var u = navigator.userAgent,
app = navigator.appVersion
excel(this.listquery, { responseType: 'arraybuffer' }).then(res => {
const content = res
const blob = new Blob([content], {
type: 'application/vnd.ms-excel'
})
const fileName = '总公司报表.xlsx'
if (u.indexOf('Edge') > -1) {
window.navigator.msSaveBlob(blob, fileName)
} else {
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href) // 释放URL 对象
document.body.removeChild(elink)
}
this.excelLoading = false
})
}
}
}
</script>
<style scoped>
.information {
border: 1px solid #ccc;
margin: 20px 0;
padding: 10px 20px;
}
.information h4 {
color: #333;
font-size: 16px;
font-weight: normal;
}
.information ul {
padding: 0;
border-top: 1px solid #eee;
padding: 10px 30px;
overflow: hidden;
}
.information li {
list-style: none;
text-align: center;
float: left;
border-right: 1px solid #eee;
}
.information .first li {
width: 25%;
}
.information .second li {
width: 33%;
}
.information li:last-child {
border: none;
}
</style>
\ No newline at end of file
<template>
<div class="app-container calendar-list-container" v-loading="loading">
<el-row style="border-bottom:1px dashed #ccc;padding-bottom:20px">
<el-date-picker v-model="time" type="daterange" placeholder="选择日期范围" @change="changeTime"></el-date-picker>
<el-select
v-model="listquery.companyId"
filterable
placeholder="请选择公司"
@change="changeCompany"
clearable
ref="company"
>
<el-option v-for="item in allCompaniesArr" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
<el-select
v-model="listquery.userPostionId"
clearable
placeholder="请选择身份"
@change="changeStaff"
ref="userPostion"
>
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
<el-button type="primary" :loading="excelLoading" @click="downloadExcel">导出报表</el-button>
</el-row>
<div class="information">
<h4>数据概况.</h4>
<ul>
<li>
<p>{{information.staffNum}}</p>
<p>员工总数(人)</p>
</li>
<li>
<p>{{information.totalSellAmount}}</p>
<p>员工销售额(元)</p>
</li>
<li>
<p>{{information.totalRoyaltyAmount}}</p>
<p>员工App提成总额(元)</p>
</li>
</ul>
</div>
<el-table
:data="tableData"
border
style="width: 100%"
header-align="center"
height="450"
@select="choose"
@select-all="chooseAll"
ref="multipleTable"
>
<el-table-column type="selection" width="55" align="center"></el-table-column>
<!-- <el-table-column type="index" width="80" label="序号" align="center"></!-->
<el-table-column label="序号" align="center" width="70">
<template scope="scope">
<span>{{scope.$index+(listquery.page - 1) * listquery.limit + 1}}</span>
</template>
</el-table-column>
<el-table-column prop="name" label="员工姓名" align="center"></el-table-column>
<el-table-column prop="companyNames" label="所属公司" align="center">
<template scope="scope">
<p v-for="(item,index) in scope.row.companyNames" :key="index">{{item}}</p>
</template>
</el-table-column>
<el-table-column prop="postionNames" label="身份" align="center">
<template scope="scope">
<span
v-for="(item,index) in scope.row.postionNames"
:key="index"
style="margin-left:10px"
>{{item}}</span>
</template>
</el-table-column>
<el-table-column prop="phone" label="电话" align="center"></el-table-column>
<el-table-column prop="sellAmount" label="销售额(元)" align="center"></el-table-column>
<el-table-column prop="royaltyAmount" label="APP提成(5%)" width="100px" align="center"></el-table-column>
<el-table-column label="会员订单数/合计金额(元)" width="120px" align="center">
<template scope="scope">
<span>{{scope.row.memberOrderNum}} / {{scope.row.memberAmount}}</span>
</template>
</el-table-column>
<el-table-column label="租车订单数/合计金额(元)" width="120px" align="center">
<template scope="scope">
<span>{{scope.row.rentVehicleOrderNum}} / {{scope.row.rentVehicleAmount}}</span>
</template>
</el-table-column>
<el-table-column label="旅游订单数/合计金额(元)" width="120px" align="center">
<template scope="scope">
<span>{{scope.row.travelOrderNum}} / {{scope.row.travelAmount}}</span>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="listquery.page"
:page-sizes="[10,20,30, 50]"
:page-size="listquery.limit"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
style="margin-top:20px"
></el-pagination>
</div>
</template>
<script>
import { getAll } from 'api/base_info/branch_company/'
import { getDate, exports } from 'api/statistics'
import { getrewardSetting } from 'api/purseManage'
export default {
created() {
this.getList()
this.getCompany()
this.getrewardSettingFn()
},
data() {
return {
loading: false, //页面loading
total: null, //总页数
information: {}, //统计数据
time: [], //时间筛选
tableData: [], //表格数据
excelLoading: false, //导出loading
allCompaniesArr: [], //公司
options: [], //身份
allChoose: false, //是否全选
userIds: [],
listquery: {
startDate: null, //开始日期
endDate: null, //结束日期
companyId: null, //公司
userPostionId: null, //身份
userIds: [],
page: 1,
limit: 10
}
}
},
methods: {
//全选
chooseAll(arr) {
arr.length > 0 ? (this.allChoose = true) : (this.allChoose = false)
},
//多选
choose(val, row) {
this.userIds = val
// console.log(val);
// val.forEach(element => {
// if (this.userIds.filter(item => item != element.userId)) {
// this.userIds.push(element.userId)
// }
// })
},
//页码
handleSizeChange(val) {
this.listquery.limit = val
this.getList()
},
//分页
handleCurrentChange(val) {
this.listquery.page = val
this.getList()
},
//时间筛选
changeTime(val, value) {
this.listquery.page = 1
if (!!val) {
let value = val.split(' - ')
this.listquery.startDate = value[0] + ' 00:00:00'
this.listquery.endDate = value[1] + ' 23:59:59'
this.getList()
} else {
this.listquery.startDate = null
this.listquery.endDate = null
this.getList()
}
},
//分公司筛选
changeCompany(val) {
this.listquery.companyName = this.$refs.company.query
this.listquery.page = 1
this.getList()
},
//身份筛选
changeStaff() {
this.listquery.page = 1
this.listquery.postionName = this.$refs.userPostion.selectedLabel
this.getList()
},
//列表数据
getList() {
this.loading = true
getDate(this.listquery).then(data => {
if (data.status == 200) {
this.tableData = data.data.page.data
this.total = data.data.page.totalCount
//点击全选所有分页都全选
this.$nextTick(function() {
if (!!this.allChoose) {
for (
let index = 0;
index < this.tableData.length;
index++
) {
this.$refs.multipleTable.toggleRowSelection(
this.tableData[index]
)
}
}
//多选
// for (let i = 0; i < this.userIds.length; i++) {
// let demo = this.tableData.findIndex(
// item => item.userId == this.userIds[i]
// )
// if (demo > 0) {
// this.$refs.multipleTable.toggleRowSelection(
// this.tableData[demo]
// )
// }
// }
})
//第一页才调取统计
if (data.data.page.pageNum == 1) {
this.information = data.data.total
}
}
setTimeout(() => {
this.loading = false
}, 300)
})
},
//获取分公司
getCompany() {
getAll().then(data => {
this.allCompaniesArr = data.data
})
},
//获取身份
getrewardSettingFn() {
getrewardSetting().then(data => {
this.options = data.data.filter(item => item.id != 6)
})
},
//导出
downloadExcel() {
if (this.userIds.length > 0) {
this.userIds.forEach(element => {
this.listquery.userIds.push(element.userId)
})
}
this.$refs.multipleTable.clearSelection()
this.userIds = []
this.excelLoading = true
var u = navigator.userAgent,
app = navigator.appVersion
exports(this.listquery, { responseType: 'arraybuffer' }).then(
res => {
const content = res
const blob = new Blob([content], {
type: 'application/vnd.ms-excel'
})
const fileName =
this.timestamp(new Date()) + '员工业绩报表.xlsx'
if (u.indexOf('Edge') > -1) {
window.navigator.msSaveBlob(blob, fileName)
console.log('ie')
} else {
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href) // 释放URL 对象
document.body.removeChild(elink)
}
this.excelLoading = false
this.listquery.userIds = []
}
)
},
timestamp(now) {
var year = now.getFullYear()
var month = now.getMonth() + 1
var date = now.getDate()
var Hours = now.getHours()
var Minutes = now.getMinutes()
var Seconds = now.getSeconds()
month = month.toString().length == 1 ? '0' + month : month
date = date.toString().length == 1 ? '0' + date : date
Hours = Hours.toString().length == 1 ? '0' + Hours : Hours
Minutes = Minutes.toString().length == 1 ? '0' + Minutes : Minutes
Seconds = Seconds.toString().length == 1 ? '0' + Seconds : Seconds
return (
year +
'-' +
month +
'-' +
date +
' ' +
Hours +
':' +
Minutes +
':' +
Seconds
)
}
}
}
</script>
<style scoped>
.information {
border: 1px solid #ccc;
margin: 20px 0;
padding: 10px 20px;
}
.information h4 {
color: #333;
font-size: 16px;
font-weight: normal;
}
.information ul {
padding: 0;
border-top: 1px solid #eee;
padding: 10px 30px;
overflow: hidden;
}
.information li {
list-style: none;
text-align: center;
float: left;
width: 33.33%;
border-right: 1px solid #eee;
}
.information li:last-child {
border: none;
}
</style>
\ No newline at end of file
<template>
<div class="app-container calendar-list-container">
<div class="filter-container">
<el-form ref="queryForm" :model="listQuery" label-width="100px">
<el-row>
<el-col :span="5">
<el-form-item label="统计时间:">
<el-date-picker
v-model="time"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="changeTime"
placeholder="请选择统计时间"
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="统计方式:" class="wayMsg">
<span
v-for="(item,index) in way"
:key="index"
:class="{active:isactive==item.label}"
@click="changeWay(item)"
>{{item.label}}</span>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="所属公司" prop="startCompanyId">
<el-select
v-model="listQuery.companyId"
filterable
placeholder="请选择"
getAllBranchCompanyChange
>
<el-option :key="undefined" label="无" :value="undefined"></el-option>
<el-option
v-for="item in allBranchCompany"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>
<el-button class="filter-item" type="primary" v-waves icon="delete" @click="clearSearch">清除搜索</el-button>
<el-button class="filter-item" type="primary" v-waves @click="exportVehicleInfo">导出为Excel</el-button>
<el-table :data="list" border fit highlight-current-row style="width: 100%" v-loading="loading">
<el-table-column align="center" label="时间">
<template scope="scope">
<span v-if="scope.row.countDate">{{scope.row.countDate}}</span>
<span v-else-if="scope.row.weekStartDate">{{scope.row.weekStartDate}} ~ {{scope.row.weekEndDate}}</span>
<span v-else>{{scope.row.countYear}}-{{scope.row.countMonth}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="公司名">
<template scope="scope">
<span>{{scope.row.companyName}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="停靠车辆数量">
<template scope="scope">
<!-- <span>{{scope.row.vehicleNum}}</span>
--> <span v-if="listQuery.type==1">{{scope.row.vehicleNum}}</span>
<span v-if="listQuery.type==2">{{Math.ceil(scope.row.vehicleNum/7)}}</span>
<span v-if="listQuery.type==3">{{Math.ceil(scope.row.vehicleNum/30)}}</span>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="listQuery.page"
:page-sizes="[10,20,30, 50]"
:page-size="listQuery.limit"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
style="margin-top:20px"
></el-pagination>
</div>
</div>
</template>
<script>
import { pageList, vehicleInfoExcel} from 'api/statistics/vehicleStatistics'
import {formatDate} from '../../utils/dateFormattor'
import { getAllCompany } from 'api/base_info/branch_company'
export default {
created() {
this.getList(),
getAllCompany(codeAndBranchCompany => {
this.allBranchCompany = codeAndBranchCompany;
});
},
data() {
return {
loading: false,
total: 0,
list: [],
time: [],
allBranchCompany:[],
// 统计时间筛选
listQuery: {
type: 1,
startTime: null,
endTime: null,
companyId:null,
limit: 10,
page: 1
},
//统计方式筛选
way: [
{
label: '日统计',
id: 1
},
{
label: '周统计',
id: 2
},
{
label: '月统计',
id: 3
}
],
isactive: '日统计'
}
},
methods: {
//统计时间筛选
changeTime() {
!!this.time[0]
? (this.listQuery.startTime = this.time[0])
: (this.listQuery.startTime = null)
!!this.time[1]
? (this.listQuery.endTime = this.time[1])
: (this.listQuery.endTime = null)
if(this.listQuery.startTime && this.listQuery.endTime) {
this.listQuery.startTime = formatDate(this.listQuery.startTime, 'yyyy-MM-dd')
this.listQuery.endTime = formatDate(this.listQuery.endTime, 'yyyy-MM-dd')
}
},
//统计方式筛选
changeWay(val) {
this.isactive = val.label
this.listQuery.type = val.id
this.listQuery.page = 1
this.getList()
},
//导出
exportVehicleInfo() {
vehicleInfoExcel(this.listQuery).then(res => {
const content = res
const blob = new Blob([content])
const fileName = '车辆信息.xlsx'
if ('download' in document.createElement('a')) {
// 非IE下载
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href) // 释放URL 对象
document.body.removeChild(elink)
} else {
// IE10+下载
navigator.msSaveBlob(blob, fileName)
}
})
},
handleSizeChange(val) {
this.listQuery.limit = val
this.getList()
},
handleCurrentChange(val) {
this.listQuery.page = val
this.getList()
},
handleFilter() {
this.listQuery.page = 1
this.$refs.queryForm.validate(valid => {
if (valid) {
this.getList()
} else {
return false
}
})
},
clearSearch() {
this.listQuery = {
type: 1,
startTime: null,
endTime: null,
companyId:null,
limit: 10,
page: 1
}
this.time = []
this.isactive = '日统计'
this.getList()
},
//列表
getList() {
this.loading = true
pageList(this.listQuery).then(data => {
if (data.status == 200 && data.data) {
this.total = data.totalCount
this.list = []
this.list = data.data.data
}
setTimeout(() => {
this.loading = false
}, 300)
})
}
}
}
</script>
<style>
.wayMsg span {
margin: 10px;
cursor: pointer;
}
.active {
color: #409eff;
font-weight: bold;
}
</style>
This diff is collapsed.
......@@ -179,7 +179,7 @@
item.value = item.name;
selectArry.push(item);
});
});
});
getAllCompany(codeAndBranchCompany => {
this.allCompanies = codeAndBranchCompany;
});
......
......@@ -334,8 +334,8 @@ export default {
this.$refs[formName].validate(valid => {
if (valid) {
let params = {
startCompanyIds: this.listQuery.startCompanyIds,
endCompanyIds: this.listQuery.endCompanyIds,
startCompanyId: this.listQuery.startCompanyIds,
endCompanyId: this.listQuery.endCompanyIds,
startDateTamp: this.listQuery.time[0].getTime(),
endDateTamp: this.listQuery.time[1].getTime(),
limit: 100,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -55,7 +55,7 @@
<el-table-column align="center" label="来源">
<template scope="scope">
<span>{{scope.row.sourceUserName || '-'}}</span>
<span>{{scope.row.sourceName || '-'}}</span>
</template>
</el-table-column>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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