Commit 0214e701 authored by jiaorz's avatar jiaorz

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

parents 46f496f7 8f1ec310
import fetch from 'utils/fetch';
/**
* 获取列表
* @param query
*/
export function getPushList(query) {
return fetch({
url: '/api/universal/jpush/list',
method: 'Get',
params: query
});
}
/**
* 获取弹窗管理列表某一条数据
* @param query
*/
export function getObj(id) {
return fetch({
url: '/api/universal/jpush/getOne/'+id,
method: 'Get'
})
}
/**
* 弹窗管理--添加
* @param query
*/
export function addObj(obj) {
return fetch({
url: '/api/universal/jpush/addMessagePush',
method: 'post',
data: obj
});
}
/**
* 编辑某一条数据,上下架
* @param query
*/
export function editObj(data) {
return fetch({
url: '/api/universal/jpush/udpMessagePush',
method: 'post',
data: data
})
}
/**
* 删除数据
* @param query
*/
export function delObj(id) {
return fetch({
url: '/api/universal/jpush/del/' + id,
method: 'delete',
})
}
/**
* 立即推送
* @param query
*/
export function pushStype(query) {
return fetch({
url: '/api/universal/jpush/stype',
method: 'Get',
params: query
});
}
...@@ -63,6 +63,7 @@ export function getBookedInfo(vehicleId, yearMonth) { ...@@ -63,6 +63,7 @@ export function getBookedInfo(vehicleId, yearMonth) {
method: 'get' method: 'get'
}); });
} }
/* /*
* 根据id获取片区下省份 * 根据id获取片区下省份
* */ * */
...@@ -89,3 +90,11 @@ export function editObj(param) { ...@@ -89,3 +90,11 @@ export function editObj(param) {
data: param data: param
}); });
} }
//检查车辆编码是否存在
export function checkCode(code, id) {
return fetch({
url: '/vehicle/vehicleInfo/exist_code/' + code + '?id=' + id,
method: 'get'
});
}
...@@ -334,7 +334,7 @@ export const asyncRouterMap = [{ ...@@ -334,7 +334,7 @@ export const asyncRouterMap = [{
{ {
path: 'bookRecord', path: 'bookRecord',
component: _import('vehicle/bookRecord/index'), component: _import('vehicle/bookRecord/index'),
name: '车辆申请管理', name: '车辆排班管理',
authority: 'bookRecord' authority: 'bookRecord'
}, },
{ {
...@@ -364,7 +364,7 @@ export const asyncRouterMap = [{ ...@@ -364,7 +364,7 @@ export const asyncRouterMap = [{
{ {
path: 'vehicleSchedulManage', path: 'vehicleSchedulManage',
component: _import('vehicle/vehicleSchedulManage/index'), component: _import('vehicle/vehicleSchedulManage/index'),
name: '车辆排班管理', name: '车辆排班',
authority: 'vehicleSchedulManage' authority: 'vehicleSchedulManage'
}, },
{ {
...@@ -519,6 +519,12 @@ export const asyncRouterMap = [{ ...@@ -519,6 +519,12 @@ export const asyncRouterMap = [{
component: _import('appManagement/selectedActivities/index'), component: _import('appManagement/selectedActivities/index'),
name: '首页精选活动', name: '首页精选活动',
authority: 'selectedActivities' authority: 'selectedActivities'
},
{
path: 'pushManagement',
component: _import('appManagement/pushManagement/index'),
name: '消息推送',
authority: 'pushManagement'
} }
] ]
}, },
......
<template>
<div class="app-container calendar-list-container" v-loading.body="showLoadingBody">
<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.title" placeholder="请输入标题"></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-select class="filter-item" v-model="listQuery.type" placeholder="请选择推送方式" @change="handleTypeChange">
<el-option :key="null" label="全部" :value="null"></el-option>
<el-option :key="1" label="手动推送" :value="1"></el-option>
<el-option :key="2" label="系统自动推送" :value="2"></el-option>
</el-select>
</el-col>
<el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>
<el-button class="filter-item" type="primary" style="float: right;" @click="handleCreate">+ 添加通知</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="98">
</el-table-column>
<el-table-column width="200" 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.alerts}}</span>
</template>
</el-table-column>
<el-table-column width="200" align="center" label="推送方式">
<template scope="scope">
<span v-if="scope.row.type==1">手动推送</span>
<span v-if="scope.row.type==2">系统自动推送</span>
</template>
</el-table-column>
<el-table-column width="250" align="center" label="创建时间">
<template scope="scope">
<span>{{scope.row.crtTimeStr}}</span>
</template>
</el-table-column>
<el-table-column align="center" width="150" label="操作" fixed="right">
<template scope="scope">
<el-button size="small" class="el-button el-button--text el-button--small" @click="handleDown(scope.row)" v-show="scope.row.type==1">立即推送</el-button>
<el-button size="small" class="el-button el-button--text el-button--small" @click="handleUpdate(scope.row)">编辑</el-button>
<el-button class="el-button el-button--text el-button--small" size="small" @click="deleteHandler(scope.row)" style="color:red;">删除</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>
<!-- banner modal弹窗 -->
<el-dialog :title="modalTitle" :visible.sync="bannerDialogVisible">
<el-form :model="form" :rules="rules" ref="form" label-width="90px">
<el-form-item label="推送方式" >
<el-radio-group v-model="form.type" size="medium">
<el-radio-button label="1">手工推送</el-radio-button>
<el-radio-button label="2">系统自动推送</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="标题" prop="name">
<el-input v-model="form.title" placeholder="请输入标题"></el-input>
</el-form-item>
<el-form-item label="描述" prop="name">
<el-input v-model="form.alert" placeholder="请输入描述"></el-input>
</el-form-item>
<el-form-item label="样式" >
<el-radio-group v-model="form.style" size="medium" @change="handleRadio">
<el-radio-button label="1">标准样式</el-radio-button>
<el-radio-button label="3" >大图</el-radio-button>
<el-radio-button label="2">自定义样式</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="图片" prop="picture" v-if="showPic" :style="{display:'block'}">
<el-upload
class="avatar-uploader"
:action="BASE_API+'/api/universal/file/app/unauth/admin/upload'"
:show-file-list="false"
:headers="getHeaderWithToken"
:on-success="handleAvatarSuccess">
<img v-if="$utils.isString(form.bigPicPath) && !$utils.isEmpty(form.bigPicPath)" :src="form.bigPicPath" style="width:200px;max-height:200px;">
<i v-else class="el-icon-plus avatar-uploader-icon" style="lineHeight:100px;width:100px;height: 100px;vertical-align: middle;"></i>
</el-upload>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelHandel">取 消</el-button>
<el-button v-if="modalTitle=='创建'" type="primary" @click="create('form')">确 定</el-button>
<el-button v-else type="primary" @click="update('form')">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import 'static/css/uploadImg.css';// 引入图片上传组件对话框
import {
formatDate
} from 'utils/dateFormattor';
import {
toEast8Date,
deepCopyDate,
newEast8Date,
convertDate2Str,
timestamp2Date,
getYMD_hm
} from 'utils/dateUtils';
import {
getPushList,
getObj,
addObj,
editObj,
delObj,
pushStype
} from 'src/api/appManagement/pushManagement';
import rsCode from '../../../utils/rsCode';
import {mapGetters} from 'vuex';
import {
getToken
} from '../../../utils/auth';
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: 'pushManagement',
components: {
ElCol,
ElRow,
Element1
},
data() {
return {
showPic:false,
tableKey:0,
modalTitle: "创建",
BASE_API: process.env.BASE_API,
bannerDialogVisible: false,//添加、编辑弹框
showLoadingBody: false,
form: {
type: "",
title:'',
alert:'',
style:'',
bigPicPath:'',
},
listQuery: {
page: 1,
limit: 10,
title: '',//标题
type:undefined
},
pushQuery: {
id: 0,
userIds: '',
},
rules: {
title: {
type: 'string',
required: true,
message: '请输入标题',
trigger: 'blur'
},
alert: {
type: 'string',
required: true,
message: '请输入描述',
},
},
pickerOptionsStart: {
disabledDate(time) {
return time.getTime() < Date.now() - 8.64e7;
}
},
pickerOptionsEnd: {
disabledDate: time => {
const beginDateVal = new Date(this.form.starTimeStr).getTime()
if (beginDateVal) {
return time.getTime() < beginDateVal - 8.64e7
}
}
},
list: null,
total: null,
listLoading: true,
inline: true,
}
},
created() {
this.getList();
},
computed: {
...mapGetters([
'elements',
'belong2Type'
]),
getHeaderWithToken() {
return {Authorization: getToken()};
},
},
methods: {
handleFilter() {
this.listQuery.page = 1;
this.$refs.queryForm.validate(valid => {
if (valid) {
this.getList();
} else {
return false;
}
});
},
handleRadio(item) {
if(item == 3) {
this.showPic = true;
} else {
this.showPic = false;
}
},
handleTypeChange(item) {
this.listQuery.type = item;
},
handleSizeChange(val) {
this.listQuery.limit = val;
this.getList();
},
handleCurrentChange(val) {
this.listQuery.page = val;
this.getList();
},
/**
* 添加
* */
handleCreate() {
this.cleanForm();
this.modalTitle = '创建';
this.bannerDialogVisible = true;
},
/**
* 操作-编辑
* */
handleUpdate(row) {
this.modalTitle = '编辑';
this.cleanForm();
getObj(row.id).then(response => {
var item = response.data;
item.up_name = item.timeType==0?'不限':item.timeType==1?'自定义':'';
if(item.startTime>0&&item.timeType==1){
item.starTimeStr = getYMD_hm(item.startTime);
}else{
item.starTimeStr = '';
}
if(item.endTime>0&&item.timeType==1){
item.endTimeStr = getYMD_hm(item.endTime);
}else{
item.endTimeStr = '';
}
this.form = item;
this.bannerDialogVisible = true;
})
},
/**
* 弹框-取消
* */
cancelHandel(){
this.cleanForm();
this.bannerDialogVisible = false;
},
/**
* 清空表单
* */
cleanForm() {
this.form = {
type: "",
title:'',
alert:'',
style:'',
bigPicPath:'',
}
},
/**
* 获取banner列表数据
* */
getList() {
this.listLoading = true;
getPushList(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;
response.data.data.map(function(item){
item.crtTimeStr = timestamp2Date(item.crtTime);
item.alerts = item.alert;
item.visible2 = false;
});
totalCountRs = response.data.totalCount;
}
this.listLoading = false;
this.list = listRs;
this.total = totalCountRs;
});
},
/**
* 创建
* */
create(formName) {
let that = this;
const set = this.$refs;
set[formName].validate(valid => {
if (valid) {
addObj(this.form).then(response => {
if (response.status === 200) {
this.bannerDialogVisible = false;
this.$notify({
title: '成功',
message: '创建成功',
type: 'success',
duration: 2000
});
this.getList();
} else {
this.$notify({
title: '失败',
message: rsCode.msg[response.code] ? rsCode.msg[response.code] : '操作失败!',
type: 'error',
duration: 2000
});
}
});
} else {
return false;
}
});
},
/**
* 编辑-更新
* */
update(formName) {
let that = this;
const set = this.$refs;
set[formName].validate(valid => {
if (valid) {
editObj(this.form).then(response => {
if (response.status === 200) {
this.bannerDialogVisible = false;
this.$notify({
title: '成功',
message: '编辑成功',
type: 'success',
duration: 2000
});
this.getList();
} else {
this.$notify({
title: '失败',
message: rsCode.msg[response.code] ? rsCode.msg[response.code] : '操作失败!',
type: 'error',
duration: 2000
});
}
});
} else {
return false;
}
});
},
/**
* 上传图片
* @param file
* @returns {boolean}
*/
beforeAvatarUpload(file) {
const isJPG = file.type === 'image/jpeg' || file.type === 'image/gif';
const isLt2M = file.size / 1024 / 1024 < 10;
if (!isJPG) {
this.$message.error('上传图片只能是 JPG/GIF 格式!');
}
if (!isLt2M) {
this.$message.error('上传图片大小不能超过 10MB!');
}
this.showLoadingBody = true;
return isJPG && isLt2M;
},
handleAvatarSuccess(res, file) {
this.form.bigPicPath = res.data;
this.showLoadingBody = false;
},
/**
* 操作-删除
* */
deleteHandler(row) {
this.$confirm('确定删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delObj(row.id).then(response => {
if (response.status === 200) {
this.$notify({
title: '成功',
message: '删除成功',
type: 'success',
duration: 2000
});
this.getList();
} else {
this.$notify({
title: '删除失败',
message: rsCode.msg[response.code] ? rsCode.msg[response.code] : '操作失败!',
type: 'error',
duration: 2000
});
}
});
})
},
/**
* 操作-推送
* */
handleDown(row) {
this.$confirm('确定推送吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.pushQuery.id=row.id
pushStype(this.pushQuery).then(response => {
if (response.status === 200) {
this.$notify({
title: '成功',
message: '推送成功',
type: 'success',
duration: 2000
});
this.getList();
} else {
this.$notify({
title: '推送失败',
message: rsCode.msg[response.code] ? rsCode.msg[response.code] : '操作失败!',
type: 'error',
duration: 2000
});
}
});
})
},
}
}
</script>
...@@ -9,10 +9,12 @@ ...@@ -9,10 +9,12 @@
:value="val.code"></el-option> :value="val.code"></el-option>
</el-select> </el-select>
</el-form-item> </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-form-item label="车牌号">
<el-input v-model="listQuery.numberPlate" placeholder="请输入车牌号"></el-input> <el-input v-model="listQuery.numberPlate" placeholder="请输入车牌号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="用途"> <el-form-item label="用途">
<el-select class="filter-item" v-model="listQuery.bookType" placeholder="请选择"> <el-select class="filter-item" v-model="listQuery.bookType" placeholder="请选择">
<el-option :key="undefined" label="无" :value="undefined"></el-option> <el-option :key="undefined" label="无" :value="undefined"></el-option>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="filter-container"> <div class="filter-container">
<el-form> <el-form>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="5">
<el-form-item> <el-form-item>
<el-date-picker <el-date-picker
v-model="listQuery.time" v-model="listQuery.time"
...@@ -15,13 +15,18 @@ ...@@ -15,13 +15,18 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="5">
<el-form-item>
<el-input type="number" style="width: 200px;" v-model.number="listQuery.code" placeholder="请输入车辆编码"></el-input>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item > <el-form-item >
<el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="车牌号" <el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="车牌号"
v-model="listQuery.numberPlate"></el-input> v-model="listQuery.numberPlate"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="5">
<el-form-item> <el-form-item>
<el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button> <el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>
</el-form-item> </el-form-item>
......
...@@ -3,17 +3,17 @@ ...@@ -3,17 +3,17 @@
<div class="filter-container" ref="filter-container"> <div class="filter-container" ref="filter-container">
<el-form :rules="rules4Query" ref="queryForm" :inline="inline" :model="listQuery" label-width="100px"> <el-form :rules="rules4Query" ref="queryForm" :inline="inline" :model="listQuery" label-width="100px">
<el-row> <el-row>
<el-col :span="8"> <el-col :span="5">
<el-form-item label="车牌"> <el-form-item label="车牌">
<el-input v-model="listQuery.numberPlate" placeholder="请输入车牌"></el-input> <el-input v-model="listQuery.numberPlate" placeholder="请输入车牌"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="5">
<el-form-item label="车辆编码"> <el-form-item label="车辆编码">
<el-input type="number" v-model.number="listQuery.code" placeholder="请输入车辆编码"></el-input> <el-input type="number" v-model.number="listQuery.code" placeholder="请输入车辆编码"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="5">
<el-form-item label="车辆状态"> <el-form-item label="车辆状态">
<el-select class="filter-item" v-model="listQuery.status" placeholder="请选择车辆状态"> <el-select class="filter-item" v-model="listQuery.status" placeholder="请选择车辆状态">
<el-option :key="undefined" label="无" :value="undefined"></el-option> <el-option :key="undefined" label="无" :value="undefined"></el-option>
...@@ -22,37 +22,8 @@ ...@@ -22,37 +22,8 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="5">
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="未预订日期" prop="notBookDateRange">
<el-date-picker
v-model="notBookDateRange"
type="daterange"
:editable="true"
format="yyyy-MM-dd"
placeholder="请输入未预订日期范围">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="预订日期" prop="bookDateRange">
<el-date-picker
v-model="bookDateRange"
type="daterange"
:editable="true"
format="yyyy-MM-dd"
placeholder="请输入已预订日期范围">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="分公司" prop="subordinateBranch"> <el-form-item label="分公司" prop="subordinateBranch">
<!--<el-select class="filter-item" v-model="listQuery.subordinateBranch" placeholder="请选择分公司">-->
<!--<el-option :key="undefined" label="无" :value="undefined"></el-option>-->
<!--<el-option v-for="item in allCompanies" :key="item.id" :label="item.name" :value="item.id"></el-option>-->
<!--</el-select>-->
<el-autocomplete <el-autocomplete
class="inline-input" class="inline-input"
v-model="state1" v-model="state1"
...@@ -64,46 +35,44 @@ ...@@ -64,46 +35,44 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col>
<el-form-item label="所属地区" prop="zoneId"> <el-form-item label="区域" prop="zoneId">
<el-select class="filter-item" v-model="listQuery.zoneId" placeholder="请选择" @change="getProvinceRegions"> <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-option v-for="val in getAllZoneList" :key="val.id" :label="val.name" :value="val.id"> </el-option>
</el-select> </el-select>
</el-form-item>
<!--<el-form-item label="片区" prop="addrCity">--> <el-select class="filter-item" v-model="listQuery.addrProvince" placeholder="请选择省份(直辖市)"
<!--<el-select class="filter-item" v-model="listQuery.addrCity" placeholder="请选择片区">--> @change='getValue'>
<!--<el-option :key="undefined" label="无" :value="undefined"></el-option>--> <el-option v-for="item in provinceRegions" :key="item.id" :label="item.name"
<!--<el-option v-for="item in cityRegions4Query" :key="item.id" :label="item.name" :value="item.id"></el-option>--> :value="item.id"></el-option>
<!--</el-select>-->
<!--</el-form-item>-->
</el-col>
<el-col :span="8">
<el-form-item label="省份">
<el-select class="filter-item" v-model="listQuery.addrProvince" placeholder="请选择省份(直辖市)" @change='getValue'>
<el-option :key="undefined" label="无" :value="undefined"></el-option>
<el-option v-for="item in provinceRegions" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="城市" prop="addrCity">
<el-select class="filter-item" v-model="listQuery.addrCity" placeholder="请选择城市"> <el-select class="filter-item" v-model="listQuery.addrCity" placeholder="请选择城市">
<el-option :key="undefined" label="无" :value="undefined"></el-option> <el-option v-for="item in cityRegions4Query" :key="item.id" :label="item.name"
<el-option v-for="item in cityRegions4Query" :key="item.id" :label="item.name" :value="item.id"></el-option> :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="车型"> <!-- <el-form-item label="车型">
<el-select class="filter-item" v-model="listQuery.modelId" placeholder="请选择车型"> <el-select class="filter-item" v-model="listQuery.modelId" placeholder="请选择车型">
<el-option :key="undefined" label="无" :value="undefined"></el-option> <el-option :key="undefined" label="无" :value="undefined"></el-option>
<el-option v-for="item in allVehicleList" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in allVehicleList" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
-->
<el-form-item label="车型" prop="modelId">
<el-autocomplete
class="inline-input"
v-model="vehicleArr"
:fetch-suggestions="queryVehicleModelSearch"
placeholder="请选择车型"
@select="handleVehicleModelSelect"
></el-autocomplete>
</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-button class="filter-item" type="primary" :icon=" showMoreQueryFilter ? 'caret-top' : 'caret-bottom' " <el-button class="filter-item" type="primary" :icon=" showMoreQueryFilter ? 'caret-top' : 'caret-bottom' "
...@@ -128,7 +97,7 @@ ...@@ -128,7 +97,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <!-- <el-col :span="8">
<el-form-item label="保险结束日期" prop="insuranceDateRange"> <el-form-item label="保险结束日期" prop="insuranceDateRange">
<el-date-picker <el-date-picker
v-model="listQuery.insuranceDateRange" v-model="listQuery.insuranceDateRange"
...@@ -138,11 +107,11 @@ ...@@ -138,11 +107,11 @@
placeholder="请输入保险结束日期范围"> placeholder="请输入保险结束日期范围">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>-->
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <!--<el-col :span="8">
<el-form-item label="年审日期" prop="aVRange"> <el-form-item label="年审日期" prop="aVRange">
<el-date-picker <el-date-picker
v-model="listQuery.aVRange" v-model="listQuery.aVRange"
...@@ -152,7 +121,7 @@ ...@@ -152,7 +121,7 @@
placeholder="请输入年审日期范围"> placeholder="请输入年审日期范围">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>-->
<el-col :span="8"> <el-col :span="8">
<el-form-item label="保养日期" prop="mRange"> <el-form-item label="保养日期" prop="mRange">
<el-date-picker <el-date-picker
...@@ -335,7 +304,8 @@ ...@@ -335,7 +304,8 @@
<el-table-column align="center" label="操作" width="280" fixed="right"> <el-table-column align="center" label="操作" width="280" fixed="right">
<template scope="scope"> <template scope="scope">
<el-button size="small" class="el-button el-button--text el-button--small" @click="handleUpdate(scope.row)">{{vehicleInfo_btn_edit?"编辑":"查看"}} <el-button size="small" class="el-button el-button--text el-button--small" @click="handleUpdate(scope.row)">
{{vehicleInfo_btn_edit?"编辑":"查看"}}
</el-button> </el-button>
<!-- <el-button v-if="scope.row.status == 1&&vehicleInfo_btn_ride" size="small" class="el-button el-button--text el-button--small" @click="departureHandler(scope.row)">出车 <!-- <el-button v-if="scope.row.status == 1&&vehicleInfo_btn_ride" size="small" class="el-button el-button--text el-button--small" @click="departureHandler(scope.row)">出车
</el-button> --> </el-button> -->
...@@ -348,12 +318,19 @@ ...@@ -348,12 +318,19 @@
保养结束 保养结束
</el-button> --> </el-button> -->
<el-button v-if="vehicleInfo_btn_apply && checkIfRuning(scope.row) " size="small" class="el-button el-button--text el-button--small" <el-button v-if="vehicleInfo_btn_apply && checkIfRuning(scope.row) " size="small"
class="el-button el-button--text el-button--small"
@click="handleApply(scope.row)">申请预订 @click="handleApply(scope.row)">申请预订
</el-button> </el-button>
<el-button size="small" class="el-button el-button--text el-button--small" @click="handleBookInfo(scope.row)">预订信息</el-button> <!-- <el-button size="small" class="el-button el-button&#45;&#45;text el-button&#45;&#45;small" @click="handleBookInfo(scope.row)">
<el-button size="small" class="el-button el-button--text el-button--small" @click="handleDepartureLog(scope.row)">出车记录</el-button> 预订信息
<el-button size="small" @click="deleteHandler(scope.row)" class="el-button el-button--text el-button--small" style="color:red;" v-if="vehicleInfo_btn_ret">删除</el-button> </el-button>-->
<el-button size="small" class="el-button el-button--text el-button--small"
@click="handleDepartureLog(scope.row)">排班记录
</el-button>
<el-button size="small" @click="deleteHandler(scope.row)" class="el-button el-button--text el-button--small"
style="color:red;" v-if="vehicleInfo_btn_ret">删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
...@@ -374,7 +351,7 @@ ...@@ -374,7 +351,7 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="车辆编码" prop="code"> <el-form-item label="车辆编码" prop="code">
<el-input v-model.number="form.code" placeholder="不填将自动生成"></el-input> <el-input v-model.number="form.code" placeholder="请输入车辆编码" type="number"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
...@@ -552,7 +529,7 @@ ...@@ -552,7 +529,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="车型"> <!--<el-form-item label="车型">
<el-select v-model="form.modelId" filterable placeholder="请选择"> <el-select v-model="form.modelId" filterable placeholder="请选择">
<el-option <el-option
v-for="item in allVehicleList" v-for="item in allVehicleList"
...@@ -561,6 +538,15 @@ ...@@ -561,6 +538,15 @@
:value="item.id"> :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item>-->
<el-form-item label="车型" prop="vehicleModelName">
<el-autocomplete
class="inline-input"
v-model="form.vehicleModelName"
:fetch-suggestions="queryVehicleModelSearch"
placeholder="请输入内容"
@select="handleVehicleModelSelectSubordinate"
></el-autocomplete>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!--<el-col :span="12">--> <!--<el-col :span="12">-->
...@@ -604,7 +590,8 @@ ...@@ -604,7 +590,8 @@
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="cancel('form')">取 消</el-button> <el-button @click="cancel('form')">取 消</el-button>
<el-button v-if="dialogStatus=='create'" type="primary" @click="create('form')">确 定</el-button> <el-button v-if="dialogStatus=='create'" type="primary" @click="create('form')">确 定</el-button>
<el-button type="primary" @click="update('form')" v-if="dialogStatus=='update'&&vehicleInfo_btn_edit">确 定</el-button> <el-button type="primary" @click="update('form')" v-if="dialogStatus=='update'&&vehicleInfo_btn_edit">确 定
</el-button>
</div> </div>
</el-dialog> </el-dialog>
...@@ -651,7 +638,8 @@ ...@@ -651,7 +638,8 @@
<el-form-item label="用途" prop="bookType"> <el-form-item label="用途" prop="bookType">
<el-select class="filter-item" v-model="form4Apply.bookType" placeholder="请选择用途"> <el-select class="filter-item" v-model="form4Apply.bookType" placeholder="请选择用途">
<el-option :key="undefined" label="" :value="undefined"></el-option> <el-option :key="undefined" label="" :value="undefined"></el-option>
<el-option v-for="(val, key, index) in book_type_list " :key="val.id" :label="val.name" :value="val.id"></el-option> <el-option v-for="(val, key, index) in book_type_list " :key="val.id" :label="val.name"
:value="val.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="保养项目" prop="upkeepIds" v-if="form4Apply.bookType==6"> <el-form-item label="保养项目" prop="upkeepIds" v-if="form4Apply.bookType==6">
...@@ -662,7 +650,8 @@ ...@@ -662,7 +650,8 @@
<el-form-item label="目的地" prop="destination"> <el-form-item label="目的地" prop="destination">
<el-input v-model="form4Apply.destination" placeholder="请输入目的地"></el-input> <el-input v-model="form4Apply.destination" placeholder="请输入目的地"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="随行物品" prop="selectedAccItem" v-if="form4Apply.bookType!=3&&form4Apply.bookType!=6&&form4Apply.bookType!=8&&form4Apply.bookType!=10"> <el-form-item label="随行物品" prop="selectedAccItem"
v-if="form4Apply.bookType!=3&&form4Apply.bookType!=6&&form4Apply.bookType!=8&&form4Apply.bookType!=10">
<el-input type="textarea" v-model="getSelectedAccItemStr" :rows="5" icon="menu" @focus="handleAccItemSelect" <el-input type="textarea" v-model="getSelectedAccItemStr" :rows="5" icon="menu" @focus="handleAccItemSelect"
clearable placeholder="请选择随行物品" clearable placeholder="请选择随行物品"
></el-input> ></el-input>
...@@ -722,9 +711,11 @@ ...@@ -722,9 +711,11 @@
</el-dialog> </el-dialog>
<!--出车弹框--> <!--出车弹框-->
<departureDialog v-if="departureDialogVisible" :departureRow="departureRow" v-on:departureDialogEvent = "departureDialogEvent"></departureDialog> <departureDialog v-if="departureDialogVisible" :departureRow="departureRow"
v-on:departureDialogEvent="departureDialogEvent"></departureDialog>
<!-- 车辆保养弹窗 --> <!-- 车辆保养弹窗 -->
<upkeepDialog v-if="upkeepDialogVisible" :upkeepRow="upkeepRow" v-on:upkeepDialogEvent = "upkeepDialogEvent"></upkeepDialog> <upkeepDialog v-if="upkeepDialogVisible" :upkeepRow="upkeepRow"
v-on:upkeepDialogEvent="upkeepDialogEvent"></upkeepDialog>
</div> </div>
</template> </template>
...@@ -741,13 +732,14 @@ ...@@ -741,13 +732,14 @@
getBookedInfo, getBookedInfo,
putObj, putObj,
delObj, delObj,
getSysRegionByIds getSysRegionByIds,
} from 'api/vehicle/vehicleInfo/'; checkCode
} from '../../../api/vehicle/vehicleInfo/';
import { import {
getAllVehicleModelList, getAllVehicleModelList,
getAllVehicleList getAllVehicleList
} from 'api/vehicleType'; } from '../../../api/vehicleType';
import { import {
getConstantByTypeAndCode, getConstantByTypeAndCode,
...@@ -830,19 +822,21 @@ ...@@ -830,19 +822,21 @@
data() { data() {
return { return {
upkeepRow: {},//保养数据 upkeepRow: {},//保养数据
departureRow:{},//出车数据 departureRow: {},//出车数据
state1: '', state1: '',
vehicleArr: '',
BASE_API: process.env.BASE_API, BASE_API: process.env.BASE_API,
dialogForm4LicenceVisible: false, dialogForm4LicenceVisible: false,
licenceSrcUrl: undefined, licenceSrcUrl: undefined,
showLoadingBody: false, showLoadingBody: false,
allVehicleList: [],//全部车型 allVehicleList: [],//全部车型
form: { form: {
subordinateBranchName : "", vehicleModelName:"",
subordinateBranchName: "",
subordinateBranch: undefined, subordinateBranch: undefined,
parkBranchCompanyName: "", parkBranchCompanyName: "",
parkBranchCompanyId: undefined, parkBranchCompanyId: undefined,
modelId:undefined,//车型id modelId: undefined,//车型id
status: undefined, status: undefined,
code: undefined, code: undefined,
numberPlate: undefined, numberPlate: undefined,
...@@ -871,6 +865,13 @@ ...@@ -871,6 +865,13 @@
trigger: 'change' trigger: 'change'
} }
], ],
vehicleModelName:[
{
required: true,
message: '请选择车型',
trigger: 'change'
}
],
parkBranchCompanyName: [ parkBranchCompanyName: [
{ {
required: true, required: true,
...@@ -882,8 +883,9 @@ ...@@ -882,8 +883,9 @@
code: [ code: [
{ {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
if (this.$utils.isUndefined(value) || this.$utils.isNull(value)) {
return callback(); if (this.$utils.isUndefined(value) || this.$utils.isNull(value) || this.$utils.isEmpty("" + value)) {
return callback(new Error("请输入车辆编码"));
} }
if (!this.$utils.isInteger(value)) { if (!this.$utils.isInteger(value)) {
return callback(new Error('编码必须为整数')); return callback(new Error('编码必须为整数'));
...@@ -891,9 +893,17 @@ ...@@ -891,9 +893,17 @@
if (value < 1 || value > 9999999999) { if (value < 1 || value > 9999999999) {
return callback(new Error('编码合法范围:[1 - 9999999999]')); return callback(new Error('编码合法范围:[1 - 9999999999]'));
} }
//检验code码
checkCode(value, this.form.id).then(response => {
if (response.data === true) {
return callback(new Error("该车辆编码已经被占用,请重新输入"));
} else {
callback(); callback();
}
})
}, },
trigger: 'blur' trigger: 'blur',
required: true
} }
], ],
vin: [ vin: [
...@@ -921,28 +931,28 @@ ...@@ -921,28 +931,28 @@
} }
] ]
}, },
book_type_list:[ book_type_list: [
{ {
name:'维修', name: '维修',
id:3 id: 3
},{ }, {
name:'展览', name: '展览',
id:4 id: 4
},{ }, {
name:'旅游', name: '旅游',
id:5 id: 5
},{ }, {
name:'保养', name: '保养',
id:6 id: 6
},{ }, {
name:'禁用', name: '禁用',
id:8 id: 8
},{ }, {
name:'客户用车', name: '客户用车',
id:9 id: 9
},{ }, {
name:'其他', name: '其他',
id:10 id: 10
} }
], ],
form4Apply: { form4Apply: {
...@@ -957,11 +967,11 @@ ...@@ -957,11 +967,11 @@
destination: undefined, destination: undefined,
selectedAccItem: undefined, selectedAccItem: undefined,
remark: undefined, remark: undefined,
vehicleId:undefined, vehicleId: undefined,
bookType:undefined, bookType: undefined,
vehicleUsername:undefined, vehicleUsername: undefined,
vehicleUserPhone:undefined, vehicleUserPhone: undefined,
upkeepIds:[], upkeepIds: [],
}, },
pickerOptions4Apply: { pickerOptions4Apply: {
disabledDate: this.checkBookDate disabledDate: this.checkBookDate
...@@ -1048,24 +1058,24 @@ ...@@ -1048,24 +1058,24 @@
trigger: 'blur' trigger: 'blur'
} }
], ],
vehicleUsername:[ vehicleUsername: [
{ {
required: true, required: true,
message: '请输入使用人', message: '请输入使用人',
trigger: 'blur' trigger: 'blur'
} }
], ],
vehicleUserPhone:[ vehicleUserPhone: [
{ {
required: true, required: true,
message: '请输入使用人联系方式', message: '请输入使用人联系方式',
trigger: 'blur' trigger: 'blur'
},{ }, {
pattern: /^1[3456789]\d{9}$/, pattern: /^1[3456789]\d{9}$/,
message: '请输入正确的手机号' message: '请输入正确的手机号'
} }
], ],
bookType:[ bookType: [
{ {
required: true, required: true,
message: '请选择用途', message: '请选择用途',
...@@ -1104,7 +1114,8 @@ ...@@ -1104,7 +1114,8 @@
} }
] ]
}, },
selectArry:[], selectArry: [],
selectVehicleModelArray: [],
list: null, list: null,
total: null, total: null,
listLoading: true, listLoading: true,
...@@ -1130,7 +1141,7 @@ ...@@ -1130,7 +1141,7 @@
notBookedStartDate: undefined, notBookedStartDate: undefined,
notBookedEndDate: undefined, notBookedEndDate: undefined,
code: undefined, code: undefined,
modelId:undefined modelId: undefined
}, },
showMoreQueryFilter: false, showMoreQueryFilter: false,
showMoreMoreCol: false, showMoreMoreCol: false,
...@@ -1177,13 +1188,13 @@ ...@@ -1177,13 +1188,13 @@
}, },
upkeepDialogVisible: false, upkeepDialogVisible: false,
allUpkeepItems: null, allUpkeepItems: null,
allZoneArr:[],//全部片区 allZoneArr: [],//全部片区
provinceRegions: [],//片区下省份数据 provinceRegions: [],//片区下省份数据
vehicleInfo_btn_edit: false,//编辑 vehicleInfo_btn_edit: false,//编辑
vehicleInfo_btn_add: false,//新增 vehicleInfo_btn_add: false,//新增
vehicleInfo_btn_apply: false,//申请预定 vehicleInfo_btn_apply: false,//申请预定
vehicleInfo_btn_ride:false,//出车 vehicleInfo_btn_ride: false,//出车
vehicleInfo_btn_ret:false,//删除 vehicleInfo_btn_ret: false,//删除
} }
}, },
created() { created() {
...@@ -1229,7 +1240,7 @@ ...@@ -1229,7 +1240,7 @@
} }
return getSonRegionByCodes(this.listQuery.addrProvince); return getSonRegionByCodes(this.listQuery.addrProvince);
}, },
getAllZoneList(){ getAllZoneList() {
this.allZoneArr = getAllZone(); this.allZoneArr = getAllZone();
return getAllZone(); return getAllZone();
}, },
...@@ -1350,8 +1361,8 @@ ...@@ -1350,8 +1361,8 @@
if (!this.$utils.isInteger(this.listQuery.zoneId)) { if (!this.$utils.isInteger(this.listQuery.zoneId)) {
return null; return null;
} }
this.allZoneArr.map(function(item){ this.allZoneArr.map(function (item) {
if(item.id == that.listQuery.zoneId){ if (item.id == that.listQuery.zoneId) {
getSysRegionByIds(item.provinceIds).then(response => { getSysRegionByIds(item.provinceIds).then(response => {
let listRs = undefined; let listRs = undefined;
if (!that.$utils.isEmpty(response.data)) { if (!that.$utils.isEmpty(response.data)) {
...@@ -1362,7 +1373,7 @@ ...@@ -1362,7 +1373,7 @@
} }
}); });
}, },
getValue(e){ getValue(e) {
this.listQuery.addrCity = undefined; this.listQuery.addrCity = undefined;
}, },
/** /**
...@@ -1380,8 +1391,9 @@ ...@@ -1380,8 +1391,9 @@
/** /**
* 刷新 * 刷新
* */ * */
reloadPage(){ reloadPage() {
this.state1 = ""; this.state1 = "";
this.vehicleArr = "";
this.listQuery = { this.listQuery = {
page: 1, page: 1,
limit: 20, limit: 20,
...@@ -1410,8 +1422,8 @@ ...@@ -1410,8 +1422,8 @@
/** /**
* 出车modal传递回来的数据 * 出车modal传递回来的数据
* */ * */
departureDialogEvent(e){ departureDialogEvent(e) {
if(e){ if (e) {
this.getList(); this.getList();
} }
this.departureDialogVisible = false; this.departureDialogVisible = false;
...@@ -1419,8 +1431,8 @@ ...@@ -1419,8 +1431,8 @@
/** /**
* 保养modal传递回来的数据 * 保养modal传递回来的数据
* */ * */
upkeepDialogEvent(e){ upkeepDialogEvent(e) {
if(e){ if (e) {
this.getList(); this.getList();
} }
this.upkeepDialogVisible = false; this.upkeepDialogVisible = false;
...@@ -1432,7 +1444,7 @@ ...@@ -1432,7 +1444,7 @@
name: "全部" name: "全部"
}; };
selectArry.push(iitem); selectArry.push(iitem);
this.allCompaniesArr.map(function(item){ this.allCompaniesArr.map(function (item) {
item.value = item.name; item.value = item.name;
selectArry.push(item); selectArry.push(item);
}); });
...@@ -1441,6 +1453,22 @@ ...@@ -1441,6 +1453,22 @@
// 调用 callback 返回建议列表的数据 // 调用 callback 返回建议列表的数据
cb(results); cb(results);
}, },
queryVehicleModelSearch(queryString, cb) {
let selectArry = [];
let iitem = {
value: "全部",
name: "全部"
};
selectArry.push(iitem);
this.allVehicleList.map(function (item) {
item.value = item.name;
selectArry.push(item);
});
this.selectVehicleModelArray = selectArry;
var results = queryString ? selectArry.filter(this.createFilter(queryString)) : selectArry;
// 调用 callback 返回建议列表的数据
cb(results);
},
createFilter(queryString) { createFilter(queryString) {
return (restaurant) => { return (restaurant) => {
return (restaurant.name.indexOf(queryString.toLowerCase()) != -1); return (restaurant.name.indexOf(queryString.toLowerCase()) != -1);
...@@ -1449,24 +1477,24 @@ ...@@ -1449,24 +1477,24 @@
/** /**
* 还车分公司 * 还车分公司
*/ */
handleSelectArrivalCompanyName(item){ handleSelectArrivalCompanyName(item) {
if(item.value == "全部"){ if (item.value == "全部") {
this.arrivalForm.arrivalBranchCompanyId = undefined; this.arrivalForm.arrivalBranchCompanyId = undefined;
} else { } else {
this.arrivalForm.arrivalBranchCompanyId = item.id; this.arrivalForm.arrivalBranchCompanyId = item.id;
} }
console.log(item); console.log(item);
}, },
handleSelectDepartureForm(item){ handleSelectDepartureForm(item) {
if(item.value == "全部"){ if (item.value == "全部") {
this.departureForm.departureBranchCompanyId = undefined; this.departureForm.departureBranchCompanyId = undefined;
} else { } else {
this.departureForm.departureBranchCompanyId = item.id; this.departureForm.departureBranchCompanyId = item.id;
} }
console.log(item); console.log(item);
}, },
handleSelectEexpectArrivalCompanyName(item){ handleSelectEexpectArrivalCompanyName(item) {
if(item.value == "全部"){ if (item.value == "全部") {
this.departureForm.expectArrivalBranchCompanyId = undefined; this.departureForm.expectArrivalBranchCompanyId = undefined;
} else { } else {
this.departureForm.expectArrivalBranchCompanyId = item.id; this.departureForm.expectArrivalBranchCompanyId = item.id;
...@@ -1476,8 +1504,8 @@ ...@@ -1476,8 +1504,8 @@
/** /**
* 提车分公司 * 提车分公司
* */ * */
handleSelect3(item){ handleSelect3(item) {
if(item.value == "全部"){ if (item.value == "全部") {
this.form4Apply.liftCompany = undefined; this.form4Apply.liftCompany = undefined;
} else { } else {
this.form4Apply.liftCompany = item.id; this.form4Apply.liftCompany = item.id;
...@@ -1487,8 +1515,8 @@ ...@@ -1487,8 +1515,8 @@
/** /**
* 还车分公司 * 还车分公司
* */ * */
handleSelect4(item){ handleSelect4(item) {
if(item.value == "全部"){ if (item.value == "全部") {
this.form4Apply.retCompany = undefined; this.form4Apply.retCompany = undefined;
} else { } else {
this.form4Apply.retCompany = item.id; this.form4Apply.retCompany = item.id;
...@@ -1498,8 +1526,8 @@ ...@@ -1498,8 +1526,8 @@
/** /**
* 所属分公司 * 所属分公司
* */ * */
handleSelectSubordinate(item){ handleSelectSubordinate(item) {
if(item.value == "全部"){ if (item.value == "全部") {
this.form.subordinateBranch = undefined; this.form.subordinateBranch = undefined;
// this.form.subordinateBranchName = ""; // this.form.subordinateBranchName = "";
} else { } else {
...@@ -1507,11 +1535,18 @@ ...@@ -1507,11 +1535,18 @@
// this.form.subordinateBranchName = item.name; // this.form.subordinateBranchName = item.name;
} }
}, },
handleVehicleModelSelectSubordinate(item) {
if (item.value == "全部") {
this.form.modelId = undefined;
} else {
this.form.modelId = item.id;
}
},
/** /**
* 停靠分公司 * 停靠分公司
* */ * */
handleSelectPark(item){ handleSelectPark(item) {
if(item.value == "全部"){ if (item.value == "全部") {
this.form.parkBranchCompanyId = undefined; this.form.parkBranchCompanyId = undefined;
this.form.parkBranchCompanyName = ""; this.form.parkBranchCompanyName = "";
} else { } else {
...@@ -1519,8 +1554,8 @@ ...@@ -1519,8 +1554,8 @@
this.form.parkBranchCompanyName = item.name; this.form.parkBranchCompanyName = item.name;
} }
}, },
handleSelect1(item){ handleSelect1(item) {
if(item.value == "全部"){ if (item.value == "全部") {
this.form.subordinateBranch = undefined; this.form.subordinateBranch = undefined;
} else { } else {
this.form.subordinateBranch = item.id; this.form.subordinateBranch = item.id;
...@@ -1528,18 +1563,25 @@ ...@@ -1528,18 +1563,25 @@
console.log(item); console.log(item);
}, },
handleSelect(item) { handleSelect(item) {
if(item.value == "全部"){ if (item.value == "全部") {
this.listQuery.subordinateBranch = undefined; this.listQuery.subordinateBranch = undefined;
} else { } else {
this.listQuery.subordinateBranch = item.id; this.listQuery.subordinateBranch = item.id;
} }
console.log(item); console.log(item);
}, },
handleVehicleModelSelect(item) {
if (item.value == "全部") {
this.listQuery.modelId = undefined;
} else {
this.listQuery.modelId = item.id;
}
},
/** /**
* 出车分公司 * 出车分公司
* */ * */
handleSelectPark1(item){ handleSelectPark1(item) {
if(item.value == "全部"){ if (item.value == "全部") {
this.departureForm.departureBranchCompanyId = undefined; this.departureForm.departureBranchCompanyId = undefined;
this.departureForm.departureBranchCompanyName = ""; this.departureForm.departureBranchCompanyName = "";
} else { } else {
...@@ -1579,7 +1621,7 @@ ...@@ -1579,7 +1621,7 @@
}, },
handleDepartureLog(row) { handleDepartureLog(row) {
this.$router.push({ this.$router.push({
path: '/vehicle/vehicleDepartureLog', path: '/vehicle/vehicleSchedulManage',
query: { query: {
numberPlate: row.numberPlate numberPlate: row.numberPlate
} }
...@@ -1594,12 +1636,12 @@ ...@@ -1594,12 +1636,12 @@
this.arrivalForm.arrivalBranchCompanyId = row.subordinateBranch; this.arrivalForm.arrivalBranchCompanyId = row.subordinateBranch;
let that = this; let that = this;
let selectArry = []; let selectArry = [];
this.allCompaniesArr.map(function(item){ this.allCompaniesArr.map(function (item) {
item.value = item.name; item.value = item.name;
selectArry.push(item); selectArry.push(item);
}); });
selectArry.map(function (iitem) { selectArry.map(function (iitem) {
if( row.subordinateBranch == iitem.id){ if (row.subordinateBranch == iitem.id) {
that.arrivalForm.arrivalBranchCompanyName = iitem.name; that.arrivalForm.arrivalBranchCompanyName = iitem.name;
} }
}); });
...@@ -1614,7 +1656,7 @@ ...@@ -1614,7 +1656,7 @@
* 收车-确定 * 收车-确定
*/ */
arrivalVehicleHandler() { arrivalVehicleHandler() {
if(this.arrivalForm.arrivalBranchCompanyName == "" || this.arrivalForm.arrivalBranchCompanyName == "全部"){ if (this.arrivalForm.arrivalBranchCompanyName == "" || this.arrivalForm.arrivalBranchCompanyName == "全部") {
this.arrivalForm.arrivalBranchCompanyId = undefined; this.arrivalForm.arrivalBranchCompanyId = undefined;
} }
arrivalVehicle(this.arrivalForm).then(response => { arrivalVehicle(this.arrivalForm).then(response => {
...@@ -1790,14 +1832,18 @@ ...@@ -1790,14 +1832,18 @@
4: { 4: {
code: 4, code: 4,
val: '出车' val: '出车'
} }/*,
5: {
code: 5,
val: '上牌中'
}*/
}; };
}, },
getBrand: function (code) { getBrand: function (code) {
if (!this.$utils.isInteger(code) || code == VEHICLE_CONSTANT_BRAND_CODE_UNKOWN) { if (!this.$utils.isInteger(code) || code == VEHICLE_CONSTANT_BRAND_CODE_UNKOWN) {
return '未知'; return '未知';
} }
return getConstantByTypeAndCode(VEHICLE_CONSTANT_VEHICLE_BRAND, code)?getConstantByTypeAndCode(VEHICLE_CONSTANT_VEHICLE_BRAND, code).val: '品牌不存在'; return getConstantByTypeAndCode(VEHICLE_CONSTANT_VEHICLE_BRAND, code) ? getConstantByTypeAndCode(VEHICLE_CONSTANT_VEHICLE_BRAND, code).val : '品牌不存在';
}, },
getAllBranch: () => { getAllBranch: () => {
return getConstantListByType(VEHICLE_CONSTANT_VEHICLE_BRAND); return getConstantListByType(VEHICLE_CONSTANT_VEHICLE_BRAND);
...@@ -1806,7 +1852,7 @@ ...@@ -1806,7 +1852,7 @@
if (!this.$utils.isInteger(code) || code == VEHICLE_CONSTANT_USE_TYPE_UNKOWN) { if (!this.$utils.isInteger(code) || code == VEHICLE_CONSTANT_USE_TYPE_UNKOWN) {
return '未知'; return '未知';
} }
return getConstantByTypeAndCode(VEHICLE_CONSTANT_VEHICLE_USE, code)?getConstantByTypeAndCode(VEHICLE_CONSTANT_VEHICLE_USE, code).val: '用途未知'; return getConstantByTypeAndCode(VEHICLE_CONSTANT_VEHICLE_USE, code) ? getConstantByTypeAndCode(VEHICLE_CONSTANT_VEHICLE_USE, code).val : '用途未知';
}, },
getAllUseType: () => { getAllUseType: () => {
return getConstantListByType(VEHICLE_CONSTANT_VEHICLE_USE); return getConstantListByType(VEHICLE_CONSTANT_VEHICLE_USE);
...@@ -1816,24 +1862,27 @@ ...@@ -1816,24 +1862,27 @@
let listQueryTemp = this.fillDateRange2Object(this.listQuery, 'mRange', 'mRangeDateStart', 'mRangeDateEnd'); let listQueryTemp = this.fillDateRange2Object(this.listQuery, 'mRange', 'mRangeDateStart', 'mRangeDateEnd');
listQueryTemp = this.fillDateRange2Object(listQueryTemp, 'aVRange', 'aVRangeDateStart', 'aVRangeDateEnd'); listQueryTemp = this.fillDateRange2Object(listQueryTemp, 'aVRange', 'aVRangeDateStart', 'aVRangeDateEnd');
listQueryTemp = this.fillDateRange2Object(listQueryTemp, 'insuranceDateRange', 'insuranceDateRangeStart', 'insuranceDateRangeEnd'); listQueryTemp = this.fillDateRange2Object(listQueryTemp, 'insuranceDateRange', 'insuranceDateRangeStart', 'insuranceDateRangeEnd');
if(!this.state1){ if (!this.state1) {
listQueryTemp.subordinateBranch = undefined; listQueryTemp.subordinateBranch = undefined;
} }
if (!this.vehicleArr) {
listQueryTemp.modelId = undefined;
}
page(listQueryTemp).then(response => { page(listQueryTemp).then(response => {
if(response.code==1){ if (response.code == 1) {
let totalCountRs = undefined; let totalCountRs = undefined;
let listRs = undefined; let listRs = undefined;
if (!this.$utils.isEmpty(response.data.data) && this.$utils.isInteger(response.data.totalCount)) { if (!this.$utils.isEmpty(response.data.data) && this.$utils.isInteger(response.data.totalCount)) {
listRs = response.data.data; listRs = response.data.data;
totalCountRs = response.data.totalCount; totalCountRs = response.data.totalCount;
listRs.map(function(item){ listRs.map(function (item) {
item.visible2 = false; item.visible2 = false;
}); });
} }
this.listLoading = false; this.listLoading = false;
this.list = listRs; this.list = listRs;
this.total = totalCountRs; this.total = totalCountRs;
}else{ } else {
this.list = []; this.list = [];
this.listLoading = false; this.listLoading = false;
} }
...@@ -1868,16 +1917,23 @@ ...@@ -1868,16 +1917,23 @@
}, },
handleUpdate(row) { handleUpdate(row) {
let selectArry = []; let selectArry = [];
let selectVehicleModelArry = [];
let iitem = { let iitem = {
value: "全部", value: "全部",
name: "全部" name: "全部"
}; };
selectArry.push(iitem); selectArry.push(iitem);
this.allCompaniesArr.map(function(item){ this.allCompaniesArr.map(function (item) {
item.value = item.name; item.value = item.name;
selectArry.push(item); selectArry.push(item);
}); });
selectVehicleModelArry.push(iitem);
this.allVehicleList.map(function (item) {
item.value = item.name;
selectVehicleModelArry.push(item);
});
this.selectArry = selectArry; this.selectArry = selectArry;
this.selectVehicleModelArray = selectVehicleModelArry;
getObj(row.id) getObj(row.id)
.then(response => { .then(response => {
let that = this; let that = this;
...@@ -1886,15 +1942,21 @@ ...@@ -1886,15 +1942,21 @@
this.form[key] = item; this.form[key] = item;
}); });
selectArry.map(function (iitem) { selectArry.map(function (iitem) {
if( that.form["subordinateBranch"] == iitem.id){ if (that.form["subordinateBranch"] == iitem.id) {
that.form.subordinateBranchName = iitem.name; that.form.subordinateBranchName = iitem.name;
that.form.subordinateBranch = iitem.id; that.form.subordinateBranch = iitem.id;
} }
if( that.form["parkBranchCompanyId"] == iitem.id){ if (that.form["parkBranchCompanyId"] == iitem.id) {
that.form.parkBranchCompanyName = iitem.name; that.form.parkBranchCompanyName = iitem.name;
that.form.parkBranchCompanyId = iitem.id; that.form.parkBranchCompanyId = iitem.id;
} }
}); });
selectVehicleModelArry.map(function (value) {
if (that.form["modelId"] == value.id){
that.form.vehicleModelName = value.name;
that.form.modelId = value.id;
}
});
this.fillDates2Range(this.form, 'insuranceDateRange4form', 'insuranceStartDate', 'insuranceEndDate'); this.fillDates2Range(this.form, 'insuranceDateRange4form', 'insuranceStartDate', 'insuranceEndDate');
this.dialogFormVisible = true; this.dialogFormVisible = true;
this.dialogStatus = 'update'; this.dialogStatus = 'update';
...@@ -1907,14 +1969,14 @@ ...@@ -1907,14 +1969,14 @@
this.resetTemp4Apply(); this.resetTemp4Apply();
let that = this; let that = this;
let selectArry = []; let selectArry = [];
this.allCompaniesArr.map(function(item){ this.allCompaniesArr.map(function (item) {
item.value = item.name; item.value = item.name;
selectArry.push(item); selectArry.push(item);
}); });
this.form4Apply.liftCompany = row.parkBranchCompanyId; this.form4Apply.liftCompany = row.parkBranchCompanyId;
this.form4Apply.vehicleId = row.id; this.form4Apply.vehicleId = row.id;
selectArry.map(function (iitem) { selectArry.map(function (iitem) {
if( row.parkBranchCompanyId == iitem.id){ if (row.parkBranchCompanyId == iitem.id) {
that.form4Apply.state3 = iitem.name; that.form4Apply.state3 = iitem.name;
} }
}); });
...@@ -2006,7 +2068,7 @@ ...@@ -2006,7 +2068,7 @@
* @param formName * @param formName
*/ */
apply(formName) { apply(formName) {
if(!this.form4Apply.state3 || this.form4Apply.state3 == "全部"){ if (!this.form4Apply.state3 || this.form4Apply.state3 == "全部") {
this.form4Apply.liftCompany = undefined; this.form4Apply.liftCompany = undefined;
this.$notify({ this.$notify({
title: '失败', title: '失败',
...@@ -2016,7 +2078,7 @@ ...@@ -2016,7 +2078,7 @@
}); });
return; return;
} }
if(!this.form4Apply.state4 || this.form4Apply.state4 == "全部"){ if (!this.form4Apply.state4 || this.form4Apply.state4 == "全部") {
this.form4Apply.retCompany = undefined; this.form4Apply.retCompany = undefined;
this.$notify({ this.$notify({
title: '失败', title: '失败',
...@@ -2029,8 +2091,8 @@ ...@@ -2029,8 +2091,8 @@
const set = this.$refs; const set = this.$refs;
set[formName].validate(valid => { set[formName].validate(valid => {
if (valid) { if (valid) {
if(this.form4Apply.bookType==6){ if (this.form4Apply.bookType == 6) {
if(this.form4Apply.upkeepIds.length==0){ if (this.form4Apply.upkeepIds.length == 0) {
this.$notify({ this.$notify({
title: '警告', title: '警告',
message: '请选择保养项目', message: '请选择保养项目',
...@@ -2040,10 +2102,10 @@ ...@@ -2040,10 +2102,10 @@
return false; return false;
} }
} }
this.form4Apply.upkeepIds = this.form4Apply.bookType==6?this.form4Apply.upkeepIds.join(","):'' this.form4Apply.upkeepIds = this.form4Apply.bookType == 6 ? this.form4Apply.upkeepIds.join(",") : ''
this.dialogFormVisible = false; this.dialogFormVisible = false;
book(this.form4Apply).then(res => { book(this.form4Apply).then(res => {
if(res.status==200){ if (res.status == 200) {
this.dialogForm4ApplyVisible = false; this.dialogForm4ApplyVisible = false;
this.getList(); this.getList();
this.$notify({ this.$notify({
...@@ -2052,7 +2114,7 @@ ...@@ -2052,7 +2114,7 @@
type: 'success', type: 'success',
duration: 2000 duration: 2000
}); });
}else{ } else {
this.$notify({ this.$notify({
title: '失败', title: '失败',
message: res.message, message: res.message,
...@@ -2102,10 +2164,11 @@ ...@@ -2102,10 +2164,11 @@
code: undefined, code: undefined,
parkBranchCompanyName: "",//停靠分公司名称 parkBranchCompanyName: "",//停靠分公司名称
parkBranchCompanyId: undefined,//停靠分公司id parkBranchCompanyId: undefined,//停靠分公司id
modelId:undefined,//车型id modelId: undefined,//车型id
numberPlate: undefined, numberPlate: undefined,
brand: undefined, brand: undefined,
subordinateBranchName: "", subordinateBranchName: "",
vehicleModelName:"",
subordinateBranch: undefined, subordinateBranch: undefined,
useType: undefined, useType: undefined,
vin: undefined, vin: undefined,
...@@ -2130,7 +2193,7 @@ ...@@ -2130,7 +2193,7 @@
bookStartDate: undefined, bookStartDate: undefined,
bookEndDate: undefined, bookEndDate: undefined,
state3: '', state3: '',
state4:'', state4: '',
retCompany: undefined, retCompany: undefined,
vehicle: undefined, vehicle: undefined,
selectedAccItem: undefined, selectedAccItem: undefined,
...@@ -2138,11 +2201,11 @@ ...@@ -2138,11 +2201,11 @@
liftAddr: undefined, liftAddr: undefined,
destination: undefined, destination: undefined,
remark: undefined, remark: undefined,
vehicleId:undefined, vehicleId: undefined,
bookType:undefined, bookType: undefined,
vehicleUsername:undefined, vehicleUsername: undefined,
vehicleUserPhone:undefined, vehicleUserPhone: undefined,
upkeepIds:[], upkeepIds: [],
}; };
}, },
resetTemp4BookInfo() { resetTemp4BookInfo() {
......
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
<el-form-item label="车牌"> <el-form-item label="车牌">
<el-input v-model="listQuery.numberPlate" placeholder="请输入车牌"></el-input> <el-input v-model="listQuery.numberPlate" placeholder="请输入车牌"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="车辆编码">
<el-input type="number" style="width: 200px;" v-model.number="listQuery.code" placeholder="请输入车辆编码"></el-input>
</el-form-item>
<el-form-item label="用途"> <el-form-item label="用途">
<el-select class="filter-item" v-model="listQuery.useType" placeholder="请选择用途"> <el-select class="filter-item" v-model="listQuery.useType" placeholder="请选择用途">
<el-option :key="undefined" label="无" :value="undefined"></el-option> <el-option :key="undefined" label="无" :value="undefined"></el-option>
...@@ -473,6 +476,10 @@ ...@@ -473,6 +476,10 @@
} }
}, },
created() { created() {
const numberPlate = this.$route.query.numberPlate;
if (numberPlate) {
this.listQuery.numberPlate = numberPlate;
}
this.getList(); this.getList();
this.getAllVehicleType(); this.getAllVehicleType();
let currentMonth = getCurrentMonth(); let currentMonth = getCurrentMonth();
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<div class="filter-container"> <div class="filter-container">
<el-input style="width: 200px;" placeholder="车牌号" <el-input style="width: 200px;" placeholder="车牌号"
v-model="listQuery.numberPlate"></el-input> v-model="listQuery.numberPlate"></el-input>
<el-input type="number" style="width: 200px;" v-model.number="listQuery.code" placeholder="请输入车辆编码"></el-input>
<el-date-picker <el-date-picker
v-model="listQuery.selectedMonth" v-model="listQuery.selectedMonth"
type="month" type="month"
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<div class="filter-container"> <div class="filter-container">
<el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="车牌号" <el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="车牌号"
v-model="listQuery.numberPlate"></el-input> v-model="listQuery.numberPlate"></el-input>
<el-input type="number" style="width: 200px;" v-model.number="listQuery.code" class="filter-item" placeholder="请输入车辆编码"></el-input>
<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="handleFilter">搜索</el-button>
</div> </div>
<el-table :key='tableKey' :data="list" v-loading.body="listLoading" border fit highlight-current-row <el-table :key='tableKey' :data="list" v-loading.body="listLoading" border fit highlight-current-row
......
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