Commit 267d438a authored by denghr's avatar denghr

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

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