Browse Source

提交相关代码

Lijy 4 days ago
parent
commit
fc25341fc9

+ 21 - 5
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/business/addEditor.vue

@@ -35,6 +35,7 @@ import { ref, onActivated } from 'vue';
 import { useLifecycle } from '@hooks/useCommon.js';
 import { GET_BUSINESS_OPPORTUNITY_DETAILS, NEW_BUSINESS_OPPORTUNITY_EDITING } from "@hooks/useApi"
 import { defaultRelatedProductDataFields } from "@utility/defaultData"
+import { routingInfos, getRouterImg } from "@utility/generalVariables.js";
 import dayjs from 'dayjs';
 import requests from "@common/requests";
 import useToast from "@hooks/useToast"
@@ -86,12 +87,27 @@ function onSubmit() {
     toastLoading('保存中', 0)
     requests.post(NEW_BUSINESS_OPPORTUNITY_EDITING, { ...commonUtil.getFromValue({ ...newForm }) }).then(() => {
       toastSuccess('保存成功')
+      const currentPages = router.$state.currentPages || []
+      const parentRoute = (currentPages[currentPages.length - 2] || {}).pathName
+      const jumpTo = routingInfos['business']
       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)
     }).catch((err) => {
       toastFail('保存失败:' + err.msg)

+ 28 - 5
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/contacts/addEditor.vue

@@ -18,6 +18,7 @@ import CustomerForm from '@components/common/formForm/formView.vue'
 import requests from "@common/requests";
 import useToast from "@hooks/useToast"
 import { CONTACT_PERSON_ADDITION_EDITOR, CUSTOMER_ADDED_EDITOR } from "@hooks/useApi"
+import { routingInfos, getRouterImg } from "@utility/generalVariables.js";
 import useRouterStore from "@store/useRouterStore.js";
 import commonUtil from "@utility/commonUtil"
 const router = useRouterStore()
@@ -41,13 +42,35 @@ function onSubmit() {
     const url = props.formValue.id ? '/contacts/updateContacts' : CONTACT_PERSON_ADDITION_EDITOR
     requests.post(url, { ...commonUtil.getFromValue({ ...props.formValue, ...res.data }) }).then(() => {
       toastSuccess('保存成功')
+      const currentPages = router.$state.currentPages || []
+      const parentRoute = (currentPages[currentPages.length - 2] || {}).pathName
+      const jumpTo = routingInfos['contacts']
       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)
     }).catch((err) => {
       toastFail('保存失败:' + err.msg)
     })

+ 28 - 5
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/contract/addEditor.vue

@@ -139,6 +139,7 @@ import FoldingPanel from '@components/common/foldingPanel.vue';
 import dayjs from 'dayjs';
 import commonUtil from "@utility/commonUtil"
 import { number } from 'echarts';
+import { routingInfos, getRouterImg } from "@utility/generalVariables.js";
 
 import TreeSelect from "@components/common/treeSelect/selectTree.vue"
 
@@ -298,13 +299,35 @@ function onSubmit() {
       departmentId: departmentRow.value.sureDepartmentId
     }).then(() => {
       toastSuccess('保存成功')
+      const currentPages = router.$state.currentPages || []
+      const parentRoute = (currentPages[currentPages.length - 2] || {}).pathName
+      const jumpTo = routingInfos['contract']
       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)
     }).catch((err) => {
       toastFail('保存失败:' + err.msg)
     })

+ 28 - 5
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/customer/addEditor.vue

@@ -18,6 +18,7 @@ import CustomerForm from '@components/common/formForm/formView.vue'
 import requests from "@common/requests";
 import useToast from "@hooks/useToast"
 import { CUSTOMER_ADDED_EDITOR } from "@hooks/useApi"
+import { routingInfos, getRouterImg } from "@utility/generalVariables.js";
 import useRouterStore from "@store/useRouterStore.js";
 import commonUtil from "@utility/commonUtil"
 
@@ -40,13 +41,35 @@ function onSubmit() {
     toastLoading('保存中', 0)
     requests.post(CUSTOMER_ADDED_EDITOR, { ...commonUtil.getFromValue({ ...props.formValue, ...res.data }) }).then(() => {
       toastSuccess('保存成功')
+      const currentPages = router.$state.currentPages || []
+      const parentRoute = (currentPages[currentPages.length - 2] || {}).pathName
+      const jumpTo = routingInfos['customer']
       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)
     }).catch(() => {
       toastFail('保存失败')
     })

+ 28 - 5
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/order/addEditor.vue

@@ -40,6 +40,7 @@ import { ref, onActivated } from 'vue';
 import { useLifecycle } from '@hooks/useCommon.js';
 import { OBTAIN_ORDER_RELATED_PRODUCTS, ORDER_ADDITION_EDITING } from "@hooks/useApi"
 import { defaultRelatedProductDataFields } from "@utility/defaultData"
+import { routingInfos, getRouterImg } from "@utility/generalVariables.js";
 import dayjs from 'dayjs';
 import requests from "@common/requests";
 import useToast from "@hooks/useToast"
