<template>
	<view class="orderDetail-digitalShel flex flex_column">
		<view class="contHead">
			<view class="statusH">
				<view class="flex flex_column align_center">
					<view class="status-row">
						<u-icon :name="pageInfo&&pageInfo.billState=='WAIT_CHECK'?'hourglass-half-fill':'checkmark-circle'" size="42" color="#fff"> 
						</u-icon>
						<text>{{pageInfo&&pageInfo.billState=='WAIT_CHECK'?'待入库':'已入库'}}</text>
					</view>
					<view class="messageText">配送方式：{{pageInfo&&pageInfo.dispatchTypeValue?pageInfo.dispatchTypeValue:'--'}}</view>
				</view>
			</view>
		</view>
		<view class="order-body">
			<view class="info partList">
				<!-- <view class="infoList">
					<view class="title">配件列表</view>
					<view>
						2款，共<text class="redText">11</text>件
					</view>
				</view> -->
				<view v-for="item in partList" :key="item.id" class="flex align-center item-list">
					<view>
						<u-image border-radius="16" width="130" height="130" bg-color="#EBEBEB" :src="item.images"></u-image>
					</view>
					<view>
						<view class="item-name">
						  <text>{{item.productName||'--'}}</text>
						</view>
						<view class="item-nums flex align-center justify_between">
							<text>{{item.productCode||'--'}}</text>
							<!-- <view>
								<u-number-box :min="0" :max="999999"></u-number-box>
							</view> -->
							<view v-if="pageInfo&&pageInfo.billState=='FINISH'">
								<text>入库数量：{{item.putQty||item.putQty==0?item.putQty:'--'}}</text>
							</view>
							<view v-else>
								<text>待入库数量：{{item.confirmQty||item.confirmQty==0?item.confirmQty:'--'}}</text>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import uniIcons from "@/components/uni-icons/uni-icons.vue"
	import moment from 'moment'
	import { findShelfReplenishBill } from '@/api/shelf.js'
	import { clzConfirm } from '@/libs/tools.js'
	import clipboard from "@/js_sdk/dc-clipboard/clipboard.js"
	export default {
	   name: 'orderDetail-digitalShel',
	   components: {
		uniIcons,
	   },
	   data() {
		   return {
			   info: null,
			   statusText: '',
			   statusIcon: '', // 结算状态icon
			   partList: [], // 配件列表
			   pageInfo:null
		   }
	   },
	   onReady() {
	   	 
	   },
	   onLoad(option) {
		   console.log(option,option.sn)
		  let sn = option.sn
		  this.getPageInfo(sn)
	   },
	   computed: {
	   },
	   methods: {
		   // 复制
		   copyVin(){
			clipboard.setText(this.vinNumber);
			uni.showToast({
				icon: 'none',
				title: 'vin码已复制成功'
			})
		   },
		 message(title){
		 	uni.showToast({
		 		icon:'none',
		 		title: title
		 	})
		 }, 
		 // 查询详情
		 getPageInfo(val){
			findShelfReplenishBill({sn:val}).then(res=>{
				if(res.status==200){
					this.pageInfo=res.data||null
					this.partList=res.data.clzReplenishBillDetailApiEntityList||[]
				}
			})
		 }
	   }
	}
</script>

<style lang="less">
	page{
		height: 100%;
	}
	.orderDetail-digitalShel{
		height: 100%;
		.redText{
			color: #FB1E1E;
		}
		.order-body{
			flex-grow: 1;
			overflow: auto;
		}
		.contHead {
			background-color: white;
			margin-top: -20rpx;
			.statusH{
				> view{
					padding: 10upx 12%;
					font-size: 34upx;
				}
				.status-row{
					font-size: 42upx;
					text{
						margin-left: 10rpx;
					}
				}
				.messageText{
					font-size: 30upx;
					text-align: center;
					text{
						color: #ffaa00;
					}
					padding: 10rpx 0;
				}
			}
		}
		.info{
			background-color: #FFFFFF;
			padding: 10rpx 30upx;
			font-size: 32rpx;
			margin-bottom: 20rpx;
			.infoList{
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding: 20rpx 0;
				border-bottom: 2rpx solid #f2f2f2;
				&:last-child{
					border: 0;
				}
				.title{
					font-weight: bold;
				}
				> text{
					&:first-child{
						color: #666E75;
					}
				}
			}
			.item-list{
				border-bottom: 2rpx solid #f2f2f2;
				&:last-child{
					border: none;
				}
				> view{
					padding: 20rpx 0;
					&:first-child{
						margin-right: 20rpx;
						margin-top: 18rpx;
					}
					&:last-child{
						flex-grow: 1;
					}
				}
				.item-name{
					word-wrap: break-word;
					font-size: 32rpx;
					color: #333;
					font-weight: bold;
					margin-top: 10rpx;
				}
				.item-nums{
					margin-top: 10rpx;
					padding: 10rpx 0;
					text{
						font-size: 32rpx;
						color: #222222;
					}
				}
			}
		}
		.footer{
			padding: 20upx 30upx;
			background: #FFFFFF;
			uni-button{
				&:after{
					border: 0;
				}
				width: 100%;
				color: #585858;
				font-size: 32rpx;
			}
		}
	}
	
</style>
