<template>
	<view class="stockDetail-wrap">
		<view class="panel-box flex align_center justify_between">
			<view class="pimgs">
				<u-image :src="productData && productData.productMsg||`../../static/def_img@2x.png`" width="100" height="100" border-radius="10"></u-image>
			</view>
			<view class="info-con flex_1">
				<view class="padding_7">{{productData && productData.productName || '--'}}</view>
				<view>{{productData && productData.productCode || '--'}}</view>
			</view>
		</view>
		<view class="stockDetail-info">
			<view class="info-item flex align_center justify_between">
				<view class="info-name">仓库</view>
				<view>{{paramsData && paramsData.warehouseName || '--'}}</view>
			</view>
			<view class="info-item flex align_center justify_between">
				<view class="info-name">仓位</view>
				<view>{{paramsData && paramsData.warehouseLocationName || '--'}}</view>
			</view>
			<view class="info-item flex align_center justify_between">
				<view class="info-name">入库时间</view>
				<view>{{paramsData && paramsData.putTime || '--'}}</view>
			</view>
			<view class="info-item flex align_center justify_between">
				<view class="info-name">入库类型</view>
				<view>{{paramsData && paramsData.putBizTypeDictValue || '--'}}</view>
			</view>
			<view class="info-item flex align_center justify_between">
				<view class="info-name">可用库存数量</view>
				<view>{{toThousands(paramsData && paramsData.currentQty || 0)}}</view>
			</view>
			<view class="info-item flex align_center justify_between">
				<view class="info-name">冻结库存数量</view>
				<view>{{toThousands(paramsData && paramsData.freezeQty || 0)}}</view>
			</view>
			<view class="info-item flex align_center justify_between" v-if="$hasPermissions('M_showCostPrice_mobile')">
				<view class="info-name">成本单价</view>
				<view>￥{{toThousands(paramsData && paramsData.putCost || 0, 2)}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { toThousands } from '@/libs/tools'
	export default{
		data(){
			return {
				productData: null,
				paramsData: null,
				theme: '',
				toThousands
			}
		},
		onLoad(option) {
			this.theme = getApp().globalData.theme
			this.productData = option.productData ? JSON.parse(option.productData) : null
			this.paramsData = option.data ? JSON.parse(option.data) : null
		},
		methods: {}
	}
</script>

<style lang="scss">
	page{
		background: #f8f8f8;
	}
	.stockDetail-wrap{
		padding: 30upx;
		.panel-box {
			background-color: #ffffff;
			padding: 20upx 20upx;
			border-radius: 20upx;
			box-shadow: 3upx 2upx 6upx #eee;
			margin-bottom: 30upx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			.info-con{
				margin-left: 20upx;
				.padding_7{
					padding: 14upx 0 0;
					font-size: 28upx;
				}
			}
		}
		.stockDetail-info{
			background-color: #ffffff;
			padding: 10upx 20upx 20upx;
			border-radius: 20upx;
			box-shadow: 3upx 2upx 6upx #eee;
			.info-item{
				border-bottom: 1px dashed #e4e7ed;
				padding: 20upx 0;
				.info-name{
					color: #464646;
				}
			}
		}
	}
</style>
