crm:code review 联系人管理

This commit is contained in:
YunaiV 2023-11-18 21:08:00 +08:00
parent 7c5ae17d04
commit 85e953b920
6 changed files with 23 additions and 7 deletions

View File

@ -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 @zynaowner
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

View File

@ -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) //

View File

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

View File

@ -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'

View File

@ -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() //

View File

@ -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([]) //
/** 初始化 **/ /** 初始化 **/