Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
customer-admin
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
customer-admin
Commits
d0d6d020
提交
d0d6d020
authored
10月 25, 2021
作者:
matian
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/master'
上级
69386e1c
f9c02078
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
31 行增加
和
9 行删除
+31
-9
api.js
src/modules/customer/api.js
+4
-0
BaseInfo.vue
src/modules/customer/components/BaseInfo.vue
+0
-1
CustomerFormDialog.vue
src/modules/customer/components/CustomerFormDialog.vue
+4
-0
Index.vue
src/modules/customer/views/Index.vue
+23
-8
没有找到文件。
src/modules/customer/api.js
浏览文件 @
d0d6d020
...
...
@@ -12,6 +12,10 @@ export function createCustomer(data) {
export
function
getBaseDetail
(
params
)
{
return
httpRequest
.
get
(
'/api/customer/admin/v1/customer/{id}'
,
{
params
})
}
// 删除客户
export
function
deleteCustomer
(
id
)
{
return
httpRequest
.
delete
(
`/api/customer/admin/v1/customer/
${
id
}
`
)
}
// 新建联系人
export
function
createContact
(
data
)
{
return
httpRequest
.
post
(
'/api/customer/admin/v1/{customer_id}/contact'
,
data
)
...
...
src/modules/customer/components/BaseInfo.vue
浏览文件 @
d0d6d020
...
...
@@ -35,7 +35,6 @@ export default {
}
}
},
mounted
()
{
this
.
getBaseInfo
()
},
...
...
src/modules/customer/components/C
reateCustomer
.vue
→
src/modules/customer/components/C
ustomerFormDialog
.vue
浏览文件 @
d0d6d020
...
...
@@ -47,6 +47,10 @@ export default {
value
:
{
type
:
Boolean
,
default
:
false
},
id
:
{
type
:
String
,
default
:
''
}
},
data
()
{
...
...
src/modules/customer/views/Index.vue
浏览文件 @
d0d6d020
...
...
@@ -37,20 +37,20 @@
<
template
v-slot:table-operate=
"{ row }"
>
<template>
<el-button
type=
"text"
@
click=
"handleDetails(row)"
size=
"mini"
>
查看
</el-button>
<el-button
type=
"text"
@
click=
"handle
Delet
e(row)"
size=
"mini"
>
删除
</el-button>
<el-button
type=
"text"
@
click=
"handle
Remov
e(row)"
size=
"mini"
>
删除
</el-button>
</
template
>
</template>
</app-list>
<c
reate-customer
v-model=
"dialogVisable"
@
change=
"$refs.list.refetch()
"
/>
<c
ustomer-form-dialog
v-model=
"dialogVisable"
@
change=
"refetchList
"
/>
</app-card>
</template>
<
script
>
import
AppUserSearch
from
'@/components/base/AppUserSearch.vue'
import
AppArea
from
'@/components/base/AppArea.vue'
import
C
reateCustomer
from
'../components/CreateCustomer
.vue'
import
C
ustomerFormDialog
from
'../components/CustomerFormDialog
.vue'
// 接口
import
{
getCustomerList
}
from
'../api'
import
{
getCustomerList
,
deleteCustomer
}
from
'../api'
const
sourceList
=
[
{
name
:
'公司资源'
,
id
:
1
},
...
...
@@ -62,7 +62,7 @@ const typeList = [
{
name
:
'重点客户'
,
id
:
2
}
]
export
default
{
components
:
{
AppUserSearch
,
AppArea
,
C
reateCustomer
},
components
:
{
AppUserSearch
,
AppArea
,
C
ustomerFormDialog
},
data
()
{
return
{
staffList
:
[
...
...
@@ -267,7 +267,7 @@ export default {
handleDetails
(
row
)
{
console
.
log
(
row
)
this
.
$router
.
push
({
name
:
'
details'
,
path
:
'/customer-manage/
details'
,
query
:
{
id
:
row
.
id
}
...
...
@@ -275,15 +275,30 @@ export default {
},
// 删除弹窗确认
handleRemove
(
data
)
{
this
.
$confirm
(
'
角色删除请谨慎操作,确定删除?'
,
'删除角色
'
,
{
this
.
$confirm
(
'
删除客户请谨慎操作,确定删除?'
,
'删除客户
'
,
{
confirmButtonText
:
'删除'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(
this
.
handleRemove
(
data
))
}).
then
(()
=>
{
this
.
fetchRemove
(
data
)
}).
catch
(()
=>
{})
},
// 删除请求
fetchRemove
(
data
)
{
console
.
log
(
data
)
deleteCustomer
(
data
.
id
).
then
(
res
=>
{
if
(
res
.
code
===
0
&&
res
.
data
&&
res
.
data
.
status
)
{
this
.
$message
.
success
(
'删除用户成功'
)
this
.
refetchList
()
}
else
{
this
.
$message
.
error
(
'删除用户失败'
)
}
}).
catch
(
err
=>
{
this
.
$message
.
error
(
'删除用户失败'
)
})
},
refetchList
()
{
this
.
$refs
.
list
.
refetch
()
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论