<template>
	<view>
		<view v-if="datalist.length">
				<!-- 主表 -->
				<!-- 领导批示列表 -->
				<block v-if="type=='ldwritten'">
					<view class="carlist" v-for="(ite,idx) in datalist" :key='idx'>
						<!-- 暂存详情 -->
						<view class="flexc mb10">
							<view class="f16 fw c34  over flex1">{{ite.xgsj||ite.cjsj}}</view>
							<!-- <view class="ldzctit flex-wrap" v-if="!ite.psnr">暂存</view> -->
							<!-- <view class="flex1"></view> -->
							<!-- 操作按钮 -->
							<view class="flex0 titp" @click.stop="getDetail(ite)" v-if="checkPermi(['fgw:ldps:add'])||checkPermi(['fgw:ldps:edit'])">
								<image :src="xpsimg"></image>
								<view>修改批示</view>
							</view>
						</view>
						<view class="c6 f15 f500 mb4">批示领导：{{ite.psr}}</view>
						<view class="c6 f15 f500 mb4" >批示详情：{{ite.psnr}}</view>
						<!-- <view class="c6 f15 f500 mb4" v-else>暂存详情：{{ite.zcpsnr}}</view> -->
					</view>
				</block>
				<block v-else>
					<!-- 主表 -->
				<view class="carlist" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite)">
					<image :src="ldtit" class="ldimg" v-if="ite.psnr"></image>
					<view class="flexc mb10">
						<view class="f16 fw c34  over flex01">{{ite.xmmc}}</view>
						<!-- 问题项目 -->
						<view class="flex0 ml8">
							<view class="car_dai btn3" v-if="ite.isWt=='Y'">问题项目</view>
						</view>
					</view>
					<view class="c6 f15 f500 mb4 flex">项目单位：<text class="flex1">{{ite.xmdw}}</text></view>
					<view class="c6 f15 f500 mb4 flex">牵头责任单位：<text class="flex1">{{ite.qtzrdw}}</text></view>
					
					<view class="c6 f15 f500 mb4 flexc" v-if="ite.psnr">领导批示：
						<view class="over flex1">{{ite.psnr}}</view>
					
						<!-- <view class="cofe flex0" v-if="checkPermi(['fgw:ldps:list'])&&type!='leader'"  @click.stop="getldwrittenFn(ite)">查看领导批示</view> -->
					</view>
				
					<view class="c6 f15 f500 mb4 flexc">审核状态意见：
							<text :class="{co26:ite.status==2,zcofa:ite.status==3}">
								<block v-if="ite.progress==1">基本信息</block>
								<block v-if="ite.progress==2">前期工作手续</block>	
							</text>
							<text v-if="ite.status==2" class="co26">已通过</text>
							<text v-else-if="ite.status==3" class="cof1">未通过</text>
							<text v-else-if="ite.status==1" class="c6">待审核</text>
							<view class="flex1"></view>
							
							<!-- 领导批示 -->
							<view v-if="checkPermi(['fgw:ldps:list'])&&type=='leader'" class="co1f flex0 txr" @click.stop="getldwrittenFn(ite)">查看批示</view>
							<view class="cofe flex0 txr" v-if="checkPermi(['fgw:jzqk:list'])&&type!='leader'&&type!='cqxm'&&ite.type==2" @click.stop="getjdDetail(ite)">查看进度汇报</view>
							<!-- 节点安排 -->
							<view class="cofe flex0 txr" v-if="checkPermi(['fgw:dbd:list'])&&type=='cqxm'" @click.stop="getdbjdDetail(ite)">查看节点安排</view>
					</view>
					<!-- 节点安排 -->
					<!-- <view class="c6 f15 f500  flexc">节点安排：开工
						<view class="zdlbtn btn1">黄牌预警</view>
						<view class="zdlbtn btn2">红牌预警</view>
						<view class="zdlbtn btn3">未超期</view>
					
						<view class="flex1"></view>
						<view class="cofe flex0 txr" @click.stop="getjdDetail(ite)">查看进度汇报</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 noData from "@/components/nodata/nodata.vue"
	import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
	export default{
		props:{
			datalist: {
				type: Array,
				default () {
					return []
				}
			},
			wtdt:{
				type: String,
				default () {
					return ''
				}
			},
			type:{
				type: String,
				default () {
					return ''
				}
			}
		},
		components:{noData},
		data(){
			return{
				ldtit:require('@/static/images/new/psicon.png'),
				xpsimg:require("@/static/images/mine/xpicon.png"),
			}
		},
		mounted() {
			
			
		},
		methods:{
			checkPermi,checkRole,
			getDetail(e){
				this.$emit('getDetail',e)
			},
			getjdDetail(e){
				// 进度汇报
				var newobj={
					id:e.id,
					tabidx:3
				}
				this.$emit('getjdDetail',newobj)
			},
			getdbjdDetail(e){
				var newobj={
					id:e.id,
					tabidx:2
				}
				this.$emit('getjdDetail',newobj)
			},
			getShprogress(e){
				this.$tab.navigateTo('/pages/work/shprogress?id='+e)
			},
			getLookPro(e){
				this.$tab.navigateTo('/pages/work/projectprogress?id='+e)
			},
			getXmjzFn(e){
				this.$emit('getXmjzFn',e)
			},
			// 领导批示
			getldwrittenFn(e){
				var newobj={
					xmId:e.id,
					xmbh:e.xmbh,
				}
				this.$tab.navigateTo('/pages/zdpages/work/ldwritten?data='+encodeURIComponent(JSON.stringify(newobj)))
			}
		}
	}
</script>

<style scoped lang="scss">
//列表
 .carlist{padding: 44rpx 28rpx;border-bottom: 2rpx solid #E5E5E5;position: relative;}
 .car_dai{font-size: 26rpx;font-weight: 500;
color: #FFFFFF;padding: 0 10rpx;border-radius: 6rpx;height: 36rpx;line-height: 36rpx;
	&.btn1{background-color: #FF440B;}
	&.btn3{background-color:#FEBD0F;}

}
.ldimg{width: 136rpx;height: 136rpx;position: absolute;right: 0;top: 0;}
.titp{display: flex;align-items: center;height: 48rpx;min-width: 120rpx;justify-content: center;
	image{width: 32rpx;height: 32rpx;}
	view{font-size: 30rpx;color: #1FB9F7 ;margin-left: 12rpx;}
	}
.ldzctit{width: 70rpx;min-height: 30rpx;background: #50D751;border-radius: 6rpx;font-size: 24rpx;color: #FFFFFF;margin-left: 22rpx;display: flex;align-items: center;justify-content: center;padding: 2rpx;box-sizing: border-box;}

.zdlbtn{
	padding: 0 12rpx;height: 36rpx;border-radius: 6rpx;color: #FFFFFF;min-width: 108rpx;box-sizing: border-box;font-size: 24rpx;font-weight: 500;margin-left: 24rpx;line-height: 36rpx;text-align: center;
	&.btn1{background: #FEBD0F;}
	&.btn2{background: #FA2300;}
	&.btn3{background: #09B329 ;}
}
</style>