<template>
	<view class="lists">
		<view class="status_bar" :style="navHeight"></view>
		<view class="header-bg">
		</view>
		<view class="main">
			<view class="list-wrapper" :style="scrollHeight">
				<list class="list-block" scrollable loadmoreoffset='1' show-scrollbar='false'>
					<cell class="view scroll-area">
						<view class="order-main view">
							<view class="top">
								<text class="title-no">{{boxNum}}</text>
							</view>
							<!-- <view class="tips title-no ">箱码</view> -->
							<view class="box-num">
								<view  v-for="item in dataList">
									<view class="box-code">{{item.boxBarcode}}</view>
								</view>
							</view>
						</view>
					</cell>
				</list>
			</view>
		</view>
	</view>
</template>
<script>
	import {
		mapState
	} from 'vuex'

	import { findGoodsSingleJoinBoxBarcode } from '@/servers/purchaseList.js'
	export default {
		data() {
			return {
				dataList: [],
				boxNum: '',
			}
		},
		computed: {
			scrollHeight() {
				return {
					'height': `${this.sysinfo.safeArea.height - 66 }px`,
				}
			},
			navHeight() {
				return {
					'height': `${this.sysinfo.safeArea.top + 44}px`
				}
			},
			...mapState(['sysinfo','userInfo'])
		},
		onLoad() {
			this.winHeight = `height:${this.sysinfo.safeArea.height}px`;
			this.navHeight = `height:${this.sysinfo.safeArea.top + 44}px`;
		},
		onBackPress() {
			
		},
		created() {
			this.getBoxNum()
		},
		onLoad(option) {
			this.boxNum = option.num
		},
		methods: {
			async getBoxNum(){
				const formdata = {
					"user_bp": this.userInfo.code,
					"role": 'WLY001',
					"wantCode": [{
						"sign": "I",
						"option": "CP",
						// "low": "*"+ this.boxNum +"*",
						"low": "*FHZG20020840*",
						"high": ""
					}],
					"page": 1,
					"pagesize": 100,
					"totalCount": 100,
					"is_result": 1,
					"sort": [{
						"field_name": "createdDate",
						"field_sort": "X"
					}],
					"billStatus": [{
						"sign": "I",
						"option": "EQ",
						"low": "E003",
						"high": ""
					}],
					"boxBarcodeNotNull": true
				}
				const res = await findGoodsSingleJoinBoxBarcode(formdata)
				this.dataList = res.data.Rows
			}
		}
	}
</script>

<style lang="scss" scoped>
	.view {
		flex-direction: column;
	}
	
	.header-bg {
		height: 284rpx;
		margin-top: -88rpx;
	}
	
	.header-bg-img {
		width: 750rpx;
	}
	
	.lists {
		flex-direction: column;
	}
	
	.main {
		position: relative;
		flex-direction: column;
		margin-top: -164rpx;
		padding: 0 32rpx;
	}
	
	.list-wrapper {
		display: flex;
		flex-direction: column;
	}
	.title-no {
		font-size: 32rpx;
		font-weight: 600;
		color: #000;
		margin-bottom: 20rpx;
	}
	.tips{
		margin-top: 40rpx;
		margin-bottom: 20rpx;
	}
	.box-num{
		background: #f8f8f8;
		min-height: 400rpx;
		width: 100%;
		border-radius: 10px;
		display: flex;
		flex-direction: column;
		padding: 24rpx;
	}
	.box-code{
		font-size: 28rpx;
		color: #000;
		line-height: 44rpx;
		font-weight: 600;
	}
</style>
