<!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>
		<!-- <script src="https://cdn.bootcdn.net/ajax/libs/pdf.js/2.0.193/pdf.min.js"></script>
		<script src="https://cdn.bootcdn.net/ajax/libs/pdf.js/2.0.193/pdf.worker.min.js"></script> -->
<!-- 		<script src="../js/pdfjs-4.2.67-dist/build/pdf.mjs"></script>
		<script src="../js/pdfjs-4.2.67-dist/build/pdf.worker.mjs"></script> -->
		  <script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.11.338/pdf.min.js"></script>
		<script type="text/javascript" src="../js/includeHead.js"></script>
		<style>
			html, body{
				background-color: #fff;
			}
			.pd-01rem{
				padding-bottom: 0.1rem;
			}
			/* 表单相关 */
			.formValue{
				float: right;
			}
			.formSubmitBtnWrapper{
				display: flex;
				justify-content: center;
				margin-top: 0.2rem;
				margin-bottom:0.2rem;
			}
			.formSubmitBtnWrapper .van-button{
				width: 4rem;
			}
			
			/**
			 * 框架样式覆盖修改
			 */
			.van-cell__value{overflow: unset; }
			.van-cell:after{border-bottom:none;}
			.van-radio-group--horizontal{float: right;}
		</style>
	</head>
	<body>
		<div id="app">
			<div class="content" v-cloak>
				
				<van-cell-group>
				  <van-field v-model="form.name" :disabled="disabled" label="危险作业" placeholder="" />
				</van-cell-group>
				<van-cell-group :class="{'disable-van-cell': disabled}">
				<van-cell is-link @click="showPopup('showPopup4hdInspectDate1')" >作业起始时间<span class="formValue">{{form.workTime1}}</span></van-cell>
				<van-popup v-model="showPopup4hdInspectDate1" position="bottom" :style="{ height: '30%' }">
					<van-datetime-picker v-model="hdInspectDateModel1" type="date" title="选择年月日" @confirm="confirm4hdInspectDate1" @cancel="showPopup4hdInspectDate1=false" />
				</van-cell-group>
				<van-cell-group :class="{'disable-van-cell': disabled}">
				<van-cell is-link @click="showPopup('showPopup4hdInspectDate2')" >作业结束时间<span class="formValue">{{form.workTime2}}</span></van-cell>
				<van-popup v-model="showPopup4hdInspectDate2" position="bottom" :style="{ height: '30%' }">
					<van-datetime-picker v-model="hdInspectDateModel2" type="date" title="选择年月日" @confirm="confirm4hdInspectDate2" @cancel="showPopup4hdInspectDate2=false" />
				</van-cell-group>
				
				<van-cell-group>
				  <van-field v-model="form.workNumber" :disabled="disabled" label="作业人数" placeholder="" />
				</van-cell-group>
				<van-cell-group>
				  <van-field v-model="form.mainPlace" :disabled="disabled" label="主要场所" placeholder="" />
				</van-cell-group>
				<van-cell-group>
				  <van-field v-model="form.reportPer" :disabled="disabled" label="报告人" placeholder="" />
				</van-cell-group>
				<van-cell-group>
				  <van-field v-model="form.perTel" :disabled="disabled" label="联系方式" placeholder="" />
				</van-cell-group>
				<van-cell-group :class="{'disable-van-cell': disabled}">
				  <van-cell is-link @click="showPopup('showPopup4hdRectificationDate')">报告时间<span class="formValue">{{form.uploadDate}}</span></van-cell>
				  <van-popup v-model="showPopup4hdRectificationDate" position="bottom" :style="{ height: '30%' }">
				  	<van-datetime-picker v-model="hdRectificationDateModel" type="date" title="选择年月日" @confirm="confirm4hdRectificationDate" @cancel="showPopup4hdRectificationDate=false" />
				  </van-popup>
				</van-cell-group>
				<van-cell-group>
				  <van-field v-model="form.remark" :disabled="disabled" label="备注" placeholder="" />
				</van-cell-group>
				<van-cell-group :class="{'disable-van-cell': true}">
				  <van-cell>文件预览：
				  <div style="width: 6.5rem;">
					<van-image
					  v-show="(form.filePathList[0]) && (form.filePathList[0].indexOf('.png')>-1 || form.filePathList[0].indexOf('.jpg')>-1 || form.filePathList[0].indexOf('.jpeg')>-1)"
					  width="100"
					  height="100"
					   :src="previewUrl+'/' + form.filePathList[0]"
					/>
					
				 
				  </div>
				  <span v-show="(form.filePathList[0]) && (form.filePathList[0].indexOf('.pdf')>-1)" @click="previewFile">{{ form.filePathList[0] }}</span>
				  <span v-show="form.filePathList[0] && !disabled" style="font-weight: bold; cursor: pointer;" @click="form.filePathList=[];fileList=[]"> 删除</span>
				  </van-cell>
				</van-cell-group>
				
				<van-cell-group :class="{'disable-van-cell': disabled}">
				  <van-cell>文件：
				  <div style="width: 2.5rem;">
				  	<van-uploader v-model="fileList" 
						accept=".jpg,.jpeg,.png,.pdf"
						:preview-image="false"
					  :before-upload="beforeUpload"
					  :after-read="afterRead"
					  
						:max-count="1" :deletable="!disabled" :preview-full-image="false">
						<van-button v-show="pageType !== 'detail' && !form.filePathList.length" size="mini" icon="plus" type="primary">上传文件</van-button>
				  	</van-uploader>
				  </div></van-cell>
				</van-cell-group>
				<div class="formSubmitBtnWrapper" v-if="!disabled"><van-button type="info" size="small" @click="submit">提交</van-button></div>
			</div>
		</div>
	</body>
</html>