<template>
  <view>
	<view v-if="datalist.length>0">
		<!-- 我的提案 -->
			<view class="caselist" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite)">
				<view class="tit overtwo" v-if="type=='wdfy'||type=='hyfy'">{{ite.speakTitle}}</view>
				<view class="tit overtwo" v-else-if="type=='hdtz'||type=='zxhd'">{{ite.activityTitle}}</view>
				<view class="tit overtwo" v-else-if="type=='zsyz'||type=='wdzs'">{{ite.clueName}}</view>
				<view  class="flexcj mb20" v-else>
					<view class="tit overtwo" style="margin-bottom: 0;">{{ite.conferenceTitle}}</view>
					<image :src="codeimg" v-if="type=='hyhd'" class='codeimg' @click.stop="getTuiFn(ite,'qdm')"></image>
				</view>
				<block v-if="type=='hytz'||type=='hyhd'">
					<view class="ftxt">
						<text>会议时间</text>
						<view>{{ite.conferenceDate}} {{ite.conferenceTime}}</view>
					</view>
					<view class="ftxt">
						<text>会议地点</text>
						<view>{{ite.conferenceAddress}}</view>
					</view>
					<view class="ftxt" >
						<text>发布时间</text>
						<view>{{ite.publishTime}}</view>
					</view>
					<view class="ftxt">
						<text>备注信息</text>
						<view>{{ite.remark}}</view>
					</view>
					<view class="casebtn flexc" v-if="type=='hyhd'">
						<view class="lfread">未读人数({{ite.noRead}})<text class="lfdet">已读人数({{ite.read}})</text></view>
						<view class="co1d" v-if="checkPermi(['zxConference:conference:getUserInfo'])" @click.stop="getReadFn(ite.conferenceId)">查看阅读详情</view>
					</view>
					<view class="casebtn  flexc" v-if="type=='hytz'&&checkPermi(['zxConference:conference:updateReply'])">
						<block v-if="ite.isJoin">
							<view class="lftit">是否参会已答复，查看<text class="lfdet" @click.stop="getDfFn(ite)">答复内容</text></view>
							<view class="btn btn3" @click.stop="">已答复</view>
						</block>
						<block v-else>
							<view class="lftit">是否成参会暂未答复</view>
							<view class="btn btn2"  @click.stop="getTuiFn(ite,'chdf')">参会答复</view>
						</block>
						<view v-if="ite.isJoin=='Y'&&ite.zxConferenceUserList[0]&&!ite.zxConferenceUserList[0].signIn" class="btn btn2" @click.stop="getTuiFn(ite,'hyqd')">去签到</view>
						<view class="btn btn3" v-if="ite.zxConferenceUserList[0].signIn" @click.stop="">已签到</view>	
							<!-- <view class="lftit">当前会议已结束，查看<text class="lfdet">签到情况</text></view> -->	
					</view>
				</block>
				<block v-if="type=='hdtz'||type=='zxhd'">
					<view class="ftxt">
						<text>活动时间</text>
						<view>{{ite.activityDate}}</view>
					</view>
					<view class="ftxt">
						<text>活动类型</text>
						<view>{{kaType(ite.activityType,hdlxlist)}}</view>
					</view>
					<view class="ftxt">
						<text>活动地点</text>
						<view>{{ite.activityAddress}}</view>
					</view>
					<view class="ftxt" >
						<text>发布时间</text>
						<view>{{ite.publishTime}}</view>
					</view>
					<view class="ftxt">
						<text>活动内容</text>
						<!-- <view>{{ite.activityDetails}}</view> -->
						<view class="over">
							<rich-text v-if="ite.activityDetails" :nodes="ite.activityDetails"></rich-text>
						</view>
					</view>
					<view class="casebtn flexc" v-if="type=='zxhd'">
						<view class="lfread">未读人数({{ite.noRead}})<text class="lfdet">已读人数({{ite.read}})</text></view>
						<view class="co1d" v-if="checkPermi(['zxActivity:activity:getUserInfo'])"  @click.stop="getReadFn(ite.activityId)">查看阅读详情</view>
					</view>
					<view class="casebtn  flexc" v-if="checkPermi(['zxActivity:activity:updateReply'])&&type=='hdtz'">
						<block v-if="ite.isJoin">
							<view class="lftit">是否参会已答复，查看<text class="lfdet" @click.stop="getDfFn(ite)">答复内容</text></view>
							<view class="btn btn3" @click.stop="">已答复</view>
						</block>
						<block v-else>
							<view class="lftit">是否成参会暂未答复</view>
							<view class="btn btn2"  @click.stop="getTuiFn(ite,'chdf')">参会答复</view>
						</block>
						<!-- <view v-if="ite.isJoin=='Y'&&!ite.signIn" class="btn btn2" @click.stop="getTuiFn(ite,'hyhd')">去签到</view>
						<view class="btn btn3" v-if="ite.signIn" @click.stop="">已签到</view>	 -->
							<!-- <view class="lftit">当前会议已结束，查看<text class="lfdet">签到情况</text></view> -->	
					</view>
				</block>
				
				<block v-if="type=='wdfy'||type=='hyfy'">
					<view class="flexcw" >
						<view class="ftxt">
							<text>发言人</text>
							<view>{{ite.name}}</view>
						</view>
						<view class="ftxt">
							<text>录入人</text>
							<view>{{ite.inputName}}</view>
						</view>
					</view>
					<view class="ftxt">
						<text>关联会议</text>
						<view>{{ite.conferenceTitle}}</view>
					</view>
					<view class="ftxt">
						<text>发言单位</text>
						<view>{{ite.speakUnit}}</view>
					</view>
					<view class="ftxt">
						<text>发言类型</text>
						<view>{{kaType(ite.speakType,fylxlist)}}</view>
					</view>
					<view class="ftxt">
						<text>录入时间</text>
						<view>{{ite.createTime}}</view>
					</view>
					<!-- <view class="ftxt">
						<text>审核状态</text>
						<view class="co0b">{{ite.speakStatus==2?'已审核':'待审核'}}</view>
					</view> -->
				</block>
				<block v-if="type=='zsyz'||type=='wdzs'">
					<view class="flexcw" >
						<view class="ftxt">
							<text>委员姓名</text>
							<view>{{ite.name}}</view>
						</view>
						<view class="ftxt">
							<text>拟投资额</text>
							<view>{{ite.investmentAmount}}万元</view>
						</view>
					</view>
					<view class="ftxt">
						<text>联系人</text>
						<view>{{ite.contactsName}}</view>
					</view>
					<view class="ftxt">
						<text>联系方式</text>
						<view>{{ite.contactsPhone}}</view>
					</view>
					<view class="ftxt">
						<text>录入时间</text>
						<view>{{ite.publishTime}}</view>
					</view>
					<view class="ftxt">
						<text>状态</text>
						<view class="co0b">{{kaType(ite.type,xsztlist)}}</view>
					</view>
				</block>
				<!-- 会议活动，活动通知管理员 -->
				
				
				<!-- 答复情况 签到-->
				
				<!-- <view class="casebtn flexc" >
					<view class="btn btn1" @click.stop="getTuiFn(ite,'scfk','1')">删除</view>
					<view class="btn btn2" @click.stop="getTuiFn(ite,'scfk','0')">修改</view>
				</view> -->
			</view>
		<!-- <block v-if="type">
		</block> -->
		<view class="shax" v-if="wtdt">{{wtdt}}</view>
	</view>
	<block v-else>
		<no-data></no-data>
	</block>
	<!-- 弹窗 -->
	<view class="bgbox" @click="getClose" v-if="dfflag"></view>
	<view class="fixedbox" v-if="dfflag">
		<view class="ttit">提示</view>
		<view  class="boxs">
			<view class="ftxt">
				<text>是否参会</text>
				<view>{{info.isJoin=='Y'?'是':'否'}}</view>
			</view>
			<view class="ftxt">
				<text>请假类型</text>
				<view>{{kaType(info.leaveType,qjlxlist)}}</view>
			</view>
			<view class="ftxt">
				<text>请假事由</text>
				<view>{{info.leaveReason}}</view>
			</view>
			<view class="fixedbtn flexcj">
				<view class="btns btn1" @click.stop="getClose">取消</view>
				<!-- <view class="btns btn2" @click.stop="getTuiFn(info,'chdf')">重新答复</view> -->
			</view>
		</view>
		
	</view>
  </view>