@@ -84,13 +85,35 @@ function onSubmit() {
     toastLoading('保存中', 0)
     requests.post(ORDER_ADDITION_EDITING, { ...commonUtil.getFromValue({ ...formVal }) }).then(() => {
       toastSuccess('保存成功')
+      const currentPages = router.$state.currentPages || []
+      const parentRoute = (currentPages[currentPages.length - 2] || {}).pathName
+      const jumpTo = routingInfos['order']
       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)
     }).catch((err) => {
       toastFail('保存失败:' + err.msg)
     })

+ 28 - 5
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/product/addEditor.vue

@@ -18,6 +18,7 @@ import CustomerForm from '@components/common/formForm/formView.vue'
 import requests from "@common/requests";
 import useToast from "@hooks/useToast"
 import { PRODUCT_ADD_EDITOR } from "@hooks/useApi"
+import { routingInfos, getRouterImg } from "@utility/generalVariables.js";
 import useRouterStore from "@store/useRouterStore.js";
 import commonUtil from "@utility/commonUtil"
 
@@ -40,13 +41,35 @@ function onSubmit() {
     toastLoading('保存中', 0)
     requests.post(PRODUCT_ADD_EDITOR, { ...commonUtil.getFromValue({ ...props.formValue, ...res.data }) }).then(() => {
       toastSuccess('保存成功')
+      const currentPages = router.$state.currentPages || []
+      const parentRoute = (currentPages[currentPages.length - 2] || {}).pathName
+      const jumpTo = routingInfos['product']
       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)
     }).catch((err) => {
       toastFail(err.msg)
     })

+ 28 - 5
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/tasks/addEditor.vue

@@ -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(() => {
 
     })

+ 28 - 5
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/thread/addEditor.vue

@@ -18,6 +18,7 @@ import CustomerForm from '@components/common/formForm/formView.vue'
 import requests from "@common/requests";
 import useToast from "@hooks/useToast"
 import { NEW_CLUE_EDITING } from "@hooks/useApi"
+import { routingInfos, getRouterImg } from "@utility/generalVariables.js";
 import useRouterStore from "@store/useRouterStore.js";
 import commonUtil from "@utility/commonUtil"
 
@@ -40,13 +41,35 @@ function onSubmit() {
     toastLoading('保存中', 0)
     requests.post(NEW_CLUE_EDITING, { ...commonUtil.getFromValue({ ...props.formValue, ...res.data }) }).then(() => {
       toastSuccess('保存成功')
+      const currentPages = router.$state.currentPages || []
+      const parentRoute = (currentPages[currentPages.length - 2] || {}).pathName
+      const jumpTo = routingInfos['thread']
       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)
     }).catch((err) => {
       toastFail('保存失败:' + err.msg)
     })

+ 7 - 1
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/tabbar/home/index.vue

@@ -99,6 +99,7 @@ import Footer from "@components/page/footer.vue";
 import requests from "@common/requests"
 import { GET_FREQUENTLY_USED_CONTACTS, GET_FAST_ACCESS_LIST, GET_ALL_ROUTING_PARAMETERS, COMMON_FUNCTIONS } from "@hooks/useApi";
 import useToast from "@hooks/useToast"
+import dayjs from 'dayjs';
 import { routingInfos, getRouterImg } from "@utility/generalVariables.js";
 import useRouterStore from "@store/useRouterStore.js";
 
@@ -149,7 +150,12 @@ function jumpAdd(rows) {
   if(rows.path == '/visitor') {
     router.navigateTo({
       pathName: 'addEditorVisitor',
-      success: () => {}
+      success: () => {
+        router.emit('addEditorVisitorParameter', {
+          row: JSON.stringify({}),
+          date: JSON.stringify(dayjs().format('YYYY-MM-DD') || {})
+        })
+      }
     })
     return
   }

+ 21 - 5
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/visitorProgram/addEditorVisitor.vue

@@ -247,12 +247,28 @@ function onSubmit() {
     submitLoading.value = true
     requests.post(PLAN_TO_ADD_EDITORS, { ...data }).then((res) => {
       toastSuccess("保存成功")
+      const currentPages = router.$state.currentPages || []
+      const parentRoute = (currentPages[currentPages.length - 2] || {}).pathName
       setTimeout(() => {
-        router.navigateBack({
-          success: () => {
-            router.emit('visitorDetailsParameter', { row: JSON.stringify({...addOrEditRow.value}) })
-          }
-        })
+        if(parentRoute == 'home') {
+          router.redirectTo({
+            pathName: 'visitor',
+            success: () => {
+              router.emit('visitorDetailsParameter', { row: JSON.stringify({...addOrEditRow.value}) })
+            }
+          })
+        } else {
+          router.navigateBack({
+            success: () => {
+              router.emit('visitorDetailsParameter', { row: JSON.stringify({...addOrEditRow.value}) })
+            }
+          })
+        }
+        // router.navigateBack({
+        //   success: () => {
+        //     router.emit('visitorDetailsParameter', { row: JSON.stringify({...addOrEditRow.value}) })
+        //   }
+        // })
       }, 2000)
     }).catch(err => {
       toastFail(`保存失败:${err.msg}`)