<template>
  <div id="detail">
    <el-row>
      <el-col :span="24" class="main">
        <el-col :span="24" class="top">
          <el-button type="primary" size="mini" @click="back">返回</el-button>
        </el-col>
        <el-col :span="24" class="down">
          <data-table :fields="fields" :opera="opera" :data="list" :total="total" @query="search" @view="toView"></data-table>
        </el-col>
      </el-col>
    </el-row>
    <el-dialog title="会审意见" width="40%" :visible.sync="dialog" @closed="handleClose" :destroy-on-close="true">
      <scoreInfo :form="info"></scoreInfo>
    </el-dialog>
  </div>
</template>

<script>
import scoreInfo from './parts/scoreInfo.vue';
import dataTable from '@common/src/components/frame/filter-page-table.vue';
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  metaInfo() {
    return { title: this.$route.meta.title };
  },
  name: 'detail',
  props: {},
  components: {
    dataTable,
    scoreInfo,
  },
  data: function() {
    return {
      opera: [
        {
          label: '专家意见查看',
          method: 'view',
          // 只有专家已评分，才可看评分相亲
          display: item => {
            return item.status == '1' ? true : false;
          },
        },
      ],
      fields: [
        { label: '专家姓名', prop: 'name', filter: 'input', showTip: true },
        { label: '联系电话', prop: 'phone', showTip: true },
        { label: '状态', prop: 'status' },
      ],
      list: [
        {
          name: '专家姓名',
          phone: '17319450324',
          content: '评分详情',
          status: '0',
        },
        {
          name: '专家姓名',
          phone: '17319450324',
          content: '评分详情',
          status: '1',
        },
      ],
      total: 0,
      // 查看会审信息
      dialog: false,
      info: {},
    };
  },
  async created() {
    await this.search();
  },
  methods: {
    // 查询列表
    async search({ skip = 0, limit = 10, ...info } = {}) {},
    // 专家评分查看
    toView({ data }) {
      this.$set(this, `info`, data);
      this.dialog = true;
    },
    // 取消查看
    handleClose() {
      this.form = {};
      this.dialog = false;
    },
    // 返回列表
    back() {
      this.$router.push({ path: '/adminMeet' });
    },
  },
  computed: {
    ...mapState(['user']),
  },
  watch: {},
};
</script>

<style lang="less" scoped>
.main {
  .top {
    margin: 0 0 10px 0;
    text-align: right;
  }
}
</style>
