<template>
|
<view class="appointment">
|
<view class="wait-collection"
|
style="background: url('https://mx.jzeg.cn:9096/appimg/image/banner/diverbanner.png') no-repeat;background-size:contain">
|
</view>
|
<uni-table border
|
stripe
|
emptyText="暂无更多数据">
|
<uni-tr>
|
<uni-th align="center">司机</uni-th>
|
<uni-th align="center">产品</uni-th>
|
<uni-th align="center">车牌号</uni-th>
|
<uni-th align="center">手机号</uni-th>
|
<uni-th align="center">操作</uni-th>
|
</uni-tr>
|
<uni-tr v-for="(item, index) in driverBillOfLoadingData"
|
:key="item.id">
|
<uni-td align="center">{{ item.driver }}</uni-td>
|
<uni-td align="center">{{ item.productName || '' }}</uni-td>
|
<uni-td align="center">{{ item.carNo || '' }}</uni-td>
|
<uni-td align="center">{{ item.phone || '' }}</uni-td>
|
<uni-td><u-button text="选择"
|
type="primary"
|
@click="yuYueBtnClick(item)"></u-button></uni-td>
|
</uni-tr>
|
</uni-table>
|
<view v-show="isshow">
|
<uni-table border
|
stripe
|
type="selection"
|
@selection-change="selectionChange"
|
emptyText="暂无更多数据">
|
<uni-tr>
|
<uni-th align="center">检测项</uni-th>
|
</uni-tr>
|
<uni-tr v-for="(item, index) in inspectData"
|
:key="item.id">
|
<uni-td align="center">{{ item.title }}</uni-td>
|
</uni-tr>
|
</uni-table>
|
<view class="fourth-line">
|
<view class="button-img"
|
@click.stop="toAppointmentClick(item)">确定</view>
|
</view>
|
</view>
|
<u-popup :show="show"
|
@close="close"
|
@open="open"
|
mode="center"
|
round="10">
|
<view class="receiverPopup">
|
<view class="receiverPopup__title"><text>确定检查完毕</text></view>
|
<view class="receiverPopup__btn"><u-button text="确定"
|
type="primary"
|
@click="popClick"
|
:disabled="canClick"
|
:loading="ClickLoading"></u-button></view>
|
</view>
|
</u-popup>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
components: {
|
},
|
data() {
|
return {
|
show: false, // 弹出全部领取提示
|
driverBillOfLoadingData:[],
|
inspectData:[],
|
isAllSelected:false,
|
isshow:false,
|
form:{},
|
ClickLoading:false
|
}
|
},
|
onShow() {
|
this.init();
|
},
|
methods: {
|
yuYueBtnClick(item){
|
this.inspectData=JSON.parse(item.inspectedResult)
|
this.form=item
|
this.isshow=true
|
},
|
selectionChange(items){
|
const allIds = this.inspectData.map(item => item);
|
this.isAllSelected = items?.detail.index.length === allIds.length
|
},
|
init() {
|
this.isAllSelected=false
|
this.TaskCoalList();
|
this.form={}
|
this.inspectData=[]
|
this.isshow=false
|
},
|
toAppointmentClick(){
|
if(this.isAllSelected==true){
|
let arr= this.driverBillOfLoadingData.map(i=>{
|
return {
|
carNo:i.carNo,
|
taskId:i.id,
|
taskcode:i.code,
|
}
|
})
|
this.show = true;
|
}else{
|
uni.$u.toast('必须全部检测')
|
}
|
|
},
|
popClick() {
|
this.ClickLoading = true;
|
this.inspectData=this.inspectData.map(item=>{
|
return {
|
...item,
|
valve:"通过"
|
}
|
})
|
uni.showLoading({ title: '加载中...' });
|
this.$reqPost('addCheckLog',{
|
carNo:this.form.carNo,
|
taskId:this.form.id,
|
taskcode:this.form.code,
|
inspectedResult:JSON.stringify(this.inspectData)
|
}, 'json').then(res => {
|
if (res.code === 0) {
|
uni.$u.toast('检查成功')
|
this.form={}
|
this.ClickLoading = false;
|
this.inspectData=[]
|
this.show = false;
|
this.isshow=false
|
this.TaskCoalList()
|
} else {
|
uni.$u.toast(res.msg ? res.msg : '检查失败')
|
}
|
})
|
},
|
open() {},
|
close() {
|
this.show = false;
|
},
|
// 司机首页列表
|
TaskCoalList() {
|
uni.showLoading({
|
title: '加载中...'
|
});
|
this.$reqGet('getCheckTaskCoal',{flag:0}).then(res => {
|
uni.hideLoading();
|
this.driverBillOfLoadingData = res.data;
|
});
|
|
},
|
}
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
.receiverPopup {
|
height: vww(110);
|
width: 300rpx;
|
|
.receiverPopup__title {
|
margin: vww(10) auto 0;
|
width: 80%;
|
text-align: center;
|
}
|
|
|
&__btn {
|
margin: vww(10) auto;
|
width: 50%;
|
|
.u-button {
|
height: vww(20);
|
}
|
}
|
}
|
.wait-collection {
|
width: 100%;
|
height: 600rpx;
|
}
|
::v-deep.appointment {
|
.appointment-description {
|
margin: vww(8) 0;
|
color: #fd1446;
|
|
text {
|
font-weight: bold;
|
display: inline-block;
|
margin-left: vww(5);
|
color: #252525;
|
}
|
}
|
@mixin fourthLine {
|
width: 64%;
|
height: vww(68);
|
display: flex;
|
align-items: center;
|
position: relative;
|
left: vww(102);
|
bottom: vww(3);
|
|
.button-img {
|
width: vww(122);
|
height: vww(41);
|
background: url('https://mx.jzeg.cn:9096/appimg/image/banner/button.png') no-repeat;
|
background-size: cover;
|
font-size: 28rpx;
|
font-weight: 300;
|
color: #ffffff;
|
text-align: center;
|
line-height: vww(40);
|
|
}
|
}
|
.fourth-line {
|
@include fourthLine;
|
}
|
|
// 表格
|
.uni-table-scroll {
|
width: 100%;
|
overflow-x: hidden;
|
|
.uni-table {
|
min-width: 0 !important;
|
|
.uni-table-tr {
|
padding: 0;
|
font-size: vww(10);
|
|
.uni-table-th {
|
height: vww(32);
|
line-height: vww(20);
|
padding: vww(5) vww(10);
|
color: #111111;
|
font-weight: 550;
|
background: #f5f5f5;
|
}
|
|
.uni-table-td {
|
height: vww(32);
|
line-height: vww(20);
|
padding: vww(5) vww(5);
|
color: #111111;
|
.u-button {
|
height: vww(23);
|
}
|
}
|
}
|
}
|
}
|
}
|
</style>
|