Commit 8c2532b0 authored by denghr's avatar denghr

购房车列表

parent 5a08a58c
import fetch from 'utils/fetch';
//根据大区Id获取分公司列表
export function getAllBranchCompanyByZoneId(query) {
return fetch({
url: '/vehicle/branchCompany/app/unauth/getByZone',
method: 'get',
params:query
});
}
/**
* 获取优惠券列表--优惠券列表
* @param query
*/
export function getCouponList(query) {
return fetch({
url: '/api/activity/admin/user_coupon/page',
method: 'Get',
params: query
});
}
\ No newline at end of file
......@@ -538,5 +538,20 @@ export const asyncRouterMap = [{
authority: 'activityList'
}
]
},
{
path: '/applyManagements',
component: Layout,
name: '申请管理',
icon: 'setting',
authority: 'applyManagements',
children: [
{
path: 'carApplyList',
component: _import('applyManagements/carApplyList'),
name: '购房车申请列表',
authority: 'carApplyList'
}
]
}
];
<template>
<div class="app-container calendar-list-container" v-loading.body="showLoadingBody">
<div>
<div class="filter-container" ref="filter-container">
<el-form ref="queryForm" :inline="inline" :model="listQuery" label-width="80px">
<el-row>
<el-form-item label="看车时间">
<el-date-picker v-model="starTimeStr" type = "date" placeholder = "开始时间" value-format=" yyyy-MM-dd" format="yyyy-MM-dd"></el-date-picker>
<span> - </span>
<el-date-picker v-model="endTimeStr" type = "date" placeholder = "结束时间" value-format=" yyyy-MM-dd" format="yyyy-MM-dd" :picker-options="newPeopelpickerOptionsEnd"></el-date-picker>
</el-form-item>
<el-form-item label="状态">
<el-select class="filter-item" v-model="listQuery.status" placeholder="请选择">
<el-option :key="undefined" label="无" :value="undefined"></el-option>
<el-option v-for="val in statusList" :key="val.id" :label="val.name" :value="val.id"> </el-option>
</el-select>
</el-form-item>
<el-form-item label="所属大区">
<el-select class="filter-item" v-model="listQuery.zoneId" placeholder="请选择" @change="getProvinceRegions">
<el-option :key="undefined" label="无" :value="undefined"></el-option>
<el-option v-for="val in getAllZoneList" :key="val.id" :label="val.name" :value="val.id"> </el-option>
</el-select>
</el-form-item>
<el-form-item label="所属公司">
<el-select class="filter-item" v-model="listQuery.liftCompany" placeholder="请选择" @change="getAllBranchCompanyChange">
<el-option :key="undefined" label="无" :value="undefined"></el-option>
<el-option v-for="val in allBranchCompany" :key="val.id" :label="val.name" :value="val.id"> </el-option>
</el-select>
</el-form-item>
<el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>
</el-row>
</el-form>
</div>
<el-table :key='tableKey' :data="list" border fit highlight-current-row
style="width: 100%;">
<el-table-column type="index" align="center" label="申请时间" width="200">
<template scope="scope">
<span>{{scope.row.crtTimeStr}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="状态" width="200">
<template scope="scope">
<span v-if="scope.row.status==0">未处理</span>
<span v-if="scope.row.status==1">已处理</span>
</template>
</el-table-column>
<el-table-column align="center" label="申请人" width="200">
<template scope="scope">
<span>{{scope.row.applyName}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="电话" width="200">
<template scope="scope">
<span>{{scope.row.applyPhone}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="看车时间" width="200">
<template scope="scope">
<span>{{scope.row.bookTimeStr}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="看车分公司" width="200">
<template scope="scope">
<span>{{scope.row.companyName}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="对接人/电话" width="300">
<template scope="scope">
<span>{{scope.row.contactName}}/{{scope.row.contactPhone}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="150" fixed="right">
<template scope="scope">
<el-button class="el-button el-button--text el-button--small" size="small" v-if="scope.row.status==0" @click="clickHandler">处理</el-button>
</template>
</el-table-column>
</el-table>
<div v-show="!listLoading" class="pagination-container">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:current-page.sync="listQuery.page" :page-sizes="[10,20,30,40,50]" :page-size="listQuery.limit"
layout="total, sizes, prev, pager, next, jumper" :total="total"></el-pagination>
</div>
</div>
</div>
</template>
<script>
import {
formatDate
} from 'utils/dateFormattor';
import {
toEast8Date,
deepCopyDate,
newEast8Date,
convertDate2Str,
timestamp2Date
} from 'utils/dateUtils';
import {mapGetters} from 'vuex';
import {
getToken
} from 'utils/auth';
import {
getCouponList,
getAllBranchCompanyByZoneId
} from 'api/applyManagements';
import {
getAllZone
} from 'api/base_info/constant/';
import Element1 from "../admin/menu/components/element";
import ElRow from "element-ui/packages/row/src/row";
import ElCol from "element-ui/packages/col/src/col";
export default {
name: 'carApplyList',
components: {
ElCol,
ElRow,
Element1,
},
data() {
return {
starTimeStr:'',
endTimeStr:'',
newPeopelpickerOptionsEnd: {
disabledDate: time => {
const beginDateVal = new Date(this.starTimeStr).getTime()
if (beginDateVal) {
return time.getTime() < beginDateVal
}
}
},
statusList: [
{
"name":'未处理',
"id":'0'
},
{
"name":'已处理',
"id":'1'
},
],
BASE_API: process.env.BASE_API,
showLoadingBody: false,
list: null,
total: null,
listLoading: true,
listQuery: {
page: 1,
limit: 20,
starTime:undefined,
endTime:undefined,
status:'',
zoneId:undefined,
liftCompany:undefined,
},
inline: true,
tableKey: 0,
baranchQuery: {
zoneId:null
},
allBranchCompany:[],
}
},
created() {
this.getList();
},
computed: {
...mapGetters([
'elements'
]),
//获取大区列表
getAllZoneList(){
return getAllZone();
},
},
methods: {
//监听change事件
getProvinceRegions(item) {
this.listQuery.zoneId = item
this.baranchQuery.zoneId = item
this.listQuery.liftCompany = undefined;
getAllBranchCompanyByZoneId(this.baranchQuery).then(response => {
this.allBranchCompany = response.data;
})
},
getAllBranchCompanyChange(item) {
this.listQuery.liftCompany = item
},
/**
* 获取列表
* */
getList() {
this.listLoading = true;
for(var key in this.listQuery){
if(this.listQuery[key]==''){
this.listQuery[key]=undefined
}
}
if(this.starTimeStr){
this.listQuery.startTime = new Date(this.starTimeStr).getTime();
}
if(this.endTimeStr){
this.listQuery.endTime = new Date(this.endTimeStr).getTime();
}
getCouponList(this.listQuery).then(response => {
let totalCountRs = undefined;
let listRs = undefined;
if (!this.$utils.isEmpty(response.data.data) && this.$utils.isInteger(response.data.totalCount)) {
listRs = response.data.data;
totalCountRs = response.data.totalCount;
listRs.map(function(item){
item.crtTimeStr = timestamp2Date(item.crtTime);
item.bookTimeStr = timestamp2Date(item.bookTime);
});
}
this.listLoading = false;
this.list = listRs;
this.total = totalCountRs;
})
},
handleFilter() {
this.listQuery.page = 1;
this.$refs.queryForm.validate(valid => {
if (valid) {
this.getList();
} else {
return false;
}
});
},
handleSizeChange(val) {
this.listQuery.limit = val;
this.getList();
},
handleCurrentChange(val) {
this.listQuery.page = val;
this.getList();
},
clickHandler(row){
this.$confirm('确定处理吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// delObjOne(row.id).then(response => {
// if (response.status == 200) {
// this.$notify({
// title: '成功',
// message: '处理成功',
// type: 'success',
// duration: 2000
// });
// this.getList();
// }else{
// this.$notify({
// title: '失败',
// message: response.message,
// type: 'error',
// duration: 2000
// });
// }
// });
})
},
}
}
</script>
......@@ -453,7 +453,7 @@
}
},
created() {
this.getList();
this.getList();
this.btn_del = this.elements['branchCompany/stockApply:btn_delete'];
this.order_btn_order_violcation_save = this.elements['order:btn_order_violcation_save'];
},
......
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