<template>
<view  :style="'padding-bottom:' + bottom ">
  	  <view class='zhanline'></view>
	  <uni-forms class='inform' :class="disabled?'disabledbox':''" ref="form" :rules="rules" :value="datainfo" >
	  			<view class="info_tit">开工信息</view>
	  			<uni-forms-item name="xmmc" style='margin-bottom: 0;'>
	  			 <view class="flexc infolist">
	  			  	<view class="f16 fw c34 flex0 pr pl12">项目名称</view>
	  			  	<input :disabled='disabled' placeholder="请输入项目名称" v-model="datainfo.xmmc"  class="f16  c34 flex1 txr"/>
	  			  </view> 
	  			</uni-forms-item>
	  			<uni-forms-item name="kgrq" style='margin-bottom: 0;'>
	  			 <view class="flexc infolist">
	  			  	<view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>开工日期</view>
	  			  	<picker :disabled='disabled' mode="date" :value="datainfo.kgrq" class="infolist_a" @change='bindDateChangea'>
	  					<view :class="datainfo.kgrq?'':'f16 co80'">{{datainfo.kgrq||"请选择开工日期"}}</view>
	  			  	</picker>
	  			  </view>
	  			</uni-forms-item>
	  			<uni-forms-item name="njgrq" style='margin-bottom: 0;'>
	  			 <view class="flexc infolist">
	  			  	<view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>拟竣工日期</view>
	  			  	<picker :disabled='disabled' mode="date" :value="datainfo.njgrq" class="infolist_a" @change='bindDateChangeb'>
	  					<view :class="datainfo.njgrq?'':'f16 co80'">{{datainfo.njgrq||"请选择拟竣工日期"}}</view>
	  			  	</picker>
	  			  </view>
	  			</uni-forms-item>
				<uni-forms-item name="sscrq" style='margin-bottom: 0;'>
				 <view class="flexc infolist">
				  	<view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>试生产日期</view>
				  	<picker :disabled='disabled' mode="date" :value="datainfo.sscrq" class="infolist_a" @change='bindDateChangec'>
						<view :class="datainfo.sscrq?'':'f16 co80'">{{datainfo.sscrq||"请选择试生产日期"}}</view>
				  	</picker>
				  </view>
				</uni-forms-item>
				<uni-forms-item name="ntcsj" style='margin-bottom: 0;'>
				 <view class="flexc infolist">
				  	<view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>拟投产日期</view>
				  	<picker :disabled='disabled' mode="date" :value="datainfo.ntcsj" class="infolist_a" @change='bindDateChanged'>
						<view :class="datainfo.ntcsj?'':'f16 co80'">{{datainfo.ntcsj||"请选择拟投产日期"}}</view>
				  	</picker>
				  </view>
				</uni-forms-item>
				<uni-forms-item name="rtsj" style='margin-bottom: 0;'>
				 <view class="flexc infolist" style="background-color: #ffffff;">
				  	<view class="f16 fw c34 flex0 pr pl12">入统日期</view>
				  	<picker mode="date" :value="datainfo.rtsj" class="infolist_a" @change='bindDateChangee'>
						<view :class="datainfo.rtsj?'':'f16 co80'">{{datainfo.rtsj||"请选择入统日期"}}</view>
				  	</picker>
					<view class="delpicker" v-if="datainfo.rtsj">
						<image :src="closedimg" class="closed" @click="datainfo.rtsj=''"></image>
					</view>
				  </view>
				</uni-forms-item>
				<uni-forms-item name="nrtsj" style='margin-bottom: 0;'>
				 <view class="flexc infolist" style="background-color: #ffffff;">
				  	<view class="f16 fw c34 flex0 pr pl12">拟入统日期</view>
				  	<picker mode="date" :value="datainfo.nrtsj" class="infolist_a" @change='bindDateChangef'>
						<view :class="datainfo.nrtsj?'':'f16 co80'">{{datainfo.nrtsj||"请选择拟入统日期"}}</view>
				  	</picker>
					<view class="delpicker" v-if="datainfo.nrtsj">
						<image :src="closedimg" class="closed" @click="datainfo.nrtsj=''"></image>
					</view>
					
				  </view>
				</uni-forms-item>
				<view class="border"></view>
				<view class="info_tit">进度照片</view>
				<uni-forms-item name="ziranren" style='margin-bottom: 0;'>
				 <view class="flexc infolist" style="background-color: #ffffff;">
					 <view class="flexc infolist_add" @click="getAddPhoto" v-if="checkPermi(['projectV2:rate:add'])">
						 <image :src="addimg"></image>
						 <view>新增进度照片</view>
					 </view>
				  	<view class="f16 fw c34 flex0 pr pl12">添加进度照片</view>
					<view class="flex1 txr flexc over ml8">
						<text class="flex1 f15 c34 over" v-if="datainfo.sbdw">{{datainfo.sbdw}}</text>
						<text class="f16 flex1 co80" v-else>请先选择添加进度照片</text>
						<!-- <view class="delimg flex0" >
							<image :src="delimg"></image>
						</view> -->
						<!-- <image :src="delimg" class="delimg"></image> -->
					</view>
				  </view>
				</uni-forms-item>
				<!-- 进度照片展示 -->
				<view class="qibox" >
					<view class="flexc infolist qi" v-for="(ite,idx) in ratelist" :key="'info-'+idx" @click="getDetailPhoto(ite)">
					 	<view class="f15 fw c34 flex0 pr pl12 ">{{ite.rateType}}</view>
						<view class="flex1 txr flexc over ml8">
							<text class="flex1 f15 c34 over">{{ite.jdDescribe}}/</text>
							<view class="flexc" style="justify-content: flex-end;">
								<view v-for="(pit,pid) in ite.photo" :key="'info1-'+pid" class="pholist">
									<image :src="baseUrl+pit"></image>
								</view>
							</view>
							
							<view class="delimg flex0" @click.stop="getDelRate(ite.id,idx)" v-if="checkPermi(['projectV2:rate:remove'])">
								<image :src="delimg"></image>
							</view>
							
						</view>
					 </view>
				</view>
				<view class="border"></view>
				<uni-forms-item name="czwt" style='margin-bottom: 0;'>
				 <view class="flexc infolist" style="align-items: flex-start;">
				  	<view class="f16 fw c34 flex0 pr pl12">存在问题</view>
					<uni-easyinput :inputBorder='false' type="textarea"  v-model="datainfo.czwt"  placeholder="请输入存在问题" placeholderStyle='text-align: right;font-size:32rpx;color:#808080'></uni-easyinput>
				  </view>
				</uni-forms-item>
				<uni-forms-item name="zsyzFjList" style='margin-bottom: 0;'>
					<view class="flexc infolist">
						<view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>附件</view>
						<view class="infolist_a co28" v-if="disabled">选择附件</view>
						<view class="infolist_a co28" v-else><lsj-upload
							    ref="lsjUpload"
							    childId="upload1"
							    :width="width"
							    :height="height"
							    :option="option"
							    :size="size"
							    :formats="formats"
							    :debug="debug"
							    :instantly="instantly"
							    @progress=""
								@uploadEnd="onuploadEnd" >
							        <view class="btn" :style="{width: width,height: height}">选择附件</view>
							</lsj-upload></view>
						</view>
				</uni-forms-item>
				<view class=" cldelistbf"  v-for="(ite,idx) in filelist" :key='idx'>
					<view class="flext f15 c6" @click="getDown(ite.path)">
						<view class="imgl"><image :src="wimg" ></image></view>
						<view>{{ite.fjName}}</view>
					</view>
					<!-- 删除 -->
					<view class="delimg flex0" @click.stop="getDelFj(idx)">
						<image :src="delimg"></image>
					</view>
				</view>
				<view class="infolist_b"><text>*</text>请上传大小不超过<text>100MB</text>格式为<text>doc/xls/ppt/txt/pdf/zip/rar/word</text>的文件</view>
				<view class="infolist_b" style="margin-top: 20rpx;"><text>*</text>土地证复印件/房屋租赁合同复印件、开工照片、项目开工申报表</view>
	  			<!-- 修改 -->
	  			<view v-if="checkPermi(['projectV2:kgxx:edit','projectV2:kgxx:add'])&&((progress==3&&xmStatus==2)||(progress==4&&xmStatus!=2))" class="infobtn flexcc cf f16 f500" @click="getSubmit">提交</view>
				<!-- 返回修改 -->
				<view v-if="checkPermi(['projectV2:kgxx:editKg'])&&(progress==4&&xmStatus==2||(progress==5&&xmStatus!=2))" class="infobtn flexcc cf f16 f500" @click="getSubmit">提交</view>
	  		</uni-forms>
	  	<!-- 弹框 -->
	  	<view class="bgbox" @click="getClose" v-if="addflag"></view>
	  	<view class="fixedbox" v-if="addflag">
	  		<image :src="closeimg" class="choseimg" @click="getClose"></image>
	  		<view class="top">添加进度照片</view>
	  		<view  class="boxs" style="padding: 60rpx 0;">
	  			<!-- 进度照片 -->
	  			<uni-forms ref="phoform" :rules="phorules" :value="phoinfo">
	  				<!-- <uni-forms-item name="companyName" style='margin-bottom: 0;'>
	  				 <view class="flexc infolist">
	  				  	<view class="f16 fw c34 flex0 pr pl12">时间</view>
	  				  	<picker mode="date" :value="phoinfo.nrtsj" class="infolist_a" @change='bindDateChangeg'>
	  				  		<view :class="phoinfo.nrtsj?'':'f16 co80'">{{phoinfo.nrtsj||"请选择拟入统日期"}}</view>
	  				  	</picker>
	  				  </view>
	  				</uni-forms-item> -->
	  				<uni-forms-item name="rateType" style='margin-bottom: 0;'>
	  				 <view class="flexc infolist">
	  				  	<view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>进度</view>
	  				  	<input  placeholder="请输入进度" v-model="phoinfo.rateType"  class="f16  c34 flex1 txr"/>
	  				  </view>
	  				</uni-forms-item>
	  				<uni-forms-item name="jdDescribe" style='margin-bottom: 0;'>
	  				 <view class="flexc infolist">
	  				  	<view class="f16 fw c34 flex0 pr pl12">描述</view>
	  				  	<input  placeholder="请输入描述详情" v-model="phoinfo.jdDescribe" class="f16  c34 flex1 txr"/>
	  				  </view>
	  				</uni-forms-item>
	  				<uni-forms-item name="photo" style='margin-bottom: 0;'>
	  					<view class="flexc infolist">
	  						<view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>照片</view>
	  					</view>
	  				</uni-forms-item>
					
					<view class="photoimg">
						<view class="photos" v-for="(item,index) in file" :key='index'>
							<view class="photolist" @click="getPreview(file,index)">
								<image :src="baseUrl+item" class="listimg"></image>
								<image :src="delimgs" class="del" @click.stop="delimgFn(index)" v-if="checkPermi(['projectV2:rate:add','projectV2:rate:edit'])"></image>
							</view>
						</view>
						<view class="photos" v-if="file.length<9&&checkPermi(['projectV2:rate:add','projectV2:rate:edit'])">
							<view class="photolist" @click.stop="getphotoFn">
								<image :src="addimgs" class="addimg"></image>
							</view>
						</view>
						
					</view>
	  				<!-- <view class=" cldelistbf" >
	  					<view class="flext f15 c6">
	  						<view class="imgl"><image :src="wimg" ></image></view>
	  						<view>照片名称fjName</view>
	  					</view>
	  					<view class="flexc f15 co28 flex0">
	  						<image :src="downimg" class="imgr"></image>预览
	  					</view>
	  				</view> -->
	  				
	  			</uni-forms>

	  		</view>
	  		<view class="fixedbtn mt20" @click="getyjSubmit" v-if="checkPermi(['projectV2:rate:add','projectV2:rate:edit'])">确认</view>
	  	</view>
  </view>
