|
@@ -20,12 +20,7 @@
|
|
|
placeholder="所在机构"
|
|
|
@change="onDoctorClubChange"
|
|
|
>
|
|
|
- <el-option
|
|
|
- v-for="item in clubList"
|
|
|
- :key="item.authId"
|
|
|
- :label="item.authParty"
|
|
|
- :value="item.authId"
|
|
|
- />
|
|
|
+ <el-option v-for="item in clubList" :key="item.authId" :label="item.authParty" :value="item.authId" />
|
|
|
</el-select>
|
|
|
<el-input v-show="false" v-model="formData.clubName" />
|
|
|
</el-form-item>
|
|
@@ -56,18 +51,24 @@
|
|
|
<el-form-item label="培训师标签" prop="tagList">
|
|
|
<el-input v-show="false" v-model="formData.tagList" />
|
|
|
<div class="tag-control">
|
|
|
- <input v-model="tagName" class="el-input el-input__inner" placeholder="输入标签名后点击添加按钮(15个字符内)" maxlength="15">
|
|
|
+ <input
|
|
|
+ v-model="tagName"
|
|
|
+ class="el-input el-input__inner"
|
|
|
+ placeholder="输入标签名后点击添加按钮(15个字符内)"
|
|
|
+ maxlength="15"
|
|
|
+ >
|
|
|
<el-button type="primary" @click="addTag">添加</el-button>
|
|
|
</div>
|
|
|
<div class="tag-list">
|
|
|
- <el-tag v-for="(item,index) in addTagList" :key="index" closable @close="onTagClose(index)">{{ item }}</el-tag>
|
|
|
+ <el-tag v-for="(item, index) in addTagList" :key="index" closable @close="onTagClose(index)">{{
|
|
|
+ item
|
|
|
+ }}</el-tag>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="自定义属性">
|
|
|
<doctor-custom-items v-if="!isRequest" ref="customItems" @change="customItemsChange" />
|
|
|
</el-form-item>
|
|
|
-
|
|
|
</el-form>
|
|
|
<div class="submit-btn">
|
|
|
<el-button type="primary" @click="submit">保存</el-button>
|
|
@@ -79,7 +80,7 @@
|
|
|
<script>
|
|
|
import { Promise } from 'jszip/lib/external'
|
|
|
import { mapGetters } from 'vuex'
|
|
|
-import DoctorCustomItems from '@/views/components/DoctorCustomItems/index.vue'
|
|
|
+import { DoctorCustomItems } from '@/views/components'
|
|
|
import UploadImage from '@/components/UploadImage'
|
|
|
import { doctorSave, doctorFormData, fetchDoctorClubList } from '@/api/doctor'
|
|
|
|
|
@@ -172,7 +173,6 @@ export default {
|
|
|
this.initFormData()
|
|
|
},
|
|
|
methods: {
|
|
|
-
|
|
|
// 添加标签
|
|
|
addTag() {
|
|
|
this.addTagList.push(this.tagName.trim())
|
|
@@ -211,15 +211,17 @@ export default {
|
|
|
initFormData() {
|
|
|
if (this.editType !== 'edit') {
|
|
|
this.$nextTick(() => {
|
|
|
- this.$refs.customItems.setParamsItem([{
|
|
|
- name: '',
|
|
|
- content: ''
|
|
|
- }])
|
|
|
+ this.$refs.customItems.setParamsItem([
|
|
|
+ {
|
|
|
+ name: '',
|
|
|
+ content: ''
|
|
|
+ }
|
|
|
+ ])
|
|
|
})
|
|
|
this.isRequest = false
|
|
|
return
|
|
|
}
|
|
|
- doctorFormData({ doctorId: this.doctorId }).then(res => {
|
|
|
+ doctorFormData({ doctorId: this.doctorId }).then((res) => {
|
|
|
this.setFormData(res.data)
|
|
|
})
|
|
|
},
|
|
@@ -235,7 +237,7 @@ export default {
|
|
|
this.formData.banner = data.bannerList.length
|
|
|
this.formData.equipmentList = data.equipmentList.length
|
|
|
this.doctorImageList.push({ url: data.doctorImage, name: 'doctor' })
|
|
|
- this.bannerList = data.bannerList.map(item => ({ url: item, name: '' }))
|
|
|
+ this.bannerList = data.bannerList.map((item) => ({ url: item, name: '' }))
|
|
|
this.deviceList = data.equipmentList
|
|
|
this.paramList = data.paramList
|
|
|
this.addTagList = data.tagList
|
|
@@ -255,7 +257,7 @@ export default {
|
|
|
// this.$refs.subForm.valideAllForm(),
|
|
|
this.$refs.submitForm.validate(),
|
|
|
this.$refs.customItems.valideAllForm()
|
|
|
- ]).then(res => {
|
|
|
+ ]).then((res) => {
|
|
|
this.save()
|
|
|
})
|
|
|
},
|
|
@@ -279,9 +281,13 @@ export default {
|
|
|
|
|
|
console.log(this.formData)
|
|
|
|
|
|
- data.bannerList = this.bannerList.map(item => item.response ? item.response.data : item.url)
|
|
|
- data.equipmentList = this.deviceList.map(item => ({ equipmentName: item.equipmentName, brand: item.brand, image: item.image }))
|
|
|
- doctorSave(data).then(res => {
|
|
|
+ data.bannerList = this.bannerList.map((item) => (item.response ? item.response.data : item.url))
|
|
|
+ data.equipmentList = this.deviceList.map((item) => ({
|
|
|
+ equipmentName: item.equipmentName,
|
|
|
+ brand: item.brand,
|
|
|
+ image: item.image
|
|
|
+ }))
|
|
|
+ doctorSave(data).then((res) => {
|
|
|
this.$message.success('保存成功')
|
|
|
this.$store.dispatch('tagsView/delView', this.$route)
|
|
|
this.$router.push('/personnel/training/list')
|
|
@@ -336,7 +342,7 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-.doctor-edit{
|
|
|
+.doctor-edit {
|
|
|
margin-bottom: 80px;
|
|
|
}
|
|
|
|
|
@@ -352,21 +358,20 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-.tag-control{
|
|
|
+.tag-control {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
- .el-input{
|
|
|
+ .el-input {
|
|
|
flex: 1;
|
|
|
margin-right: 16px;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-.tag-list{
|
|
|
- padding-top: 8px;
|
|
|
- .el-tag{
|
|
|
+.tag-list {
|
|
|
+ padding-top: 8px;
|
|
|
+ .el-tag {
|
|
|
margin-right: 6px;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
</style>
|