<template>
	<!-- 带气封堵工程 -->
	<scroll-view>
		<view>
			<view class="background">
				<view class="uni-list">
					<view class="container" style="border-bottom: 1px solid #f8f8f8;">
						<view style="font-size: 16px;display: flex; justify-content: space-between;">
							{{projectTypeLabel}}
						</view>
					</view>
				</view>
				<view class="uni-list">
					<view class="container" style="border-bottom: 1px solid #f8f8f8;">
						<view>
							工程名称
						</view>
						<view v-if="this.isEmpty(this.enginName)">
							<span style="color: darkgray;">请选择工程</span>
							<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
						</view>
						<view v-else>
							<span style="color: black;">{{enginName}}</span>
							<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
						</view>
					</view>
				</view>

				<view class="uni-list">
					<view class="container" style="border-bottom: 1px solid #f8f8f8;">

						<text>工程地点</text>
						<input class="uni-input" type="digit" v-model="address" placeholder="请输入工程地点" maxlength="100"
							style="margin-left: 10px;text-align: right;"></input>
					</view>
				</view>

				<view class="uni-list">
					<view class="container" style="border-bottom: 1px solid #f8f8f8;">

						<text>作业方式</text>
						<input class="uni-input" type="digit" v-model="workType" placeholder="请输入作业方式" maxlength="100"
							style="margin-left: 10px;text-align: right;"></input>
					</view>
				</view>

				<view class="uni-list">
					<view class="container" style="border-bottom: 1px solid #f8f8f8;">

						<text>施工内容</text>
						<input class="uni-input" type="digit" v-model="workContent" placeholder="请输入施工内容"
							maxlength="100" style="margin-left: 10px;text-align: right;"></input>
					</view>
				</view>

				<view class="uni-list">
					<view class="container" style="border-bottom: 1px solid #f8f8f8;">

						<text>管道压力</text>
						<input class="uni-input" type="digit" v-model="pipePressure" placeholder="请输入管道压力"
							maxlength="100" style="margin-left: 10px;text-align: right;"></input>
					</view>
				</view>

				<view class="uni-list">
					<view class="align-items" style="margin-bottom: 20px;">
						<view class="container" style="color: #b2b2b2;">*请上传开孔照片</view>
						<view style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
							<image :src="loadImgSrc('updateimg.png')" mode=""
								style="width: 200rpx; height: 150rpx; margin: 0 12rpx; " @click="choose('fileOpenArr')">
							</image>
							<view v-for="(item,index) in fileOpenArr" :key="index" style="position: relative;">
								<view style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									<image
										v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' || item.substring(item.length - 4) == 'jpeg' "
										:src="item" @click="this.showPhoto(fileOpenArr.indexOf(item),fileOpenArr)"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</image>
									<video v-else-if="item.substring(item.length - 3) == 'mp4'" :src="item"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</video>
									<text v-else @click="chooseModel(item,item.fileName)">
										{{item.fileName}}
									</text>
								</view>
								<view v-if="isShowRemoveFile(item)" @click="removeFile(index,fileOpenArr)"
									style="position: absolute; top: 0; right: 0rpx; border-radius: 50%;">
									<image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
									</image>
								</view>
							</view>
						</view>
					</view>
				</view>

				<view class="uni-list">
					<view class="align-items" style="margin-bottom: 20px;">
						<view class="container" style="color: #b2b2b2;">*请上传封堵照片</view>
						<view style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
							<image :src="loadImgSrc('updateimg.png')" mode=""
								style="width: 200rpx; height: 150rpx; margin: 0 12rpx; "
								@click="choose('filePluggingArr')">
							</image>
							<view v-for="(item,index) in filePluggingArr" :key="index" style="position: relative;">
								<view style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									<image
										v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' || item.substring(item.length - 4) == 'jpeg' "
										:src="item"
										@click="this.showPhoto(filePluggingArr.indexOf(item),filePluggingArr)"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</image>
									<video v-else-if="item.substring(item.length - 3) == 'mp4'" :src="item"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</video>
									<text v-else @click="chooseModel(item,item.fileName)">
										{{item.fileName}}
									</text>
								</view>
								<view v-if="isShowRemoveFile(item)" @click="removeFile(index,filePluggingArr)"
									style="position: absolute; top: 0; right: 0rpx; border-radius: 50%;">
									<image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
									</image>
								</view>
							</view>
						</view>
					</view>
				</view>

				<view class="uni-list">
					<view class="align-items" style="margin-bottom: 20px;">
						<view class="container" style="color: #b2b2b2;">*请上传作业完成照片</view>
						<view style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
							<image :src="loadImgSrc('updateimg.png')" mode=""
								style="width: 200rpx; height: 150rpx; margin: 0 12rpx; " @click="choose('fileWorkArr')">
							</image>
							<view v-for="(item,index) in fileWorkArr" :key="index" style="position: relative;">
								<view style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									<image
										v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' || item.substring(item.length - 4) == 'jpeg' "
										:src="item" @click="this.showPhoto(fileWorkArr.indexOf(item),fileWorkArr)"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</image>
									<video v-else-if="item.substring(item.length - 3) == 'mp4'" :src="item"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</video>
									<text v-else @click="chooseModel(item,item.fileName)">
										{{item.fileName}}
									</text>
								</view>
								<view v-if="isShowRemoveFile(item)" @click="removeFile(index,fileWorkArr)"
									style="position: absolute; top: 0; right: 0rpx; border-radius: 50%;">
									<image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
									</image>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="background" v-if="projectType==='pe'">

				<view class="uni-list">
					<view class="align-items" style="margin-bottom: 20px;">
						<view class="container" style="color: #b2b2b2;">*请上传鞍型焊接照片</view>
						<view style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
							<image :src="loadImgSrc('updateimg.png')" mode=""
								style="width: 200rpx; height: 150rpx; margin: 0 12rpx; " @click="choose('filePE01Arr')">
							</image>
							<view v-for="(item,index) in filePE01Arr" :key="index" style="position: relative;">
								<view style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									<image
										v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' || item.substring(item.length - 4) == 'jpeg' "
										:src="item" @click="this.showPhoto(filePE01Arr.indexOf(item),filePE01Arr)"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</image>
									<video v-else-if="item.substring(item.length - 3) == 'mp4'" :src="item"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</video>
									<text v-else @click="chooseModel(item,item.fileName)">
										{{item.fileName}}
									</text>
								</view>
								<view v-if="isShowRemoveFile(item)" @click="removeFile(index,filePE01Arr)"
									style="position: absolute; top: 0; right: 0rpx; border-radius: 50%;">
									<image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
									</image>
								</view>
							</view>
						</view>
					</view>
				</view>

				<view class="uni-list">
					<view class="align-items" style="margin-bottom: 20px;">
						<view class="container" style="color: #b2b2b2;">*请上传气密实验照片</view>
						<view style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
							<image :src="loadImgSrc('updateimg.png')" mode=""
								style="width: 200rpx; height: 150rpx; margin: 0 12rpx; " @click="choose('filePE02Arr')">
							</image>
							<view v-for="(item,index) in filePE02Arr" :key="index" style="position: relative;">
								<view style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									<image
										v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' || item.substring(item.length - 4) == 'jpeg' "
										:src="item" @click="this.showPhoto(filePE02Arr.indexOf(item),filePE02Arr)"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</image>
									<video v-else-if="item.substring(item.length - 3) == 'mp4'" :src="item"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</video>
									<text v-else @click="chooseModel(item,item.fileName)">
										{{item.fileName}}
									</text>
								</view>
								<view v-if="isShowRemoveFile(item)" @click="removeFile(index,filePE02Arr)"
									style="position: absolute; top: 0; right: 0rpx; border-radius: 50%;">
									<image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
									</image>
								</view>
							</view>
						</view>
					</view>
				</view>

				<view class="uni-list">
					<view class="align-items" style="margin-bottom: 20px;">
						<view class="container" style="color: #b2b2b2;">*请上传清扫照片</view>
						<view style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
							<image :src="loadImgSrc('updateimg.png')" mode=""
								style="width: 200rpx; height: 150rpx; margin: 0 12rpx; " @click="choose('filePE03Arr')">
							</image>
							<view v-for="(item,index) in filePE03Arr" :key="index" style="position: relative;">
								<view style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									<image
										v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' || item.substring(item.length - 4) == 'jpeg' "
										:src="item" @click="this.showPhoto(filePE03Arr.indexOf(item),filePE03Arr)"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</image>
									<video v-else-if="item.substring(item.length - 3) == 'mp4'" :src="item"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</video>
									<text v-else @click="chooseModel(item,item.fileName)">
										{{item.fileName}}
									</text>
								</view>
								<view v-if="isShowRemoveFile(item)" @click="removeFile(index,filePE03Arr)"
									style="position: absolute; top: 0; right: 0rpx; border-radius: 50%;">
									<image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
									</image>
								</view>
							</view>
						</view>
					</view>
				</view>

				<view class="uni-list">
					<view class="align-items" style="margin-bottom: 20px;">
						<view class="container" style="color: #b2b2b2;">*请上传碰口作业照片</view>
						<view style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
							<image :src="loadImgSrc('updateimg.png')" mode=""
								style="width: 200rpx; height: 150rpx; margin: 0 12rpx; " @click="choose('filePE04Arr')">
							</image>
							<view v-for="(item,index) in filePE04Arr" :key="index" style="position: relative;">
								<view style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									<image
										v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' || item.substring(item.length - 4) == 'jpeg' "
										:src="item" @click="this.showPhoto(filePE04Arr.indexOf(item),filePE04Arr)"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</image>
									<video v-else-if="item.substring(item.length - 3) == 'mp4'" :src="item"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</video>
									<text v-else @click="chooseModel(item,item.fileName)">
										{{item.fileName}}
									</text>
								</view>
								<view v-if="isShowRemoveFile(item)" @click="removeFile(index,filePE04Arr)"
									style="position: absolute; top: 0; right: 0rpx; border-radius: 50%;">
									<image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
									</image>
								</view>
							</view>
						</view>
					</view>
				</view>
				<view class="uni-list">
					<view class="align-items" style="margin-bottom: 20px;">
						<view class="container" style="color: #b2b2b2;">*请上传恢复通气捡漏照片</view>
						<view style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
							<image :src="loadImgSrc('updateimg.png')" mode=""
								style="width: 200rpx; height: 150rpx; margin: 0 12rpx; " @click="choose('filePE05Arr')">
							</image>
							<view v-for="(item,index) in filePE05Arr" :key="index" style="position: relative;">
								<view style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									<image
										v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' || item.substring(item.length - 4) == 'jpeg' "
										:src="item" @click="this.showPhoto(filePE05Arr.indexOf(item),filePE05Arr)"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</image>
									<video v-else-if="item.substring(item.length - 3) == 'mp4'" :src="item"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</video>
									<text v-else @click="chooseModel(item,item.fileName)">
										{{item.fileName}}
									</text>
								</view>
								<view v-if="isShowRemoveFile(item)" @click="removeFile(index,filePE05Arr)"
									style="position: absolute; top: 0; right: 0rpx; border-radius: 50%;">
									<image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
									</image>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="background" v-else>

				<view class="uni-list">
					<view class="align-items" style="margin-bottom: 20px;">
						<view class="container" style="color: #b2b2b2;">*请上传管道壁厚照片</view>
						<view style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
							<!--  -->
							<image :src="loadImgSrc('updateimg.png')" mode=""
								style="width: 200rpx; height: 150rpx; margin: 0 12rpx; "
								@click="choose('fileSteel01Arr')">
							</image>
							<view v-for="(item,index) in fileSteel01Arr" :key="index" style="position: relative;">
								<view style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									<image
										v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' || item.substring(item.length - 4) == 'jpeg' "
										:src="item" @click="this.showPhoto(fileSteel01Arr.indexOf(item),fileSteel01Arr)"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</image>
									<video v-else-if="item.substring(item.length - 3) == 'mp4'" :src="item"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</video>
									<text v-else @click="chooseModel(item,item.fileName)">
										{{item.fileName}}
									</text>
								</view>
								<view v-if="isShowRemoveFile(item)" @click="removeFile(index,fileSteel01Arr)"
									style="position: absolute; top: 0; right: 0rpx; border-radius: 50%;">
									<image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
									</image>
								</view>
							</view>
						</view>
					</view>
				</view>

				<view class="uni-list">
					<view class="align-items" style="margin-bottom: 20px;">
						<view class="container" style="color: #b2b2b2;">*请上传焊接四通照片</view>
						<view style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
							<image :src="loadImgSrc('updateimg.png')" mode=""
								style="width: 200rpx; height: 150rpx; margin: 0 12rpx; "
								@click="choose('fileSteel02Arr')">
							</image>
							<view v-for="(item,index) in fileSteel02Arr" :key="index" style="position: relative;">
								<view style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									<image
										v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' || item.substring(item.length - 4) == 'jpeg' "
										:src="item" @click="this.showPhoto(fileSteel02Arr.indexOf(item),fileSteel02Arr)"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</image>
									<video v-else-if="item.substring(item.length - 3) == 'mp4'" :src="item"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</video>
									<text v-else @click="chooseModel(item,item.fileName)">
										{{item.fileName}}
									</text>
								</view>
								<view v-if="isShowRemoveFile(item)" @click="removeFile(index,fileSteel02Arr)"
									style="position: absolute; top: 0; right: 0rpx; border-radius: 50%;">
									<image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
									</image>
								</view>
							</view>
						</view>
					</view>
				</view>


				<view class="uni-list">
					<view class="align-items" style="margin-bottom: 20px;">
						<view class="container" style="color: #b2b2b2;">*请上传焊接旁通照片</view>
						<view style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
							<image :src="loadImgSrc('updateimg.png')" mode=""
								style="width: 200rpx; height: 150rpx; margin: 0 12rpx; "
								@click="choose('fileSteel03Arr')">
							</image>
							<view v-for="(item,index) in fileSteel03Arr" :key="index" style="position: relative;">
								<view style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									<image
										v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' || item.substring(item.length - 4) == 'jpeg' "
										:src="item" @click="this.showPhoto(fileSteel03Arr.indexOf(item),fileSteel03Arr)"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</image>
									<video v-else-if="item.substring(item.length - 3) == 'mp4'" :src="item"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</video>
									<text v-else @click="chooseModel(item,item.fileName)">
										{{item.fileName}}
									</text>
								</view>
								<view v-if="isShowRemoveFile(item)" @click="removeFile(index,fileSteel03Arr)"
									style="position: absolute; top: 0; right: 0rpx; border-radius: 50%;">
									<image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
									</image>
								</view>
							</view>
						</view>
					</view>
				</view>

				<view class="uni-list">
					<view class="align-items" style="margin-bottom: 20px;">
						<view class="container" style="color: #b2b2b2;">*请上传氮气吹扫照片</view>
						<view style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
							<image :src="loadImgSrc('updateimg.png')" mode=""
								style="width: 200rpx; height: 150rpx; margin: 0 12rpx; "
								@click="choose('fileSteel04Arr')">
							</image>
							<view v-for="(item,index) in fileSteel04Arr" :key="index" style="position: relative;">
								<view style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									<image
										v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' || item.substring(item.length - 4) == 'jpeg' "
										:src="item" @click="this.showPhoto(fileSteel04Arr.indexOf(item),fileSteel04Arr)"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</image>
									<video v-else-if="item.substring(item.length - 3) == 'mp4'" :src="item"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</video>
									<text v-else @click="chooseModel(item,item.fileName)">
										{{item.fileName}}
									</text>
								</view>
								<view v-if="isShowRemoveFile(item)" @click="removeFile(index,fileSteel04Arr)"
									style="position: absolute; top: 0; right: 0rpx; border-radius: 50%;">
									<image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
									</image>
								</view>
							</view>
						</view>
					</view>
				</view>

				<view class="uni-list">
					<view class="align-items" style="margin-bottom: 20px;">
						<view class="container" style="color: #b2b2b2;">*请上传管道置换照片</view>
						<view style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
							<image :src="loadImgSrc('updateimg.png')" mode=""
								style="width: 200rpx; height: 150rpx; margin: 0 12rpx; "
								@click="choose('fileSteel05Arr')">
							</image>
							<view v-for="(item,index) in fileSteel05Arr" :key="index" style="position: relative;">
								<view style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									<image
										v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' || item.substring(item.length - 4) == 'jpeg' "
										:src="item" @click="this.showPhoto(fileSteel05Arr.indexOf(item),fileSteel05Arr)"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</image>
									<video v-else-if="item.substring(item.length - 3) == 'mp4'" :src="item"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</video>
									<text v-else @click="chooseModel(item,item.fileName)">
										{{item.fileName}}
									</text>
								</view>
								<view v-if="isShowRemoveFile(item)" @click="removeFile(index,fileSteel05Arr)"
									style="position: absolute; top: 0; right: 0rpx; border-radius: 50%;">
									<image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
									</image>
								</view>
							</view>
						</view>
					</view>
				</view>

				<view class="uni-list">
					<view class="align-items" style="margin-bottom: 20px;">
						<view class="container" style="color: #b2b2b2;">*请上传下堵照片</view>
						<view style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
							<image :src="loadImgSrc('updateimg.png')" mode=""
								style="width: 200rpx; height: 150rpx; margin: 0 12rpx; "
								@click="choose('fileSteel06Arr')">
							</image>
							<view v-for="(item,index) in fileSteel06Arr" :key="index" style="position: relative;">
								<view style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									<image
										v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' || item.substring(item.length - 4) == 'jpeg' "
										:src="item" @click="this.showPhoto(fileSteel06Arr.indexOf(item),fileSteel06Arr)"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</image>
									<video v-else-if="item.substring(item.length - 3) == 'mp4'" :src="item"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</video>
									<text v-else @click="chooseModel(item,item.fileName)">
										{{item.fileName}}
									</text>
								</view>
								<view v-if="isShowRemoveFile(item)" @click="removeFile(index,fileSteel06Arr)"
									style="position: absolute; top: 0; right: 0rpx; border-radius: 50%;">
									<image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
									</image>
								</view>
							</view>
						</view>
					</view>
				</view>

				<view class="uni-list">
					<view class="align-items" style="margin-bottom: 20px;">
						<view class="container" style="color: #b2b2b2;">*请上传四通防腐照片</view>
						<view style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
							<image :src="loadImgSrc('updateimg.png')" mode=""
								style="width: 200rpx; height: 150rpx; margin: 0 12rpx; "
								@click="choose('fileSteel07Arr')">
							</image>
							<view v-for="(item,index) in fileSteel07Arr" :key="index" style="position: relative;">
								<view style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									<image
										v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' || item.substring(item.length - 4) == 'jpeg' "
										:src="item" @click="this.showPhoto(fileSteel07Arr.indexOf(item),fileSteel07Arr)"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</image>
									<video v-else-if="item.substring(item.length - 3) == 'mp4'" :src="item"
										style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
									</video>
									<text v-else @click="chooseModel(item,item.fileName)">
										{{item.fileName}}
									</text>
								</view>
								<view v-if="isShowRemoveFile(item)" @click="removeFile(index,fileSteel07Arr)"
									style="position: absolute; top: 0; right: 0rpx; border-radius: 50%;">
									<image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
									</image>
								</view>
							</view>
						</view>
					</view>
				</view>

			</view>
		</view>
		<view class="action-btn">
			<button @click="submit" class="btn cu-btn block bg-blue lg round">提交</button>
		</view>
	</scroll-view>
