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.
 
 
 
 
cy_pda/pages/smallStore/picking.vue

258 lines
6.4 KiB

<template>
<view class="container">
<u-input class="input" v-model="wareHouse" border type="text" placeholder="请扫描货位" placeholder-style="color:#666666" />
<view class="content">
<view class="item">
<span class="itemLabel">货位名称:</span>
<span class="itemValue">{{ result.outLocationName }}</span>
</view>
<view class="item">
<span class="itemLabel">商品编号:</span>
<span class="itemValue">{{ result.goodNo }}</span>
</view>
<view class="item">
<span class="itemLabel">商品名称:</span>
<span class="itemValue">{{ result.goodName }}</span>
</view>
<view class="item">
<span class="itemLabel">规格:</span>
<span class="itemValue">{{ result.specifications }}</span>
</view>
<view class="item">
<span class="itemLabel">厂家:</span>
<span class="itemValue">{{ result.factory }}</span>
</view>
<view class="item">
<span class="itemLabel">产地:</span>
<span class="itemValue">{{ result.areaCode }}</span>
</view>
<view class="item">
<span class="itemLabel">件装量:</span>
<span class="itemValue">{{ result.packageQty }} 单位:{{getDic(result.unit)}}</span>
</view>
<view class="item">
<span class="itemLabel">拣货数量:</span>
<span class="itemValue">{{ result.pickQty }}</span>
</view>
<view class="item">
<span class="itemLabel">批号:</span>
<span class="itemValue">{{ result.batchNo }}</span>
</view>
<view class="item">
<span class="itemLabel">显示效期:</span>
<span class="itemValue">{{ result.productionDate }} —— {{ result.expiredDate }}</span>
</view>
</view>
<div>
<view class="desktop">
<view v-for="item in container" :key="item.containerCode" class="desktopItem" :style="{backgroundColor:(item.pickQty?'#67c237':null)}">
<span class="desktopLabel">{{ item.containerCode}}</span>
<span v-if="item.pickQty" class="desktopValue">{{ item.pickQty }}</span>
</view>
</view>
<view class="footer">
<u-button type="primary" @click="show = true">冲红</u-button>
<u-button type="success" @click="sure()">确认</u-button>
</view>
</div>
<u-popup v-model="show" mode="center" width="80%" height="200px" border-radius="14">
<view style="display: flex;align-items: center;padding: 0 40rpx;margin:40rpx 0rpx">
<span style="width: 100rpx;">工号</span>
<u-input v-model="username" type="text" :border="true" />
</view>
<view style="display: flex;align-items: center;padding: 0 40rpx;">
<span style="width: 100rpx">密码</span>
<u-input v-model="password" type="password" :border="true" />
</view>
<view class="confrim-btn">
<u-button type="primary" style="width:200rpx; margin-top: 40rpx" @click="isHave()">确定</u-button>
</view>
</u-popup>
</view>
</template>
<script>
export default {
data() {
return {
result: {},
container: [],
wareHouse: '',
show: false,
username: '',
password: '',
dicOptions: []
}
},
onLoad(e) {
this.result = JSON.parse(e.list)
this.container = JSON.parse(e.container)
this.getDic()
},
methods: {
getDic() {
this.$u.api.getByDicType().then(res => {
this.dicOptions = res.data;
});
},
transUnit(unit) {
for (let dic in this.dicOptions) {
if (this.dicOptions[dic].dictValue === unit) {
return this.dicOptions[dic].dictLabel;
}
}
},
isHave() {
if(this.username&&this.password) {
this.$u.api.pickingManage.loginConfirm({
username: this.username,
password: this.password
}).then((res)=>{
if(res.code===200) {
this.$u.route({
url: 'pages/smallStore/rushRed',
type: 'navigateTo',
params: {
list: JSON.stringify(this.result)
}
})
} else {
this.$u.toast(res.msg)
}
this.show = false
})
} else {
this.$u.toast('请输入账号或密码')
}
},
checkOutPick() {
this.$u.api.pickingManage.checkOutPick({
taskType: 0
}).then(res => {
if(res.code===200) {
// 进入索取页面
if(res.data.pickType===200) {
// 零货
// 跳转到复核台
this.$u.route({
url: 'pages/smallStore/reviewStage',
type: 'navigateTo',
params: {
pickGroup: this.result.pickGroup
}
})
}
//进入拣货页面
if(res.data.pickType===800) {
// 零货
this.$u.route({
url: 'pages/smallStore/picking',
type: 'navigateTo',
params: {
list: JSON.stringify(res.data.businOutPickDTaskVo),
container: JSON.stringify(res.data.containrList)
}
})
}
// 进入绑定周转箱页面
if(res.data.pickType===801) {
// 零货
this.$u.route({
url: 'pages/smallStore/bind',
type: 'navigateTo',
params: {
list: JSON.stringify(res.data.taskAndContainerList)
}
})
}
}
});
},
sure() {
if(this.wareHouse) {
this.$u.api.pickingManage.pickPieceTaskConfirm({
...this.result,
scannedLocationCode: this.wareHouse
}).then((res)=>{
console.log(res)
if(res.code===200) {
this.checkOutPick()
} else {
this.$u.toast(res.msg)
}
})
} else {
this.$u.toast('请先扫描货位')
}
},
}
}
</script>
<style lang="scss" scoped>
.container {
width: 90%;
height: calc(100vh - 120rpx);
margin: 20rpx auto;
border:0.5px solid #333333
}
.input {
width: 90%;
margin: 20rpx auto;
}
.content {
width: 90%;
margin: 20rpx auto;
}
.item {
display: flex;
align-items: center;
font-size: 28rpx;
line-height: 50rpx;
.itemLabel {
color: #555555;
width: 160rpx;
text-align: right;
}
.itemValue {
color: #333333;
}
}
.desktop {
border-top: 0.5px solid #333333;
border-left: 0.5px solid #333333;
display: flex;
flex-wrap: wrap;
width: 70%;
margin: 0 auto;
}
.desktopItem {
width: 50%;
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
height: 140rpx;
border-bottom: 0.5px solid #333333;
border-right: 0.5px solid #333333;
}
.desktopLabel {
text-align: center;
}
.desktopValue {
text-align: center;
color: #0000FF;;
}
.footer {
width: 90%;
margin: 0 auto;
margin-top: 40rpx;
display: flex;
justify-content: space-between;
}
</style>