<template>
  <div id="achieveList">
    <el-row>
      <el-col :span="24" class="list">
        <van-collapse v-model="openCollapse">
          <van-collapse-item :name="index" v-for="(item, index) in achieveList" :key="index">
            <div slot="title" class="title">
              <span class="name">{{ item.studentid }}</span>
              <van-button type="primary" size="mini" @click="clickBtn()">上成绩</van-button>
            </div>
            <van-row v-for="(tag, index) in item.lesson" :key="index">
              <van-col :span="14" class="score"> 课程名称：{{ tag.lessonid }} </van-col>
              <van-col :span="10" class="score"> 作业分：{{ tag.score }} 分</van-col>
            </van-row>
          </van-collapse-item>
        </van-collapse>
      </el-col>
    </el-row>
    <van-dialog v-model="show" title="学生成绩上传" :showConfirmButton="false">
      <van-form @submit="onSubmit">
        <van-field v-model="form.name" name="学生名称" disabled />
        <van-field v-model="form.lessonid" name="课程名称" label="课程名称" placeholder="请输入课程名称" />
        <van-field v-model="form.score" name="作业分数" label="作业分数" placeholder="请输入作业分数" />
        <div style="margin: 16px;">
          <van-button round block type="info" native-type="submit">
            提交
          </van-button>
        </div>
      </van-form>
    </van-dialog>
  </div>
</template>

<script>
export default {
  name: 'achieveList',
  props: {
    achieveList: null,
    show: null,
    form: null,
    lessonList: null,
  },
  components: {},
  data: () => ({
    openCollapse: [],
    option1: [
      { text: '全部商品', value: 0 },
      { text: '新款商品', value: 1 },
    ],
  }),
  created() {},
  computed: {},
  methods: {
    clickBtn() {
      this.$emit('clickDialog');
    },
    onSubmit() {
      this.$emit('submit', { data: this.form });
    },
  },
};
</script>

<style lang="less" scoped>
p {
  padding: 0;
  margin: 0;
}
.list {
  background: #fff;
  margin: 0 5px 5px 5px;
  width: 97%;
  padding: 0 10px;
  border-radius: 15px;
}
.list .title {
  float: left;
  width: 100%;
}
.list .name {
  float: left;
  width: 80%;
  font-size: 20px;
}
/deep/.el-collapse-item__content {
  padding: 10px 0 10px 0;
}
.list .score {
  padding: 10px 0;
  font-size: 18px;
}
</style>
