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