<template>
|
<default-header-page-layout ref="page" title="空托绑定">
|
<view class="page-frame with-action-user-row" :style="{height:pageBodyHeight+'px'}" v-if="pageBodyHeight">
|
<action-user-row />
|
<view class="with-action-user-row-page-content">
|
<!-- 托盘 -->
|
<scan-input-form-item :clearable="true" :hasScan="false" :hasSearch="false" class="forma-item" label="托盘编号" v-model="form.containerNo"/>
|
<!-- 库位 -->
|
<selectItem
|
:selectData="placeList" :value.sync="form.placeNo" label="库位编号" labelField="placeNo"
|
valueField="placeNo" @update:value="getPlaceNo"/>
|
|
<div v-if="materialInfoShow">
|
<scan-input-form-item class="forma-item" label="库存信息" :content="false" />
|
<materialInfo :materialData="materialData" />
|
|
</div>
|
|
</view>
|
|
|
</view>
|
<template v-slot:footer>
|
<view class="bottom-btns-row">
|
<view class="btn-frame">
|
<u-button v-if="btnAbled" type="primary" text="绑 定" @click="onConfirm">
|
</u-button>
|
</view>
|
</view>
|
</template>
|
</default-header-page-layout>
|
</template>
|
|
<script>
|
import DefaultHeaderPageLayout from '@/components/DefaultHeaderPageLayout.vue'
|
import ActionUserRow from '@/components/ActionUserRow.vue'
|
import ScanInputFormItem from '@/components/ScanInputFormItem.vue'
|
import EasySelectFormItem from '@/components/EasySelectFormItem.vue'
|
import EasyPicker from '@/components/EasyPicker.vue'
|
import selectItem from '@/components/selectItem.vue'
|
import materialInfo from './modules/materialInfo.vue'
|
import {emptyContainerBindKTHCPlace} from '@/api/emptyIn.js'
|
import {
|
getMaterialDetail
|
} from '@/api/common.js'
|
import {
|
palceList
|
} from '@/service/mixins/mixins.js'
|
import {
|
parseDic,
|
$alert,
|
$successInfo,
|
getDicList
|
} from '@/static/js/utils/index.js'
|
let initInterVal=null;
|
export default {
|
name: 'emptyInPage',
|
components: {
|
DefaultHeaderPageLayout,
|
ActionUserRow,
|
ScanInputFormItem,
|
EasySelectFormItem,
|
EasyPicker,
|
selectItem,
|
materialInfo
|
},
|
data() {
|
return {
|
pageBodyHeight: 0,
|
form: {
|
containerNo: '',
|
placeNo: ''
|
},
|
materialData: []
|
}
|
},
|
computed: {
|
btnAbled() {
|
return Boolean(this.form.placeNo)&&Boolean(this.form.containerNo);
|
},
|
materialInfoShow(){
|
return Boolean(this.form.placeNo) ;
|
}
|
},
|
mixins: [palceList],
|
methods: {
|
getPlaceNo(val,obj){
|
console.log(val,obj,'111');
|
this.getMaterialDetail(obj.id);
|
},
|
//获取物料信息
|
async getMaterialDetail(id){
|
try{
|
let {result}=await getMaterialDetail({id})
|
this.materialData=result.wmsMaterialStocks;
|
console.log(result,'data');
|
}catch(e){
|
//TODO handle the exception
|
console.log(e);
|
}
|
},
|
// 清除托盘信息
|
onClearContainter() {
|
this.form.containerCode = ''
|
},
|
// 清除单据号
|
onClearNO() {
|
|
},
|
|
// 入库
|
async onConfirm() {
|
uni.showModal({
|
title: '入库确认',
|
content: '确定执行入库操作吗?',
|
showCancel: true,
|
cancelText: '取消',
|
confirmText: '确定',
|
success: async (type) => {
|
let {
|
confirm,
|
cancel
|
} = type
|
if (confirm) {
|
console.log(this.form);
|
try{
|
await emptyContainerBindKTHCPlace(this.form)
|
$alert("空托绑定成功");
|
this.form={}
|
this.materialData=[]
|
}catch(e){
|
//TODO handle the exception
|
console.log(e);
|
}
|
}
|
}
|
})
|
|
// this.onClearContainter()
|
// this.onClearNO()
|
},
|
// 获取枚举信息
|
async getSysEnumData() {
|
try {
|
let {
|
data
|
} = await getSysEnumData({
|
enumName: 'ContainerStatus'
|
})
|
this.ContainerStatus = data
|
} catch (e) {
|
//TODO handle the exception
|
console.log(e);
|
}
|
},
|
checkChange(item) {
|
item.checked = !item.checked
|
},
|
/* 页面初始化获取页面body高度的定时器 */
|
startInitInterval(callback) {
|
initInterVal = setInterval(() => {
|
if (this.pageBodyHeight) {
|
this.clearInitInterval()
|
callback && callback()
|
} else {
|
this.pageBodyHeight = this.$refs.page.getBodyHeight()
|
}
|
}, 200)
|
},
|
/* 清除定时器 */
|
clearInitInterval() {
|
try {
|
clearInterval(initInterVal)
|
initInterVal = null
|
} catch (e) {
|
//TODO handle the exception
|
}
|
}
|
},
|
onReady() {
|
this.startInitInterval(() => {
|
/* 页面初始化后需要执行的代码在这边调用 */
|
// this.getLinesOptions()
|
// this.selectOptions.models = getDicList(this.$store,'assemble_taskmodel')
|
this.getPalceList({
|
areaCode: 'KTHC',
|
aisle:3
|
})
|
console.log(this.placeList);
|
})
|
},
|
onUnload() {
|
this.clearInitInterval()
|
}
|
}
|
</script>
|
|
<style scoped lang="scss">
|
.forma-item {
|
margin-bottom: 24rpx;
|
}
|
|
.only-watch-container {
|
background-color: #D0DDD8;
|
min-height: 90rpx;
|
display: flex;
|
|
&>.label {
|
color: $u-tips-color;
|
font-size: 32rpx;
|
flex-shrink: 0;
|
padding-left: 20rpx;
|
padding-top: 22rpx;
|
}
|
|
&>.content {
|
width: 1px;
|
flex-grow: 1;
|
display: flex;
|
align-items: center;
|
font-size: 30rpx;
|
padding: 8rpx 0;
|
}
|
}
|
|
.bottom-btns-row {
|
display: flex;
|
padding: 10rpx 20rpx;
|
background-color: #fff;
|
|
.btn-frame {
|
width: 1%;
|
box-sizing: border-box;
|
flex-grow: 1;
|
}
|
}
|
</style>
|