<template>
<view  :style="'padding-bottom:' + bottom ">
  	  <view class='zhanline'></view>
	  <uni-forms class='inform '  ref="form" :rules="rules"  :value="datainfo" v-show="type==1">
	  			<!-- <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>
					<!-- <uni-easyinput v-model="datainfo.xmmc" placeholder="请输入项目名称" /> -->
	  			  	<input  placeholder="请输入项目名称"  v-model="datainfo.xmmc"  class="f16  c34 flex1 txr"/>
	  			  </view> 
	  			</uni-forms-item>
	  			<uni-forms-item name="dq" style='margin-bottom: 0;'>
					<view class="flexc infolist" @click="showPicker('dq')">
					 	<view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>地区</view>
							<view class="f16 c34 txr flex1">
							<view :class="datainfo.dq?'':'f16 co80'">{{datainfo.dq||"请选择地区"}}</view>
							</view>
					 </view>
	  			 <!-- <view class="flexc infolist" @click="showPicker('dq')">
	  			  	<view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>地区</view>
					<picker  range-key='dictLabel' :value="dqindex" :range="location" class="infolist_a" @change='bindDateChangec'>
						<view :class="datainfo.dq?'':'f16 co80'">{{datainfo.dq||"请选择地区"}}</view>
					</picker>
	  			  </view> -->
	  			</uni-forms-item>
	  			<uni-forms-item name="jsdw" 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="datainfo.jsdw"  class="f16  c34 flex1 txr"/>
	  			  </view>
	  			</uni-forms-item>
				<uni-forms-item name="xmbq" style='margin-bottom: 0;'>
					<view class="flexc infolist" @click="showPicker('xmbq')">
					 	<view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>项目标签</view>
							<view class="f16 c34 txr flex1">
							<view :class="datainfo.xmbq?'':'f16 co80'">{{datainfo.xmbq||"请选择项目标签"}}</view>
							<!-- <view :class="datainfo.xmbq?'':'f16 co80'">{{checkstring(datainfo.xmbq)||"请选择项目标签"}}</view> -->
							</view>
					 </view>
				<!-- <view class="flexc infolist">
				  	<view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>项目标签</view>
					<picker  range-key='dictLabel' :value="xmbqindex" :range="xmlabel" class="infolist_a" @change='bindDateChanged'>
						<view :class="datainfo.xmbq?'':'f16 co80'">{{datainfo.xmbq||"请选择项目标签"}}</view>
					</picker>
				  </view> -->
				</uni-forms-item>
				<view class="pfixedb flexc">
					<view class="cluebtn btn1" @click="getNext(1)">下一步</view>
					<view class="cluebtn btn2" @click="getSubmit">提交</view>
				</view>
	  			
	  		</uni-forms>
			<!-- 下一步 -->
			<!-- :rules="tworules" -->
			<uni-forms class='inform informtwo' ref="twoform"  :value="datainfo" v-show="type==2">
				<view class="info_tit">前期工作手续</view>
				<view class="infolist_b infolist_bt" style="display: block;margin-bottom: 20rpx;"><text>*</text>请上传大小不超过<text>100MB</text>格式为<text>doc/xls/ppt/txt/pdf/zip/rar/word</text>的文件</view>
				
				<!-- 循环 -->
				<block v-for="(lite,lidx) in fjtitlist" :key="'fjtit-'+lidx">
					<uni-forms-item name="fjList" style='margin-bottom: 0;'>
						<view class="flexc infolist">
							<view class="f16 fw c34 flex1 pr">{{lite.tit}}</view>
							<view class="infolist_a co28">
								<view class="infolist_yj" v-if="checkPermi(['fgw:xmxq:fjcb'])" @click="getCbFn(lite.tit)">一键催报</view>
								<view class="btn" @click="getUpdate(lite.type)" v-if="lite.isSh!=2">上传文件</view>
								<!-- <lsj-upload ref="lsjUpload" v-if="lite.isSh!=2" :xmtype='lite.type' @getFile="getFile" 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>
					<block v-for="(ite,idx) in filelist" :key="'f-'+idx" >
						<view class=" cldelistbf"  v-if="ite.type==lite.type">
							<view class="flext f15 c6" @click="getDown(ite.path)">
								<view class="imgl"><image :src="wimg" ></image></view>
								<view class="wordb">{{ite.fjName}}</view>
								
							</view>
							<view class="f14 c6 ml10 mr10">{{ite.createTime}}</view>
							<text v-if="ite.isSh==1" class="f16 c6">待审核</text>
							<text v-if="ite.isSh==2" class="f16 co26">已通过</text>
							<text v-if="ite.isSh==3" class="f16 cof1">未通过</text>
							<view class="delimg flex0" @click.stop="getDelFj(idx)" v-if="ite.isSh!=2">
								<image :src="delimg"></image>
							</view>
						</view>
					</block>
				</block>
				<view class="pfixedb flexc">
					<view class="cluebtn btn1" @click="getNext(2)">下一步</view>
					<view class="cluebtn btn2" @click="getSubmit">提交</view>
				</view>
			</uni-forms>
			<uni-forms class='inform '  ref="threeform"   :value="datainfo" v-show="type==3">
				<view class="info_tit">其他信息</view>
				<uni-forms-item name="jhkgsj" style='margin-bottom: 0;'>
				 <view class="flexc infolist">
				  	<view class="f16 fw c34 flex0 pr pl12">计划开工时间</view>
				  	<picker mode="date" :value="datainfo.jhkgsj" class="infolist_a" @change='bindDateChangetimec'>
						<view :class="datainfo.jhkgsj?'':'f16 co80'">{{datainfo.jhkgsj||"请选择计划开工时间"}}</view>
				  	</picker>
				  </view>
				</uni-forms-item>
					<uni-forms-item name="kgsj" style='margin-bottom: 0;'>
					 <view class="flexc infolist">
					  	<view class="f16 fw c34 flex0 pr pl12">实际开工时间</view>
					  	<picker mode="date" :value="datainfo.kgsj" class="infolist_a" @change='bindDateChangetimea'>
							<view :class="datainfo.kgsj?'':'f16 co80'">{{datainfo.kgsj||"请选择实际开工时间"}}</view>
					  	</picker>
					  </view>
					</uni-forms-item>
					<uni-forms-item name="njgsj" style='margin-bottom: 0;'>
					 <view class="flexc infolist">
					  	<view class="f16 fw c34 flex0 pr pl12">计划竣工时间</view>
					  	<picker mode="date" :value="datainfo.njgsj" class="infolist_a" @change='bindDateChangetimed'>
							<view :class="datainfo.njgsj?'':'f16 co80'">{{datainfo.njgsj||"请选择计划竣工时间"}}</view>
					  	</picker>
					  </view>
					</uni-forms-item>
					<uni-forms-item name="jgsj" style='margin-bottom: 0;'>
					 <view class="flexc infolist">
					  	<view class="f16 fw c34 flex0 pr pl12">实际竣工时间</view>
					  	<picker mode="date" :value="datainfo.jgsj"  class="infolist_a" @change='bindDateChangetimee'>
							<view :class="datainfo.jgsj?'':'f16 co80'">{{datainfo.jgsj||"请选择实际竣工时间"}}</view>
					  	</picker>
					  </view>
					</uni-forms-item>
					<uni-forms-item name="ntsj" style='margin-bottom: 0;'>
					 <view class="flexc infolist">
					  	<view class="f16 fw c34 flex0 pr pl12">纳统时间</view>
					  	<picker mode="date" :value="datainfo.ntsj"  class="infolist_a" @change='bindDateChangetimeb'>
							<view :class="datainfo.ntsj?'':'f16 co80'">{{datainfo.ntsj||"请选择纳统时间"}}</view>
					  	</picker>
					  </view>
					</uni-forms-item>
					<uni-forms-item name="nttz" style='margin-bottom: 0;'>
					 <view class="flexc infolist">
					  	<view class="f16 fw c34 flex0 pr pl12">项目最近投资(万元)</view>
					  	<input  placeholder="请输入项目最近一次投资" v-model="datainfo.nttz"   class="f16  c34 flex1 txr"/>
					  </view>
					</uni-forms-item>
					<uni-forms-item name="ntxmtc" style='margin-bottom: 0;'>
					 <view class="flexc infolist">
					  	<view class="f16 fw c34 flex0 pr pl12">项目累计投资(万元)</view>
					  	<input  placeholder="请输入项目累计完成投资" v-model="datainfo.ntxmtc"   class="f16  c34 flex1 txr"/>
					  </view>
					</uni-forms-item>
					<!-- <uni-forms-item name="ntxmtc" style='margin-bottom: 0;'>
					 <view class="flexc infolist">
					  	<view class="f16 fw c34 flex0 pr pl12">纳统项目完成投资(万元)</view>
					  	<input  placeholder="请输入纳统项目完成投资" v-model="datainfo.ntxmtc"   class="f16  c34 flex1 txr"/>
					  </view>
					</uni-forms-item> -->
					<view class="border"></view>
					<uni-forms-item name="remark" style='margin-bottom: 0;'>
					 <view class="flexc infolist">
					  	<view class="f16 fw c34 flex0 pr pl12">备注</view>
					  	<input  placeholder="请输入备注信息" v-model="datainfo.remark"    class="f16  c34 flex1 txr"/>
					  </view>
					</uni-forms-item>
					
					<view class="pfixedb flexc">
						<view class="cluebtn btn2" @click="getSubmit">提交</view>
					</view>
				</uni-forms>
				<!-- 弹框 -->
			<view class="bgbox" v-if="cbflag||scflag"></view>
			<view class="fixedbox inform" v-if="cbflag" style="padding-bottom: 80rpx;">
				<image :src="closeimg" class="choseimg" @click="getClose"></image>
				<view class="top">时间</view>
				<view class="boxs">
					<view class="box">
						<view class="flexc flex1 infolist" >
						 	<view class="f16 fw c34 flex0 pr">催办时限</view>
						 	<picker mode="date" :value="cbtime" class="infolist_a" @change='bindDateChangetimecb'>
									<view :class="cbtime?'':'f16 co80'">{{cbtime||"请选择催办时限"}}</view>
						 	</picker>
							<image :src="rimg" class="rimg"></image>
						 </view>
					</view>
				</view>
				<view class="fixedbtn" @click="getcuisuimit">提交</view>			
			</view>
			<!-- 上传时间 -->
			<view class="fixedbox inform" v-if="scflag" style="padding-bottom: 80rpx;">
				<image :src="closeimg" class="choseimg" @click="getClose"></image>
				<view class="top">时间</view>
				<view class="boxs">
					<view class="box">
						<view class="flexc flex1 infolist" >
						 	<view class="f16 fw c34 flex0 pr">上传时间</view>
						 	<picker mode="date" :value="createTime" class="infolist_a" @change='bindDateChangetimecc'>
									<view :class="createTime?'':'f16 co80'">{{createTime||"请选择时间"}}</view>
						 	</picker>
							<image :src="rimg" class="rimg"></image>
						 </view>
					</view>
				</view>
				<!-- v-if="lite.isSh!=2" @getFile="getFile"-->
				<lsj-upload ref="lsjUpload" style="display: block;" v-if="createTime"    childId="upload1" :width="width"  :height="height"  :option="option"   :size="size" :formats="formats" :debug="debug" :instantly="instantly" @progress="" @uploadEnd="onuploadEnd" >
				        <view class="fixedbtn" :style="{width: width,height: height}" >上传文件</view>
				</lsj-upload>
				<view class="fixedbtn" @click="getsure" v-else>提交</view>			
			</view>
		<bartree-pickerfixed deptType='1' ref="treePickerdq" :map="map" :mvalue="adtbgvalue" :multiple='true' @select-change="selectChangedq" title="选择地区"
		:localdata="location"></bartree-pickerfixed>
		<bartree-pickerfixed ref="treePickerxmbq" deptType='2' :map="map" :mvalue="xmbqbgvalue" :multiple='true' @select-change="selectChangexmbq" title="选择项目标签"
		:localdata="xmlabel" ></bartree-pickerfixed>
  </view>
