<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<meta name="viewport"
		content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0, viewprot-fit:cover" />
	<title>应急演练</title>
	<!-- 在 includeHead.js 之后添加环境判断 -->
	<script src="../sdk/includeHead.js"></script>
	<script type="text/javascript" src="../sdk/axios_http3.js"></script>
	<link href="../sdk/quilljs/quill.snow.css" rel="stylesheet">
	<script src="../sdk/quilljs/quill.js"></script>
</head>

<body>
	<div id="app" class="page_wrapper" v-cloak>
		<div class="third-layer">
			<!-- form开始 -->
			<div class="form-container">

				<div class="form-item">
					<span class="form-label title_require">单位名称</span>
					<div class="form-input-wrap" style="font-size: 15px;color: #737373;">
						{{ formData.merName }}
					</div>
				</div>

				<div class="form-item">
					<span class="form-label title_require">联系人</span>
					<div class="form-input-wrap" style="font-size: 15px;color: #737373;">
						<template>
							<span :class="'form-input'" style="line-height: .7rem;">
							  {{ showOriginal.merchantName ? formData.merchantName : desensitize(formData.merchantName, 'name') }}
							</span>
							<van-icon 
							  :name="showOriginal.merchantName ? 'eye-o' : 'closed-eye'"
							  @click="toggleShow('merchantName')"
							  style="margin-left: 8px; color: #1989fa; cursor: pointer;"
							/>
						  </template>
					</div>
				</div>

				<div class="form-item">
					<span class="form-label title_require">电话</span>
					<div class="form-input-wrap" style="font-size: 15px;color: #737373;">
						<template><!-- 详情模式 -->
							<span class="form-input" style="line-height: .7rem;">
							  {{ showOriginal.merchantPhone ? formData.merchantPhone : desensitize(formData.merchantPhone, 'phone') }}
							</span>
							<van-icon 
							  :name="showOriginal.merchantPhone ? 'eye-o' : 'closed-eye'"
							  @click="toggleShow('merchantPhone')"
							  style="margin-left: 8px; color: #1989fa; cursor: pointer;"
							/>
						  </template>
					</div>
				</div>
				<div class="form-item">
					<span class="form-label title_require">特种作业类别</span>
					<div class="form-input-wrap">
						<select class="selector" v-model="formData.workType" :disabled="flag=='XQ'">
							<option v-for="(item, i) in tabList4lv2" :key="i"
								:label="item.dictLabel" :value="item.dictValue">
							</option>
						</select>
					</div>
				</div>
				<div class="form-item">
					<span class="form-label title_require">作业公司</span>
					<div class="form-input-wrap">
						<input maxlength="25" type="text" v-model="formData.companyName" :disabled="flag=='XQ'" class="form-input"
							placeholder="请输入作业公司">
					</div>
				</div>

				<div class="form-item">
					<span class="form-label title_require">作业人员姓名</span>
					<div class="form-input-wrap">
						<input maxlength="25" type="text" v-model="formData.workerName" :disabled="flag=='XQ'" class="form-input"
							placeholder="请输入作业人员姓名(多个逗号隔开)">
					</div>
				</div>

				<!-- 详情模式 -->
				<div class="form-label form-label-div title_require title_requirediv" style="width: 4rem;">上传作业证件（最多6张）</div>
				<div class="img-wrapper">
					<div style="position: relative;" v-for="(imgItem, index) in formData.attachmentFile">
						<img :src="previewUrl + imgItem" style="width: 1.6rem; height: 1.6rem;"
							@click="showImage(formData.attachmentFile, index)" />
						<div v-if="flag=='ADD'" class="van-uploader__preview-delete"
							@click="handleDeleteFloorPlan(index, 'floorPlan')"><i
								class="van-icon van-icon-cross van-uploader__preview-delete-icon"></i></div>
					</div>
					<div v-if="formData.attachmentFile.length<6 && flag=='ADD' ">
						<!-- <van-uploader :before-read="beforeRead" :after-read="(file) => afterRead(file, 'floorPlan')"
							class="uploader-wrapper" :deletable="false" :preview-image="false">
							<img src="../image/code/upload.png" style="width:1.6rem;height: 1.6rem;" alt="" srcset="">
						</van-uploader> -->
						<img src="../image/code/upload.png" style="width:1.6rem;height: 1.6rem;" alt="" srcset="" @click="paizhao()">
					</div>
				</div>
				
				<div>
					
				</div>

				<!-- 原作业时间部分替换为 -->
				<div class="form-item date-wrapper">
					<span class="form-label title_require" style="width: 2rem;">作业时间(起始)</span>
					<div class="form-input-wrap" style="display: flex; align-items: center; gap: 0.2rem;">
						<van-field readonly v-model="formData.startTime" :disabled="flag=='XQ'" placeholder="请选择作业时间(起始)"
							class="form-input" @click="showStartDatePickerHandler" />
					</div>
				</div>
				<div class="form-item date-wrapper">
					<span class="form-label title_require" style="width: 2rem;">作业时间(结束)</span>
					<div class="form-input-wrap" style="display: flex; align-items: center; gap: 0.2rem;">
						<van-field readonly v-model="formData.endTime" :disabled="flag=='XQ'" placeholder="请选择作业时间(结束)"
							class="form-input" @click="showEndDatePickerHandler" />
					</div>
				</div>

				<!-- 原日期选择器替换为两个 -->
				<van-popup v-model="showStartDatePicker" position="bottom">
					<van-datetime-picker type="datehour"
						:min-date="minDate"
						:max-date="maxDate"
						@confirm="onStartDateConfirm"
						@cancel="showStartDatePicker = false"
						/>
				</van-popup>

				<van-popup v-model="showEndDatePicker" position="bottom">
					<van-datetime-picker type="datehour"
						:min-date="minDate"
						:max-date="maxDate"
						@confirm="onEndDateConfirm"
						@cancel="showEndDatePicker = false"
						/>
				</van-popup>
				<div style="margin-top: .2rem;" v-if="flag=='ADD'">
						<van-checkbox v-model="formData.check" icon-size="16px" style="color:blue; font-size:.28rem;" >
						我已阅读
						<span style="color:blue;" @click="showTipPage">《提醒事项》</span>
					</van-checkbox>
					<!-- form结束 -->
					<button class="save-btn" style="margin-top: .1rem;margin-left: 50%; transform: translateX(-50%);" v-if="flag=='ADD'"
						@click="submitForm">提交报备</button>
				</div>
			</div>

			<!-- 新增提醒事项弹出层 -->
			<van-popup v-model="showTipPopup" position="center" :style="{ width: '90%', height: '80%', padding: '.3rem'}">
				<div id="fuwenben-wrapper">
					<!-- <iframe :src="`_tezhongzuoye_detail-text.html?type=${formData.workType}`"></iframe>
					 -->
					  <div id="editor-container"></div>
				
					
				</div>
				<van-button type="info" size="small" plain
					style="margin-top: 0.2rem;
					width: 100%;" @click="showTipPopup = false,formData.check=true;">
						关闭
					</van-button>
			</van-popup>

		</div>
		<div class="float-read-btn" @click="goback4ios" v-if="iosFlag">
		  <img src="../image/code/back.png" style="width: .9rem;" />
		</div>
</body>

</html>