integrated_traffic_uniapp/pages/application/driving-inspections/driving-item-list.vue

181 lines
4.8 KiB
Vue
Raw Normal View History

2024-03-22 15:09:31 +08:00
<template>
<view>
<cu-custom bgColor="bg-gradual-blueness" :isBack="true" :isRingt="true">
<block slot="backText">返回</block>
<block slot="content">排查项列表</block>
</cu-custom>
<scroll-view scroll-y>
<view class="spot-list">
<view v-for="(item, index) in list" :key="item.CHECKTYPE_ID"
2024-05-09 18:08:07 +08:00
:class="['spot-item', { 'active': (pd.WAYBILLSTATUS == '3' && item.CHECKTYPE_NAME == '待承诺') || (pd.WAYBILLSTATUS == '0' && item.CHECKTYPE_NAME == '出车前') || (pd.WAYBILLSTATUS == '1' && item.CHECKTYPE_NAME == '行车中') || (pd.WAYBILLSTATUS == '2' && item.CHECKTYPE_NAME == '收车后') }]"
@click="$noMultipleClicks(goToList,{
'CHECKTYPE_ID':item.CHECKTYPE_ID,
'CHECKTYPE_NAME':item.CHECKTYPE_NAME,
'WAYBILLREGISTRATION_ID':WAYBILLREGISTRATION_ID,index})">
<view class="spot-img">
2024-05-09 18:08:07 +08:00
<image v-if="item.CHECKTYPE_NAME == '待承诺'" src="../../../static/driving_before.png" mode=""></image>
<image v-if="item.CHECKTYPE_NAME == '出车前'" src="../../../static/driving_before.png" mode=""></image>
<image v-if="item.CHECKTYPE_NAME == '行车中'" src="../../../static/driving.png" mode=""></image>
<image v-if="item.CHECKTYPE_NAME == '收车后'" src="../../../static/driving_affter.png" mode=""></image>
</view>
2024-03-22 15:09:31 +08:00
<view class="spot-cont">
<view class="text f30">
{{item.CHECKTYPE_NAME}}
</view>
</view>
</view>
</view>
<view class="cu-tabbar-height"></view>
</scroll-view>
</view>
</template>
<script>
import {
basePath,
loginUser,
} from '@/common/tool.js';
import ykAuthpup from "@/components/yk-authpup/yk-authpup"
export default {
components: {
ykAuthpup
},
data() {
return {
permissionID: '',
noClick: true,
initflag: false,
listId: '',
status: '',
pd:[],
list: [],
dataFlag: 'noData',
CHECKRECORD_ID: '',
}
},
onLoad(e) {
this.WAYBILLREGISTRATION_ID = e.listId;
this.status = e.status;
this.getData();
},
onShow(e) {
var _this = this;
if (_this.initflag) {
_this.initflag = false;
_this.list = [];
}
this.getData()
},
methods: {
getData() {
var _this = this;
uni.showLoading({
title: '请稍候'
})
uni.request({
url: basePath + '/app/drivingitem/getDrivingItem',
method: 'POST',
dataType: 'json',
header: {
'Content-type': 'application/x-www-form-urlencoded'
},
data: {
USER_NAME: loginUser.NAME,
CORPINFO_ID: loginUser.CORPINFO_ID,
USER_ID: loginUser.USER_ID,
WAYBILLREGISTRATION_ID: _this.WAYBILLREGISTRATION_ID,
},
success: (res) => {
if ("success" == res.data.result) {
uni.hideLoading();
_this.list = res.data.varList;
_this.pd = res.data.pd;
} else {
uni.showToast({
icon: 'none',
title: '系统异常',
duration: 2000
});
}
}
});
},
//跳转事件
goToList(e) {
const index = e.index
2024-05-09 18:08:07 +08:00
const WAYBILLSTATUS = this.pd.WAYBILLSTATUS
if((this.pd.WAYBILLSTATUS === '1' || this.pd.WAYBILLSTATUS === '2' || this.pd.IsExist != '0') && index === 1){
2024-03-22 15:09:31 +08:00
uni.showModal({
title: '提示',
cancelText: '确认',
confirmText: '取消',
content:'您已经完成出车前检查,无需再次检查',
});
return;
2024-05-09 18:08:07 +08:00
}else if((this.pd.WAYBILLSTATUS === '2' || this.pd.IsExist == '1' || this.pd.IsExist == '0') && index === 2){
if(this.pd.WAYBILLSTATUS === '0') {
uni.showModal({
title: '提示',
content:'未进行出车前检查,无法进行此操作',
showCancel: false,
confirmText: '确认'
});
}
2024-03-22 15:09:31 +08:00
return
2024-05-09 18:08:07 +08:00
}else if((this.pd.WAYBILLSTATUS === '2' || this.pd.IsExist == '2' || this.pd.IsExist == '0') && index === 3){
2024-03-22 15:09:31 +08:00
uni.showModal({
title: '提示',
cancelText: '确认',
confirmText: '取消',
content:'您未进行行车中检查,请按顺序检查',
});
return;
2024-05-09 18:08:07 +08:00
}
uni.navigateTo({
url: '/pages/application/driving-inspections/driving-item-check-list?CHECKTYPE_ID=' +
e.CHECKTYPE_ID + '&CHECKTYPE_NAME=' + e.CHECKTYPE_NAME + '&WAYBILLREGISTRATION_ID=' + e.WAYBILLREGISTRATION_ID
});
}
}
}
2024-03-22 15:09:31 +08:00
</script>
<style>
.spot-list {}
.spot-cont {
margin-left: 20upx;
flex: 1;
}
.spot-cont .text {
line-height: 1.4;
}
.spot-img {
width: 50upx;
height: 50upx;
2024-03-22 15:09:31 +08:00
}
.spot-img image {
width: 100%;
height: 100%;
}
.spot-list .spot-item {
display: flex;
align-items: center;
background-color: #fff;
border-radius: 10upx;
margin: 20upx;
padding: 20upx;
}
.spot-list .spot-item.active{
box-shadow: 0 0 10px #dcf7dc;
border: 1px solid #65da99;
}
2024-03-22 15:09:31 +08:00
</style>