Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
85e953b9
authored
Nov 18, 2023
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crm:code review 联系人管理
parent
7c5ae17d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
7 deletions
+23
-7
src/views/crm/contact/ContactForm.vue
+10
-5
src/views/crm/contact/OwerSelect.vue
+1
-0
src/views/crm/contact/detail/ContactBasicInfo.vue
+2
-1
src/views/crm/contact/detail/ContactDetails.vue
+1
-0
src/views/crm/contact/detail/index.vue
+2
-0
src/views/crm/contact/index.vue
+7
-1
No files found.
src/views/crm/contact/ContactForm.vue
View file @
85e953b9
...
...
@@ -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 @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
()
})
...
...
src/views/crm/contact/OwerSelect.vue
View file @
85e953b9
...
...
@@ -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
)
// 弹窗的是否展示
...
...
src/views/crm/contact/detail/ContactBasicInfo.vue
View file @
85e953b9
...
...
@@ -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
}
>
()
...
...
src/views/crm/contact/detail/ContactDetails.vue
View file @
85e953b9
...
...
@@ -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'
...
...
src/views/crm/contact/detail/index.vue
View file @
85e953b9
<
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
()
// 视图操作
...
...
src/views/crm/contact/index.vue
View file @
85e953b9
<
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
([])
//客户列表
/** 初始化 **/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment