<template>
	<view class="picking-wrap">
		<view class="ground-title-picking">
			<picker mode="date" @change="handleDate">
				<view class="date c-flex-align" :style="{ height:'100rpx'}">
					<view>{{ selDate }}</view>
					<image src="https://i.loli.net/2020/07/15/xjVSvzWcH9NO7al.png" mode="" class="icon-triangle">
					</image>
				</view>
			</picker>
		</view>
		<uni-easyinput prefixIcon="search" v-model="value" placeholder="请输入消耗单号" @iconClick="iconClick" :focus="true">
		</uni-easyinput>
		<z-paging ref="paging" @query="queryList" v-model="dataList" :use-page-scroll="true">
			<view class="inner-item" v-for="(item,index) in listData" :key="index" @click="itemDetails(item)">
				<view class="inventory-item">
					<view class="shuo-item shuo-one-cont">
						<view class="shuo-label">
							消耗单号:
						</view>
						<view class="shuo-cont">
							{{item.chucode}}
						</view>
					</view>
				</view>
				<view class="inventory-item">
					<view class="shuo-item">
						<view class="shuo-label">
							消耗科室:
						</view>
						<view class="shuo-cont">
							{{item.mubiaoke}}
						</view>
					</view>
				</view>
				<view class="inventory-item">
					<view class="shuo-item">
						<view class="shuo-label">
							消耗品种:
						</view>
						<view class="shuo-await">
							{{item.yansliang}}
						</view>
					</view>
					<view class="shuo-item">
						<view class="shuo-label">
							消耗数量:
						</view>
						<view class="shuo-ready">
							{{item.yishangj}}
						</view>
					</view>
				</view>
				<view class="inventory-item">
					<view class="shuo-item shuo-min">
						<view class="shuo-label">
							制单人:
						</view>
						<view class="shuo-cont">
							{{item.hispName}}
						</view>
					</view>
					<view class="shuo-item max-item">
						<view class="shuo-label">
							制单时间:
						</view>
						<view class="shuo-cont">
							{{item.shangjhuwe}}
						</view>
					</view>
				</view>
				<view class="all-text">已出库</view>
			</view>
		</z-paging>
		<uni-fab ref="fab" @trigger="trigger" @fabClick="fabClick" />
	</view>
</template>


<script>
	import {
		listData
	} from './list.js';
	import ZPMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin.js'
	export default {
		mixins: [ZPMixin],
		data() {
			return {
				value: "",
				dataList: [],
				listData: listData,
				selDate: "选择日期"
			}
		},
		methods: {
			queryList(pageNo, pageSize) {
				this.$refs.paging.complete(this.listData);
			},
			// 获取日期
			handleDate(e) {
				let d = e.detail.value;
				this.selDate = d;
			},
			//跳转上架详情	 
			itemDetails(item) {
				// uni.navigateTo({
				// 	url: '/pages/pickingetials/pickingetials',
				// 	success: function(res) {}
				// });
			},
			//跳转待消耗详情
			fabClick() {
				uni.navigateTo({
					url: '/pages/consumepick/consumepick',
					success: function(res) {}
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.picking-wrap {
		width: 100%;
		height: 100%;
		padding: 20rpx;
		box-sizing: border-box;
		background-color: #F1F1F1;

		.ground-title-picking {
			width: 100%;
			height: 100rpx;
			display: flex;
			align-items: center;
			justify-content: flex-end;
			padding: 20rpx;
			box-sizing: border-box;
			margin-bottom: 10rpx;
			background-color: #fff;

			.c-flex-align {
				display: flex;
				align-items: center;
				color: rgba(16, 16, 16, 1);
			}

			.icon-triangle {
				width: 16rpx;
				height: 16rpx;
				margin-left: 10rpx;
			}
		}

		.inner-item {
			width: 100%;
			height: 260rpx;
			border-bottom: 2rpx solid #BDBDBD;
			padding: 20rpx 20rpx 20rpx 50rpx;
			box-sizing: border-box;
			position: relative;
			background-color: #fff;
			border-radius: 20rpx;
			position: relative;
			margin-top: 10rpx;

			.all-text {
				width: 150rpx;
				height: 40rpx;
				position: absolute;
				right: 20rpx;
				top: 30rpx;
				font-family: PingFangSC-regular;
				font-size: 28rpx;
				color: rgba(52, 124, 175, 0.6);
			}

			.inventory-item {
				width: 100%;
				height: 40rpx;
				color: rgba(16, 16, 16, 1);
				font-size: 28rpx;
				text-align: left;
				font-family: PingFangSC-semiBold;
				margin-top: 10rpx;
				display: flex;
				align-items: center;

				.shuo-label {
					color: rgba(16, 16, 16, 1);
					font-size: 28rpx;
					text-align: left;
					font-family: PingFangSC-regular;
				}

				.shuo-cont {
					color: rgba(16, 16, 16, 1);
					font-size: 28rpx;
					text-align: left;
					font-family: PingFangSC-regular;
					margin-left: 30rpx;
				}

				.shuo-item {
					width: 50%;
					height: 100%;
					line-height: 20rpx;
					display: flex;
					align-items: center;

					.shuo-label {
						color: rgba(16, 16, 16, 1);
						font-size: 28rpx;
						text-align: left;
						font-family: PingFangSC-regular;
					}

					.shuo-cont {
						color: rgba(16, 16, 16, 1);
						font-size: 28rpx;
						text-align: left;
						font-family: PingFangSC-regular;
						margin-left: 30rpx;
					}

					.shuo-await {
						color: rgba(255, 191, 107, 1);
						font-size: 28rpx;
						text-align: left;
						font-family: PingFangSC-regular;
						margin-left: 20rpx;
					}

					.shuo-ready {
						color: rgba(162, 239, 77, 1);
						font-size: 28rpx;
						text-align: left;
						font-family: PingFangSC-regular;
						margin-left: 20rpx;
					}
				}

				.shuo-one-cont {
					width: 60%;
				}

				.shuo-min {
					width: 33%;
				}

				.max-item {
					width: 68%;
					margin-left: 10rpx;

					.shuo-cont {
						font-size: 25rpx;
					}

				}
			}
		}


	}
</style>