<!-- 全部任务-所有 -->
<template>
	<uni-card v-for="(item,index) in props.taskList" padding="0" spacing="0" class="allTask" v-if="props.taskList.length!=0">
		<!-- 待整改 -->
		<view v-if="item.status=='0'" class="allTask_list">
			<view class="list_content">
				<view class="list_content_img">
					<image :src="item.statusIcon" class="statusIcon"></image>
				</view>
				<view class="list_item">质控名称</view>
				<view class="list_item_text">{{item.taskName}}</view>
			</view>
			<view class="list_content">
				<view class="list_item">质控日期</view>
				<view class="list_item_text">{{item.zkTime}}</view>
			</view>
			<view class="list_content">
				<view class="list_item">整改截止日期</view>
				<view class="list_item_text">{{item.zgDeadline}}</view>
			</view>
			<view class="list_content">
				<view class="list_item">整改项数</view>
				<view class="list_item_text">{{item.zgxs}}</view>
			</view>
			<view class="list_content">
				<view class="list_item">整改情况</view>
				<view class="list_item_text">{{'第'+item.zgState+'次'}}</view>
			</view>
			<view class="button">
				<view class="button_upload" @click="uploadZg(item)">上传整改</view>
			</view>
		</view>
		<!-- 审核中 -->
		<view v-if="item.status=='1'" class="allTask_list" @click="pageNav(item)">
			<view class="list_content">
				<view class="list_content_img">
					<image :src="item.statusIcon" class="statusIcon"></image>
				</view>
				<view class="list_item">质控名称</view>
				<view class="list_item_text">{{item.taskName}}</view>
			</view>
			<view class="list_content">
				<view class="list_item">质控日期</view>
				<view class="list_item_text">{{item.zkTime}}</view>
			</view>
			<view class="list_content">
				<view class="list_item">整改截止日期</view>
				<view class="list_item_text">{{item.zgDeadline}}</view>
			</view>
			<view class="list_content">
				<view class="list_item">整改项数</view>
				<view class="list_item_text">{{item.zgxs}}</view>
			</view>
			<view class="list_content">
				<view class="list_item">整改情况</view>
				<view class="list_item_text">{{'第'+item.zgState+'次'}}</view>
			</view>
		</view>
		<!-- 完成 -->
		<view v-if="item.status=='2'" class="allTask_list" @click="pageNav(item)">
			<view class="list_content">
				<view class="list_content_img">
					<image :src="item.statusIcon" class="statusIcon"></image>
				</view>
				<view class="list_item">质控名称</view>
				<view class="list_item_text">{{item.taskName}}</view>
			</view>
			<view class="list_content">
				<view class="list_item">质控日期</view>
				<view class="list_item_text">{{item.zkTime}}</view>
			</view>
			<view class="list_content">
				<view class="list_item">整改项数</view>
				<view class="list_item_text">{{item.zgxs}}</view>
			</view>
			<view class="list_content">
				<view class="list_item">整改上传日期</view>
				<view class="list_item_text">{{item.zgDeadline}}</view>
			</view>
			<view class="list_content">
				<view class="list_item">整改情况</view>
				<view class="list_item_text">{{'第'+item.zgState+'次'}}</view>
			</view>
			<view class="list_content">
				<view class="list_item">整改审核日期</view>
				<view class="list_item_text">{{item.zgshTime}}</view>
			</view>
			<view class="list_content">
				<view class="list_item">整改审核结果</view>
				<view class="list_item_text">{{item.zgState}}</view>
			</view>
		</view>
	</uni-card>
	<view v-else class="empty_data">
		<image src="@/static/empty_data.png" mode="aspectFit"></image>
	</view>
</template>

<script setup>
import http from '@/utils/request';
import {ref,reactive,getCurrentInstance, computed, nextTick,watch} from "vue";
import {onLoad,onShow,onUnload,onPageScroll,onReachBottom,onPullDownRefresh} from "@dcloudio/uni-app";

const props=defineProps({
	// 接受父组件参数，任务列表
	taskList:Array
})

const pageData=reactive({
	statusIcon:""
})

// 上传整改
const uploadZg=(e)=>{
	uni.navigateTo({
		url:'/pages/ypczk/djfk/uploadZg/rectification?id='+e.id+'&status='+e.status
	})
}

const pageNav=(e)=>{
	uni.navigateTo({
		url: '/pages/ypczk/djfk/uploadZg/rectification?id='+e.id+'&status='+e.status,
	});
}
</script>

<style lang="scss" scoped>
@import 'index.scss';
</style>