<template>
	<view class="container">
		<tui-list-cell :hover="false">
			<view class="fs-flex__between fs-ellipsis"><view>巡检编码</view><view class="fs-ellipsis ">{{info.planNo}}</view></view>
		</tui-list-cell>
		<tui-list-cell :hover="false">
			<view class="fs-flex__between fs-ellipsis"><view>计划名称</view><view class="fs-ellipsis">{{info.planName}}</view></view>
		</tui-list-cell>
		<tui-list-cell :hover="false">
			<view class="fs-flex__between fs-ellipsis"><view>归属公司</view><view class="fs-ellipsis">{{info.belongCompanyName}}</view></view>
		</tui-list-cell>
		<tui-list-cell :hover="false">
			<view class="fs-flex__between fs-ellipsis"><view>道路名称</view><view class="fs-ellipsis ">{{info.roadName}}</view></view>
		</tui-list-cell>
		<!--
		<tui-list-cell :hover="false">
			<view class="fs-flex__between"><view>植物类型</view><view>{{info.maintainSubjectName}}</view></view>
		</tui-list-cell>
		-->
		<tui-list-cell :hover="false">
			<view class="fs-flex__between"><view>养护类型</view><view>{{info.maintainTypeName}}</view></view>
		</tui-list-cell>
		<tui-list-cell :hover="false">
			<view class="fs-flex__between"><view>养护等级</view><view>{{info.curingLevelName}}</view></view>
		</tui-list-cell>
		<tui-list-cell :hover="false">
			<view class="fs-flex__between"><view>周 期</view><view>{{info.levelValue}}{{info.cycleName}}</view></view>
		</tui-list-cell>
		<tui-list-cell :hover="false">
			<view class="fs-flex__between"><view>计划开启</view><view>{{info.beginTimePlus}}</view></view>
		</tui-list-cell>
		<tui-list-cell :hover="false">
			<view class="fs-flex__between"><view>计划结束</view><view>{{info.endTimePlus}}</view></view>
		</tui-list-cell>
		<tui-list-cell :hover="false">
			<view class="fs-flex__between"><view>计划次数</view><view>{{info.planNum}}</view></view>
		</tui-list-cell>
		<tui-list-cell :hover="false" unlined>
			<view class="fs-flex__between"><view>完成次数</view><view>{{info.planFinishNum}}</view></view>
		</tui-list-cell>
		<view class="fs-mt60 fs-flex__center fs-safe__area" v-if="!info.planStatus">
			<tui-button shape="circle" width="500rpx" height="80rpx" shadow @click="toAdd">添加巡检记录</tui-button>
		</view>
	</view>
</template>

<script>
import { apiInspectionDetail } from '@/api/work'
export default {
	data() {
		return {
			info: {},
      planno:''
		}
	},
	onLoad(options) {
    this.planno = options.planno
	},
  onShow(){
    this.getInspectionInfo()
  },
	methods: {
		// 获取巡检详情
		getInspectionInfo() {
			apiInspectionDetail({data:{plan_no:this.planno}}).then(res => {
				this.info = res.data
			})
		},
		// 跳转记录添加
		toAdd() {
			uni.$tui.href(`/pages/work/daily/inspection/add?id=${this.info.id}&planno=${this.info.planNo}`)
		}
	}
}
</script>

<style lang="scss" scoped>

</style>
