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.
410 lines
9.1 KiB
410 lines
9.1 KiB
<template> |
|
<u-navbar title="合托" |
|
bgColor='#D3832A' leftIconColor='#ffffff' |
|
titleStyle='color:#ffffff' placeholder :autoBack="true" leftIconSize='35'></u-navbar> |
|
<view class="topbos"> |
|
<view class="srview"> |
|
<view>被合并托盘码</view> |
|
<view> |
|
<input placeholder="请扫描或输入" v-model="mergeTray" @focus="setstate(1)"/> |
|
</view> |
|
</view> |
|
<view class="srview"> |
|
<view>合并托盘码</view> |
|
<view> |
|
<input placeholder="请扫描或输入" v-model="newmergeTray" @focus="setstate(2)"/> |
|
</view> |
|
</view> |
|
</view> |
|
<view class="tabsetnumb"> |
|
<view @click="settabberstate(1)" :class="tabberstate==1?'xz':''"> |
|
<view>被合并托盘数据</view> |
|
<view></view> |
|
</view> |
|
<view @click="settabberstate(2)" :class="tabberstate==2?'xz':''"> |
|
<view>合并托盘数据</view> |
|
<view></view> |
|
</view> |
|
</view> |
|
<view class="tarynumvw"> |
|
托盘数量:{{(tabberstate==1?(beilist?.totalNum):(newbeilist?.totalNum))||0}} |
|
</view> |
|
<scroll-view scroll-y="true" class="scvorder"> |
|
<view class="itembox" v-for="(item,index) in (beilist?.list||[])" v-if="tabberstate==1"> |
|
<view class="topon1"> |
|
<view>{{index+1}}</view> |
|
<view> |
|
<view :class="item.isFleeing=='0'?'xzc':''">正常</view> |
|
<view :class="item.isFleeing=='1'?'xze':''">异常</view> |
|
</view> |
|
</view> |
|
<view class="topon2" v-if="item.orderCode"> |
|
<image src="/pagesHome/static/scanicon1.png"></image> |
|
<view>订单号:{{item.orderCode}}</view> |
|
</view> |
|
<view class="topon2" v-if="item.code"> |
|
<image src="/pagesHome/static/scanicon1.png"></image> |
|
<view>包装号:{{item.code}}</view> |
|
</view> |
|
<view class="topon2" v-if="item.num"> |
|
<image src="/pagesHome/static/scanicon1.png"></image> |
|
<view>录入数量:{{item.num}}</view> |
|
</view> |
|
</view> |
|
<view class="itembox" v-for="(item,index) in (newbeilist?.list||[])" v-if="tabberstate==2"> |
|
<view class="topon1"> |
|
<view>{{index+1}}</view> |
|
<view> |
|
<view :class="item.isFleeing=='0'?'xzc':''">正常</view> |
|
<view :class="item.isFleeing=='1'?'xze':''">异常</view> |
|
</view> |
|
</view> |
|
<view class="topon2" v-if="item.orderCode"> |
|
<image src="/pagesHome/static/scanicon1.png"></image> |
|
<view>订单号:{{item.orderCode}}</view> |
|
</view> |
|
<view class="topon2" v-if="item.code"> |
|
<image src="/pagesHome/static/scanicon1.png"></image> |
|
<view>包装号:{{item.code}}</view> |
|
</view> |
|
<view class="topon2" v-if="item.num"> |
|
<image src="/pagesHome/static/scanicon1.png"></image> |
|
<view>录入数量:{{item.num}}</view> |
|
</view> |
|
</view> |
|
</scroll-view> |
|
<view class="butys"> |
|
<view class="qut">取消</view> |
|
<view class="conf" @click="godetails">确认合并</view> |
|
</view> |
|
<tips ref="tip"></tips> |
|
</template> |
|
|
|
<script lang="ts" setup> |
|
import { |
|
warehouseTrayTypescanSourceTrayCode, |
|
warehouseTrayTypescanTargetTrayCode, |
|
warehouseTrayTypemergeTray |
|
} from '@/api/user.js' |
|
import { |
|
onLoad, |
|
onShow, |
|
onHide, |
|
onUnload |
|
} from '@dcloudio/uni-app' |
|
import { reactive, ref, toRefs } from "vue"; |
|
const tip=ref(null) |
|
const details=reactive({ |
|
scantype:1, |
|
mergeTray:'',//来源托盘 |
|
newmergeTray:'',//目标托盘 |
|
scancode:'', |
|
tabberstate:1, |
|
beilist:{} as any, |
|
newbeilist:{} as any, |
|
}) |
|
onLoad((op) => { |
|
// details.upshelfScanType = op.type |
|
details.scancode = 'HT20230800002' |
|
scandata() |
|
setTimeout(()=>{ |
|
details.scantype=2 |
|
details.scancode = 'HT20230800001' |
|
scandata() |
|
},2500) |
|
// setTimeout(()=>{ |
|
// details.scancode='23072506670-2' |
|
// scandata() |
|
// },4500) |
|
uni.$on('scancodedate', function (code) { |
|
if (code) { |
|
// console.log(code); |
|
details.scancode = code |
|
scandata() |
|
} |
|
}) |
|
}) |
|
function setstate(state:number){ |
|
details.scantype=state |
|
} |
|
async function scandata(){ |
|
// let res=await |
|
let res=null |
|
if(details.scantype==1){ |
|
let data={ |
|
trayCode:details.scancode |
|
} |
|
res=await warehouseTrayTypescanSourceTrayCode(data) |
|
}else if(details.scantype==2){ |
|
let data={ |
|
trayCode:details.scancode |
|
} |
|
res=await warehouseTrayTypescanTargetTrayCode(data) |
|
} |
|
if(res.code==200){ |
|
if(details.scantype==1){ |
|
details.beilist=res.data |
|
details.mergeTray=details.scancode |
|
}else if(details.scantype==2){ |
|
details.newbeilist=res.data |
|
details.newmergeTray=details.scancode |
|
} |
|
}else{ |
|
uni.showToast({ |
|
title:res.msg, |
|
icon:'none' |
|
}) |
|
} |
|
console.log(res); |
|
} |
|
function settabberstate(state:number){ |
|
details.tabberstate=state |
|
} |
|
function godetails(){ |
|
// uni.navigateTo({ |
|
// url:'/pagesHome/pages/MergeTrayDetails/MergeTrayDetails' |
|
// }) |
|
if(!details.newmergeTray){ |
|
uni.showToast({ |
|
title:'请扫描目标托盘', |
|
icon:'none' |
|
}) |
|
return |
|
} |
|
if(!details.mergeTray){ |
|
uni.showToast({ |
|
title:'请扫描来源托盘', |
|
icon:'none' |
|
}) |
|
return |
|
} |
|
tip.value.setdetails({ |
|
isshow:true, |
|
content:'是否确认合并?', |
|
confirmTxt:'合并', |
|
success:async ()=>{ |
|
let data={ |
|
sourceTrayCode:details.mergeTray, |
|
targetTrayCode:details.newmergeTray |
|
} |
|
let res=await warehouseTrayTypemergeTray(data) |
|
if(res.code==200){ |
|
uni.showToast({ |
|
title:'合并成功', |
|
icon:'none' |
|
}) |
|
uni.navigateTo({ |
|
url:'/pagesHome/pages/MergeTrayDetails/MergeTrayDetails?tray='+details.newmergeTray |
|
}) |
|
}else{ |
|
uni.showToast({ |
|
title:res.msg, |
|
icon:'none' |
|
}) |
|
} |
|
tip.value.setdetails({isshow:false}) |
|
}, |
|
cancel:()=>{ |
|
tip.value.setdetails({isshow:false}) |
|
}, |
|
close:()=>{ |
|
tip.value.setdetails({isshow:false}) |
|
}, |
|
}) |
|
} |
|
const { |
|
beilist, |
|
newbeilist, |
|
newmergeTray, |
|
mergeTray, |
|
scantype, |
|
scancode, |
|
tabberstate, |
|
}=toRefs(details) |
|
</script> |
|
|
|
<style lang="scss"> |
|
.butys{ |
|
display: flex; |
|
align-items: center; |
|
margin-top: 20upx; |
|
justify-content: space-around; |
|
>.conf{ |
|
width: 320upx; |
|
height: 100upx; |
|
border-radius: 20upx; |
|
display: flex; |
|
align-items: center; |
|
justify-content: center; |
|
font-size: 32upx; |
|
font-weight: 400; |
|
color: #FFFFFF; |
|
background-color: #D3832A; |
|
} |
|
>.qut{ |
|
width: 320upx; |
|
height: 100upx; |
|
border-radius: 20upx; |
|
display: flex; |
|
align-items: center; |
|
justify-content: center; |
|
font-size: 32upx; |
|
font-weight: 400; |
|
color: #5A6875; |
|
background-color: #FFFFFF; |
|
} |
|
} |
|
.scvorder{ |
|
width: 100%; |
|
margin-top: 20upx; |
|
height: 47vh; |
|
.itembox{ |
|
width: 686upx; |
|
border-radius: 20upx; |
|
padding: 0 20upx; |
|
box-sizing: border-box; |
|
background-color: #ffffff; |
|
margin: auto; |
|
margin-bottom: 20upx; |
|
>.topon1{ |
|
display: flex; |
|
align-items: center; |
|
justify-content: space-between; |
|
padding: 20upx 10upx; |
|
box-sizing: border-box; |
|
border-bottom: 4upx solid #EEEEEE; |
|
>view:nth-of-type(1){ |
|
width: 50rpx; |
|
height: 50rpx; |
|
background: #178AF220; |
|
border-radius: 50%; |
|
display: flex; |
|
align-items: center; |
|
justify-content: center; |
|
font-size: 28upx; |
|
font-weight: 500; |
|
color: #178AF2; |
|
} |
|
>view:nth-of-type(2){ |
|
display: flex; |
|
align-items: center; |
|
>view{ |
|
width: 136upx; |
|
height: 64upx; |
|
border-radius: 8upx; |
|
display: flex; |
|
align-items: center; |
|
justify-content: center; |
|
font-size: 28rpx; |
|
font-weight: 400; |
|
color: #90A0AF; |
|
background-color: #F5F5F6; |
|
margin-right: 20upx; |
|
&:nth-last-child(1){ |
|
margin-right: 0upx; |
|
} |
|
} |
|
.xzc{ |
|
background-color: #178AF2 !important; |
|
color: #ffffff !important; |
|
} |
|
.xze{ |
|
background-color: #F8544B !important; |
|
color: #ffffff !important; |
|
} |
|
>image{ |
|
width: 64upx; |
|
height: 64upx; |
|
} |
|
} |
|
} |
|
>.topon2{ |
|
display: flex; |
|
align-items: center; |
|
justify-content: flex-start; |
|
padding: 20upx 10upx; |
|
box-sizing: border-box; |
|
border-bottom: 4upx solid #EEEEEE; |
|
>image{ |
|
width: 64upx; |
|
height: 64upx; |
|
margin-right: 20upx; |
|
} |
|
>view{ |
|
font-size: 28upx; |
|
font-weight: 400; |
|
color: #020B18; |
|
} |
|
} |
|
} |
|
} |
|
.tarynumvw{ |
|
width: 100%; |
|
padding: 24upx 70upx; |
|
box-sizing: border-box; |
|
background-color: #ffffff; |
|
margin-top: 4upx; |
|
box-sizing: border-box; |
|
} |
|
.tabsetnumb{ |
|
display: flex; |
|
align-items: center; |
|
justify-content: space-between; |
|
background-color: #ffffff; |
|
margin-top: 20upx; |
|
.xz{ |
|
>view:nth-of-type(1){ |
|
color: #D3832A !important; |
|
} |
|
>view:nth-of-type(2){ |
|
background-color: #D3832A !important; |
|
} |
|
} |
|
>view{ |
|
width: 50%; |
|
display: flex; |
|
flex-direction: column; |
|
align-items: center; |
|
|
|
>view:nth-of-type(1){ |
|
font-size: 32upx; |
|
font-weight: 400; |
|
color: #020B18; |
|
padding: 30upx 0; |
|
} |
|
>view:nth-of-type(2){ |
|
width: 96upx; |
|
height: 8upx; |
|
background-color: #D3832A00; |
|
border-radius: 4upx; |
|
} |
|
} |
|
} |
|
.topbos{ |
|
display: flex; |
|
flex-direction: column; |
|
>.srview{ |
|
display: flex; |
|
align-items: center; |
|
padding: 26upx 32upx; |
|
box-sizing: border-box; |
|
background-color: #ffffff; |
|
margin-bottom: 4upx; |
|
&:nth-last-child(1){ |
|
margin-bottom: 0; |
|
} |
|
>view:nth-of-type(1){ |
|
width: 190upx; |
|
font-size: 28upx |
|
} |
|
>view:nth-of-type(2){ |
|
font-size: 28upx; |
|
flex: 1; |
|
>input{ |
|
flex: 1; |
|
font-size: 28upx; |
|
} |
|
} |
|
} |
|
} |
|
</style>
|
|
|