huwhois 5 years ago
parent
commit
8fc903a8f7
1 changed files with 45 additions and 13 deletions
  1. 45 13
      src/views/modules/admin/lecture-add-or-update.vue

+ 45 - 13
src/views/modules/admin/lecture-add-or-update.vue

@ -7,8 +7,25 @@
7 7
    <el-form-item label="会议id" prop="meetingId">
8 8
      <el-input v-model="dataForm.meetingId" placeholder="会议id"></el-input>
9 9
    </el-form-item>
10
    <el-form-item label="演讲人id" prop="speaker">
11
      <el-input v-model="dataForm.speaker" placeholder="演讲人id"></el-input>
10
    <el-form-item label="演讲人id" prop="attendersId">
11
      <template>
12
        <el-select
13
          v-model="dataForm.attendersId"
14
          filterable
15
          remote
16
          reserve-keyword
17
          placeholder="请输入姓名"
18
          :remote-method="selectAttendersIdByname"
19
          :loading="loading">
20
          <el-option
21
            v-for="item in options"
22
            :key="item.id"
23
            :label="item.name"
24
            :value="item.id">
25
          </el-option>
26
        </el-select>
27
      </template>
28
      <!-- <el-input v-model="dataForm.attendersId" placeholder="演讲人id"></el-input> -->
12 29
    </el-form-item>
13 30
    <el-form-item label="题目" prop="topic">
14 31
      <el-input v-model="dataForm.topic" placeholder="题目"></el-input>
@ -44,7 +61,7 @@
44 61
        dataForm: {
45 62
          id: 0,
46 63
          meetingId: '',
47
          speaker: '',
64
          attendersId: '',
48 65
          topic: '',
49 66
          branchId: '',
50 67
          speechTime: '',
@ -56,7 +73,7 @@
56 73
          meetingId: [
57 74
            { required: true, message: '会议id不能为空', trigger: 'blur' }
58 75
          ],
59
          speaker: [
76
          attendersId: [
60 77
            { required: true, message: '演讲人id不能为空', trigger: 'blur' }
61 78
          ],
62 79
          topic: [
@ -70,18 +87,16 @@
70 87
          ],
71 88
          summary: [
72 89
            { required: true, message: '摘要不能为空', trigger: 'blur' }
73
          ],
74
          createTime: [
75
            { required: true, message: '創建時間不能为空', trigger: 'blur' }
76
          ],
77
          isDel: [
78
            { required: true, message: '是否被删除 状态  0:正常   1:删除不能为空', trigger: 'blur' }
79 90
          ]
80
        }
91
        },
92
        options: [],
93
        loading: false,
94
        meetingId: 0
81 95
      }
82 96
    },
83 97
    methods: {
84 98
      init (id) {
99
        this.meetingId = this.$route.params.id
85 100
        this.dataForm.id = id || 0
86 101
        this.visible = true
87 102
        this.$nextTick(() => {
@ -94,7 +109,7 @@
94 109
            }).then(({data}) => {
95 110
              if (data && data.code === 0) {
96 111
                this.dataForm.meetingId = data.lecture.meetingId
97
                this.dataForm.speaker = data.lecture.speaker
112
                this.dataForm.attendersId = data.lecture.attendersId
98 113
                this.dataForm.topic = data.lecture.topic
99 114
                this.dataForm.branchId = data.lecture.branchId
100 115
                this.dataForm.speechTime = data.lecture.speechTime
@ -116,7 +131,7 @@
116 131
              data: this.$http.adornData({
117 132
                'id': this.dataForm.id || undefined,
118 133
                'meetingId': this.dataForm.meetingId,
119
                'speaker': this.dataForm.speaker,
134
                'attendersId': this.dataForm.attendersId,
120 135
                'topic': this.dataForm.topic,
121 136
                'branchId': this.dataForm.branchId,
122 137
                'speechTime': this.dataForm.speechTime,
@ -141,6 +156,23 @@
141 156
            })
142 157
          }
143 158
        })
159
      },
160
      // 通过姓名模糊查询参会人员id
161
      selectAttendersIdByname (name) {
162
        this.loading = true
163
        this.$http({
164
          url: this.$http.adornUrl(`/admin/attenders/selectbyname`),
165
          method: 'get',
166
          params: this.$http.adornParams({
167
            'name': name,
168
            'meetingId': this.meetingId
169
          })
170
        }).then(({data}) => {
171
          if (data && data.code === 0) {
172
            this.loading = false
173
            this.options = data.list
174
          }
175
        })
144 176
      }
145 177
    }
146 178
  }