</template>

<script>
	import SelectPicker from '../../components/selectPicker/select_picker.vue'
	import bottomSheet from '../../components/bottomSheet/bottomSheetGasSealing.vue'
	import {
		getToken
	} from '../../utils/auth';
	import {
		getGasSealingProjectList,
		submitGasSealingProject,
		getGasSealingHistoryList
	} from '@/api/common'
	export default {
		components: {
			SelectPicker,
			bottomSheet
		},
		data() {
			return {
				headers: {
					Authorization: "Bearer " + getToken()
				},
				file: [], // 附件
				pics: [], // 附件返回
				open: false,
				currentTime: '',
				fileArr: [],
				id: '',
				enginName: '',
				address: '',
				workType: '',
				workContent: '',
				pipePressure: '',
				projectType: '',
				projectTypeLabel: '',

				fileOpenArr: [], //开孔照片
				fileWorkArr: [], //作业完成照片
				filePluggingArr: [], //封堵照片

				filePE01Arr: [], //鞍型焊接照片
				filePE02Arr: [], //气密实验照片
				filePE03Arr: [], //清扫照片
				filePE04Arr: [], //碰口作业照片
				filePE05Arr: [], //恢复通气检漏照片

				fileSteel01Arr: [], //管道壁厚照片
				fileSteel02Arr: [], //焊接四通照片
				fileSteel03Arr: [], //焊接旁通照片
				fileSteel04Arr: [], //氮气吹扫照片
				fileSteel05Arr: [], //管道置换照片
				fileSteel06Arr: [], //下堵照片
				fileSteel07Arr: [], //四通防腐照片

				historyList: {},

				projectTime: "",
				imgList: [],

				popupText: '', //对话框内容
				titleText: '',
				cancelText: '',
				confirmText: '',
				show_loding: false,
				fileUrl: '', //点击的文件地址
				fileName: '', //点击的文件名称
				objValue: {},
			}
		},
		created() {
			// this.currentTime = this.traversalTime(new Date().getTime()); //在data里定义变量-nowTime

		},

		onLoad(options) {
			if ('params' in options) {
				this.objValue = JSON.parse(decodeURIComponent(options.params));
				this.id = this.objValue.id;
				this.projectType = this.objValue.value;
				if (this.projectType === 'pe') {
					this.projectTypeLabel = 'PE封堵';
				} else {
					this.projectTypeLabel = '钢管带气封堵';
				}
			}

			uni.setNavigationBarTitle({
				title: '带气封堵施工'
			})
			history();
		},
		methods: {
			isEmpty(str) {
				return (!str || 0 === str.length);
			},
			chooseModel(url, name) {
				this.cancelText = '复制';
				this.confirmText = "下载";
				this.titleText = "温馨提示"
				this.popupText = "下载或者复制链接";
				this.show_loding = true;
				this.fileName = name;
				this.fileUrl = url; //文件名称和下载地址赋值
			},
			//取消按钮
			cancel_loding() {
				let _this = this;
				_this.show_loding = false;
				if (!_this.isEmpty(_this.fileUrl)) {
					uni.setClipboardData({
						data: _this.fileUrl,
						success() {
							uni.showToast({
								title: '已复制' + _this.fileName + '地址成功 请在浏览器打开',
								icon: 'none'
							});
						},
						fail(e) {
							uni.showToast({
								title: '复制失败',
								icon: 'none'
							});
						}
					});

				}
			},
			//确定按钮
			confirm_loding() {
				this.show_loding = false;
				this.download(this.fileUrl, this.fileName);
			},
			getDownLoadFilePath() {
				let cachePath = `${uni.env.USER_DATA_PATH}/downloads`
				let fm = uni.getFileSystemManager()
				try {
					// 访问成功则存在
					fm.accessSync(cachePath)
				} catch (error) {
					// 不存在则新建
					fm.mkdirSync(cachePath, true)
				}
				return cachePath
			},
			download(url, name) {
				let savePath = this.getDownLoadFilePath();
				//var savePath = uni.env.USER_DATA_PATH + '/savePath'
				uni.downloadFile({
					url: url,
					success: response => {
						if (response.statusCode === 200) {
							uni.getFileSystemManager().saveFile({
								tempFilePath: response.tempFilePath,
								filePath: `${savePath}/${name}`,
								success: (resData) => {
									uni.showToast({
										title: '下载成功'
									})
								},
								fail: error => {}
							})
						}
					}
				})
			},
			showPhoto(index, list) {
				uni.previewImage({
					current: index,
					urls: list,
				})

			},
			pickerShow() {
				this.open = true;

			},
			changeSelect(e) {

			},
			close() {
				this.open = false;
			},
			history() {
				if (this.isEmpty(this.id)) {
					this.$modal.msg('请选择工程')
					return;
				}

				getGasSealingHistoryList(this.id, this.projectType).then(res => {
					if (res.data.zEngineeringNodeBo.zEngineeringInfoBoList != null) {
						this.historyList = res.data;
						this.$refs.refShare.handleShowShare();
					} else {
						this.$modal.msg("暂无历史信息")
					}
				})
			},
			projectListSelect(item, index) {
				this.open = false;
				this.enginName = item.enginName;
				this.id = item.id;
			},
			choose(fileType) {
				if (this.isEmpty(this.id)) {
					this.$modal.msg('请选择工程')
					return;
				}
				let _this = this;
				uni.showActionSheet({
					title: '上传',
					itemList: ['图片', '视频'],
					success: (res) => {
						if (res.tapIndex == 0) {
							this.chooseimage(fileType)
						} else {
							this.choosevideo(fileType)
						}
					}
				})
			},
			chooseimage(fileType) {
				let _this = this;
				uni.chooseImage({
					sizeType: ['album', 'camera'],
					success(resp) {
						resp.tempFiles.forEach((item, index) => {
							const task = uni.uploadFile({
								url: _this.$HTTP + `/obs`,
								filePath: item.path,
								name: 'file',
								formData: {},
								header: _this.headers,

								success: res => {

									let data = JSON.parse(res.data);
									if (![200].includes(data.code)) {
										_this.$modal.msg(data.msg)
									} else {
										if (_this.progress === 100) {
											if (fileType === 'fileOpenArr') { //开孔
												_this.fileOpenArr.push(data.data.url)
											} else if (fileType === 'filePluggingArr') { //封堵
												_this.filePluggingArr.push(data.data.url)
											} else if (fileType === 'fileWorkArr') { //作业
												_this.fileWorkArr.push(data.data.url)
											} else if (fileType === 'filePE01Arr') { //PE01
												_this.filePE01Arr.push(data.data.url)
											} else if (fileType === 'filePE02Arr') { //PE02
												_this.filePE02Arr.push(data.data.url)
											} else if (fileType === 'filePE03Arr') { //PE03
												_this.filePE03Arr.push(data.data.url)
											} else if (fileType === 'filePE04Arr') { //PE04
												_this.filePE04Arr.push(data.data.url)
											} else if (fileType === 'filePE05Arr') { //PE05
												_this.filePE05Arr.push(data.data.url)
											} else if (fileType ===
												'fileSteel01Arr') { //fileSteel01Arr
												_this.fileSteel01Arr.push(data.data.url)
											} else if (fileType ===
												'fileSteel02Arr') { //fileSteel02Arr
												_this.fileSteel02Arr.push(data.data.url)
											} else if (fileType ===
												'fileSteel03Arr') { //fileSteel03Arr
												_this.fileSteel03Arr.push(data.data.url)
											} else if (fileType ===
												'fileSteel04Arr') { //fileSteel04Arr
												_this.fileSteel04Arr.push(data.data.url)
											} else if (fileType ===
												'fileSteel05Arr') { //fileSteel05Arr
												_this.fileSteel05Arr.push(data.data.url)
											} else if (fileType ===
												'fileSteel06Arr') { //fileSteel06Arr
												_this.fileSteel06Arr.push(data.data.url)
											} else if (fileType ===
												'fileSteel07Arr') { //fileSteel07Arr
												_this.fileSteel07Arr.push(data.data.url)
											}
											_this.$modal.msg('上传成功！')
										}
									}
								},
								fail: e => {
									_this.$modal.msg('上传失败！')
								},
								complete: res => {
									uni.hideLoading();
									_this.uploading = false;

								}
							});
							task.onProgressUpdate(res => {
								_this.progress = res.progress;
								uni.showLoading({
									title: '上传中'
								})
								if (_this.progress != 100) {
									_this.loading = false
								} else {
									_this.loading = true
								}
							});

						})

					},
				})
			},

			choosevideo(fileType) {
				let _this = this;
				uni.chooseVideo({
					sourceType: ['album', 'camera'],
					maxDuration: 30,
					success(resp) {
						const task = uni.uploadFile({
							url: _this.$HTTP + `/obs`,
							filePath: resp.tempFilePath,
							name: 'file',
							formData: {},
							header: _this.headers,
							success: res => {
								// 判断是否json字符串，将其转为json格式
								let data = JSON.parse(res.data);
								if (![200].includes(res.statusCode)) {
									this.uploadError(index, data);
								} else {
									//上传成功
									if (_this.progress === 100) {
										if (fileType === 'fileOpenArr') { //开孔
											_this.fileOpenArr.push(data.data.url)
										} else if (fileType === 'filePluggingArr') { //封堵
											_this.filePluggingArr.push(data.data.url)
										} else if (fileType === 'fileWorkArr') { //作业
											_this.fileWorkArr.push(data.data.url)
										} else if (fileType === 'filePE01Arr') { //PE01
											_this.filePE01Arr.push(data.data.url)
										} else if (fileType === 'filePE02Arr') { //PE02
											_this.filePE02Arr.push(data.data.url)
										} else if (fileType === 'filePE03Arr') { //PE03
											_this.filePE03Arr.push(data.data.url)
										} else if (fileType === 'filePE04Arr') { //PE04
											_this.filePE04Arr.push(data.data.url)
										} else if (fileType === 'filePE05Arr') { //PE05
											_this.filePE05Arr.push(data.data.url)
										} else if (fileType ===
											'fileSteel01Arr') { //fileSteel01Arr
											_this.fileSteel01Arr.push(data.data.url)
										} else if (fileType ===
											'fileSteel02Arr') { //fileSteel02Arr
											_this.fileSteel02Arr.push(data.data.url)
										} else if (fileType ===
											'fileSteel03Arr') { //fileSteel03Arr
											_this.fileSteel03Arr.push(data.data.url)
										} else if (fileType ===
											'fileSteel04Arr') { //fileSteel04Arr
											_this.fileSteel04Arr.push(data.data.url)
										} else if (fileType ===
											'fileSteel05Arr') { //fileSteel05Arr
											_this.fileSteel05Arr.push(data.data.url)
										} else if (fileType ===
											'fileSteel06Arr') { //fileSteel06Arr
											_this.fileSteel06Arr.push(data.data.url)
										} else if (fileType ===
											'fileSteel07Arr') { //fileSteel07Arr
											_this.fileSteel07Arr.push(data.data.url)
										}
										_this.$modal.msg('上传成功！')
										//_this.photo = false;
									}
								}
							},
							fail: e => {
								_this.$modal.msg('上传失败！')
								this.uploadError(index, e);
							},
							complete: res => {
								uni.hideLoading();
								_this.uploading = false;
							}
						});
						task.onProgressUpdate(res => {
							_this.progress = res.progress;
							uni.showLoading({
								title: '上传中'
							})
							if (_this.progress != 100) {
								_this.loadingFile = false
							} else {
								_this.loadingFile = true
							}
						});

					},
				})
			},
			isShowRemoveFile(item) {
				var isShow = true;
				// var isShow = item.createBy == this.$user.state.name;
				return isShow;
			},
			removeFile(index, fileArr) {
				uni.showModal({
					title: '提示',
					content: '是否删除该文件？',
					success: (res) => {
						if (res.confirm) {
							fileArr.splice(index, 1)
						}
					}
				})
			},
			submit() {
				// if (this.isEmpty(this.address)) {
				// 	this.$modal.msg('请输入地点')
				// 	return;
				// }
				// if (this.isEmpty(this.workType)) {
				// 	this.$modal.msg('请输入作业方式')
				// 	return;
				// }
				// if (this.isEmpty(this.pipePressure)) {
				// 	this.$modal.msg('请输入管道压力')
				// 	return;
				// }
				// if (this.projectType !== 'pe' && this.isEmpty(this.workContent)) {
				// 	this.$modal.msg('请输入施工内容')
				// 	return;
				// }
				// if (this.fileOpenArr.length <= 0) {
				// 	this.$modal.msg('请选择附件')
				// 	return;
				// }

				let param = {
					id: this.id,
					zEngineeringNodeBo: {
						zEngineeringInfoBo: {
							headName: this.enginName, //工程名称
							constructAddre: this.address, //地点
							segmentedCompressionQualified: this.workType, //作业方式
							constructAccordingDrawings: this.pipePressure, //管道压力

							remark: this.workContent, //施工内容 PE

							peHolesOpening: this.fileOpenArr, //开孔照片 PE
							peHomeworkDone: this.fileWorkArr, //作业完成照片 PE
							pePlugging: this.filePluggingArr, //封堵照片 PE

							peSaddleWelding: this.filePE01Arr, //鞍型焊接照片 PE
							peAirtightTest: this.filePE02Arr, //气密实验照片 PE
							peCleaning: this.filePE03Arr, //清扫照片 PE
							peCollisionOperating: this.filePE04Arr, //碰口作业照片 PE
							peAirrecovering: this.filePE05Arr, //恢复通气检漏照片 PE

							ironHolesOpening: this.fileOpenArr, //开孔照片
							ironHomeworkDone: this.fileWorkArr, //作业完成照片
							ironCleaning: this.filePluggingArr, //封堵照片

							ironPipelineThickness: this.fileSteel01Arr, //管道壁厚照片
							iron4Welding: this.fileSteel02Arr, //焊接四通照片
							ironBypassWelding: this.fileSteel03Arr, //焊接旁通照片
							ironNitrogenPurging: this.fileSteel04Arr, //氮气吹扫照片
							ironPipelineReplacing: this.fileSteel05Arr, //管道置换照片
							ironLowerEndCap: this.fileSteel06Arr, //下堵照片
							iron4Aczoiling: this.fileSteel07Arr, //四通防腐照片
						}
					}
				}

				uni.showLoading();
				submitGasSealingProject(param).then(res => {
					uni.hideLoading()
					this.$modal.msg(res.msg);
					setTimeout(() => {
						uni.navigateBack();
					}, 1000);
				})
			},
			// 打开picker
			openDatetimePicker() {
				if (this.isEmpty(this.id)) {
					this.$modal.msg('请选择工程')
				} else {
					this.$refs.myPicker.show();
				}
			},
		}
	}
