<template>
	<view>
		<view class="uni-flex uni-row">
			<text @click="openDetail()">{{dataContent.locationCode}}</text>|
			<text v-if="allowEdit" @click="openScanLocation()">编辑|</text>
			<text @click="openDetail()">查看详情</text>
		</view>
		<uni-popup ref="popup">
			<view style="background-color: white;width: 230px; height:60%;">
				<view class="uni-flex uni-row">
					<text>库位代码:</text>
					<text>{{dataContent.locationCode}}</text>
				</view>

				<view class="uni-flex uni-column">
					<view class="uni-flex uni-row">
						<text>库区:{{dataContent.area}}</text>
					</view>
					<view class="uni-flex uni-row">
						<text>库位组:{{dataContent.group}}</text>
					</view>
					<view class="uni-flex uni-row">
						<text>Erp储位:{{dataContent.erpCode}}</text>
					</view>
				</view>
			</view>
		</uni-popup>
		<win-scan-location ref="scanLocation" @getLocation='getLocationInfo'></win-scan-location>
	</view>
</template>

<script setup>
	import {
		ref
	} from "vue";
	import uniPopup from '@/uni_modules/uni-popup/components/uni-popup/uni-popup.vue';
	import winScanLocation from '@/mycomponents/wincom/scanCom/winScanLocation.vue'

	const popup = ref(null)
	const scanLocation = ref();

	const props = defineProps({
		dataContent: {
			type: Object,
			default () {
				return {
					locationCode: '无',
					area: '无',
					group: '无',
					erpCode: '无',
				}
			}
		},
		allowEdit: {
			type: Boolean,
			default () {
				return true
			}
		}
	});

	const openDetail = function() {
		popup.value.open()
	};

	const closeDetail = function() {
		popup.value.close()
	};

	const openScanLocation = function() {
		scanLocation.value.openScanPopup();
	};
	
	const getLocationInfo=function(){
		
	};
</script>

<style>
</style>


// <script>
	// 	export default {
	// 		data() {
	// 			return {
	// 				expand: false,
	// 			}
	// 		},
	// 		props: {
	// 			dataContent: {
	// 				type: Object,
	// 				default: {}
	// 			},
	// 		},
	// 		methods: {
	// 			expandDetail() {
	// 				this.expand = !this.expand;
	// 			},
	// 		}
	// 	}
	// 
</script>

<style>
</style>
