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-form-item>
<!-- TODO 芋艿封装成一个组件 -->
<el-form-item label="客户名称" prop="customerName">
<el-popover
placement="bottom"
@ -89,7 +90,6 @@
/>
</el-select>
</el-form-item>
<el-form-item label="手机号" prop="mobile">
<el-input v-model="formData.mobile" placeholder="请输入手机号" />
</el-form-item>
@ -212,6 +212,7 @@ const formRules = reactive({
const formRef = ref() // Ref
const ownerUserList = ref<any[]>([])
const userList = ref<UserApi.UserVO[]>([]) //
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
dialogVisible.value = true
@ -231,6 +232,8 @@ const open = async (type: string, id?: number) => {
}
}
}
defineExpose({ open }) // open
/** 查询列表 */
const getList = async () => {
loading.value = true
@ -242,7 +245,7 @@ const getList = async () => {
loading.value = false
}
}
defineExpose({ open }) // open
const gotOwnerUser = (owerUserId: any) => {
if (owerUserId !== null) {
owerUserId.split(',').forEach((item: string) => {
@ -254,6 +257,7 @@ const gotOwnerUser = (owerUserId: any) => {
})
}
}
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
@ -305,12 +309,13 @@ const resetForm = () => {
formRef.value?.resetFields()
ownerUserList.value = []
}
/** 添加/修改操作 */
// TODO @zynaowner
const owerRef = ref()
const openOwerForm = (type: string) => {
owerRef.value.open(type, ownerUserList.value)
}
const owerSelectValue = (value) => {
ownerUserList.value = value.value
formData.value.ownerUserId = undefined
@ -322,7 +327,7 @@ const owerSelectValue = (value) => {
}
})
}
//
//
const showCustomer = ref(false)
const openCustomerSelect = () => {
showCustomer.value = !showCustomer.value
@ -341,7 +346,7 @@ const selectCustomer = () => {
formData.value.customerName = multipleSelection.value.name
showCustomer.value = !showCustomer.value
}
const allContactList = ref([]) //
const allContactList = ref([]) //
onMounted(async () => {
allContactList.value = await ContactApi.simpleAlllist()
})

View File

@ -18,6 +18,7 @@
</Dialog>
</template>
<script setup lang="ts">
// TODO
import * as UserApi from '@/api/system/user'
import { parseBigInt } from 'jsencrypt/lib/lib/jsbn/jsbn'
const dialogVisible = ref(false) //

View File

@ -3,7 +3,7 @@
* @Date: 2023-11-11 14:50:11
* @LastEditTime: 2023-11-11 14:52:47
* @FilePath: \yudao-ui-admin-vue3\src\views\crm\contact\detail\ContactBasicInfo.vue
* @Description:
* @Description:
-->
<template>
<el-col>
@ -17,6 +17,7 @@
</el-col>
</template>
<script setup lang="ts">
// TODO review
import * as ContactApi from '@/api/crm/contact'
const { contact } = defineProps<{ contact: ContactApi.ContactVO }>()

View File

@ -62,6 +62,7 @@
</el-collapse>
</template>
<script setup lang="ts">
// TODO review
import * as ContactApi from '@/api/crm/contact'
import { DICT_TYPE } from '@/utils/dict'
import { formatDate } from '@/utils/formatTime'

View File

@ -1,4 +1,5 @@
<template>
<!-- TODO 芋艿要不要把 3 62 合并成一个组件 -->
<div v-loading="loading">
<div class="flex items-start justify-between">
<div>
@ -105,6 +106,7 @@ import ContactDetails from '@/views/crm/contact/detail/ContactDetails.vue'
import ContactForm from '@/views/crm/contact/ContactForm.vue'
import { formatDate } from '@/utils/formatTime'
import * as CustomerApi from '@/api/crm/customer'
// TODO review
defineOptions({ name: 'ContactDetail' })
const { delView } = useTagsViewStore() //

View File

@ -1,6 +1,7 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<!-- TODO zyna筛选项按照需求简化下 -->
<el-form
class="-mb-15px"
:model="queryParams"
@ -214,6 +215,7 @@ import * as UserApi from '@/api/system/user'
import * as CustomerApi from '@/api/crm/customer'
defineOptions({ name: 'CrmContact' })
const message = useMessage() //
const { t } = useI18n() //
@ -244,6 +246,7 @@ const queryParams = reactive({
const queryFormRef = ref() //
const exportLoading = ref(false) //
const userList = ref<UserApi.UserVO[]>([]) //
/** 查询列表 */
const getList = async () => {
loading.value = true
@ -301,6 +304,8 @@ const handleExport = async () => {
exportLoading.value = false
}
}
// TODO @zyna
const gotOwnerUser = (owerUserId: string) => {
let ownerName = ''
if (owerUserId !== null) {
@ -315,13 +320,14 @@ const gotOwnerUser = (owerUserId: string) => {
}
return ownerName
}
/** 详情页面 */
/** 打开客户详情 */
const { push } = useRouter()
const openDetail = (id: number) => {
push({ name: 'CrmContactDetail', params: { id } })
}
// TODO @zyna
const allContactList = ref([]) //
const allCustomerList = ref([]) //
/** 初始化 **/