内外部会议、政策课题 修改

This commit is contained in:
zyn
2023-10-18 16:17:34 +08:00
parent b227b6eec4
commit 21606aa5d3
5 changed files with 81 additions and 82 deletions
@@ -98,9 +98,9 @@
<el-col :span="24">
<div class="divider-line">
课题组会议
<el-button type="primary" size="mini" icon="el-icon-plus" @click="addMeeting"
<el-button type="primary" size="mini" icon="el-icon-plus" @click="add('meetingList')"
:style="{visibility: (index === form.meetingList.length - 1) ? 'visible' : 'collapse'}"></el-button>
<el-button type="primary" size="mini" icon="el-icon-minus" @click="removeMeeting(index)"
<el-button type="primary" size="mini" icon="el-icon-minus" @click="remove('meetingList', index)"
:style="{visibility: (form.meetingList.length < 2 && index === 0) ? 'collapse' : 'visible'}"></el-button>
</div>
</el-col>
@@ -187,9 +187,9 @@
<el-col :span="24">
<div class="divider-line">
课题组联系方式
<el-button type="primary" size="mini" icon="el-icon-plus" @click="addTopicContactInformation"
<el-button type="primary" size="mini" icon="el-icon-plus" @click="add('topicContactInformationList')"
:style="{visibility: (index === form.topicContactInformationList.length - 1) ? 'visible' : 'collapse'}"></el-button>
<el-button type="primary" size="mini" icon="el-icon-minus" @click="removeTopicContactInformation(index)"
<el-button type="primary" size="mini" icon="el-icon-minus" @click="remove('topicContactInformationList', index)"
:style="{visibility: (form.topicContactInformationList.length < 2 && index === 0) ? 'collapse' : 'visible'}"></el-button>
</div>
</el-col>
@@ -283,9 +283,9 @@
<el-col :span="24">
<div class="divider-line">
课题组联系方式
<el-button type="primary" size="mini" icon="el-icon-plus" @click="addInsideContactInformation"
<el-button type="primary" size="mini" icon="el-icon-plus" @click="add('insideContactInformationList')"
:style="{visibility: (index === form.insideContactInformationList.length - 1) ? 'visible' : 'collapse'}"></el-button>
<el-button type="primary" size="mini" icon="el-icon-minus" @click="removeInsideContactInformation(index)"
<el-button type="primary" size="mini" icon="el-icon-minus" @click="remove('insideContactInformationList', index)"
:style="{visibility: (form.insideContactInformationList.length < 2 && index === 0) ? 'collapse' : 'visible'}"></el-button>
</div>
</el-col>
@@ -362,60 +362,59 @@ export default {
type: Object
}
},
data (){
const rules = {
data (){const rules = {
topicName: [
{required: true, type: 'string', message: '会议名称不能为空', trigger: 'change'},
{type: 'string', max: 500, message: '会议名称不能超过500个字符', trigger: 'change'}
{required: true, type: 'string', message: '课题名称不能为空', trigger: 'change'},
{type: 'string', max: 500, message: '课题名称不能超过500个字符', trigger: 'change'}
],
organizer: [
{required: true, type: 'string', message: '会议名称不能为空', trigger: 'change'},
{type: 'string', max: 500, message: '会议名称不能超过500个字符', trigger: 'change'}
{required: true, type: 'string', message: '课题承办单位不能为空', trigger: 'change'},
{type: 'string', max: 500, message: '课题承办单位不能超过500个字符', trigger: 'change'}
],
guidanceUnit: [
{type: 'string', max: 500, message: '会议名称不能超过500个字符', trigger: 'change'}
{type: 'string', max: 500, message: '课题指导单位不能超过500个字符', trigger: 'change'}
],
participatingUnit: [
{type: 'string', max: 500, message: '会议名称不能超过500个字符', trigger: 'change'}
{type: 'string', max: 500, message: '课题参与单位不能超过500个字符', trigger: 'change'}
],
startTime: [
{required: true, message: '会议时间不能为空', trigger: 'change'}
{required: true, message: '启动时间不能为空', trigger: 'change'}
],
topicStatus: [
{required: true, type: 'string', message: '会议名称不能为空', trigger: 'change'},
{required: true, type: 'string', message: '课题状态不能为空', trigger: 'change'},
],
topicCost: [
{type: 'string', max: 500, message: '会议名称不能超过500个字符', trigger: 'change'}
{type: 'string', max: 500, message: '课题费用(万元)不能超过500个字符', trigger: 'change'}
],
meetingName: [
{type: 'string', max: 500, message: '会议名称不能超过500个字符', trigger: 'change'}
],
meetingTime: [
{type: 'string', max: 500, message: '会议名称不能超过500个字符', trigger: 'change'}
{type: 'string', max: 500, message: '会议时间不能超过500个字符', trigger: 'change'}
],
meetingAddress: [
{type: 'string', max: 500, message: '会议名称不能超过500个字符', trigger: 'change'}
{type: 'string', max: 500, message: '会议地点不能超过500个字符', trigger: 'change'}
],
participants: [
{type: 'string', max: 500, message: '会议名称不能超过500个字符', trigger: 'change'}
{type: 'string', max: 500, message: '参会人员(内部)不能超过500个字符', trigger: 'change'}
],
meetingContent: [
{type: 'string', max: 500, message: '会议名称不能超过500个字符', trigger: 'change'}
{type: 'string', max: 500, message: '会议主要内容不能超过500个字符', trigger: 'change'}
],
name: [
{type: 'string', max: 500, message: '会议名称不能超过500个字符', trigger: 'change'}
{type: 'string', max: 500, message: '姓名不能超过500个字符', trigger: 'change'}
],
department: [
{type: 'string', max: 500, message: '会议名称不能超过500个字符', trigger: 'change'}
{type: 'string', max: 500, message: '单位不能超过500个字符', trigger: 'change'}
],
phone: [
{type: 'string', max: 500, message: '会议名称不能超过500个字符', trigger: 'change'}
{type: 'string', max: 500, message: '电话不能超过500个字符', trigger: 'change'}
],
email: [
{type: 'string', max: 500, message: '会议名称不能超过500个字符', trigger: 'change'}
{type: 'string', max: 500, message: '邮箱不能超过500个字符', trigger: 'change'}
],
identity: [
{type: 'string', max: 500, message: '会议名称不能超过500个字符', trigger: 'change'}
{type: 'string', max: 500, message: '身份不能超过500个字符', trigger: 'change'}
],
}
const form = {
@@ -495,7 +494,7 @@ export default {
}
},
watch: {
editForm (val) {
showDrawer (val) {
if (this.title === '编辑') {
this.form = { ...this.editForm }
} else {
@@ -549,62 +548,39 @@ export default {
}
})
},
addMeeting () {
const meetingListItem = {
meetingName: '',
meetingTime: '',
meetingAddress: '',
participants: '',
meetingContent: '',
add (type) {
let item = {}
switch (type) {
case 'meetingList':
item = {
meetingName: '',
meetingTime: '',
meetingAddress: '',
participants: '',
meetingContent: ''
}
break
case 'topicContactInformationList':
case 'insideContactInformationList':
item = {
name: '',
department: '',
phone: '',
email: '',
identity: ''
}
break
}
this.form.meetingList = [...this.form.meetingList, meetingListItem]
this.form[type] = [...this.form[type], item]
},
removeMeeting (index) {
remove (type, index) {
let res = []
this.form.meetingList.forEach((item, i) => {
this.form[type].forEach((item, i) => {
if (i !== index) {
res.push(item)
}
})
this.form.meetingList = [ ...res ]
},
addTopicContactInformation () {
const topicContactInformationListItem = {
name: '',
department: '',
phone: '',
email: '',
identity: ''
}
this.form.topicContactInformationList = [...this.form.topicContactInformationList, topicContactInformationListItem]
},
removeTopicContactInformation (index) {
let res = []
this.form.topicContactInformationList.forEach((item, i) => {
if (i !== index) {
res.push(item)
}
})
this.form.topicContactInformationList = [ ...res ]
},
addInsideContactInformation () {
const insideContactInformationListItem = {
name: '',
department: '',
phone: '',
email: '',
identity: ''
}
this.form.insideContactInformationListItem = [...this.form.insideContactInformationListItem, insideContactInformationListItem]
},
removeInsideContactInformation (index) {
let res = []
this.form.insideContactInformationListItem.forEach((item, i) => {
if (i !== index) {
res.push(item)
}
})
this.form.insideContactInformationListItem = [ ...res ]
this.form[type] = [ ...res ]
},
resetForm () {
this.form = this.initForm