فهرست منبع

提交相关代码

Lijy 5 ماه پیش
والد
کامیت
391169db7b

BIN
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/assets/image/claimAndClaim.png


+ 2 - 1
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/hooks/useApi.js

@@ -17,7 +17,7 @@ export const GET_TASK_LIST = '/tasks/pageTask' // 获取任务列表
 export const GET_PRODUCT_LIST = '/product/list' // 获取产品列表
 export const GET_CONTRACT_LIST = '/contract/getContractPage' // 获取合同列表
 export const GET_SALES_ORDER_LIST = '/order/list' // 获取销售订单列表
-export const GET_VISITOR_PLAN = `/visitPlan/getVisitPlan` // 获取访客计划
+export const GET_VISITOR_PLAN = `/visitPlan/getVisitPlanList` // 获取访客计划
 export const GET_FREQUENTLY_USED_CONTACTS = `/contacts/getFrequentContacts` // 获取常用联系人
 export const GET_COMMONLY_USED_MODULES = `/userCommonModule/getCommonModules` // 常用模块
 
@@ -34,6 +34,7 @@ export const DELETE_VISITOR_PLAN = `/visitPlan/delVisitPlan` // 删除访客计
 export const BUSINESS_OPPORTUNITY_TRANSFER = '/business-opportunity/claim' // 转移商机
 export const TRANSFER_CLUES = '/clue/claim' // 转移线索
 export const TRANSFER_CUSTOMERS = '/custom/claim' // 转移客户
+export const TRANSFER_CONTACT_PERSON = `/contacts/transferContacts` // 转移联系人
 export const NEW_BUSINESS_OPPORTUNITY_EDITING = `/business-opportunity/insertAndUpdate` // 商机新增编辑
 export const NEW_CLUE_EDITING = `/clue/insertAndUpdate` // 线索新增编辑
 export const CUSTOMER_ADDED_EDITOR = `/custom/insertAndUpdate` // 客户新增编辑

+ 40 - 7
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/moduleList/moduleList.vue

@@ -43,11 +43,27 @@
                     </div>
                     <template #right>
                       <div class="flex items-center h-full bg-white">
-                        <template v-for="subItem in popUpWindowArray">
-                          <div class="buttonCircle rounded-full items-justify-center text-white" @click="longPress(item, subItem)">
-                            <img :src="subItem.icon" class="w-full h-full">
+                        <template v-if="!item.inchargerName">
+                          <div class="buttonCircle rounded-full" @click="claimAndClaim(item)" v-if="['business', 'thread', 
+                          'customer'].includes(queryParameters?.key)">
+                            <img src="/src/assets/image/claimAndClaim.png" class="w-full h-full">
                           </div>
                         </template>
+                        <template v-if="item.inchargerName || item.ownerName">
+                          <div class="buttonCircle rounded-full" @click="transfer(item)" v-if="['business', 'thread', 
+                          'customer', 'contacts'].includes(queryParameters?.key)">
+                            <img src="/src/assets/image/transfer.png" class="w-full h-full">
+                          </div>
+                        </template>
+                        <div class="buttonCircle rounded-full" @click="topMounted(item)">
+                          <img src="/src/assets/image/topMounted.png" class="w-full h-full">
+                        </div>
+                        <div class="buttonCircle rounded-full" @click="edit(item)">
+                          <img src="/src/assets/image/edit.png" class="w-full h-full">
+                        </div>
+                        <div class="buttonCircle rounded-full" @click="deleteRow(item)">
+                          <img src="/src/assets/image/delete.png" class="w-full h-full">
+                        </div>
                       </div>
                     </template>
                   </van-swipe-cell>
@@ -97,6 +113,7 @@ import { GET_CUSTOM_FORM_JSON } from '@hooks/useApi'
 import requests from "@common/requests";
 import useRouterStore from "@store/useRouterStore.js";
 import useFixedData from "@store/useFixedData.js"
+import useInfoStore from '@store/useInfoStore'
 // import ElementLongPress from "@components/common/elementLongPress.vue";
 import DragBox from '@components/common/dragBox.vue';
 
@@ -108,6 +125,7 @@ const TOP_MOUNTED = 'topMounted';
 const { toastSuccess, toastFail, toastText } = useShowToast()
 const router = useRouterStore()
 const fixedData = useFixedData()
+const userInfo = useInfoStore()
 const searchVal = ref()
 const queryParameters = ref({})
 const loadingList = ref(false)
