This commit is contained in:
2025-11-17 15:17:03 +08:00
parent 49769b7d4f
commit 332c5745fb
3 changed files with 121 additions and 86 deletions
@@ -57,6 +57,20 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
v-model="formData.address"></el-input>
</el-form-item>
</el-col>
<el-col :span="12" v-if="activity_type===40003">
<el-form-item prop="clubId" label="活动所属协会">
<el-select v-model="formData.clubId" clearable filterable multiple
placeholder="请选择活动所属协会"
style="width: 100%">
<el-option
v-for="item in clubOptions"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系人" prop="userId">
@@ -164,6 +178,7 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="hostUnitIds" label="主办单位">
<el-select v-model="formData.hostUnitIds" clearable filterable multiple
@@ -180,7 +195,8 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
</el-col>
<el-col :span="12">
<el-form-item prop="undertakeUnitIds" label="承办单位">
<el-select v-model="formData.undertakeUnitIds" clearable filterable multiple
<el-select v-model="formData.undertakeUnitIds" clearable filterable
multiple
placeholder="请选择承办单位"
style="width: 100%">
<el-option
@@ -576,7 +592,8 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
plannedDate: [{required: true, message: "必填", trigger: ["blur", "change"]}],
time: [{required: true, message: "必填", trigger: ["blur", "change"]}],
cover: [{required: true, message: "必填", trigger: ["blur", "change"]}],
signUpMethod: [{required: true, message: "必填", trigger: ["blur", "change"]}]
signUpMethod: [{required: true, message: "必填", trigger: ["blur", "change"]}],
clubId: [{required: true, message: "必填", trigger: ["blur", "change"]}]
},
projectTypeList: [],
@@ -629,6 +646,14 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
},
// 保存
onSave() {
if (!this.formData.projectTypeCode) {
this.$message.error("请选择活动项目类型")
return
}
if (!this.formData.clubId && this.activity_type === 40003) {
this.$message.error("请选择活动所属协会")
return
}
this.$confirm("您确定保存吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@@ -675,93 +700,101 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
},
// 提交
onSubmit() {
this.$confirm("您确定保存吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
const formData = JSON.parse(JSON.stringify(this.formData))
formData.activity_type = this.activity_type
const {time, applyTime2, plannedDate} = formData
if (applyTime2 && applyTime2.length) {
formData.applyStartTime = applyTime2[0]
formData.applyEndTime = applyTime2[1]
formData.applyTime2 = null
}
if (time && time.length) {
formData.startTime = formData.time[0]
formData.endTime = formData.time[1]
formData.time = null
}
if (plannedDate && plannedDate.length) {
formData.startPlannedDate = formData.plannedDate[0]
formData.endPlannedDate = formData.plannedDate[1]
formData.plannedDate = null
}
this.$axios.post('/platform/activity/culture/applyActivity/submit', {
data: JSON.stringify(formData)
}).then(res => {
if (res.code === 0) {
this.$emit("goBack")
this.$message.success("提交成功")
if (this.activity_type === 40002) {
location.href = "/platform/activity/culture/infoManage/union"
// commonUtil.pjaxPush("/platform/activity/culture/infoManage/union")
} else if (this.activity_type === 40003) {
location.href = "/platform/activity/culture/infoManage/club"
// commonUtil.pjaxPush("/platform/activity/culture/infoManage/club")
} else {
location.href = "/platform/activity/culture/infoManage/school"
// commonUtil.pjaxPush("/platform/activity/culture/infoManage/school")
this.$refs["addForm"].validate((valid) => {
if (valid) {
this.$confirm("您确定提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
const formData = JSON.parse(JSON.stringify(this.formData))
formData.activity_type = this.activity_type
const {time, applyTime2, plannedDate} = formData
if (applyTime2 && applyTime2.length) {
formData.applyStartTime = applyTime2[0]
formData.applyEndTime = applyTime2[1]
formData.applyTime2 = null
}
}
})
if (time && time.length) {
formData.startTime = formData.time[0]
formData.endTime = formData.time[1]
formData.time = null
}
if (plannedDate && plannedDate.length) {
formData.startPlannedDate = formData.plannedDate[0]
formData.endPlannedDate = formData.plannedDate[1]
formData.plannedDate = null
}
this.$axios.post('/platform/activity/culture/applyActivity/submit', {
data: JSON.stringify(formData)
}).then(res => {
if (res.code === 0) {
this.$emit("goBack")
this.$message.success("提交成功")
if (this.activity_type === 40002) {
location.href = "/platform/activity/culture/infoManage/union"
// commonUtil.pjaxPush("/platform/activity/culture/infoManage/union")
} else if (this.activity_type === 40003) {
location.href = "/platform/activity/culture/infoManage/club"
// commonUtil.pjaxPush("/platform/activity/culture/infoManage/club")
} else {
location.href = "/platform/activity/culture/infoManage/school"
// commonUtil.pjaxPush("/platform/activity/culture/infoManage/school")
}
}
})
})
}
})
},
// 再次提交
onFinishTask() {
this.$confirm("您确定保存吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
const formData = JSON.parse(JSON.stringify(this.formData))
formData.activity_type = this.activity_type
const {time, applyTime2, plannedDate} = formData
if (applyTime2 && applyTime2.length) {
formData.applyStartTime = applyTime2[0]
formData.applyEndTime = applyTime2[1]
formData.applyTime2 = null
}
if (time && time.length) {
formData.startTime = formData.time[0]
formData.endTime = formData.time[1]
formData.time = null
}
if (plannedDate && plannedDate.length) {
formData.startPlannedDate = formData.plannedDate[0]
formData.endPlannedDate = formData.plannedDate[1]
formData.plannedDate = null
}
this.$axios.post('/platform/activity/culture/applyActivity/submitAgain', {
data: JSON.stringify(formData),
taskId: this.taskId
}).then(res => {
if (res.code === 0) {
this.$emit("goBack")
this.$message.success("提交成功")
if (this.activity_type === 40002) {
location.href = "/platform/activity/culture/infoManage/union"
// commonUtil.pjaxPush("/platform/activity/culture/infoManage/union")
} else if (this.activity_type === 40003) {
location.href = "/platform/activity/culture/infoManage/club"
// commonUtil.pjaxPush("/platform/activity/culture/infoManage/club")
} else {
location.href = "/platform/activity/culture/infoManage/school"
// commonUtil.pjaxPush("/platform/activity/culture/infoManage/school")
this.$refs["addForm"].validate((valid) => {
if (valid) {
this.$confirm("您确定提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
const formData = JSON.parse(JSON.stringify(this.formData))
formData.activity_type = this.activity_type
const {time, applyTime2, plannedDate} = formData
if (applyTime2 && applyTime2.length) {
formData.applyStartTime = applyTime2[0]
formData.applyEndTime = applyTime2[1]
formData.applyTime2 = null
}
}
})
if (time && time.length) {
formData.startTime = formData.time[0]
formData.endTime = formData.time[1]
formData.time = null
}
if (plannedDate && plannedDate.length) {
formData.startPlannedDate = formData.plannedDate[0]
formData.endPlannedDate = formData.plannedDate[1]
formData.plannedDate = null
}
this.$axios.post('/platform/activity/culture/applyActivity/submitAgain', {
data: JSON.stringify(formData),
taskId: this.taskId
}).then(res => {
if (res.code === 0) {
this.$emit("goBack")
this.$message.success("提交成功")
if (this.activity_type === 40002) {
location.href = "/platform/activity/culture/infoManage/union"
// commonUtil.pjaxPush("/platform/activity/culture/infoManage/union")
} else if (this.activity_type === 40003) {
location.href = "/platform/activity/culture/infoManage/club"
// commonUtil.pjaxPush("/platform/activity/culture/infoManage/club")
} else {
location.href = "/platform/activity/culture/infoManage/school"
// commonUtil.pjaxPush("/platform/activity/culture/infoManage/school")
}
}
})
})
}
})
},
async remoteMethod(query) {
@@ -968,8 +1001,8 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
if (data.startPlannedDate) data.plannedDate = [data.startPlannedDate, data.endPlannedDate]
this.userData = clone(data.tissuePersonList)
data.unionUserNumberLimit = JSON.parse(data.unionUserNumberLimit)
data.undertakeUnitIds = JSON.parse(data.undertakeUnitIds)
data.hostUnitIds = JSON.parse(data.hostUnitIds)
if (data.undertakeUnitIds) data.undertakeUnitIds = JSON.parse(data.undertakeUnitIds)
if (data.hostUnitIds) data.hostUnitIds = JSON.parse(data.hostUnitIds)
this.formData = data
if (!this.formData.unionUserNumberLimit) {
this.getUnionData().then((data) => {