소스 검색

提交代码

Lijy 4 달 전
부모
커밋
58f0ff721d

+ 3 - 0
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/moduleList/moduleList.vue

@@ -387,6 +387,9 @@ useLifecycle({
   }
 });
 
+router.eventOn('moduleListRefreshData', (data) => {
+  onRefresh(true)
+})
 
 </script>
 

+ 7 - 1
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/business/addEditor.vue

@@ -41,7 +41,9 @@ import useToast from "@hooks/useToast"
 import CustomerForm from '@components/common/formForm/formView.vue'
 import FoldingPanel from '@components/common/foldingPanel.vue';
 import NewAndModifiedRelatedProducts from '@pages/pageComponents/product/newAndModifiedRelatedProducts.vue'
+import useRouterStore from "@store/useRouterStore.js";
 
+const router = useRouterStore()
 const props = defineProps({
   formJson: { required: true },
   formValue: { required: true },
@@ -76,7 +78,11 @@ function onSubmit() {
     requests.post(NEW_BUSINESS_OPPORTUNITY_EDITING, { ...newForm }).then(() => {
       toastSuccess('保存成功')
       setTimeout(() => {
-        history.back();
+        router.navigateBack({
+          success: () => {
+            router.eventEmit('moduleListRefreshData', {})
+          }
+        })
       }, 2000)
     }).catch((err) => {
       toastFail('保存失败:' + err.msg)

+ 13 - 1
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/business/businessInfo.vue

@@ -65,6 +65,8 @@ import { BUSINESS_OPPORTUNITY_TRANSFER, GET_CONTACTS_WITH_MORE_I_DS, CONTACT_PER
 import requests from "@common/requests";
 import useShowToast from '@hooks/useToast'
 import useInfoStore from '@store/useInfoStore'
+import useRouterStore from "@store/useRouterStore.js";
+const router = useRouterStore()
 
 const userInfo = useInfoStore()
 const { toastSuccess, toastFail, toastText } = useShowToast()
@@ -100,6 +102,7 @@ function relatedContacts() {
     props.info.contactsName = dialogSelection.value.label
     showContactDialog.value = false
     toastSuccess('关联成功')
+    listReloadData()
   })
 }
 
@@ -112,7 +115,7 @@ function confirmTransfer() {
     toastSuccess('转移成功')
     showDialog.value = false
     setTimeout(() => {
-      history.back()
+      listReloadData()
     }, 2000)
   })
 }
@@ -124,12 +127,21 @@ function claimAndClaim() {
   }).then(() => {
     requests.post(BUSINESS_OPPORTUNITY_TRANSFER, { ids: props.info.id, inchargerId: userInfo.userInfo.id }).then((res) => {
       toastSuccess('认领成功')
+      listReloadData()
       props.info.inchargerName = userInfo.userInfo.name
       showDialog.value = false
     })
   })
 }
 
