From 85e953b920891cd25c1dc886586bd6bcae47af7e Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 18 Nov 2023 21:08:00 +0800 Subject: [PATCH] =?UTF-8?q?crm=EF=BC=9Acode=20review=20=E8=81=94=E7=B3=BB?= =?UTF-8?q?=E4=BA=BA=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/crm/contact/ContactForm.vue | 15 ++++++++++----- src/views/crm/contact/OwerSelect.vue | 1 + src/views/crm/contact/detail/ContactBasicInfo.vue | 3 ++- src/views/crm/contact/detail/ContactDetails.vue | 1 + src/views/crm/contact/detail/index.vue | 2 ++ src/views/crm/contact/index.vue | 8 +++++++- 6 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/views/crm/contact/ContactForm.vue b/src/views/crm/contact/ContactForm.vue index 94d50299..68d0030b 100644 --- a/src/views/crm/contact/ContactForm.vue +++ b/src/views/crm/contact/ContactForm.vue @@ -28,6 +28,7 @@ /> + - @@ -212,6 +212,7 @@ const formRules = reactive({ const formRef = ref() // 表单 Ref const ownerUserList = ref([]) const userList = ref([]) // 用户列表 + /** 打开弹窗 */ 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 @zyna:owner?拼写要注意哈; 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() }) diff --git a/src/views/crm/contact/OwerSelect.vue b/src/views/crm/contact/OwerSelect.vue index 83dd143b..5ed0fe50 100644 --- a/src/views/crm/contact/OwerSelect.vue +++ b/src/views/crm/contact/OwerSelect.vue @@ -18,6 +18,7 @@