<template>
  <!-- 详情 -->
  <div class="detail-container">
    <div class="detail-top">
      <div class="left-top">
        <img src="@/assets/images/back.png" @click="cancel()" />
        <div class="left-title"></div>
      </div>
      <div class="right-top">
        <el-button @click="cancel()">{{ $t('form.cancel') }}</el-button>
        <el-button @click="exportExcel()">{{ $t('form.export') }}</el-button>
      </div>
    </div>
    <div class="detail-title"><img src="@/assets/images/detail-title.png">{{ $t('page.business.resource.mjy.ffjlxq')
      }}<img src="@/assets/images/detail-title.png" /></div>
    <div class="detail-content">
      <div class="content-left">
        <div class="content-title">
          <div class="line"></div>
          <div class="subtitle"> 基本信息</div>
        </div>
        <div class="pal">
          <div class="left">
            <div class="left-title">{{ $t('page.business.resource.gsp.mc') }}</div>
            <el-input type="text" :value="form.mc" maxlength="50" disabled />
          </div>
          <div class="right">
            <div class="right-title">{{ $t('page.business.resource.gsp.bh') }}</div>
            <el-input type="text" :value="form.bh" maxlength="50" disabled />
          </div>
        </div>
        <div class="pal">
          <div class="left">
            <div class="left-title">{{ $t('page.business.resource.gsp.ph') }}</div>
            <el-input type="text" :value="form.ph" maxlength="50" disabled />
          </div>
          <div class="right">
            <div class="right-title">{{ $t('page.business.resource.gsp.gg') }}</div>
            <el-input type="text" :value="form.gg" maxlength="50" disabled>
              <template slot="append">{{ form.ggdw }}</template>
            </el-input>
          </div>
        </div>
        <div class="pal">
          <div class="left">
            <div class="left-title">{{ $t('page.business.resource.gsp.yxq') }}</div>
            <el-input type="text" :value="form.yxq" maxlength="50" disabled />
          </div>
          <div class="right">
            <div class="right-title">{{ $t('page.business.resource.gsp.cctj') }}</div>
            <el-input type="text" :value="form.cctj" maxlength="50" disabled />
          </div>
        </div>
        <div class="pal">
          <div class="left">
            <div class="left-title">{{ $t('page.business.resource.gsp.jsrq') }}</div>
            <el-input type="text" :value="form.jsrq" maxlength="50" disabled />
          </div>
          <div class="right">
            <div class="right-title">{{ $t('page.business.resource.gsp.ffzytj') }}</div>
            <el-input type="text" :value="form.ffzytj" maxlength="50" disabled />
          </div>
        </div>
        <div class="pal">
          <div class="left">
            <div class="left-title">{{ $t('page.business.resource.gsp.ckl') }}</div>
            <el-input type="text" :value="form.ckl" maxlength="50" disabled> <template slot="append">{{ form.ckldw
                }}</template>
            </el-input>
          </div>
          <div class="right">
            <div class="right-title">{{ $t('page.business.resource.gsp.lqr1') }}</div>
            <el-input type="text" :value="form.lqr1Mc" maxlength="50" disabled />
          </div>
        </div>
        <div class="pal">
          <div class="left">
            <div class="left-title">{{ $t('page.business.resource.gsp.lqr2') }}</div>
            <el-input type="text" :value="form.lqr2Mc" maxlength="50" disabled />
          </div>
          <div class="right">
            <div class="right-title">{{ $t('page.business.resource.gsp.kgy1') }}</div>
            <el-input type="text" :value="form.ghr1Mc" maxlength="50" disabled />
          </div>
        </div>
        <div class="pal">
          <div class="left">
            <div class="left-title">{{ $t('page.business.resource.gsp.kgy2') }}</div>
            <el-input type="text" :value="form.ghr2Mc" maxlength="50" disabled />
          </div>
          <div class="right">
            <div class="right-title">{{ $t('page.business.resource.gsp.ghzytj') }}</div>
            <el-input type="text" :value="form.ghzytj" maxlength="50" disabled />
          </div>
        </div>
        <div class="pal">
          <div class="left">
            <div class="left-title">{{ $t('page.business.resource.gsp.rkl') }}</div>
            <el-input type="text" :value="form.rkl" maxlength="50" disabled> <template slot="append">{{ form.rkldw
                }}</template>
            </el-input>
          </div>
        </div>
        <div class="pal">
          <div class="left">
            <div class="left-title">{{ $t('page.business.resource.gsp.ffbz') }}</div>
            <el-input type="text" :value="form.ffbz" disabled />
          </div>
          <div class="right">
            <div class="right-title">{{ $t('page.business.resource.gsp.ghbz') }}</div>
            <el-input type="text" :value="form.ghbz" disabled />
          </div>
        </div>

        <div class="pal">
          <div class="left">
            <div class="left-title">{{ $t('page.business.resource.gsp.gdsqr') }}</div>
            <el-input type="text" :value="form.gdsqrMc" maxlength="50" disabled />
          </div>
          <div class="right">
            <div class="right-title">{{ $t('page.business.resource.gsp.cjsj') }}</div>
            <el-input type="text" :value="form.createTime" maxlength="50" disabled />
          </div>
        </div>
        <div class="pal">
          <div class="left">
            <div class="left-title">{{ $t('page.business.resource.gsp.jlzt') }}</div>
            <el-select v-model="form.jlzt" disabled style="width: 100%;">
              <el-option :label="$t('page.business.resource.resource.jlzt.wsd')" :value="1" />
              <el-option :label="$t('page.business.resource.resource.jlzt.ysd')" :value="3" />
              <el-option :label="$t('page.business.resource.resource.jlzt.dgd')" :value="5" />
              <el-option :label="$t('page.business.resource.resource.jlzt.gd')" :value="7" />
              <el-option :label="$t('page.business.resource.resource.jlzt.djd')" :value="9" />
            </el-select>
          </div>
          <div class="right">
            <div class="right-title">{{ $t('page.business.resource.gsp.jyzt') }}</div>
            <el-select v-model="form.jyzt" disabled style="width: 100%;">
              <el-option :label="$t('page.business.resource.resource.jyzt.wjy')" :value="1" />
              <el-option :label="$t('page.business.resource.resource.jyzt.djy')" :value="3" />
              <el-option :label="$t('page.business.resource.resource.jyzt.jyz')" :value="5" />
            </el-select>
          </div>
        </div>
      </div>
      <div class="content-right">
        <div class="content-title">
          <div class="line"></div>
          <div class="subtitle"> 稽查轨迹日志</div>
        </div>
        <jcgjList ref="jcgjList" @handleQuery="getJjcgjList" />

        <pagination v-show="jcgjTotal > 0" small layout="prev, pager, next" :total="jcgjTotal"
          @pagination="getJjcgjList" :limit="queryJcgjParams.pageSize" />
      </div>
    </div>
  </div>
