<template>
  <div class="app-container">
    <div class="info">
      <div>
        <div class="title">检测信息</div>
      <el-form ref="form" :model="form" label-width="120px" label-position="left">
        <el-row :gutter="20">
          <el-col :span="11">
            <el-form-item label="仓房名称">
              <el-input v-model="form.houseCode"></el-input>
            </el-form-item>
            <el-form-item label="虫害检测方法">
              <el-input v-model="form.ff"></el-input>
            </el-form-item>
            <el-form-item label="密度(头/公斤)">
              <el-input v-model="form.md"></el-input>
            </el-form-item>
            <el-form-item label="害虫抗药性分析">
              <el-input v-model="form.kyxfx"></el-input>
            </el-form-item>
            <el-form-item label="二氧化氮(ppm)">
              <el-input v-model="form.co2"></el-input>
            </el-form-item>
            <el-form-item label="检测时间">
              <el-input v-model="form.collectorTime"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="11" :offset="2">
            <el-form-item label="虫害检测单号">
              <el-input v-model="form.testSheet"></el-input>
            </el-form-item>
            <el-form-item label="害虫种类">
              <el-input v-model="form.kind"></el-input>
            </el-form-item>
            <el-form-item label="虫害等级">
              <el-input v-model="form.chdj"></el-input>
            </el-form-item>
            <el-form-item label="氧气">
              <el-input v-model="form.o2"></el-input>
            </el-form-item>
            <el-form-item label="磷化氢(ppm)">
              <el-input v-model="form.lhq"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      </div>
      
      <el-footer style="height: 41px;">
        <el-button type="primary" class="footerBtn" @click="back">返 回</el-button>
      </el-footer>
    </div>
  </div>
</template>

<script>
import { getPestItem } from '@/api/grainDetection/pestDetection/index'
export default {
  data () {
    return {
      form: {
        houseCode: '1号仓',
        ff: '自动检测',
        md: '2.3',
        kyxfx: '无抗药性',
        co2: '0.3',
        collectorTime: '2022-01-12',
        testSheet: '43091199802128911',
        kind: '玉米虫',
        chdj: '三级',
        o2: '60',
        lhq: '3'
      },
    }
  },
  created () {
    // console.log(this.$route.query, 'query')
  },
  mounted () {
    console.log(this.$route.params.data, 'this.$route.params.data')
    this.form = this.$route.params.data
    if (this.$route.params.data.id) {
      console.log('cunzaiid')
      this.getDetail()
    }
  },
  methods: {
    getDetail () {
      let id = this.$route.params.data.id
      getPestItem(id).then(res => {
        console.log(res, 'getPestItem')
        if (res.code == 200) {

        }
      }).catch(err => {
        console.log(err)
      })
    },
    back () {
      this.$router.push({ name: "PestDetection" })
    }
  }
}
</script>
<style lang='scss' scoped>
.info {
  background-color: #fff;
  border-radius: 15px;
  padding: 10px 15px;
  height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  .title {
    border-left: 4px solid #4a7de6;
    padding-left: 10px;
  }
  .el-form {
    margin-top: 15px;
  }
}
.table {
  border-radius: 0.185185rem;
}
.th {
  height: 1.074074rem;
  line-height: 1.074074rem;
  background-color: #1d9eef;
  text-align: center;
  // border: 1px solid #000;
}
.list-tr {
  height: 1.074074rem;
  line-height: 1.074074rem;
  border: 1px solid #000;
}
td {
  text-align: center;
}
// ::v-deep .el-input__inner {
//   text-align: center;
// }
.el-footer {
  text-align: center;
  margin-top: 15px;
  margin-bottom: 15px;
  width: 100%;
  color: #888;
  font-weight: 500;
  font-family: Source Han Sans CN;
  font-size: 14px;
  text-align: center;
  z-index: 2;
  .footerBtn {
    width: 300px;
    border-radius: 20px;
  }
}
</style>
