Skip to content

Commit 85e953b

Browse files
committed
crm:code review 联系人管理
1 parent 7c5ae17 commit 85e953b

File tree

6 files changed

+23
-7
lines changed

6 files changed

+23
-7
lines changed

src/views/crm/contact/ContactForm.vue

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
/>
2929
</el-select>
3030
</el-form-item>
31+
<!-- TODO 芋艿:封装成一个组件 -->
3132
<el-form-item label="客户名称" prop="customerName">
3233
<el-popover
3334
placement="bottom"
@@ -89,7 +90,6 @@
8990
/>
9091
</el-select>
9192
</el-form-item>
92-
9393
<el-form-item label="手机号" prop="mobile">
9494
<el-input v-model="formData.mobile" placeholder="请输入手机号" />
9595
</el-form-item>
@@ -212,6 +212,7 @@ const formRules = reactive({
212212
const formRef = ref() // 表单 Ref
213213
const ownerUserList = ref<any[]>([])
214214
const userList = ref<UserApi.UserVO[]>([]) // 用户列表
215+
215216
/** 打开弹窗 */
216217
const open = async (type: string, id?: number) => {
217218
dialogVisible.value = true
@@ -231,6 +232,8 @@ const open = async (type: string, id?: number) => {
231232
}
232233
}
233234
}
235+
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
236+
234237
/** 查询列表 */
235238
const getList = async () => {
236239
loading.value = true
@@ -242,7 +245,7 @@ const getList = async () => {
242245
loading.value = false
243246
}
244247
}
245-
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
248+
246249
const gotOwnerUser = (owerUserId: any) => {
247250
if (owerUserId !== null) {
248251
owerUserId.split(',').forEach((item: string) => {
@@ -254,6 +257,7 @@ const gotOwnerUser = (owerUserId: any) => {
254257
})
255258
}
256259
}
260+
257261
/** 提交表单 */
258262
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
259263
const submitForm = async () => {
@@ -305,12 +309,13 @@ const resetForm = () => {
305309
formRef.value?.resetFields()
306310
ownerUserList.value = []
307311
}
312+
308313
/** 添加/修改操作 */
314+
// TODO @zyna:owner?拼写要注意哈;
309315
const owerRef = ref()
310316
const openOwerForm = (type: string) => {
311317
owerRef.value.open(type, ownerUserList.value)
312318
}
313-
314319
const owerSelectValue = (value) => {
315320
ownerUserList.value = value.value
316321
formData.value.ownerUserId = undefined
@@ -322,7 +327,7 @@ const owerSelectValue = (value) => {
322327
}
323328
})
324329
}
325-
//选择客户
330+
// 选择客户
326331
const showCustomer = ref(false)
327332
const openCustomerSelect = () => {
328333
showCustomer.value = !showCustomer.value
@@ -341,7 +346,7 @@ const selectCustomer = () => {
341346
formData.value.customerName = multipleSelection.value.name
342347
showCustomer.value = !showCustomer.value
343348
}
344-
const allContactList = ref([]) //所有联系人列表
349+
const allContactList = ref([]) // 所有联系人列表
345350
onMounted(async () => {
346351
allContactList.value = await ContactApi.simpleAlllist()
347352
})

src/views/crm/contact/OwerSelect.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
</Dialog>
1919
</template>
2020
<script setup lang="ts">
21+
// TODO 芋艿:统一选择框。
2122
import * as UserApi from '@/api/system/user'
2223
import { parseBigInt } from 'jsencrypt/lib/lib/jsbn/jsbn'
2324
const dialogVisible = ref(false) // 弹窗的是否展示

src/views/crm/contact/detail/ContactBasicInfo.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @Date: 2023-11-11 14:50:11
44
* @LastEditTime: 2023-11-11 14:52:47
55
* @FilePath: \yudao-ui-admin-vue3\src\views\crm\contact\detail\ContactBasicInfo.vue
6-
* @Description:
6+
* @Description:
77
-->
88
<template>
99
<el-col>
@@ -17,6 +17,7 @@
1717
</el-col>
1818
</template>
1919
<script setup lang="ts">
20+
// TODO 芋艿:后面在 review 么?
2021
import * as ContactApi from '@/api/crm/contact'
2122
2223
const { contact } = defineProps<{ contact: ContactApi.ContactVO }>()

src/views/crm/contact/detail/ContactDetails.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
</el-collapse>
6363
</template>
6464
<script setup lang="ts">
65+
// TODO 芋艿:后面在 review 么?
6566
import * as ContactApi from '@/api/crm/contact'
6667
import { DICT_TYPE } from '@/utils/dict'
6768
import { formatDate } from '@/utils/formatTime'

src/views/crm/contact/detail/index.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<template>
2+
<!-- TODO 芋艿:要不要把 3 到 62 合并成一个组件 -->
23
<div v-loading="loading">
34
<div class="flex items-start justify-between">
45
<div>
@@ -105,6 +106,7 @@ import ContactDetails from '@/views/crm/contact/detail/ContactDetails.vue'
105106
import ContactForm from '@/views/crm/contact/ContactForm.vue'
106107
import { formatDate } from '@/utils/formatTime'
107108
import * as CustomerApi from '@/api/crm/customer'
109+
// TODO 芋艿:后面在 review 么?
108110
109111
defineOptions({ name: 'ContactDetail' })
110112
const { delView } = useTagsViewStore() // 视图操作

src/views/crm/contact/index.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<template>
22
<ContentWrap>
33
<!-- 搜索工作栏 -->
4+
<!-- TODO zyna:筛选项,按照需求简化下 -->
45
<el-form
56
class="-mb-15px"
67
:model="queryParams"
@@ -214,6 +215,7 @@ import * as UserApi from '@/api/system/user'
214215
import * as CustomerApi from '@/api/crm/customer'
215216
216217
defineOptions({ name: 'CrmContact' })
218+
217219
const message = useMessage() // 消息弹窗
218220
const { t } = useI18n() // 国际化
219221
@@ -244,6 +246,7 @@ const queryParams = reactive({
244246
const queryFormRef = ref() // 搜索的表单
245247
const exportLoading = ref(false) // 导出的加载中
246248
const userList = ref<UserApi.UserVO[]>([]) // 用户列表
249+
247250
/** 查询列表 */
248251
const getList = async () => {
249252
loading.value = true
@@ -301,6 +304,8 @@ const handleExport = async () => {
301304
exportLoading.value = false
302305
}
303306
}
307+
308+
// TODO @zyna:这个负责人的读取,放在后端好点
304309
const gotOwnerUser = (owerUserId: string) => {
305310
let ownerName = ''
306311
if (owerUserId !== null) {
@@ -315,13 +320,14 @@ const gotOwnerUser = (owerUserId: string) => {
315320
}
316321
return ownerName
317322
}
318-
/** 详情页面 */
323+
319324
/** 打开客户详情 */
320325
const { push } = useRouter()
321326
const openDetail = (id: number) => {
322327
push({ name: 'CrmContactDetail', params: { id } })
323328
}
324329
330+
// TODO @zyna:这个上级的读取,放在后端读取,更合适;因为可能数据量比较大
325331
const allContactList = ref([]) //所有联系人列表
326332
const allCustomerList = ref([]) //客户列表
327333
/** 初始化 **/

0 commit comments

Comments
 (0)