</template>

<script>
import { info, jcgjList } from "@/api/business/gsp/gspFfjl"
import JcgjList from "@/views/business/comps/common/JcgjList";

export default {
  name: "Xq",
  components: { JcgjList },
  data() {
    return {
      form: {},
      jcgjTotal: 0,
      jcgjList: [],
      open: false,
      queryJcgjParams: {
        pageNum: 1,
        ffjlId: null,
        pageSize: 5,
      }
    }
  },
  created() {
  },
  methods: {
    exportExcel() {
      alert('todo')
    },
    cancel() {
      this.open = false
      this.$emit('callback')
    },
    getJjcgjList(val) {
      this.$modal.loading()
      jcgjList(_.merge({}, this.queryJcgjParams, val)).then(response => {
        this.jcgjList = response.rows
        this.jcgjTotal = response.total
        if (this.queryJcgjParams.pageNum == 1) {
          this.$refs.jcgjList.init(this.jcgjList)
        } else {
          this.$refs.jcgjList.add(this.jcgjList)
        }
        this.$modal.closeLoading()
      })
    },
    show(row) {
      this.$modal.loading()
      this.queryJcgjParams.ffjlId = row.id
      info({ id: row.id }).then(response => {
        this.form = response.data
        this.open = true
        this.getJjcgjList()
      })
    }
  }
}
</script>
