<template>
	<view class="choose_main">
		<view class="ljh_box">
			<view class="tit_ljh">{{ dataContent.itemCode }}</view>
			<view class="ljh_left">
				<view class="text_lightblue font_xs">{{dataContent.itemName }}</view>
				<view class="text_lightblue font_xs">{{dataContent.item.desc2 }}</view>
			</view>
		</view>
		<view class="list_form">
			<view class="uni-container">
				<uni-table style="overflow-x: hidden;">
					<uni-tr>
						<uni-th width="100"></uni-th>
						<uni-th width="100" align="center">库存</uni-th>
						<uni-th width="100" align="center">出库</uni-th>
					</uni-tr>
					<uni-tr>
						<uni-th width="100">数量（{{dataContent.qty.uom}}）</uni-th>
						<uni-th width="100" align="center">
							<text class="text_black" style="font-size: 1rem;">{{dataContent.qty.qty}}</text>
						</uni-th>
						<uni-th width="100" align="center">
							<uni-easyinput v-model="dataContent.handelQty.qty" type="digit"
								@input="qtyInput($event,dataContent)"></uni-easyinput>
						</uni-th>
					</uni-tr>
				</uni-table>
			</view>
		</view>
		<view class="uni-flex uni-row bot_card">
			<view class="bot_card_item item_long">
				<label class="icon_bg icon_bg_xm">
					<image class="icon_normal" src="@/static/icons_ui/icon_xm.svg"></image>
				</label>
				<text>{{dataContent.packingCode}}</text>
			</view>
			<!-- 箱码 -->
			<view class="bot_card_item" style="width:46%;">
				<label class="icon_bg icon_bg_kw">
					<image class="icon_normal" src="@/static/icons_ui/icon_kw.svg"></image>
				</label>
				<text>{{ dataContent.locationCode }}</text>
			</view>
			<!-- 库位 -->
			<view class="bot_card_item">
				<label class="icon_bg icon_bg_pc">
					<image class="icon_normal" src="@/static/icons_ui/icon_pc.svg"></image>
				</label>
				<text>{{dataContent.lot}}</text>
			</view>
			<!-- 批次 -->
			<view class="bot_card_item item_short">
				<label class="icon_state" :class="statusStyle(dataContent.status) "></label>
				<text class="state_point" :class="statusStyle(dataContent.status) ">
					{{ statusColor(dataContent.status) }}
				</text>
			</view>
		</view>
		<comMessage ref="comMessage"></comMessage>
	</view>

</template>

<script>
	import {
		getInventoryTypeStyle,
		getInventoryStatusDesc,
	} from '@/common/basic.js';
	import comMessage from '@/mycomponents/common/comMessage.vue'
	export default {
		name: 'comUnissue',
		components: {
			comMessage
		},
		props: {
			dataContent: {
				type: Object,
				default: {}
			},
		},
		data() {
			return {}
		},
		created() {

		},
		methods: {
			qtyInput(value, item) {
				let that = this;
				if (value == '') {
					setTimeout(() => {
						that.dataContent.handledQty;
					}, 10)

				} else {
					let qty = Number(value);
					this.$emit('qtyChanged',qty,item)
					
				}
			},
			showMessage(message) {
				this.$refs.comMessage.showMessage(message);
			},
			statusStyle: function(val) {
				return getInventoryTypeStyle(val);
			},
			statusColor: function(val) {
				return getInventoryStatusDesc(val);
			},
		}
	}
</script>

<style>
</style>
