apply.vue 4.1 KB
<template>
	<view>
		<view class="searchbar">
			<uni-easyinput placeholderStyle="font-size:30rpx" :input-border="false" prefixIcon="search"
				v-model="queryParams.name" placeholder="搜索考级名称" @blur="getList" @clear="getList">
			</uni-easyinput>
			<view class="invertedbtn-red" @click="goAdd">+ 添加级位考试</view>
		</view>
		<view class="appList">
			<view class="appItem" v-for="item in list">
				<view class="status" @click="goDetail(item)">
					<text :class="{
					                'text-primary':item.status=='1',
					                'text-success':item.status=='2',
					                'text-danger':item.status=='3',
					                'text-warning':item.status=='4'
					              }">{{ item.statusStr }}</text>
				</view>

				<view class="date" v-if="item.status!='0'&&item.submitTime">提交时间:{{item.submitTime}}</view>
				<view class="name mt0" @click="goDetail(item)">{{item.name}}</view>
				<view class="pp esp">考级日期:{{item.startTime.substring(0,16)}}{{item.endTime.substring(0,16)}}</view>
				<view class="flexbox" @click="goDetail(item)">
					<view>
						申请日期
						<view>{{item.applyTime.substring(0, 10)}}</view>
					</view>
					<view>
						申请单位
						<view>{{item.memberName}}</view>
					</view>
					<view>
						通过人数
						<view>{{item.pass}}</view>
					</view>
				</view>
				<view class="func" v-if="item.status=='0'||item.status=='3'||item.status=='4'">
					<button @click="editThis(item)">编辑</button>
					<button @click="handleSubmit(item)">提交审核</button>
				</view>
			</view>
		</view>
		
		
		
		<view class="nodata" v-if="list.length==0">
			<image mode="aspectFit" src="/static/nodata.png"></image>
			<text>暂无数据</text>
		</view>
	</view>
</template>

<script setup>
	import * as api from '@/common/api.js'
	import config from '@/config.js'
	import {
		onMounted,
		ref
	} from 'vue'
	import {
		onLoad,
		onShow
	} from '@dcloudio/uni-app'
	const app = getApp();
	const queryParams = ref({
		// pageNum: 1,
		// pageSize: 10
		type: '1',
		rankStatus: '0'
	})
	const navs = ref(['未提交', '审核中', '审核通过', '审核拒绝'])
	const current = ref()
	const list = ref([])
	const total = ref(0)
	const deptType = ref('')
	onLoad(() => {

	})
	onShow(() => {
		if (app.globalData.isLogin) {
			init()
		} else {

			app.firstLoadCallback = () => {
				init()
			};
		}
	})

	function init() {
		uni.showLoading({
			title: '加载中'
		})
		deptType.value = app.globalData.deptType
		getList()
	}


	function getList() {
		api.getLevelList(queryParams.value).then(res => {
			uni.hideLoading()
			list.value = res.rows
			total.value = res.total
		})
	}

	function goAdd() {
		let path = `/pages/level/addApply`
		uni.navigateTo({
			url: path
		});
	}

	function editThis(item) {
		let path = `/pages/level/addApply?examId=${item.examId}`
		uni.navigateTo({
			url: path
		});
	}
	function handleSubmit(item){
		uni.showModal({
			title: '提示',
			content: `确定提交${item.name}进行审核吗`,
			success: function(res) {
				if (res.confirm) {
					uni.showLoading({
						title:`提交中`
					})
					upApply(item.examId)
				}
			}
		})
	}
	function upApply(id){
		api.submitVerity(id).then(res=>{
			uni.hideLoading()
			getList()
			uni.showToast({
				title:`提交成功`
			})
		})
	}


	function goDetail(item) {
		if(item.status!='0'){
			let path = `/pages/level/applyDetail?examId=${item.examId}`
			uni.navigateTo({
				url: path
			});
		} else {
			return
		}

	}
</script>


<style scoped>
	.searchbar {
		display: flex;
		align-items: center;
		padding: 25rpx;
		box-sizing: border-box;

		:deep(.uni-easyinput .uni-easyinput__content) {
			border-radius: 35rpx;
			border: none;
			height: 70rpx;
		}

		:deep(.uni-easyinput__content-input) {
			font-size: 26rpx;
		}

		.invertedbtn-red {
			border-radius: 50px;
			background-color: #fff;

			font-size: 30rpx;
			padding: 10rpx 20rpx;
		}
	}

	.mt0 {
		margin-top: 0 !important;
	}

	.appList .appItem .name {
		width: 80%;
		word-break: break-all;
	}
</style>