<template>
  <el-dialog width="40%" :title="title" :visible.sync="visible" append-to-body @close="visible = false">
    <div v-if="classTypeList == undefined || classTypeList.length == 0">无班型数据</div>
    <el-table v-else :data="classTypeList" style="height: 300px; overflow-y: auto">
      <el-table-column label="班型" min-width="140">
        <template slot-scope="scope">
          <span>{{ scope.row.licenseType }}-{{ scope.row.typeName }}</span>
        </template>
      </el-table-column>
      <el-table-column property="currentPrice" label="报价" width="100" />
      <el-table-column property="minPrice" label="底价" width="100" />
      <el-table-column property="description" label="描述" width="200" show-overflow-tooltip />
    </el-table>
  </el-dialog>
</template>
<script>
import { getAllList } from '@/api/sch/classType'

export default {
  data() {
    return {
      classTypeList: [],
      visible: false,
      title: ''
    }
  },
  methods: {
    async init(info) {
      this.title = info.schoolName + '-' + info.name + '-班型报价';
      const resp = await getAllList({
        schoolId: info.schoolId,
        placeId: info.placeId,
        status: '0'
      });
      if (resp.code == 200) {
        this.classTypeList = resp.data
      }
      this.visible = true
    },
  },
}
</script>