Commit 5f7489b1 authored by guoyou's avatar guoyou

分公司统计

parent 32ec2a74
...@@ -35,4 +35,23 @@ export function excel(query) { ...@@ -35,4 +35,23 @@ export function excel(query) {
data: query, data: query,
responseType: 'blob' 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',
data: query,
responseType: 'blob'
});
} }
\ No newline at end of file
...@@ -19,7 +19,7 @@ export function statistic(param) { ...@@ -19,7 +19,7 @@ export function statistic(param) {
export function findReserveType(param) { export function findReserveType(param) {
return fetch({ return fetch({
url: '/departure/findReserveType ', url: '/vehicle/departure/findReserveType ',
method: 'get', method: 'get',
params: param params: param
}) })
......
...@@ -555,7 +555,8 @@ export const asyncRouterMap = [{ ...@@ -555,7 +555,8 @@ export const asyncRouterMap = [{
component: _import('userManagement/imCustomerServiceManger/cusomterServiceList'), component: _import('userManagement/imCustomerServiceManger/cusomterServiceList'),
name: '客服列表', name: '客服列表',
authority: 'imCustomerServiceManger' authority: 'imCustomerServiceManger'
},{ },
{
path: 'employeesInput', path: 'employeesInput',
component: _import('userManagement/employeesInput'), component: _import('userManagement/employeesInput'),
name: '员工录入', name: '员工录入',
...@@ -587,7 +588,7 @@ export const asyncRouterMap = [{ ...@@ -587,7 +588,7 @@ export const asyncRouterMap = [{
component: _import('appManagement/selectedActivities/index'), component: _import('appManagement/selectedActivities/index'),
name: '首页精选活动', name: '首页精选活动',
authority: 'selectedActivities' authority: 'selectedActivities'
}, }
// { // {
// path: 'pushManagement', // path: 'pushManagement',
// component: _import('appManagement/pushManagement/index'), // component: _import('appManagement/pushManagement/index'),
...@@ -753,6 +754,11 @@ export const asyncRouterMap = [{ ...@@ -753,6 +754,11 @@ export const asyncRouterMap = [{
component: _import('financial/memberPerformance'), component: _import('financial/memberPerformance'),
name: '总公司报表', name: '总公司报表',
authority: 'memberPerformance' authority: 'memberPerformance'
}, {
path: 'branchCompany',
component: _import('financial/branchCompany'),
name: '总公司报表',
authority: 'branchCompany'
} }
] ]
} }
......
<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">
<el-table-column
prop="date"
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="depositAmount" 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>
<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 {
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() {
company_performance(this.listQuery).then(data => {
if (data.status == 200) {
this.tableData = data.data.data
this.total = data.data.totalCount
} else {
this.$message.error(data.message)
}
})
},
//分页
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> <template>
<div class="app-container calendar-list-container"> <div class="app-container calendar-list-container">
<div class="filter-container"> <div class="filter-container">
<el-form> <el-form>
<el-row> <el-row>
<el-col :span="5">
<el-form-item label="车辆编码" prop="code">
<el-input type="number" style="width: 200px;" v-model.number="listQuery.code"
placeholder="请输入车辆编码"></el-input>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="车牌号" prop="code">
<el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="车牌号"
v-model="listQuery.numberPlate"></el-input>
</el-form-item>
</el-col>
<el-col :span="5"> <el-col :span="5">
<el-form-item label="出车日期" prop="startTime"> <el-form-item label="车辆编码" prop="code">
<el-date-picker <el-input
v-model="listQuery.startTime" type="number"
type="date" style="width: 200px;"
:editable="false" v-model.number="listQuery.code"
format="yyyy-MM-dd" placeholder="请输入车辆编码"
prop="startTime" ></el-input>
placeholder="请选择出车日期"> </el-form-item>
</el-date-picker>
</el-form-item>
</el-col> </el-col>
<el-col :span="5">
<el-form-item label="车牌号" prop="code">
<el-input
@keyup.enter.native="handleFilter"
style="width: 200px;"
class="filter-item"
placeholder="车牌号"
v-model="listQuery.numberPlate"
></el-input>
</el-form-item>
</el-col>
<el-col :span="5"> <el-col :span="5">
<el-form-item label="还车日期" prop="endTime"> <el-form-item label="出车日期" prop="startTime">
<el-date-picker <el-date-picker
v-model="listQuery.endTime" v-model="listQuery.startTime"
type="date" type="date"
:editable="false" :editable="false"
format="yyyy-MM-dd" format="yyyy-MM-dd"
prop="endTime" prop="startTime"
placeholder="请选择还车日期"> placeholder="请选择出车日期"
</el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row>
<el-col :span="5">
<el-form-item label="分公司" prop="departureId">
<el-autocomplete
class="inline-input"
v-model="state1"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
@select="handleSelect"
></el-autocomplete>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item>
<el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>
<el-button class="filter-item" type="primary" v-waves @click="reloadPage">重置</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div v-show="statisticVisiable">
<el-row style="text-align: center;margin-top: 10px;margin-bottom: 10px">
<el-col :span="8">
<span class="statistic_number">{{statisticData.departureCount}}</span>
<br><br>
<span class="statistic_title">出行次数</span>
</el-col>
<el-col :span="8">
<span class="statistic_number">{{statisticData.departureDay}}</span>
<br><br>
<span class="statistic_title">出行天数</span>
</el-col>
<el-col :span="8">
<span class="statistic_number">{{statisticData.departureMileage}}</span>
<br><br>
<span class="statistic_title">公里</span>
</el-col>
</el-row>
</div>
<el-button class="filter-item" type="primary" :icon=" showMoreMoreCol ? 'caret-left' : 'caret-right' " v-waves
@click="showMoreMoreCol=!showMoreMoreCol">
更多列
</el-button>
<el-table :key='tableKey' :data="list" v-loading.body="listLoading" border fit highlight-current-row
style="width: 100%">
<el-table-column
type="index"
label="编号"
width="65">
</el-table-column>
<!-- <el-table-column align="center" label="编号" width="65">
--> <!--<template scope="scope">-->
<!--<span>{{scope.row.id}}</span>-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column align="center" label="车牌号" width="120">
<template scope="scope">
<span>{{scope.row.numberPlate}}</span>
</template>
</el-table-column>
<el-table-column width="200" align="center" label="出车时间">
<template scope="scope">
<span>{{scope.row.departureTime}}</span>
</template>
</el-table-column>
<el-table-column width="100" align="center" label="使用人">
<template scope="scope">
<span>{{scope.row.user}}</span>
</template>
</el-table-column>
<el-table-column width="200" align="center" label="出车地点">
<template scope="scope">
<span>{{scope.row.departureName}}</span>
</template>
</el-table-column>
<el-table-column width="200" align="center" label="还车时间">
<template scope="scope">
<span>{{scope.row.arrivalTime}}</span>
</template>
</el-table-column>
<el-table-column width="100" align="center" label="还车人">
<template scope="scope">
<span>{{scope.row.recycleMan}}</span>
</template>
</el-table-column>
<el-table-column width="200" align="center" label="还车地点">
<template scope="scope">
<span>{{scope.row.arrivalName}}</span>
</template>
</el-table-column>
<el-table-column width="150" align="center" label="本次出行天数">
<template scope="scope">
<span>{{scope.row.departureDay}}</span>
</template>
</el-table-column>
<el-table-column width="150" align="center" label="本次出行公里">
<template scope="scope">
<span>{{scope.row.mileage}}</span>
</template>
</el-table-column>
<el-table-column width="100" align="center" label="验车人">
<template scope="scope">
<span>{{scope.row.checkMan}}</span>
</template>
</el-table-column>
<el-table-column width="100" align="center" label="用途">
<template scope="scope">
<span>{{scope.row.use}}</span>
</template>
</el-table-column>
<el-table-column width="200" align="center" label="使用人电话" v-if="showMoreMoreCol"> <el-col :span="5">
<template scope="scope"> <el-form-item label="还车日期" prop="endTime">
<span>{{scope.row.userTel}}</span> <el-date-picker
</template> v-model="listQuery.endTime"
</el-table-column> type="date"
:editable="false"
format="yyyy-MM-dd"
prop="endTime"
placeholder="请选择还车日期"
></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="5">
<el-form-item label="出车公司" prop="departureId">
<el-autocomplete
class="inline-input"
v-model="state1"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
@select="handleSelect"
></el-autocomplete>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="收车公司">
<el-autocomplete
class="inline-input"
v-model="arrivalBranchCompanyId"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
@select="putCompanyChange"
></el-autocomplete>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="用途">
<el-select v-model="listQuery.use" filterable placeholder="请选择车辆用途" @change="changeUse">
<el-option label="全部" value>全部</el-option>
<el-option
v-for="item in useArr"
:key="item.code"
:label="item.name"
:value="item.code"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item>
<el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>
<el-button class="filter-item" type="primary" v-waves @click="reloadPage">重置</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div v-show="statisticVisiable">
<el-row style="text-align: center;margin-top: 10px;margin-bottom: 10px">
<el-col :span="8">
<span class="statistic_number">{{statisticData.departureCount}}</span>
<br />
<br />
<span class="statistic_title">出行次数</span>
</el-col>
<el-col :span="8">
<span class="statistic_number">{{statisticData.departureDay}}</span>
<br />
<br />
<span class="statistic_title">出行天数</span>
</el-col>
<el-col :span="8">
<span class="statistic_number">{{statisticData.departureMileage}}</span>
<br />
<br />
<span class="statistic_title">公里</span>
</el-col>
</el-row>
</div>
<el-button
class="filter-item"
type="primary"
:icon=" showMoreMoreCol ? 'caret-left' : 'caret-right' "
v-waves
@click="showMoreMoreCol=!showMoreMoreCol"
>更多列</el-button>
<el-table
:key="tableKey"
:data="list"
v-loading.body="listLoading"
border
fit
highlight-current-row
style="width: 100%"
>
<el-table-column type="index" label="编号" width="65"></el-table-column>
<!-- <el-table-column align="center" label="编号" width="65">
-->
<!--<template scope="scope">-->
<!--<span>{{scope.row.id}}</span>-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column align="center" label="车牌号" width="120">
<template scope="scope">
<span>{{scope.row.numberPlate}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="预约出/收车时间">
<template scope="scope">
<p>{{scope.row.bookStartDate}}</p>
<p>{{scope.row.bookEndDate}}</p>
</template>
</el-table-column>
<el-table-column align="center" label="实际出/收车时间">
<template scope="scope">
<p>{{scope.row.actualStartDate}}</p>
<p>{{scope.row.actualEndDate}}</p>
</template>
</el-table-column>
<el-table-column align="center" label="出/收车公司">
<template scope="scope">
<p>{{scope.row.departureName}}</p>
<p>{{scope.row.arrivalName}}</p>
</template>
</el-table-column>
<el-table-column align="center" label="出/收车人">
<template scope="scope">
<span>{{scope.row.departureTime}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="出行天数/公里数">
<template scope="scope">
<p>{{scope.row.departureDay}}</p>
<p>{{scope.row.mileage}}</p>
</template>
</el-table-column>
<el-table-column align="center" label="客户/手机号">
<template scope="scope">
<p>{{scope.row.user}}</p>
<p>{{scope.row.userTel}}</p>
</template>
</el-table-column>
<el-table-column align="center" label="用途">
<template scope="scope">
<span>{{scope.row.use}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="备注">
<template scope="scope">
<span>{{scope.row.departureTime}}</span>
</template>
</el-table-column>
<!-- <el-table-column width="100" align="center" label="使用人">
<template scope="scope">
<span>{{scope.row.user}}</span>
</template>
</el-table-column>
<el-table-column width="200" align="center" label="出车地点">
<template scope="scope">
<span>{{scope.row.departureName}}</span>
</template>
</el-table-column>
<el-table-column width="200" align="center" label="还车时间">
<template scope="scope">
<span>{{scope.row.arrivalTime}}</span>
</template>
</el-table-column>
<el-table-column width="100" align="center" label="还车人">
<template scope="scope">
<span>{{scope.row.recycleMan}}</span>
</template>
</el-table-column>
<el-table-column width="200" align="center" label="还车地点">
<template scope="scope">
<span>{{scope.row.arrivalName}}</span>
</template>
</el-table-column>
<el-table-column width="150" align="center" label="本次出行天数">
<template scope="scope">
<span>{{scope.row.departureDay}}</span>
</template>
</el-table-column>
<el-table-column width="150" align="center" label="本次出行公里">
<template scope="scope">
<span>{{scope.row.mileage}}</span>
</template>
</el-table-column>
<el-table-column width="100" align="center" label="验车人">
<template scope="scope">
<span>{{scope.row.checkMan}}</span>
</template>
</el-table-column>
<el-table-column width="100" align="center" label="用途">
<template scope="scope">
<span>{{scope.row.use}}</span>
</template>
</el-table-column>-->
<el-table-column width="200" align="center" label="验车人电话" v-if="showMoreMoreCol"> <!-- <el-table-column width="200" align="center" label="使用人电话" v-if="showMoreMoreCol">
<template scope="scope"> <template scope="scope">
<span>{{scope.row.checkManTel}}</span> <span>{{scope.row.userTel}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="200" align="center" label="验车人电话" v-if="showMoreMoreCol">
<template scope="scope">
<span>{{scope.row.checkManTel}}</span>
</template>
</el-table-column>
<el-table-column width="100" align="center" label="开始公里数" v-if="showMoreMoreCol"> <el-table-column width="100" align="center" label="开始公里数" v-if="showMoreMoreCol">
<template scope="scope"> <template scope="scope">
<span>{{scope.row.mileageStart}}</span> <span>{{scope.row.mileageStart}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="100" align="center" label="结束公里数" v-if="showMoreMoreCol"> <el-table-column width="100" align="center" label="结束公里数" v-if="showMoreMoreCol">
<template scope="scope"> <template scope="scope">
<span>{{scope.row.mileageEnd}}</span> <span>{{scope.row.mileageEnd}}</span>
</template> </template>
</el-table-column> </el-table-column>-->
</el-table> </el-table>
<div v-show="!listLoading" class="pagination-container"> <div v-show="!listLoading" class="pagination-container">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" <el-pagination
:current-page.sync="listQuery.page" :page-sizes="[10,20,30, 50]" :page-size="listQuery.limit" @size-change="handleSizeChange"
layout="total, sizes, prev, pager, next, jumper" :total="total"></el-pagination> @current-change="handleCurrentChange"
</div> :current-page.sync="listQuery.page"
:page-sizes="[10,20,30, 50]"
:page-size="listQuery.limit"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
></el-pagination>
</div>
<!-- <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">--> <!-- <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">-->
<!-- <el-form :model="form" :rules="rules" ref="form" label-width="100px">--> <!-- <el-form :model="form" :rules="rules" ref="form" label-width="100px">-->
<!-- <el-form-item label="姓名" prop="name">--> <!-- <el-form-item label="姓名" prop="name">-->
<!-- <el-input v-model="form.name" placeholder="请输入姓名"></el-input>--> <!-- <el-input v-model="form.name" placeholder="请输入姓名"></el-input>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- </el-form>--> <!-- </el-form>-->
<!-- <div slot="footer" class="dialog-footer">--> <!-- <div slot="footer" class="dialog-footer">-->
<!-- <el-button @click="cancel('form')">取 消</el-button>--> <!-- <el-button @click="cancel('form')">取 消</el-button>-->
<!-- <el-button v-if="dialogStatus=='create'" type="primary" @click="create('form')">确 定</el-button>--> <!-- <el-button v-if="dialogStatus=='create'" type="primary" @click="create('form')">确 定</el-button>-->
<!-- <el-button v-else type="primary" @click="update('form')">确 定</el-button>--> <!-- <el-button v-else type="primary" @click="update('form')">确 定</el-button>-->
<!-- </div>--> <!-- </div>-->
<!-- </el-dialog>--> <!-- </el-dialog>-->
</div> </div>
</template> </template>
<style> <style>
.statistic_number { .statistic_number {
font-size: x-large; font-size: x-large;
font-weight: bolder; font-weight: bolder;
} }
.statistic_title { .statistic_title {
font-size: x-large; font-size: x-large;
} }
</style> </style>
<script> <script>
import {mapGetters} from 'vuex'; import { mapGetters } from 'vuex'
import { import {
page, page,
statistic statistic,
} from '../../../api/vehicle/departureLog'; findReserveType
import { } from '../../../api/vehicle/departureLog'
getAllCompany, import { getAllCompany, getAll } from 'api/base_info/branch_company/'
getAll import { getAllZone } from 'api/base_info/constant/'
} from 'api/base_info/branch_company/'; import { getAllBranchCompanyByZoneId } from 'api/order/rentVehicle'
import { import {
getAllZone toEast8Date,
} from 'api/base_info/constant/'; deepCopyDate,
import { newEast8Date,
getAllBranchCompanyByZoneId getYMD_date
} from 'api/order/rentVehicle'; } from 'utils/dateUtils'
import { export default {
toEast8Date, name: 'vehicleDepartureLog',
deepCopyDate, data() {
newEast8Date, return {
getYMD_date purpose:null,
} from 'utils/dateUtils'; showMoreMoreCol: false,
export default { form: {
name: 'vehicleDepartureLog', id: null,
data() { numberPlate: null,
return { vehicleId: null,
showMoreMoreCol: false, use: null,
form: { user: null,
id: null, userTel: null,
numberPlate: null, checkMan: null,
vehicleId: null, checkManTel: null,
use: null, recycleMan: null,
user: null, recycleManTel: null,
userTel: null, departureTime: null,
checkMan: null, arrivalTime: null,
checkManTel: null, mileageStart: null,
recycleMan: null, mileageEnd: null,
recycleManTel: null, state: null,
departureTime: null, allCompaniesArr: [],
arrivalTime: null, selectArry: []
mileageStart: null, },
mileageEnd: null, rules: {
state: null, name: [
allCompaniesArr:[], {
selectArry: [], required: true,
}, message: '请输入用户',
rules: { trigger: 'blur'
name: [ }
{ ]
required: true, },
message: '请输入用户', list: null,
trigger: 'blur' total: null,
} listLoading: true,
] allBranchCompany: [],
}, baranchQuery: {
list: null, zoneId: null
total: null, },
listLoading: true, allZoneArr: [], //全部片区
allBranchCompany:[], state1: '',
baranchQuery: { arrivalBranchCompanyId:null,
zoneId:null useArr:[],//用途
}, listQuery: {
allZoneArr:[],//全部片区 page: 1,
state1:'', limit: 20,
listQuery: { startTime: undefined,
page: 1, endTime: undefined,
limit: 20, numberPlate: undefined,
startTime: undefined, departureId: undefined,
endTime:undefined, arrivalBranchCompanyId: null,
numberPlate: undefined, use:null
departureId:undefined, },
}, dialogStatus: '',
dialogStatus: '', textMap: {
textMap: { update: '编辑',
update: '编辑', create: '创建'
create: '创建' },
}, tableKey: 0,
tableKey: 0, dialogFormVisible: null,
dialogFormVisible: null, statisticVisiable: true,
statisticVisiable: true, statisticData: {
statisticData: { departureCount: null,
departureCount: null, departureDay: null,
departureDay: null, departureMileage: null
departureMileage: null }
} }
} },
}, created() {
created() { let t = this
let t = this; const numberPlate = this.$route.query.numberPlate
const numberPlate = this.$route.query.numberPlate; if (numberPlate) {
if (numberPlate) { this.listQuery.numberPlate = numberPlate
this.listQuery.numberPlate = numberPlate; }
} getAll().then(response => {
getAll() .then(response => { this.allCompaniesArr = response.data
this.allCompaniesArr = response.data; let query = localStorage.getItem('vehicleDepartureLog')
let query = localStorage.getItem("vehicleDepartureLog"); if (query != 'null' && query && !numberPlate) {
if(query !="null" && query && !numberPlate){ this.listQuery = JSON.parse(query)
this.listQuery = JSON.parse(query); if (t.listQuery.departureId) {
if(t.listQuery.departureId){ t.allCompaniesArr.map(function(item) {
t.allCompaniesArr.map(function (item) { if (item.id == t.listQuery.departureId) {
if(item.id == t.listQuery.departureId){ t.state1 = item.name
t.state1 = item.name; }
} })
}); }
} }
} t.handleFilter()
t.handleFilter(); })
}) findReserveType().then(data=>{
}, this.useArr = JSON.parse(data.data).type
computed: { console.log(this.useArr);
...mapGetters([
'elements' })
]), },
//获取大区列表 computed: {
getAllZoneList() { ...mapGetters(['elements']),
return getAllZone(); //获取大区列表
}, getAllZoneList() {
}, return getAllZone()
methods: { }
/** },
* 重置 methods: {
* */ //收车公司筛选
reloadPage() { putCompanyChange(val) {
this.state1=''; if (val) {
this.listQuery = { this.listQuery.arrivalBranchCompanyId = val.id
page: 1, } else {
limit: 20, this.listQuery.arrivalBranchCompanyId = null
startTime: undefined, }
endTime:undefined, },
numberPlate: undefined, changeUse(val){
departureId:undefined, if(!val) this.listQuery.use = null
}; },
if(this.listQuery){ /**
localStorage.setItem("vehicleDepartureLog", JSON.stringify(this.listQuery)); * 重置
} * */
this.handleFilter(); reloadPage() {
}, this.state1 = ''
handleFilter() { this.arrivalBranchCompanyId = null
this.listQuery.page = 1 this.listQuery = {
if(this.listQuery){ page: 1,
localStorage.setItem("vehicleDepartureLog", JSON.stringify(this.listQuery)); limit: 20,
} startTime: undefined,
this.getList(); endTime: undefined,
if (this.listQuery.numberPlate) { numberPlate: undefined,
statistic({numberPlate: this.listQuery.numberPlate}).then(response => { departureId: undefined,
this.statisticData = response.data; arrivalBranchCompanyId: undefined,
}); use:undefined
this.statisticVisiable = true; }
} if (this.listQuery) {
}, localStorage.setItem(
dateToString: function (date) { 'vehicleDepartureLog',
var year = date.getFullYear(); JSON.stringify(this.listQuery)
var month = (date.getMonth() + 1).toString(); )
var day = (date.getDate()).toString(); }
if (month.length == 1) { this.handleFilter()
month = "0" + month; },
} handleFilter() {
if (day.length == 1) { this.listQuery.page = 1
day = "0" + day; if (this.listQuery) {
} localStorage.setItem(
var dateTime = year + "-" + month + "-" + day; 'vehicleDepartureLog',
return dateTime; JSON.stringify(this.listQuery)
}, )
getList() { }
this.listLoading = true; this.getList()
if (!this.listQuery.numberPlate) { if (this.listQuery.numberPlate) {
this.statisticVisiable = false; statistic({ numberPlate: this.listQuery.numberPlate }).then(
} response => {
if (this.listQuery.startTime) { if (response.status == 200) {
this.listQuery.startTime = getYMD_date(new Date(this.listQuery.startTime)); this.statisticData = response.data
} this.statisticVisiable = true
if(this.listQuery.endTime) { } else {
this.listQuery.endTime = getYMD_date(new Date(this.listQuery.endTime)); this.$message(response.message)
} }
if (!this.state1) { }
this.listQuery.departureId = undefined; )
} }
page(this.listQuery) },
.then(response => { dateToString: function(date) {
this.list = response.data.list; var year = date.getFullYear()
this.total = response.data.total; var month = (date.getMonth() + 1).toString()
this.listLoading = false; var day = date.getDate().toString()
}) if (month.length == 1) {
}, month = '0' + month
querySearch(queryString, cb) { }
let selectArry = []; if (day.length == 1) {
let iitem = { day = '0' + day
value: "全部", }
name: "全部" var dateTime = year + '-' + month + '-' + day
}; return dateTime
selectArry.push(iitem); },
this.allCompaniesArr.map(function (item) { getList() {
item.value = item.name; this.listLoading = true
selectArry.push(item); if (!this.listQuery.numberPlate) {
}); this.statisticVisiable = false
this.selectArry = selectArry; }
var results = queryString ? selectArry.filter(this.createFilter(queryString)) : selectArry; if (this.listQuery.startTime) {
// 调用 callback 返回建议列表的数据 this.listQuery.startTime = getYMD_date(
cb(results); new Date(this.listQuery.startTime)
}, )
createFilter(queryString) { }
return (restaurant) => { if (this.listQuery.endTime) {
return (restaurant.name.indexOf(queryString.toLowerCase()) != -1); this.listQuery.endTime = getYMD_date(
}; new Date(this.listQuery.endTime)
}, )
handleSelect(item) { }
if (item.value == "全部") { if (!this.state1) {
this.listQuery.departureId = undefined; this.listQuery.departureId = undefined
} else { }
this.listQuery.departureId = item.id; page(this.listQuery).then(response => {
} this.list = response.data.list
}, this.total = response.data.total
handleSizeChange(val) { this.listLoading = false
this.listQuery.limit = val; })
if(this.listQuery){ },
localStorage.setItem("vehicleDepartureLog", JSON.stringify(this.listQuery)); querySearch(queryString, cb) {
} let selectArry = []
this.getList(); let iitem = {
}, value: '全部',
handleCurrentChange(val) { name: '全部'
this.listQuery.page = val; }
if(this.listQuery){ selectArry.push(iitem)
localStorage.setItem("vehicleDepartureLog", JSON.stringify(this.listQuery)); this.allCompaniesArr.map(function(item) {
} item.value = item.name
this.getList(); selectArry.push(item)
}, })
} this.selectArry = selectArry
} var results = queryString
? selectArry.filter(this.createFilter(queryString))
: selectArry
// 调用 callback 返回建议列表的数据
cb(results)
},
createFilter(queryString) {
return restaurant => {
return restaurant.name.indexOf(queryString.toLowerCase()) != -1
}
},
handleSelect(item) {
if (item.value == '全部') {
this.listQuery.departureId = undefined
} else {
this.listQuery.departureId = item.id
}
},
handleSizeChange(val) {
this.listQuery.limit = val
if (this.listQuery) {
localStorage.setItem(
'vehicleDepartureLog',
JSON.stringify(this.listQuery)
)
}
this.getList()
},
handleCurrentChange(val) {
this.listQuery.page = val
if (this.listQuery) {
localStorage.setItem(
'vehicleDepartureLog',
JSON.stringify(this.listQuery)
)
}
this.getList()
}
}
}
</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