<!--发料任务卡片-->
<template>
	<page-meta root-font-size="18px"></page-meta>
	<uni-popup ref="popupItems" type="center">
		<scroll-view scroll-y="true" style="background-color: #EEEEEE;height: 90vh;">
			<view class="popinpop count_shadow" style="width: 90vw;margin: 20rpx 20rpx 30rpx 20rpx;"
				v-for="(item, index) in balanceItems" :key="item.id" @click="callback(item)">
				<com-balance-item :dataContent="item"></com-balance-item>
			</view>
		</scroll-view>
	</uni-popup>
</template>

<script>
	import {
		getJobStatuStyle,
		getInventoryStatusDesc
	} from '@/common/basic.js';
	import comBalanceItem from '@/mycomponents/comItem/comBalanceItem.vue'
	
	export default {
		name: "combalance",
		emits:['selectedItem'],
		components: {
			comBalanceItem
		},
		data() {
			return {
				balanceItems: [],
			};
		},
		// 此处定义传入的数据
		props: {
			// datacontent: {
			// 	type: Object,
			// 	value: null
			// }
		},
		methods: {
			openPopup(items) {
				this.balanceItems = items;
				this.$refs['popupItems'].open("center");
			},

			callback(item) {
				this.$emit("selectedItem", item);
				this.$refs['popupItems'].close();
			},
			statusStyle: function(val) {
				return getJobStatuStyle(val);
			},
			inventoryStatus: function(val) {
				return getInventoryStatusDesc(val);
			}
		}
	}
</script>

<style scoped lang="scss">
</style>