+function listReloadData() {
+  router.navigateBack({
+    success: () => {
+      router.eventEmit('moduleListRefreshData', {})
+    }
+  })
+}
+
 function selectChange(value, label) {
   dialogSelection.value = {
     value, label

+ 8 - 2
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/contacts/addEditor.vue

@@ -17,7 +17,9 @@ import { useLifecycle } from '@hooks/useCommon.js';
 import CustomerForm from '@components/common/formForm/formView.vue'
 import requests from "@common/requests";
 import useToast from "@hooks/useToast"
-import { CONTACT_PERSON_ADDITION_EDITOR } from "@hooks/useApi"
+import { CONTACT_PERSON_ADDITION_EDITOR, CUSTOMER_ADDED_EDITOR } from "@hooks/useApi"
+import useRouterStore from "@store/useRouterStore.js";
+const router = useRouterStore()
 
 const { toastText, toastSuccess, toastFail, toastLoading } = useToast()
 
@@ -39,7 +41,11 @@ function onSubmit() {
     requests.post(url, { ...props.formValue, ...res.data }).then(() => {
       toastSuccess('保存成功')
       setTimeout(() => {
-        history.back();
+        router.navigateBack({
+          success: () => {
+            router.eventEmit('moduleListRefreshData', {})
+          }
+        })
       }, 2000)
     }).catch((err) => {
       toastFail('保存失败:' + err.msg)

+ 11 - 5
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/contacts/contactsInfo.vue

@@ -19,8 +19,8 @@
     </div>
 
     <!-- 转移弹窗 -->
-    <van-dialog v-model:show="showDialog" :title="`转移线索`" show-cancel-button
-      @confirm="confirmTransfer" :before-close="dialogCloseBefo">
+    <van-dialog v-model:show="showDialog" :title="`转移线索`" show-cancel-button @confirm="confirmTransfer"
+      :before-close="dialogCloseBefo">
       <van-cell title="转移至" is-link @click="showSelect = true">
         <template #value>
           {{ dialogSelection.label }}
@@ -43,7 +43,9 @@ import { TRANSFER_CONTACT_PERSON } from '@hooks/useApi'
 import requests from "@common/requests";
 import useShowToast from '@hooks/useToast'
 import useInfoStore from '@store/useInfoStore'
+import useRouterStore from "@store/useRouterStore.js";
 
+const router = useRouterStore()
 const userInfo = useInfoStore()
 const { toastSuccess, toastFail, toastText } = useShowToast()
 const props = defineProps({
@@ -59,7 +61,7 @@ const showSelect = ref(false);
 const dialogSelection = ref({});
 
 function confirmTransfer() {
-  if(!dialogSelection.value.label) {
+  if (!dialogSelection.value.label) {
     return toastText('请选择要转移的人员')
   }
 
@@ -67,7 +69,11 @@ function confirmTransfer() {
     toastSuccess('转移成功')
     showDialog.value = false
     setTimeout(() => {
-      history.back()
+      router.navigateBack({
+        success: () => {
+          router.eventEmit('moduleListRefreshData', {})
+        }
+      })
     }, 2000)
   })
 }
@@ -84,7 +90,7 @@ function showDialogCli() {
 }
 
 function dialogCloseBefo(val) {
-  if(val == 'confirm' && showDialog.value) {
+  if (val == 'confirm' && showDialog.value) {
     return false
   }
 

+ 8 - 1
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/contract/addEditor.vue

@@ -18,6 +18,9 @@ import CustomerForm from '@components/common/formForm/formView.vue'
 import requests from "@common/requests";
 import useToast from "@hooks/useToast"
 import { CONTRACT_ADDITION_EDITING } from "@hooks/useApi"
+import useRouterStore from "@store/useRouterStore.js";
+
+const router = useRouterStore()
 
 const { toastText, toastSuccess, toastFail, toastLoading } = useToast()
 
@@ -38,7 +41,11 @@ function onSubmit() {
     requests.post(CONTRACT_ADDITION_EDITING, { ...props.formValue, ...res.data }).then(() => {
       toastSuccess('保存成功')
       setTimeout(() => {
-        history.back();
+        router.navigateBack({
+          success: () => {
+            router.eventEmit('moduleListRefreshData', {})
+          }
+        })
       }, 2000)
     }).catch(() => {
       toastFail('保存失败')

+ 7 - 1
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/customer/addEditor.vue

@@ -18,7 +18,9 @@ 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 useRouterStore from "@store/useRouterStore.js";
 
+const router = useRouterStore()
 const { toastText, toastSuccess, toastFail, toastLoading } = useToast()
 
 const props = defineProps({
@@ -38,7 +40,11 @@ function onSubmit() {
     requests.post(CUSTOMER_ADDED_EDITOR, { ...props.formValue, ...res.data }).then(() => {
       toastSuccess('保存成功')
       setTimeout(() => {
-        history.back();
+        router.navigateBack({
+          success: () => {
+            router.eventEmit('moduleListRefreshData', {})
+          }
+        })
       }, 2000)
     }).catch(() => {
       toastFail('保存失败')

+ 32 - 17
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/customer/customerInfo.vue

@@ -16,13 +16,15 @@
       <van-cell title="备注" :value="info.customDesc" />
     </div>
     <div class="bottomButton">
-      <van-button type="warning" class="w-full block" v-if="info.inchargerName"  @click="showDialogCli()">转移客户</van-button>
-      <van-button type="primary" class="w-full block" v-if="!info.inchargerName" @click="claimAndClaim()">认领客户</van-button>
+      <van-button type="warning" class="w-full block" v-if="info.inchargerName"
+        @click="showDialogCli()">转移客户</van-button>
+      <van-button type="primary" class="w-full block" v-if="!info.inchargerName"
+        @click="claimAndClaim()">认领客户</van-button>
     </div>
 
     <!-- 转移弹窗 -->
-    <van-dialog v-model:show="showDialog" :title="`转移线索`" show-cancel-button
-      @confirm="confirmTransfer" :before-close="dialogCloseBefo">
+    <van-dialog v-model:show="showDialog" :title="`转移线索`" show-cancel-button @confirm="confirmTransfer"
+      :before-close="dialogCloseBefo">
       <van-cell title="转移至" is-link @click="showSelect = true">
         <template #value>
           {{ dialogSelection.label }}
@@ -45,7 +47,9 @@ import { TRANSFER_CUSTOMERS } from '@hooks/useApi'
 import requests from "@common/requests";
 import useShowToast from '@hooks/useToast'
 import useInfoStore from '@store/useInfoStore'
+import useRouterStore from "@store/useRouterStore.js";
 
+const router = useRouterStore()
 const userInfo = useInfoStore()
 const { toastSuccess, toastFail, toastText } = useShowToast()
 const props = defineProps({
@@ -61,7 +65,7 @@ const showSelect = ref(false);
 const dialogSelection = ref({});
 
 function confirmTransfer() {
-  if(!dialogSelection.value.label) {
+  if (!dialogSelection.value.label) {
     return toastText('请选择要转移的人员')
   }
 
@@ -69,7 +73,7 @@ function confirmTransfer() {
     toastSuccess('转移成功')
     showDialog.value = false
     setTimeout(() => {
-      history.back()
+      listReloadData()
     }, 2000)
   })
 }
@@ -81,12 +85,21 @@ function claimAndClaim() {
   }).then(() => {
     requests.post(TRANSFER_CUSTOMERS, { ids: props.info.id, inchargerId: userInfo.userInfo.id }).then((res) => {
       toastSuccess('认领成功')
+      listReloadData()
       props.info.inchargerName = userInfo.userInfo.name
       showDialog.value = false
     })
   })
 }
 
+function listReloadData() {
+  router.navigateBack({
+    success: () => {
+      router.eventEmit('moduleListRefreshData', {})
+    }
+  })
+}
+
 function selectChange(value, label) {
   dialogSelection.value = {
     value, label
@@ -99,7 +112,7 @@ function showDialogCli() {
 }
 
 function dialogCloseBefo(val) {
-  if(val == 'confirm' && showDialog.value) {
+  if (val == 'confirm' && showDialog.value) {
     return false
   }
 
@@ -114,15 +127,17 @@ useLifecycle({
 </script>
 
 <style lang='scss' scoped>
-  .bottomButton {
-    margin: 0 14px;
-    padding-bottom: 30px;
-    :deep(.van-button) {
-      margin-bottom: 20px;
-    }
-  }
-  .info {
-    margin: 8px 14px 30px 14px;
-    padding: 14px;
+.bottomButton {
+  margin: 0 14px;
+  padding-bottom: 30px;
+
+  :deep(.van-button) {
+    margin-bottom: 20px;
   }
+}
+
+.info {
+  margin: 8px 14px 30px 14px;
+  padding: 14px;
+}
 </style>

+ 8 - 1
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/order/addEditor.vue

@@ -46,6 +46,9 @@ import useToast from "@hooks/useToast"
 import FoldingPanel from '@components/common/foldingPanel.vue';
 import CustomerForm from '@components/common/formForm/formView.vue'
 import NewAndModifiedRelatedProducts from '@pages/pageComponents/product/newAndModifiedRelatedProducts.vue'
+import useRouterStore from "@store/useRouterStore.js";
+
+const router = useRouterStore()
 
 const { toastText, toastSuccess, toastFail, toastLoading } = useToast()
 const props = defineProps({
@@ -77,7 +80,11 @@ function onSubmit() {
     requests.post(ORDER_ADDITION_EDITING, { ...formVal }).then(() => {
       toastSuccess('保存成功')
       setTimeout(() => {
-        history.back();
+        router.navigateBack({
+          success: () => {
+            router.eventEmit('moduleListRefreshData', {})
+          }
+        })
       }, 2000)
     }).catch((err) => {
       toastFail('保存失败:' + err.msg)

+ 9 - 3
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/product/addEditor.vue

@@ -18,7 +18,9 @@ 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 useRouterStore from "@store/useRouterStore.js";
 
+const router = useRouterStore()
 const { toastText, toastSuccess, toastFail, toastLoading } = useToast()
 
 const props = defineProps({
@@ -31,14 +33,18 @@ const formVal = ref({})
 
 function onSubmit() {
   formFormRef.value.getJsonData().then((res) => {
-    if(!res.data) {
+    if (!res.data) {
       return
     }
     toastLoading('保存中', 0)
     requests.post(PRODUCT_ADD_EDITOR, { ...props.formValue, ...res.data }).then(() => {
       toastSuccess('保存成功')
       setTimeout(() => {
-        history.back();
+        router.navigateBack({
+          success: () => {
+            router.eventEmit('moduleListRefreshData', {})
+          }
+        })
       }, 2000)
     }).catch(() => {
       toastFail('保存失败')
@@ -56,7 +62,7 @@ useLifecycle({
 });
 
 onActivated(() => {
-  
+
 })
 </script>
 

+ 21 - 13
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/tasks/addEditor.vue

@@ -62,8 +62,8 @@
             {{ vantFormVal.contactsIdName }}
           </template>
         </van-field>
-        <van-field v-model="vantFormVal.executorId" name="executorId" label="执行人" placeholder="请选择" is-link readonly class="resetStyles"
-          @click="showSelectionToBox('executorId')">
+        <van-field v-model="vantFormVal.executorId" name="executorId" label="执行人" placeholder="请选择" is-link readonly
+          class="resetStyles" @click="showSelectionToBox('executorId')">
           <template #input v-if="vantFormVal.executorIdName && vantFormVal.executorIdName.length > 0">
             <TranslationComponent :openId="vantFormVal.executorIdName" />
           </template>
@@ -119,7 +119,8 @@
           <template v-if="[4, '4'].includes(vantFormVal.repeatType)">
             <div class="flex items-center justify-between px-8 pt-3">
               <div>自定义日期</div>
-              <div><van-icon name="add-o" class="ml-2 themeTextColor" size="1.3rem" @click="addCustomeDateItem()" /></div>
+              <div><van-icon name="add-o" class="ml-2 themeTextColor" size="1.3rem" @click="addCustomeDateItem()" />
+              </div>
             </div>
             <van-cell-group inset class="additionalCoAuthorship">
               <template v-for="(item, index) in customeDate">
@@ -129,7 +130,8 @@
                       <van-stepper v-model="item.value" :min="0" button-size="1.2rem" theme="round" integer
                         class="mr-2" />
                       之后
-                      <van-icon name="delete-o" class="ml-2 text-[red]" size="1.3rem"  @click="deleteCustomeDateItem(index)" />
+                      <van-icon name="delete-o" class="ml-2 text-[red]" size="1.3rem"
+                        @click="deleteCustomeDateItem(index)" />
                     </div>
                   </template>
                 </van-cell>
@@ -191,7 +193,9 @@ import dayjs from 'dayjs';
 import PullDownSelector from '@components/common/pullDownSelector.vue'
 import CustomerForm from '@components/common/formForm/formView.vue'
 import TranslationComponent from '@components/common/translationComponent.vue';
+import useRouterStore from "@store/useRouterStore.js";
 
+const router = useRouterStore()
 const { toastText, toastSuccess, toastFail, toastLoading } = useToast()
 const props = defineProps({
   formJson: { required: true },
@@ -229,13 +233,13 @@ const contactDisabled = computed(() => {
   if (!taskType && taskType != 0) {
     return true
   }
-  if(taskType == 0 && !vantFormVal.value.customId) {
+  if (taskType == 0 && !vantFormVal.value.customId) {
     return true
   }
-  if(taskType == 1 && !vantFormVal.value.businessOpportunityId) {
+  if (taskType == 1 && !vantFormVal.value.businessOpportunityId) {
     return true
   }
-  if(taskType == 2 && !vantFormVal.value.orderId) {
+  if (taskType == 2 && !vantFormVal.value.orderId) {
     return true
   }
   return false
@@ -256,7 +260,11 @@ function onSubmit() {
     requests.post(TASK_ADD_EDIT, { ...formValue }).then(() => {
       toastSuccess('保存成功')
       setTimeout(() => {
-        history.back();
+        router.navigateBack({
+          success: () => {
+            router.eventEmit('moduleListRefreshData', {})
+          }
+        })
       }, 2000)
     }).finally(() => {
 
@@ -284,7 +292,7 @@ function selectChange(value, label) {
       getContactData(showSelectionFiled.value, value)
     }
   }
-  if(showSelectionFiled.value == 'repeatType') {
+  if (showSelectionFiled.value == 'repeatType') {
     vantFormVal.value = {
       ...vantFormVal.value,
       endType: 0,
@@ -402,7 +410,7 @@ function getAllListData() {
 
 function initializeData() {
   const row = props.formValue
-  if(!row.id) {
+  if (!row.id) {
     vantFormVal.value = {
       taskType: 0,
       taskTypeName: '客户',
@@ -417,7 +425,7 @@ function initializeData() {
   }
 
   const { id, taskName, priority, taskType, customId, customName, businessOpportunityId, businessOpportunityName, orderId, orderName, clueId, clueNme, contactsId, contactsName
-  , taskExecutors, isRepeat, repeatType, repeatDesignSameday, endType, repeatEndCount, repeatEndDate, repeatDesignDay, executorId, startDate, endDate } = row
+    , taskExecutors, isRepeat, repeatType, repeatDesignSameday, endType, repeatEndCount, repeatEndDate, repeatDesignDay, executorId, startDate, endDate } = row
   vantFormVal.value = {
     id, taskName, priority, taskType, customId, businessOpportunityId, orderId, clueId, contactsId, executorId, repeatType, repeatDesignSameday, endType, repeatEndCount, repeatEndDate, startDate, endDate,
     isRepeat: isRepeat == 1 ? true : false,
@@ -439,10 +447,10 @@ function initializeData() {
     }
   })
   formVal.value = props.formValue
-  if((taskType || taskType == 0) && taskType != 3) {
+  if ((taskType || taskType == 0) && taskType != 3) {
     const filed = taskType == 0 ? 'customId' : taskType == 1 ? 'businessOpportunityId' : taskType == 2 ? 'orderId' : 'clueId'
     const value = taskType == 0 ? customId : taskType == 1 ? businessOpportunityId : taskType == 2 ? orderId : clueId
-    if(value) {
+    if (value) {
       getContactData(filed, value)
     }
   }

+ 9 - 3
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/thread/addEditor.vue

@@ -18,7 +18,9 @@ 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 useRouterStore from "@store/useRouterStore.js";
 
+const router = useRouterStore()
 const { toastText, toastSuccess, toastFail, toastLoading } = useToast()
 
 const props = defineProps({
@@ -31,14 +33,18 @@ const formVal = ref({})
 
 function onSubmit() {
   formFormRef.value.getJsonData().then((res) => {
-    if(!res.data) {
+    if (!res.data) {
       return
     }
     toastLoading('保存中', 0)
     requests.post(NEW_CLUE_EDITING, { ...props.formValue, ...res.data }).then(() => {
       toastSuccess('保存成功')
       setTimeout(() => {
-        history.back();
+        router.navigateBack({
+          success: () => {
+            router.eventEmit('moduleListRefreshData', {})
+          }
+        })
       }, 2000)
     }).catch((err) => {
       toastFail('保存失败:' + err.msg)
@@ -56,7 +62,7 @@ useLifecycle({
 });
 
 onActivated(() => {
-  
+
 })
 </script>
 

+ 11 - 1
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/thread/threadInfo.vue

@@ -45,7 +45,9 @@ import { TRANSFER_CLUES } from '@hooks/useApi'
 import requests from "@common/requests";
 import useShowToast from '@hooks/useToast'
 import useInfoStore from '@store/useInfoStore'
+import useRouterStore from "@store/useRouterStore.js";
 
+const router = useRouterStore()
 const userInfo = useInfoStore()
 const { toastSuccess, toastFail, toastText } = useShowToast()
 const props = defineProps({
@@ -60,6 +62,13 @@ const showDialog = ref(false);
 const showSelect = ref(false);
 const dialogSelection = ref({});
 
+function listReloadData() {
+  router.navigateBack({
+    success: () => {
+      router.eventEmit('moduleListRefreshData', {})
+    }
+  })
+}
 function confirmTransfer() {
   if(!dialogSelection.value.label) {
     return toastText('请选择要转移的人员')
@@ -69,7 +78,7 @@ function confirmTransfer() {
     toastSuccess('转移成功')
     showDialog.value = false
     setTimeout(() => {
-      history.back()
+      listReloadData()
     }, 2000)
   })
 }
@@ -81,6 +90,7 @@ function claimAndClaim() {
   }).then(() => {
     requests.post(TRANSFER_CLUES, { ids: props.info.id, inchargerId: userInfo.userInfo.id }).then((res) => {
       toastSuccess('认领成功')
+      listReloadData()
       props.info.inchargerName = userInfo.userInfo.name
       showDialog.value = false
     })