<template lang="pug">
  <div class='m_i_dialog'>
    <el-dialog title="详情" width="725px" :close-on-click-modal='false' :visible.sync='visible' :modal-append-to-body='false'>
      <span slot='title' class="title-bold">巡查结果详情</span>
      <el-form :model='dataForm' :rules='dataRule'  ref='dataForm' :inline='true'  label-width="100px">
        <el-form-item label='计划名称:' prop='port'>
          <el-input v-model='dataForm.planName' readonly></el-input>
        </el-form-item>
        <el-form-item label='巡查员:' prop='port'>
          <el-input v-model='dataForm.patrollerName' readonly></el-input>
        </el-form-item>
        <el-form-item label='开始时间:' prop='port'>
          <el-input v-model='dataForm.startTime' readonly></el-input>
        </el-form-item>
        <el-form-item label='结束时间:' prop='port'>
          <el-input v-model='dataForm.endTime' readonly></el-input>
        </el-form-item>
      </el-form>
      <el-table :data="dataList" v-loading="dataListLoading" :stripe="true" :header-cell-style="{background:'#EEF8FF',color:'#333333'}" style="width: 100%;">
        <el-table-column type="index" header-align="center" align="center" width='80' label="序号"></el-table-column>
        <el-table-column prop="pointName" header-align="center" align="center" label="巡查点"></el-table-column>
        <el-table-column prop="patrolTime" header-align="center" align="center" label="巡查时间"></el-table-column>
        <el-table-column align="center" label="巡查状态">
          <template slot-scope="scope">
            <div v-if="scope.row.patrolStatus==0">漏检</div>
            <div v-if="scope.row.patrolStatus==1">正常</div>
          </template>
        </el-table-column>
      </el-table>
      <span class="dialog-footer" slot='footer'>
        <el-button type="primary" @click='visible = false'>关闭</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  computed: {
    ...mapState('d2admin/user', [
      'info'
    ])
  },
  data () {
    return {
      visible: false,
      dataForm: {},
      dataListLoading: false,
      dataList: [],
      dataRule: {}
    }
  },
  created() {

  },
  methods: {
    init (res) {
      this.visible = true
      this.dataForm = res
      this.$http({
        url: this.$http.adornUrlEq('/epPatrolResult/getId'),
        method: 'get',
        params: {
                id: res.id,
                stationId: res.stationId
              }
      }).then(data => {
        //console.log('data', data)
        if (data && data.code === 0) {
          this.dataForm = data.bean
          this.dataList = this.dataForm.pointList
        } else {
          this.dataList = []
        }
      })
    }
  }
}
</script>
<style>

</style>
