货无忧
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.

263 lines
6.0 KiB

2 years ago
<template>
1 year ago
<view class="head">
<view class="type1">
<view>货位<view style="color: #092C4D;">{{items.allocation}}</view></view>
<view>物品<view style="color: #092C4D;">{{items.materialName}}</view></view>
</view>
<view class="type1">
<view>SKU<view style="color: #092C4D;">{{items.sku}}</view></view>
<view>规格<view style="color: #092C4D;">{{items.cargoNorms}}</view></view>
</view>
<view class="type1">
<view>计划数量<view style="color: #092C4D;">{{items.planNum}}</view></view>
<view>单位<view style="color: #092C4D;">{{items.cargoUnit}}</view></view>
</view>
2 years ago
</view>
1 year ago
<view class="butsbx">
<view v-if="items.unpack==0">采集原包条码</view>
<view @click="showmd">新生成包码</view>
</view>
<scroll-view scroll-y="true" class="scrollv">
<view class="mabxs">
<view class="ite" v-for="(item,index) in codelist">
<view>
<view>序号{{index}}</view>
<view>作业时间2001-12-10</view>
</view>
<view>
<view>包条码{{item.packageCode}}</view>
<view></view>
</view>
</view>
</view>
</scroll-view>
<tiplist ref="tips"></tiplist>
2 years ago
</template>
<script lang="ts" setup>
1 year ago
import {
onLoad,
onShow,
onHide,
onUnload
} from '@dcloudio/uni-app'
import {
distributionStockupstockupStockListPackageCode,
distributionStockupstockupScan,
distributionStockuporderInfo
} from '@/api/user.js'
import { detailType } from '@/interfaces/pagesHome/setbarcode'
import { reactive, ref, toRefs } from "vue";
let details=reactive<detailType>({
items:{},
reservationId:'',
codelist:[],
printlist:[],
packageNum:0,
goodsAreaName:''
})
const tips=ref(null)
onLoad((op)=>{
details.items=JSON.parse(op.item)
details.reservationId=op.reservationId
details.goodsAreaName=op.goodsAreaName
uni.$on('scancodedate', function(code) {
if (code) {
console.log(code);
scandata(code)
}
})
initpage()
})
async function initpage(){
let data={
orderStatus:2,
reservationId:details.reservationId,
stockListId:details.items.stockListId
}
let response=await distributionStockuporderInfo(data)
details.codelist=response.data.packageList
}
function showmd(){
tips.value.setdetails({
list:details.printlist,
isshow:true,
tipstate:1,
placeholder:'请输入需要生成的包条码数量',
success:(deta)=>{
console.log(deta);
details.packageNum=deta.inputtext
if(Number(details.packageNum)>Number(details.items.planNum)){
uni.showToast({
title:'不能大于计划数量,请重新输入',
icon:'none'
})
tips.value.setdetails({inputtext:''})
return
}
ctokListpackage()
},
cancel:(details)=>{
tips.value.setdetails({isshow:false})
},
close:(details)=>{
tips.value.setdetails({isshow:false})
}
})
}
async function ctokListpackage(){
let data={
reservationId:details.reservationId,
stockListId:details.items.stockListId,
packageNum:details.packageNum
}
let response=await distributionStockupstockupStockListPackageCode(data)
console.log(response);
details.printlist=response.data
tips.value.setdetails({
title:'请选择要打印的包条',
tipstate:2,
list:response.data,
checklist:[],
inputtext:'',
confirmTxt:'打印',
success:(deta)=>{
if(deta.checklist.length==0){
uni.showToast({
title:'请先选择需要打印的包条码',
icon:'none'
})
return
}
scandata(response.data[0])
tips.value.setdetails({isshow:false})
},
cancel:(details)=>{
tips.value.setdetails({isshow:false})
},
close:(details)=>{
tips.value.setdetails({isshow:false})
}
})
}
async function scandata(code){
let data={
scanType:2,
stockListId:details.items.stockListId,
packetBarCode:code,
stockupArea:details.goodsAreaName,
reservationId:details.reservationId,
}
let response=await distributionStockupstockupScan(data)
console.log(response);
}
const { items,codelist,printlist }=toRefs(details)
2 years ago
</script>
<style lang="scss">
1 year ago
.scrollv{
width: 686upx;
height: 74vh;
// padding: 10upx;
box-sizing: border-box;
background-color: #ffffff;
margin: auto;
margin-top: 20upx;
padding: 20upx;
box-sizing: border-box;
border-radius: 10upx;
.mabxs{
display: flex;
flex-direction: column;
align-items: center;
padding-top: 5upx;
.ite{
width: 96%;
// width: 100%;
display: flex;
flex-direction: column;
align-items: center;
padding: 20upx 15upx;
box-sizing: border-box;
border-radius: 8upx;
box-shadow: 0upx 2upx 10upx 0upx #e2e2e3;
margin-bottom: 20upx;
padding-bottom: 10upx;
font-size: 26upx;
&:nth-last-child(1){
margin-bottom: 5upx;
}
>view{
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
margin-bottom: 20upx;
&:nth-last-child(1){
margin-bottom: none !important;
}
>view{
// width: 50%;
// flex: 1;
font-size: 26upx;
font-weight: 400;
color: #092C4D;
}
}
}
}
}
.butsbx{
display: flex;
align-items: center;
justify-content: space-around;
margin-top: 25upx;
>view{
width: 204upx;
height: 64upx;
background: #FFFFFF;
border-radius: 8upx;
opacity: 1;
font-size: 28upx;
display: flex;
align-items: center;
justify-content: center;
border: 2upx solid #D3832A;
color: #D3832A;
&:nth-of-type(2){
// margin-left: 10upx;
}
}
}
.head{
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
padding: 20upx;
height: 176upx;
box-sizing: border-box;
// border-bottom: 1upx solid #ececec;
background-color: #ffffff;
>.type1{
width: 100%;
// height: 60upx;
display: flex;
align-items: flex-start;
justify-content: space-between;
font-size: 28upx;
font-weight: 400;
color: #90A0AF;
>view{
width: 50%;
display: flex;
align-items: flex-start;
>view:nth-of-type(1){
flex: 1;
}
}
}
}
2 years ago
</style>