<template>
	<view>
		<uni-collapse>
			<uni-forms ref="form" :modelValue="formData">
				<uni-collapse-item title="维修任务明细单" :open="true">
					<uni-forms-item label="任务名" :labelWidth='90' name="taskName">
						<uni-easyinput disabled v-model="formData.taskName" />
					</uni-forms-item>
					<uni-forms-item label="故障号" :labelWidth='90' name="taskItemCode">
						<uni-easyinput disabled v-model="formData.taskItemCode" />
					</uni-forms-item>
					<uni-forms-item label="故障名" :labelWidth='90' name="taskItemName">
						<uni-easyinput disabled v-model="formData.taskItemName" />
					</uni-forms-item>
					<uni-forms-item label="故障类型" :labelWidth='90' name="type">
						<uni-easyinput disabled v-model="formData.type" />
					</uni-forms-item>
					<uni-forms-item label="设备编码" :labelWidth='90' name="equipmentCode">
						<uni-easyinput disabled v-model="formData.equipmentCode" />
					</uni-forms-item>
				</uni-collapse-item>
				<uni-collapse-item title="维修任务明细项信息" :open="true">
					<uni-swipe-action>
						<uni-swipe-action-item :rightOptions="rightOptions" :key="index"
							v-for="(item, index) in formData.tpmEquipmentRepairBreakdownMaterialList">
							<uni-badge :text="index+1" type="primary"></uni-badge>
							<uni-forms-item label="物料编码"
								:name="'tpmEquipmentRepairBreakdownMaterialList.'+ index +'.detailCode'">
								<uni-easyinput disabled type="text" disabled
									v-model="item.materialCode"></uni-easyinput>
							</uni-forms-item>
							<uni-forms-item label="物料名称"
								:name="'tpmEquipmentRepairBreakdownMaterialList.'+ index +'.detailName'">
								<uni-easyinput disabled type="text" disabled
									v-model="item.materialName"></uni-easyinput>
							</uni-forms-item>
							<uni-forms-item label="计划数量" :labelWidth='90'
								name="'tpmEquipmentRepairBreakdownMaterialList.'+ index +'.materialName'">
								<uni-easyinput disabled type="text" v-model="item.planNumber" />
							</uni-forms-item>
							<uni-forms-item label="实际数量" :labelWidth='90'
								name="'tpmEquipmentRepairBreakdownMaterialList.'+ index +'.materialCode'">
								<uni-easyinput disabled type="text" v-model="item.actualNumber" />
							</uni-forms-item>
							<uni-forms-item label="单位" :labelWidth='90'
								name="'tpmEquipmentRepairBreakdownMaterialList.'+ index +'.planNumber'">
								<uni-easyinput disabled type="text" v-model="formData.unitName" />
							</uni-forms-item>
							<uni-forms-item label="备注" :labelWidth='90'
								name="'tpmEquipmentRepairBreakdownMaterialList.'+ index +'actualNumber'">
								<uni-easyinput disabled type="number" v-model="item.remark" />
							</uni-forms-item>
							<uni-forms-item label="单位" :labelWidth='90'
								name="'tpmEquipmentRepairBreakdownMaterialList.'+ index +'unitName'">
								<uni-easyinput disabled type="text" v-model="item.unitName" />
							</uni-forms-item>
							<uni-forms-item label="备注" :labelWidth='90'
								name="'tpmEquipmentRepairBreakdownMaterialList.'+ index +'remark'">
								<uni-easyinput disabled type="text" v-model="item.remark" />
							</uni-forms-item>
						</uni-swipe-action-item>
					</uni-swipe-action>
				</uni-collapse-item>
			</uni-forms>
		</uni-collapse>
	</view>
</template>

<script>
	export default {
		onLoad(option) {
			this.formData = JSON.parse(option.formData);
		},
		mounted() {},
		data() {
			return {
				formData: {},
				rightOptions: [{
					text: '删除',
					style: {
						backgroundColor: '#ff2a17'
					}
				}, ],
			}
		},
		methods: {

		}
	}
</script>

<style>
</style>