</template>

<script>
import bartreePickerfixed from "@/components/ba-tree-picker/danpicker.vue"
import { getDictionaryFn} from '@/api/work/index.js'
import {selectDictLabel} from "@/utils/common.js"
import {getxmsbDetail,getxmsbPutFn} from '@/api/zdwork/addclue.js'
import {getxmfjcbFn} from "@/api/zdwork/clue.js"
import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
 import config from '@/config'
  const baseUrl = config.baseUrl
  import { getToken } from '@/utils/auth'
  export default {
	components:{
		bartreePickerfixed
	},
    data() {
      return {
		  //附件
		    option: {
		          // 上传服务器地址，需要替换为你的接口地址
		          url: baseUrl+'/common/upload', // 该地址非真实路径，需替换为你项目自己的接口地址
		          // 上传附件的key
		          name: 'file',
		          // 根据你接口需求自定义请求头,默认不要写content-type,让浏览器自适配
		          header: {
		              // 示例参数可删除
		              'Authorization':  'Bearer ' + getToken(),
		          },
		          // 根据你接口需求自定义body参数
		          formData: {
		          }
		      },
		  // 选择文件后是否立即自动上传，true=选择后立即上传
		  instantly: true,
		  // 必传宽高且宽高应与slot宽高保持一致
		  width: '',
		  height: '80rpx',
		  // 限制允许上传的格式，空串=不限制，默认为空
		  formats: 'doc,docx,xls,ppt,txt,pdf,zip,rar,word',
		  // 文件上传大小限制
		  size: 100,
		  // 文件数量限制 默认10
		  count: 5,
		  // 文件回显列表
		  files: new Map(),
		  // 微信小程序Map对象for循环不显示，所以转成普通数组，不要问为什么，我也不知道
		  wxFiles: [],
		  // 是否打印日志
		  debug: false,
		  filelist:[], 
		  filetype:0,
		  
		selectDate: '',
		defaultPhoneHeight: '', //屏幕默认高度
		nowPhoneHeight: '', //屏幕现在的高度
		bottom:0,
		type:1,
		datainfo:{
			"id":"",
			"xmmc":"",//项目名称
			"dq":"",//地区
			"jsdw":"",//建设单位
			"jsDeptId":"",//建设部门id
			"deptId":"",//申报部门id
			"userId":"",//申报人id
			"kgsj":"",//开工时间
			"jhkgsj":"",//计划开工时间
			"jgsj":"",//竣工时间
			"njgsj":"",//计划竣工时间
			"ntsj":"",//纳统时间
			"ntxmtc":"",//纳统项目完成投资
			"nttz":"",//纳统项目最近一次投资
			"xmbq":'',//项目标签
			
			fjList:[],//附件
		},
		tanfalg:false,
		scflag:false,
		createTime:'',
		addimg:require("@/static/images/mine/add.png"),
		delimg:require("@/static/images/mine/del.png"),
		checknimg:require("@/static/images/mine/jnicon.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'),
		rimg:require("@/static/images/mine/rimg.png"),
		rules: {
		  xmmc: {rules: [{required: true,errorMessage: '请输入项目名称'}]},
		  dq: {rules: [{required: true,errorMessage: '请输入地区',}]},
		  jsdw: {rules: [{required: true,errorMessage: '请输入建设单位' } ]},
		  xmbq: {rules: [{required: true,errorMessage: '请选择项目标签' } ]},
		},
		currentdate:'',//当天日期
		pagetype:'add',
		location:[],//你落户地
		xmlabel:[],//项目标签
		dqindex:0,
		xmbqindex:0,
		cbflag:false,
		checktype:'',//选择的是哪个
		cbtit:'',//催报项
		cbtime:'',//催办时间,
		map:{text:'dictLabel',value:'dictValue'},
		adtbgvalue:[],
		xmbqbgvalue:[],
		fjtitlist:[{tit:'节能审查',type:'1'},{tit:'用地预审与选址意见书',type:'2'},{tit:'核准/备案',type:'3'},{tit:'建议书批复',type:'4'},{tit:'可研批复',type:'5'},{tit:'初步设计批复',type:'6'},{tit:'环境影响评价',type:'7'},{tit:'生态红线不可避让论证',type:'8'},{tit:'建设用地规划许可证',type:'9'},{tit:'建设工程规划许可证',type:'10'},{tit:'农用地转用和土地征收批复',type:'11'},{tit:'划拨决定书',type:'12'},{tit:'土地出让合同',type:'13'},{tit:'不动产权证',type:'14'},{tit:'工程招投标',type:'15'},{tit:'施工许可证',type:'16'},{tit:'竣工资料',type:'17'},]
	}
    },
	onLoad(e) {
		this.currentdate = this.getNowFormatDate();
		var newObj=JSON.parse(decodeURIComponent(e.data))
		
		// console.log(newObj,123)
		this.getinvestmentarea()
		this.pagetype=newObj.pagetype||'add';
		this.datainfo.id=newObj.id;
		this.datainfo.xmmc=newObj.xmmc;
		if(this.pagetype=='update'){
			// 获取详情 修改
			this.getDataFn()
		}else{
		
		}
	// #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,
		checkstring(e){
			// var newArr=[];
			// e.forEach((ite,idx)=>{
			// 	newArr[idx]=ite.deptName
			// })
			// return newArr.join(',')
		},
		getUpdate(e){
			this.scflag=true;
			this.createTime=this.currentdate;
			this.filetype=e
		},
		showPicker(e) {
			this.checktype=e;
			if(e=='dq'){
				this.$refs.treePickerdq._show();
			}else if(e=='xmbq'){
				this.$refs.treePickerxmbq._show();
			}  
		 },
		selectChangedq(e){
			var newarr=e;
			var newarrs=[]
			newarr.forEach(ite=>{
				newarrs.push(ite.dictLabel)
			})
			this.datainfo.dq=newarrs.join(',')
		},
		selectChangexmbq(e){
			var newarr=e;
			var newarrs=[]
			newarr.forEach(ite=>{
				newarrs.push(ite.dictLabel)
			})
			this.datainfo.xmbq=newarrs.join(',')

			// var val=e;
// this.fgwJdapXtDwList=JSON.parse(JSON.stringify(val))
		},
		getClose(){
			this.cbflag=false;
			this.scflag=false;
		},
		getCbFn(e){
			this.cbtit=e;
			this.cbflag=true;
		},
		// 项目详情
		getDataFn(){
			var that=this;
			getxmsbDetail(this.datainfo.id).then(res=>{
				if(res.code==200){
					this.datainfo=res.data;
					if(res.data.fjList&&res.data.fjList.length){
						this.filelist=JSON.parse(JSON.stringify(res.data.fjList))
						//控制上传的显示与隐藏
						// var newArr=this.fjtitlist;
						var filelist=res.data.fjList
						filelist.forEach((ite,idx)=>{
							Object.keys(this.fjtitlist).some((key) => {
								if (this.fjtitlist[key].type == ('' + ite.type)) {
									this.fjtitlist[key].isSh=ite.isSh;
									return true;
								}
								
							})
						})
						// this.fjtitlist=JSON.parse(JSON.stringify(newArr))
						
					}
					// 拟落户地
					var adrbgchose=this.datainfo.dq.split(',')
					var adrbglaber=adrbgchose.join('/');
					var backgrounArr=[];
					adrbgchose.forEach(ite=>{
						var pronum = Number(selectDictLabel(that.location,ite))
						backgrounArr.push(pronum)
					})
					this.adtbgvalue=backgrounArr;
					
					// 项目标签
					var xmbqbgchose=this.datainfo.xmbq.split(',')
					var xmbqbglaber=xmbqbgchose.join('/');
					var xmbqbackgrounArr=[];
					xmbqbgchose.forEach(ite=>{
						var pronum = Number(selectDictLabel(that.xmlabel,ite))
						xmbqbackgrounArr.push(pronum)
					})
					this.xmbqbgvalue=xmbqbackgrounArr;
					// for(var i=0;i<that.xmlabel.length;i++){
					// 	if(that.xmlabel[i].dictLabel==this.datainfo.xmbq){
					// 		this.xmbqbgvalue=Number(i)
					// 		break;
					// 	}
					// }
				}else{
					this.$toast(res.msg)
				}
			})
		},
		// 字典值
		getinvestmentarea(){
			// 拟落户地
			getDictionaryFn('proposed_location').then(res=>{
				if(res.code==200){
					this.location = res.data.map(v => {
						return {
							dictLabel: v.dictLabel,
							dictValue: Number(v.dictValue)
						}
					})
					// console.log(this.location,123)
				}
			})
			//项目标签
			getDictionaryFn('project_label').then(res=>{
				if(res.code==200){
					this.xmlabel = res.data.map(v => {
						return {
							dictLabel: v.dictLabel,
							dictValue: Number(v.dictValue)
						}
					})
				}
			})
		},
		// 拟落户地location
		bindDateChangec(e) {
			var val=e.detail.value;
			this.datainfo.dq=this.location[val].dictLabel
		},
		//项目标签
		bindDateChanged(e) {
			var val=e.detail.value;
			this.datainfo.xmbq=this.xmlabel[val].dictLabel;
		},
		getNowFormatDate(){
			let date = new Date();
			let y = date.getFullYear();
			let m = date.getMonth() + 1;
			m = m < 10 ? "0" + m : m;
			let d = date.getDate();
			d = d < 10 ? "0" + d : d;
			const timeday = y + "-" + m + "-" + d;
			return timeday;
		},
		
		bindDateChangetimea(e){//开工时间
			this.datainfo.kgsj=e.detail.value
		},
		bindDateChangetimeb(e){//纳统时间
			this.datainfo.ntsj=e.detail.value
		},
		bindDateChangetimec(e){//计划开工时间
			this.datainfo.jhkgsj=e.detail.value
		},
		bindDateChangetimed(e){//计划竣工时间
			this.datainfo.njgsj=e.detail.value
		},
		bindDateChangetimee(e){//实际竣工时间
			this.datainfo.jgsj=e.detail.value
		},
		bindDateChangetimecb(e){
			this.cbtime=e.detail.value
		},
		bindDateChangetimecc(e){
			this.createTime=e.detail.value
		},
		getcuisuimit(){
			var parasm={
				id:this.datainfo.id,
				time:this.cbtime,
				name:this.cbtit,
			}
			if(!this.cbtime){
				this.$toast('请选择催办时限')
				return
			}
			getxmfjcbFn(parasm).then(res=>{
				if(res.code==200){
					this.$toast('催办成功')	
					this.cbflag=false;
				}else{
					this.$toast(res.msg)
				}
			})
		},
		getNext(idx){
			if(idx==1){
				this.$refs.form.validate().then(res => {
					this.type=2;
				})
			}else if(idx==2){
				this.type=3;
			}
			
		},
      getSubmit() {
			var that=this;
			this.datainfo.fjList=JSON.parse(JSON.stringify(this.filelist));
			this.$refs.form.validate().then(res => {
				// 第一步可提交
				var params=this.datainfo;
				var str='新增前期工作手续成功'
				if(this.pagetype=='update'){
					str='修改前期工作手续成功'
				}
				// 都是走修改信息
				getxmsbPutFn(params).then(res=>{
					if(res.code==200){
						that.$toast(str)	
						setTimeout(function() {
							uni.$emit('refreshdatazd');
							uni.$emit('refreshdatalistzd');
							uni.navigateBack({delta: 1});
						},1500);
					}else{
						this.$toast(res.msg)
					}
				})
			})
      },
	  getsure(){
		 if(!this.createTime){
			 this.$toast('请选择时间')
			 return
		 } 
	  },
	  getFile(idx){
		 this.filetype=idx 
	  },
	  onuploadEnd(item) {
	  	var newobj={}
	  	var responseText=JSON.parse(item.responseText)
	  	newobj.fjName=responseText.originalFilename;
	  	newobj.path=responseText.fileName;
		
		newobj.xmId=this.datainfo.id;
		newobj.xmmc=this.datainfo.xmmc;
		newobj.type= this.filetype;
		newobj.createTime= this.createTime;
	  	this.filelist.push(newobj)
		this.scflag=false;
		this.datainfo.fjList=JSON.parse(JSON.stringify(this.filelist))
	  },
	  getDelFj(idx){
	  	this.filelist.splice(idx,1)
		this.datainfo.fjList=JSON.parse(JSON.stringify(this.filelist))
	  },
	  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) {
	  			     }
	  			   });
	  		},
	  		fail(res) {uni.hideLoading()}
	  	})
	  },
    }
  }
