<template>
	<view class="uni-flex uni-column" style="background-color: white;width: 230px; height:60%;">
		<view class="uni-flex uni-column">
			<view class="uni-flex uni-row">
				<text>标包个数:</text>
				<uni-number-box @change="calcQty($event,stdCount)" :value="stdCount"></uni-number-box>
				<!-- <text> ({{packInfo.packName}})</text> -->
				<text> 个 </text>
			</view>
			<view class="uni-flex uni-row">
				<text>标包量:</text>
				<text>{{packInfo.stdPackQty}} ({{packInfo.stdPackUom}})</text>
			</view>
			<view class="uni-flex uni-row">
				<text>总数量:</text>
				<input class="uni-input" v-model="newQty" :focus="true" />
				({{packInfo.stdPackUom}})

			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				newQty: this.packInfo.handledQty,
				stdCount: Math.ceil(this.packInfo.handledQty/this.packInfo.stdPackQty) 
			}
		},
		props: {
			packInfo: {
				type: Object,
				default: {}
			},
			isEdit: {
				type: Boolean,
				default: false
			}
		},
		methods: {
			calcQty(val) {
				this.newQty = val * this.packInfo.stdPackQty;
				this.$emit("calcQty", this.newQty);
			}
		}
	}
</script>

<style>
</style>
