qa-prevention-xgf-app/pages/door_access_control/vehicle_info/index.vue

206 lines
5.3 KiB
Vue
Raw Permalink Normal View History

2025-07-19 10:03:05 +08:00
<template>
<view class="content">
<view class="search card">
<u--input
prefixIcon="search"
placeholder="请输入车牌号"
2025-07-19 10:03:05 +08:00
border="surround"
v-model="LICENCE_NO"
2025-07-19 10:03:05 +08:00
clearable
shape="circle"
></u--input>
<view class="bth-mini ml-10">
<u-button type="success" text="确定" @click="resetList"></u-button>
</view>
</view>
<u-list @scrolltolower="scrolltolower" v-if="list.length > 0">
<u-list-item v-for="(item, index) in list" :key="index">
<view>
<view class="flex-between main-title">
<text>车牌号{{ item.LICENCE_NO }}</text>
</view>
<view class="flex-between mt-10 subtitle">
<text>车牌类型{{ VEHICLE_LICENSE_PLATE_TYPE_MAP[item.LICENCE_TYPE] }}</text>
<text>车辆类型{{ getVehicleTypeName(item.VEHICLE_TYPE) }}</text>
2025-07-19 10:03:05 +08:00
</view>
<view class="flex-between mt-10 subtitle">
2025-07-21 15:32:28 +08:00
<text>车辆所属部门{{ item.JG_DEPT_NAME }}</text>
<text>车辆归属人{{ item.JG_USER_NAME }}</text>
2025-07-19 10:03:05 +08:00
</view>
<view class="flex-between mt-10 subtitle">
2025-07-21 15:32:28 +08:00
<text>车辆进/出港状态{{ item.vehicleArrivalStatus || '出港' }}</text>
<text> 审核状态{{ IS_AUDIT_LIST[item.IS_AUDIT] }} </text>
2025-07-19 10:03:05 +08:00
</view>
<view class="flex-between mt-10 subtitle">
<text>车辆来源{{ VEHICLE_OWNERSHIP_TYPE_MAP[parseInt(item.CAR_FROM)] }}</text>
2025-07-19 10:03:05 +08:00
</view>
<view class="mt-10 see_btn">
<view class="wrap">
<u-button type="primary" text="查看" size="mini"
@click="fnNavigatorView(item.VEHICLE_ID)"></u-button>
</view>
<view class="wrap ml-10">
2025-07-21 15:32:28 +08:00
<u-button type="primary" text="修改" size="mini"
@click="fnNavigatorAdd(item.VEHICLE_ID)"></u-button>
</view>
<view class="wrap ml-10">
<u-button type="error" text="删除" size="mini"
@click="fnDelete(item.VEHICLE_ID)"></u-button>
2025-07-19 10:03:05 +08:00
</view>
</view>
</view>
</u-list-item>
</u-list>
<empty v-else></empty>
<fab-button @click="fnNavigatorAdd('')"/>
</view>
</template>
<script>
import FabButton from '@/components/fab_button/index.vue'
import {getVehiclemessagePageList, getVehicleTypeList, setVehiclemessageDelete} from "@/api";
2025-07-19 10:03:05 +08:00
export default {
components: {
FabButton,
},
data() {
return {
VEHICLE_LICENSE_PLATE_TYPE_MAP: {
0: "白牌",
1: "蓝牌",
2: "黄牌",
3: "绿牌",
4: "黑牌",
},
VEHICLE_TYPE_MAP: [],
2025-07-19 10:03:05 +08:00
AUDIT_STATUS_MAP: {
1: "待审核",
2: "已审核",
3: "审核驳回",
},
2025-07-21 15:32:28 +08:00
VEHICLE_OWNERSHIP_TYPE_MAP: {
0: "监管",
1: "企业",
2: "相关方",
},
IS_AUDIT_LIST: {
1: "待审核",
2: "审核通过",
3: "审核驳回",
2025-07-21 15:32:28 +08:00
},
LICENCE_NO: '',
2025-07-19 10:03:05 +08:00
pageSize: 10,
currentPage: 1,
totalPage: 0,
list: [],
}
},
computed: {
userInfo() {
return this.$store.getters.getUserInfo
}
},
onShow() {
2025-07-23 09:32:58 +08:00
this.resetList()
this.getVehicleTypes()
2025-07-19 10:03:05 +08:00
},
methods: {
async getData() {
const resData = await getVehiclemessagePageList({ LICENCE_NO: this.LICENCE_NO, type: 1, CAR_FROM: 2, curPage: this.currentPage, limit: this.pageSize});
2025-07-19 10:03:05 +08:00
this.list = [...this.list, ...resData.varList];
this.totalPage = resData.page.totalPage;
},
2025-07-23 09:32:58 +08:00
fnDelete(VEHICLE_ID) {
uni.showModal({
title: '提示',
content: '确定要删除这条记录?',
success: async res => {
if (res.confirm) {
await setVehiclemessageDelete({
VEHICLE_ID
})
this.resetList()
}
}
})
},
2025-07-19 10:03:05 +08:00
resetList() {
this.pageSize = 10
this.currentPage = 1
this.list = []
this.getData()
},
fnNavigatorView(VEHICLE_ID) {
uni.$u.route({
url: '/pages/door_access_control/vehicle_info/view',
params: {
VEHICLE_ID,
}
})
},
fnNavigatorAdd(VEHICLE_ID) {
uni.$u.route({
url: '/pages/door_access_control/vehicle_info/add',
params: {
VEHICLE_ID,
}
})
},
scrolltolower() {
this.currentPage++;
if (this.totalPage >= this.currentPage) this.getData();
},
async getVehicleTypes() {
const { list } = await getVehicleTypeList();
const TYPE_LIST = [];
for (let i = 0; i < list.length; i++){
TYPE_LIST.push({id: list[i].BIANMA, name: list[i].NAME})
}
this.VEHICLE_TYPE_MAP = TYPE_LIST;
},
getVehicleTypeName(id) {
if (!id || id === '') return '';
for (let i = 0; i < this.VEHICLE_TYPE_MAP.length; i++) {
if (this.VEHICLE_TYPE_MAP[i].id === id) {
return this.VEHICLE_TYPE_MAP[i].name
}
}
}
2025-07-19 10:03:05 +08:00
}
}
</script>
<style scoped lang="scss">
.ml-10 {
margin-left: 10rpx;
}
.search {
display: flex;
.ml-10 {
margin-left: 10rpx;
}
.bth-mini {
width: 100rpx;
}
}
.see_btn {
display: flex;
justify-content: flex-end;
.wrap {
//width: 200rpx;
margin: 0 10rpx;
}
}
</style>