|
@@ -134,18 +134,33 @@ const endProcess = () => {
|
|
|
// 提交选择的事件信息
|
|
|
submitSelectedEvent()
|
|
|
.then(() => {
|
|
|
- console.log('Form submitted successfully.');
|
|
|
- closeDialog();
|
|
|
- router.go(-1);
|
|
|
+ console.log('Selected event updated successfully.');
|
|
|
+ // 调用 closeEvent 接口关闭事件
|
|
|
+ submitForm()
|
|
|
+ .then(() => {
|
|
|
+ closeDialog();
|
|
|
+ router.go(-1);
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ console.error('Failed to close event:', error);
|
|
|
+ proxy?.$message.error('关闭事件失败,请检查您的输入');
|
|
|
+ });
|
|
|
})
|
|
|
.catch((error) => {
|
|
|
console.error('Failed to submit the form:', error);
|
|
|
proxy?.$message.error('提交表单失败,请检查您的输入');
|
|
|
});
|
|
|
} else {
|
|
|
- // 如果 flag 为 true,则直接关闭对话框并返回上一页
|
|
|
- closeDialog();
|
|
|
- router.go(-1); // 立即返回上一级页面
|
|
|
+ // 如果 flag 为 true,则直接调用 closeEvent 接口关闭事件
|
|
|
+ submitForm()
|
|
|
+ .then(() => {
|
|
|
+ closeDialog();
|
|
|
+ router.go(-1); // 立即返回上一级页面
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ console.error('Failed to submit the form:', error);
|
|
|
+ proxy?.$message.error('提交表单失败,请检查您的输入');
|
|
|
+ });
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -160,8 +175,7 @@ const submitForm = async () => {
|
|
|
eventId: form.value.event_id,
|
|
|
address: form.value.address,
|
|
|
latitude: form.value.latitude,
|
|
|
- longitude: form.value.longitude,
|
|
|
- // event_status: '3' // 设置 event_status 为 3
|
|
|
+ longitude: form.value.longitude
|
|
|
};
|
|
|
console.log('Sending request with params:', params); // 添加调试信息
|
|
|
// 提交关闭事件请求
|
|
@@ -197,7 +211,6 @@ const submitSelectedEvent = async () => {
|
|
|
try {
|
|
|
await editEvent(updateParams);
|
|
|
// 提交关闭事件请求
|
|
|
- await submitForm();
|
|
|
} catch (error) {
|
|
|
console.error('Failed to update or close event:', error);
|
|
|
throw error; // 抛出错误以便外层处理
|