</script>

<style>
	.container {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 10px;
		position: relative;
	}

	.uni-list {
		border: 1xp solid #eee;
	}

	.to-right-icon {
		width: 15px;
		height: 15px;
		position: absolute;
		top: 50%;
		transform: translateY(-50%);
	}


	.marginLeft5 {
		margin-left: 5px;
	}

	.title-txt {
		font-size: 15px;
		font-weight: bold;
		color: black;
	}

	.content-txt {
		font-size: 10px;
		font-weight: bold;
		color: black;
	}

	.background {
		// border: 15px solid hsla(0, 0%, 100%, .5);
		background: white;
		background-clip: padding-box;
		padding: 20rpx;
		border-radius: 20rpx;
		margin: 20rpx;
		/*从padding开始往外面裁剪背景*/
	}

	.uni-list-cell {
		position: relative;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}

	.uni-list-cell-left {
		white-space: nowrap;
		font-size: 28rpx;
	}

	.centered {
		text-align: center;
		background-color: #e2f4ff;

	}

	.text {
		background-color: #e2f4ff;
		height: 20rpx;
	}

	.view_bg_build {
		background-color: #e2f4ff;
		padding: 10rpx;
		margin: 20rpx;
	}

	.grid-text {
		font-size: 14px;
		color: #000000;
		text-align: center;
		padding-left: 30rpx;
		padding-right: 30rpx;
		padding-top: 20rpx;
		padding-bottom: 20rpx;
	}

	.name {
		flex: 0;
		font-size: 14px;
		color: #000000;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.table-item {
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.block-iv {
		width: 10px;
		height: 10px;
	}

	.btn {
		width: 715rpx;
		height: 69rpx;
		background: #79A4F0;
		border-radius: 6rpx;
		font-size: 25rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: #FFFFFF;
		line-height: 69rpx;
		margin-top: 40rpx;
		margin-bottom: 100rpx;
	}

	.number {
		display: flex;
		/* 水平居中显示子元素 */
		align-items: flex-start;
		/* 垂直居中显示子元素 */
		justify-content: space-between;
		/* 左右间距等于间距大小 */
		padding: 10px;
		/* 设置padding以提高视觉效果 */
	}

	.tj-btn {
		height: 69rpx;
		background: #3184f0;
		border-radius: 6rpx;
		font-size: 25rpx;
		font-weight: 400;
		color: #FFFFFF;
		line-height: 69rpx;
		margin: 40rpx 70rpx;
	}

	.sc-btn {
		height: 69rpx;
		background: #f0686b;
		border-radius: 6rpx;
		font-size: 25rpx;
		font-weight: 400;
		color: #FFFFFF;
		line-height: 69rpx;
		margin: 40rpx;
	}

	.num-style {
		background: #e8f4f9;
		margin: 20rpx;
		padding: 10rpx;
		border-radius: 20rpx;
		border: 1px solid #d4e3f0;
	}

	.textarea {
		margin-top: 10upx;
		width: 100%;
		border: 1rpx solid red;
		min-height: 100upx;
		line-height: 20px;
	}

	.text {
		font-size: 16px;
		color: #333;
	}

	input {
		flex-grow: 1;
		font-size: 28rpx;
		color: #808080;
	}
</style>