<template>
|
<view class="has-foot">
|
<form>
|
<view class="cu-form-group margin-top">
|
<view class="title">容器号</view>
|
<input
|
placeholder="请扫容器条码"
|
v-model="container"
|
/>
|
<!-- <text class='cuIcon-search text-blue' @click="search"></text> -->
|
</view>
|
<view class="cu-form-group">
|
<view class="title">新容器号</view>
|
<input
|
placeholder="请扫描新容器号"
|
v-model="newContainer"
|
/>
|
</view>
|
</form>
|
|
<view class="cu-list det menu sm-border padding">
|
<block
|
v-for="(item, index) in list"
|
:key="index"
|
>
|
<view class="cu-bar bg-white solid-bottom margin-top-sm">
|
<view class="action">
|
<view class="index">
|
{{ index + 1 }}
|
</view>
|
<view class="text-blue">
|
{{ `${item.maktx}` }}
|
</view>
|
</view>
|
<!-- <view class="action" >
|
<text @click="remove(index)" class="cuIcon-close text-red" style="font-size: 24px;"></text>
|
</view> -->
|
</view>
|
|
<view class="cu-item">
|
<view class="content">
|
<text class="text-black">ASN:</text>
|
</view>
|
<view class="action">
|
<text class="text-grey">{{ item.asnCode }}</text>
|
</view>
|
</view>
|
|
<view class="cu-item">
|
<view class="content">
|
<text class="text-black">批次:</text>
|
</view>
|
<view class="action">
|
<text class="text-grey">{{ item.batch }}</text>
|
</view>
|
</view>
|
|
<view class="cu-item">
|
<view class="content">
|
<text class="text-black">收货数量:</text>
|
</view>
|
<view class="action">
|
<text class="text-grey">{{ item.anfme }}</text>
|
</view>
|
</view>
|
</block>
|
</view>
|
|
<view class="cu-bar btn-group foot">
|
<button
|
v-if="hasButtonPermission('reset')"
|
class="cu-btn text-blue line-blue shadow"
|
@click="clear"
|
>
|
清空
|
</button>
|
<button
|
v-if="hasButtonPermission('submit')"
|
class="cu-btn bg-blue shadow-blur"
|
@click="confirm"
|
>
|
换绑
|
</button>
|
</view>
|
|
<uni-popup
|
ref="popup"
|
class="cu-popup"
|
>
|
<view class="popup-content">
|
<view class="head">
|
<text>推荐</text>
|
<text
|
class="cuIcon-close text-red close"
|
@click="close"
|
></text>
|
</view>
|
|
<div class="body">
|
<view class="cu-list grid col-3 no-border">
|
<view
|
class="item"
|
v-for="el in range"
|
>
|
<view
|
class="cu-btn round sm"
|
:class="[
|
el === curCode ? 'bg-blue' : 'line-blue'
|
]"
|
@click="itemChange(el)"
|
>
|
{{ el }}
|
</view>
|
</view>
|
</view>
|
</div>
|
|
<view class="cu-bar btn-group">
|
<button
|
class="cu-btn bg-blue shadow-blur"
|
@click="popupSubmit"
|
>
|
提交
|
</button>
|
</view>
|
</view>
|
</uni-popup>
|
</view>
|
</template>
|
|
<script>
|
import { request } from '@/common/request.js'
|
import { mapState, mapMutations, mapActions, mapGetters } from 'vuex'
|
export default {
|
data() {
|
return {
|
barcode: '',
|
areaName: '',
|
locCode: '',
|
container: '',
|
newContainer: '',
|
list: [],
|
range: [],
|
curCode: '',
|
agvStationInput: '', // AGV站点输入值
|
agvStationName: '',
|
buttonPermissions: [] // 按钮权限列表
|
}
|
},
|
computed: {
|
...mapState('user', ['dynamicFields'])
|
},
|
mounted() {
|
// 获取按钮权限
|
this.buttonPermissions = uni.getStorageSync('buttonPermissions') || []
|
console.log('当前页面按钮权限:', this.buttonPermissions)
|
},
|
methods: {
|
async checkAgvStation() {
|
const that = this
|
if (this.container === '' || this.container === null) {
|
uni.showToast({
|
title: '容器码为空',
|
icon: 'none',
|
position: 'top'
|
})
|
return
|
}
|
const { code, data, msg } = await request('/check/agvStation', {
|
transferStationNo: this.agvStationInput
|
})
|
if (code === 200) {
|
this.agvStationName = data.stationName
|
} else {
|
uni.showToast({
|
title: msg,
|
icon: 'none',
|
position: 'top'
|
})
|
setTimeout(function () {
|
that.agvStationName = ''
|
that.agvStationInput = ''
|
}, 200)
|
}
|
},
|
async search() {
|
const { code, data, msg } = await request('/stock/operate/list', {
|
barcode: this.container,
|
sta: this.barcode
|
})
|
if (code === 200) {
|
// const find = this.list.find(el => el.id === data.id);
|
// !find &&
|
this.list = data
|
} else {
|
uni.showToast({
|
title: msg,
|
icon: 'none'
|
})
|
}
|
},
|
|
// 检查按钮权限
|
hasButtonPermission(route) {
|
return this.buttonPermissions.includes(route)
|
},
|
|
remove(index) {
|
this.list.splice(index, 1)
|
},
|
clear() {
|
this.list = []
|
|
this.container = ''
|
this.newContainer = ''
|
},
|
|
open() {
|
this.$refs.popup.open()
|
},
|
|
close() {
|
this.$refs.popup.close()
|
},
|
|
popupSubmit() {
|
this.$refs.popup.close()
|
},
|
itemChange(el) {
|
this.curCode = el
|
},
|
|
async confirm() {
|
if (this.container === '' || this.container === null) {
|
uni.showToast({
|
title: '容器码不能为空',
|
icon: 'none'
|
})
|
return
|
}
|
if (this.newContainer === '' || this.newContainer === null) {
|
uni.showToast({
|
title: '新容器码不能为空',
|
icon: 'none'
|
})
|
return
|
}
|
const { code, data, msg } = await request(
|
'/orderOut/containerRebinding',
|
{
|
containerNo: this.container,
|
newContainerNo: this.newContainer
|
}
|
)
|
if (code === 200) {
|
uni.showToast({
|
title: '换绑完成'
|
})
|
this.clear()
|
} else {
|
uni.showToast({
|
title: msg,
|
icon: 'none'
|
})
|
}
|
}
|
}
|
}
|
</script>
|
|
<style>
|
.index {
|
border: 1px solid #e54d42;
|
color: #e54d42;
|
border-radius: 50%;
|
display: block;
|
width: 50rpx;
|
height: 50rpx;
|
line-height: 48rpx;
|
text-align: center;
|
margin-right: 20rpx;
|
font-size: 30rpx;
|
}
|
|
.text-blue {
|
color: #0081ff !important;
|
}
|
|
.item {
|
position: relative;
|
display: flex;
|
min-height: 80upx;
|
align-items: center;
|
}
|
|
.uni-file-picker {
|
width: 100%;
|
margin-bottom: 10px;
|
}
|
|
.uni-select__selector {
|
z-index: 999;
|
}
|
|
.tj {
|
height: auto;
|
padding: 6px 8px;
|
display: inline-block;
|
border-radius: 6px;
|
}
|
|
.item {
|
display: flex;
|
justify-content: center;
|
}
|
|
.item .cu-btn {
|
font-size: 26upx;
|
}
|
</style>
|