<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="equipmentCode">
						<uni-easyinput disabled v-model="formData.equipmentCode" />
					</uni-forms-item>
					<uni-forms-item label="操作人ID" :labelWidth='90' name="operatorId">
						<uni-easyinput disabled v-model="formData.operatorId" />
					</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.tpmEquipmentMaintainTaskItemDetailList">
							<uni-badge :text="index+1" type="primary"></uni-badge>
							<uni-forms-item label="项目编码"
								:name="'tpmEquipmentMaintainTaskItemDetailList.'+ index +'.detailCode'">
								<uni-easyinput disabled type="text" disabled v-model="item.detailCode"></uni-easyinput>
							</uni-forms-item>
							<uni-forms-item label="项目名称"
								:name="'tpmEquipmentMaintainTaskItemDetailList.'+ index +'.detailName'">
								<uni-easyinput disabled type="text" disabled v-model="item.detailName"></uni-easyinput>
							</uni-forms-item>
							<uni-forms-item label="物料名称" :labelWidth='90'
								name="'tpmEquipmentMaintainTaskItemDetailList.'+ index +'.materialName'">
								<uni-easyinput disabled type="text" v-model="item.materialName" />
							</uni-forms-item>
							<uni-forms-item label="物料编码" :labelWidth='90'
								name="'tpmEquipmentMaintainTaskItemDetailList.'+ index +'.materialCode'">
								<uni-easyinput disabled type="text" v-model="item.materialCode" />
							</uni-forms-item>
							<uni-forms-item label="数量" :labelWidth='90'
								name="'tpmEquipmentMaintainTaskItemDetailList.'+ index +'.planNumber'">
								<uni-easyinput disabled type="text" v-model="formData.planNumber" />
							</uni-forms-item>
							<uni-forms-item label="实际数量" :labelWidth='90'
								name="'tpmEquipmentMaintainTaskItemDetailList.'+ index +'actualNumber'">
								<uni-easyinput disabled type="number" v-model="item.actualNumber" />
							</uni-forms-item>
							<uni-forms-item label="单位" :labelWidth='90'
								name="'tpmEquipmentMaintainTaskItemDetailList.'+ index +'unitName'">
								<uni-easyinput disabled type="text" v-model="item.unitName" />
							</uni-forms-item>
							<uni-forms-item label="备注" :labelWidth='90'
								name="'tpmEquipmentMaintainTaskItemDetailList.'+ 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>
	import {
		listTaskItem,
		getTaskItem
	} from "@/api/tpm/index.js";

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

		}
	}
</script>

<style>
</style>