<template>
	<view class="todo-page">
		<step-title :stepPage="stepsPage" :stepText="stepsText"></step-title>
		<view class="allview">
			<view class="card">
				<u--form labelWidth="auto" :model="model" ref="wForm" class="demo-ruleForm">
					<view style="position: relative;">
						<view style="position: absolute;left: -10px;color: #3d4b70;top: -3px;">*</view>
					</view>

					<view style="font-size: 15px; font-weight: bold;color: #3d4b70;margin-bottom: 10px;">基本信息填写</view>
					<u-form-item label="发起时间：" prop="Product_Unit">
						<u--input v-model="model.CREATE_TIME" disabled disabledColor="#ffffff" border="none" inputAlign="right" fontSize="14px">
						</u--input>

					</u-form-item>
					<u-form-item label="发起部门：" prop="Product_Unit">
						<u--input v-model="(model.Nav_ApplyDepartment||{}).NAME" disabled disabledColor="#ffffff" border="none" inputAlign="right" fontSize="14px">
						</u--input>

					</u-form-item>
					<u-form-item label="发起人：" prop="Product_Unit">
						<u--input v-model="(model.Nav_ApplyUser||{}).NAME" disabled disabledColor="#ffffff" border="none" inputAlign="right" fontSize="14px">
						</u--input>

					</u-form-item>
					<u-form-item label="生产单元：" prop="Product_Unit">
						<u--input v-model="(model.Nav_ProductionUnit||{}).NAME" disabled disabledColor="#ffffff" border="none" inputAlign="right" fontSize="14px">
						</u--input>

					</u-form-item>
					<u-form-item label="发现区域:">
						<u--input v-model="(model.Nav_RiskArea||{}).NAME" placeholder="请选择检查区域" disabled disabledColor="#ffffff" border="none" inputAlign="right" fontSize="14px">
						</u--input>
					</u-form-item>
					<u-form-item label="隐患地点:" prop="HIDDEN_PLACE">
						<u--input v-model="model.HIDDEN_PLACE" placeholder="请填写隐患地点" disabledColor="#ffffff" inputAlign="right" fontSize="14px" border="none">
						</u--input>
					</u-form-item>
					<u-form-item label="隐患描述:" prop="HIDDEN_DESCRIPTION">
						<u--input v-model="model.HIDDEN_DESCRIPTION" placeholder="请填写隐患描述" disabledColor="#ffffff" inputAlign="right" fontSize="14px" border="none">
						</u--input>
					</u-form-item>
					<view class="upload-title">隐患照片：</view>
					<full-upload v-model="model.Nav_ReportFiles" :isShowBtn='false' :listProp='listPropUpload' :listPropVal='listPropValUpload'></full-upload>

				</u--form>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		extendFilterGroup,
		extendGroupRule,
		extendInclude,
		extendOrder,
		extendRule,
		extendIgnoreDataRule,
		guid,
		initFilter,
		initFilterGroup,
		transformData
	} from '../../../../utils/common'
	import {
		MineTypeIndex,
		MineTypeName
	} from '../../../../utils/enums.js'
	import {
		GetHandRiskReportRecord,
	} from '../../../../services/apply/subPages/SK/SKServices.js'
	import stepTitle from '@/components/custom/step-title.vue'
	import {
		getEnum,
		GetEnumAnyOrder
	} from '../../../../services/common';
	export default {
		components: {
			stepTitle,
		},
		data() {
			return {
				listPropUpload: ['NOTIFY_ID'],
				listPropValUpload: [],
				ORG_ID: uni.getStorageSync('orgId'),
				model: {
					Nav_ReportFiles: [],
					Product_Unit: '',
					Nav_RiskArea: {
						NAME: ''
					},
					HIDDEN_PLACE: '',
					HIDDEN_DESCRIPTION: '',
					Nav_ApplyDepartment: {
						NAME: ''
					},
					Nav_ApplyUser: {
						NAME: ''
					},
					CREATE_TIME: ''
				},
				stepsText: ['发起', '归档'],
				stepsPage: 0,
				stepsPageList: 0,
				TaskID: '',
				isLoadOK: false,
				isAudit: false,
				tableKey: 0,
				enumsData: {}, // 存储所有枚举数据（键：枚举名称，值：处理后的枚举列表）
				enumsText: {} // 存储枚举文本列表（用于下拉选择等场景）


			}
		},
		onLoad(option) {
			this.TaskID = option.taskID ? option.taskID : '';
			this.model.ID = option.ID ? option.ID : '';
			this.tableKey = option.tableKey ? option.tableKey : '0'
			this.isAudit = option.isAudit
			this.loadData();
		},
		methods: {
			loadData() {
				const orgId = uni.getStorageSync('orgId')
				const json = initFilter(orgId, "", "")
				extendRule(json, 'ID', 1, this.model.ID);
				extendInclude(json, 'Nav_ApplyUser');
				extendInclude(json, 'Nav_ProductionUnit');
				extendInclude(json, 'Nav_ApplyDepartment');
				extendInclude(json, 'Nav_RiskArea');
				extendInclude(json, 'Nav_ReportFiles');
				extendInclude(json, 'Nav_ReportFiles.Nav_ImgFile');
				extendIgnoreDataRule(json)
				// extendRule(json, 'TASK_ID', 1, this.TaskID);
				GetHandRiskReportRecord(json).then(res => {
					this.isLoadOK = true
					this.model = res
					this.stepsPage = res.STATUS == 0 ? 0 : 1
				})


			},

		}



	}
</script>

<style scoped>
	@import url("../../../../style/css/newTemplate.css");

	.todo-page>>>.u-steps-item__line {
		width: 187.6px !important;
	}
</style>