</template>

<script>
	import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
	import { selectValue } from '@/utils/common.js';
	import noData from "@/components/nodata/nodata.vue"
  export default {
	props:{
		datalist: {
			type: Array,
			default () {
				return []
			}
		},
		wtdt:{
			type: String,
			default () {
				return ''
			}
		},
		type:{
			type: [String,Number],
			default () {
				return ''
			}
		},
		hdlxlist:{
			type: Array,
			default () {
				return []
			}
		},
		xsztlist:{
			type: Array,
			default () {
				return []
			}
		},
		listtype:{
			type: [String,Number],
			default () {
				return ''
			}
		},
		fylxlist:{
			type: Array,
			default () {
				return []
			}
		},	
		qjlxlist:{
			type: Array,
			default () {
				return []
			}
		}
	},
	components:{
		noData
	},
	data(){
		return{
			start:require("@/work/static/images/start.png"),
			nstart:require("@/work/static/images/nstart.png"),
			zanimg:require("@/work/static/images/zanico.png"),
			nzanimg:require("@/work/static/images/nzanico.png"),
			flower:require("@/work/static/images/flower.png"),
			nflower:require("@/work/static/images/nflower.png"),
			codeimg:require("@/work/static/images/meeting/code.png"),
			info:{},
			dfflag:false,
		}
	},
	onLoad: function() {
	},
	methods:{
		checkPermi, checkRole,
		kaType(ite,list){
			return selectValue(list, ite);
		},
		getClose(){
			this.dfflag=false
		},
		getDetail(e){
			var id='';
			var type=this.type;
			if(type=='hyhd'||type=='hytz'){
				id=e.conferenceId
			}else if(type=='wdfy'||type=='hyfy'){
				id=e.speakId
			}else if(type=='hdtz'||type=='zxhd'){
				id=e.activityId
			}else if(type=='zsyz'||type=='wdzs'){
				id=e.investmentId
			}
			this.$emit('getDetail',id)
		},
		getDfFn(ite){
			if(this.type=='hdtz'){
				this.info=ite.zxActivityUserList[0];
			}else{
				this.info=ite.zxConferenceUserList[0];	
			}
			this.dfflag=true	
		},
		getReadFn(e){
			this.$emit('getReadFn',e)
		},
		getTuiFn(ite,txt,sh){
			var that=this;
			this.dfflag=false
			if(txt=='scfk'&&sh==0){
				uni.showModal({
					title: '确认立案',
					content: "是否确认立案",
					cancelText: '取消',
					confirmText: '确认',
					success: function(res) {
						if (res.confirm) {
							var obj={
								id:ite.conferenceId,
								type:txt,
								sh:sh,
							}
							that.$emit('getTuiFn',obj)
						} else if (res.cancel) {
							// console.log('用户点击取消');
						}
					}
				});
			}else if(txt=='zsyzsh'||txt=='zsyzqy'){
				var id=ite.investmentId;
				var obj={
					id:id,
					type:txt,
				}
				this.$emit('getTuiFn',obj)
			}else{
				var id=ite.conferenceId;
				if(this.type=='hdtz'){
					id=ite.activityId
				}
				var obj={
					id:id,
					type:txt,
					sh:sh,
					item:ite
				}
				this.$emit('getTuiFn',obj)
			}
			
		},
		typeFn(data){
			if(data){
				var newArr=[]
				var astr=data.split('-')
				astr.forEach(ite=>{
					var a=ite.substring(0,5);
					newArr.push(a)
				})
				return newArr.join('-')
			}else{
				return ''
			}
		},
	},
	
  }
