<template>
  <view>
	<view v-if="datalist.length>0">
		<!-- 我的提案 -->
		<block v-if="type=='tabl'">
			<view class="caselist" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite.categoryId)">
				<view class="tit overtwo">{{ite.title}}</view>
				
				<view class="flexcw" >
					<view class="ftxt">
						<text>提案者</text>
						<view>{{ite.proposalName}}</view>
					</view>
					<view class="ftxt" v-if="ite.proposalNumber">
						<text>案号</text>
						<view>{{ite.proposalNumber}}</view>
					</view>
					<view class="ftxt">
						<text>提案类型</text>
						<view>{{ite.proposalType==0?'大会提案':'平时提案'}}</view>
					</view>
				</view>
				<view class="ftxt">
					<text>提案类别</text>
					<view>{{ite.categoryName}}</view>
				</view>
				<view class="ftxt">
					<text>提交时间</text>
					<view>{{ite.createTime}}</view>
				</view>
				<view class="ftxt">
					<text>提案状态</text>
					<view class="co0b">{{kaType(ite.proposalProgress)}}</view>
				</view>
				
				<!-- 提案办理  回复单位-->
				<view class="casebtn flexc">
					<view class="ftit">办理状态<text>{{ite.isReply==0&&ite.proposalProgress!=6&&ite.proposalProgress!=7?'已反馈':'待反馈'}}</text></view>
					<view class="btn btn3" v-if="ite.isReply==0&&ite.proposalProgress!=6&&ite.proposalProgress!=7">已反馈</view>
					<view class="btn btn2" v-if="checkPermi(['proposal:unit:reply'])&&(ite.isReply!=0||ite.proposalProgress==6)&&ite.proposalProgress!=3&&ite.proposalProgress!=7" @click.stop="getTuiFn(ite,'dffk')">反馈意见</view>
					<view class="btn btn2" v-if="checkPermi(['proposal:unit:reply'])&&(ite.isReply!=0||ite.proposalProgress==7)&&(ite.proposalProgress==3||ite.proposalProgress==7)" @click.stop="getTuiFn(ite,'dwdf')">反馈意见</view>
				</view>
				<!--催办  4(不包含4) 之后 可以催办-->
				<view class="casebtn flexc" v-if="type=='tacb'">
					<!-- <block v-if="ite.isRecord=='0'">
						<view class="lftit">该提案已被催办 <text class="co1d">1次</text></view>
						<view class="btn btn3">再次催办</view>
					</block> -->
					<!-- <block v-if="ite.isRecord==1">
						<view class="lftit">该提案暂未被催办</view>
						<view class="btn btn2" @click.stop="getTuiFn(ite,'tacb')">催办</view>
					</block> -->
					<view class="lftit"></view>
					<view class="btn btn2" @click.stop="getTuiFn(ite,'tacb')">催办</view>
				</view>

			</view>
		</block>
		<!-- 社情议案 -->
		<block v-if="type=='sqtabl'">
			<view class="caselist" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite.sqmyId)">
				<view class="tit overtwo">{{ite.title}}</view>
				<view class="ftxt">
					<text>上报者</text>
					<view>{{ite.sqmyName}}</view>
				</view>
				<view class="ftxt">
					<text>主题类型</text>
					<view>{{kaType(ite.topicType,ztlxlist)}}</view>
				</view>
				<view class="ftxt">
					<text>提交时间</text>
					<view>{{ite.createTime}}</view>
				</view>
				<view class="ftxt">
					<text>进度情况</text>
					<view class="co0b">{{kaType(ite.sqmyProgress)}}</view>
				</view>
				
				<!-- 委员反馈 提案办理 -->
				<view class="casebtn flexc">
					<view class="ftit">办理状态<text>{{ite.isReply==0&&ite.sqmyProgress!=6&&ite.sqmyProgress!=7?'已反馈':'待反馈'}}</text></view>
					<view class="btn btn3" v-if="ite.isReply==0&&ite.sqmyProgress!=6&&ite.sqmyProgress!=7">已反馈</view>
					<view class="btn btn2" v-if="checkPermi(['sqmy:unit:reply'])&&(ite.isReply!=0||ite.sqmyProgress==6)&&ite.sqmyProgress!=3&&ite.sqmyProgress!=7" @click.stop="getTuiFn(ite,'dffk')">反馈意见</view>
					<view class="btn btn2" v-if="checkPermi(['sqmy:unit:reply'])&&(ite.isReply!=0||ite.sqmyProgress==7)&&(ite.sqmyProgress==3||ite.sqmyProgress==7)" @click.stop="getTuiFn(ite,'dwdf')">反馈意见</view>
				</view>
			</view>
		</block>
		<!-- 提案催办 -->
		<block v-if="type=='tncb'">
			<view class="caselist" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite.sqmyId)">
				<view class="tit overtwo">{{ite.title}}</view>
				<view class="ftxt">
					<text>催办标题</text>
					<view>{{ite.urgeTitle}}</view>
				</view>
				<view class="ftxt">
					<text>催办类型</text>
					<view>{{ite.urgeType==1?'提案催办':'社情名义催办'}}</view>
				</view>
				<view class="ftxt">
					<text>催办内容</text>
					<view>{{ite.urgeContent}}</view>
				</view>
				<view class="ftxt">
					<text>发布人</text>
					<view>{{ite.issuer}}</view>
				</view>
				<view class="ftxt">
					<text>发布单位</text>
					<view>{{ite.issuerDept}}</view>
				</view>
				<view class="ftxt">
					<text>接收人</text>
					<view>{{ite.acceptUser}}</view>
				</view>
				<view class="ftxt">
					<text>接收单位</text>
					<view class="co0b">{{ite.acceptDept}}</view>
				</view>
				<view class="ftxt">
					<text>接收单位</text>
					<view class="co0b">{{ite.urgeTime}}</view>
				</view>
				<!-- <view class="ftxt">
					<text>催办状态</text>
					<view class="co0b">{{kaType(ite.sqmyProgress)}}</view>
				</view> -->
				<!-- 委员反馈 提案办理 -->
				<!-- <view class="casebtn flexc" v-if="type=='xxsb'||type=='xxbl'">
					<view class="ftit">办理状态<text>{{ite.isReply==0&&ite.sqmyProgress!=6&&ite.sqmyProgress!=7?'已反馈':'待反馈'}}</text></view>
					<view class="btn btn3" v-if="ite.isReply==0&&ite.sqmyProgress!=6&&ite.sqmyProgress!=7">已反馈</view>
					<view class="btn btn2" v-if="checkPermi(['sqmy:unit:reply'])&&(ite.isReply!=0||ite.sqmyProgress==6)&&ite.sqmyProgress!=3&&ite.sqmyProgress!=7" @click.stop="getTuiFn(ite,'dffk')">反馈意见</view>
					<view class="btn btn2" v-if="checkPermi(['sqmy:unit:reply'])&&(ite.isReply!=0||ite.sqmyProgress==7)&&(ite.sqmyProgress==3||ite.sqmyProgress==7)" @click.stop="getTuiFn(ite,'dwdf')">反馈意见</view>
				</view> -->
			</view>
		</block>
		<view class="shax" v-if="wtdt">{{wtdt}}</view>
	</view>
	<block v-else>
		<no-data></no-data>
	</block>
  </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 []
			}
		},
		tajdlist: {
			type: Array,
			default () {
				return []
			}
		},
		wtdt:{
			type: String,
			default () {
				return ''
			}
		},
		ztlxlist:{
			type: Array,
			default () {
				return []
			}
		},
		type:{
			type: [String,Number],
			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"),
		}
	},
	onLoad: function() {
	},
	methods:{
		checkPermi, checkRole,
		kaType(ite){
			return selectValue(this.tajdlist, ite);
		},
		getDetail(e){
			this.$emit('getDetail',e)
		},
		getTuiFn(ite,txt,sh){
			var that=this;
			var obj={
				type:txt,
				sh:sh,
				ite:ite
			}
			if(that.type=='sqtabl'){
				obj.id=ite.sqmyId
			}else if(that.type=='tabl'){
				obj.id=ite.proposalId
			}
			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;}
	}
	.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;}
		}
		.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;}
		
		}
	}
}

</style>