@@ -159,7 +177,7 @@ function edit(row) {
   const formList = resetListData(formJson?.list)
   const filedObj = getListFieldKey(formList, row)
   let other = {}
-  if(queryParameters.value.key == 'tasks') {
+  if (queryParameters.value.key == 'tasks') {
     other = { ...row }
   }
   toAddEditor({ ...other, ...filedObj, id: row.id })
@@ -173,7 +191,7 @@ function transfer(row) {
 }
 
 function confirmTransfer() {
-  if(!dialogSelection.value.label) {
+  if (!dialogSelection.value.label) {
     return toastText('请选择要转移的人员')
   }
   const { id } = excessiveData.value
@@ -185,6 +203,21 @@ function confirmTransfer() {
   })
 }
 
+// 认领
+function claimAndClaim(item) {
+  const { id, name, clueName, customName } = item
+  const userId = userInfo.userInfo.id
+  showConfirmDialog({
+    title: `认领${queryParameters.value.name}`,
+    message: `确定认领【${name || clueName || customName}】${queryParameters.value.name}吗?`,
+  }).then(() => {
+    requests.post(queryParameters?.value.transferInterface, { ids: id, inchargerId: userId }).then((res) => {
+      toastSuccess('认领成功')
+      onRefresh(true)
+    })
+  })
+}
+
 // 删除事件
 function deleteRow(row) {
   const { name = '', searchFiled = {}, deteleFiled = '' } = queryParameters.value
@@ -322,7 +355,7 @@ function selectChange(value, label) {
 }
 
 function dialogCloseBefo(val) {
-  if(val == 'confirm' && showDialog.value) {
+  if (val == 'confirm' && showDialog.value) {
     return false
   }
 
@@ -367,7 +400,7 @@ useLifecycle({
   }
 }
 
-.headerModeuleList  :deep(.van-search__content) {
+.headerModeuleList :deep(.van-search__content) {
   background: #fff !im\portant;
   height: 42px;
   align-items: center;

+ 88 - 11
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/business/businessInfo.vue

@@ -20,15 +20,40 @@
     </div>
     <div class="bottomButton">
       <van-button type="primary" class="w-full block">关联联系人</van-button>
-      <van-button type="warning" class="w-full block">转移商机</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-cell title="转移至" is-link @click="showSelect = true">
+        <template #value>
+          {{ dialogSelection.label }}
+        </template>
+      </van-cell>
+      <div class="themeTextColor text-size-small pl-4 pt-2 pb-2">转移后,将看不到此商机了</div>
+    </van-dialog>
+
+    <!-- select 选择器 -->
+    <van-popup v-model:show="showSelect" destroy-on-close position="bottom" :style="{ height: '80%' }">
+      <PullDownSelector @change="selectChange" />
+    </van-popup>
   </div>
 </template>
 
 <script setup>
 import { ref } from 'vue';
 import { useLifecycle } from '@hooks/useCommon.js';
+import { BUSINESS_OPPORTUNITY_TRANSFER } from '@hooks/useApi'
+import requests from "@common/requests";
+import useShowToast from '@hooks/useToast'
+import useInfoStore from '@store/useInfoStore'
 
+const userInfo = useInfoStore()
+const { toastSuccess, toastFail, toastText } = useShowToast()
 const props = defineProps({
   info: {
     type: Object,
@@ -37,6 +62,56 @@ const props = defineProps({
   }
 })
 
+const showDialog = ref(false);
+const showSelect = ref(false);
+const dialogSelection = ref({});
+
+function confirmTransfer() {
+  if (!dialogSelection.value.label) {
+    return toastText('请选择要转移的人员')
+  }
+
+  requests.post(BUSINESS_OPPORTUNITY_TRANSFER, { ids: props.info.id, inchargerId: dialogSelection.value.value }).then((res) => {
+    toastSuccess('转移成功')
+    showDialog.value = false
+    setTimeout(() => {
+      history.back()
+    }, 2000)
+  })
+}
+
+function claimAndClaim() {
+  showConfirmDialog({
+    title: '认领商机',
+    message: `确定认领【${props.info.name}】商机吗?`,
+  }).then(() => {
+    requests.post(BUSINESS_OPPORTUNITY_TRANSFER, { ids: props.info.id, inchargerId: userInfo.userInfo.id }).then((res) => {
+      toastSuccess('认领成功')
+      props.info.inchargerName = userInfo.userInfo.name
+      showDialog.value = false
+    })
+  })
+}
+
+function selectChange(value, label) {
+  dialogSelection.value = {
+    value, label
+  }
+  showSelect.value = false
+}
+
+function showDialogCli() {
+  showDialog.value = true
+}
+
+function dialogCloseBefo(val) {
+  if (val == 'confirm' && showDialog.value) {
+    return false
+  }
+
+  return true
+}
+
 useLifecycle({
   load: () => {
     // 添加加载逻辑
@@ -45,15 +120,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>

+ 62 - 0
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/contacts/contactsInfo.vue

@@ -14,13 +14,38 @@
       </van-cell>
       <van-cell title="备注" :value="info.remark" />
     </div>
+    <div class="bottomButton">
+      <van-button type="warning" class="w-full block" @click="showDialogCli()">转移联系人</van-button>
+    </div>
+
+    <!-- 转移弹窗 -->
+    <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 }}
+        </template>
+      </van-cell>
+      <div class="themeTextColor text-size-small pl-4 pt-2 pb-2">转移后,将看不到此线索了</div>
+    </van-dialog>
+
+    <!-- select 选择器 -->
+    <van-popup v-model:show="showSelect" destroy-on-close position="bottom" :style="{ height: '80%' }">
+      <PullDownSelector @change="selectChange" />
+    </van-popup>
   </div>
 </template>
 
 <script setup>
 import { ref } from 'vue';
 import { useLifecycle } from '@hooks/useCommon.js';
+import { TRANSFER_CONTACT_PERSON } from '@hooks/useApi'
+import requests from "@common/requests";
+import useShowToast from '@hooks/useToast'
+import useInfoStore from '@store/useInfoStore'
 
+const userInfo = useInfoStore()
+const { toastSuccess, toastFail, toastText } = useShowToast()
 const props = defineProps({
   info: {
     type: Object,
@@ -29,6 +54,43 @@ const props = defineProps({
   }
 })
 
+const showDialog = ref(false);
+const showSelect = ref(false);
+const dialogSelection = ref({});
+
+function confirmTransfer() {
+  if(!dialogSelection.value.label) {
+    return toastText('请选择要转移的人员')
+  }
+
+  requests.post(TRANSFER_CONTACT_PERSON, { ids: props.info.id, ownerId: dialogSelection.value.value }).then((res) => {
+    toastSuccess('转移成功')
+    showDialog.value = false
+    setTimeout(() => {
+      history.back()
+    }, 2000)
+  })
+}
+
+function selectChange(value, label) {
+  dialogSelection.value = {
+    value, label
+  }
+  showSelect.value = false
+}
+
+function showDialogCli() {
+  showDialog.value = true
+}
+
+function dialogCloseBefo(val) {
+  if(val == 'confirm' && showDialog.value) {
+    return false
+  }
+
+  return true
+}
+
 useLifecycle({
   load: () => {
     // 添加加载逻辑

+ 74 - 2
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/customer/customerInfo.vue

@@ -16,16 +16,38 @@
       <van-cell title="备注" :value="info.customDesc" />
     </div>
     <div class="bottomButton">
-      <van-button type="primary" class="w-full block">关联联系人</van-button>
-      <van-button type="warning" class="w-full block">转移商机</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-cell title="转移至" is-link @click="showSelect = true">
+        <template #value>
+          {{ dialogSelection.label }}
+        </template>
+      </van-cell>
+      <div class="themeTextColor text-size-small pl-4 pt-2 pb-2">转移后,将看不到此线索了</div>
+    </van-dialog>
+
+    <!-- select 选择器 -->
+    <van-popup v-model:show="showSelect" destroy-on-close position="bottom" :style="{ height: '80%' }">
+      <PullDownSelector @change="selectChange" />
+    </van-popup>
   </div>
 </template>
 
 <script setup>
 import { ref } from 'vue';
 import { useLifecycle } from '@hooks/useCommon.js';
+import { TRANSFER_CUSTOMERS } from '@hooks/useApi'
+import requests from "@common/requests";
+import useShowToast from '@hooks/useToast'
+import useInfoStore from '@store/useInfoStore'
 
+const userInfo = useInfoStore()
+const { toastSuccess, toastFail, toastText } = useShowToast()
 const props = defineProps({
   info: {
     type: Object,
@@ -34,6 +56,56 @@ const props = defineProps({
   }
 })
 
+const showDialog = ref(false);
+const showSelect = ref(false);
+const dialogSelection = ref({});
+
+function confirmTransfer() {
+  if(!dialogSelection.value.label) {
+    return toastText('请选择要转移的人员')
+  }
+
+  requests.post(TRANSFER_CUSTOMERS, { ids: props.info.id, inchargerId: dialogSelection.value.value }).then((res) => {
+    toastSuccess('转移成功')
+    showDialog.value = false
+    setTimeout(() => {
+      history.back()
+    }, 2000)
+  })
+}
+
+function claimAndClaim() {
+  showConfirmDialog({
+    title: '认领客户',
+    message: `确定认领【${props.info.name}】客户吗?`,
+  }).then(() => {
+    requests.post(TRANSFER_CUSTOMERS, { ids: props.info.id, inchargerId: userInfo.userInfo.id }).then((res) => {
+      toastSuccess('认领成功')
+      props.info.inchargerName = userInfo.userInfo.name
+      showDialog.value = false
+    })
+  })
+}
+
+function selectChange(value, label) {
+  dialogSelection.value = {
+    value, label
+  }
+  showSelect.value = false
+}
+
+function showDialogCli() {
+  showDialog.value = true
+}
+
+function dialogCloseBefo(val) {
+  if(val == 'confirm' && showDialog.value) {
+    return false
+  }
+
+  return true
+}
+
 useLifecycle({
   load: () => {
     // 添加加载逻辑

+ 74 - 2
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/thread/threadInfo.vue

@@ -16,16 +16,38 @@
       <van-cell title="备注" :value="info.remark" />
     </div>
     <div class="bottomButton">
-      <van-button type="primary" class="w-full block">转移线索</van-button>
-      <van-button type="warning" class="w-full block">转为商机</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-cell title="转移至" is-link @click="showSelect = true">
+        <template #value>
+          {{ dialogSelection.label }}
+        </template>
+      </van-cell>
+      <div class="themeTextColor text-size-small pl-4 pt-2 pb-2">转移后,将看不到此线索了</div>
+    </van-dialog>
+
+    <!-- select 选择器 -->
+    <van-popup v-model:show="showSelect" destroy-on-close position="bottom" :style="{ height: '80%' }">
+      <PullDownSelector @change="selectChange" />
+    </van-popup>
   </div>
 </template>
 
 <script setup>
 import { ref } from 'vue';
 import { useLifecycle } from '@hooks/useCommon.js';
+import { TRANSFER_CLUES } from '@hooks/useApi'
+import requests from "@common/requests";
+import useShowToast from '@hooks/useToast'
+import useInfoStore from '@store/useInfoStore'
 
+const userInfo = useInfoStore()
+const { toastSuccess, toastFail, toastText } = useShowToast()
 const props = defineProps({
   info: {
     type: Object,
@@ -34,6 +56,56 @@ const props = defineProps({
   }
 })
 
+const showDialog = ref(false);
+const showSelect = ref(false);
+const dialogSelection = ref({});
+
+function confirmTransfer() {
+  if(!dialogSelection.value.label) {
+    return toastText('请选择要转移的人员')
+  }
+
+  requests.post(TRANSFER_CLUES, { ids: props.info.id, inchargerId: dialogSelection.value.value }).then((res) => {
+    toastSuccess('转移成功')
+    showDialog.value = false
+    setTimeout(() => {
+      history.back()
+    }, 2000)
+  })
+}
+
+function claimAndClaim() {
+  showConfirmDialog({
+    title: '认领线索',
+    message: `确定认领【${props.info.name}】线索吗?`,
+  }).then(() => {
+    requests.post(TRANSFER_CLUES, { ids: props.info.id, inchargerId: userInfo.userInfo.id }).then((res) => {
+      toastSuccess('认领成功')
+      props.info.inchargerName = userInfo.userInfo.name
+      showDialog.value = false
+    })
+  })
+}
+
+function selectChange(value, label) {
+  dialogSelection.value = {
+    value, label
+  }
+  showSelect.value = false
+}
+
+function showDialogCli() {
+  showDialog.value = true
+}
+
+function dialogCloseBefo(val) {
+  if(val == 'confirm' && showDialog.value) {
+    return false
+  }
+
+  return true
+}
+
 useLifecycle({
   load: () => {
     // 添加加载逻辑