Commit 88e8a800 authored by hanfeng's avatar hanfeng

Merge remote-tracking branch 'origin/base-modify' into base-modify-hf

parents 8ff39948 e99278af
......@@ -123,3 +123,11 @@ export function downloadExcel(query) {
responseType: 'blob'
});
}
export function exportExcel(query) {
return fetch({
url: '/vehicle/VehicleInformationDownload/app/unauth/export',
method: 'get',
responseType: 'blob'
});
}
......@@ -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>
......
......@@ -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.activitiesName" placeholder="请输入描述"></el-input>
</el-form-item>
......
<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="60px">
<el-row>
<el-col :span="4">
<el-form-item label="手机号">
<el-input v-model.number="listQuery.phone" placeholder="请输入手机号"></el-input>
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="">
<el-select class="filter-item" v-model="listQuery.couponId" placeholder="请选择优惠券标题">
<el-option key="" label="" value=""> </el-option>
<el-option v-for="(item,index) in titleList" :key="index" :label="item.title" :value="item.id"> </el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="金额">
<el-input v-model.number="listQuery.usedAmount" placeholder="请输入金额"></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="">
<el-select class="filter-item" v-model="listQuery.status" placeholder="请输入状态">
<el-option v-for="(item,index) in typeOptions" :key="index" :label="item.name" :value="item.val"> </el-option>
</el-select>
</el-form-item>
</el-col>
<el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>
<el-button class="filter-item" type="primary" @click="giveCunpon" style="float: right;">+ 发券</el-button>
<!-- <el-button class="filter-item" type="primary" style="float: right;">+ 批量发券</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="ID" width="200">
<template scope="scope">
<span>{{scope.row.id}}</span>
</template>
</el-table-column>
<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="60px">
<el-row>
<el-form-item label="手机号">
<el-input v-model.number="listQuery.phone" placeholder="请输入手机号"></el-input>
</el-form-item>
<el-form-item label="优惠券">
<el-select class="filter-item" v-model="listQuery.couponId" placeholder="请选择优惠券标题">
<el-option key label value></el-option>
<el-option
v-for="(item,index) in titleList"
:key="index"
:label="item.title"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="金额">
<el-input v-model.number="listQuery.usedAmount" placeholder="请输入金额"></el-input>
</el-form-item>
<el-form-item label="状态">
<el-select class="filter-item" v-model="listQuery.status" placeholder="请输入状态">
<el-option
v-for="(item,index) in typeOptions"
:key="index"
:label="item.name"
:value="item.val"
></el-option>
</el-select>
</el-form-item>
<!-- <el-col :span="4"></el-col>
<el-col :span="3"></el-col>
<el-col :span="4"></el-col>
<el-col :span="4"></el-col> -->
<el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>
<el-button class="filter-item" type="primary" @click="giveCunpon" style="float: right;">+ 发券</el-button>
<!-- <el-button class="filter-item" type="primary" style="float: right;">+ 批量发券</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="ID" width="200">
<template scope="scope">
<span>{{scope.row.id}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="手机号">
<template scope="scope">
<span>{{scope.row.phone}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="手机号">
<template scope="scope">
<span>{{scope.row.phone}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="优惠券标题">
<template scope="scope">
<span>{{scope.row.title}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="优惠券标题">
<template scope="scope">
<span>{{scope.row.title}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="金额">
<template scope="scope">
<span>{{scope.row.usedAmount}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="领取时间">
<template scope="scope">
<span>{{scope.row.crtTimeStr}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="过期时间">
<template scope="scope">
<span>{{scope.row.validType == 3 ? '永久' : scope.row.expireTimeStr}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="状态">
<template scope="scope">
<span v-if="scope.row.isUse==1">已使用</span>
<span v-if="scope.row.isUse==0">未使用</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" style="color:red;" size="small" @click="deleteHandler(scope.row)">删除</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>
<el-dialog title="发券" :visible.sync="giveDialogVisible">
<el-form :model="formdata" :rules="rules" ref="form" label-width="110px">
<el-row>
<el-col :span="12">
<el-form-item label="手机号" prop="phone">
<el-input v-model="formdata.phone" placeholder="请输入手机号"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="选择优惠券" prop="couponId">
<el-select class="filter-item" v-model="formdata.couponId" placeholder="请选择优惠券">
<el-option key="" label="" value=""> </el-option>
<el-option v-for="(item,index) in titleList" :key="index" :label="item.title" :value="item.id"> </el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="添加张数" prop="couponNum">
<el-input v-model="formdata.couponNum" placeholder="请输入添加张数"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="add('form')">确认添加</el-button>
</div>
</el-dialog>
</div>
<el-table-column align="center" label="金额">
<template scope="scope">
<span>{{scope.row.usedAmount}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="领取时间">
<template scope="scope">
<span>{{scope.row.crtTimeStr}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="过期时间">
<template scope="scope">
<span>{{scope.row.validType == 3 ? '永久' : scope.row.expireTimeStr}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="状态">
<template scope="scope">
<span v-if="scope.row.isUse==1">已使用</span>
<span v-if="scope.row.isUse==0">未使用</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"
style="color:red;"
size="small"
@click="deleteHandler(scope.row)"
>删除</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>
<el-dialog title="发券" :visible.sync="giveDialogVisible">
<el-form :model="formdata" :rules="rules" ref="form" label-width="110px">
<el-row>
<el-col :span="12">
<el-form-item label="手机号" prop="phone">
<el-input v-model="formdata.phone" placeholder="请输入手机号"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="选择优惠券" prop="couponId">
<el-select class="filter-item" v-model="formdata.couponId" placeholder="请选择优惠券">
<el-option key label value></el-option>
<el-option
v-for="(item,index) in titleList"
:key="index"
:label="item.title"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="添加张数" prop="couponNum">
<el-input v-model="formdata.couponNum" placeholder="请输入添加张数"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="add('form')">确认添加</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
formatDate
} from 'utils/dateFormattor';
import { formatDate } from 'utils/dateFormattor'
import {
toEast8Date,
deepCopyDate,
newEast8Date,
convertDate2Str,
timestamp2Date
} from 'utils/dateUtils';
import {
toEast8Date,
deepCopyDate,
newEast8Date,
convertDate2Str,
timestamp2Date
} from 'utils/dateUtils'
import rsCode from '../../utils/rsCode';
import rsCode from '../../utils/rsCode'
import {mapGetters} from 'vuex';
import {
getToken
} from 'utils/auth';
import {
getTitle,
getCouponList,
giveObj,
delObjOne
} from 'api/cunponManagements';
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";
import { mapGetters } from 'vuex'
import { getToken } from 'utils/auth'
import {
getTitle,
getCouponList,
giveObj,
delObjOne
} from 'api/cunponManagements'
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: 'conponList',
components: {
ElCol,
ElRow,
Element1,
},
data() {
return {
titleList:[],
rules:{
phone: [
{
type: 'string',
required: true,
message: '请输入手机号',
trigger: 'blur'
},
{ pattern: /^1[3456789]\d{9}$/, message: '手机号码错误' }
],
couponNum: {
type: 'string',
required: true,
message: '请输入添加张数',
trigger: 'blur'
},
couponId:{
required: true,
message: '请选择优惠券',
}
},
giveDialogVisible:false,
typeOptions: [
{
"name":'已使用',
"val":'1'
},
{
"name":'未使用',
"val":'0'
},
],
BASE_API: process.env.BASE_API,
showLoadingBody: false,
list: null,
total: null,
listLoading: true,
listQuery: {
page: 1,
limit: 20,
couponId:'',//优惠券id
phone: '',//手机号
usedAmount: '',//金额
status:'0',//状态
},
inline: true,
tableKey: 0,
formdata:{
phone:'',
couponNum:'',
couponId:''
}
}
},
created() {
this.getList();
this.get_title();
},
computed: {
...mapGetters([
'elements'
])
},
methods: {
get_title(){
getTitle().then(response => {
this.titleList = response.data;
})
},
/**
* 获取列表
* */
getList() {
this.listLoading = true;
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.expireTimeStr = timestamp2Date(item.expireTime);
});
}
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();
},
add(formName) {
var that = this;
const set = this.$refs;
set[formName].validate(valid => {
if (valid) {
giveObj(that.formdata)
.then(response => {
if (response.status === 200) {
this.giveDialogVisible = false;
this.getList();
this.$notify({
title: '成功',
message: '发券成功',
type: 'success',
duration: 2000
});
} else {
this.$notify({
title: '失败',
message: rsCode.msg[response.code] ? rsCode.msg[response.code] : '操作失败!',
type: 'error',
duration: 2000
});
}
});
} else {
return false;
}
});
},
deleteHandler(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
});
}
});
})
},
giveCunpon(){
this.giveDialogVisible = true;
}
}
}
export default {
name: 'conponList',
components: {
ElCol,
ElRow,
Element1
},
data() {
return {
titleList: [],
rules: {
phone: [
{
type: 'string',
required: true,
message: '请输入手机号',
trigger: 'blur'
},
{ pattern: /^1[3456789]\d{9}$/, message: '手机号码错误' }
],
couponNum: {
type: 'string',
required: true,
message: '请输入添加张数',
trigger: 'blur'
},
couponId: {
required: true,
message: '请选择优惠券'
}
},
giveDialogVisible: false,
typeOptions: [
{
name: '已使用',
val: '1'
},
{
name: '未使用',
val: '0'
}
],
BASE_API: process.env.BASE_API,
showLoadingBody: false,
list: null,
total: null,
listLoading: true,
listQuery: {
page: 1,
limit: 20,
couponId: '', //优惠券id
phone: '', //手机号
usedAmount: '', //金额
status: '0' //状态
},
inline: true,
tableKey: 0,
formdata: {
phone: '',
couponNum: '',
couponId: ''
}
}
},
created() {
this.getList()
this.get_title()
},
computed: {
...mapGetters(['elements'])
},
methods: {
get_title() {
getTitle().then(response => {
this.titleList = response.data
})
},
/**
* 获取列表
* */
getList() {
this.listLoading = true
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.expireTimeStr = timestamp2Date(item.expireTime)
})
}
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()
},
add(formName) {
var that = this
const set = this.$refs
set[formName].validate(valid => {
if (valid) {
giveObj(that.formdata).then(response => {
if (response.status === 200) {
this.giveDialogVisible = false
this.getList()
this.$notify({
title: '成功',
message: '发券成功',
type: 'success',
duration: 2000
})
} else {
this.$notify({
title: '失败',
message: rsCode.msg[response.code]
? rsCode.msg[response.code]
: '操作失败!',
type: 'error',
duration: 2000
})
}
})
} else {
return false
}
})
},
deleteHandler(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
})
}
})
})
},
giveCunpon() {
this.giveDialogVisible = true
}
}
}
</script>
......@@ -28,7 +28,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-col :span="6">
<el-form-item label="创建时间">
<el-date-picker
v-model="createTime"
......@@ -39,7 +39,7 @@
<!-- <el-date-picker v-model="createTime" type="datetimerange" placeholder="选择时间范围" @change="changeCreate"></el-date-picker> -->
</el-form-item>
</el-col>
<el-col :span="5">
<el-col :span="6">
<el-form-item label="支付时间">
<!-- <el-date-picker v-model="aplyTime" type="datetimerange" placeholder="选择支付时间范围" @change="changePay"></el-date-picker> -->
<el-date-picker
......
......@@ -78,14 +78,14 @@
<p
v-if="orderDetailInfo.rentVehiclePriceVO && orderDetailInfo.rentVehiclePriceVO.vehicleDayNum > 0"
>¥{{orderDetailInfo.rentVehiclePriceVO.modelAmount}}*{{orderDetailInfo.rentVehiclePriceVO.vehicleNum}}/{{orderDetailInfo.rentVehiclePriceVO.vehicleDayNum}}</p>
<p v-else>{{orderDetailInfo.costDetail.children[0].key}} : {{orderDetailInfo.costDetail.children[0].detail}}</p>
<!-- <p v-else-if="orderDetailInfo.costDetail.children[0]">{{orderDetailInfo.costDetail.children[0].key}} : {{orderDetailInfo.costDetail.children[0].detail}}</p> -->
</td>
<td>
<p v-if="orderDetailInfo.rentVehiclePriceVO && orderDetailInfo.rentVehiclePriceVO.couponAmount > 0">
<span>{{orderDetailInfo.rentVehiclePriceVO.couponDesc}}-{{orderDetailInfo.rentVehiclePriceVO.couponAmount}}</span>
</p>
<p v-else-if="orderDetailInfo.costDetail.children && orderDetailInfo.costDetail.children[2]">{{orderDetailInfo.costDetail.children[2].key}} : {{orderDetailInfo.costDetail.children[2].val}}</p>
<!-- <p v-else-if="orderDetailInfo.costDetail.children && orderDetailInfo.costDetail.children[2]">{{orderDetailInfo.costDetail.children[2].key}} : {{orderDetailInfo.costDetail.children[2].val}}</p> -->
<p v-else></p>
</td>
<td>
......@@ -96,7 +96,7 @@
</td>
<td>
<p v-if="orderDetailInfo.rentVehiclePriceVO">{{orderDetailInfo.rentVehiclePriceVO.deposit}}</p>
<p v-else>{{orderDetailInfo.costDetail.children[1].key}} : {{orderDetailInfo.costDetail.children[1].val}}</p>
<!-- <p v-else-if="orderDetailInfo.costDetail.children[0]">{{orderDetailInfo.costDetail.children[1].key}} : {{orderDetailInfo.costDetail.children[1].val}}</p> -->
</td>
<td>
<p
......
......@@ -4,7 +4,7 @@
<div class="filter-container">
<el-form ref="queryForm" :model="listQuery" label-width="100px">
<el-row>
<el-col :span="5">
<el-col :span="6">
<el-form-item label="统计时间:">
<el-date-picker
v-model="listQuery.time"
......@@ -17,7 +17,7 @@
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="5">
<el-col :span="6">
<el-form-item label="统计方式:" class="wayMsg">
<span
v-for="(item,index) in way"
......
......@@ -1036,7 +1036,7 @@ export default {
}
orderDetail(param).then(response => {
this.orderDetailInfo = response.data
if(this.orderDetailInfo && this.orderDetailInfo.memberLevel) {
if(this.orderDetailInfo) {
if(this.orderDetailInfo.memberLevel == 1) {
this.orderDetailInfo.memberName = "普通会员"
}
......
......@@ -120,7 +120,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelHandel">取 消</el-button>
<el-button type="primary" @click="edit('dialogFrom')">确 定</el-button>
<el-button type="primary" @click="edit('dialogFrom')" :loading="submitBtn">确 定</el-button>
</div>
</el-dialog>
</div>
......@@ -155,6 +155,7 @@ export default {
},
data() {
return {
submitBtn:false,
time:[],//提现时间
typeOptions: [
{
......@@ -259,6 +260,7 @@ export default {
this.dialogVisible = true
},
edit(formName) {
var that = this
const set = this.$refs
set[formName].validate(valid => {
......@@ -285,6 +287,7 @@ export default {
}
}
if (valid) {
this.submitBtn = true;
editObj(that.dialogFrom).then(response => {
if (response.status === 200) {
this.dialogVisible = false
......@@ -295,6 +298,7 @@ export default {
type: 'success',
duration: 2000
})
this.submitBtn = false;
} else {
this.$notify({
title: '失败',
......@@ -304,6 +308,7 @@ export default {
type: 'error',
duration: 2000
})
this.submitBtn = false;
}
})
} else {
......
......@@ -4,16 +4,14 @@
<div class="filter-container" ref="filter-container">
<el-form ref="queryForm" :inline="inline" :model="listQuery" label-width="100px">
<el-row>
<el-col :span="5">
<el-form-item label="姓名">
<el-input v-model="listQuery.username" placeholder="请输入姓名"></el-input>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="手机号">
<el-input v-model.number="listQuery.phone" placeholder="请输入手机号"></el-input>
</el-form-item>
</el-col>
<el-form-item label="姓名">
<el-input v-model="listQuery.username" placeholder="请输入姓名"></el-input>
</el-form-item>
<el-form-item label="手机号">
<el-input v-model.number="listQuery.phone" placeholder="请输入手机号"></el-input>
</el-form-item>
<el-col :span="5"></el-col>
<el-col :span="5"></el-col>
<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="search" @click="clearFilter">清除搜索</el-button>
</el-row>
......@@ -32,11 +30,11 @@
</template>
</el-table-column>
<!-- <el-table-column width="200" align="center" label="佣金比例">
<!-- <el-table-column width="200" align="center" label="佣金比例">
<template scope="scope">
<span>{{scope.row.commissionRate+'%'}}</span>
</template>
</el-table-column> -->
</el-table-column>-->
<el-table-column width="200" align="center" label="总收益">
<template scope="scope">
......@@ -44,19 +42,18 @@
</template>
</el-table-column>
<el-table-column width="200" align="center" label="当前余额">
<el-table-column width="200" align="center" label="当前余额">
<template scope="scope">
<span>{{scope.row.balance}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="总提现">
<template scope="scope">
<span>{{scope.row.withdrawals}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="提现中">
<template scope="scope">
<span>{{scope.row.withdrawaling}}</span>
......@@ -71,7 +68,7 @@
<template scope="scope">
<span>{{scope.row.balance}}</span>
</template>
</el-table-column> -->
</el-table-column>-->
<!-- <el-table-column align="center" label="操作" fixed="right">
<template scope="scope">
<el-button
......@@ -80,7 +77,7 @@
@click="deposit(scope.row)"
>{{scope.row.isFrozen == 0 ? '禁止提现' : '允许提现'}}</el-button>
</template>
</el-table-column> -->
</el-table-column>-->
</el-table>
<div v-show="!listLoading" class="pagination-container">
<el-pagination
......@@ -151,8 +148,8 @@ export default {
},
methods: {
//清除搜索
clearFilter(){
this.listQuery.username = this.listQuery.phone = null;
clearFilter() {
this.listQuery.username = this.listQuery.phone = null
this.getList()
},
//提现
......
......@@ -3,12 +3,12 @@
<div class="filter-container">
<el-form ref="queryForm" :model="listQuery" label-width="100px">
<el-row>
<el-col :span="4">
<el-col :span="6">
<el-form-item label="手机号">
<el-input v-model.number="listQuery.username" placeholder="请输入手机号"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="16">
<el-form-item label="导入时间">
<el-date-picker
v-model="listQuery.startTime"
......
......@@ -861,6 +861,9 @@
if(queryJson.mobile){
t.listQuery.mobile = queryJson.mobile;
}
if(queryJson.realName){
t.listQuery.realName = queryJson.realName;
}
if(queryJson.memberLevel){
t.listQuery.memberLevel = queryJson.memberLevel;
}
......
......@@ -3,87 +3,79 @@
<div class="filter-container" ref="filter-container">
<el-form :rules="rules4Query" ref="queryForm" :inline="inline" :model="listQuery">
<el-row>
<el-col :span="5">
<el-form-item label="用途">
<el-select class="filter-item" v-model="listQuery.bookType" placeholder="请选择">
<el-option :key="undefined" label="全部" :value="undefined"></el-option>
<el-option v-for="val in bookTypeList" :key="val.id" :label="val.name" :value="val.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="车辆编码">
<el-input type="number" v-model.number="listQuery.code" placeholder="请输入车辆编码"></el-input>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="车牌号">
<el-input v-model="listQuery.numberPlate" placeholder="请输入车牌号"></el-input>
</el-form-item>
</el-col>
<el-col :span="5">
<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, key, index) in statusList " :key="val.code" :label="val.val"
:value="val.code"></el-option>-->
<el-option
v-for="(val, index) in statusList "
:key="index"
:label="val.val"
:value="val.code"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-form-item label="用途">
<el-select class="filter-item" v-model="listQuery.bookType" placeholder="请选择">
<el-option :key="undefined" label="全部" :value="undefined"></el-option>
<el-option v-for="val in bookTypeList" :key="val.id" :label="val.name" :value="val.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="车辆编码">
<el-input type="number" v-model.number="listQuery.code" placeholder="请输入车辆编码"></el-input>
</el-form-item>
<el-form-item label="车牌号">
<el-input v-model="listQuery.numberPlate" placeholder="请输入车牌号"></el-input>
</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, key, index) in statusList " :key="val.code" :label="val.val"
:value="val.code"></el-option>-->
<el-option
v-for="(val, index) in statusList "
:key="index"
:label="val.val"
:value="val.code"
></el-option>
</el-select>
</el-form-item>
<!-- <el-col :span="5"></el-col>
<el-col :span="5"></el-col>
<el-col :span="5"></el-col>
<el-col :span="5"></el-col> -->
</el-row>
<el-row>
<el-col :span="5">
<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-col>
<el-col :span="5">
<el-form-item label="提车公司" prop="subordinateBranch">
<el-autocomplete
class="inline-input"
v-model="listQuery.liftCompanyName"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
@select="handleSelect"
></el-autocomplete>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="提车时间" prop="bookStartDate4Query">
<el-date-picker
v-model="bookStartDate4Query"
type="month"
:editable="true"
format="yyyy-MM"
placeholder="请选择预约提车时间"
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="还车时间" prop="bookEndDate4Query">
<el-date-picker
v-model="bookEndDate4Query"
type="month"
:editable="true"
format="yyyy-MM"
placeholder="请选择预约还车时间"
></el-date-picker>
</el-form-item>
</el-col>
<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="提车公司" prop="subordinateBranch">
<el-autocomplete
class="inline-input"
v-model="listQuery.liftCompanyName"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
@select="handleSelect"
></el-autocomplete>
</el-form-item>
<el-form-item label="提车时间" prop="bookStartDate4Query">
<el-date-picker
v-model="bookStartDate4Query"
type="month"
:editable="true"
format="yyyy-MM"
placeholder="请选择预约提车时间"
></el-date-picker>
</el-form-item>
<el-form-item label="还车时间" prop="bookEndDate4Query">
<el-date-picker
v-model="bookEndDate4Query"
type="month"
:editable="true"
format="yyyy-MM"
placeholder="请选择预约还车时间"
></el-date-picker>
</el-form-item>
<!-- <el-col :span="5"></el-col>
<el-col :span="5"></el-col>
<el-col :span="5"></el-col>
<el-col :span="5"></el-col> -->
</el-row>
<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>
......@@ -91,13 +83,13 @@
</div>
<el-table
:key="tableKey"
:data="list"
v-loading.body="listLoading"
border
fit
highlight-current-row
style="width: 100%"
:key="tableKey"
:data="list"
v-loading.body="listLoading"
border
fit
highlight-current-row
style="width: 100%"
>
<el-table-column align="center" label="车牌号" width="110">
<template scope="scope">
......@@ -247,47 +239,47 @@
<template scope="scope">
<!-- <el-button size="small" type="success" @click="handleBookInfo(scope.row)">预订信息</el-button> -->
<el-button
size="small"
class="el-button el-button--text el-button--small"
v-if="scope.row.status==3"
@click="illegalInquiry(scope.row)"
size="small"
class="el-button el-button--text el-button--small"
v-if="scope.row.status==3"
@click="illegalInquiry(scope.row)"
>违章记录</el-button>
<el-button
v-if="bookRecord_btn_prove&&scope.row.status==1&&scope.row.bookType !=1"
size="small"
class="el-button el-button--text el-button--small"
@click="handleProve(scope.row)"
v-if="bookRecord_btn_prove&&scope.row.status==1&&scope.row.bookType !=1"
size="small"
class="el-button el-button--text el-button--small"
@click="handleProve(scope.row)"
>通过</el-button>
<el-button
v-if="bookRecord_btn_reject&&scope.row.status==1&&scope.row.bookType !=1"
size="small"
class="el-button el-button--text el-button--small"
style="color: red;"
@click="handleReject(scope.row)"
v-if="bookRecord_btn_reject&&scope.row.status==1&&scope.row.bookType !=1"
size="small"
class="el-button el-button--text el-button--small"
style="color: red;"
@click="handleReject(scope.row)"
>驳回</el-button>
<template v-if="scope.row.vehicleDepartureLogVo==undefined">
<el-button
v-if="bookRecord_btn_lift&&scope.row.liftStatus==1&&scope.row.status==2&&scope.row.bookType !=1"
size="small"
class="el-button el-button--text el-button--small"
@click="handleLift(scope.row)"
v-if="bookRecord_btn_lift&&scope.row.liftStatus==1&&scope.row.status==2&&scope.row.bookType !=1"
size="small"
class="el-button el-button--text el-button--small"
@click="handleLift(scope.row)"
>出车</el-button>
</template>
<template v-if="scope.row.vehicleDepartureLogVo!=undefined">
<el-button
v-if="bookRecord_btn_ret&&scope.row.vehicleDepartureLogVo.state==0&&scope.row.retStatus==1&&scope.row.bookType !=1"
size="small"
class="el-button el-button--text el-button--small"
@click="handleRet(scope.row)"
v-if="bookRecord_btn_ret&&scope.row.vehicleDepartureLogVo.state==0&&scope.row.retStatus==1&&scope.row.bookType !=1"
size="small"
class="el-button el-button--text el-button--small"
@click="handleRet(scope.row)"
>收车</el-button>
</template>
<template v-if="scope.row.vehicleDepartureLogVo==undefined">
<el-button
v-if="bookRecord_btn_unbook&&scope.row.status==2&&scope.row.bookType !=1"
size="small"
class="el-button el-button--text el-button--small"
style="color: red;"
@click="handleUnbook(scope.row)"
v-if="bookRecord_btn_unbook&&scope.row.status==2&&scope.row.bookType !=1"
size="small"
class="el-button el-button--text el-button--small"
style="color: red;"
@click="handleUnbook(scope.row)"
>取消预定</el-button>
</template>
</template>
......@@ -296,13 +288,13 @@
<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"
@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>
......@@ -409,7 +401,7 @@
<el-col :span="8">
<el-form-item label="操作时间">
<span
v-if="detailItem.vehicleDepartureLogVo"
v-if="detailItem.vehicleDepartureLogVo"
>{{detailItem.vehicleDepartureLogVo.departureTime}}</span>
</el-form-item>
</el-col>
......@@ -418,7 +410,7 @@
<el-col :span="24">
<el-form-item label="提车公里数">
<span
v-if="detailItem.vehicleDepartureLogVo"
v-if="detailItem.vehicleDepartureLogVo"
>{{detailItem.vehicleDepartureLogVo.mileageStart?detailItem.vehicleDepartureLogVo.mileageStart+'KM':''}}</span>
</el-form-item>
</el-col>
......@@ -438,7 +430,7 @@
<el-card>
<img :src="item" class="image" />
</el-card>
</el-col> -->
</el-col>-->
</el-row>
<hr />
<el-row>
......@@ -446,11 +438,11 @@
<el-form-item label="还车分公司">
<span>{{detailItem.retCompanyName}}</span>
<el-button
size="mini"
type="primary"
style="padding: 7px 9px;"
@click="resetReturn = true"
v-show="detailItem.status == 2 || detailItem.status == 5"
size="mini"
type="primary"
style="padding: 7px 9px;"
@click="resetReturn = true"
v-show="detailItem.status == 2 || detailItem.status == 5"
>更换</el-button>
</el-form-item>
</el-col>
......@@ -462,7 +454,7 @@
<el-col :span="8">
<el-form-item label="操作时间">
<span
v-if="detailItem.vehicleDepartureLogVo"
v-if="detailItem.vehicleDepartureLogVo"
>{{detailItem.vehicleDepartureLogVo.arrivalTime}}</span>
</el-form-item>
</el-col>
......@@ -471,7 +463,7 @@
<el-col :span="24">
<el-form-item label="还车公里数">
<span
v-if="detailItem.vehicleDepartureLogVo"
v-if="detailItem.vehicleDepartureLogVo"
>{{detailItem.vehicleDepartureLogVo.mileageEnd?detailItem.vehicleDepartureLogVo.mileageEnd+'KM':''}}</span>
</el-form-item>
</el-col>
......@@ -490,7 +482,7 @@
<el-card>
<img :src="item" class="image" />
</el-card>
</el-col> -->
</el-col>-->
</el-row>
<hr />
<el-row>
......@@ -539,39 +531,39 @@
<!-- 出车对话框相关html元素 -->
<el-dialog title="出车" :visible.sync="dialogForm4LiftVisible">
<el-form
:model="departureForm"
:rules="departureFormrules"
ref="departureForm"
label-width="120px"
:model="departureForm"
:rules="departureFormrules"
ref="departureForm"
label-width="120px"
>
<el-form-item label="车牌号">
<el-input v-model="departureForm.numberPlate" disabled></el-input>
</el-form-item>
<el-form-item label="出车时间">
<el-date-picker
v-model="departureForm.departureDate"
type="date"
disabled
format="yyyy-MM-dd"
placeholder="选择日期"
v-model="departureForm.departureDate"
type="date"
disabled
format="yyyy-MM-dd"
placeholder="选择日期"
></el-date-picker>
</el-form-item>
<el-form-item label="出车分公司">
<el-autocomplete
class="inline-input"
v-model="departureForm.departureBranchCompanyName"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
disabled
class="inline-input"
v-model="departureForm.departureBranchCompanyName"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
disabled
></el-autocomplete>
</el-form-item>
<el-form-item label="目的地分公司" prop="expectArrivalBranchCompanyName">
<el-autocomplete
class="inline-input"
v-model="departureForm.expectArrivalBranchCompanyName"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
disabled
class="inline-input"
v-model="departureForm.expectArrivalBranchCompanyName"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
disabled
></el-autocomplete>
</el-form-item>
<el-form-item label="用途">
......@@ -599,13 +591,13 @@
<el-col>
<el-form-item label="出车截图" :style="{display:'block'}" required>
<el-upload
class="upload-demo"
:headers="getHeaderWithToken"
:action="BASE_API+'/api/universal/file/app/unauth/admin/upload'"
:on-remove="handleDepartureRemove"
:file-list="departurePicList"
:on-success="handleDepartureSuccess"
list-type="picture-card"
class="upload-demo"
:headers="getHeaderWithToken"
:action="BASE_API+'/api/universal/file/app/unauth/admin/upload'"
:on-remove="handleDepartureRemove"
:file-list="departurePicList"
:on-success="handleDepartureSuccess"
list-type="picture-card"
>
<i class="el-icon-plus"></i>
</el-upload>
......@@ -627,20 +619,20 @@
</el-form-item>
<el-form-item label="收车时间">
<el-date-picker
v-model="arrivalForm.arrivalDate"
type="date"
disabled
format="yyyy-MM-dd"
placeholder="选择日期"
v-model="arrivalForm.arrivalDate"
type="date"
disabled
format="yyyy-MM-dd"
placeholder="选择日期"
></el-date-picker>
</el-form-item>
<el-form-item label="还车分公司">
<el-autocomplete
class="inline-input"
v-model="arrivalForm.arrivalBranchCompanyName"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
disabled
class="inline-input"
v-model="arrivalForm.arrivalBranchCompanyName"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
disabled
></el-autocomplete>
</el-form-item>
<el-form-item label="收车人" prop="recycleMan">
......@@ -659,13 +651,13 @@
<el-col>
<el-form-item label="收车截图" :style="{display:'block'}" required>
<el-upload
class="upload-demo"
:headers="getHeaderWithToken"
:action="BASE_API+'/api/universal/file/app/unauth/admin/upload'"
:on-remove="handleArrivalRemove"
:file-list="arrivalPicList"
:on-success="handleArrivalSuccess"
list-type="picture-card"
class="upload-demo"
:headers="getHeaderWithToken"
:action="BASE_API+'/api/universal/file/app/unauth/admin/upload'"
:on-remove="handleArrivalRemove"
:file-list="arrivalPicList"
:on-success="handleArrivalSuccess"
list-type="picture-card"
>
<i class="el-icon-plus"></i>
</el-upload>
......@@ -685,13 +677,13 @@
<el-col>
<el-form-item label="违章截图" :style="{display:'block'}">
<el-upload
class="upload-demo"
:headers="getHeaderWithToken"
:action="BASE_API+'/api/universal/file/app/unauth/admin/upload'"
:on-remove="handleRemove"
:file-list="fileList2"
:on-success="handleSuccess"
list-type="picture-card"
class="upload-demo"
:headers="getHeaderWithToken"
:action="BASE_API+'/api/universal/file/app/unauth/admin/upload'"
:on-remove="handleRemove"
:file-list="fileList2"
:on-success="handleSuccess"
list-type="picture-card"
>
<i class="el-icon-plus"></i>
</el-upload>
......@@ -702,10 +694,10 @@
<el-col>
<el-form-item label="违章罚款">
<el-input
v-model="price"
type="number"
placeholder="请输入违章罚款金额"
style="width: 50%;margin-right:10px"
v-model="price"
type="number"
placeholder="请输入违章罚款金额"
style="width: 50%;margin-right:10px"
></el-input>
</el-form-item>
</el-col>
......@@ -720,1230 +712,1236 @@
</template>
<script>
import {
page,
prove,
reject,
getObj,
lift,
ret,
unbook,
getOneIllegalRow,
saveOrderViolation,
departureVehicle,
arrivalVehicle
} from 'api/vehicle/bookRecord'
import {
page,
prove,
reject,
getObj,
lift,
ret,
unbook,
getOneIllegalRow,
saveOrderViolation,
departureVehicle,
arrivalVehicle
} from 'api/vehicle/bookRecord'
import {
getAllCompany,
getAll,
updateById
} from 'api/base_info/branch_company/'
import { getAllZone } from 'api/base_info/constant/'
import { getAllBranchCompanyByZoneId } from 'api/order/rentVehicle'
import { formatDate } from 'utils/dateFormattor'
import {
getAllCompany,
getAll,
updateById
} from 'api/base_info/branch_company/'
import { getAllZone } from 'api/base_info/constant/'
import { getAllBranchCompanyByZoneId } from 'api/order/rentVehicle'
import { formatDate } from 'utils/dateFormattor'
import rsCode from '../../../utils/rsCode'
import rsCode from '../../../utils/rsCode'
import { mapGetters } from 'vuex'
import { mapGetters } from 'vuex'
import { toEast8Date, deepCopyDate, newEast8Date } from 'utils/dateUtils'
import { getToken } from '../../../utils/auth'
import {
BOOK_RECORD_STATUS_APPLY,
BOOK_RECORD_STATUS_PROVED,
BOOK_RECORD_STATUS_LIFT
} from '../../../store/modules/baseInfo'
import { toEast8Date, deepCopyDate, newEast8Date } from 'utils/dateUtils'
import { getToken } from '../../../utils/auth'
import {
BOOK_RECORD_STATUS_APPLY,
BOOK_RECORD_STATUS_PROVED,
BOOK_RECORD_STATUS_LIFT
} from '../../../store/modules/baseInfo'
import bookInfoViewer from '../bookInfoViewer'
import accItemSelector from '../accompanyingItem/accItemSelector.vue'
import bookInfoViewer from '../bookInfoViewer'
import accItemSelector from '../accompanyingItem/accItemSelector.vue'
export default {
name: 'bookRecord',
components: {
bookInfoViewer,
accItemSelector
},
data() {
return {
returnForm: {
retCompany: ''
},
allCompaniesArr: [],
resetReturn: false, //更改换成地点loading
rejectVisible: false,
rejectFrom: {
vehicleBookRecordId: '',
rejectRemark: ''
export default {
name: 'bookRecord',
components: {
bookInfoViewer,
accItemSelector
},
data() {
return {
returnForm: {
retCompany: ''
},
allCompaniesArr: [],
resetReturn: false, //更改换成地点loading
rejectVisible: false,
rejectFrom: {
vehicleBookRecordId: '',
rejectRemark: ''
},
rejectRules: {
rejectRemark: {
type: 'string',
required: true,
message: '请输入拒绝原因',
trigger: 'blur'
}
},
BASE_API: process.env.BASE_API,
departureFormrules: {
checkMan: {
required: true,
message: '请输入验车人',
trigger: 'blur'
},
rejectRules: {
rejectRemark: {
type: 'string',
checkManTel: [
{
required: true,
message: '请输入拒绝原因',
message: '请输入验车人联系方式',
trigger: 'blur'
},
{
pattern: /^1[3456789]\d{9}$/,
message: '请输入正确的手机号'
}
],
mileage: {
type: 'number',
required: true,
message: '请输入公里数',
trigger: 'blur'
}
},
departureForm: {
vehicleId: null,
departureBranchCompanyId: null, //出发地分公司id
departureBranchCompanyName: '', //出发地分公司名称
use: null,
user: null,
userTel: null,
checkMan: null,
checkManTel: null,
mileage: null,
numberPlate: null,
expectArrivalBranchCompanyId: null, //目的地分公司id
expectArrivalBranchCompanyName: '', //目的地分公司名称
bookRecordId: null,
departurePic: '',
remark: null,
bookStartDate: null
},
departurePicList: [],
arrivalPicList: [],
arrivalForm: {
vehicleId: null,
numberPlate: null,
arrivalDate: null,
recycleMan: null,
recycleManTel: null,
mileage: null,
arrivalBranchCompanyId: null,
arrivalBranchCompanyName: '',
arrivalPic: '',
remark: '',
bookRecordId: null
},
arrivalFormrules: {
recycleMan: {
required: true,
message: '请输入收车人',
trigger: 'blur'
},
BASE_API: process.env.BASE_API,
departureFormrules: {
checkMan: {
recycleManTel: [
{
required: true,
message: '请输入验车人',
message: '请输入收车人联系方式',
trigger: 'blur'
},
checkManTel: [
{
required: true,
message: '请输入验车人联系方式',
trigger: 'blur'
},
{
pattern: /^1[3456789]\d{9}$/,
message: '请输入正确的手机号'
}
],
mileage: {
type: 'number',
required: true,
message: '请输入公里数',
trigger: 'blur'
{
pattern: /^1[3456789]\d{9}$/,
message: '请输入正确的手机号'
}
],
mileage: {
type: 'number',
required: true,
message: '请输入收车公里数',
trigger: 'blur'
}
},
statusList: [
{
code: '1',
val: '申请中'
},
departureForm: {
vehicleId: null,
departureBranchCompanyId: null, //出发地分公司id
departureBranchCompanyName: '', //出发地分公司名称
use: null,
user: null,
userTel: null,
checkMan: null,
checkManTel: null,
mileage: null,
numberPlate: null,
expectArrivalBranchCompanyId: null, //目的地分公司id
expectArrivalBranchCompanyName: '', //目的地分公司名称
bookRecordId: null,
departurePic: '',
remark: null,
bookStartDate: null
{
code: '3',
val: '待出行'
},
departurePicList: [],
arrivalPicList: [],
arrivalForm: {
vehicleId: null,
numberPlate: null,
arrivalDate: null,
recycleMan: null,
recycleManTel: null,
mileage: null,
arrivalBranchCompanyId: null,
arrivalBranchCompanyName: '',
arrivalPic: '',
remark: '',
bookRecordId: null
{
code: '4',
val: '驳回'
},
arrivalFormrules: {
recycleMan: {
required: true,
message: '请输入收车人',
trigger: 'blur'
},
recycleManTel: [
{
required: true,
message: '请输入收车人联系方式',
trigger: 'blur'
},
{
pattern: /^1[3456789]\d{9}$/,
message: '请输入正确的手机号'
}
],
mileage: {
type: 'number',
required: true,
message: '请输入收车公里数',
trigger: 'blur'
}
{
code: '5',
val: '出行中'
},
statusList: [
{
code: '1',
val: '申请中'
},
{
code: '3',
val: '待出行'
},
{
code: '4',
val: '驳回'
},
{
code: '5',
val: '出行中'
},
{
code: '6',
val: '取消预订'
},
{
code: '6',
val: '取消预订'
},
{
code: '7',
val: '已完成'
}
],
activeId: '',
bookTypeList: [
{
id: '1',
name: '租车'
},
{
id: '2',
name: '用户租赁'
},
{
id: '3',
name: '维修'
},
{
id: '4',
name: '展览'
},
{
id: '5',
name: '旅游'
},
{
id: '6',
name: '保养'
},
{
id: '7',
name: '预约中'
},
{
id: '8',
name: '禁用'
},
{
id: '9',
name: '客户用车'
},
{
id: '10',
name: '其他'
}
],
detailId: '',
illegalVisible: false,
price: undefined, //违章罚款金额
fileList2: [], //违章截图
detailItem: {},
dialogDetailVisible: false,
baranchQuery: {
zoneId: null
},
allZoneArr: [], //全部片区
allBranchCompany: [],
state2: '', //搜索-分公司名称
rules4Query: {},
list: null,
total: null,
listLoading: true,
listQuery: {
page: 1,
limit: 20,
flag: false,
zoneId: undefined,
liftCompany: undefined,
liftCompanyName: '',
numberPlate: undefined,
selectedMonth: undefined,
status: undefined,
bookType: undefined,
bookStartDate: undefined,
bookEndDate: undefined
},
inline: true,
dialogFormVisible: false,
dialogStatus: '',
bookRecord_btn_prove: false,
bookRecord_btn_unbook: false,
bookRecord_btn_reject: false,
bookRecord_btn_lift: false,
bookRecord_btn_ret: false,
dialogForm4LiftVisible: false,
dialogForm4RetVisible: false,
allCompanies: {},
tableKey: 0,
form4Lift: {
state1: '',
id: undefined,
mileageLift: undefined,
liftCompany: undefined,
liftRemark: undefined
},
rules4Lift: {
liftCompany: [
{
code: '7',
val: '已完成'
required: true,
message: '请选择提车分公司',
trigger: 'blur',
type: 'integer'
}
],
activeId: '',
bookTypeList: [
mileageLift: [
{
id: '1',
name: '租车'
},
{
id: '2',
name: '用户租赁'
},
{
id: '3',
name: '维修'
},
{
id: '4',
name: '展览'
},
{
id: '5',
name: '旅游'
required: true,
message: '请输入当前里程数',
trigger: 'blur',
type: 'integer'
},
{
id: '6',
name: '保养'
},
validator: (rule, value, callback) => {
if (
this.$utils.isUndefined(value) ||
this.$utils.isNull(value)
) {
return callback()
}
if (!this.$utils.isInteger(value)) {
return callback(new Error('里程数必须为整数'))
}
if (value < 0 || value > 9999999999) {
return callback(
new Error(
'里程数合法范围:[0 - 9999999999]'
)
)
}
callback()
},
trigger: 'blur'
}
],
retRemark: [
{
id: '7',
name: '预约中'
},
min: 0,
max: 2000,
message: '长度小于 2000 个字符',
trigger: 'blur'
}
]
},
form4Ret: {
id: undefined,
mileageRet: undefined,
haveViolation: undefined,
retCompany: undefined,
retRemark: undefined
},
rules4Ret: {
retCompany: [
{
id: '8',
name: '禁用'
},
required: true,
message: '请选择提车分公司',
trigger: 'blur',
type: 'integer'
}
],
mileageRet: [
{
id: '9',
name: '客户用车'
required: true,
message: '请输入当前里程数',
trigger: 'blur',
type: 'integer'
},
{
id: '10',
name: '其他'
}
],
detailId: '',
illegalVisible: false,
price: undefined, //违章罚款金额
fileList2: [], //违章截图
detailItem: {},
dialogDetailVisible: false,
baranchQuery: {
zoneId: null
},
allZoneArr: [], //全部片区
allBranchCompany: [],
state2: '', //搜索-分公司名称
rules4Query: {},
list: null,
total: null,
listLoading: true,
listQuery: {
page: 1,
limit: 20,
flag: false,
zoneId: undefined,
liftCompany: undefined,
liftCompanyName: "",
numberPlate: undefined,
selectedMonth: undefined,
status: undefined,
bookType: undefined,
bookStartDate: undefined,
bookEndDate: undefined
},
inline: true,
dialogFormVisible: false,
dialogStatus: '',
bookRecord_btn_prove: false,
bookRecord_btn_unbook: false,
bookRecord_btn_reject: false,
bookRecord_btn_lift: false,
bookRecord_btn_ret: false,
dialogForm4LiftVisible: false,
dialogForm4RetVisible: false,
allCompanies: {},
tableKey: 0,
form4Lift: {
state1: '',
id: undefined,
mileageLift: undefined,
liftCompany: undefined,
liftRemark: undefined
},
rules4Lift: {
liftCompany: [
{
required: true,
message: '请选择提车分公司',
trigger: 'blur',
type: 'integer'
}
],
mileageLift: [
{
required: true,
message: '请输入当前里程数',
trigger: 'blur',
type: 'integer'
},
{
validator: (rule, value, callback) => {
if (
this.$utils.isUndefined(value) ||
this.$utils.isNull(value)
) {
return callback()
}
if (!this.$utils.isInteger(value)) {
return callback(new Error('里程数必须为整数'))
}
if (value < 0 || value > 9999999999) {
return callback(
new Error(
'里程数合法范围:[0 - 9999999999]'
)
validator: (rule, value, callback) => {
if (
this.$utils.isUndefined(value) ||
this.$utils.isNull(value)
) {
return callback()
}
if (!this.$utils.isInteger(value)) {
return callback(new Error('里程数必须为整数'))
}
if (value < 0 || value > 9999999999) {
return callback(
new Error(
'里程数合法范围:[0 - 9999999999]'
)
}
callback()
},
trigger: 'blur'
}
],
retRemark: [
{
min: 0,
max: 2000,
message: '长度小于 2000 个字符',
trigger: 'blur'
}
]
},
form4Ret: {
id: undefined,
mileageRet: undefined,
haveViolation: undefined,
retCompany: undefined,
retRemark: undefined
},
rules4Ret: {
retCompany: [
{
required: true,
message: '请选择提车分公司',
trigger: 'blur',
type: 'integer'
}
],
mileageRet: [
{
required: true,
message: '请输入当前里程数',
trigger: 'blur',
type: 'integer'
)
}
callback()
},
{
validator: (rule, value, callback) => {
if (
this.$utils.isUndefined(value) ||
this.$utils.isNull(value)
) {
return callback()
}
if (!this.$utils.isInteger(value)) {
return callback(new Error('里程数必须为整数'))
}
if (value < 0 || value > 9999999999) {
return callback(
new Error(
'里程数合法范围:[0 - 9999999999]'
)
)
}
callback()
},
trigger: 'blur'
}
],
retRemark: [
{
min: 0,
max: 2000,
message: '长度小于 2000 个字符',
trigger: 'blur'
}
]
},
selectedAccItem: undefined
}
},
created() {
let t = this;
getAll().then(response => {
this.allCompaniesArr = response.data;
let query = localStorage.getItem("bookRecord");
if(query !="null" && query){
let queryJson = JSON.parse(query);
if(queryJson.page){
t.listQuery.page = queryJson.page;
}
if(queryJson.limit){
t.listQuery.limit = queryJson.limit;
}
if(queryJson.flag){
t.listQuery.flag = queryJson.flag;
}
if(queryJson.zoneId){
t.listQuery.zoneId = queryJson.zoneId;
}
if(queryJson.liftCompany){
t.listQuery.liftCompany = queryJson.liftCompany;
}
if(queryJson.liftCompanyName){
t.listQuery.liftCompanyName = queryJson.liftCompanyName;
}
if(queryJson.numberPlate){
t.listQuery.numberPlate = queryJson.numberPlate;
}
if(queryJson.selectedMonth){
t.listQuery.selectedMonth = queryJson.selectedMonth;
}
if(queryJson.status){
t.listQuery.status = queryJson.status;
trigger: 'blur'
}
if(queryJson.bookType){
t.listQuery.bookType = queryJson.bookType;
],
retRemark: [
{
min: 0,
max: 2000,
message: '长度小于 2000 个字符',
trigger: 'blur'
}
// if(queryJson.liftCompany){
// t.allCompaniesArr.map(function (item) {
// if(item.id == queryJson.liftCompany){
// t.listQuery.liftCompanyName = item.name;
// }
// });
// }
]
},
selectedAccItem: undefined
}
},
created() {
let t = this
getAll().then(response => {
this.allCompaniesArr = response.data
let query = localStorage.getItem('bookRecord')
if (query != 'null' && query) {
let queryJson = JSON.parse(query)
if (queryJson.page) {
t.listQuery.page = queryJson.page
}
this.getList()
});
getAllCompany(codeAndBranchCompany => {
//初始化公司列表
this.allCompanies = codeAndBranchCompany
});
this.bookRecord_btn_prove = this.elements['bookRecord:btn_prove']
this.bookRecord_btn_reject = this.elements['bookRecord:btn_reject']
this.bookRecord_btn_unbook = this.elements['bookRecord:btn_unbook']
this.bookRecord_btn_lift = this.elements['bookRecord:btn_lift']
this.bookRecord_btn_ret = this.elements['bookRecord:btn_ret']
if (queryJson.limit) {
t.listQuery.limit = queryJson.limit
}
if (queryJson.flag) {
t.listQuery.flag = queryJson.flag
}
if (queryJson.zoneId) {
t.listQuery.zoneId = queryJson.zoneId
}
if (queryJson.liftCompany) {
t.listQuery.liftCompany = queryJson.liftCompany
}
if (queryJson.liftCompanyName) {
t.listQuery.liftCompanyName = queryJson.liftCompanyName
}
if (queryJson.numberPlate) {
t.listQuery.numberPlate = queryJson.numberPlate
}
if (queryJson.selectedMonth) {
t.listQuery.selectedMonth = queryJson.selectedMonth
}
if (queryJson.status) {
t.listQuery.status = queryJson.status
}
if (queryJson.bookType) {
t.listQuery.bookType = queryJson.bookType
}
// if(queryJson.liftCompany){
// t.allCompaniesArr.map(function (item) {
// if(item.id == queryJson.liftCompany){
// t.listQuery.liftCompanyName = item.name;
// }
// });
// }
}
this.getList()
})
getAllCompany(codeAndBranchCompany => {
//初始化公司列表
this.allCompanies = codeAndBranchCompany
})
this.bookRecord_btn_prove = this.elements['bookRecord:btn_prove']
this.bookRecord_btn_reject = this.elements['bookRecord:btn_reject']
this.bookRecord_btn_unbook = this.elements['bookRecord:btn_unbook']
this.bookRecord_btn_lift = this.elements['bookRecord:btn_lift']
this.bookRecord_btn_ret = this.elements['bookRecord:btn_ret']
},
computed: {
...mapGetters(['elements', 'bookRecordStatus']),
getHeaderWithToken() {
return { Authorization: getToken() }
},
computed: {
...mapGetters(['elements', 'bookRecordStatus']),
getHeaderWithToken() {
return { Authorization: getToken() }
},
//获取大区列表
getAllZoneList() {
return getAllZone()
},
selectedMonth4Query: {
get: function() {
if (
this.$utils.isString(this.listQuery.selectedMonth) &&
this.listQuery.selectedMonth !== ''
) {
return toEast8Date(this.listQuery.selectedMonth)
}
return undefined
},
set: function(date) {
if (this.$utils.isDate(date)) {
this.listQuery.selectedMonth = formatDate(date, 'yyyy-MM')
} else {
this.listQuery.selectedMonth = undefined
}
//获取大区列表
getAllZoneList() {
return getAllZone()
},
selectedMonth4Query: {
get: function() {
if (
this.$utils.isString(this.listQuery.selectedMonth) &&
this.listQuery.selectedMonth !== ''
) {
return toEast8Date(this.listQuery.selectedMonth)
}
return undefined
},
bookStartDate4Query: {
get: function() {
if (
this.$utils.isString(this.listQuery.bookStartDate) &&
this.listQuery.bookStartDate !== ''
) {
return toEast8Date(this.listQuery.bookStartDate)
}
return undefined
},
set: function(date) {
if (this.$utils.isDate(date)) {
this.listQuery.bookStartDate = formatDate(date, 'yyyy-MM')
} else {
this.listQuery.bookStartDate = undefined
}
set: function(date) {
if (this.$utils.isDate(date)) {
this.listQuery.selectedMonth = formatDate(date, 'yyyy-MM')
} else {
this.listQuery.selectedMonth = undefined
}
}
},
bookStartDate4Query: {
get: function() {
if (
this.$utils.isString(this.listQuery.bookStartDate) &&
this.listQuery.bookStartDate !== ''
) {
return toEast8Date(this.listQuery.bookStartDate)
}
return undefined
},
bookEndDate4Query: {
get: function() {
if (
this.$utils.isString(this.listQuery.bookEndDate) &&
this.listQuery.bookEndDate !== ''
) {
return toEast8Date(this.listQuery.bookEndDate)
}
return undefined
},
set: function(date) {
if (this.$utils.isDate(date)) {
this.listQuery.bookEndDate = formatDate(date, 'yyyy-MM')
} else {
this.listQuery.bookEndDate = undefined
}
set: function(date) {
if (this.$utils.isDate(date)) {
this.listQuery.bookStartDate = formatDate(date, 'yyyy-MM')
} else {
this.listQuery.bookStartDate = undefined
}
}
},
methods: {
/**
* 重置
* */
reloadPage() {
this.listQuery = {
page: 1,
limit: 20,
flag: false,
zoneId: undefined,
liftCompany: undefined,
liftCompanyName: "",
numberPlate: undefined,
selectedMonth: undefined,
status: undefined,
bookType: undefined,
bookStartDate: undefined,
bookEndDate: undefined
};
if(this.listQuery){
localStorage.setItem("bookRecord", JSON.stringify(this.listQuery));
bookEndDate4Query: {
get: function() {
if (
this.$utils.isString(this.listQuery.bookEndDate) &&
this.listQuery.bookEndDate !== ''
) {
return toEast8Date(this.listQuery.bookEndDate)
}
this.getList();
return undefined
},
confirm() {
if (this.returnForm.retCompany == '') {
this.$notify({
title: '失败',
message: '还车地点不能为空',
type: 'error',
duration: 2000
})
set: function(date) {
if (this.$utils.isDate(date)) {
this.listQuery.bookEndDate = formatDate(date, 'yyyy-MM')
} else {
this.returnForm.id = this.activeId
updateById(this.returnForm).then(data => {
if (data.status == 200) {
this.$notify({
title: '成功',
message: '修改还车地点成功',
type: 'success',
duration: 2000
})
this.resetReturn = false;
this.dialogDetailVisible = false;
this.getList();
} else {
this.$notify({
title: '失败',
message: data.message,
type: 'error',
duration: 2000
})
}
})
this.listQuery.bookEndDate = undefined
}
},
/**
* 确定
* */
okHandler() {
let arr = []
this.fileList2.map(function(item) {
arr.push(item.url)
}
}
},
methods: {
/**
* 重置
* */
reloadPage() {
this.listQuery = {
page: 1,
limit: 20,
flag: false,
zoneId: undefined,
liftCompany: undefined,
liftCompanyName: '',
numberPlate: undefined,
selectedMonth: undefined,
status: undefined,
bookType: undefined,
bookStartDate: undefined,
bookEndDate: undefined
}
if (this.listQuery) {
localStorage.setItem(
'bookRecord',
JSON.stringify(this.listQuery)
)
}
this.getList()
},
confirm() {
if (this.returnForm.retCompany == '') {
this.$notify({
title: '失败',
message: '还车地点不能为空',
type: 'error',
duration: 2000
})
let params = {
illegalPic: arr.join(','),
illegalAmount: this.price,
id: this.detailId
}
saveOrderViolation(params).then(response => {
if (response.status === 200) {
} else {
this.returnForm.id = this.activeId
updateById(this.returnForm).then(data => {
if (data.status == 200) {
this.$notify({
title: '成功',
message: '创建成功',
message: '修改还车地点成功',
type: 'success',
duration: 2000
})
this.illegalVisible = false
this.resetReturn = false
this.dialogDetailVisible = false
this.getList()
} else {
this.$notify({
title: '创建失败',
message: '操作失败!',
title: '失败',
message: data.message,
type: 'error',
duration: 2000
})
}
})
},
/**
* 上传成功
* */
handleSuccess(res, file) {
let c = { url: res.data }
this.fileList2.push(c)
this.showLoadingBody = false
},
/**
* 删除违章图片
* */
handleRemove(file, fileList1) {
this.fileList2 = fileList1
},
/**
* 出车上传成功
* */
handleDepartureSuccess(res, file) {
let c = { url: res.data }
this.departurePicList.push(c)
this.showLoadingBody = false
},
/**
* 删除出车图片
* */
handleDepartureRemove(file, fileList2) {
this.departurePicList = fileList2
},
/**
* 上传成功
* */
handleArrivalSuccess(res, file) {
let c = { url: res.data }
this.arrivalPicList.push(c)
this.showLoadingBody = false
},
/**
* 删除违章图片
* */
handleArrivalRemove(file, fileList3) {
this.arrivalPicList = fileList3
},
/**
* 操作-违章查询按钮,显示违章弹框
*/
illegalInquiry(row) {
var t = this
this.fileList2 = []
this.price = ''
if (row.vehicleDepartureLogVo.illegalPic) {
let arr = row.vehicleDepartureLogVo.illegalPic.split(',')
let fileList2 = []
let p = {}
arr.map(function(item) {
p = {
url: item
}
fileList2.push(p)
}
},
/**
* 确定
* */
okHandler() {
let arr = []
this.fileList2.map(function(item) {
arr.push(item.url)
})
let params = {
illegalPic: arr.join(','),
illegalAmount: this.price,
id: this.detailId
}
saveOrderViolation(params).then(response => {
if (response.status === 200) {
this.$notify({
title: '成功',
message: '创建成功',
type: 'success',
duration: 2000
})
this.illegalVisible = false
this.getList()
} else {
this.$notify({
title: '创建失败',
message: '操作失败!',
type: 'error',
duration: 2000
})
t.fileList2 = fileList2
}
if (row.vehicleDepartureLogVo.illegalAmount) {
t.price = parseFloat(row.vehicleDepartureLogVo.illegalAmount)
}
this.detailId = row.vehicleDepartureLogVo.id
this.illegalVisible = true
},
/**
* 弹框-取消
* */
cancel() {
this.illegalVisible = false
},
handleDetail(row) {
this.activeId = row.id
var t = this
this.detailItem = row
if (row.vehicleDepartureLogVo != undefined) {
if (
row.vehicleDepartureLogVo.departurePic != undefined &&
row.vehicleDepartureLogVo.departurePic != ''
) {
let arr = row.vehicleDepartureLogVo.departurePic.split(',')
let departurePicList = []
let p = {}
arr.map(function(item) {
departurePicList.push(item)
})
t.departurePicList = departurePicList
} else {
t.departurePicList = []
}
if (
row.vehicleDepartureLogVo.arrivalPic != undefined &&
row.vehicleDepartureLogVo.arrivalPic != ''
) {
let Arr = row.vehicleDepartureLogVo.arrivalPic.split(',')
let arrivalPicList = []
let p = {}
Arr.map(function(item) {
arrivalPicList.push(item)
})
t.arrivalPicList = arrivalPicList
} else {
t.arrivalPicList = []
})
},
/**
* 上传成功
* */
handleSuccess(res, file) {
let c = { url: res.data }
this.fileList2.push(c)
this.showLoadingBody = false
},
/**
* 删除违章图片
* */
handleRemove(file, fileList1) {
this.fileList2 = fileList1
},
/**
* 出车上传成功
* */
handleDepartureSuccess(res, file) {
let c = { url: res.data }
this.departurePicList.push(c)
this.showLoadingBody = false
},
/**
* 删除出车图片
* */
handleDepartureRemove(file, fileList2) {
this.departurePicList = fileList2
},
/**
* 上传成功
* */
handleArrivalSuccess(res, file) {
let c = { url: res.data }
this.arrivalPicList.push(c)
this.showLoadingBody = false
},
/**
* 删除违章图片
* */
handleArrivalRemove(file, fileList3) {
this.arrivalPicList = fileList3
},
/**
* 操作-违章查询按钮,显示违章弹框
*/
illegalInquiry(row) {
var t = this
this.fileList2 = []
this.price = ''
if (row.vehicleDepartureLogVo.illegalPic) {
let arr = row.vehicleDepartureLogVo.illegalPic.split(',')
let fileList2 = []
let p = {}
arr.map(function(item) {
p = {
url: item
}
fileList2.push(p)
})
t.fileList2 = fileList2
}
if (row.vehicleDepartureLogVo.illegalAmount) {
t.price = parseFloat(row.vehicleDepartureLogVo.illegalAmount)
}
this.detailId = row.vehicleDepartureLogVo.id
this.illegalVisible = true
},
/**
* 弹框-取消
* */
cancel() {
this.illegalVisible = false
},
handleDetail(row) {
this.activeId = row.id
var t = this
this.detailItem = row
if (row.vehicleDepartureLogVo != undefined) {
if (
row.vehicleDepartureLogVo.departurePic != undefined &&
row.vehicleDepartureLogVo.departurePic != ''
) {
let arr = row.vehicleDepartureLogVo.departurePic.split(',')
let departurePicList = []
let p = {}
arr.map(function(item) {
departurePicList.push(item)
})
t.departurePicList = departurePicList
} else {
t.departurePicList = []
t.arrivalPicList = []
}
this.dialogDetailVisible = true
},
//监听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
},
querySearch(queryString, cb) {
let selectArry = []
let iitem = {
value: '全部',
name: '全部'
}
selectArry.push(iitem)
this.allCompaniesArr.map(function(item) {
item.value = item.name
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.liftCompany = undefined;
if (
row.vehicleDepartureLogVo.arrivalPic != undefined &&
row.vehicleDepartureLogVo.arrivalPic != ''
) {
let Arr = row.vehicleDepartureLogVo.arrivalPic.split(',')
let arrivalPicList = []
let p = {}
Arr.map(function(item) {
arrivalPicList.push(item)
})
t.arrivalPicList = arrivalPicList
} else {
this.listQuery.liftCompany = item.id;
t.arrivalPicList = []
}
},
cancelDialog4Lift(formName) {
this.dialogForm4LiftVisible = false
this.$refs[formName].resetFields()
},
cancelDialog4Ret(formName) {
this.dialogForm4RetVisible = false
this.$refs[formName].resetFields()
},
/**
* 出车弹框-确定
* */
liftOk(formName) {
const set = this.$refs
set[formName].validate(valid => {
if (valid) {
if (Number(this.departureForm.mileage) > 999999) {
} else {
t.departurePicList = []
t.arrivalPicList = []
}
this.dialogDetailVisible = true
},
//监听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
},
querySearch(queryString, cb) {
let selectArry = []
let iitem = {
value: '全部',
name: '全部'
}
selectArry.push(iitem)
this.allCompaniesArr.map(function(item) {
item.value = item.name
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.liftCompany = undefined
} else {
this.listQuery.liftCompany = item.id
}
},
cancelDialog4Lift(formName) {
this.dialogForm4LiftVisible = false
this.$refs[formName].resetFields()
},
cancelDialog4Ret(formName) {
this.dialogForm4RetVisible = false
this.$refs[formName].resetFields()
},
/**
* 出车弹框-确定
* */
liftOk(formName) {
const set = this.$refs
set[formName].validate(valid => {
if (valid) {
if (Number(this.departureForm.mileage) > 999999) {
this.$notify({
title: '警告',
message: '公里数不能大于999999',
type: 'warning',
duration: 2000
})
return false
}
var arr = []
this.departurePicList.map(function(item) {
arr.push(item.url)
})
this.departureForm.departurePic = arr.join(',')
departureVehicle(this.departureForm).then(response => {
if (response.status == 200) {
this.dialogForm4LiftVisible = false
this.$notify({
title: '警告',
message: '公里数不能大于999999',
type: 'warning',
title: '成功',
message: '出车成功',
type: 'success',
duration: 2000
})
this.cleanDepartureForm()
this.getList()
} else {
this.$notify({
title: '失败',
message: response.message,
type: 'error',
duration: 2000
})
return false
}
var arr = []
this.departurePicList.map(function(item) {
arr.push(item.url)
})
this.departureForm.departurePic = arr.join(',')
departureVehicle(this.departureForm).then(response => {
if (response.status == 200) {
this.dialogForm4LiftVisible = false
this.$notify({
title: '成功',
message: '出车成功',
type: 'success',
duration: 2000
})
this.cleanDepartureForm()
this.getList()
} else {
this.$notify({
title: '失败',
message: response.message,
type: 'error',
duration: 2000
})
}
})
} else {
return false
}
})
},
handleBookInfo(row) {
this.$refs.bookInfoViewer.handleBookInfo(row.vehicle)
},
handleAccItemInfo(row) {
this.selectedAccItem = row.accItemAndAmount
this.$refs.accItemSelector.show()
},
checkIfBooked(bookedDate, [startDateStr, endDateStr]) {
if (
this.$utils.isInteger(bookedDate) &&
this.$utils.isString(startDateStr) &&
startDateStr !== '' &&
this.$utils.isString(endDateStr) &&
endDateStr !== ''
})
} else {
return false
}
})
},
handleBookInfo(row) {
this.$refs.bookInfoViewer.handleBookInfo(row.vehicle)
},
handleAccItemInfo(row) {
this.selectedAccItem = row.accItemAndAmount
this.$refs.accItemSelector.show()
},
checkIfBooked(bookedDate, [startDateStr, endDateStr]) {
if (
this.$utils.isInteger(bookedDate) &&
this.$utils.isString(startDateStr) &&
startDateStr !== '' &&
this.$utils.isString(endDateStr) &&
endDateStr !== ''
) {
let startDate = toEast8Date(startDateStr)
let endDate = toEast8Date(endDateStr)
for (
;
this.$utils.toDateString(startDate, 'yyyy-MM-dd') <=
this.$utils.toDateString(endDate, 'yyyy-MM-dd');
startDate.setDate(startDate.getDate() + 1)
) {
let startDate = toEast8Date(startDateStr)
let endDate = toEast8Date(endDateStr)
for (
;
this.$utils.toDateString(startDate, 'yyyy-MM-dd') <=
this.$utils.toDateString(endDate, 'yyyy-MM-dd');
startDate.setDate(startDate.getDate() + 1)
) {
if ((bookedDate & (1 << (startDate.getDate() - 1))) !== 0) {
return true
}
if ((bookedDate & (1 << (startDate.getDate() - 1))) !== 0) {
return true
}
}
return false
},
checkIfApply(code) {
return code === BOOK_RECORD_STATUS_APPLY
},
checkIfProved(code) {
return code === BOOK_RECORD_STATUS_PROVED
},
checkIfLift(code) {
return code === BOOK_RECORD_STATUS_LIFT
},
getList() {
this.listLoading = true
for (var key in this.listQuery) {
if (this.listQuery[key] === '') {
this.listQuery[key] = undefined
}
}
return false
},
checkIfApply(code) {
return code === BOOK_RECORD_STATUS_APPLY
},
checkIfProved(code) {
return code === BOOK_RECORD_STATUS_PROVED
},
checkIfLift(code) {
return code === BOOK_RECORD_STATUS_LIFT
},
getList() {
this.listLoading = true
for (var key in this.listQuery) {
if (this.listQuery[key] === '') {
this.listQuery[key] = undefined
}
page(this.listQuery).then(response => {
this.list = response.data.data
this.total = response.data.totalCount
this.listLoading = false
})
},
getBookRecordStatus: function(data) {
this.bookRecordStatus['3'].val = '待出行'
this.bookRecordStatus['4'].val = '驳回'
this.bookRecordStatus['5'].val = '出行中'
this.bookRecordStatus['7'].val = '已完成'
if (data) {
if (!this.$utils.isInteger(data.status)) {
return '未知'
}
if (
data.status == 2 &&
(data.vehicleDepartureLogVo == undefined ||
data.vehicleDepartureLogVo == null)
) {
return this.bookRecordStatus['3'].val
}
if (
data.status == 2 &&
data.vehicleDepartureLogVo != undefined &&
data.vehicleDepartureLogVo != null &&
data.vehicleDepartureLogVo.state == 0
) {
return this.bookRecordStatus['5'].val
}
if (
data.status == 2 &&
data.vehicleDepartureLogVo != undefined &&
data.vehicleDepartureLogVo != null &&
data.vehicleDepartureLogVo.state == 1
) {
return this.bookRecordStatus['7'].val
}
return this.bookRecordStatus[data.status + ''].val
}
page(this.listQuery).then(response => {
this.list = response.data.data
this.total = response.data.totalCount
this.listLoading = false
})
},
getBookRecordStatus: function(data) {
this.bookRecordStatus['3'].val = '待出行'
this.bookRecordStatus['4'].val = '驳回'
this.bookRecordStatus['5'].val = '出行中'
this.bookRecordStatus['7'].val = '已完成'
if (data) {
if (!this.$utils.isInteger(data.status)) {
return '未知'
}
return ''
},
getAllBookRecordStatus: function() {
console.log(this.bookRecordStatus)
return this.bookRecordStatus
},
getDatePeriodStr([startDate, endDate]) {
if (
this.$utils.isString(startDate) &&
startDate !== '' &&
this.$utils.isString(endDate) &&
endDate !== ''
data.status == 2 &&
(data.vehicleDepartureLogVo == undefined ||
data.vehicleDepartureLogVo == null)
) {
return (
formatDate(toEast8Date(startDate), 'yyyy-MM-dd') +
' 至 ' +
formatDate(toEast8Date(endDate), 'yyyy-MM-dd')
)
return this.bookRecordStatus['3'].val
}
return '未知'
},
/**
* 清空出车弹框数据
*/
cleanDepartureForm() {
this.departureForm = {
vehicleId: null,
departureBranchCompanyId: null, //出发地分公司id
departureBranchCompanyName: '', //出发地分公司名称
use: null,
user: null,
userTel: null,
checkMan: null,
checkManTel: null,
mileage: null,
numberPlate: null,
expectArrivalBranchCompanyId: null, //目的地分公司id
expectArrivalBranchCompanyName: '', //目的地分公司名称
bookRecordId: null,
departurePic: '',
remark: null,
bookStartDate: null
if (
data.status == 2 &&
data.vehicleDepartureLogVo != undefined &&
data.vehicleDepartureLogVo != null &&
data.vehicleDepartureLogVo.state == 0
) {
return this.bookRecordStatus['5'].val
}
},
cleanArrivalForm() {
this.arrivalForm = {
vehicleId: null,
numberPlate: null,
arrivalDate: null,
recycleMan: null,
recycleManTel: null,
mileage: null,
arrivalBranchCompanyId: null,
arrivalBranchCompanyName: '',
arrivalPic: '',
remark: '',
bookRecordId: null
if (
data.status == 2 &&
data.vehicleDepartureLogVo != undefined &&
data.vehicleDepartureLogVo != null &&
data.vehicleDepartureLogVo.state == 1
) {
return this.bookRecordStatus['7'].val
}
},
/**
* 搜索按钮
* */
handleFilter() {
this.listQuery.page = 1
this.$refs.queryForm.validate(valid => {
if (valid) {
if(this.listQuery){
localStorage.setItem("bookRecord", JSON.stringify(this.listQuery));
return this.bookRecordStatus[data.status + ''].val
}
return ''
},
getAllBookRecordStatus: function() {
console.log(this.bookRecordStatus)
return this.bookRecordStatus
},
getDatePeriodStr([startDate, endDate]) {
if (
this.$utils.isString(startDate) &&
startDate !== '' &&
this.$utils.isString(endDate) &&
endDate !== ''
) {
return (
formatDate(toEast8Date(startDate), 'yyyy-MM-dd') +
' 至 ' +
formatDate(toEast8Date(endDate), 'yyyy-MM-dd')
)
}
return '未知'
},
/**
* 清空出车弹框数据
*/
cleanDepartureForm() {
this.departureForm = {
vehicleId: null,
departureBranchCompanyId: null, //出发地分公司id
departureBranchCompanyName: '', //出发地分公司名称
use: null,
user: null,
userTel: null,
checkMan: null,
checkManTel: null,
mileage: null,
numberPlate: null,
expectArrivalBranchCompanyId: null, //目的地分公司id
expectArrivalBranchCompanyName: '', //目的地分公司名称
bookRecordId: null,
departurePic: '',
remark: null,
bookStartDate: null
}
},
cleanArrivalForm() {
this.arrivalForm = {
vehicleId: null,
numberPlate: null,
arrivalDate: null,
recycleMan: null,
recycleManTel: null,
mileage: null,
arrivalBranchCompanyId: null,
arrivalBranchCompanyName: '',
arrivalPic: '',
remark: '',
bookRecordId: null
}
},
/**
* 搜索按钮
* */
handleFilter() {
this.listQuery.page = 1
this.$refs.queryForm.validate(valid => {
if (valid) {
if (this.listQuery) {
localStorage.setItem(
'bookRecord',
JSON.stringify(this.listQuery)
)
}
this.getList()
} else {
return false
}
})
},
handleSizeChange(val) {
this.listQuery.limit = val
this.getList()
},
handleCurrentChange(val) {
this.listQuery.page = val
this.getList()
},
handleProve(row) {
this.$confirm('确定批准申请?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
prove(row.id).then(response => {
if (
response.code ===
rsCode.code.VEHICLE_BOOKED_INFO_ALREADY_CHANGED
) {
this.$notify({
title: '失败',
message:
rsCode.msg[
rsCode.code
.VEHICLE_BOOKED_INFO_ALREADY_CHANGED
],
type: 'error',
duration: 2000
})
} else if (
response.code ===
rsCode.code.VEHICLE_BOOKED_RECORD_ALREADY_CHANGED
) {
this.$notify({
title: '失败',
message:
rsCode.msg[
rsCode.code
.VEHICLE_BOOKED_RECORD_ALREADY_CHANGED
],
type: 'error',
duration: 2000
})
} else if (response.code === rsCode.RS_CODE_SUC) {
this.$notify({
title: '成功',
message: '操作成功',
type: 'success',
duration: 2000
})
if (this.dialogDetailVisible) {
this.dialogDetailVisible = false
}
this.getList()
} else {
return false
}
this.getList()
})
},
handleSizeChange(val) {
this.listQuery.limit = val
this.getList()
},
handleCurrentChange(val) {
this.listQuery.page = val
this.getList()
},
handleProve(row) {
this.$confirm('确定批准申请?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
prove(row.id).then(response => {
if (
response.code ===
rsCode.code.VEHICLE_BOOKED_INFO_ALREADY_CHANGED
) {
this.$notify({
title: '失败',
message:
rsCode.msg[
rsCode.code
.VEHICLE_BOOKED_INFO_ALREADY_CHANGED
],
type: 'error',
duration: 2000
})
} else if (
response.code ===
rsCode.code.VEHICLE_BOOKED_RECORD_ALREADY_CHANGED
) {
this.$notify({
title: '失败',
message:
rsCode.msg[
rsCode.code
.VEHICLE_BOOKED_RECORD_ALREADY_CHANGED
],
type: 'error',
duration: 2000
})
} else if (response.code === rsCode.RS_CODE_SUC) {
})
},
rejectBtn(formName) {
const set = this.$refs
set[formName].validate(valid => {
if (valid) {
reject(this.rejectFrom).then(response => {
if (response.code == 1) {
this.$notify({
title: '成功',
message: '操作成功',
type: 'success',
duration: 2000
})
this.getList()
if (this.rejectVisible) {
this.rejectVisible = false
}
if (this.dialogDetailVisible) {
this.dialogDetailVisible = false
}
} else {
this.$notify({
title: '失败',
message: response.message,
type: 'error',
duration: 2000
})
}
this.getList()
})
})
},
rejectBtn(formName) {
const set = this.$refs
set[formName].validate(valid => {
if (valid) {
reject(this.rejectFrom).then(response => {
if (response.code == 1) {
this.$notify({
title: '成功',
message: '操作成功',
type: 'success',
duration: 2000
})
this.getList()
if (this.rejectVisible) {
this.rejectVisible = false
}
if (this.dialogDetailVisible) {
this.dialogDetailVisible = false
}
} else {
this.$notify({
title: '失败',
message: response.message,
type: 'error',
duration: 2000
})
}
} else {
return false
}
})
},
handleReject(row) {
this.rejectVisible = true
this.rejectFrom.vehicleBookRecordId = row.id
this.rejectFrom.rejectRemark = ''
},
/**
* 操作-出车
* @param row
*/
handleLift(row) {
this.cleanDepartureForm()
this.departurePicList = []
if (row.bookType == 1) {
this.departureForm.use = '租车'
} else if (row.bookType == 2) {
this.departureForm.use = '用户租赁'
} else if (row.bookType == 3) {
this.departureForm.use = '维修'
} else if (row.bookType == 4) {
this.departureForm.use = '展览'
} else if (row.bookType == 5) {
this.departureForm.use = '旅游'
} else if (row.bookType == 6) {
this.departureForm.use = '保养'
} else if (row.bookType == 7) {
this.departureForm.use = '预约中'
} else if (row.bookType == 8) {
this.departureForm.use = '禁用'
} else if (row.bookType == 9) {
this.departureForm.use = '客户用车'
} else if (row.bookType == 10) {
this.departureForm.use = '其他'
}
this.departureForm.bookRecordId = row.id
this.departureForm.vehicleId = row.vehicleId
this.departureForm.numberPlate = row.numberPlate
this.departureForm.departureDate = Date()
this.departureForm.departureBranchCompanyId = row.liftCompany
this.departureForm.departureBranchCompanyName = row.liftCompanyName
this.departureForm.user = row.vehicleUsername
this.departureForm.userTel = row.vehicleUserPhone
// if(row.vehicleDepartureLogVo!=undefined){
// this.departureForm.user = row.vehicleDepartureLogVo.user?row.vehicleDepartureLogVo.user:''
// this.departureForm.userTel = row.vehicleDepartureLogVo.userTel?row.vehicleDepartureLogVo.userTel:''
// }else{
// this.departureForm.user = ''
// this.departureForm.userTel = ''
// }
this.departureForm.expectArrivalBranchCompanyId = row.retCompany
this.departureForm.expectArrivalBranchCompanyName =
row.retCompanyName
this.dialogForm4LiftVisible = true
},
/**
* 操作-收车
* @param row
*/
handleRet(row) {
this.arrivalPicList = []
this.arrivalForm.bookRecordId = row.id
this.arrivalForm.vehicleId = row.vehicleId
this.arrivalForm.numberPlate = row.numberPlate
this.arrivalForm.arrivalDate = Date()
this.arrivalForm.arrivalBranchCompanyId = row.retCompany
this.arrivalForm.arrivalBranchCompanyName = row.retCompanyName
this.dialogForm4RetVisible = true
},
ret(formName) {
const set = this.$refs
set[formName].validate(valid => {
if (valid) {
if (Number(this.arrivalForm.mileage) > 999999) {
this.$notify({
title: '警告',
message: '公里数不能大于999999',
type: 'warning',
duration: 2000
})
} else {
return false
}
})
},
handleReject(row) {
this.rejectVisible = true
this.rejectFrom.vehicleBookRecordId = row.id
this.rejectFrom.rejectRemark = ''
},
/**
* 操作-出车
* @param row
*/
handleLift(row) {
this.cleanDepartureForm()
this.departurePicList = []
if (row.bookType == 1) {
this.departureForm.use = '租车'
} else if (row.bookType == 2) {
this.departureForm.use = '用户租赁'
} else if (row.bookType == 3) {
this.departureForm.use = '维修'
} else if (row.bookType == 4) {
this.departureForm.use = '展览'
} else if (row.bookType == 5) {
this.departureForm.use = '旅游'
} else if (row.bookType == 6) {
this.departureForm.use = '保养'
} else if (row.bookType == 7) {
this.departureForm.use = '预约中'
} else if (row.bookType == 8) {
this.departureForm.use = '禁用'
} else if (row.bookType == 9) {
this.departureForm.use = '客户用车'
} else if (row.bookType == 10) {
this.departureForm.use = '其他'
}
this.departureForm.bookRecordId = row.id
this.departureForm.vehicleId = row.vehicleId
this.departureForm.numberPlate = row.numberPlate
this.departureForm.departureDate = Date()
this.departureForm.departureBranchCompanyId = row.liftCompany
this.departureForm.departureBranchCompanyName = row.liftCompanyName
this.departureForm.user = row.vehicleUsername
this.departureForm.userTel = row.vehicleUserPhone
// if(row.vehicleDepartureLogVo!=undefined){
// this.departureForm.user = row.vehicleDepartureLogVo.user?row.vehicleDepartureLogVo.user:''
// this.departureForm.userTel = row.vehicleDepartureLogVo.userTel?row.vehicleDepartureLogVo.userTel:''
// }else{
// this.departureForm.user = ''
// this.departureForm.userTel = ''
// }
this.departureForm.expectArrivalBranchCompanyId = row.retCompany
this.departureForm.expectArrivalBranchCompanyName =
row.retCompanyName
this.dialogForm4LiftVisible = true
},
/**
* 操作-收车
* @param row
*/
handleRet(row) {
this.arrivalPicList = []
this.arrivalForm.bookRecordId = row.id
this.arrivalForm.vehicleId = row.vehicleId
this.arrivalForm.numberPlate = row.numberPlate
this.arrivalForm.arrivalDate = Date()
this.arrivalForm.arrivalBranchCompanyId = row.retCompany
this.arrivalForm.arrivalBranchCompanyName = row.retCompanyName
this.dialogForm4RetVisible = true
},
ret(formName) {
const set = this.$refs
set[formName].validate(valid => {
if (valid) {
if (Number(this.arrivalForm.mileage) > 999999) {
var arr = []
this.arrivalPicList.map(function(item) {
arr.push(item.url)
})
this.arrivalForm.arrivalPic = arr.join(',')
arrivalVehicle(this.arrivalForm).then(response => {
if (response.status == 200) {
this.dialogForm4RetVisible = false
this.$notify({
title: '成功',
message: '收车成功',
type: 'success',
duration: 2000
})
this.cleanArrivalForm()
this.getList()
} else {
this.$notify({
title: '警告',
message: '公里数不能大于999999',
type: 'warning',
title: '失败',
message: response.message,
type: 'error',
duration: 2000
})
return false
}
var arr = []
this.arrivalPicList.map(function(item) {
arr.push(item.url)
})
this.arrivalForm.arrivalPic = arr.join(',')
arrivalVehicle(this.arrivalForm).then(response => {
if (response.status == 200) {
this.dialogForm4RetVisible = false
this.$notify({
title: '成功',
message: '收车成功',
type: 'success',
duration: 2000
})
this.cleanArrivalForm()
this.getList()
} else {
this.$notify({
title: '失败',
message: response.message,
type: 'error',
duration: 2000
})
}
})
} else {
return false
}
})
},
handleUnbook(row) {
this.$confirm('确定取消预定?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var obj = {
vehicleBookRecordId: row.id
}
})
} else {
return false
}
})
},
handleUnbook(row) {
this.$confirm('确定取消预定?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var obj = {
vehicleBookRecordId: row.id
}
unbook(obj)
.then(response => {
if (response.code == 1) {
this.$notify({
title: '成功',
message: '操作成功',
type: 'success',
duration: 2000
})
this.getList()
} else {
this.$notify({
title: '失败',
message: response.message,
type: 'error',
duration: 2000
})
}
unbook(obj)
.then(response => {
if (response.code == 1) {
this.$notify({
title: '成功',
message: '操作成功',
type: 'success',
duration: 2000
})
.catch(response => {
console.log(response)
this.getList()
} else {
this.$notify({
title: '失败',
message: response.message,
type: 'error',
duration: 2000
})
})
}
}
})
.catch(response => {
console.log(response)
})
})
}
}
}
</script>
<style scoped>
.order-details .el-form-item {
margin-bottom: 0px !important;
}
.order-details hr {
height: 1px;
background-color: #ccc;
border: none;
}
.image {
width: 100%;
height: 110px;
display: block;
}
.el-card__body,
.el-card {
padding: 0px !important;
width: 150px;
text-align: center;
}
.modal_modal {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
opacity: 0.5;
background: #000;
z-index: 2001;
}
.voucher{
width: 100px;
height: 100px;
}
.order-details .el-form-item {
margin-bottom: 0px !important;
}
.order-details hr {
height: 1px;
background-color: #ccc;
border: none;
}
.image {
width: 100%;
height: 110px;
display: block;
}
.el-card__body,
.el-card {
padding: 0px !important;
width: 150px;
text-align: center;
}
.modal_modal {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
opacity: 0.5;
background: #000;
z-index: 2001;
}
.voucher {
width: 100px;
height: 100px;
}
</style>
......@@ -201,6 +201,12 @@
v-waves
@click="handleFilter('download')"
>下载车辆信息Excel表</el-button>
<el-button
class="filter-item"
type="primary"
v-waves
@click="handleFilter('export')"
>导出分公司车辆信息</el-button>
</div>
<el-table :key="tableKey" :data="list" border fit highlight-current-row style="width: 100%">
......@@ -970,7 +976,8 @@ import {
downloadExcel,
checkVin,
checkEngineNum,
getArea
getArea,
exportExcel
} from '../../../api/vehicle/vehicleInfo/'
import {
......@@ -1986,7 +1993,27 @@ export default {
}
this.getList()
},
exportExcelInfo() {
exportExcel().then(res => {
const content = res
const blob = new Blob([content])
const fileName = 'vehicle.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)
}
})
},
/**
* 下载车辆信息excel表
* */
......@@ -2727,6 +2754,9 @@ export default {
if (p == 'download') {
this.download()
}
if (p == 'export') {
this.exportExcelInfo();
}
} else {
return false
}
......
......@@ -66,7 +66,7 @@
@click="setVal(GMTToStrs(dayobject.day),index,dayobject.day.getMonth()+1 != currentMonth)"
>
<!-- 选中的状态 -->
<span ref="activeDay"></span>
<span ref="activeDay" v-show="dayobject.day.getMonth()+1 == currentMonth"></span>
<!-- <span :class="{isChosse:isChosses}" ref="activeDay"></span> -->
<!--本月-->
......@@ -85,19 +85,6 @@
<span v-else>{{ dayobject.day.getDate() }}</span>
</span>
<p style="color:red">{{matching(GMTToStr(dayobject.day))}}</p>
<!-- <p style="color:red">{{GMTToStr(dayobject.day)}}</p> -->
<!-- <p
v-if="new Date(dayobject.day).getDay()+1 == 1 || new Date(dayobject.day).getDay()+1 == 7"
style="color:red"
>{{GMTToStr(dayobject.day)}}</p>-->
<!--显示剩余多少数量-->
<!-- <p v-if="leftobj[dayobject.index]">
剩余:
<span style="color: red">{{leftobj[dayobject.index].count}}</span>
</p>-->
<!---->
<!-- <button @click="order(dayobject)" v-if="leftobj[dayobject.index]">预定</button> -->
</li>
</ul>
......@@ -242,6 +229,7 @@ export default {
this.levelsFn()
},
methods: {
//通用规则设置
submitForm(formName) {
this.$refs[formName].validate(valid => {
if (valid) {
......@@ -262,8 +250,9 @@ export default {
}
})
},
//清空设置样式
changeIsGlobal(val) {
let activeStatus = this.$refs.activeDay
let activeStatus = this.$refs.activeDay || ''
if (val == 0) {
for (let index = 0; index < activeStatus.length; index++) {
activeStatus[index].className = ''
......@@ -327,10 +316,6 @@ export default {
type: this.setForm.type
})
}
// else {
// this.$message.error('请设置不同车型不同价格1')
// return false
// }
} else if (this.setForm.type == 2) {
if (!!element.price || !!element.freeDays) {
params.push({
......@@ -343,10 +328,6 @@ export default {
type: this.setForm.type
})
}
// else {
// this.$message.error('请设置不同车型不同价格2')
// return false
// }
} else {
if (!!element.level || !!element.freeDays) {
params.push({
......@@ -359,25 +340,28 @@ export default {
type: this.setForm.type
})
}
// else {
// this.$message.error('请设置不同车型不同价格3')
// return false
// }
}
})
}
if (params == '') {
add_edit('',this.activeTime).then(data => {
if (data.status == 200) {
this.$message.success('设置成功')
this.chooseData = []
this.getList()
} else {
this.$message.error(data.message)
}
})
if (this.activeTime) {
add_edit('', this.activeTime).then(data => {
if (data.status == 200) {
this.$message.success('设置成功')
this.chooseData = []
this.getList()
} else {
this.$message.error(data.message)
}
})
}else{
this.$message.error('请选择要设置的日期')
}
} else {
add_edit(params,this.activeTime).then(data => {
// console.log(params);
console.log(this.activeTime)
add_edit(params, this.activeTime).then(data => {
if (data.status == 200) {
this.$message.success('设置成功')
this.chooseData = []
......@@ -398,8 +382,9 @@ export default {
})
},
setVal(val, index, isClick) {
//val:当前日期 index:当前索引 isClick:不置灰
if (!isClick) {
this.activeTime = val
this.activeTime = val.length == 1 ? '0' + val : val
if (this.calendarStatus == 1 && this.setForm.isGlobal == 0) {
dayList(val).then(data => {
data.data.forEach(element => {
......@@ -461,6 +446,8 @@ export default {
let date = new Date(time)
let year = date.getFullYear()
let month = date.getMonth() + 1
month = month.toString().length == 1 ? '0' + month : month
// console.log(month);
let datas =
date.getDate().toString().length == 1
? '0' + date.getDate()
......@@ -472,6 +459,7 @@ export default {
let date = new Date(time)
let year = date.getFullYear()
let month = date.getMonth() + 1
month = month.toString().length == 1 ? '0' + month : month
let datas =
date.getDate().toString().length == 1
? '0' + date.getDate()
......@@ -564,7 +552,7 @@ export default {
this.days.push(dayobject) //将日期放入data 中的days数组 供页面渲染使用
}
//其他周
for (var i = 1; i <= 35 - this.currentWeek; i++) {
for (var i = 1; i <= 35 - this.currentWeek + 7; i++) {
var d = new Date(str)
d.setDate(d.getDate() + i)
var dayobject = {}
......@@ -581,6 +569,7 @@ export default {
}
},
pickPre: function(year, month) {
var activeStatus = this.$refs.activeDay || ''
// setDate(0); 上月最后一天
// setDate(-1); 上月倒数第二天
// setDate(dx) 参数dx为 上月最后一天的前后dx天
......@@ -588,14 +577,51 @@ export default {
d.setDate(0)
this.initData(this.formatDate(d.getFullYear(), d.getMonth() + 1, 1))
this.getList()
if (this.calendarStatus == 1) {
this.changeIsGlobal(0)
for (let index = 0; index < this.days.length; index++) {
if (
this.GMTToStr(
this.days[index] == this.chooseData[index]
)
) {
if (this.chooseData[index]) {
const indexs = this.days.findIndex(
item =>
this.GMTToStrs(item.day) ==
this.chooseData[index]
)
if (activeStatus[indexs])
activeStatus[indexs].className = 'isChosse'
}
}
}
}
},
pickNext: function(year, month) {
var activeStatus = this.$refs.activeDay || ''
var d = new Date(this.formatDate(year, month, 1))
d.setDate(35)
this.initData(this.formatDate(d.getFullYear(), d.getMonth() + 1, 1))
this.getList()
},
this.changeIsGlobal(0)
for (let index = 0; index < this.days.length; index++) {
if (this.GMTToStr(this.days[index] == this.chooseData[index])) {
if (this.chooseData[index]) {
const indexs = this.days.findIndex(
item =>
this.GMTToStrs(item.day) ==
this.chooseData[index]
)
if (activeStatus[indexs])
activeStatus[indexs].className = 'isChosse'
// activeStatus[indexs].className = 'isChosse'
}
}
}
},
// 返回 类似 2016-01-02 格式的字符串
formatDate: function(year, month, day) {
var y = year
......
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