<template>
	<view class="query-wrap">
		<view class="inner-item">
			<view class="text-title">
				<view class="title-circ">
				</view>
				<span>基本信息</span>
			</view>
			<view class="inventory-item">
				<view class="shuo-item-name">
					<view class="shuo-label-podnme">
						出库单号:
					</view>
					<view class="shuo-unit">
						{{acceptDetaData.delvOrdId}}
					</view>
				</view>
			</view>
			<view class="inventory-item">
				<view class="shuo-item-name">
					<view class="shuo-label-podnme">
						关联订单号:
					</view>
					<view class="shuo-unit">
						{{acceptDetaData.purcOrdId}}
					</view>
				</view>
			</view>
			<view class="inventory-item">
				<view class="shuo-item">
					<view class="shuo-label">
						采购品种数
					</view>
					<view class="shuo-cont">
						{{acceptDetaData.detlCnt||""}}
					</view>
				</view>
				<view class="shuo-item">
					<view class="shuo-label">
						采购总数量
					</view>
					<view class="shuo-cont">
						{{acceptDetaData.qtySum||""}}
					</view>
				</view>
			</view>
			<view class="inventory-item">
				<view class="shuo-item">
					<view class="shuo-label">
						本次出库数:
					</view>
					<view class="shuo-cont">
						{{acceptDetaData.bcckl||""}}
					</view>
				</view>
				<view class="shuo-item">
					<view class="shuo-label">
						本次验收量:
					</view>
					<view class="shuo-cont">
						{{acceptDetaData.shppCnt||""}}
					</view>
				</view>
			</view>
			<view class="inventory-item">
				<view class="shuo-item">
					<view class="shuo-label">
						待出库量:
					</view>
					<view class="shuo-cont">
						{{acceptDetaData.toDelvCnt||""}}
					</view>
				</view>
				<view class="shuo-item">
					<view class="shuo-label">
						出库人:
					</view>
					<view class="shuo-cont">
						{{acceptDetaData.docmker||""}}
					</view>
				</view>
			</view>
			<view class="inventory-item">
				<view class="shuo-item-name">
					<view class="shuo-label">
						来源机构:
					</view>
					<view class="shuo-cont">
						{{acceptDetaData.branchName}}
					</view>
				</view>
			</view>
			<view class="inventory-item">
				<view class="shuo-item">
					<view class="shuo-label">
						出库时间:
					</view>
					<view class="shuo-cont">
						{{forMatTime(acceptDetaData.docmkDate)}}
					</view>
				</view>
			</view>
		</view>
		<view class="empty-cont" v-if="orderDelData.length=='0'">
			暂无明细数据
		</view>
		<view class="inner-item" v-for="(item,idex) in orderDelData" :key="idex">
			<view class="text-title" v-if="idex=='0'">
				<view class="title-circ">

				</view>
				<span>耗材清单</span>
			</view>
			<view class="inventory-item">
				<view class="shuo-item-name">
					<view class="shuo-label-podnme">
						耗材编码
					</view>
					<view class="shuo-unit">
						{{item.prodCode}}
					</view>
				</view>
			</view>
			<view class="inventory-item">
				<view class="shuo-item-name">
					<view class="shuo-label-podnme">
						医保编码
					</view>
					<view class="shuo-unit">
						{{item.hiCode}}
					</view>
				</view>
			</view>
			<view class="inventory-item">
				<view class="shuo-item-name">
					<view class="shuo-label-podnme">
						{{item.prodName}}
					</view>
					<view class="shuo-unit">
						<span>{{ item.purcUnt }} ({{ item.convrat }}{{ item.prcUnt }}/{{
					                  item.purcUnt
					                }})</span>
					</view>
				</view>
			</view>
			<view class="inventory-item">
				<view class="shuo-item">
					<view class="shuo-label">
						规格:
					</view>
					<view class="shuo-cont">
						{{item.spec}}
					</view>
				</view>
				<view class="shuo-item">
					<view class="shuo-label">
						型号:
					</view>
					<view class="shuo-cont">
						{{item.mol}}
					</view>
				</view>
			</view>
			<view class="inventory-item">
				<view class="shuo-item">
					<view class="shuo-label">
						材质:
					</view>
					<view class="shuo-cont">
						{{item.matl}}
					</view>
				</view>
				<view class="shuo-item">
					<view class="shuo-label">
						采购数量:
					</view>
					<view class="shuo-cont">
						{{item.purcCnt}}
					</view>
				</view>
			</view>
			<view class="inventory-item">
				<view class="shuo-item">
					<view class="shuo-label">
						已出库数量:
					</view>
					<view class="shuo-cont">
						{{item.delvCnt}}
					</view>
				</view>
				<view class="shuo-item">
					<view class="shuo-label">
						剩余出库量:
					</view>
					<view class="shuo-cont">
						{{item.toDelvCnt||""}}
					</view>
				</view>
			</view>
			<view class="inventory-item">
				<view class="shuo-item">
					<view class="shuo-label">
						本次验收量:
					</view>
					<view class="shuo-cont">
						{{item.shppCnt}}
					</view>
				</view>
				<view class="shuo-item">
					<view class="shuo-label">
						本次拒收量:
					</view>
					<view class="shuo-cont">
						{{item.returnCnt||""}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	import {
		mapState,
		mapMutations,
		mapActions
	} from 'vuex';
	import moment from "moment";
	export default {
		data() {
			return {
				listData: [],
				acceptDetaData: {},
				subMitData: {},
				selcectData: {} //详情选中的数据
			}
		},
		computed: {
			...mapState(['orderDelData', 'instData', 'batchData'])
		},
		onShow() {
			let that = this;
			uni.getStorage({
				key: 'orderDetailsData',
				success: function(res) {
					that.touData({
						delvOrdId: res.data.delvOrdId,
						purcOrdId: res.data.purcOrdId,
						spdId: that.instData.spdId,
					});
					that.acceptDetaData = res.data;
				}
			});
		},
		mounted() {},
		methods: {
			...mapActions(['getOrderReadyDetail']),
			async touData(data) {
				this.getOrderReadyDetail(data)
			},
			forMatTime(row) {
				return moment(row).format("YYYY-MM-DD HH:mm");
			},
			//属性值进行比较
			//日期格式化
			forMatTime(time) {
				return moment(time).format("YYYY-MM-DD");
			},
			//加时分秒
			forMatTimehs(time) {
				return moment(time).format("YYYY-MM-DD HH:mm");
			},
		},
		watch: {

		}

	}
</script>

<style lang="scss" scoped>
	.query-wrap {
		width: 100%;
		height: 100%;
		padding: 20rpx;
		box-sizing: border-box;
		background-color: #F1F1F1;
		overflow-y: scroll;
		overflow-x: hidden;
		position: relative;
		padding-bottom: 200rpx;

		.botm-btn {
			width: 100%;
			height: 120rpx;
			background-color: #fff;
			position: fixed;
			left: 0;
			bottom: 0;
			padding-top: 40rpx;
			display: flex;
			align-items: center;
			justify-content: space-around;
		}

		.time-view {
			height: 350rpx;
			background-color: #fff;
			padding: 50rpx 50rpx 0 50rpx;
			box-sizing: border-box;

			.btn-view {
				width: 100%;
				height: 100rpx;
				margin-top: 100rpx;
				display: flex;
				justify-content: space-around;
			}
		}

	}

	uni-page-body {
		width: 100%;
		height: 100%;
	}
</style>