<template>
	<uni-popup ref="popupItems">
		<com-popup @onClose="closePopup">
			<view v-for="(item, index) in list" :key="index">
				<com-issue-job-card v-if="type=='issue'" :dataContent="item" @click='selectItem(item)'></com-issue-job-card>
				<com-receipt-job-card v-else :dataContent="item" @click='selectItem(item)'></com-receipt-job-card>
				<u-line></u-line>
			</view>
		</com-popup>
	</uni-popup>
</template>

<script>
	import comPopup from '@/mycomponents/common/comPopup.vue'
	import comReceiptJobCard from '@/pages/unPlanned/coms/comReceiptJobCard.vue'
	import comIssueJobCard from '@/pages/unPlanned/coms/comIssueJobCard.vue'

	export default {
		emits: ["selectedItem"],
		components: {
			comPopup,
			comReceiptJobCard,
			comIssueJobCard
		},
		props: {

		},
		data() {
			return {
				list: [],
				type: ''
			}
		},
		methods: {
			openPopup(items, type) {
				this.list = items;
				this.$refs['popupItems'].open("center");
			},
			closePopup() {
				this.$refs.popupItems.close()
			},
			selectItem(item) {
				this.$emit("selectedItem", item);
				this.$refs['popupItems'].close();
			},
		}
	}
</script>

<style>
</style>
