238 lines
7.1 KiB
Vue
238 lines
7.1 KiB
Vue
<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"
|
|
: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">
|
|
<image v-if="item.CHECKTYPE_NAME == '待承诺'" src="../../../static/driving.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>
|
|
<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;
|
|
},
|
|
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
|
|
console.log(this.pd)
|
|
if ((this.pd.WAYBILLSTATUS === '3' || this.pd.IsExist == '0') && index === 1) {
|
|
uni.showModal({
|
|
title: '提示',
|
|
cancelText: '确认',
|
|
confirmText: '取消',
|
|
content: '未进行出车前安全承诺,无法进行此操作',
|
|
});
|
|
return;
|
|
}else if ((this.pd.WAYBILLSTATUS === '0' || this.pd.IsExist == '0') && index === 2) {
|
|
uni.showModal({
|
|
title: '提示',
|
|
cancelText: '确认',
|
|
confirmText: '取消',
|
|
content: '未进行出车前检查,无法进行此操作',
|
|
});
|
|
return;
|
|
}else if ((this.pd.WAYBILLSTATUS === '0' || this.pd.WAYBILLSTATUS === '1' || this.pd.WAYBILLSTATUS === '2') && index === 0) {
|
|
uni.showModal({
|
|
title: '提示',
|
|
cancelText: '确认',
|
|
confirmText: '取消',
|
|
content: '您已经完成出车前安全承诺,无需再次承诺',
|
|
});
|
|
return;
|
|
}else if ((this.pd.WAYBILLSTATUS === '1' || this.pd.WAYBILLSTATUS === '2' || this.pd.WAYBILLSTATUS === '2') && index === 1) {
|
|
uni.showModal({
|
|
title: '提示',
|
|
cancelText: '确认',
|
|
confirmText: '取消',
|
|
content: '您已经完成出车前检查,无需再次检查',
|
|
});
|
|
return;
|
|
}else if ((this.pd.WAYBILLSTATUS === '2') && index === 2) {
|
|
uni.showModal({
|
|
title: '提示',
|
|
cancelText: '确认',
|
|
confirmText: '取消',
|
|
content: '您已经完成行车中检查,无需再次检查',
|
|
});
|
|
return;
|
|
}else if ((this.pd.WAYBILLSTATUS === '0') && index === 3) {
|
|
uni.showModal({
|
|
title: '提示',
|
|
cancelText: '确认',
|
|
confirmText: '取消',
|
|
content: '您未进行行车中检查,请按顺序检查',
|
|
});
|
|
return;
|
|
}else if ((this.pd.WAYBILLSTATUS === '3') && index === 3) {
|
|
uni.showModal({
|
|
title: '提示',
|
|
cancelText: '确认',
|
|
confirmText: '取消',
|
|
content: '您未进行行车中检查,请按顺序检查',
|
|
});
|
|
return;
|
|
}
|
|
|
|
/* if ((this.pd.WAYBILLSTATUS === '2' || this.pd.WAYBILLSTATUS === '3' || this.pd.IsExist != '0') && index === 1) {
|
|
uni.showModal({
|
|
title: '提示',
|
|
cancelText: '确认',
|
|
confirmText: '取消',
|
|
content: '您已经完成出车前检查,无需再次检查',
|
|
});
|
|
return;
|
|
} 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: '确认'
|
|
});
|
|
}
|
|
return
|
|
} else if ((this.pd.WAYBILLSTATUS === '2' || this.pd.IsExist == '2' || this.pd.IsExist == '0') && index === 3) {
|
|
uni.showModal({
|
|
title: '提示',
|
|
cancelText: '确认',
|
|
confirmText: '取消',
|
|
content: '您未进行行车中检查,请按顺序检查',
|
|
});
|
|
return;
|
|
}*/
|
|
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
|
|
});
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
.spot-list {}
|
|
|
|
.spot-cont {
|
|
margin-left: 20upx;
|
|
flex: 1;
|
|
}
|
|
|
|
.spot-cont .text {
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.spot-img {
|
|
width: 50upx;
|
|
height: 50upx;
|
|
}
|
|
|
|
.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;
|
|
}
|
|
</style>
|