<!--
 * @Title: 
 * @Description: 当天维修任务动态信息
 * @Author: swp
 * @Date: 2022-08-24 10:49:21
 * @LastEditors: 
 * @LastEditTime: 2022-08-24 10:49:21
-->
<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-list>
				<uni-list-item v-for="item in list" :key="item.id">
					<template v-slot:body>
						<view class="list-item-block">
							<view class="items-line">
								<image class="item-title-run-status-icon" style="box-shadow:0 0 2px 2px lightblue"
									src="/static/images/list/order_item.png" mode="widthFix">
								</image>
								<text class="item-title-rtu-name">{{item.rtuName}}</text>
								<text class="item-title-rtu-code">[{{item.rtuCode}}]</text>
							</view>
							<view class="items-line">
								<uni-icons class="input-uni-icon" type="loop" size="18" color="lightblue" />
								<text class="item-text-lable">状态：</text>
								<text class="item-text-content">{{item.orderStatusName}}</text>
							</view>
							<view class="items-line">
								<uni-icons class="input-uni-icon" type="person" size="18" color="lightblue" />
								<text class="item-text-lable">填报人：</text>
								<text class="item-text-content">{{item.orderProcessUserName}}</text>
							</view>
							<view class="items-line">
								<uni-icons class="input-uni-icon" type="calendar" size="18" color="lightblue" />
								<text class="item-text-lable">填报时间：</text>
								<text class="item-text-content">{{item.updateTime}}</text>
							</view>
							<view class="items-line">
								<uni-icons class="input-uni-icon" type="compose" size="18" color="lightblue" />
								<text class="item-text-lable">说明：</text>
								<text class="item-text-content-ellipsis">{{item.processDesc}}</text>
							</view>
							<view class="item-button-group">
								<view class="item-button" @click="toOrderProcessDetail(item.orderId)">
									<view class="items-line">
										<uni-icons class="input-uni-icon" type="info" size="18" color="coral" />
										<text class="button-text">详情信息</text>
									</view>
								</view>
							</view>
						</view>
					</template>
				</uni-list-item>
			</uni-list>
			<uni-group>
				<view class="pagination-block">
					<uni-pagination show-icon :pageSize="pageSize" :current="pageCurrent" :total="total"
						@change="pageChange" />
				</view>
			</uni-group>
		</view>
	</view>
</template>

<script>
	import http from '@/http/api.js';
	export default {
		components: {
		},
		onLoad(option) {},
		data() {
			return {
				list: [],
				title: '今日测站动态信息',
				pageSize: 10,
				// 当前页
				pageCurrent: 1,
				// 数据总量
				total: 0,
			}
		},
		computed: {
		},
		onShow() {
			this.getPage();
		},
		methods: {
			toBack() {
				uni.navigateBack({
					delta: 1
				})
			},
			// 分页触发
			pageChange(e) {
				this.pageCurrent = e.current;
				this.getPage()
			},
			getPage() {
				let that = this;
				const current = this.pageCurrent;
				const size = this.pageSize;
				http.request({
					url: '/galaxy-business/rtu/check/order/process/today/page',
					method: 'GET',
					params: {
						current,
						size,
					},
				}).then(res => {
					if (res.success) {
						if (res.data.records != null) {
							that.list = res.data.records;
						}
						this.total = res.data.total;
					}
				}).catch(err => {
					console.log(err)
				})
			},
			toOrderProcessDetail(id) {
				console.log("opne record ", id)
				var url = '/pages/check-order/orderprocessreportdetail?orderId=' + id;
				uni.navigateTo({
					url: url
				})
			},
		}
	}
</script>

<style>

</style>

<style lang="scss" scoped>

</style>
