Commit 267d438a authored by denghr's avatar denghr

排班表取消预订,驳回接口修改

parent a9b6fcac
......@@ -32,10 +32,11 @@ export function reject(obj) {
});
}
export function unbook(id) {
export function unbook(obj) {
return fetch({
url: '/vehicle/vehicleInfo/unbook/4employee/' + id,
method: 'delete'
url: '/vehicle/vehicleInfo/unbook/4employee',
method: 'delete',
data:obj
});
}
......
......@@ -37,20 +37,22 @@ export function agreeBook(bookRecordId) {
/**
* 取消
*/
export function cancleBook(bookRecordId) {
export function cancleBook(obj) {
return fetch({
url: '/vehicle/vehicleInfo/unbook/4employee/' + bookRecordId,
method: 'delete'
url: '/vehicle/vehicleInfo/unbook/4employee',
method: 'delete',
data:obj
});
}
/**
* 拒绝
*/
export function rejectBook(bookRecordId) {
export function rejectBook(obj) {
return fetch({
url: '/vehicle/vehicleInfo/book/4employee/reject/' + bookRecordId,
method: 'put'
url: '/vehicle/vehicleInfo/book/4employee/reject',
method: 'put',
data: obj
});
}
......
......@@ -13,6 +13,13 @@
<el-input v-model="listQuery.numberPlate" placeholder="请输入车牌号"></el-input>
</el-form-item>
<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-select class="filter-item" v-model="listQuery.zoneId" placeholder="请选择" @change="getProvinceRegions">
<el-option :key="undefined" label="无" :value="undefined"></el-option>
......@@ -260,8 +267,8 @@
<el-row>
<el-col :span="24">
<el-form-item label="使用人">
<span v-if="detailItem.vehicleDepartureLogVo">{{detailItem.vehicleDepartureLogVo.user}}</span>
<span style="margin-left:10px" v-if="detailItem.vehicleDepartureLogVo">{{detailItem.vehicleDepartureLogVo.userTel}}</span>
<span>{{detailItem.vehicleUsername}}</span>
<span style="margin-left:10px">{{detailItem.vehicleUserPhone}}</span>
</el-form-item>
</el-col>
</el-row>
......@@ -729,6 +736,48 @@
val:'已提车'
},
],
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,//违章罚款金额
......@@ -754,7 +803,8 @@
liftCompany: undefined,
numberPlate: undefined,
selectedMonth: undefined,
status: undefined
status: undefined,
bookType:undefined
},
inline: true,
dialogFormVisible: false,
......@@ -1394,38 +1444,27 @@
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
unbook(row.id)
var obj = {
vehicleBookRecordId:row.id
}
unbook(obj)
.then(response => {
if(response.status==500){
if(response.code==1){
this.$notify({
title: '失败',
message: response.message,
type: 'error',
duration: 2000
});
}else 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',
title: '成功',
message: '操作成功',
type: 'success',
duration: 2000
});
} else if (response.code === rsCode.code.VEHICLE_BOOKED_RECORD_ALREADY_CHANGED) {
this.getList();
}else{
this.$notify({
title: '失败',
message: rsCode.msg[rsCode.code.VEHICLE_BOOKED_RECORD_ALREADY_CHANGED],
message: response.message,
type: 'error',
duration: 2000
});
} else if (response.code === rsCode.RS_CODE_SUC) {
this.$notify({
title: '成功',
message: '操作成功',
type: 'success',
duration: 2000
});
}
this.getList();
}
}).catch(response=>{
console.log(response)
}
......
......@@ -10,7 +10,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="车辆编码">
<el-input v-model.number="listQuery.code" placeholder="请输入车辆编码"></el-input>
<el-input type="number" v-model.number="listQuery.code" placeholder="请输入车辆编码"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
......@@ -1822,18 +1822,23 @@
listQueryTemp.subordinateBranch = undefined;
}
page(listQueryTemp).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.visible2 = false;
});
if(response.code==1){
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.visible2 = false;
});
}
this.listLoading = false;
this.list = listRs;
this.total = totalCountRs;
}else{
this.list = [];
this.listLoading = false;
}
this.listLoading = false;
this.list = listRs;
this.total = totalCountRs;
})
},
getAddrStr(branchCompany) {
......
......@@ -89,7 +89,21 @@
* */
cancel() {
console.log("展览取消用车");
cancleBook(this.currentItem.ii.vehicleBookRecord.id).then(response => {this.$emit("zhanlanDialogEvent", true);});
var obj = {
vehicleBookRecordId:this.currentItem.ii.vehicleBookRecord.id
}
cancleBook(obj).then(response => {
if(response.code==1){
this.$emit("zhanlanDialogEvent", true);
}else{
this.$notify({
title: '失败',
message: response.message,
type: 'error',
duration: 2000
});
}
});
},
/**
* 确定用车
......@@ -110,7 +124,21 @@
*/
notAgree(){
console.log("不同意");
rejectBook(this.currentItem.ii.vehicleBookRecord.id).then(response => {this.$emit("zhanlanDialogEvent", true);});
var obj = {
vehicleBookRecordId:this.currentItem.ii.vehicleBookRecord.id
}
rejectBook(obj).then(response => {
if(response.code==1){
this.$emit("zhanlanDialogEvent", true);
}else{
this.$notify({
title: '失败',
message: response.message,
type: 'error',
duration: 2000
});
}
});
},
}
}
......
......@@ -102,8 +102,22 @@
* 保养-弹框-取消
* */
cancel() {
cancleBook(this.currentItem.ii.vehicleBookRecord.id).then(response => {this.$emit("zhanlanDialogEvent", true);});
this.$emit("baoyangDialogEvent", true);
var obj = {
vehicleBookRecordId:this.currentItem.ii.vehicleBookRecord.id
}
cancleBook(obj).then(response => {
if(response.code==1){
this.$emit("zhanlanDialogEvent", true);
this.$emit("baoyangDialogEvent", true);
}else{
this.$notify({
title: '失败',
message: response.message,
type: 'error',
duration: 2000
});
}
});
},
/**
* 同意
......@@ -117,7 +131,21 @@
*/
notAgree(){
console.log("不同意");
rejectBook(this.currentItem.ii.vehicleBookRecord.id).then(response => {this.$emit("zhanlanDialogEvent", true);});
var obj = {
vehicleBookRecordId:this.currentItem.ii.vehicleBookRecord.id
}
rejectBook(obj).then(response => {
if(response.code==1){
this.$emit("baoyangDialogEvent", true);
}else{
this.$notify({
title: '失败',
message: response.message,
type: 'error',
duration: 2000
});
}
});
},
}
}
......
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