crm:code review 联系人管理
This commit is contained in:
parent
7c5ae17d04
commit
85e953b920
@ -28,6 +28,7 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<!-- TODO 芋艿:封装成一个组件 -->
|
||||||
<el-form-item label="客户名称" prop="customerName">
|
<el-form-item label="客户名称" prop="customerName">
|
||||||
<el-popover
|
<el-popover
|
||||||
placement="bottom"
|
placement="bottom"
|
||||||
@ -89,7 +90,6 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="手机号" prop="mobile">
|
<el-form-item label="手机号" prop="mobile">
|
||||||
<el-input v-model="formData.mobile" placeholder="请输入手机号" />
|
<el-input v-model="formData.mobile" placeholder="请输入手机号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -212,6 +212,7 @@ const formRules = reactive({
|
|||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
const ownerUserList = ref<any[]>([])
|
const ownerUserList = ref<any[]>([])
|
||||||
const userList = ref<UserApi.UserVO[]>([]) // 用户列表
|
const userList = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||||
|
|
||||||
/** 打开弹窗 */
|
/** 打开弹窗 */
|
||||||
const open = async (type: string, id?: number) => {
|
const open = async (type: string, id?: number) => {
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
@ -231,6 +232,8 @@ const open = async (type: string, id?: number) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
/** 查询列表 */
|
/** 查询列表 */
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
@ -242,7 +245,7 @@ const getList = async () => {
|
|||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|
||||||
const gotOwnerUser = (owerUserId: any) => {
|
const gotOwnerUser = (owerUserId: any) => {
|
||||||
if (owerUserId !== null) {
|
if (owerUserId !== null) {
|
||||||
owerUserId.split(',').forEach((item: string) => {
|
owerUserId.split(',').forEach((item: string) => {
|
||||||
@ -254,6 +257,7 @@ const gotOwnerUser = (owerUserId: any) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 提交表单 */
|
/** 提交表单 */
|
||||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
@ -305,12 +309,13 @@ const resetForm = () => {
|
|||||||
formRef.value?.resetFields()
|
formRef.value?.resetFields()
|
||||||
ownerUserList.value = []
|
ownerUserList.value = []
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 添加/修改操作 */
|
/** 添加/修改操作 */
|
||||||
|
// TODO @zyna:owner?拼写要注意哈;
|
||||||
const owerRef = ref()
|
const owerRef = ref()
|
||||||
const openOwerForm = (type: string) => {
|
const openOwerForm = (type: string) => {
|
||||||
owerRef.value.open(type, ownerUserList.value)
|
owerRef.value.open(type, ownerUserList.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
const owerSelectValue = (value) => {
|
const owerSelectValue = (value) => {
|
||||||
ownerUserList.value = value.value
|
ownerUserList.value = value.value
|
||||||
formData.value.ownerUserId = undefined
|
formData.value.ownerUserId = undefined
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
</Dialog>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
// TODO 芋艿:统一选择框。
|
||||||
import * as UserApi from '@/api/system/user'
|
import * as UserApi from '@/api/system/user'
|
||||||
import { parseBigInt } from 'jsencrypt/lib/lib/jsbn/jsbn'
|
import { parseBigInt } from 'jsencrypt/lib/lib/jsbn/jsbn'
|
||||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
// TODO 芋艿:后面在 review 么?
|
||||||
import * as ContactApi from '@/api/crm/contact'
|
import * as ContactApi from '@/api/crm/contact'
|
||||||
|
|
||||||
const { contact } = defineProps<{ contact: ContactApi.ContactVO }>()
|
const { contact } = defineProps<{ contact: ContactApi.ContactVO }>()
|
||||||
|
@ -62,6 +62,7 @@
|
|||||||
</el-collapse>
|
</el-collapse>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
// TODO 芋艿:后面在 review 么?
|
||||||
import * as ContactApi from '@/api/crm/contact'
|
import * as ContactApi from '@/api/crm/contact'
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
import { DICT_TYPE } from '@/utils/dict'
|
||||||
import { formatDate } from '@/utils/formatTime'
|
import { formatDate } from '@/utils/formatTime'
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<!-- TODO 芋艿:要不要把 3 到 62 合并成一个组件 -->
|
||||||
<div v-loading="loading">
|
<div v-loading="loading">
|
||||||
<div class="flex items-start justify-between">
|
<div class="flex items-start justify-between">
|
||||||
<div>
|
<div>
|
||||||
@ -105,6 +106,7 @@ import ContactDetails from '@/views/crm/contact/detail/ContactDetails.vue'
|
|||||||
import ContactForm from '@/views/crm/contact/ContactForm.vue'
|
import ContactForm from '@/views/crm/contact/ContactForm.vue'
|
||||||
import { formatDate } from '@/utils/formatTime'
|
import { formatDate } from '@/utils/formatTime'
|
||||||
import * as CustomerApi from '@/api/crm/customer'
|
import * as CustomerApi from '@/api/crm/customer'
|
||||||
|
// TODO 芋艿:后面在 review 么?
|
||||||
|
|
||||||
defineOptions({ name: 'ContactDetail' })
|
defineOptions({ name: 'ContactDetail' })
|
||||||
const { delView } = useTagsViewStore() // 视图操作
|
const { delView } = useTagsViewStore() // 视图操作
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<!-- 搜索工作栏 -->
|
<!-- 搜索工作栏 -->
|
||||||
|
<!-- TODO zyna:筛选项,按照需求简化下 -->
|
||||||
<el-form
|
<el-form
|
||||||
class="-mb-15px"
|
class="-mb-15px"
|
||||||
:model="queryParams"
|
:model="queryParams"
|
||||||
@ -214,6 +215,7 @@ import * as UserApi from '@/api/system/user'
|
|||||||
import * as CustomerApi from '@/api/crm/customer'
|
import * as CustomerApi from '@/api/crm/customer'
|
||||||
|
|
||||||
defineOptions({ name: 'CrmContact' })
|
defineOptions({ name: 'CrmContact' })
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
@ -244,6 +246,7 @@ const queryParams = reactive({
|
|||||||
const queryFormRef = ref() // 搜索的表单
|
const queryFormRef = ref() // 搜索的表单
|
||||||
const exportLoading = ref(false) // 导出的加载中
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
const userList = ref<UserApi.UserVO[]>([]) // 用户列表
|
const userList = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||||
|
|
||||||
/** 查询列表 */
|
/** 查询列表 */
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
@ -301,6 +304,8 @@ const handleExport = async () => {
|
|||||||
exportLoading.value = false
|
exportLoading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO @zyna:这个负责人的读取,放在后端好点
|
||||||
const gotOwnerUser = (owerUserId: string) => {
|
const gotOwnerUser = (owerUserId: string) => {
|
||||||
let ownerName = ''
|
let ownerName = ''
|
||||||
if (owerUserId !== null) {
|
if (owerUserId !== null) {
|
||||||
@ -315,13 +320,14 @@ const gotOwnerUser = (owerUserId: string) => {
|
|||||||
}
|
}
|
||||||
return ownerName
|
return ownerName
|
||||||
}
|
}
|
||||||
/** 详情页面 */
|
|
||||||
/** 打开客户详情 */
|
/** 打开客户详情 */
|
||||||
const { push } = useRouter()
|
const { push } = useRouter()
|
||||||
const openDetail = (id: number) => {
|
const openDetail = (id: number) => {
|
||||||
push({ name: 'CrmContactDetail', params: { id } })
|
push({ name: 'CrmContactDetail', params: { id } })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO @zyna:这个上级的读取,放在后端读取,更合适;因为可能数据量比较大
|
||||||
const allContactList = ref([]) //所有联系人列表
|
const allContactList = ref([]) //所有联系人列表
|
||||||
const allCustomerList = ref([]) //客户列表
|
const allCustomerList = ref([]) //客户列表
|
||||||
/** 初始化 **/
|
/** 初始化 **/
|
||||||
|
Loading…
Reference in New Issue
Block a user