货无忧
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

649 lines
15 KiB

2 years ago
<template>
<!-- <u-navbar title="装车扫描" placeholder border=true :autoBack="true" leftIconSize='35'></u-navbar> -->
<u-navbar title="装车扫描"
bgColor='#D3832A' leftIconColor='#ffffff'
titleStyle='color:#ffffff' placeholder
:autoBack="true" leftIconSize='35'></u-navbar>
<view class="tabbmiax">
<view @click="setstates(1)" :class="checkstate==1?'xz':''">
<view>商配</view>
<view></view>
</view>
<view @click="setstates(2)" :class="checkstate==2?'xz':''">
<view>市配</view>
<view></view>
</view>
</view>
2 years ago
<view class="schbox">
<view>配车日期</view>
<view @click='showtime(true)' class="inputsr">
2 years ago
<input :value='datatime' disabled placeholder="请选择时间"/>
<view @click.stop.prevent>
<u-icon @click='showtime(true)' style="margin-right: 10rpx;" v-if="!datatime" name="calendar" color="#999999" size="50"></u-icon>
<u-icon @click="cleartime" style="margin-right: 10rpx;" v-else name="close-circle" color="#999999" size="40"></u-icon>
2 years ago
</view>
</view>
2 years ago
<view @click="init">
2 years ago
查询
</view>
</view>
2 years ago
<scroll-view scroll-y="true" class="scvbx" @scrolltolower="jiazai">
2 years ago
<view class="mabxslist">
<view class="item" v-for="item in recordsList">
<view class="headtop">
<view class="type1s">
<view>
1 year ago
<text style="color: #90A0AF;">配送类型</text>{{item.type_name}}
2 years ago
</view>
<view>
1 year ago
<text style="color: #90A0AF;">配送状态</text>{{item.vehicleStatus_name}}
2 years ago
</view>
</view>
<view class="type1s">
<view>
2 years ago
<text style="color: #90A0AF;">车牌号</text>{{item.vehicleName}}
2 years ago
</view>
<view>
2 years ago
<text style="color: #90A0AF;">司机</text>{{item.driverName}}
2 years ago
</view>
</view>
<view class="type1s">
<view>
1 year ago
<text style="color: #90A0AF;">装卸班组</text>{{item.loadingTeamName}}
2 years ago
</view>
<view class="bhcolor">
2 years ago
<text style="color: #90A0AF;">备货是否完成</text>{{item.isstock}}
2 years ago
</view>
</view>
<view class="type1s">
<view>
1 year ago
<text style="color: #90A0AF;">客户</text>{{item.consignee}}
2 years ago
</view>
</view>
<view class="type1s">
<view>
1 year ago
<text style="color: #90A0AF;">配送日期</text>{{item.createTime}}
2 years ago
</view>
</view>
<view class="type1s" v-if="item.departureTime">
<view>
<text style="color: #90A0AF;">发车时间</text>{{item.departureTime}}
</view>
</view>
<view class="type1s">
<view>
<text style="color: #90A0AF;">备货区</text>{{item.stockupArea||'无备货区'}}
</view>
</view>
2 years ago
<view class="type1s" @click="goloddeta(item)">
<view class="bhcolor">
<text style="color: #90A0AF ;">车次号</text><text style="text-decoration: underline;">{{item.trainNumber}}</text>
2 years ago
</view>
</view>
<view class="liebs">
<view>
<view>配送客户数</view>
2 years ago
<view>{{item.customersNumber}}</view>
2 years ago
</view>
<view>
<view>订单总数</view>
2 years ago
<view>{{item.orderNumber}}</view>
2 years ago
</view>
<view>
<view>计划件数</view>
2 years ago
<view>{{item.deliveryNumber}}</view>
2 years ago
</view>
<view>
<view>装车件数</view>
2 years ago
<view>{{item.scannedNumber}}</view>
2 years ago
</view>
<view>
<view>库存品数</view>
<view>{{item.inventoryNub}}</view>
</view>
2 years ago
</view>
</view>
<view class="buts">
<view v-if="!item.departureTime" @click="startld(item)">发车</view>
2 years ago
<view @click="goselscan(item)">装车扫描</view>
2 years ago
</view>
</view>
</view>
</scroll-view>
2 years ago
<l-calendar v-model:value="show" :initStartDate='date[0]' :initEndDate='date[1]' @hide='showCalendar' @change="onConfirm"></l-calendar>
<!-- <u-datetime-picker :show="show" mode="datetime" @cancel="showtime(false)" @confirm="checktime"
itemHeight='80'></u-datetime-picker> -->
<tiplist ref="tiplists"></tiplist>
<tips ref="tip"></tips>
2 years ago
</template>
<script lang="ts" setup>
import {
onLoad,
onShow,
onHide,
onUnload
} from '@dcloudio/uni-app'
2 years ago
import {
deliverypage,
deliverystart,
deliveryvehicle,
2 years ago
} from '@/api/user.js'
2 years ago
import { detailType } from '@/interfaces/pagesHome/LoadingScan'
import { reactive, toRefs,ref,watchEffect } from "vue";
2 years ago
let details = reactive<detailType>({
datatime: '',
show: false,
2 years ago
recordsList:[],
current:1,
size:10,
checkstate:1,
2 years ago
})
const tip = ref<any>(null)
const tiplists = ref<any>(null)
2 years ago
const date = ref<number|string[]>([])
1 year ago
onShow(()=>{
initpage()
})
2 years ago
function showCalendar(){
details.show=!details.show
}
function stop(){
}
function setstates(state:number){
if(details.checkstate==state){
return
}
details.checkstate=state
init()
}
async function startld(item){
tip.value.setdetails({
title: '提示',
content:'确认发车?',
confirmTxt: '发车',
isshow: true,
isshowcancel: true,
success:async () => {
Departure(item)
},
cancel: () => {
tip.value.setisshow(false)
},
close: () => {
tip.value.setisshow(false)
}
})
}
async function Departure(item){
tip.value.setisshow(false)
let data={
deliveryId:item.id
}
let res=await deliveryvehicle(data)
if(res.data.length == 1 ){
let data={
deliveryId:item.id,
loadingId:res.data[0].id
}
let response=await deliverystart(data)
if(response.code==200){
uni.showToast({
title:'发车成功',
icon:'none'
})
init()
}
return
}
if(res.data.length == 0 ){
uni.showToast({
title:'没有司机数据',
icon:'none'
})
return
}
let list=[]
res.data.map(item=>{
list.push(item.driverName+'---'+item.vehicleNub)
})
tiplists.value.setdetails({
title:'请选择车辆',
isshow:true,
tipstate:2,
list,
checklist:[],
inputtext:'',
confirmTxt:'确认选择',
isonecheck:true,
success:async (deta)=>{
if(deta.checklist.length==0){
uni.showToast({
title:'请选择车辆',
icon:'none'
})
return
}
tiplists.value.setdetails({isshow:false})
let data={
deliveryId:item.id,
loadingId:res.data[deta.checklist[0]].id
}
let response=await deliverystart(data)
if(response.code==200){
init()
uni.showToast({
title:'发车成功',
icon:'none'
})
}
},
cancel:(details)=>{
tiplists.value.setdetails({isshow:false})
},
close:(details)=>{
tiplists.value.setdetails({isshow:false})
}
})
}
2 years ago
function init(){
details.current=1
details.recordsList=[]
2 years ago
initpage()
}
function jiazai(){
details.current++
initpage()
}
watchEffect(()=>{
if((date.value as []).length!=0){
details.datatime=date.value[0]+' 至 '+date.value[1]
}
})
2 years ago
function onConfirm(e:any) {
console.log(e);
date.value[0]=e.startDate
date.value[1]=e.endDate
details.datatime=date.value[0]+' 至 '+date.value[1]
// details.datatime=(uni as any).$u.timeFormat(date.value[0], 'yyyy-mm-dd')+' 至 '+(uni as any).$u.timeFormat(date.value[1], 'yyyy-mm-dd')
}
2 years ago
onLoad(()=>{
date.value[0]=(uni as any).$u.timeFormat((new Date().valueOf()-1000*60*60*24*3), 'yyyy-mm-dd')
date.value[1]=(uni as any).$u.timeFormat((new Date().valueOf()), 'yyyy-mm-dd')
2 years ago
details.current=1
2 years ago
})
function showtime(value : boolean) {
console.log(value);
details.show = value
}
async function initpage(){
let data={
2 years ago
current:details.current,
size:details.size,
2 years ago
taskTime_start:date.value[0]||'',
taskTime_end:date.value[1]||'',
type:details.checkstate
2 years ago
}
let response=await deliverypage(data)
console.log(response);
if(details.current==1){
details.recordsList=response.data.records
}else{
if(response.data.records.lngth==0){
uni.showToast({
title:'已经到底了。',
icon:'none'
})
1 year ago
details.current--
return
}
details.recordsList=details.recordsList.concat(response.data.records)
}
// details.recordsList=response.data.records
2 years ago
}
function checktime(event : any) {
console.log(event);
details.datatime = (uni as any).$u.timeFormat(event.value, 'yyyy-mm-dd');
details.show = false
console.log(details.datatime);
}
2 years ago
async function goselscan(item:any) {
let data={
deliveryId:item.id
}
let res=await deliveryvehicle(data)
1 year ago
if(res.data.length == 1 ){
2 years ago
uni.setStorageSync('checkvehicle',res.data[0])
uni.navigateTo({
url: '/pagesHome/pages/DeliveryCustomerScan/DeliveryCustomerScan?id='+item.id+'&item='+JSON.stringify(item)
})
return
}
1 year ago
if(res.data.length == 0 ){
uni.showToast({
title:'没有司机数据',
icon:'none'
})
return
}
2 years ago
let list=[]
res.data.map(item=>{
list.push(item.driverName+'---'+item.vehicleNub)
})
tiplists.value.setdetails({
2 years ago
title:'请选择车辆',
isshow:true,
tipstate:2,
list,
checklist:[],
inputtext:'',
confirmTxt:'确认选择',
isonecheck:true,
success:(deta)=>{
if(deta.checklist.length==0){
uni.showToast({
title:'请选择车辆',
icon:'none'
})
return
}
tiplists.value.setdetails({isshow:false})
2 years ago
uni.setStorageSync('checkvehicle',res.data[deta.checklist[0]])
uni.navigateTo({
url: '/pagesHome/pages/DeliveryCustomerScan/DeliveryCustomerScan?id='+item.id+'&item='+JSON.stringify(item)
})
},
cancel:(details)=>{
tiplists.value.setdetails({isshow:false})
2 years ago
},
close:(details)=>{
tiplists.value.setdetails({isshow:false})
2 years ago
}
})
}
async function goloddeta(item){
let data={
deliveryId:item.id
}
let res=await deliveryvehicle(data)
console.log(res);
2 years ago
if(res.data.length==1){
uni.setStorageSync('checkvehicle',res.data[0])
uni.navigateTo({
url: '/pagesHome/pages/LoadingDetails/LoadingDetails?item='+JSON.stringify(item)
})
return
}
1 year ago
if(res.data.length == 0 ){
uni.showToast({
title:'没有司机数据',
icon:'none'
})
return
}
2 years ago
let list=[]
res.data.map(item=>{
list.push(item.driverName+'---'+item.vehicleNub)
})
tiplists.value.setdetails({
2 years ago
title:'请选择车辆',
isshow:true,
tipstate:2,
list,
checklist:[],
inputtext:'',
confirmTxt:'确认选择',
isonecheck:true,
success:(deta)=>{
if(deta.checklist.length==0){
uni.showToast({
title:'请选择车辆',
icon:'none'
})
return
}
tiplists.value.setdetails({isshow:false})
2 years ago
uni.setStorageSync('checkvehicle',res.data[deta.checklist[0]])
2 years ago
uni.navigateTo({
url: '/pagesHome/pages/LoadingDetails/LoadingDetails?item='+JSON.stringify(item)
})
},
cancel:(details)=>{
tiplists.value.setdetails({isshow:false})
2 years ago
},
close:(details)=>{
tiplists.value.setdetails({isshow:false})
2 years ago
}
2 years ago
})
2 years ago
// return
2 years ago
}
function cleartime(){
2 years ago
// console.log(cleartime);
2 years ago
details.datatime=''
2 years ago
date.value=[]
init()
2 years ago
}
const { checkstate,datatime, recordsList, show } = toRefs(details)
2 years ago
</script>
<style lang="scss">
.tabbmiax{
display: flex;
align-items: center;
justify-content: space-between;
background-color: #ffffff;
.xz{
>view:nth-of-type(1){
color: #FA8C16 !important;
}
>view:nth-of-type(2){
background-color: #FA8C16 !important;
}
}
>view{
width: 50%;
height: 80upx;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
border-bottom: 1upx solid #EEEEEE;
&:nth-of-type(1){
border-right: 1upx solid #EEEEEE;
}
>view:nth-of-type(1){
font-size: 34upx;
color: #092C4D;
}
>view:nth-of-type(2){
width: 58upx;
height: 8upx;
margin-top: 10upx;
border-radius: 20upx;
}
}
}
2 years ago
.inputsr{
2 years ago
width: 400upx !important;
height: 64upx;
2 years ago
background: #F5F5F6;
2 years ago
border-radius: 8upx 8upx 8upx 8upx;
2 years ago
opacity: 1;
2 years ago
border: 2upx solid #EEEEEE;
2 years ago
padding: 16upx 18upx;
box-sizing: border-box;
padding-right: 0;
display: flex;
align-items: center;
2 years ago
justify-content: space-between;
font-size: 26upx;
2 years ago
font-weight: 400;
color: #092C4D;
2 years ago
>input{
flex: 1;
font-size: 26upx;
}
2 years ago
}
.scvbx {
width: 100%;
height: 75vh;
2 years ago
margin-top: 20upx;
.mabxslist {
display: flex;
flex-direction: column;
align-items: center;
>.item {
width: 686upx;
// height: 610upx;
background: #FFFFFF;
border-radius: 8upx;
padding: 20upx 0;
box-sizing: border-box;
margin-bottom: 20upx;
>.headtop {
display: flex;
flex-direction: column;
padding: 24upx;
>.type1s {
display: flex;
2 years ago
align-items: flex-start;
2 years ago
justify-content: space-between;
margin-bottom: 20upx;
box-sizing: border-box;
font-size: 28upx;
font-weight: 400;
color: #092C4D;
>view {
flex: 1;
}
.bhcolor{
color: #0086F1;
}
}
>.liebs {
display: flex;
2 years ago
align-items: flex-start;
2 years ago
justify-content: space-around;
>view {
display: flex;
flex-direction: column;
align-items: center;
margin-top: 20upx;
&:nth-of-type(1) {
>view:nth-of-type(2) {
color: #092C4D;
}
}
&:nth-of-type(2) {
>view:nth-of-type(2) {
color: #0086F1;
}
}
&:nth-of-type(3) {
>view:nth-of-type(2) {
color: #3AD8BC;
}
}
&:nth-of-type(4) {
>view:nth-of-type(2) {
color: #FA8C16;
}
}
>view:nth-of-type(1) {
font-size: 28upx;
font-weight: 400;
color: #092C4D;
}
>view:nth-of-type(2) {
font-size: 36upx;
font-weight: 400;
margin-top: 20upx;
}
}
}
}
>.buts {
border-top: 3upx solid #EEEEEE;
display: flex;
align-items: center;
justify-content: space-around;
padding-top: 20upx;
>view {
width: 204upx;
height: 64upx;
border-radius: 8upx;
opacity: 1;
display: flex;
align-items: center;
justify-content: center;
font-size: 28upx;
}
>view:nth-of-type(1) {
border: 2upx solid #0086F1;
color: #0086F1;
}
>view:nth-of-type(2) {
border: 2upx solid #D3832A;
color: #D3832A;
}
}
}
}
}
.schbox {
display: flex;
align-items: center;
justify-content: space-between;
padding: 15upx 32upx;
box-sizing: border-box;
background-color: #ffffff;
>view:nth-of-type(1) {
// width: 150upx;
font-size: 28upx;
font-weight: 400;
color: #092C4D;
}
>view:nth-of-type(2) {
width: 380upx;
// height: 64upx;
}
>view:nth-of-type(3) {
width: 128upx;
height: 64upx;
background: #D3832A;
border-radius: 8upx;
display: flex;
align-items: center;
justify-content: center;
font-size: 32upx;
font-weight: 400;
color: #FFFFFF;
}
}
</style>