<template>
	<view class="picking-wrap">
		<view class="ground-title-picking">
			<csr-tab :value.sync="index" :rangeKey="rangeKey" :tabList="tabList"
				style="{position: 'relative';z-index: 51;}" @change="tabChange"></csr-tab>
			<view class="ground-icon"></view>
			<ren-dropdown-filter :filterData='filterData' :defaultIndex='defaultIndex' @ed='ed'
				:stylesData="{padding:'0 0 0 580rpx'}"></ren-dropdown-filter>
		</view>
		<uni-easyinput prefixIcon="search" v-model="value" placeholder="请输入或扫描入库单号" @iconClick="iconClick" :focus="true"
			@input="input">
		</uni-easyinput>
		<z-paging ref="paging" @query="queryList" v-model="dataList" :use-page-scroll="true">
			<view class="inner-item" v-for="(item,index) in dataList" :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.id_bill}}
						</view>
					</view>
				</view>
				<view class="inventory-item">
					<view class="shuo-item">
						<view class="shuo-label">
							目标科室:
						</view>
						<view class="shuo-cont">
							{{item.id_dept_super}}
						</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">
						<view class="shuo-label">
							耗材类型:
						</view>
						<view class="shuo-cont">
							{{item.guige}}
						</view>
					</view>
					<view class="shuo-item">
						<view class="shuo-label">
							结算方式:
						</view>
						<view class="shuo-cont">
							{{item.xinghao}}
						</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.rq}}
						</view>
					</view>
				</view>
				<view class="inventory-item">
					<view class="shuo-item shuo-one-cont">
						<view class="shuo-label">
							请领单号:
						</view>
						<view class="shuo-cont">
							{{item.shangjiatime}}
						</view>
					</view>
				</view>
				<view class="all-text">已出库</view>
			</view>
		</z-paging>
	</view>
</template>


<script>
	import {
		listData
	} from './list.js';
	import ZPMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin.js';
	import {
		mapState,
		mapMutations,
		mapActions
	} from 'vuex';
	export default {
		mixins: [ZPMixin],
		data() {
			return {
				index: 0,
				rangeKey: "rangeKey",
				tabList: [{
					rangeKey: "全部",
					value: ""
				}, {
					rangeKey: "待出库",
					value: "NotOut"
				}, {
					rangeKey: "已出库",
					value: "YesOut"
				}, ],
				value: "",
				rangeKeyVal: "",
				dataList: [],
				listData: listData,
				filterData: [
					[{
						text: '血透室',
						value: 0
					}, {
						text: '已上架',
						value: 1
					}]
				],
				defaultIndex: [0],
			}
		},
		computed: {
			...mapState(['outboundData'])
		},
		mounted() {

		},
		methods: {
			...mapActions(['getoutbondData']),
			queryList(pageNo, pageSize) {
				this.getoutbondData({
					type: ""
				})
			},
			//跳转上架详情	 
			itemDetails(item) {
				uni.navigateTo({
					url: '/pages/pickingetials/pickingetials',
					success: function(res) {}
				});
				uni.setStorageSync('outBounddetails', [item]);
				
			},
			tabChange(data) {
				this.rangeKeyVal = data['tab']['value'];
				this.getoutbondData({
					type: data['tab']['value'],
					id_bill:this.value
				})
			},
			input(e) {
				this.$nextTick(() => {
					this.value = e;
				})
				this.getoutbondData({
					id_bill: e,
					type: this.rangeKeyVal
				})
			},
		},
		watch: {
			outboundData(newData, flodData) {
				this.$refs.paging.complete(newData);
			}
		}
	}
</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;
			border-bottom: 2rpx solid #ccc;
			display: flex;
			align-items: center;
			padding: 20rpx;
			box-sizing: border-box;
			position: relative;
			margin-bottom: 10rpx;
		}

		.inner-item {
			width: 100%;
			height: 360rpx;
			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>