<template>
	<view class="page">
		<navbar title="工序卡1" leftClick @leftClick="$utils.navigateBack" />
		<view class="info">
			
			<view class="Work-List">
				<view class="label">
					中试作业员：
				</view>
				<view class="text">
					<input type="text" v-model="StepOne.operator"/>
				</view>
			</view>
			
			<view class="Work-List">
				<view class="label">
					气缸料号1：
				</view>
				<view class="text">
					<input type="text" v-model="StepOne.cylinder1"/>
				</view>
			</view>
			
			<view class="Work-List">
				<view class="label">
					气缸料号2：
				</view>
				<view class="text">
					<input type="text" v-model="StepOne.cylinder2"/>
				</view>
			</view>
			
			<view class="Work-List">
				<view class="label">
					活塞料号1：
				</view>
				<view class="text">
					<input type="text" v-model="StepOne.piston1"/>
				</view>
			</view>
			
			<view class="Work-List">
				<view class="label">
					活塞料号2：
				</view>
				<view class="text">
					<input type="text" v-model="StepOne.piston2"/>
				</view>
			</view>
			
			<view class="Work-List">
				<view class="label">
					滑片料号1：
				</view>
				<view class="text">
					<input type="text" v-model="StepOne.scribing1"/>
				</view>
			</view>
			
			<view class="Work-List">
				<view class="label">
					滑片料号2：
				</view>
				<view class="text">
					<input type="text" v-model="StepOne.scribing2"/>
				</view>
			</view>
		</view>
		
		<view class="list">
			
			<view class="item-box">
				<view class="title">
					上钢选配
				</view>
				
				<view class="list-box"
				:key="stepIndex"
				v-for="(step, stepIndex) in stepList">
					<view class="title">
						钢化膜
					</view>
					
					<view class="item-input">
						<view class="Work-List"
						:key="index"
						v-for="(item, index) in 20"
						>
							<view class="label">
								规格{{ index + 1 }}：
							</view>
							<view class="text">
								<input type="text" 
								v-model="step['param' + (index + 1)]"/>
							</view>
							<view class="text"
							style="margin-left: 20rpx;">
								{{ step.specs }}
							</view>
						</view>
					</view>
					
				</view>
			</view>
			
		</view>
		
		<view class="uni-color-btn"
		@click="submit">
			保存
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: 0,
				StepOne: {},
				stepList : [],
			}
		},
		onLoad(arg) {
			this.id = arg.id
			this.queryStepOne()
		},
		methods: {
			queryStepOne() {
				this.$api('queryStepOne', {
					templateId: this.id
				}, res => {
					if (res.code == 200) {
						this.StepOne = res.result.workorderGeneralStepone
						this.stepList = res.result.workorderParamSteponeList
					}
				})
			},
			submit(){
				console.log(this.stepList);
			},
		}
	}
</script>

<style scoped lang="scss">
	.page{
		padding-bottom: 200rpx;
		.Work-List{
			display: flex;
			padding: 16rpx 0rpx;
			align-items: center;
			.label{
				width: 200rpx;
				flex-shrink: 0;
			}
			.text{
				input{
					background-color: #eee;
					padding: 10rpx 20rpx;
					border-radius: 20rpx;
				}
			}
		}
		.info{
			padding: 30rpx;
			input{
				width: 430rpx;
			}
		}
		.list{
			padding: 0 30rpx;
			.list-box{
				padding: 20rpx 0;
				padding-left: 40rpx;
				.item-input{
					padding-left: 40rpx;
					.label{
						width: 130rpx;
					}
				}
			}
			input{
				width: 320rpx;
			}
		}
	}
</style>