</template>

<script>
import {uploadmore} from '@/utils/common.js'
import {uploadPhoto} from '@/api/system/user.js'
import {getkgxxAddFn,getkgxxPutFn,getrateAddFn,getratePutFn,getrateDelFn,getrateListFn,gekgxxputKg} from "@/api/work/addclue.js"
import {getkgxxdetail} from "@/api/work/clue.js"
import config from '@/config'
  const baseUrl = config.baseUrl
  import { getToken } from '@/utils/auth'
  import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  export default {

    data() {
      return {
		  //附件
		    option: {
		          // 上传服务器地址，需要替换为你的接口地址
		          url: baseUrl+'/common/upload', // 该地址非真实路径，需替换为你项目自己的接口地址
		          // 上传附件的key
		          name: 'file',
		          // 根据你接口需求自定义请求头,默认不要写content-type,让浏览器自适配
		          header: {
		              // 示例参数可删除
		              'Authorization':  'Bearer ' + getToken(),
		          },
		          // 根据你接口需求自定义body参数
		          formData: {
		          }
		      },
		  // 选择文件后是否立即自动上传，true=选择后立即上传
		  instantly: true,
		  // 必传宽高且宽高应与slot宽高保持一致
		  width: '',
		  height: '48rpx',
		  // 限制允许上传的格式，空串=不限制，默认为空
		  formats: 'doc,docx,xls,ppt,txt,pdf,zip,rar,word',
		  // 文件上传大小限制
		  size: 100,
		  // 文件数量限制 默认10
		  count: 5,
		  // 文件回显列表
		  files: new Map(),
		  // 微信小程序Map对象for循环不显示，所以转成普通数组，不要问为什么，我也不知道
		  wxFiles: [],
		  // 是否打印日志
		  debug: false,
		  filelist:[], 
		  
		selectDate: '',
		defaultPhoneHeight: '', //屏幕默认高度
		nowPhoneHeight: '', //屏幕现在的高度
		bottom:0,
		type:1,
		baseUrl:'',
		datainfo:{
			"xmId":"",//项目ID
			"xmbh":"",//项目编号
			"xmmc":"",//项目名称
			"kgrq":"",//开工日期
			"njgrq":"",//拟竣工日期
			"sscrq":"",//试生产日期
			"ntcsj":"",//拟投产时间
			"rtsj":"",//入统时间
			"nrtsj":"",//拟入统时间
			"kggjrsjh":"",//开工跟进人手机号
			'czwt':'',//存在问题
			zsyzFjList:[],//附件地址
		},
		phoinfo:{
			photo:'',
			jdDescribe:'',
			rateType:'',
		},
		tanfalg:false,
		addflag:false,
		imageValue:[],
		closedimg:require("@/static/images/del.png"),
		addimg:require("@/static/images/mine/add.png"),
		addimgs:require('@/static/images/index/add.png'),
		delimg:require("@/static/images/mine/del.png"),
		delimgs:require("@/static/images/index/del.png"),
		checknimg:require("@/static/images/mine/jnicon.png"),
		bgimg:require("@/static/images/banner.png"),
		gcheckimg:require("@/static/images/mine/jicon.png"),
		closeimg:require('@/static/images/close.png'),
		wimg:require('@/static/images/index/wicon.png'),
		downimg:require('@/static/images/index/down.png'),
		rules: {
		  kgrq: {rules: [{required: true,errorMessage: '请选择开工日期'}]},
		  njgrq: {rules: [{required: true,errorMessage: '请选择拟竣工日期',}]},
		  sscrq: {rules: [{required: true,errorMessage: '请选择试生产日期' } ]},
		  ntcsj: {rules: [{required: true,errorMessage: '请选择拟投产日期'} ]},
		  zsyzFjList: {rules: [{required: true,errorMessage: '请上传附件'} ]},
		 
		},
		phorules:{
			rateType: {rules: [{required: true,errorMessage: '请输入进度'}]},
			photo: {rules: [{required: true,errorMessage: '请上传图片'}]},
			
		},

		map:{text:'label',value:'id'},
		
		file:[],
		images:[],
		pagetype:'add',
		ratelist:[],
		disabled:false,
		xmmc:'',
		progress:'',
		xmStatus:'',
	}
    },
	onLoad(e) {
		this.baseUrl=baseUrl;
		var newObj=JSON.parse(decodeURIComponent(e.data))
		this.pagetype=newObj.pagetype||'add';
		this.datainfo.xmId=newObj.xmId;
		this.datainfo.xmbh=newObj.xmbh;
		this.progress=newObj.progress||'';
		this.xmStatus=newObj.xmStatus||'';
		this.xmmc=newObj.xmmc;
		if(this.pagetype=='update'){
			// 获取详情 修改
			if(newObj.dis){
				this.disabled=true;
			}else{
				this.disabled=false;
			}
			this.init();
			this.getDataFn()
		}else{
			this.datainfo.xmmc=newObj.xmmc;
		}
	// #ifdef APP
		uni.onKeyboardHeightChange(res=> { //监听键盘高度变化
		    const res_keyboard = uni.getSystemInfoSync();
		    let key_height = res.height - (res_keyboard.screenHeight - res_keyboard.windowHeight)
		    // let key_height = res.height - (res_keyboard.screenHeight - res_keyboard.windowHeight + res_keyboard.safeAreaInsets.bottom)
		     this.bottom = `${ key_height>0 ? key_height : 0}px`; 
		})
		// #endif
	},
	onHide() {
	    // #ifdef APP-PLUS
	    uni.offKeyboardHeightChange();  // 取消监听键盘高度变化事件，避免内存消耗
	    // #endif
	},
    onReady() {
      // this.$refs.form.setRules(this.rules)
    },
    methods: {
		checkPermi, checkRole,
		// 开工详情
		getDataFn(){
			getkgxxdetail(this.datainfo.xmId).then(res=>{
				if(res.code==200){
					this.datainfo=res.data;
					this.datainfo.xmmc=this.xmmc;
					if(res.data.zsyzFjList&&res.data.zsyzFjList.length){
						this.filelist=JSON.parse(JSON.stringify(res.data.zsyzFjList))
					}
				}else{
					this.$toast(res.msg)
				}
			})
		},
		// 查看照片
		getPreview(iurl,idx) {
			var newArr=[];
			iurl.forEach(ite=>{
				var ds=this.baseUrl+ite
				newArr.push(ds)
			})
			uni.previewImage({
				urls: newArr,
				current:idx,
				success: function(data) {
					
				},
				fail: function(err) {
					console.log(err.errMsg);
				}
			});
		},
		init(){
			this.getRateList()//项目进度
		},
		bindDateChangea(e){//开工日期
			this.datainfo.kgrq=e.detail.value
		},
		bindDateChangeb(e){//拟竣工日期
			this.datainfo.njgrq=e.detail.value
		},
		bindDateChangec(e){//试生产日期
			this.datainfo.sscrq=e.detail.value
		},
		bindDateChanged(e){//拟投产日期
			this.datainfo.ntcsj=e.detail.value
		},
		bindDateChangee(e){//入统日期
			this.datainfo.rtsj=e.detail.value
		},
		bindDateChangef(e){//拟入统日期
			this.datainfo.nrtsj=e.detail.value
		},

		getAddPhoto(){
			this.phoinfo={
				photo:'',
				jdDescribe:'',
				rateType:'',
			};
			this.file=[];
			this.addflag=true;	
		},
		getDetailPhoto(ite){
			var newStr=JSON.parse(JSON.stringify(ite))
			this.phoinfo=newStr;
			this.file=newStr.photo;
			var newStr=newStr.photo.join(',');
			this.phoinfo.photo=newStr;
			this.addflag=true;
		},
		getDelRate(id,idx){ //删除进度
			var that=this;
			uni.showModal({
				title: '确认删除',
				content: "是否确认删除",
				cancelText: '取消',
				confirmText: '确认',
				success: function(res) {
					if (res.confirm) {
						// var params={
						// 	id:id
						// }
						getrateDelFn(id).then(res=>{
							if(res.code==200){
								that.$toast('删除成功')
				
								that.ratelist.splice(idx,1)
							}else{
								that.$toast(res.msg)
							}
						})	
					} else if (res.cancel) {
					}
				}
			});
		},
		// 项目列表
		getRateList(){
			var params={
				xmbh:this.datainfo.xmbh,
				xmId:this.datainfo.xmId
			}
			getrateListFn(params).then(res=>{
				if(res.code==200){
					// 
					var newArr=res.rows||[];
					if(newArr.length){
						newArr.forEach(ite=>{
							ite.photo=ite.photo.split(',')
						})
					}
					this.ratelist=newArr
					// if(res.rows.length){
					// 	this.qiziflag=true
					// }
				}else{
					this.$toast(res.msg)
				}
			})
		},
		getyjSubmit(){
			// 项目进度
			var that=this;
			this.$refs.phoform.validate().then(res => {
				var params=this.phoinfo;
				params.xmbh=this.datainfo.xmbh;
				params.xmId=this.datainfo.xmId;
				if(params.id){
					// 修改
					getratePutFn(params).then(res=>{
						if(res.code==200){
							this.$toast('修改成功');
							setTimeout(function(){
								that.addflag=false;
								// 获取列表
								that.getRateList()
							},1500)
							
						}else{
							this.$toast(res.msg)
						}
					})
				}else{
					// 新增
					getrateAddFn(params).then(res=>{
						if(res.code==200){
							this.$toast('添加成功');
							setTimeout(function(){
								that.addflag=false;
								// 获取列表
								that.getRateList()
							},1500)
							
						}else{
							this.$toast(res.msg)
						}
					})
				}
				
			})
		},
		delimgFn(e){
			var that = this;
			that.file.splice(e,1);
			this.phoinfo.photo=that.file.join(',')
		},
		getphotoFn(){
			let that = this;
			let file = that.file;
			if(file.length < 9){
				uni.chooseImage({
					count: 9 - parseInt(file.length),
					success:function(res){
						let img= res.tempFilePaths;
						if(img.length + file.length > 9){
							uni.showToast({
								title: '最多上传9张图片',
								icon: 'none',
								duration: 2000
							})
						}else{

							let imglen = res.tempFilePaths.length;
							var fuwufile = [];
							uploadmore('/common/upload',img,0,0,0,imglen,fuwufile,function(rs){
								that.file = that.file.concat(rs);
								that.phoinfo.photo=that.file.join(',')
								// console.log(that.phoinfo.photo,85)
							})	
						}
					}
				});
			}
		},
		getClose(){
			this.addflag=false;
		},
		getAddFn(){
			this.addflag=true;
		},
      getSubmit() {
			var that=this;
			this.datainfo.zsyzFjList=JSON.parse(JSON.stringify(this.filelist));
			this.$refs.form.validate().then(res => {
				var params=this.datainfo;
				// params.zsyzFjList=this.filelist
				if(!params.rtsj&&!params.nrtsj){
					this.$toast('请选择入统时间或者拟入统时间');
					return
				}
				if(this.pagetype=='add'){
					getkgxxAddFn(params).then(res=>{
						if(res.code==200){
							this.$toast('上报开工信息成功')	
							setTimeout(function() {
								uni.$emit('refreshdata');
								uni.navigateBack({delta: 1});
							},1500);
						}else{
							this.$toast(res.msg)
						}
						
					})
				}else{
					if(this.disabled){
						var obj={
							id:params.id,
							rtsj:params.rtsj,
							nrtsj:params.nrtsj,
							xmId:params.xmId
						}
						gekgxxputKg(obj).then(res=>{
							if(res.code==200){
								this.$toast('修改开工信息成功')	
								setTimeout(function() {
									uni.$emit('refreshdata');
									uni.navigateBack({delta: 1});
								},1500);
							}else{
								this.$toast(res.msg)
							}
							
						})
					}else{
						getkgxxPutFn(params).then(res=>{
							if(res.code==200){
								this.$toast('修改开工信息成功')	
								setTimeout(function() {
									uni.$emit('refreshdata');
									uni.navigateBack({delta: 1});
								},1500);
							}else{
								this.$toast(res.msg)
							}
							
						})
					}
					
				}
				
			})
      },
	  onuploadEnd(item) {
	  	var newobj={}
	  	var responseText=JSON.parse(item.responseText)
	  	newobj.fjName=responseText.originalFilename;
	  	newobj.path=responseText.fileName;
	  	this.filelist.push(newobj)
	  		this.datainfo.zsyzFjList=JSON.parse(JSON.stringify(this.filelist))
	  },
	  getDelFj(idx){
		  var that=this;
		  if(!this.disabled){
			  uni.showModal({
			  	title: '确认删除',
			  	content: "是否确认删除",
			  	cancelText: '取消',
			  	confirmText: '确认',
			  	success: function(res) {
			  		if (res.confirm) {
			  			that.filelist.splice(idx,1)
			  			that.datainfo.zsyzFjList=JSON.parse(JSON.stringify(that.filelist))
			  		} else if (res.cancel) {
			  		}
			  	}
			  });
		  }
	  },
	  getDown(e){
		  uni.showLoading({
		  	title: '加载中'
		  });
	  	var url=baseUrl+e;
	  	uni.downloadFile({
	  		url: url,//文件的下载路径
	  		success(result) {
				uni.hideLoading()
	  			var filePath = result.tempFilePath;
	  			   uni.openDocument({
	  			     filePath: filePath,
	  			     showMenu: true,
	  			     success: function (res) {
	  			       // console.log('打开文档成功');
	  			     }
	  			   });
	  		},
	  		fail(res) {uni.hideLoading()}
	  	})
	  },
    }
  }
