Commit 96b4f098 authored by denghr's avatar denghr

车辆预约信息

parent 8bc28350
...@@ -53,3 +53,30 @@ export function ret(data) { ...@@ -53,3 +53,30 @@ export function ret(data) {
data: data data: data
}); });
} }
/**
* 根据id获取一条违章查询记录
* @param query
*/
export function getOneIllegalRow(id) {
return fetch({
url: '/api/order/orderViolation/getOne/' + id,
method: 'get'
});
}
/**
* 保存违章记录
* @param query
* {price:图片地址(多个逗号分割)
price:退款总金额
detailId:租车订单id
}
*/
export function saveOrderViolation(params) {
return fetch({
url: '/vehicle/departure/app/save',
method: 'post',
data: params
});
}
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<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>
<el-option v-for="(val, key, index) in getAllBookRecordStatus() " :key="val.code" :label="val.val" <el-option v-for="(val, key, index) in statusList " :key="val.code" :label="val.val"
:value="val.code"></el-option> :value="val.code"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="所属公司"> <el-form-item label="停靠公司">
<el-select class="filter-item" v-model="listQuery.liftCompany" placeholder="请选择" @change="getAllBranchCompanyChange"> <el-select class="filter-item" v-model="listQuery.liftCompany" placeholder="请选择" @change="getAllBranchCompanyChange">
<el-option :key="undefined" label="无" :value="undefined"></el-option> <el-option :key="undefined" label="无" :value="undefined"></el-option>
<el-option v-for="val in allBranchCompany" :key="val.id" :label="val.name" :value="val.id"> </el-option> <el-option v-for="val in allBranchCompany" :key="val.id" :label="val.name" :value="val.id"> </el-option>
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<el-table-column align="center" label="停靠公司" width="120"> <el-table-column align="center" label="停靠公司" width="120">
<template scope="scope"> <template scope="scope">
<span>{{scope.row.parkCompanyName}}</span> <span>{{scope.row.liftCompanyName}}</span>
</template> </template>
</el-table-column> </el-table-column>
...@@ -189,18 +189,18 @@ ...@@ -189,18 +189,18 @@
</el-table-column> </el-table-column>
<el-table-column align="center" label="操作" width="250"> <el-table-column align="center" label="操作" width="250">
<template scope="scope"> <template scope="scope">
<el-button size="small" type="success" @click="handleBookInfo(scope.row)">预订信息</el-button> <!-- <el-button size="small" type="success" @click="handleBookInfo(scope.row)">预订信息</el-button> -->
<el-button v-if="scope.row.haveViolation" size="small" type="success" @click="weizhang(scope.row)">违章记录</el-button> <el-button size="small" type="success" v-if="scope.row.status==3" @click="illegalInquiry(scope.row)">违章记录</el-button>
<el-button v-if="bookRecord_btn_prove&&scope.row.status==1" size="small" type="success" @click="handleProve(scope.row)">通过 <el-button v-if="bookRecord_btn_prove&&scope.row.status==1" size="small" type="success" @click="handleProve(scope.row)">通过
</el-button> </el-button>
<el-button v-if="bookRecord_btn_reject&&scope.row.status==1" size="small" type="danger" @click="handleReject(scope.row)">驳回 <el-button v-if="bookRecord_btn_reject&&scope.row.status==1" size="small" type="danger" @click="handleReject(scope.row)">驳回
</el-button> </el-button>
<el-button v-if="bookRecord_btn_lift && checkIfProved(scope.row.status)" size="small" type="success" <!-- <el-button v-if="bookRecord_btn_lift && checkIfProved(scope.row.status)" size="small" type="success"
@click="handleLift(scope.row)">提车 @click="handleLift(scope.row)">提车
</el-button> </el-button>
<el-button v-if="bookRecord_btn_ret && checkIfLift(scope.row.status)" size="small" type="success" <el-button v-if="bookRecord_btn_ret && checkIfLift(scope.row.status)" size="small" type="success"
@click="handleRet(scope.row)">还车 @click="handleRet(scope.row)">还车
</el-button> </el-button> -->
<el-button v-if="bookRecord_btn_unbook && checkIfProved(scope.row.status)" size="small" type="danger" <el-button v-if="bookRecord_btn_unbook && checkIfProved(scope.row.status)" size="small" type="danger"
@click="handleUnbook(scope.row)">取消预定 @click="handleUnbook(scope.row)">取消预定
</el-button> </el-button>
...@@ -439,6 +439,38 @@ ...@@ -439,6 +439,38 @@
</div> </div>
</el-dialog> </el-dialog>
<el-dialog title="违章查询" :visible.sync="illegalVisible">
<el-form>
<el-row>
<el-col>
<el-form-item label="违章截图" :style="{display:'block'}">
<el-upload
class="upload-demo"
:headers="getHeaderWithToken"
action="https://xxtest.upyuns.com/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>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="违章罚款">
<el-input v-model="price" type="number" placeholder="请输入违章罚款金额" style="width: 50%;margin-right:10px"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel">取 消</el-button>
<el-button type="primary" @click="okHandler('form')">确 定</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
...@@ -450,7 +482,9 @@ ...@@ -450,7 +482,9 @@
getObj, getObj,
lift, lift,
ret, ret,
unbook unbook,
getOneIllegalRow,
saveOrderViolation
} from 'api/vehicle/bookRecord'; } from 'api/vehicle/bookRecord';
...@@ -477,7 +511,9 @@ ...@@ -477,7 +511,9 @@
deepCopyDate, deepCopyDate,
newEast8Date newEast8Date
} from 'utils/dateUtils'; } from 'utils/dateUtils';
import {
getToken
} from '../../../utils/auth';
import { import {
BOOK_RECORD_STATUS_APPLY, BOOK_RECORD_STATUS_APPLY,
BOOK_RECORD_STATUS_PROVED, BOOK_RECORD_STATUS_PROVED,
...@@ -495,6 +531,40 @@ ...@@ -495,6 +531,40 @@
}, },
data() { data() {
return { return {
statusList:[
{
code:'1',
val:'申请中'
},
{
code:'2',
val:'已通过'
},
{
code:'3',
val:'已归还'
},
{
code:'4',
val:'拒绝'
},
{
code:'5',
val:'逾期归还'
},
{
code:'6',
val:'取消预订'
},
{
code:'7',
val:'已提车'
},
],
detailId:'',
illegalVisible:false,
price: undefined,//违章罚款金额
fileList2:[],//违章截图
detailItem:{}, detailItem:{},
dialogDetailVisible:false, dialogDetailVisible:false,
baranchQuery: { baranchQuery: {
...@@ -660,6 +730,9 @@ ...@@ -660,6 +730,9 @@
'elements', 'elements',
'bookRecordStatus' 'bookRecordStatus'
]), ]),
getHeaderWithToken() {
return {Authorization: getToken()};
},
//获取大区列表 //获取大区列表
getAllZoneList(){ getAllZoneList(){
return getAllZone(); return getAllZone();
...@@ -681,6 +754,84 @@ ...@@ -681,6 +754,84 @@
} }
}, },
methods: { methods: {
/**
* 确定
* */
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
});
}
});
},
/**
* 上传成功
* */
handleSuccess(res, file) {
let c = {url: res.data};
this.fileList2.push(c);
this.showLoadingBody = false;
},
/**
* 删除违章图片
* */
handleRemove(file, fileList){
this.fileList2 = fileList;
},
/**
* 操作-违章查询按钮,显示违章弹框
*/
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){ handleDetail(row){
this.detailItem = row; this.detailItem = row;
this.dialogDetailVisible = true; this.dialogDetailVisible = true;
...@@ -1020,7 +1171,14 @@ ...@@ -1020,7 +1171,14 @@
}).then(() => { }).then(() => {
unbook(row.id) unbook(row.id)
.then(response => { .then(response => {
if (response.code === rsCode.code.VEHICLE_BOOKED_INFO_ALREADY_CHANGED) { if(response.status==500){
this.$notify({
title: '失败',
message: response.message,
type: 'error',
duration: 2000
});
}else if (response.code === rsCode.code.VEHICLE_BOOKED_INFO_ALREADY_CHANGED) {
this.$notify({ this.$notify({
title: '失败', title: '失败',
message: rsCode.msg[rsCode.code.VEHICLE_BOOKED_INFO_ALREADY_CHANGED], message: rsCode.msg[rsCode.code.VEHICLE_BOOKED_INFO_ALREADY_CHANGED],
...@@ -1043,7 +1201,11 @@ ...@@ -1043,7 +1201,11 @@
}); });
} }
this.getList(); this.getList();
}); }).catch(response=>{
console.log(response)
}
);
}); });
}, },
resetTemp4Lift() { resetTemp4Lift() {
......
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