Commit 06076d4e authored by lixy's avatar lixy

违章查询

parent b57cefce
...@@ -6,4 +6,32 @@ export function page(query) { ...@@ -6,4 +6,32 @@ export function page(query) {
method: 'get', method: 'get',
params:query params:query
}); });
} }
\ No newline at end of file
/**
* 根据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: '/api/order/orderViolation/saveOrderViolation',
method: 'post',
data: params
});
}
<template>
<el-dialog title="违章查询" :visible.sync="isVisible">
<el-form>
<el-row>
<el-col :span="24">
<el-form-item label="订单号">
<span>{{row.no}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="订单金额">
<span>{{row.realAmount}}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="车牌号">
<span>{{row.vehicleNumberPlat}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="用户ID/实名">
<span>{{row.userId}}</span>/<span>{{row.username}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="取车">
<span>{{dateFormat(row.orderRentVehicleDetail.startTime)}}</span>
</el-form-item>
</el-col>
<el-col :span="16">
<el-form-item label="交车公司">
<span>{{row.startCompanyName}}</span>
<span>({{row.orderRentVehicleDetail.startCityName}}{{row.orderRentVehicleDetail.startAddr}})</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="还车">
<span>{{dateFormat(row.orderRentVehicleDetail.endTime)}}</span>
</el-form-item>
</el-col>
<el-col :span="16">
<el-form-item label="收车公司">
<span><span>{{row.endCompanyName}}</span>
<span>({{row.orderRentVehicleDetail.endCityName}}{{row.orderRentVehicleDetail.endAddr}})</span></span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="违章截图" :style="{display:'block'}">
<!--<el-upload-->
<!--action="https://xxtest.upyuns.com/api/universal/file/app/unauth/admin/upload"-->
<!--list-type="picture-card"-->
<!--:headers="getHeaderWithToken"-->
<!--:on-success="handleSuccess"-->
<!--:on-remove="handleRemove">-->
<!--<i class="el-icon-plus"></i>-->
<!--</el-upload>-->
<!--<el-dialog v-model="dialogVisible" size="tiny">-->
<!--<img width="100%" :src="dialogImageUrl" alt="">-->
<!--</el-dialog>-->
<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">
<!--<div slot="tip" class="el-upload__tip">最多上传5张</div>-->
<i class="el-icon-plus"></i>
</el-upload>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="违章罚款" style="display: inline-block;">
<el-input v-model="price" type="number" placeholder="请输入违章罚款金额"></el-input>
</el-form-item>
</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>
</template>
<script>
import {
page,
saveOrderViolation
} from 'api/order/rentVehicle';
import {mapGetters} from 'vuex';
import {
formatDate
} from '../../../utils/dateFormattor';
import {
getToken
} from '../../../utils/auth';
import {
getOneIllegalRow
} from 'api/order/rentVehicle';
import ElRow from "element-ui/packages/row/src/row";
import ElInput from "../../../../node_modules/element-ui/packages/input/src/input.vue";
import ElCol from "element-ui/packages/col/src/col";
import ElFormItem from "../../../../node_modules/element-ui/packages/form/src/form-item.vue";
import ElForm from "../../../../node_modules/element-ui/packages/form/src/form.vue";
export default {
props: ["row"],
name: 'illegalDialog',
components: {
ElForm,
ElFormItem,
ElCol,
ElInput,
ElRow
},
data() {
return {
price: undefined,//违章罚款金额
isVisible: false,
fileList2:[],//违章截图
}
},
created() {
},
watch: {
isVisible(newValue, oldValue){
if(!newValue){
this.$emit('illegalEvent', false);
}
},
},
mounted() {
let that = this;
// if(that.row.refundStatus == 3) {
//refundStatus退款状态 0、未退款 1、已退还所有(取消订单时)2、 已退还部分(保留违章预备金)3、已退还所有押金(扣除该扣除的)
that.getOne(that.row.detailId);
// }
this.isVisible = true;
},
computed: {
...mapGetters([
'elements',
]),
getHeaderWithToken() {
return {Authorization: getToken()};
}
},
methods: {
/**
* 根据id查询一条记录
* */
getOne(id){
let t = this;
getOneIllegalRow(id).then(response => {
if(response.status == 200){
let arr = response.data.picture.split(",");
let fileList2 = [];
let p = {};
arr.map(function(item){
p = {
url: item
};
fileList2.push(p);
});
t.price = parseFloat(response.data.price);
t.fileList2 = fileList2;
} else {
this.$notify({
title: '失败',
message: response.menu,
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;
},
/**
* 确定
* */
okHandler() {
let arr = [];
this.fileList2.map(function(item){
arr.push(item.url);
});
let params = {
picture:arr.join(","),
price:this.price,
detailId: this.row.detailId
};
saveOrderViolation(params).then(response => {
if (response.status === 200) {
this.$notify({
title: '成功',
message: '创建成功',
type: 'success',
duration: 2000
});
this.$emit('illegalEvent', false);
} else {
this.$notify({
title: '创建失败',
message: '操作失败!',
type: 'error',
duration: 2000
});
}
});
},
/**
* 弹框-取消
* */
cancel() {
this.$emit('illegalEvent', false);
},
/**
* 格式化时间
* @param timestamp
* @returns {*}
*/
dateFormat(timestamp) {
let date = new Date(timestamp);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
return formatDate(date, 'yyyy-MM-dd hh:mm:ss');
},
}
}
</script>
<style>
.el-form-item__content{
display: inline-block;
}
</style>
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
<el-option :key="4" label="待出行" :value="4"></el-option> <el-option :key="4" label="待出行" :value="4"></el-option>
<el-option :key="5" label="出行中" :value="5"></el-option> <el-option :key="5" label="出行中" :value="5"></el-option>
<el-option :key="6" label="已完成" :value="6"></el-option> <el-option :key="6" label="已完成" :value="6"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -37,7 +36,6 @@ ...@@ -37,7 +36,6 @@
</el-form> </el-form>
<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-button class="filter-item" type="primary" v-waves icon="delete" @click="clearSearch">清除搜索</el-button> <el-button class="filter-item" type="primary" v-waves icon="delete" @click="clearSearch">清除搜索</el-button>
</el-button>
</div> </div>
<el-table :key='tableKey' :data="list" v-loading.body="listLoading" <el-table :key='tableKey' :data="list" v-loading.body="listLoading"
border fit highlight-current-row border fit highlight-current-row
...@@ -85,7 +83,7 @@ ...@@ -85,7 +83,7 @@
<span>{{scope.row.orderAmount}}</span> <span>{{scope.row.orderAmount}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="110" align="center" label="状态"> <el-table-column width="110" align="center" label="状态">
<template scope="scope"> <template scope="scope">
<span v-if="scope.row.status == '2'">取消</span> <span v-if="scope.row.status == '2'">取消</span>
...@@ -95,16 +93,19 @@ ...@@ -95,16 +93,19 @@
<span v-if="scope.row.status == '6'">已完成</span> <span v-if="scope.row.status == '6'">已完成</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="操作" width="150">
<!-- <el-table-column align="center" label="操作" width="150">
<template scope="scope"> <template scope="scope">
<el-button v-if="btn_buy && scope.row.state == 0" size="small" type="success" @click="handleBuy(scope.row)">订单详情</el-button> <!--status订单状态\n0--删除\n1--创建订单\n2--取消\n3--待付款\n4--待出行\n5--出行中(进行中)\n6--已完成 refundStatus退款状态 0、未退款 1、已退还所有(取消订单时)2、 已退还部分(保留违章预备金)3、已退还所有押金(扣除该扣除的)-->
<el-button v-if="btn_buy && scope.row.state == 0" size="small" type="success" @click="handleBuy(scope.row)">操作</el-button> <!--v-if="scope.row.status == 6"-->
<el-button size="small" v-if="scope.row.status == 6" type="success" @click="illegalInquiry(scope.row)">违章查询</el-button>
</template> </template>
</el-table-column> --> </el-table-column>
</el-table> </el-table>
<!--违章查询弹框-->
<Illegal :row="currentRow" v-if="illegalVisible" v-on:illegalEvent = "illegalEvent"></Illegal>
<div v-show="!listLoading" class="pagination-container"> <div v-show="!listLoading" class="pagination-container">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:current-page.sync="listQuery.page" :page-sizes="[10,20,30, 50]" :page-size="listQuery.limit" :current-page.sync="listQuery.page" :page-sizes="[10,20,30, 50]" :page-size="listQuery.limit"
...@@ -114,16 +115,19 @@ ...@@ -114,16 +115,19 @@
</template> </template>
<script> <script>
import Illegal from "./illegalModal";//违章查询
import {
formatDate
} from '../../../utils/dateFormattor';
import { import {
page page
} from 'api/order/rentVehicle'; } from 'api/order/rentVehicle';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import rsCode from '../../../utils/rsCode';
import {
formatDate
} from '../../../utils/dateFormattor';
export default { export default {
name: 'branchCompanyStock', name: 'branchCompanyStock',
components: {
Illegal,
},
data() { data() {
return { return {
form: { form: {
...@@ -135,6 +139,7 @@ ...@@ -135,6 +139,7 @@
count: null, count: null,
state: null state: null
}, },
illegalVisible: false,//违章查询弹框
rules: { rules: {
// companyName: [ // companyName: [
// { // {
...@@ -144,20 +149,6 @@ ...@@ -144,20 +149,6 @@
// } // }
// ], // ],
}, },
applyState: {
'-1': {
key: -1,
label: '放弃购买'
},
0: {
key: 0,
label: '申请中'
},
1: {
key: 1,
label: '确认购买'
}
},
list: null, list: null,
total: null, total: null,
listLoading: true, listLoading: true,
...@@ -186,36 +177,24 @@ ...@@ -186,36 +177,24 @@
computed: { computed: {
...mapGetters([ ...mapGetters([
'elements' 'elements'
]), ])
provinceRegions() {
return getSonRegionByCodes(1);
},
cityRegions() {
if (!this.$utils.isInteger(this.form.addrProvince)) {
return null;
}
return getSonRegionByCodes(this.form.addrProvince);
}
}, },
methods: { methods: {
handleBuy(row) { /**
this.$confirm('此操作将确认购买, 是否继续?', '提示', { * 操作-违章查询按钮,显示违章弹框
confirmButtonText: '确定', */
cancelButtonText: '取消', illegalInquiry(row){
type: 'warning' this.currentRow = row;
}) this.illegalVisible = true;
.then(() => { },
buyStock(row.id) /**
.then(() => { * 关闭违章查询弹框
this.$notify({ * */
title: '成功', illegalEvent(params){
message: '操作成功', this.illegalVisible = false;
type: 'success', if(params){
duration: 2000 console.log(params);
}); }
this.getList();
});
});
}, },
handleCancel(row) { handleCancel(row) {
this.$confirm('此操作将放弃购买, 是否继续?', '提示', { this.$confirm('此操作将放弃购买, 是否继续?', '提示', {
...@@ -235,26 +214,6 @@ ...@@ -235,26 +214,6 @@
this.getList(); this.getList();
}); });
}); });
},
handleDelete(row) {
this.$confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
delObj(row.id)
.then(() => {
this.$notify({
title: '成功',
message: '删除成功',
type: 'success',
duration: 2000
});
const index = this.list.indexOf(row);
this.list.splice(index, 1);
});
});
}, },
handleFilter() { handleFilter() {
this.listQuery.page = 1; this.listQuery.page = 1;
...@@ -279,6 +238,9 @@ ...@@ -279,6 +238,9 @@
} }
this.getList() this.getList()
}, },
/**
* 获取订单列表
*/
getList() { getList() {
this.listLoading = true; this.listLoading = true;
console.log(this.listQuery) console.log(this.listQuery)
......
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