</script>

<style lang="scss" scoped>
 .inform{padding-top: 30rpx; padding-bottom: 160rpx;}
  .infolist{padding: 30rpx 32rpx 30rpx 24rpx;position: relative;
	.cir{position: absolute;font-size: 36rpx;font-weight: bold;color: #FE5706;left: 0rpx;}
	// .delimg{width: 30rpx;height:30rpx;margin-left: 8rpx;}
  }
  .delimg{width: 40rpx;height:40rpx;margin-left: 16rpx;display: flex;align-items: center;justify-content: center;
  	image{width: 30rpx;height: 30rpx;}
  }
  .infobtn{width: 100%;height: 88rpx;background: #FA5F03;line-height: 88rpx;position: fixed;left: 0;right: 0;bottom: 0;z-index: 3;}
  .input_ye image{width: 34rpx;height: 18rpx;}
.info_tit{font-size: 32rpx;color: #FE5706;padding: 30rpx 26rpx;font-weight: bold;}
.infolist_a{height: 44rpx;flex: 1;text-align: right;font-size: 32rpx;color: #343434;}
.infolist_add{position: absolute;right: 0;top: -40rpx;font-size: 28rpx;color: #41C942;padding-right: 30rpx;
	image{width: 30rpx;height: 30rpx;margin-right: 20rpx;}
}
.fixedbtn{width:100%;height: 80rpx;background: #FF6400;
border-radius: 10rpx;display: flex;align-items: center;justify-content: center;font-size: 32rpx;font-weight: bold;color: #FFFFFF;
	&.btn1{background-color: #20ACCF;margin-bottom: 36rpx;}
	}
.fixedbox .infolist{padding: 30rpx 0;}
 .inform /deep/ .uni-forms-item__error{margin-top: -30rpx;margin-left: 24rpx;}
 .fixedbox /deep/ .uni-forms-item__error{margin-top: -30rpx;margin-left: 24rpx;}
.inform .pl12{margin-right: 10rpx;}
.fixedbox .pl12{margin-right: 10rpx;}
.pholist{
	display: flex;align-items: center;max-width: 220rpx;overflow: hidden;
	image{
		width: 44rpx;height: 44rpx;margin-left: 10rpx;flex: 0 0 auto;
	}
}
.disabledbox{
	.infolist{background-color: #F5f5f5;}
}
</style>