</script>

<style lang="scss" scoped>
 .inform{padding-top: 30rpx; padding-bottom: 160rpx;}
  .infolist{padding: 30rpx 32rpx 20rpx 24rpx;position: relative;
	.cir{position: absolute;font-size: 36rpx;font-weight: bold;color: #FE5706;left: 0rpx;}
  }
  .delimg{width: 40rpx;height:40rpx;margin-left: 20rpx;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;
	view{line-height: 44rpx;}
}
.rimg{width: 14rpx;height: 28rpx;flex: 0 0 auto;margin-left: 10rpx;}
.informtwo{
	.infolist_a{display: flex;align-items: center;justify-content: end;flex:0 0 auto;margin-left: 12rpx;
		.infolist_yj{margin-right: 16rpx;color: #FA5F03;height: 48rpx;padding: 0 4rpx;}
	}
}

 .inform /deep/ .uni-forms-item__error{margin-top: -30rpx;margin-left: 24rpx;}
.inform .pl12{margin-right: 10rpx;}
.fixedbox .pl12{margin-right: 10rpx;}

.cluebtn{
	display: flex;align-items: center;justify-content: center;font-weight: bold;font-size: 32rpx;color: #ffff;height: 100rpx;
	&.btn1{background-color: #1FB9F7;flex: 1;}
	&.btn2{background-color:#FF6400;flex: 1;}
}
.infolist_bt{margin: 0rpx 0 30rpx;display: none;}
.fixedbox{
	.infolist{padding: 30rpx 0 20rpx;}
	.infolist_a{align-items: center;}
}
.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;}
	}
.boxs{padding: 60rpx 0;
	.box{display: flex;align-items: center;min-height:100rpx;}
}

.cldelistbf {
	.flext{flex: 1;margin-right: 16rpx;}
	// .clder{display: flex;align-items: center;font-size: 32rpx;color: #28C529;flex: 0 0 auto;margin-left: 20rpx;}
}
</style>