</script>

<style lang="scss" scoped>
.caselist{background: #FFFFFF;border-radius: 30rpx;margin-top: 24rpx;padding: 38rpx 24rpx 8rpx;
	.tit{font-weight: bold;font-size: 32rpx;color: #222327;margin-bottom: 42rpx;}
	.ftxt{display: flex;align-items: flex-start;margin-bottom: 32rpx;flex:0 1 auto;min-width: 50%;
		text{font-weight: bold;font-size: 26rpx;color: #CACACA;flex: 0 0 auto;min-width: 104rpx;text-align-last: justify;}
		view{flex: 1;color: #343434;font-size: 26rpx;margin-left: 20rpx;line-height: 34rpx;}
	}
	.codeimg{width: 42rpx;height: 42rpx;flex: 0 0 auto;margin-left: 20rpx;}
	.casebtn{padding: 24rpx 0;border-top: 2rpx solid #E6E6E6;
		.ftit{font-weight: bold;font-size: 26rpx;color: #CACACA;flex: 1;
			text{color: $com-cd3;margin-left: 20rpx;font-weight:500;min-width: 104rpx;text-align-last: justify;}
		}
		.lftit{font-weight: 500;font-size: 26rpx;color: #666666;flex:1;
			.lfdet{color: $com-cd3;text-decoration: underline;}
		}
		.lfread{font-weight: bold;font-size: 26rpx;color: #FF0000;flex:1;
			.lfdet{color: #222327;margin-left: 16rpx;}
		}
		.zanimg{width: 22rpx;height: 20rpx;margin-right: 14rpx;}
		.staimg{width: 24rpx;height: 24rpx;margin-right: 14rpx;}
		.btn{min-width: 118rpx;height: 52rpx;border-radius: 26rpx;font-weight: bold;flex: 0 0 auto;display: flex;align-items: center;
font-size: 26rpx;margin-left: 26rpx;line-height: 52rpx;text-align: center;padding: 0 32rpx;box-sizing: border-box;
		&.btn1{background: #FFEDED;color: #FF4141;}
		&.btn2{background: #E4EEFF;color: #1D64E2;}
		&.btn3{background: #ECECEC;color: #666666;}
		
		}
	}
}
.fixedbox{position: fixed;left: 48rpx;right: 48rpx;background: #fff;border-radius: 10rpx;min-height: 468rpx;top: 50%;transform: translateY(-50%);z-index: 10;padding: 32rpx 40rpx 50rpx;max-height: calc(100vh - 300rpx);overflow: auto;box-sizing: border-box;
	.ftxt{display: flex;align-items: flex-start;margin-bottom: 32rpx;flex:0 1 auto;min-width: 50%;
		text{font-weight: bold;font-size: 26rpx;color: #CACACA;flex: 0 0 auto;min-width: 104rpx;text-align-last: justify;}
		view{flex: 1;color: #343434;font-size: 26rpx;margin-left: 20rpx;line-height: 34rpx;}
	}
	.ttit{position: relative;text-align: center;font-weight: bold;font-size: 36rpx;color: #222327;margin-bottom: 34rpx;}
	.fixedbtn{padding-top: 18rpx;
			.btns{width: 254rpx;height: 80rpx;border-radius: 40rpx;font-weight: bold;flex: 1;
	font-size: 30rpx;display: flex;align-items: center;justify-content: center;box-sizing: border-box;
				&.btn1{color: #1D64E2;border: 2rpx solid #1D64E2;}
				&.btn2{color: #ffffff;background: #1D64E2;}
				.down{width: 26rpx;height: 26rpx;margin-right: 6rpx;flex: 0 0 auto;}
			}	
		}
}
</style>
