<template>
	<view class="lists">
		<StickyNavBar>
			<NavBar title="库存盘点"></NavBar>
			<view class="btn">
				<uni-easyinput prefixIcon="search" class="topSearch" v-model="nlpla" focus placeholder="请扫盘点凭证码" @confirm="handleConfirm"></uni-easyinput>
			</view>
		</StickyNavBar>
			<waitInventoried ref="waitInventoriedRef" />
			<!-- <inventoryForm v-else /> -->
		<BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle" ></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 {
			nlpla: '',
			isDisabled: false,
			isFocus: false,
			btnArr: [
				{
					style: '',
					type: 'warning',
					text: '返回',
					way: 'goBack'
				}
			]
		};
	},
	methods: {
		// 加载更多
		onReachBottom() {
			console.log('加载更多inventoryCounting');
		},
		getBtnHandle(row) {
			console.log('getBtnHandle', row);
			this[row.way]();
		},
		handleConfirm(e) {
			const params = JSON.parse(e)
			this.$refs.waitInventoriedRef.getList(params);
			setTimeout(() => {
				this.nlpla = ''
			}, 1000)
		},
		goBack() {
			console.log('返回了');
			uni.navigateBack();
		},
	}
};
</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>
