<template>
	<view class="lists">
		<StickyNavBar>
			<NavBar title="库存盘点"></NavBar>
			<view class="btn">
				<uni-easyinput prefixIcon="search" class="topSearch" v-model="nlpla" focus placeholder="请扫盘点凭证码" @change="handleInputNlpla"></uni-easyinput>
				<!-- <uni-easyinput
					prefixIcon="search"
					:disabled="isDisabled"
					v-model="wxparams"
					:focus="isFocus"
					placeholder="请扫描产品包装条码/外箱码"
					@input="handleInputPlnr"
				></uni-easyinput> -->
			</view>
		</StickyNavBar>
			<waitInventoried ref="waitInventoriedRef" />
			<!-- <inventoryForm v-else /> -->
		<BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle" v-if="current === 0"></BottomBtn>
	</view>
</template>

<script>
import StickyNavBar from '@/components/StickyNavBar/index.vue';
import ContentLoadingMore from '@/components/ContentLoadingMore/index.vue';
import BottomBtn from '@/components/BottomBtn/index.vue';
import waitInventoried from './waitInventoried.vue';
import inventoryForm from './inventoryForm.vue';

export default {
	components: {
		StickyNavBar,
		ContentLoadingMore,
		BottomBtn,
		waitInventoried,
		inventoryForm
	},
	data() {
		return {
			value: '',
			type: 'select',
			show: false,
			border: true,
			nlpla: '',
			isDisabled: false,
			isFocus: false,
			wxparams: '',
			list: [
				{
					name: '待盘点'
				},
				{
					name: '盘点调整单'
				}
			],
			current: 0,
			status: 'loadmore',
			btnArr: [
				{
					style: '',
					type: 'warning',
					text: '返回',
					way: 'goBack'
				}
			]
		};
	},
	methods: {
		// 加载更多
		onReachBottom() {
			console.log('加载更多inventoryCounting');
		},
		getBtnHandle(row) {
			console.log('getBtnHandle', row);
			this[row.way]();
		},
		handleInputNlpla(e) {
			this.$refs.waitInventoriedRef.getList(e);
		},
		goBack() {
			console.log('返回了');
			uni.navigateBack();
		},
		changeTab(index) {
			this.current = index;
		}
	}
};
</script>

<style lang="scss">
.selectSheet {
	border-bottom: 1px solid #ccc;
}
/deep/ .u-sticky {
	top: 0 !important;
	background: #fff;
}
.contentMore {
	margin: 20rpx;
}
page {
	background: #f8f8f8;
}
</style>
