headStuList.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <div id="headStuList">
  3. <el-row type="flex" justify="center" style="padding:10px 0">
  4. <el-col :span="6">
  5. <el-button type="primary" plain size="mini" @click.native="$router.push({ path: '/class/achieve', query: { classid: $attrs.classid } })">
  6. 查看平时成绩
  7. </el-button>
  8. </el-col>
  9. </el-row>
  10. <el-row>
  11. <el-col :span="24" class="info">
  12. <el-col :span="6" class="list" v-for="(item, index) in headStuList" :key="index" @click.native="clickAssign(item.id)">
  13. <p class="name">{{ item.name }}</p>
  14. <p class="job" v-if="item.job">{{ item.job }}<i class="el-icon-circle-check"></i></p>
  15. </el-col>
  16. </el-col>
  17. </el-row>
  18. <el-dialog title="指派职务" width="90%" :visible.sync="assignShow" :before-close="handleClose">
  19. <el-form :model="assignForm">
  20. <el-form-item label="学生姓名">
  21. <!-- <el-input v-model="assignForm.name" :disabled="true"></el-input> -->
  22. {{ assignForm.name }}
  23. </el-form-item>
  24. <el-form-item label="学生职务">
  25. <el-select v-model="assignForm.job" placeholder="请选择学生职务">
  26. <el-option v-for="(item, index) in job_list" :key="index" :label="item.name" :value="item.name"></el-option>
  27. </el-select>
  28. </el-form-item>
  29. </el-form>
  30. <div slot="footer" class="dialog-footer">
  31. <el-button @click="outAssignShow">取 消</el-button>
  32. <el-button type="primary" @click="onAssignShow">确 定</el-button>
  33. </div>
  34. </el-dialog>
  35. </div>
  36. </template>
  37. <script>
  38. export default {
  39. name: 'headStuList',
  40. props: {
  41. headStuList: null,
  42. assignForm: null,
  43. assignShow: null,
  44. job_list: null,
  45. },
  46. components: {},
  47. data: () => ({}),
  48. created() {},
  49. computed: {},
  50. methods: {
  51. clickAssign(id) {
  52. this.$emit('assign', id);
  53. },
  54. outAssignShow() {
  55. this.$emit('outForm');
  56. },
  57. onAssignShow(id) {
  58. this.$emit('onForm', { data: this.assignForm });
  59. },
  60. handleClose() {
  61. this.$emit('handleClose');
  62. },
  63. },
  64. };
  65. </script>
  66. <style lang="less" scoped>
  67. p {
  68. padding: 0;
  69. margin: 0;
  70. }
  71. .info {
  72. margin: 15px 0 0 0;
  73. }
  74. .list {
  75. text-align: center;
  76. min-height: 50px;
  77. }
  78. .list .job {
  79. font-size: 10px;
  80. color: #405ffe;
  81. }
  82. </style>