Commit 81bd12ad by 史敦盼

专家人才库修改,项目信息管理编辑-附件回显问题修复

1 parent 481c73a5
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Autor: pan * @Autor: pan
* @Date: 2024-03-12 14:55:59 * @Date: 2024-03-12 14:55:59
* @LastEditors: pan * @LastEditors: pan
* @LastEditTime: 2024-04-01 15:56:14 * @LastEditTime: 2024-04-02 09:56:29
--> -->
<template> <template>
<div class="form-box"> <div class="form-box">
...@@ -22,7 +22,11 @@ ...@@ -22,7 +22,11 @@
<el-form-item :prop="item.prop" :label="item.label" :rules="item.rules"> <el-form-item :prop="item.prop" :label="item.label" :rules="item.rules">
<!-- 自定义插槽,可用于特殊表单块 --> <!-- 自定义插槽,可用于特殊表单块 -->
<template v-if="item.__slotName"> <template v-if="item.__slotName">
<slot :name="item.__slotName" :data="item"></slot> <slot
:name="item.__slotName"
:form-data="formData"
:data="item"
></slot>
</template> </template>
<SearchFormItem <SearchFormItem
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Autor: pan * @Autor: pan
* @Date: 2024-03-12 14:55:59 * @Date: 2024-03-12 14:55:59
* @LastEditors: pan * @LastEditors: pan
* @LastEditTime: 2024-04-01 11:54:48 * @LastEditTime: 2024-04-02 10:49:45
--> -->
<!-- /** <!-- /**
* 搜索栏公共组件 * 搜索栏公共组件
...@@ -134,7 +134,7 @@ export default { ...@@ -134,7 +134,7 @@ export default {
this.$refs.formRef.validate((valid) => { this.$refs.formRef.validate((valid) => {
if (valid) { if (valid) {
// console.log('提交成功') // console.log('提交成功')
console.log(this.formData) // console.log(this.formData)
callback() callback()
} }
}) })
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Autor: pan * @Autor: pan
* @Date: 2024-03-12 15:11:47 * @Date: 2024-03-12 15:11:47
* @LastEditors: pan * @LastEditors: pan
* @LastEditTime: 2024-04-02 09:29:25 * @LastEditTime: 2024-04-02 10:13:55
--> -->
<template> <template>
<div class="form-item"> <div class="form-item">
...@@ -149,7 +149,11 @@ export default { ...@@ -149,7 +149,11 @@ export default {
currentVal: { currentVal: {
get() { get() {
if (this.isSelect) { if (this.isSelect) {
return this.value && this.value + '' if (Array.isArray(this.value)) {
return this.value
} else {
return this.value && this.value + ''
}
} else { } else {
return this.value return this.value
} }
......
...@@ -496,3 +496,9 @@ export default { ...@@ -496,3 +496,9 @@ export default {
@import '@/styles/elementui.scss'; @import '@/styles/elementui.scss';
@import './index.scss'; @import './index.scss';
</style> </style>
<style>
.el-tooltip__popper {
max-width: 50%;
}
</style>
>
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Autor: pan * @Autor: pan
* @Date: 2024-04-01 14:39:48 * @Date: 2024-04-01 14:39:48
* @LastEditors: pan * @LastEditors: pan
* @LastEditTime: 2024-04-02 08:56:20 * @LastEditTime: 2024-04-02 11:11:39
--> -->
<template> <template>
<el-dialog <el-dialog
...@@ -17,6 +17,24 @@ ...@@ -17,6 +17,24 @@
> >
<div> <div>
<Form ref="addForm" :form-options="formOptions" label-width="120px"> <Form ref="addForm" :form-options="formOptions" label-width="120px">
<template #talentPoolName="{ formData }">
<el-select
v-model="formData.talentPoolName"
placeholder="请选择"
clearable
class="w-100"
>
<el-input placeholder="请输入内容" v-model="addTalentPoolName">
<div slot="append" @click="fnAddTalentPoolName()">新增</div>
</el-input>
<el-option
v-for="(item, idnex) in talentPoolNameOptions"
:key="idnex"
:label="item.label"
:value="item.label"
></el-option>
</el-select>
</template>
</Form> </Form>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
...@@ -35,6 +53,7 @@ import { ...@@ -35,6 +53,7 @@ import {
getETPManagePoolName, getETPManagePoolName,
getETPManageAdd, getETPManageAdd,
getETPManageUpdate, getETPManageUpdate,
getETPManagePoolNameAdd,
} from '@/api' } from '@/api'
export default { export default {
props: { props: {
...@@ -54,6 +73,7 @@ export default { ...@@ -54,6 +73,7 @@ export default {
data() { data() {
return { return {
talentPoolNameOptions: [], talentPoolNameOptions: [],
addTalentPoolName: '',
} }
}, },
components: { components: {
...@@ -74,11 +94,12 @@ export default { ...@@ -74,11 +94,12 @@ export default {
{ {
label: '所属专家库', // label文字 label: '所属专家库', // label文字
prop: 'talentPoolName', // 字段名 prop: 'talentPoolName', // 字段名
element: 'el-select', // 指定elementui组件 // element: 'el-select', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性 // placeholder: '请输入内容', // elementui组件属性
options: this.talentPoolNameOptions, // options: this.talentPoolNameOptions,
filterable: true, // filterable: true,
rules: [{ required: true, trigger: 'blur', message: '不能为空' }], rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
__slotName: 'talentPoolName',
}, },
{ {
label: '专家姓名', // label文字 label: '专家姓名', // label文字
...@@ -128,6 +149,8 @@ export default { ...@@ -128,6 +149,8 @@ export default {
element: 'el-select', // 指定elementui组件 element: 'el-select', // 指定elementui组件
placeholder: '请选择', // elementui组件属性 placeholder: '请选择', // elementui组件属性
dictType: 'sys_professional_field', dictType: 'sys_professional_field',
multiple: true,
initValue: [],
rules: [{ required: true, trigger: 'blur', message: '不能为空' }], rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
}, },
{ {
...@@ -165,6 +188,20 @@ export default { ...@@ -165,6 +188,20 @@ export default {
}, },
}, },
methods: { methods: {
fnAddTalentPoolName() {
//新增专家库名称
const params = {
talentPoolName: this.addTalentPoolName,
}
this.$refs['addForm'].$refs['formRef'].clearValidate('talentPoolName')
getETPManagePoolNameAdd(params).then((res) => {
if (res.code == 200) {
this.$message.success('新增成功!')
this.addTalentPoolName = ''
this.fnGetETPManagePoolName()
}
})
},
handleSubmit() { handleSubmit() {
this.$refs['addForm'].onValidate(() => { this.$refs['addForm'].onValidate(() => {
const loading = this.$loading({ const loading = this.$loading({
...@@ -178,13 +215,14 @@ export default { ...@@ -178,13 +215,14 @@ export default {
const params = { const params = {
...this.rowData, ...this.rowData,
...formInfo, ...formInfo,
professionalField: formInfo.professionalField.join(','),
} }
typeApi(params).then((res) => { typeApi(params).then((res) => {
loading.close() loading.close()
if (res.code === 200) { if (res.code === 200) {
this.$message.success('保存成功') this.$message.success('保存成功')
this.showDialog = false this.showDialog = false
this.handleClose() // this.handleClose()
this.$emit('querySearch') this.$emit('querySearch')
} else { } else {
this.$message.error(res.msg) this.$message.error(res.msg)
...@@ -194,13 +232,18 @@ export default { ...@@ -194,13 +232,18 @@ export default {
}, },
handleClose() { handleClose() {
this.showDialog = false this.showDialog = false
console.log('this.formOptions', this.formOptions)
this.formOptions.forEach((v) => { this.formOptions.forEach((v) => {
v.initValue = '' if (v.prop === 'professionalField') {
v.initValue = []
} else {
v.initValue = undefined
}
}) })
this.$refs['addForm'].addInitValue() this.$refs['addForm'].addInitValue()
this.$refs['addForm'].onReset() this.$refs['addForm'].onReset()
}, },
async handleOpen() { fnGetETPManagePoolName() {
getETPManagePoolName().then((res) => { getETPManagePoolName().then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.talentPoolNameOptions = res.data.map((v) => { this.talentPoolNameOptions = res.data.map((v) => {
...@@ -211,10 +254,17 @@ export default { ...@@ -211,10 +254,17 @@ export default {
}) })
} }
}) })
},
async handleOpen() {
this.fnGetETPManagePoolName()
if (Object.keys(this.rowData).length) { if (Object.keys(this.rowData).length) {
this.formOptions.forEach((v) => { this.formOptions.forEach((v) => {
v.initValue = this.rowData[v.prop] if (v.prop === 'professionalField') {
v.initValue = this.rowData[v.prop].split(',')
} else {
v.initValue = this.rowData[v.prop]
}
}) })
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['addForm'].addInitValue() this.$refs['addForm'].addInitValue()
...@@ -231,4 +281,10 @@ export default { ...@@ -231,4 +281,10 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '@/styles/elementui.scss'; @import '@/styles/elementui.scss';
@import '@/styles/common.scss';
/deep/ .el-input-group__append {
background-color: #0d867f;
color: #fff;
cursor: pointer;
}
</style> </style>
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Autor: pan * @Autor: pan
* @Date: 2024-04-01 14:38:41 * @Date: 2024-04-01 14:38:41
* @LastEditors: pan * @LastEditors: pan
* @LastEditTime: 2024-04-01 17:00:27 * @LastEditTime: 2024-04-02 11:09:12
--> -->
<template> <template>
<el-dialog <el-dialog
...@@ -113,6 +113,8 @@ export default { ...@@ -113,6 +113,8 @@ export default {
element: 'el-select', // 指定elementui组件 element: 'el-select', // 指定elementui组件
placeholder: '请选择', // elementui组件属性 placeholder: '请选择', // elementui组件属性
dictType: 'sys_professional_field', dictType: 'sys_professional_field',
multiple: true,
initValue: [],
rules: [{ required: true, trigger: 'blur', message: '不能为空' }], rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
}, },
{ {
...@@ -152,10 +154,12 @@ export default { ...@@ -152,10 +154,12 @@ export default {
const typeApi = this.isEdit ? updKlPerson : addKlPerson const typeApi = this.isEdit ? updKlPerson : addKlPerson
const formInfo = this.$refs['addForm'].getData() const formInfo = this.$refs['addForm'].getData()
console.log('professionalField', formInfo.professionalField)
const params = { const params = {
...this.rowData, ...this.rowData,
...formInfo, ...formInfo,
type: 1, type: 1,
professionalField: formInfo.professionalField.join(','),
} }
typeApi(params).then((res) => { typeApi(params).then((res) => {
loading.close() loading.close()
...@@ -173,7 +177,11 @@ export default { ...@@ -173,7 +177,11 @@ export default {
handleClose() { handleClose() {
this.showDialog = false this.showDialog = false
this.formOptions.forEach((v) => { this.formOptions.forEach((v) => {
v.initValue = '' if (v.prop === 'professionalField') {
v.initValue = []
} else {
v.initValue = undefined
}
}) })
this.$refs['addForm'].addInitValue() this.$refs['addForm'].addInitValue()
this.$refs['addForm'].onReset() this.$refs['addForm'].onReset()
...@@ -181,7 +189,11 @@ export default { ...@@ -181,7 +189,11 @@ export default {
async handleOpen() { async handleOpen() {
if (Object.keys(this.rowData).length) { if (Object.keys(this.rowData).length) {
this.formOptions.forEach((v) => { this.formOptions.forEach((v) => {
v.initValue = this.rowData[v.prop] if (v.prop === 'professionalField') {
v.initValue = this.rowData[v.prop].split(',')
} else {
v.initValue = this.rowData[v.prop]
}
}) })
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['addForm'].addInitValue() this.$refs['addForm'].addInitValue()
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Autor: pan * @Autor: pan
* @Date: 2024-04-01 14:05:50 * @Date: 2024-04-01 14:05:50
* @LastEditors: pan * @LastEditors: pan
* @LastEditTime: 2024-04-02 09:28:36 * @LastEditTime: 2024-04-02 11:16:06
--> -->
<template> <template>
<div class="searchTable"> <div class="searchTable">
...@@ -45,6 +45,19 @@ ...@@ -45,6 +45,19 @@
:columns="columns" :columns="columns"
:key="activeName" :key="activeName"
> >
<template #professionalField="{ data }">
<el-tag
:class="{
'm-r-10':
idx != getTagList(data.row.professionalField).length - 1,
}"
v-for="(item, idx) in getTagList(data.row.professionalField)"
:key="idx"
>
{{ item }}
</el-tag>
<!-- <span>{{ handleText(data.row.professionalField) }}</span> -->
</template>
</table-config> </table-config>
</template> </template>
</list-page> </list-page>
...@@ -134,10 +147,11 @@ export default { ...@@ -134,10 +147,11 @@ export default {
{ {
label: '专业领域', // label文字 label: '专业领域', // label文字
prop: 'professionalField', // 字段名 prop: 'professionalField', // 字段名
initValue: '', initValue: [],
element: 'el-select', // 指定elementui组件 element: 'el-select', // 指定elementui组件
placeholder: '请选择', // elementui组件属性 placeholder: '请选择', // elementui组件属性
dictType: 'sys_professional_field', dictType: 'sys_professional_field',
multiple: true,
}, },
] ]
return arr return arr
...@@ -168,23 +182,23 @@ export default { ...@@ -168,23 +182,23 @@ export default {
options: this.sexOptions, options: this.sexOptions,
collectionType: true, collectionType: true,
}, },
{ label: '出生年月', prop: 'birthday' }, { label: '出生年月', prop: 'birthday', width: '120px' },
{ {
label: '学历', label: '学历',
prop: 'education', prop: 'education',
options: this.educationOptions, options: this.educationOptions,
collectionType: true, collectionType: true,
}, },
{ label: '联系方式', prop: 'telephone' }, { label: '联系方式', prop: 'telephone', width: '120px' },
{ label: '邮箱', prop: 'email', width: '120px' }, { label: '邮箱', prop: 'email', width: '120px' },
{ {
label: '专业领域', label: '专业领域',
prop: 'professionalField', prop: 'professionalField',
options: this.professionalFieldOptions, __slotName: 'professionalField',
collectionType: true, width: '200px',
}, },
{ label: '专家级别', prop: 'level' }, { label: '专家级别', prop: 'level' },
{ label: '成果简介', prop: 'remark' }, { label: '成果简介', prop: 'remark', width: '200px' },
{ {
label: '专家状态', label: '专家状态',
prop: 'state_', prop: 'state_',
...@@ -251,8 +265,8 @@ export default { ...@@ -251,8 +265,8 @@ export default {
{ {
label: '专业领域', label: '专业领域',
prop: 'professionalField', prop: 'professionalField',
options: this.professionalFieldOptions, __slotName: 'professionalField',
collectionType: true, width: '200px',
}, },
{ label: '成果简介', prop: 'remark' }, { label: '成果简介', prop: 'remark' },
{ {
...@@ -288,6 +302,16 @@ export default { ...@@ -288,6 +302,16 @@ export default {
this.getDicts() this.getDicts()
}, },
methods: { methods: {
getTagList(codes) {
const arr = codes.split(',')
let arrStr = []
arr.forEach((v) => {
const obj =
this.professionalFieldOptions.find((val) => val.value == v) || {}
arrStr.push(obj.label)
})
return arrStr
},
getDicts() { getDicts() {
getDictTypeOptions('talent_status').then((res) => { getDictTypeOptions('talent_status').then((res) => {
this.talentStatusOptions = res this.talentStatusOptions = res
...@@ -324,9 +348,11 @@ export default { ...@@ -324,9 +348,11 @@ export default {
this.selectRows = data this.selectRows = data
}, },
querySearch(data) { querySearch(data) {
const professionalField = data?.professionalField.join(',')
this.query.queryParam = { this.query.queryParam = {
...this.query.queryParam, ...this.query.queryParam,
...data, ...data,
professionalField,
} }
this.$refs.searchTable.queryData() this.$refs.searchTable.queryData()
}, },
...@@ -396,4 +422,5 @@ export default { ...@@ -396,4 +422,5 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '@/styles/common.scss'; @import '@/styles/common.scss';
@import '@/styles/elementui.scss';
</style> </style>
...@@ -241,6 +241,7 @@ ...@@ -241,6 +241,7 @@
:center="false" :center="false"
:close-on-click-modal="false" :close-on-click-modal="false"
width="80%" width="80%"
@close="handleClose()"
> >
<el-form <el-form
:model="ruleForm" :model="ruleForm"
...@@ -975,6 +976,12 @@ export default { ...@@ -975,6 +976,12 @@ export default {
}) })
}) })
}, },
handleClose() {
this.tableData4.forEach((item, index) => {
item.fileList = []
item.fileArray = []
})
},
async editItem(row) { async editItem(row) {
//编辑 //编辑
this.add_dialog = true this.add_dialog = true
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!