<template>
		<page-meta root-font-size="16px"></page-meta>
	<uni-popup ref="popupResult" type="center">
		<view class="uni-popup-view">
			<view class="uni-list">
				<view class="uni-list-cell">
					<view class="uni-list-cell-left">
						<view class="uni-label">箱码</view>
					</view>
					<view class="uni-list-cell-db">
						<input class="uni-input" type="text" :disabled="true"
							v-model="itemDetail.recommendPackingCode" />
					</view>
				</view>
				<view class="uni-list-cell">
					<view class="uni-list-cell-left">
						<view class="uni-label">零件号</view>
					</view>
					<view class="uni-list-cell-db">
						<input class="uni-input" type="text" :disabled="true" v-model="itemDetail.itemCode" />
					</view>
				</view>
				<view class="uni-list-cell">
					<view class="uni-list-cell-left">
						<view class="uni-label">数量</view>
					</view>
					<view class="uni-list-cell-db">
						<input class="uni-input" type="text" :disabled="true" v-model="qty" />
					</view>
				</view>
				<view class="uni-list-cell">
					<view class="uni-list-cell-left">
						<view class="uni-label">单位</view>
					</view>
					<view class="uni-list-cell-db">
						<input class="uni-input" type="text" :disabled="true" v-model="uom" />
					</view>
				</view>
				<view class="uni-list-cell">
					<view class="uni-list-cell-left">
						<view class="uni-label">不合格数量</view>
					</view>
					<view class="uni-list-cell-db">
						<input class="uni-input" type="number" :disabled="false" placeholder="请输入数字"
							v-model="itemDetail.failedQty" />
					</view>
				</view>
				<view class="uni-list-cell">
					<view class="uni-list-cell-left">
						<view class="uni-label">不合格原因</view>
					</view>
					<view class="uni-list-cell-db">
						<picker @change="bindPickerChange" :value="index" :range="array" range-key="name"
							placeholder="请选择原因">
							<view class="uni-input">{{array[index].name}}</view>
						</picker>
					</view>
				</view>
				<view class="uni-list-cell">
					<view class="uni-list-cell-left">
						<view class="uni-label">破坏数量</view>
					</view>
					<view class="uni-list-cell-db">
						<input class="uni-input" type="number" :disabled="false" placeholder="请输入数字"
							v-model="itemDetail.crackQty" />
					</view>
				</view>
			</view>


			<view class="uni-popup-button-box">
				<button class="uni-popup-button" type="primary" @click="submit">确定</button>
			</view>
		</view>
	</uni-popup>
</template>

<script>
	export default {
		data() {
			return {
				itemDetail: {},
				// qty: this.itemDetail.receiveQty.qty,
				// uom: this.itemDetail.receiveQty.uom,
				qty: "",
				uom: "",
				array: [{
					name: '原因1'
				}, {
					name: '原因2'
				}, {
					name: '原因3'
				}, {
					name: '原因4'
				}],
				index: 0,
			}
		},
		props: {
			itemCode: "",

		},
		methods: {
			openPopup(itemdetail) {
				this.itemDetail = itemdetail;
				this.qty = this.itemDetail.receiveQty.qty;
				this.uom = this.itemDetail.receiveQty.uom;
				this.$refs['popupResult'].open("center");
			},
			bindPickerChange: function(e) {
				console.log('picker发送选择改变，携带值为：' + e.detail.value)
				this.index = e.detail.value
			},
			//加载零件信息
			loadItemDetail() {

			},
			submit() {}
		}
	}
</script>

<style scoped lang="scss">

</style>
