<template>
	<view class="wrap">
		<uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
			@clickLeft="toBack">
			<view class="nav-title">
				<text>{{title}}</text>
			</view>
		</uni-nav-bar>
		<view class="container">
			<uni-table ref="order_table" border stripe type="" emptyText="暂无更多数据">
				<uni-tr>
					<uni-th width="140" align="center">
						<view style="text-align: center;color: black;">运维人员姓名</view>
					</uni-th>
					<uni-th align="center">
						<view style="text-align: center;color: black;">任务数量</view>
					</uni-th>
					<uni-th align="center">
						<view style="text-align: center;color: black;">处理中</view>
					</uni-th>
					<uni-th align="center">
						<view style="text-align: center;color: black;">已处理</view>
					</uni-th>
				</uni-tr>
				<uni-tr v-for="(item, index) in tableData" :key="index">
					<uni-td>
						<view style="text-align: center;">{{ item.servicePersonName }}</view>
					</uni-td>
					<uni-td align="center">
						<view style="text-decoration-line: underline;text-align: center;color: coral;"
							@click="onCheckOrderCountClick(item)">{{ item.orderCount }}</view>
					</uni-td>
					<uni-td align="center">
						<view style="text-decoration-line: underline;text-align: center;color: coral;"
							@click="onCheckOrderProcessCountClick(item)">{{ item.processingOrderCount }}
						</view>
					</uni-td>
					<uni-td align="center">
						<view style="text-decoration-line: underline;text-align: center;color: coral;"
							@click="onCheckOrderReportCountClick(item)">{{ item.reportOrderCount }}
						</view>
					</uni-td>
				</uni-tr>
			</uni-table>
		</view>
	</view>
</template>

<script>
	import http from '@/http/api.js';
	export default {
		components: {
		},
		onLoad(option) {
			this.getCountInfo();
		},
		data() {
			return {
				title: '维修任务统计报表',
				tableData: [],
			}
		},
		computed: {
		},
		onShow() {
		},
		methods: {
			toBack() {
				uni.navigateBack({
					delta: 1
				})
			},
			onCheckOrderCountClick(item){
				var url = '/pages/check-order/servicepersoncheckorderlist?type=1&userId='+item.userId;
				uni.navigateTo({
					url: url
				})
			},
			onCheckOrderProcessCountClick(item){
				var url = '/pages/check-order/servicepersoncheckorderlist?type=2&userId='+item.userId;
				uni.navigateTo({
					url: url
				})
			},
			onCheckOrderReportCountClick(item){
				var url = '/pages/check-order/servicepersoncheckorderlist?type=3&userId=' + item.userId;
				uni.navigateTo({
					url: url
				})
			},
			getCountInfo() {
				var that = this;
				http.request({
					url: '/galaxy-business/rtu/check/order/statistics',
					method: 'GET',
				}).then(res => {
					if (res.data != null) {
						that.tableData = res.data;
					}
				}).catch(err => {
					console.log(err)
				})
			},
		}
	}
</script>

<style>

</style>

<style lang="scss" scoped>
	.wrap {
		padding: 0 0 100rpx;
	}
</style>
