contactsInfo.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <div class="flex flex-col h-full">
  3. <div class="bg-white info flex-1 overflow-y-auto cellnormall">
  4. <van-cell title="联系人姓名" :value="info.name" />
  5. <van-cell title="电话" :value="info.phone" />
  6. <van-cell title="邮箱" :value="info.email" />
  7. <van-cell title="职务" :value="info.position" />
  8. <van-cell title="地址" :value="info.address" />
  9. <van-cell title="性别" :value="info.phone == 1 ? '男' : '女'" />
  10. <van-cell title="负责人">
  11. <template #default>
  12. <TranslationComponent :openId="info.ownerName" />
  13. </template>
  14. </van-cell>
  15. <van-cell title="备注" :value="info.remark" />
  16. </div>
  17. <div class="bottomButton">
  18. <van-button type="warning" class="w-full block" @click="showDialogCli()">转移联系人</van-button>
  19. </div>
  20. <!-- 转移弹窗 -->
  21. <van-dialog v-model:show="showDialog" :title="`转移线索`" show-cancel-button
  22. @confirm="confirmTransfer" :before-close="dialogCloseBefo">
  23. <van-cell title="转移至" is-link @click="showSelect = true">
  24. <template #value>
  25. {{ dialogSelection.label }}
  26. </template>
  27. </van-cell>
  28. <div class="themeTextColor text-size-small pl-4 pt-2 pb-2">转移后,将看不到此线索了</div>
  29. </van-dialog>
  30. <!-- select 选择器 -->
  31. <van-popup v-model:show="showSelect" destroy-on-close position="bottom" :style="{ height: '80%' }">
  32. <PullDownSelector @change="selectChange" />
  33. </van-popup>
  34. </div>
  35. </template>
  36. <script setup>
  37. import { ref } from 'vue';
  38. import { useLifecycle } from '@hooks/useCommon.js';
  39. import { TRANSFER_CONTACT_PERSON } from '@hooks/useApi'
  40. import requests from "@common/requests";
  41. import useShowToast from '@hooks/useToast'
  42. import useInfoStore from '@store/useInfoStore'
  43. const userInfo = useInfoStore()
  44. const { toastSuccess, toastFail, toastText } = useShowToast()
  45. const props = defineProps({
  46. info: {
  47. type: Object,
  48. required: true,
  49. default: () => ({})
  50. }
  51. })
  52. const showDialog = ref(false);
  53. const showSelect = ref(false);
  54. const dialogSelection = ref({});
  55. function confirmTransfer() {
  56. if(!dialogSelection.value.label) {
  57. return toastText('请选择要转移的人员')
  58. }
  59. requests.post(TRANSFER_CONTACT_PERSON, { ids: props.info.id, ownerId: dialogSelection.value.value }).then((res) => {
  60. toastSuccess('转移成功')
  61. showDialog.value = false
  62. setTimeout(() => {
  63. history.back()
  64. }, 2000)
  65. })
  66. }
  67. function selectChange(value, label) {
  68. dialogSelection.value = {
  69. value, label
  70. }
  71. showSelect.value = false
  72. }
  73. function showDialogCli() {
  74. showDialog.value = true
  75. }
  76. function dialogCloseBefo(val) {
  77. if(val == 'confirm' && showDialog.value) {
  78. return false
  79. }
  80. return true
  81. }
  82. useLifecycle({
  83. load: () => {
  84. // 添加加载逻辑
  85. }
  86. });
  87. </script>
  88. <style lang='scss' scoped>
  89. .bottomButton {
  90. margin: 0 14px;
  91. padding-bottom: 30px;
  92. :deep(.van-button) {
  93. margin-bottom: 20px;
  94. }
  95. }
  96. .info {
  97. margin: 8px 14px 30px 14px;
  98. padding: 14px;
  99. }
  100. </style>