|
@@ -194,6 +194,7 @@ import { ref, onActivated, computed } from 'vue';
|
|
|
import { useLifecycle } from '@hooks/useCommon.js';
|
|
|
import { fixedFieldTaskType, fixedFieldPriority, fixedFieldRepetitiveType } from '@utility/defaultData.js';
|
|
|
import { GET_ALL_CUSTOMERSLIST, GET_ALL_BUSINESS_OPPORTUNITIES, GET_SALES_ORDER_LIST, GET_OBTAIN_ALL_CLUES, GET_CONTACTS_WITH_MORE_I_DS, TASK_ADD_EDIT, MODIFY_TASK } from "@hooks/useApi";
|
|
|
+import { routingInfos, getRouterImg } from "@utility/generalVariables.js";
|
|
|
import requests from "@common/requests";
|
|
|
import useToast from "@hooks/useToast"
|
|
|
import dayjs from 'dayjs';
|
|
@@ -290,13 +291,35 @@ function onSubmit() {
|
|
|
const url = formValue.id ? MODIFY_TASK : TASK_ADD_EDIT
|
|
|
requests.post(url, { ...commonUtil.getFromValue({ ...formValue }) }).then(() => {
|
|
|
toastSuccess('保存成功')
|
|
|
+ const currentPages = router.$state.currentPages || []
|
|
|
+ const parentRoute = (currentPages[currentPages.length - 2] || {}).pathName
|
|
|
+ const jumpTo = routingInfos['tasks']
|
|
|
setTimeout(() => {
|
|
|
- router.navigateBack({
|
|
|
- success: () => {
|
|
|
- router.eventEmit('moduleListRefreshData', {})
|
|
|
- }
|
|
|
- })
|
|
|
+ if(parentRoute == 'home') {
|
|
|
+ router.redirectTo({
|
|
|
+ pathName: 'moduleList',
|
|
|
+ success: () => {
|
|
|
+ router.eventEmit('moduleListRefreshData', {})
|
|
|
+ router.emit('moduleListDetailParameter', {
|
|
|
+ row: JSON.stringify(jumpTo)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ router.navigateBack({
|
|
|
+ success: () => {
|
|
|
+ router.eventEmit('moduleListRefreshData', {})
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}, 2000)
|
|
|
+ // setTimeout(() => {
|
|
|
+ // router.navigateBack({
|
|
|
+ // success: () => {
|
|
|
+ // router.eventEmit('moduleListRefreshData', {})
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }, 2000)
|
|
|
}).finally(() => {
|
|
|
|
|
|
})
|