<template>
	<view class="">
		<uni-swipe-action ref="swipeAction">
			<uni-swipe-action-item :right-options="options" @click="swipeClick($event)">
				<view class="">
					推荐
				</view>
				<view class="">
					物品信息 {{dataContent.itemCode}}
				</view>
				<view class="">
					描述 {{dataContent.itemDesc1}} {{dataContent.itemDesc2}}
				</view>
				<view class="">
					箱码 {{dataContent.recommendPackingCode}}
				</view>
				<view class="">
					批次 {{dataContent.recommendLot}}
				</view>
				<view class="">
					库位 {{dataContent.recommendLocationCode}}
				</view>
				<view class="">
					数量{{dataContent.recommendQty}}
				</view>
				<view class="">
					推荐单位{{dataContent.recommendUom}}
				</view>

				<view class="">
					<view v-if="dataContent.scaned">
						已扫描
					</view>
					<view v-else>
						未扫描
					</view>
				</view>
			</uni-swipe-action-item>
		</uni-swipe-action>

		<winHint ref="winHint" :title="title" :dataContent="dataContent"></winHint>

	</view>
</template>

<script>
	import winHint from "../../wincom/basicCom/winHint.vue"

	export default {
		components: {
			winHint
		},
		props: {
			dataContent: {
				type: Object,
				default: {}
			}
		},
		watch: {
			dataContent: {
				handler(newName, oldName) {},
				immediate: true,
				deep: true
			}
		},

		data() {
			return {
				options: [{
					text: '查看详情',
					style: {
						backgroundColor: 'rgb(254,156,1)'
					}
				}],
				title: "推荐详情"
			}
		},
		methods: {
			openScanPopup() {
				this.$refs.winHint.openScanPopup()
			},
			swipeClick(e) {
				if (e.content.text == "查看详情") {
					this.openScanPopup();
				}
			}
		}
	}
</script>

<style>
</style>
