Compare commits
23 Commits
prod-25-06
...
prod-25-07
Author | SHA1 | Date | |
---|---|---|---|
1cb27fea3a | |||
61f2ae5a87 | |||
156d570595 | |||
c44f872d00 | |||
5c603618d3 | |||
9a9ac9f76e | |||
da73c933a0 | |||
45d95fe250 | |||
310b64f97c | |||
058ce2c72c | |||
ee8fdb16c4 | |||
7ff13628b5 | |||
eae60d1000 | |||
3a1e4a6ae2 | |||
5bd9db3165 | |||
fbce498e94 | |||
6ab2e0b1d7 | |||
001683f215 | |||
bb13a6e34e | |||
16d4425e07 | |||
a73434fd4d | |||
75d20beb77 | |||
9a21834741 |
@ -112,3 +112,43 @@ export function correctionHandle(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 获取报警列表
|
||||
export function getAlarmList(data) {
|
||||
return request({
|
||||
url: '/supplierAppV2/dispatchApp/alarm/alarmList',
|
||||
method:'POST',
|
||||
contentType: 'application/json',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 获取报警数目
|
||||
export function getAlarmCount(data) {
|
||||
return request({
|
||||
url: '/supplierAppV2/dispatchApp/alarm/alarmCount',
|
||||
method:'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 获取报警详情
|
||||
export function getAlarmByCode(data) {
|
||||
return request({
|
||||
url: '/supplierAppV2/dispatchApp/alarm/getAlarmByCode',
|
||||
method:'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 处理报警
|
||||
export function dealWithAlarm(data) {
|
||||
return request({
|
||||
url: '/supplierAppV2/dispatchApp/alarm/handAlarm',
|
||||
method:'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
BIN
src/assets/alarm_check.png
Normal file
After Width: | Height: | Size: 785 B |
BIN
src/assets/alarm_one.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
src/assets/alarm_repair.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
src/assets/alarm_three.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
src/assets/alarm_tip.png
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
src/assets/alarm_trailer.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
src/assets/alarm_two.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
src/assets/alarm_unCheck.png
Normal file
After Width: | Height: | Size: 770 B |
@ -251,6 +251,22 @@ const routes = [
|
||||
title:'车辆维保'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/vehicleAlarmList',
|
||||
name: 'vehicleAlarmList',
|
||||
component:()=>import('@/views/vehicle-maintenance/vehicle-alarm-list.vue'),
|
||||
meta: {
|
||||
title:'车辆报警'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/vehicleAlarmDetail',
|
||||
name: 'vehicleAlarmDetail',
|
||||
component:()=>import('@/views/vehicle-maintenance/vehicle-alarm-detail.vue'),
|
||||
meta: {
|
||||
title:'报警详情'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/maintenanceApplication',
|
||||
name: 'maintenanceApplication',
|
||||
|
@ -11,7 +11,11 @@ const service = axios.create({
|
||||
})
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
let token = urlParams.get('token');
|
||||
localStorage.setItem('token', token);
|
||||
if( token ) {
|
||||
localStorage.setItem('token', token);
|
||||
} else {
|
||||
localStorage.setItem('token', '');
|
||||
}
|
||||
service.interceptors.request.use(
|
||||
config => {
|
||||
let reqUrl=config.url
|
||||
@ -21,11 +25,13 @@ service.interceptors.request.use(
|
||||
}
|
||||
config.headers['Content-Type'] = config.contentType || 'application/x-www-form-urlencoded'
|
||||
let token = localStorage.getItem('token');
|
||||
// let token='4099761587129c46b03c9316c9e866c9'
|
||||
// let token='eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJBTkNIQU5HIiwidXNlcklkIjo0NTY3MSwibmFtZSI6IuWuieeVhSIsInVzZXJOYW1lIjoiQU5DSEFORyIsInN1cHBsaWVySWQiOjExMjgsImlzWmQiOjAsImV4cCI6MTc1NTQyMjUyNX0.xzDZhaANJFnbeViIHJA0SEtOyTv7Ja3rKmXqRKRuFkc'
|
||||
// let token='eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJTSEhQWEIiLCJ1c2VySWQiOjU0NzI2LCJuYW1lIjoiI-a1i-ivleWwj-eZveeZvSIsInVzZXJOYW1lIjoiU0hIUFhCIiwic3VwcGxpZXJJZCI6MTAwMDE2NSwiZXhwIjoxNzQ0NTEwNzkwfQ.JPk0OA7slYJN3FIi_uhW4Y0CiWRvl6R1dK8MRTbyhD8'
|
||||
if(!(reqUrl=='/supplier/supplierTraining/trainingTask' || reqUrl=='/supplier/supplierTraining/normalList' || reqUrl=='/supplier/supplierTraining/trainingList')){
|
||||
if(token) {
|
||||
config.headers['Authorization'] = `${token}`;
|
||||
config.headers['token'] = `${token}`;
|
||||
}
|
||||
}
|
||||
return config
|
||||
},
|
||||
|
@ -21,7 +21,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchFun } from '@/utils/map'
|
||||
import { searchFun, getLocal, getAddress } from '@/utils/map'
|
||||
export default {
|
||||
name: "addressMap",
|
||||
data() {
|
||||
@ -31,6 +31,7 @@
|
||||
activeIndex: '',
|
||||
map: '',
|
||||
marker: null,
|
||||
cityCode: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -43,16 +44,22 @@
|
||||
await this.initMap()
|
||||
},
|
||||
methods: {
|
||||
initMap() { // 初始化地图
|
||||
async initMap() { // 初始化地图
|
||||
this.map = new AMap.Map('mapId', {
|
||||
viewMode: '2D', // 默认使用 2D 模式
|
||||
zoom:11, //初始化地图层级
|
||||
})
|
||||
let res = await getLocal(this.map);
|
||||
let lnglat = new AMap.LngLat(res?.lng, res?.lat);
|
||||
let location = await getAddress(this.map, lnglat)
|
||||
this.cityCode = location?.regeocode.addressComponent.adcode
|
||||
//location?.regeocode?.addressComponent?.city || location?.regeocode?.addressComponent?.province
|
||||
console.log('location', location);
|
||||
},
|
||||
async searchHandler() {
|
||||
this.activeIndex = null
|
||||
if( this.keyword ) {
|
||||
this.addressList = await searchFun(this.map, '', this.keyword)
|
||||
this.addressList = await searchFun(this.map, this.cityCode, this.keyword,)
|
||||
this.addressList = this.addressList.filter(item => !!item.location)
|
||||
} else {
|
||||
this.addressList = []
|
||||
|
@ -2,7 +2,10 @@
|
||||
<div class="wrap">
|
||||
<div class="service_title">
|
||||
<span class="name">{{orderInfo?.serviceName}}</span>
|
||||
<span class="status">{{orderInfo?.orderStatusString}}</span>
|
||||
<span class="status">
|
||||
{{orderInfo?.orderStatusString}}
|
||||
<span class="refresh_btn" @click="refreshHandler">刷新</span>
|
||||
</span>
|
||||
</div>
|
||||
<!-- <img class="report_line" src="@/assets/report/report_line.png" alt="">-->
|
||||
<div class="service_content">
|
||||
@ -25,6 +28,11 @@
|
||||
export default {
|
||||
name: "service-item",
|
||||
props: ['orderInfo'],
|
||||
methods: {
|
||||
refreshHandler() {
|
||||
this.$emit('refresh')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -58,6 +66,13 @@
|
||||
font-size: 13px;
|
||||
color: #F19028;
|
||||
}
|
||||
.refresh_btn {
|
||||
background-color: #267EF0;
|
||||
color: #fff;
|
||||
padding: 6px 12px;
|
||||
margin-left: 5px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
}
|
||||
.service_content {
|
||||
padding: 11px 16px 18px;
|
||||
|
@ -1,125 +1,127 @@
|
||||
<template>
|
||||
<div class="main_wrap">
|
||||
<div class="top_bg">
|
||||
<div class="title">报备中心</div>
|
||||
</div>
|
||||
<div class="service_wrap">
|
||||
<service-item :order-info="orderInfo"></service-item>
|
||||
</div>
|
||||
<div class="chat_list" ref="chatList">
|
||||
<!--ai对话框 s -->
|
||||
<div v-for="(item, index) in recordList" :key="index">
|
||||
<template v-if="item.messageType == 4">
|
||||
<div class="top_tip_wrap">为了快速解决问题,请选择下方咨询类型</div>
|
||||
<div class="ai_chat" >
|
||||
<div class="ai_left">
|
||||
<img class="report_ai" src="@/assets/report/report_ai.png" alt="">
|
||||
</div>
|
||||
<div class="ai_right">
|
||||
<div class="ai_title">{{ orderInfo?.driverName }}你好,请选择报备内容</div>
|
||||
<ul>
|
||||
<li v-for="_item in item.content" :key="_item.id" @click="addReportHandler(_item)">“{{_item.name}}”</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="[2, 3].includes(Number(item.messageType))">
|
||||
<!--ai对话框 e -->
|
||||
<div class="tip_wrap">{{item.createTime}}</div>
|
||||
<!--客服对话框 s -->
|
||||
<div class="customer_item mb20">
|
||||
<div class="customer_left">
|
||||
<img class="profile_photo mr" src="@/assets/report/report_customer.png" alt="">
|
||||
</div>
|
||||
<div class="common_right customer_cls">
|
||||
<div class="customer_status">{{item.reportConfigName}}</div>
|
||||
<div class="response_con">{{item.remark}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="item.messageType == 1">
|
||||
<!--服务人员对话框 e -->
|
||||
<div class="tip_wrap">{{item.createTime}}</div>
|
||||
<!--服务人员对话框 s -->
|
||||
<div class="server_item mb20">
|
||||
<div class="common_right service_cls">
|
||||
<div class="service_status">{{item.reportConfigName}}</div>
|
||||
<div class="response_con">{{item.remark}}</div>
|
||||
</div>
|
||||
<div class="customer_left">
|
||||
<img class="profile_photo ml" v-if="type == 1" src="@/assets/report/report_dispatch.png" alt="">
|
||||
<img class="profile_photo ml" v-else src="@/assets/report/report_driver.png" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<!--服务人员对话框 e -->
|
||||
</template>
|
||||
<!-- <van-pull-refresh v-model="isLoading" class="custom-pull-refresh safe-pull-refresh" @refresh="onRefresh">-->
|
||||
<div class="main_wrap">
|
||||
<div class="top_bg" :class="{'dispatch' : type == 1 , 'driver' : type != 1}">
|
||||
<!-- <div class="title">报备中心</div>-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<report-list-item :report-list.sync="reportList" @getReport="getReportHandler" />
|
||||
|
||||
<van-popup ref="addReportModal" v-model="addReportShow" :close-on-click-overlay="false" closeable duration="0" round position="bottom">
|
||||
<div class="dialog_wrap">
|
||||
<img class="add_report_bg" src="@/assets/report/add_report_bg.png" alt="">
|
||||
<div class="report_content">
|
||||
<template v-if="currentInfo.component == 'time'">
|
||||
<!--预约时间报备 s -->
|
||||
<div class="report_title">
|
||||
<img class="dot" src="@/assets/report/add_report_dot.png" alt="">
|
||||
<span>预约时间</span>
|
||||
</div>
|
||||
<div class="report_time_content" @click="showDatetime = true">
|
||||
<div class="report_time_left">
|
||||
<img class="add_report_time" src="@/assets/report/add_report_time.png" alt="">
|
||||
<span>{{appointTime || '请选择时间'}}</span>
|
||||
<div class="service_wrap">
|
||||
<service-item :order-info="orderInfo" @refresh="onRefreshHandler"></service-item>
|
||||
</div>
|
||||
<div class="chat_list" ref="chatList" >
|
||||
<!--ai对话框 s -->
|
||||
<div v-for="(item, index) in recordList" :key="index">
|
||||
<template v-if="item.messageType == 4">
|
||||
<div class="top_tip_wrap">为了快速解决问题,请选择下方咨询类型</div>
|
||||
<div class="ai_chat" >
|
||||
<div class="ai_left">
|
||||
<img class="report_ai" src="@/assets/report/report_ai.png" alt="">
|
||||
</div>
|
||||
<img class="report_arrow" src="@/assets/report/add_report_arrow.png" alt="">
|
||||
</div>
|
||||
<!--预约时间报备 e -->
|
||||
</template>
|
||||
<template v-if="currentInfo.component == 'address'">
|
||||
<!--修改地址报备 s -->
|
||||
<div class="report_title">
|
||||
<img class="dot" src="@/assets/report/add_report_dot.png" alt="">
|
||||
<span>修改事发地</span>
|
||||
</div>
|
||||
<div class="report_time_content" @click="goPage('addressMap')">
|
||||
<div class="report_time_left">
|
||||
<img class="add_report_time" src="@/assets/report/add_report_address.png" alt="">
|
||||
<span>{{address || '请选择地址'}}</span>
|
||||
<div class="ai_right">
|
||||
<div class="ai_title">{{ orderInfo?.driverName }}你好,请选择报备内容</div>
|
||||
<ul>
|
||||
<li v-for="_item in item.content" :key="_item.id" @click="addReportHandler(_item)">“{{_item.name}}”</li>
|
||||
</ul>
|
||||
</div>
|
||||
<img class="report_arrow" src="@/assets/report/add_report_arrow.png" alt="">
|
||||
</div>
|
||||
<!--修改地址报备 e -->
|
||||
</template>
|
||||
<div class="report_title">
|
||||
<img class="dot" src="@/assets/report/add_report_dot.png" alt="">
|
||||
<span>补充报备内容</span>
|
||||
</div>
|
||||
<div class="report_common_content">
|
||||
<van-field
|
||||
v-model="remark"
|
||||
class="report_textarea"
|
||||
placeholder="点击这里输入补充报备内容" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="report_btn" @click="saveHandler">
|
||||
提交报备
|
||||
<template v-if="[2, 3].includes(Number(item.messageType))">
|
||||
<!--ai对话框 e -->
|
||||
<div class="tip_wrap">{{item.createTime}}</div>
|
||||
<!--客服对话框 s -->
|
||||
<div class="customer_item mb20">
|
||||
<div class="customer_left">
|
||||
<img class="profile_photo mr" src="@/assets/report/report_customer.png" alt="">
|
||||
</div>
|
||||
<div class="common_right customer_cls">
|
||||
<div class="customer_status">{{item.reportConfigName}}</div>
|
||||
<div class="response_con">{{item.remark}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="item.messageType == 1">
|
||||
<!--服务人员对话框 e -->
|
||||
<div class="tip_wrap">{{item.createTime}}</div>
|
||||
<!--服务人员对话框 s -->
|
||||
<div class="server_item mb20">
|
||||
<div class="common_right service_cls">
|
||||
<div class="service_status">{{item.reportConfigName}}</div>
|
||||
<div class="response_con">{{item.remark}}</div>
|
||||
</div>
|
||||
<div class="customer_left">
|
||||
<img class="profile_photo ml" v-if="type == 1" src="@/assets/report/report_dispatch.png" alt="">
|
||||
<img class="profile_photo ml" v-else src="@/assets/report/report_driver.png" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<!--服务人员对话框 e -->
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</van-popup>
|
||||
<report-list-item :report-list.sync="reportList" @getReport="getReportHandler" />
|
||||
<van-popup ref="addReportModal" v-model="addReportShow" :close-on-click-overlay="false" closeable duration="0" round position="bottom">
|
||||
<div class="dialog_wrap">
|
||||
<img class="add_report_bg" src="@/assets/report/add_report_bg.png" alt="">
|
||||
<div class="report_content">
|
||||
<template v-if="currentInfo.component == 'time'">
|
||||
<!--预约时间报备 s -->
|
||||
<div class="report_title">
|
||||
<img class="dot" src="@/assets/report/add_report_dot.png" alt="">
|
||||
<span>预约时间</span>
|
||||
</div>
|
||||
<div class="report_time_content" @click="showDatetime = true">
|
||||
<div class="report_time_left">
|
||||
<img class="add_report_time" src="@/assets/report/add_report_time.png" alt="">
|
||||
<span>{{appointTime || '请选择时间'}}</span>
|
||||
</div>
|
||||
<img class="report_arrow" src="@/assets/report/add_report_arrow.png" alt="">
|
||||
</div>
|
||||
<!--预约时间报备 e -->
|
||||
</template>
|
||||
<template v-if="currentInfo.component == 'address'">
|
||||
<!--修改地址报备 s -->
|
||||
<div class="report_title">
|
||||
<img class="dot" src="@/assets/report/add_report_dot.png" alt="">
|
||||
<span>修改地址</span>
|
||||
</div>
|
||||
<div class="report_time_content" @click="goPage('addressMap')">
|
||||
<div class="report_time_left">
|
||||
<img class="add_report_time" src="@/assets/report/add_report_address.png" alt="">
|
||||
<span>{{address || '请选择地址'}}</span>
|
||||
</div>
|
||||
<img class="report_arrow" src="@/assets/report/add_report_arrow.png" alt="">
|
||||
</div>
|
||||
<!--修改地址报备 e -->
|
||||
</template>
|
||||
<div class="report_title">
|
||||
<img class="dot" src="@/assets/report/add_report_dot.png" alt="">
|
||||
<span>补充报备内容</span>
|
||||
</div>
|
||||
<div class="report_common_content">
|
||||
<textarea class="report_textarea" id="text-input" rows="4" placeholder="点击这里输入补充报备内容" v-model.trim="remark"></textarea>
|
||||
<!-- <van-field-->
|
||||
<!-- v-model="remark"-->
|
||||
<!-- class="report_textarea"-->
|
||||
<!-- placeholder="点击这里输入补充报备内容" />-->
|
||||
</div>
|
||||
</div>
|
||||
<div class="report_btn" @click="saveHandler">
|
||||
提交报备
|
||||
</div>
|
||||
</div>
|
||||
</van-popup>
|
||||
|
||||
<van-popup v-model="showDatetime" round position="bottom">
|
||||
<van-datetime-picker
|
||||
class="dataTime"
|
||||
v-if="showDatetime"
|
||||
v-model="appointTime"
|
||||
type="datetime"
|
||||
@confirm="onConfirm"
|
||||
@cancel="showDatetime = false"
|
||||
/>
|
||||
</van-popup>
|
||||
</div>
|
||||
<van-popup v-model="showDatetime" round position="bottom">
|
||||
<van-datetime-picker
|
||||
class="dataTime"
|
||||
v-if="showDatetime"
|
||||
v-model="appointTime"
|
||||
type="datetime"
|
||||
:min-date="minDate"
|
||||
@confirm="onConfirm"
|
||||
@cancel="showDatetime = false"
|
||||
/>
|
||||
</van-popup>
|
||||
</div>
|
||||
<!-- </van-pull-refresh>-->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -139,6 +141,7 @@
|
||||
remark: '',
|
||||
showDatetime: false,
|
||||
appointTime: '',
|
||||
minDate: new Date(),
|
||||
address: '',
|
||||
lat: '',
|
||||
lng: '',
|
||||
@ -150,6 +153,8 @@
|
||||
userOrderId: '',
|
||||
userOrderCode: '',
|
||||
driverId: '',
|
||||
clickFlag: true,
|
||||
isLoading: false,
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
@ -174,6 +179,19 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onRefreshHandler() {
|
||||
setTimeout(async () => {
|
||||
try {
|
||||
this.recordList = [];
|
||||
await this.getReportList();
|
||||
await this.getDetail();
|
||||
await this.getRecordList();
|
||||
await this.scrollToBottom();
|
||||
} finally {
|
||||
this.isLoading = false; // 结束加载状态
|
||||
}
|
||||
}, 100)
|
||||
},
|
||||
// 添加滚动方法
|
||||
scrollToBottom() {
|
||||
this.$nextTick(() => {
|
||||
@ -191,48 +209,56 @@
|
||||
this.recordList = recordList.data;
|
||||
},
|
||||
async saveHandler() {
|
||||
let data = {
|
||||
source: Number(this.type),
|
||||
reportContent: this.remark,
|
||||
userOrderId: Number(this.userOrderId),
|
||||
reportConfigId: this.currentInfo.id,
|
||||
userOrderCode: this.userOrderCode,
|
||||
driverId: this.driverId,
|
||||
}
|
||||
if(this.currentInfo.component == 'time') {
|
||||
if( !this.appointTime ) {
|
||||
Toast('预约时间不能为空')
|
||||
if( this.clickFlag ) {
|
||||
let data = {
|
||||
source: Number(this.type),
|
||||
reportContent: this.remark,
|
||||
userOrderId: Number(this.userOrderId),
|
||||
reportConfigId: this.currentInfo.id,
|
||||
userOrderCode: this.userOrderCode,
|
||||
driverId: this.driverId,
|
||||
}
|
||||
if(this.currentInfo.component == 'time') {
|
||||
if( !this.appointTime ) {
|
||||
Toast('预约时间不能为空')
|
||||
return
|
||||
}
|
||||
if( new Date(this.appointTime).getTime() <= new Date().getTime() ) {
|
||||
Toast('预约时间不能小于当前时间')
|
||||
return
|
||||
}
|
||||
data.time = this.appointTime
|
||||
}
|
||||
if(this.currentInfo.component == 'address') {
|
||||
if( !this.address ) {
|
||||
Toast('地址不能为空')
|
||||
return
|
||||
}
|
||||
data.address = this.address
|
||||
data.lat = this.lat;
|
||||
data.lng = this.lng;
|
||||
}
|
||||
if( !this.remark ) {
|
||||
Toast('备注内容不能为空')
|
||||
return
|
||||
}
|
||||
if( new Date(this.appointTime).getTime() <= new Date().getTime() ) {
|
||||
Toast('预约时间不能小于当前时间')
|
||||
return
|
||||
this.clickFlag = false;
|
||||
try {
|
||||
await newOrderReporting(data)
|
||||
Dialog.alert({
|
||||
title: '提示',
|
||||
message: "报备添加成功"
|
||||
}).then(async () => {
|
||||
await this.getRecordList()
|
||||
this.addReportShow = false
|
||||
this.scrollToBottom();
|
||||
this.initDialogData();
|
||||
this.clickFlag = true
|
||||
});
|
||||
} finally {
|
||||
this.clickFlag = true
|
||||
}
|
||||
data.time = this.appointTime
|
||||
}
|
||||
if(this.currentInfo.component == 'address') {
|
||||
if( !this.address ) {
|
||||
Toast('地址不能为空')
|
||||
return
|
||||
}
|
||||
data.address = this.address
|
||||
data.lat = this.lat;
|
||||
data.lng = this.lng;
|
||||
}
|
||||
if( !this.remark ) {
|
||||
Toast('备注内容不能为空')
|
||||
return
|
||||
}
|
||||
await newOrderReporting(data)
|
||||
Dialog.alert({
|
||||
title: '提示',
|
||||
message: "报备添加成功"
|
||||
}).then(async () => {
|
||||
await this.getRecordList()
|
||||
this.addReportShow = false
|
||||
this.scrollToBottom();
|
||||
this.initDialogData();
|
||||
});
|
||||
},
|
||||
initDialogData() {
|
||||
this.appointTime = '';
|
||||
@ -253,11 +279,16 @@
|
||||
this.scrollToBottom();
|
||||
},
|
||||
async getDetail(){ // 订单详情
|
||||
let result = await getOrderInfo({
|
||||
userOrderId: this.userOrderId,
|
||||
userOrderCode: this.userOrderCode
|
||||
})
|
||||
this.orderInfo = result.data
|
||||
if(this.userOrderId) {
|
||||
let result = await getOrderInfo({
|
||||
userOrderId: this.userOrderId,
|
||||
userOrderCode: this.userOrderCode
|
||||
})
|
||||
this.orderInfo = result.data
|
||||
} else {
|
||||
this.orderInfo = {}
|
||||
}
|
||||
|
||||
},
|
||||
async getReportList() { // 报备大类
|
||||
let res = await getReportListByOrder({
|
||||
@ -272,37 +303,60 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.custom-pull-refresh {
|
||||
height: 100% !important;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
#app {
|
||||
background: #F9FCFF !important;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.main_wrap {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #F9FCFF !important;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
// 添加以下样式确保正确的高度计算
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
.top_bg {
|
||||
width: 100%;
|
||||
height: 162px;
|
||||
background: #334885;
|
||||
.title {
|
||||
height: 87px;
|
||||
/*.title {
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
padding-top: 52px;
|
||||
font-size: 17px;
|
||||
line-height: 24px;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
.dispatch { // 调度app头部背景色
|
||||
background: #354683;
|
||||
}
|
||||
.driver { // 司机app头部背景色
|
||||
background: #334885;
|
||||
}
|
||||
.service_wrap {
|
||||
margin-top: -75px;
|
||||
margin-bottom: 20px;
|
||||
/*margin-bottom: 20px;*/
|
||||
}
|
||||
.chat_list {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
/*overflow: auto;*/
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
-webkit-overflow-scrolling: touch; // 为了iOS平滑滚动
|
||||
padding-top: 10px;
|
||||
/* 修复 iOS 滚动问题 */
|
||||
transform: translateZ(0);
|
||||
.top_tip_wrap {
|
||||
color: #7C8698;
|
||||
text-align: center;
|
||||
@ -490,6 +544,8 @@
|
||||
border-radius: 6px;
|
||||
min-height: 95px;
|
||||
border: 1px solid #E2EAF6;
|
||||
padding: 10px;
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
<div class="headerWrap">
|
||||
<div v-if="isWebFunc()" style="opacity: 0;" class="back"></div>
|
||||
<img v-else class="back" @click="h5GoBack" src="@/assets/secondHandCar/back.png" />
|
||||
<span>{{detailInfo.status.code !== 6 ? '在售' : '已售出'}}</span>
|
||||
<span>{{detailInfo?.status?.code !== 6 ? '在售' : '已售出'}}</span>
|
||||
<div style="opacity: 0;" class="back"></div>
|
||||
</div>
|
||||
<van-loading v-show="!detailInfo" class="loadingWrap" type="spinner" color="#1989fa" />
|
||||
@ -48,6 +48,10 @@
|
||||
</div>
|
||||
<div class="viewNum">{{detailInfo.attentionCount}}人想要<span>{{detailInfo.browseCount}}人浏览</span></div>
|
||||
</div>
|
||||
<div class="price commonColor">
|
||||
车源ID: {{ detailInfo.code }}
|
||||
<img class="copyIcon" @click="copyHandler(detailInfo.code)" src="@/assets/copy.png" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="detailInfoWrap wrapCommon">
|
||||
<div>
|
||||
@ -136,6 +140,7 @@ export default {
|
||||
startTime: null, // 记录进入时间
|
||||
recordType:1,
|
||||
isList:false,//是否是首页列表跳转过来的
|
||||
recordResponseId:'',//信息记录获取的id,用于关闭界面掉接口所需参数
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
@ -157,6 +162,7 @@ export default {
|
||||
queryType:this.queryType ,
|
||||
})
|
||||
this.detailInfo=res?.data
|
||||
// console.log("this.detailInfo",this.detailInfo)
|
||||
const municipalities = ['北京市', '天津市', '上海市', '重庆市'];
|
||||
const isMunicipality = municipalities.some(city => res.data.areaName.includes(city));
|
||||
this.detailInfo.areaName= isMunicipality ? res.data.areaName?.substring(0, 3) : res.data.areaName;
|
||||
@ -167,12 +173,25 @@ export default {
|
||||
this.imgSrcList.unshift(res?.data?.vehicleRearPhoto)
|
||||
}
|
||||
this.imgSrcList.unshift(res?.data?.vehicleAnglePhoto)
|
||||
let result=await saveRecord({type: 1, carInfoId: this.id, duration:'',id:''});
|
||||
// console.log('resultresult',result)
|
||||
this.recordResponseId=result?.data?.id
|
||||
}
|
||||
},
|
||||
destroyed() {
|
||||
this.getDuration(1)
|
||||
},
|
||||
methods:{
|
||||
copyHandler(copyText){
|
||||
let inputNode = document.createElement('input') // 创建input
|
||||
inputNode.value = copyText // 赋值给 input 值
|
||||
document.body.appendChild(inputNode) // 插入进去
|
||||
inputNode.select() // 选择对象
|
||||
document.execCommand('Copy') // 原生调用执行浏览器复制命令
|
||||
inputNode.className = 'oInput'
|
||||
inputNode.style.display = 'none' // 隐藏
|
||||
this.$toast('复制成功')
|
||||
},
|
||||
showImagePreview(index) {
|
||||
ImagePreview({
|
||||
images: this.imgSrcList.map(item => item),
|
||||
@ -197,7 +216,7 @@ export default {
|
||||
this.saveRecord(duration,type);
|
||||
},
|
||||
async saveRecord(duration,type){
|
||||
await saveRecord({type: type, carInfoId: this.id, duration})
|
||||
await saveRecord({type: type, carInfoId: this.id, duration,id:this.recordResponseId || ''})
|
||||
},
|
||||
handle(){
|
||||
this.getDuration(2)
|
||||
@ -269,7 +288,7 @@ export default {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.titleWrap{
|
||||
height: 108px;
|
||||
height: 120px;
|
||||
padding: 18px 0 15px 21px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@ -432,4 +451,14 @@ export default {
|
||||
object-fit: cover;
|
||||
object-position: center;
|
||||
}
|
||||
.copyIcon {
|
||||
width: 35px;
|
||||
height: 15px;
|
||||
margin-left: 10px
|
||||
}
|
||||
.commonColor {
|
||||
color: #999999 !important;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
|
@ -23,6 +23,12 @@
|
||||
</div>
|
||||
<div class="viewNum">{{detailInfo.attentionCount}}人想卖<span>{{detailInfo.browseCount}}人浏览</span></div>
|
||||
</div>
|
||||
<div class="priceWrap">
|
||||
<div class="commonColor" style="margin-top: 5px">
|
||||
车源ID: {{ detailInfo.code }}
|
||||
<img class="copyIcon" @click="copyHandler(detailInfo.code)" src="@/assets/copy.png" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="detailInfoWrap wrapCommon">
|
||||
<div>
|
||||
@ -72,6 +78,7 @@ export default {
|
||||
duration:'',
|
||||
startTime: null, // 记录进入时间
|
||||
isList:false,
|
||||
recordResponseId:'',//信息记录获取的id,用于关闭界面掉接口所需参数
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
@ -92,19 +99,31 @@ export default {
|
||||
queryType: this.queryType,
|
||||
})
|
||||
this.detailInfo = res?.data
|
||||
let result=await saveRecord({type: 1, carInfoId: this.id, duration:'',id:''});
|
||||
this.recordResponseId=result?.data?.id
|
||||
}
|
||||
},
|
||||
destroyed() {
|
||||
this.getDuration(1)
|
||||
},
|
||||
methods:{
|
||||
copyHandler(copyText){
|
||||
let inputNode = document.createElement('input') // 创建input
|
||||
inputNode.value = copyText // 赋值给 input 值
|
||||
document.body.appendChild(inputNode) // 插入进去
|
||||
inputNode.select() // 选择对象
|
||||
document.execCommand('Copy') // 原生调用执行浏览器复制命令
|
||||
inputNode.className = 'oInput'
|
||||
inputNode.style.display = 'none' // 隐藏
|
||||
this.$toast('复制成功')
|
||||
},
|
||||
getDuration(type){
|
||||
const endTime = new Date();
|
||||
const duration = (endTime - this.startTime) / 1000; // 计算时长(秒)
|
||||
this.saveRecord(duration,type);
|
||||
},
|
||||
async saveRecord(duration,type){
|
||||
await saveRecord({type:type,carInfoId:this.id,duration})
|
||||
await saveRecord({type:type,carInfoId:this.id,duration,id:this.recordResponseId || ''})
|
||||
},
|
||||
handle(){
|
||||
this.getDuration(2)
|
||||
@ -287,4 +306,14 @@ export default {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.commonColor {
|
||||
color: #999999 !important;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.copyIcon {
|
||||
width: 35px;
|
||||
height: 15px;
|
||||
margin-left: 10px
|
||||
}
|
||||
</style>
|
||||
|
381
src/views/vehicle-maintenance/vehicle-alarm-detail.vue
Normal file
@ -0,0 +1,381 @@
|
||||
<template>
|
||||
<div class="wrap">
|
||||
<div class="alarm_info">
|
||||
<div class="alarm_title">
|
||||
<div class="title_left">
|
||||
<span class="car_title">{{info.alarmTypeString}}</span>
|
||||
<img class="alarm_level" v-if="info.level == 1" src="@/assets/alarm_one.png" alt="">
|
||||
<img class="alarm_level" v-if="info.level == 2" src="@/assets/alarm_two.png" alt="">
|
||||
<img class="alarm_level" v-if="info.level == 3" src="@/assets/alarm_three.png" alt="">
|
||||
</div>
|
||||
<div class="status">{{info.handStatusString}}</div>
|
||||
</div>
|
||||
<div class="content_list">
|
||||
<div class="alarm_content">
|
||||
<div class="label">报警时间:</div>
|
||||
<div class="content">{{info.startTime}}</div>
|
||||
</div>
|
||||
<div class="alarm_content">
|
||||
<div class="label">报警详情:</div>
|
||||
<div class="content">{{info.alarmRemark}}</div>
|
||||
</div>
|
||||
<div class="alarm_content">
|
||||
<div class="label">报警照片:</div>
|
||||
<div class="content">
|
||||
<img class="photo" v-if="info.url" :src="info.url" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="alarm_content">
|
||||
<div class="label">报警通道:</div>
|
||||
<div class="content content_flex">
|
||||
<span>{{ info.plateNumber + '_' + (info?.channel || '') }} <!--浙A7H1M2_1--></span>
|
||||
<span class="btn">查看监控</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="alarm_info car_info">
|
||||
<div class="car_title title">
|
||||
车辆位置
|
||||
</div>
|
||||
<div class="car_map">
|
||||
<div class="map_title">
|
||||
<span class="driver_name">{{info.vehicleName}} / {{info.plateNumber}}</span>
|
||||
<span class="driver_name">司机:{{info.onlineDriverName}} <a :href="'tel:' + info.onlinePhone">{{info.onlinePhone}}</a></span>
|
||||
</div>
|
||||
<div class="map_cover" id="container"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="deal_btn" v-if="[0, 3].includes(info.handStatus)" @click="dealWithShow = true">处理</div>
|
||||
<van-popup v-model="dealWithShow" v-if="dealWithShow" round position="center">
|
||||
<div class="dialog_wrap">
|
||||
<div class="dialog_title">报警处理</div>
|
||||
<div>
|
||||
<van-radio-group v-model="radio" @change="change" class="horizontal-radio-group">
|
||||
<van-radio v-for="item in radioList" :key="item.value" :name="item.value" :disabled="item.disabled" class="item">
|
||||
<span :style="{ color: radio === item.value ? '#393230' : 'rgba(0, 0, 0, 0.5)' }">
|
||||
{{ item.name }}
|
||||
</span>
|
||||
<img
|
||||
slot="icon"
|
||||
class="icon"
|
||||
slot-scope="props"
|
||||
:src="props.checked ? activeIcon : inactiveIcon"
|
||||
>
|
||||
</van-radio>
|
||||
</van-radio-group>
|
||||
<div class="alarm_tip" v-if="['1', '2', '3'].includes(String(info.alarmType))">
|
||||
注:开始处理后将流转至技术支持进行处理。
|
||||
</div>
|
||||
<div class="alarm_text" v-if="radio == 5">
|
||||
<textarea class="alarm_textarea" id="text-input" rows="6" placeholder="处理结果:" v-model.trim="remark"></textarea>
|
||||
</div>
|
||||
<div class="btn_wrap">
|
||||
<div class="btn_confirm" @click="noMultipleClicks(operatorHandle)">确认</div>
|
||||
<div class="btn_close" @click="dealWithShow = false">关闭</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</van-popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {myMixins} from "@/utils/myMixins"
|
||||
import { getAlarmByCode, dealWithAlarm } from "@/api/order"
|
||||
import trailerPosition from "@/assets/alarm_trailer.png";
|
||||
import repairPosition from "@/assets/alarm_repair.png";
|
||||
export default {
|
||||
name: "vehicleAlarmDetail",
|
||||
mixins: [ myMixins ],
|
||||
data() {
|
||||
return {
|
||||
noClick: true,
|
||||
map: null,
|
||||
lng: 121.553376,
|
||||
lat: 31.247998,
|
||||
radio: '',
|
||||
activeIcon: require('@/assets/alarm_check.png'),
|
||||
inactiveIcon: require('@/assets/alarm_unCheck.png'),
|
||||
dealWithShow: false,
|
||||
radioList: [{ name: '开始处理', value: 3, disabled: false }, { name: '处理完成', value: 5, disabled: false }],
|
||||
remark: '',
|
||||
code: '',
|
||||
info: {}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.code = this.$route.query.code;
|
||||
this.getAlarmDetail();
|
||||
this.initMap();
|
||||
},
|
||||
methods: {
|
||||
async operatorHandle() {
|
||||
try {
|
||||
await dealWithAlarm({
|
||||
alarmId: this.info.id,
|
||||
handleStatus: this.radio,
|
||||
remark: this.remark
|
||||
})
|
||||
this.$toast('操作成功')
|
||||
} finally {
|
||||
this.dealWithShow = false;
|
||||
await this.getAlarmDetail();
|
||||
}
|
||||
},
|
||||
change(e) {
|
||||
this.radio = e
|
||||
},
|
||||
async getAlarmDetail() {
|
||||
let res = await getAlarmByCode({
|
||||
code: this.code
|
||||
});
|
||||
if(!res.data) {
|
||||
this.$router.push({
|
||||
name: 'vehicleAlarmList',
|
||||
replace: true // 关键:替换当前路由,而不是新增历史记录
|
||||
});
|
||||
}
|
||||
this.info = res?.data;
|
||||
if( this.info.handStatus == 0 && ['1', '2', '3'].includes(String(this.info.alarmType))) { // 未处理,且需要技术处理
|
||||
this.radio = this.radioList[0].value
|
||||
this.radioList[1].disabled = true
|
||||
}
|
||||
if(this.info.handStatus == 3) {
|
||||
this.radioList[0].disabled = true
|
||||
}
|
||||
|
||||
},
|
||||
initMap() {
|
||||
this.map = new AMap.Map('container',{
|
||||
zoom:14,//级别(缩放比例 3-20 )
|
||||
center: [this.lng, this.lat],//中心点坐标
|
||||
viewMode:'2D',//使用3D视图
|
||||
})
|
||||
this.map.on('complete', () => {
|
||||
this.mapMarkers();
|
||||
});
|
||||
},
|
||||
mapMarkers() {
|
||||
let url = String(this.info.vehicleType) == '5' ? repairPosition : trailerPosition
|
||||
let marker = new AMap.Marker({
|
||||
position: [this.lng, this.lat],
|
||||
icon: new AMap.Icon({
|
||||
image: url, // 图片的相对路径
|
||||
size: new AMap.Size(42, 50), // 图标的尺寸
|
||||
imageSize: new AMap.Size(42, 50) // 图片的实际尺寸
|
||||
}),
|
||||
});
|
||||
this.map.add(marker);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.wrap {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #F4F5F7 !important;
|
||||
box-sizing: border-box;
|
||||
overflow-y: auto;
|
||||
padding: 0 12px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.alarm_info {
|
||||
padding-top: 12px;
|
||||
padding-bottom: 16px;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px 1px 4px 0px rgba(39,52,125,0.05);
|
||||
border-radius: 6px;
|
||||
backdrop-filter: blur(5.602678571428572px);
|
||||
margin-top: 10px;
|
||||
.alarm_title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid rgba(233, 233, 234, 0.6);
|
||||
padding: 3px 20px 10px 18px;
|
||||
.title_left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.alarm_level {
|
||||
width: 32px;
|
||||
height: 14px;
|
||||
margin-left: 7px;
|
||||
}
|
||||
}
|
||||
.status {
|
||||
font-size: 11px;
|
||||
color: #FA8D14;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.content_list {
|
||||
padding: 12px 18px 0px;
|
||||
}
|
||||
.alarm_content {
|
||||
display: flex;
|
||||
margin-bottom: 6px;
|
||||
.content {
|
||||
margin-left: 10px;
|
||||
font-size: 12px;
|
||||
color: rgba(0, 0, 0, 0.75);
|
||||
flex: 1;
|
||||
.btn {
|
||||
/*display: inline-block;*/
|
||||
padding: 5px 12px;
|
||||
background: #FA8236;
|
||||
border-radius: 3px;
|
||||
color: #fff;
|
||||
font-size: 12px;
|
||||
}
|
||||
.photo {
|
||||
width: 75px;
|
||||
height: 55px;
|
||||
margin-right: 6px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.label {
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
.content_flex {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.car_title {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
}
|
||||
.title {
|
||||
padding-left: 18px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.car_info {
|
||||
padding: 12px 4px 5px 4px;
|
||||
}
|
||||
.car_map {
|
||||
width: 100%;
|
||||
/*height: 204px;*/
|
||||
border-radius: 4px;
|
||||
border: 1px solid #F0F0F0;
|
||||
background-color: #F9FCFF;
|
||||
box-sizing: border-box;
|
||||
.map_title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 10px 8px 10px 15px;
|
||||
.driver_name {
|
||||
font-size: 12px;
|
||||
color: #000000;
|
||||
a {
|
||||
color: #377BE6;
|
||||
}
|
||||
}
|
||||
}
|
||||
.map_cover {
|
||||
width: 100%;
|
||||
height: 174px;
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
.deal_btn {
|
||||
width: calc(100% - 38px);
|
||||
height: 48px;
|
||||
text-align: center;
|
||||
line-height: 48px;
|
||||
position: fixed;
|
||||
bottom: 10px;
|
||||
left: 19px;
|
||||
font-size: 15px;
|
||||
color: #fff;
|
||||
background: #354D93;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.dialog_wrap {
|
||||
width: 325px;
|
||||
border-radius: 13px;
|
||||
.dialog_title {
|
||||
height: 68px;
|
||||
line-height: 82px;
|
||||
background: linear-gradient( 180deg, #FFE8DA 0%, rgba(255,233,233,0) 100%);
|
||||
font-size: 18px;
|
||||
color: #E0481E;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
.horizontal-radio-group {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-around;
|
||||
margin-bottom: 15px;
|
||||
.icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
.item {
|
||||
font-size: 14px;
|
||||
margin-bottom: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
.alarm_tip {
|
||||
font-size: 14px;
|
||||
color: #FF5D3B;
|
||||
margin: 10px 0 20px;
|
||||
text-align: center;
|
||||
}
|
||||
.alarm_text {
|
||||
width: 100%;
|
||||
padding: 0 25px 15px;
|
||||
box-sizing: border-box;
|
||||
.alarm_textarea {
|
||||
width: 100%;
|
||||
background: #FFFBFB;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #F97C64;
|
||||
backdrop-filter: blur(10px);
|
||||
padding: 10px;
|
||||
color: #FF5D3B;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.alarm_textarea::placeholder {
|
||||
color: rgba(255, 93, 59, 0.8);
|
||||
}
|
||||
}
|
||||
.btn_wrap {
|
||||
.btn_confirm {
|
||||
width: 173px;
|
||||
height: 42px;
|
||||
line-height: 42px;
|
||||
color: #FFFFFF;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
background: #F16363;
|
||||
border-radius: 23px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.btn_close {
|
||||
margin-top: 12px;
|
||||
margin-bottom: 22px;
|
||||
font-size: 14px;
|
||||
color: rgba(44, 65, 85, 0.6);
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
::v-deep .van-radio__icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
::v-deep .van-radio__label--disabled {
|
||||
opacity: 0.5;
|
||||
}
|
||||
</style>
|
233
src/views/vehicle-maintenance/vehicle-alarm-list.vue
Normal file
@ -0,0 +1,233 @@
|
||||
<template>
|
||||
<div class="wrap">
|
||||
<div class="tab_wrap">
|
||||
<div class="item_wrap" v-for="(item, index) in tabArr" :key="index" @click="changeTab(index)">
|
||||
<span class="alpha" :class="{'active' : activeIndex == index }"> {{ item.name }}</span>
|
||||
<span class="numTip" style="opacity: 1 !important;" v-if="item.num > 0">{{item.num}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<van-pull-refresh class="refresh" v-model="isLoading" @refresh="onRefresh" v-show="!show">
|
||||
<van-list
|
||||
v-model="loading"
|
||||
:finished="finished"
|
||||
finished-text="没有更多了"
|
||||
@load="onLoad"
|
||||
>
|
||||
<div class="content_wrap">
|
||||
<div class="alarm_wrap" v-for="(item, index) in pageList" :key="index" @click="goDetail(item)">
|
||||
<div class="alarm_title">
|
||||
<div class="title_left">
|
||||
<span>{{item.alarmTypeString}}</span>
|
||||
<img class="alarm_level" v-if="item.level == 1" src="@/assets/alarm_one.png" alt="">
|
||||
<img class="alarm_level" v-if="item.level == 2" src="@/assets/alarm_two.png" alt="">
|
||||
<img class="alarm_level" v-if="item.level == 3" src="@/assets/alarm_three.png" alt="">
|
||||
</div>
|
||||
<div class="label">{{item.startTime}}</div>
|
||||
</div>
|
||||
<div class="alarm_content">
|
||||
<div class="label">车辆名称:</div>
|
||||
<div class="content">{{item.vehicleName}}</div>
|
||||
</div>
|
||||
<div class="alarm_content">
|
||||
<div class="label">报警详情:</div>
|
||||
<div class="content">{{item.alarmRemark}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</van-list>
|
||||
</van-pull-refresh>
|
||||
<div class="bgEmptyImg" v-show="show" >
|
||||
<img src="@/assets/empty.png" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {myMixins} from "@/utils/myMixins"
|
||||
import { getAlarmList, getAlarmCount } from "@/api/order"
|
||||
export default {
|
||||
name: "vehicleAlarmList",
|
||||
data() {
|
||||
return {
|
||||
tabArr: [{ name: '未处理', num: 0 }, { name: '技术处理中', num: 0 }, {name: '处理中', num: 1 }],
|
||||
activeIndex: 0,
|
||||
pageNum:1,
|
||||
pageSize:10,
|
||||
total:'',
|
||||
pageList: [],
|
||||
isLoading: '',
|
||||
loading: false,
|
||||
finished: false,
|
||||
}
|
||||
},
|
||||
mixins: [ myMixins ],
|
||||
computed:{
|
||||
show() {
|
||||
return (this.pageList.length < 0 || this.pageList.length == 0); // 判断数组长度是否大于 0
|
||||
},
|
||||
},
|
||||
async mounted() {
|
||||
await this.getList()
|
||||
},
|
||||
methods: {
|
||||
goDetail(item) {
|
||||
this.goPage('vehicleAlarmDetail', { code: item.code })
|
||||
},
|
||||
async getCount() {
|
||||
let res = await getAlarmCount();
|
||||
this.tabArr[0].num = res?.data?.alarmCount || 0
|
||||
this.tabArr[1].num = res?.data?.jxCount || 0
|
||||
this.tabArr[2].num = res?.data?.yyCount || 0
|
||||
},
|
||||
async changeTab(index) {
|
||||
this.activeIndex = index
|
||||
this.pageNum = 1
|
||||
this.pageList = [];
|
||||
this.total= 0
|
||||
await this.getList()
|
||||
},
|
||||
async getList() {
|
||||
let res = await getAlarmList({
|
||||
pageNum:this.pageNum,
|
||||
pageSize:this.pageSize,
|
||||
handStatus: this.activeIndex
|
||||
})
|
||||
this.total = res.total
|
||||
if(this.pageNum == 1){// 第一页直接赋值
|
||||
this.pageList=res.data
|
||||
}else{// 第二页数据拼接
|
||||
let preList = this.pageList;
|
||||
let arr = res.data;
|
||||
this.pageList = preList.concat(arr)
|
||||
}
|
||||
await this.getCount();
|
||||
},
|
||||
async onLoad(){
|
||||
this.pageNum++;
|
||||
await this.getList()
|
||||
this.loading = false;
|
||||
if (this.pageList.length >= this.total) {
|
||||
this.finished = true;
|
||||
}
|
||||
},
|
||||
async onRefresh() {
|
||||
this.pageNum=1
|
||||
await this.getList()
|
||||
setTimeout(() => {
|
||||
this.$toast('刷新成功');
|
||||
this.isLoading = false;
|
||||
}, 1000);
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.wrap{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #F4F5F7 !important;
|
||||
box-sizing: border-box;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.tab_wrap {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
padding-top: 15px;
|
||||
padding-bottom: 10px;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: #F4F5F7;
|
||||
z-index: 100;
|
||||
.item_wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.alpha {
|
||||
color: rgba(115, 115, 115, 0.7);
|
||||
font-size: 13px;
|
||||
line-height: 13px;
|
||||
}
|
||||
.active {
|
||||
font-size: 14px;
|
||||
color: #3678FF;
|
||||
position: relative;
|
||||
}
|
||||
.active:after {
|
||||
content: '';
|
||||
display: block;
|
||||
width: 18px;
|
||||
height: 3px;
|
||||
background: linear-gradient( 270deg, #33A3FF 0%, #176AFE 100%);
|
||||
border-radius: 2px;
|
||||
position: absolute;
|
||||
margin-top: 3px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
.numTip {
|
||||
border-radius: 4px;
|
||||
background: #F95B45;
|
||||
display: inline-block;
|
||||
padding: 2px 4px;
|
||||
font-weight: 600;
|
||||
font-size: 11px;
|
||||
color: #FFFFFF;
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
.content_wrap {
|
||||
padding: 50px 12px 0;
|
||||
.alarm_wrap {
|
||||
margin-top: 10px;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px 2px 10px 0px rgba(216,216,216,0.5);
|
||||
border-radius: 6px;
|
||||
padding: 13px 13px 17px 18px;
|
||||
box-sizing: border-box;
|
||||
.alarm_title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.label {
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
.title_left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
span {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
}
|
||||
.alarm_level {
|
||||
width: 32px;
|
||||
height: 14px;
|
||||
margin-left: 7px;
|
||||
}
|
||||
}
|
||||
.alarm_content {
|
||||
display: flex;
|
||||
margin-top: 10px;
|
||||
.content {
|
||||
margin-left: 10px;
|
||||
font-size: 13px;
|
||||
color: rgba(0, 0, 0, 0.75);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bgEmptyImg{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 90% ;
|
||||
background-color: #F4F5F7;
|
||||
img{
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|