huwhois 5 ans auparavant
Parent
commit
8fc903a8f7
1 fichiers modifiés avec 45 ajouts et 13 suppressions
  1. 45 13
      src/views/modules/admin/lecture-add-or-update.vue

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

7
    <el-form-item label="会议id" prop="meetingId">
7
    <el-form-item label="会议id" prop="meetingId">
8
      <el-input v-model="dataForm.meetingId" placeholder="会议id"></el-input>
8
      <el-input v-model="dataForm.meetingId" placeholder="会议id"></el-input>
9
    </el-form-item>
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
    </el-form-item>
29
    </el-form-item>
13
    <el-form-item label="题目" prop="topic">
30
    <el-form-item label="题目" prop="topic">
14
      <el-input v-model="dataForm.topic" placeholder="题目"></el-input>
31
      <el-input v-model="dataForm.topic" placeholder="题目"></el-input>
44
        dataForm: {
61
        dataForm: {
45
          id: 0,
62
          id: 0,
46
          meetingId: '',
63
          meetingId: '',
47
          speaker: '',
64
          attendersId: '',
48
          topic: '',
65
          topic: '',
49
          branchId: '',
66
          branchId: '',
50
          speechTime: '',
67
          speechTime: '',
56
          meetingId: [
73
          meetingId: [
57
            { required: true, message: '会议id不能为空', trigger: 'blur' }
74
            { required: true, message: '会议id不能为空', trigger: 'blur' }
58
          ],
75
          ],
59
          speaker: [
76
          attendersId: [
60
            { required: true, message: '演讲人id不能为空', trigger: 'blur' }
77
            { required: true, message: '演讲人id不能为空', trigger: 'blur' }
61
          ],
78
          ],
62
          topic: [
79
          topic: [
70
          ],
87
          ],
71
          summary: [
88
          summary: [
72
            { required: true, message: '摘要不能为空', trigger: 'blur' }
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
    methods: {
97
    methods: {
84
      init (id) {
98
      init (id) {
99
        this.meetingId = this.$route.params.id
85
        this.dataForm.id = id || 0
100
        this.dataForm.id = id || 0
86
        this.visible = true
101
        this.visible = true
87
        this.$nextTick(() => {
102
        this.$nextTick(() => {
94
            }).then(({data}) => {
109
            }).then(({data}) => {
95
              if (data && data.code === 0) {
110
              if (data && data.code === 0) {
96
                this.dataForm.meetingId = data.lecture.meetingId
111
                this.dataForm.meetingId = data.lecture.meetingId
97
                this.dataForm.speaker = data.lecture.speaker
112
                this.dataForm.attendersId = data.lecture.attendersId
98
                this.dataForm.topic = data.lecture.topic
113
                this.dataForm.topic = data.lecture.topic
99
                this.dataForm.branchId = data.lecture.branchId
114
                this.dataForm.branchId = data.lecture.branchId
100
                this.dataForm.speechTime = data.lecture.speechTime
115
                this.dataForm.speechTime = data.lecture.speechTime
116
              data: this.$http.adornData({
131
              data: this.$http.adornData({
117
                'id': this.dataForm.id || undefined,
132
                'id': this.dataForm.id || undefined,
118
                'meetingId': this.dataForm.meetingId,
133
                'meetingId': this.dataForm.meetingId,
119
                'speaker': this.dataForm.speaker,
134
                'attendersId': this.dataForm.attendersId,
120
                'topic': this.dataForm.topic,
135
                'topic': this.dataForm.topic,
121
                'branchId': this.dataForm.branchId,
136
                'branchId': this.dataForm.branchId,
122
                'speechTime': this.dataForm.speechTime,
137
                'speechTime': this.dataForm.speechTime,
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
  }