<template>
	<dialog-base ref="baseDialog" title="添加新批次">
		<view class="list-title"><text class="label">批次号：{{form['batchNumber']}}</text></view>
		<view class="list-container">
			<view class="list-container-item uni-row">
				<text class="label">产品描述</text>
				<text class="label value">{{form['caseNumber']}}</text>
			</view>
			<view class="list-container-item uni-row">
				<text class="label">关联箱号</text>
				<text class="label value">{{form['caseNumber']}}</text>
			</view>
			<view class="list-container-item uni-row">
				<text class="label">当前工序</text>
				<text class="label value">{{form['totalWorkingHours']}}</text>
			</view>
			<view class="list-container-item uni-row" style="border-bottom: 1px solid #999999;">
				<text class="label">投产数量</text>
				<text class="label value">{{form['qualifiedQuantity']}}</text>
			</view>
		</view>
<!-- 		<view class="list-title"><text class="label">请选择设备：</text></view>
		<view class="equipment-container uni-row ">
			<view v-for="(item, index) in equiments" :class="{'item':true,'selected': selectedButton === item}" :key="index" @click="selectButton(item)"><text class="label" >{{item}}</text></view>
		</view> -->
		<!-- </scroll-view> -->
		<view class="add-btn-container uni-row">
			<button type="primary" class="btn" >确认</button>
		</view>
	</dialog-base>
</template>

<script setup>
	import {
		ref,
		getCurrentInstance
	} from 'vue'
	const baseDialog = ref(null)
	const selectedButton = ref(null)
	const form = ref({
		batchNumber: "DC23727410070",
		caseNumber: "X12522、X522、X15522、J5211、J5112",
		totalWorkingHours: 135.5,
		qualifiedQuantity: 600,
		invest: 1000,
		previousProcess: "NC车1",
		currentProcess: "热处理",
		NextProcess: "清洗",
		status: 0
	})
	// const equiments = ref(['009-21','009-22','009-23','009-24','009-25','009-26','009-27','009-28','009-29'])
 //    const selectButton = (data) => {
	// 	 selectedButton.value = data;
	// }
	const open = (data) => {
		// console.log(dialog.value)
		baseDialog.value.open()
	}
	defineExpose({
		open
	})
	
	function handleScanCode(){
		uni.scanCode({
			onlyFromCamera: true,
			success: function (res) {
			}
		});
	}
</script>

<style lang="scss">
	.dialog-body {
		.list-title {
			margin: 40rpx 0 20rpx 0;

			.label {
				font-size: 32rpx;
				font-weight: bold;
			}
		}

		.list-container {
			width: 100%;
			display: flex;
			align-items: flex-start;
			padding: 0 4rpx;

			.list-container-item {
				width: 100%;
				border: 1px solid #999999;
				border-bottom: none;
				padding: 12rpx 8rpx;
				

				.label {
					font-size: 28rpx;
					color: gray;
					width: 144rpx;

					&.value {
						flex: 1;
					}
				}
			}

		}
		.add-btn-container {
			margin-top: 32rpx;
			.btn {
				flex: 1;
			}
		}
	}
</style>