<template>
	<view>
		<view v-if="datalist.length">
			<!-- 省库项目 -->
			<block v-if="type=='shengku'">
				<view class="carlist" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite)">
					<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.isHs=='Y'">徽商</view>
						</view>
					</view>
					<!-- <view class="c6 f15 f500 mb4 over">投资单位
					</view> -->
					<view class="c6 f15 f500 mb4">项目所在地：{{ite.szdqName}}</view>
					<view class="c6 f15 f500 mb4">总投资额: {{ite.ztze}}万元</view>
					<view class="c6 f15 f500 mb4">省外资金：{{ite.swzj}}万元</view>
					<!-- <view class="c6 f15 f500 mb4">入库日期：{{ite.rkTime}}</view> -->
					<view class="c6 f15 f500 flexc">审核状态意见：
						<text v-if="ite.isSh==1" class="c6">待审核</text>
						<text v-if="ite.isSh==2" class="co26">已通过</text>
						<text v-if="ite.isSh==3" class="cof1">未通过</text>
						<block v-if="!ite.shJy">
							<view class='flex1'></view>
							<!-- v-if="checkPermi(['projectV2:shyj:list'])" -->
							<view class="co1f flex0 txr" v-if="checkPermi(['projectV2:dzje:list'])"  @click.stop="getlookdzje(ite)">到位资金情况</view>
						</block>
					</view>
					<view class="c6 f15 f500 flexc" v-if="ite.shJy">反馈意见：
						<text class="c6">{{ite.shJy}}</text>
						<view class='flex1'></view>
						<block >
							<view class="co1f flex0 txr" v-if="checkPermi(['projectV2:dzje:list'])"  @click.stop="getlookdzje(ite)">到位资金情况</view>
						</block>
					</view>
				</view>
			</block>
			<!-- 省库项目到位资金 -->
			<block v-else-if="type=='skdwzj'">
				<view class="carlist" v-for="(ite,idx) in datalist" :key='idx'>
					<view class="flexc mb10">
						<view class="f16 fw c34  over flex1">{{ite.dwrq}}</view>
						<!-- <view class="ldzctit flex-wrap" v-if="!ite.psnr">暂存</view> -->
						<!-- <view class="flex1"></view> -->
						<!-- 操作按钮 &&ite.isSh!=2-->
						<view class="flex0 titp" v-if="checkPermi(['projectV2:dzje:edit','projectV2:dzje:remove'])" @click.stop="getDetail(ite)">
							<image :src="xpsimg"></image>
							<view>操作</view>
						</view>
					</view>
					<view class="c6 f15 f500 mb4">单位名称：{{ite.dwmc}}</view>
					<view class="c6 f15 f500 mb4" >注资金额：{{ite.zzje}}(万元)</view>
					<!-- <view class="c6 f15 f500 mb4" v-else>暂存详情：{{ite.zcpsnr}}</view> -->
				</view>
			</block>
			<!-- 问题项目 -->
			<!-- <block v-else-if="type=='wenti'">
				<view class="carlist" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite)">
					<view class="flexc mb10">
						<view class="f16 fw c34  over flex1">{{ite.xmmc}}</view>
					</view>
					<view class="c6 f15 f500 mb4">项目阶段：{{ite.xmjd}}</view>
					<view class="c6 f15 f500 mb4">审核人：{{ite.shrxm}}</view>
					<view class="c6 f15 f500 flexc">审核状态意见：

						<text v-if="ite.shjg==2" class="co26">{{ite.xmjd}}已通过</text>
						<text v-else-if="ite.shjg==3" class="cof1">{{ite.xmjd}}未通过</text>
						<text v-else-if="ite.shjg==1" class="c6">{{ite.xmjd}}待审核</text>

						<view class="flex1"></view>
						<block v-if="checkPermi(['projectV2:shyj:list'])">
							<view class="co1f flex0 txr"   @click.stop="getShprogress(ite.xmId)">查看审核进度</view>
						</block>
						
					</view>
				</view>
			</block> -->
			<!-- 督办 -->
			<block v-else-if="type=='duban'">
				<view class="carlist" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite)">	
					<view class="flexc mb10">
						<view class="f16 fw c34  over flex1">{{ite.xmmc}}</view>
						<view class="flex0 ml8">
							<view class="car_dai btn2" v-if="ite.dbType==1">代办</view>
							<view class="car_dai btn1" v-if="ite.dbType==2">代办</view>
						</view>
					</view>
					<view class="c6 f15 f500 mb4">督办部门名称：{{ite.deptName}}</view>
					<view class="c6 f15 f500 mb4">督办事项：{{ite.dbsx}}</view>
					<view class="c6 f15 f500 mb4">督办日期：{{ite.dbTime}}</view>
					<view class="c6 f15 f500 flexc">是否回复：
					<!-- isHf 拿最后一条审核状态 -->
					<!-- （是否回复 N:未回复，2:已回复）-->
					<text v-if="ite.isHf=='Y'" class="co26">已回复</text>
					<!-- <text v-else-if="ite.isHf==2" class="cof1">未通过</text> -->
					<text v-if="ite.isHf=='N'" class="c6">待回复</text>
			
						<view class="flex1"></view>
						<!-- 领导批示 -->
						<!-- <view class="co1f flex0 txr" v-if="type=='leader'" @click.stop="getShprogress(ite.id)">查看批示</view> -->
						<view class="co1f flex0 txr" v-if="checkPermi(['projectV2:dbd:list'])"  @click.stop="getDetail(ite)">回复</view>
						<view class="cofr flex0 txr ml10" v-if="checkPermi(['projectV2:dbd:remove'])"  @click.stop="getDel(ite.id)">删除</view>
					</view>
				</view>
			</block>
			<!-- 提示项目 tslist-->
			<block v-else-if="type=='tslist'">
				<view class="carlist" v-for="(ite,idx) in datalist" :key='idx'>
					<view class="flexc mb10">
						<view class="f16 fw c34  over flex1">{{ite.xmxsmc}}</view>
						<view class="co1f flex0 txr" v-if="checkPermi(['projectV2:shyj:list'])"  @click.stop="getXmjzFn(ite)">添加项目进展</view>
					</view>
					<view class="c6 f15 f500 mb4">项目编号：{{ite.xmbh}}</view>
					<view class="c6 f15 f500 mb4">项目名称：{{ite.xmmc}}</view>
					<view class="c6 f15 f500 mb4 flex"><text class="flex0">内容：</text>
						<view class="flex1">{{ite.details}}</view>
					</view>


				</view>
			</block>
			<!-- 统计 -->
			<block v-else-if="type=='tongjizs'">
				<view class="carlist" v-for="(ite,idx) in datalist" :key='idx'>
					<view class="flexc mb10">
						<view class="f16 fw c34  over flex1">{{ite.outsideTime}}</view>
					</view>
					<view class="c6 f15 f500 mb4">上报单位：{{ite.deptName}}</view>
					<view class="c6 f15 f500 mb4">外出天数：{{ite.numberOutings}}天</view>
					<view class="c6 f15 f500 mb4 over" v-if="ite.details">情况说明：{{ite.details}}</view>
					<view class="c6 f15 f500 mb4 flexc over">
						<view class="flex01 over">
							外出人员：{{ite.outgoer}}
						</view>
						<view class="flex1"></view>
						<!--  -->	
						<view class="co1f flex0 txr" v-if="checkPermi(['system:wczs:query'])"   @click.stop="getDetail(ite)">查看详情</view>
					</view>
				</view>
			</block>
			<block v-else-if="type=='tongjiks'">
				<view class="carlist" v-for="(ite,idx) in datalist" :key='idx'>
					<view class="flexc mb10">
						<view class="f16 fw c34  over flex1">{{ite.outsideTime}}</view>
					</view>
					<view class="c6 f15 f500 mb4 flexc over">
						<view class="flex01 over">
							上报单位：{{ite.deptName}}
						</view>
						<block v-if="!ite.details">
							<view class="flex1"></view>
							<view class="co1f flex0 txr" v-if="checkPermi(['system:djks:query'])"  @click.stop="getDetail(ite)">查看详情</view>
						</block>
						
					</view>
					
					<view class="c6 f15 f500 mb4 over flexc" v-if="ite.details">
						<view class="flex01 over">
							情况说明：{{ite.details}}
						</view>
						<!-- <text class="c6"></text> -->
						<view class="flex1"></view>
						<view class="co1f flex0 txr" v-if="checkPermi(['system:djks:query'])"  @click.stop="getDetail(ite)">查看详情</view>
						</view>
					<!-- <view class="c6 f15 f500 mb4 flexc over">对接人员：{{ite.outgoer}}
						<view class="flex1"></view>
						<view class="co1f flex0 txr" v-if="checkPermi(['system:djks:query'])"  @click.stop="getDetail(ite)">查看详情</view>
					</view> -->
				</view>
			</block>
			<!-- 领导批示列表 -->
			<block v-else-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(['system:ldps:update'])||checkPermi(['system:ldps:add'])">
							<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 flex1">
						<!-- {{ite.xmxsmc}} -->
						<block v-if="ite.progress==1||ite.progress==2">{{ite.xmxsmc}}</block>
						<block v-if="ite.progress==3||ite.progress==4||ite.progress==5">{{ite.zsyzQyxx.xmmc}}</block>
						</view>
						<!-- 问题项目 -->
						
					</view>
					<!-- <block v-if="ite.progress==1">项目首谈</block>
					<block v-if="ite.progress==2">项目承接</block>
					<block v-if="ite.progress==3">项目签约</block>
					<block v-if="ite.progress==4">项目开工</block>
					<block v-if="ite.progress==5">项目投产</block> -->
					<view class="c6 f15 f500 mb4">
						<!-- 落户地：{{ite.nlhd}} -->
						<block v-if="ite.progress==1||ite.progress==2">拟落户地：{{ite.nlhd}}</block>
						<block v-if="ite.progress==3||ite.progress==4||ite.progress==5">落户地：{{ite.zsyzQyxx.xmszd}}</block>
					</view>
					<view class="c6 f15 f500 mb4">
						<!-- 投资额：{{ite.ntze}}亿元 -->
						<block v-if="ite.progress==1||ite.progress==2">拟投资额：{{ite.ntze}}亿元</block>
						<block v-if="ite.progress==3||ite.progress==4||ite.progress==5">投资额：{{ite.zsyzQyxx.xytze}}万元</block>
					</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(['system:ldps:list'])&&type!='leader'"  @click.stop="getldwrittenFn(ite)">查看领导批示</view>
					</view>
					<!-- 项目进展 -->
					<!-- <view class="c6 f15 f500 mb4 flexc">
						项目进展：<view class="flex1 over">{{ite.xmjz}}</view>
					</view> -->
					<view class="c6 f15 f500  flexc">审核状态意见：
					<!-- shjg 拿最后一条审核状态 -->
					<!-- <text :class="{co26:ite.shjg==1,cof1:ite.shjg==2}" v-if="ite.progress=='1'||ite.progress=='2'||ite.progress=='3'||ite.progress=='4'||ite.progress=='5'">线索</text>
					<text :class="{co26:ite.shjg==1,cof1:ite.shjg==2}" v-else-if="ite.progress=='7'||ite.progress=='6'">签约</text>
					<text :class="{co26:ite.shjg==1,cof1:ite.shjg==2}" v-else-if="ite.progress=='9'||ite.progress=='8'">开工</text>
					<text :class="{co26:ite.shjg==1,cof1:ite.shjg==2}" v-else>投产</text> -->
					
					<text :class="{co26:ite.xmStatus==2,cof1:ite.xmStatus==3}">
						<block v-if="ite.progress==1">项目首谈</block>
						<block v-if="ite.progress==2">项目承接</block>
						<block v-if="ite.progress==3">项目签约</block>
						<block v-if="ite.progress==4">项目开工</block>
						<block v-if="ite.progress==5">项目投产</block>
					</text>
						<text v-if="ite.xmStatus==2" class="co26">已通过</text>
						<text v-else-if="ite.xmStatus==3" class="cof1">未通过</text>
						<text v-else-if="ite.xmStatus==1" class="c6">待审核</text>


						<view class="flex1"></view>
						<!-- 领导批示 -->
						<view v-if="checkPermi(['system:ldps:list'])&&type=='leader'" class="co1f flex0 txr" @click.stop="getldwrittenFn(ite)">查看批示</view>
						<view v-if="checkPermi(['projectV2:shyj:list'])&&type!='leader'" class="co1f flex0 txr"   @click.stop="getShprogress(ite.id)">查看审核进度</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/index/ldtit.png'),
				xpsimg:require("@/static/images/mine/xpicon.png"),
			}
		},
		mounted() {
			
			
		},
		methods:{
			checkPermi,checkRole,
			getDetail(e){
				this.$emit('getDetail',e)
			},
			getDel(e){
				this.$emit('getDel',e)
			},
			getShprogress(e){
				this.$tab.navigateTo('/pages/work/shprogress?id='+e)
			},
			getLookPro(e){
				this.$tab.navigateTo('/pages/work/projectprogress?id='+e)
			},
			getlookdzje(e){
				var newobj={
					id:e.id,
					isSh:e.isSh,
					xmmc:e.xmmc
				}
				this.$tab.navigateTo('/pages/work/skproject/dzjelist?data='+encodeURIComponent(JSON.stringify(newobj)))
			},
			getXmjzFn(e){
				this.$emit('getXmjzFn',e)
			},
			// 领导批示
			getldwrittenFn(e){
				var newobj={
					xmId:e.id,
					xmbh:e.xmbh,
				}
				this.$tab.navigateTo('/pages/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;}
	&.btn2{background-color:#FEBD0F;}
	&.btn3{background-color:#28C529;}

}
.ldimg{width: 94rpx;height: 96rpx;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;}
</style>