<template>
|
<view class="overflow">
|
<cu-custom bgColor="bg-white" :isBack="true">
|
<block slot="backText"></block>
|
<block slot="content">容器回库</block>
|
</cu-custom>
|
<view class="flex justify-end align-center padding_right30rpx padding_top12rpx">
|
<text class="fontSize12rpx"> 操作人:{{operator}} </text>
|
</view>
|
<u-form labelPosition="top" :model="warehouse" ref="warehouseRef">
|
<u-row class="border_bottom margin_top10rpx padding10" style="background-color: #fff;">
|
<u-col span="10">
|
<u-form-item label="容器编号:" prop="ContainerCode" required
|
style="font-size: 16px;font-weight: bold;padding: 0 0 10rpx;">
|
<input v-model="warehouse.ContainerCode" placeholder="请录入或扫码" @focus="warehouse.ContainerCode = ''" @blur="getConDetail"
|
style="font-weight: bolder;margin-left: 15rpx;"
|
class="width padding_left30rpx">
|
</input>
|
<u-icon name="close-circle-fill" color="#848484" v-if="warehouse.containerCode && focu"
|
@click="warehouse.containerCode=''"></u-icon>
|
</u-form-item>
|
</u-col>
|
<u-col span="2">
|
<u-icon class="iconfont icon-saoma fontSize60rpx" @click="containerScane"></u-icon>
|
</u-col>
|
</u-row>
|
</u-form>
|
<view style="margin-bottom: 180rpx;margin-top: 10rpx;">
|
<view v-for="(item, eindex) in singlist" :key="eindex" style="width: 100vw;">
|
<u-swipe-action :show="item.show" :index="eindex" @click="longpress" :options="[]" style="width: 100vw;">
|
<view class="item u-border-bottom">
|
<!-- 此层wrap在此为必写的,否则可能会出现标题定位错误 -->
|
<view class="title-wrap fontSize32rpx background_fff">
|
<view class="fontSize32rpx" style="background-color: #fff;">
|
<u-row class="padding15">
|
<u-col span="12" class="flex color_f18202">
|
<view class="idindex">
|
{{eindex+1}}
|
</view>
|
<text class="padding_left10rpx">{{item.wareMaterialCode}}</text>
|
</u-col>
|
</u-row>
|
<u-row class="padding15">
|
<u-col span="6" class="" style="text-align: right;">
|
批次:{{item.barNo}}
|
</u-col>
|
<u-col span="6" class="color_f18202" style="text-align: right;">
|
数量:{{item.quantity - item.occQuantity}}
|
</u-col>
|
</u-row>
|
</view>
|
</view>
|
</view>
|
</u-swipe-action>
|
</view>
|
</view>
|
<modal-code ref="resmodal" :rescode='rescode' :resmessage='resmessage' />
|
<button-modal :subShow='true' garmenTitle='重置' @submit='submit' />
|
</view>
|
</template>
|
|
<script>
|
import ModalCode from '../../components/ModalCode.vue'
|
import ButtonModal from '../../components/buttonModal.vue'
|
import {containerReturn,getContainerDetail} from '@/api/sort.js'
|
export default {
|
data() {
|
return {
|
rescode: 0,
|
resmessage: "",
|
focu: false,
|
singlist: [], //容器内物料详情
|
warehouse: { //入库请求参数
|
ContainerCode: '',
|
StorehouseCode: '',
|
TaskType: 0
|
},
|
warehouseRules: {
|
ContainerCode: [{required: true,message: '容器编号不能为空',trigger: 'blur'}],
|
StorehouseCode: [{required: true,message: '入库口不能为空',trigger: 'blur'}],
|
},
|
operator: '', //当前登录人
|
|
};
|
},
|
components: {
|
ModalCode,
|
ButtonModal
|
},
|
onLoad: function (option) { //option为object类型,会序列化上个页面传递的参数
|
if(option.containerCode) {
|
this.warehouse.ContainerCode = option.containerCode
|
}
|
if(option.taskType) {
|
this.warehouse.TaskType = parseInt(option.taskType)
|
}
|
},
|
onReady() {
|
this.$refs.warehouseRef.setRules(this.warehouseRules)
|
console.log(this.warehouse)
|
},
|
mounted() {
|
this.operator = JSON.parse(uni.getStorageSync('userInfo')).name
|
},
|
methods: {
|
//获取容器下物料详情
|
getConDetail(){
|
if(this.warehouse.ContainerCode.trim().length > 0) {
|
getContainerDetail({ContainerCode: this.warehouse.ContainerCode}).then(res => {
|
console.log(res)
|
if(Array.isArray(res.data) && res.data.length > 0) {
|
this.singlist = res.data;
|
}else {
|
this.rescode = 400
|
this.resmessage = '暂无数据'
|
this.$refs.resmodal.show = true
|
this.singlist=[]
|
}
|
})
|
}
|
},
|
//出入库口扫描
|
wareScane() {
|
uni.scanCode({
|
scanType: ['barCode','qrCode'],
|
autoDecodeCharset: true,
|
success:(res) => {
|
this.warehouseRules.StorehouseCode = res.result.trim()
|
},
|
fail:(err) => {
|
this.rescode = 400
|
this.resmessage = `扫描失败${JSON.stringify(err)}`
|
this.$refs.resmodal.show = true
|
}
|
})
|
},
|
//容器扫描
|
containerScane() {
|
uni.scanCode({
|
scanType: ['barCode','qrCode'],
|
autoDecodeCharset: true,
|
success:(res) => {
|
this.warehouse.ContainerCode = res.result
|
this.getConDetail()
|
},
|
fail:(err) => {
|
this.rescode = 400
|
this.resmessage = `扫描失败${JSON.stringify(err)}`
|
this.$refs.resmodal.show = true
|
}
|
})
|
},
|
//容器回库
|
submit() {
|
this.singlist = [];
|
this.warehouse.ContainerCode = ''
|
}
|
}
|
|
}
|
</script>
|
|
<style lang="scss">
|
|
</style>
|