<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>
|
<!-- <view class="text-bold width fontSize32rpx" style="padding: 10rpx 10rpx;background-color: #d6d6d6;"
|
v-if="renameFocus">
|
<view class="flex justify-between align-center">
|
<text class="width23 padding10">入库单号</text>
|
<text>{{putCode}}</text>
|
</view>
|
</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="focu=true"
|
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-row class="border_bottom margin_top10rpx padding10" style="background-color: #fff;">
|
<u-col span="12">
|
<u-form-item label="栅格数:" prop="GridNumber" required
|
style="font-size: 16px;font-weight: bold;padding: 0 0 10rpx;">
|
<input v-model="warehouse.GridNumber" type="number" placeholder="请录入栅格数" required
|
style="font-weight: bolder;margin-left: 15rpx;"
|
class="width padding_left30rpx">
|
</input>
|
</u-form-item>
|
</u-col>
|
</u-row>
|
|
<u-row class="border_bottom margin_top10rpx padding10" style="background-color: #fff;">
|
<u-col span="10">
|
<u-form-item label="入库口:" prop="StorehouseCode" required
|
style="font-size: 16px;font-weight: bold;padding: 0 0 10rpx;">
|
<input v-model="warehouse.StorehouseCode" placeholder="请录入或扫码" required
|
style="font-weight: bolder;margin-left: 15rpx;"
|
class="width padding_left30rpx">
|
</input>
|
</u-form-item>
|
</u-col>
|
<u-col span="2">
|
<u-icon class="iconfont icon-saoma fontSize60rpx" @click="wareScane"></u-icon>
|
</u-col>
|
</u-row>
|
</u-form>
|
<modal-code ref="resmodal" :rescode='rescode' :resmessage='resmessage' />
|
<button-modal :subShow='true' garmenTitle='确认入库' @submit='submit' />
|
</view>
|
</template>
|
|
<script>
|
import {getDate} from '../../../utils/dateTime.js'
|
import ModalCode from '../../../components/ModalCode.vue'
|
import ButtonModal from '../../../components/buttonModal.vue'
|
import {trayPutStorage} from '@/api/container/index.js'
|
export default {
|
data() {
|
return {
|
rescode: 0,
|
resmessage: "",
|
focu: false,
|
warehouse: { //入库请求参数
|
ContainerCode: '',
|
StorehouseCode: '',
|
GridNumber: '1'
|
},
|
warehouseRules: {
|
ContainerCode: [{required: true,message: '容器编号不能为空',trigger: 'blur'}],
|
StorehouseCode: [{required: true,message: '入库口不能为空',trigger: 'blur'}],
|
GridNumber: [{required: true,message: '栅格数不能为空',trigger: 'blur'}],
|
},
|
operator: '', //
|
|
};
|
},
|
components: {
|
ModalCode,
|
ButtonModal
|
},
|
onReady() {
|
this.$refs.warehouseRef.setRules(this.warehouseRules)
|
},
|
mounted() {
|
this.operator = JSON.parse(uni.getStorageSync('userInfo')).name
|
},
|
methods: {
|
//出入库口扫描
|
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
|
},
|
fail:(err) => {
|
this.rescode = 400
|
this.resmessage = `扫描失败${JSON.stringify(err)}`
|
this.$refs.resmodal.show = true
|
}
|
})
|
},
|
submit() {
|
this.$refs.warehouseRef.validate(valid => {
|
if (valid) {
|
trayPutStorage(this.warehouse).then((res) => {
|
this.$refs.resmodal.show = true
|
this.rescode = res.code
|
this.resmessage = res.message
|
this.$refs.warehouseRef.resetFields()
|
})
|
}
|
})
|
}
|
}
|
|
}
|
</script>
|
|
<style lang="scss">
|
|
</style>
|