Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
customer-admin
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
customer-admin
Commits
a4ccd0e4
提交
a4ccd0e4
authored
10月 25, 2021
作者:
matian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
联系人信息
上级
c5eb0e1b
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
43 行增加
和
20 行删除
+43
-20
api.js
src/modules/customer/api.js
+5
-1
Contact.vue
src/modules/customer/components/Contact.vue
+17
-8
CreateContact.vue
src/modules/customer/components/CreateContact.vue
+20
-11
List.vue
src/modules/system/customergroup/views/List.vue
+1
-0
没有找到文件。
src/modules/customer/api.js
浏览文件 @
a4ccd0e4
...
@@ -22,9 +22,13 @@ export function deleteCustomer(id) {
...
@@ -22,9 +22,13 @@ export function deleteCustomer(id) {
}
}
// 新建联系人
// 新建联系人
export
function
createContact
(
data
)
{
export
function
createContact
(
data
)
{
return
httpRequest
.
post
(
'/api/customer/admin/v1/{customer_id}/contact'
,
data
)
return
httpRequest
.
post
(
`/api/customer/admin/v1/
${
data
.
customer_id
}
/contact`
,
data
)
}
}
// 获取联系人
// 获取联系人
export
function
getContactList
(
params
)
{
export
function
getContactList
(
params
)
{
return
httpRequest
.
get
(
`/api/customer/admin/v1/
${
params
.
customer_id
}
/contacts`
,
params
)
return
httpRequest
.
get
(
`/api/customer/admin/v1/
${
params
.
customer_id
}
/contacts`
,
params
)
}
}
// 更新联系人
export
function
UpdateContact
(
data
)
{
return
httpRequest
.
put
(
`/api/customer/admin/v1/contact/
${
data
.
id
}
`
,
data
)
}
src/modules/customer/components/Contact.vue
浏览文件 @
a4ccd0e4
<
template
>
<
template
>
<div
class=
"base-info"
>
<div
class=
"base-info"
>
<div
class=
"bar"
>
<div
class=
"bar"
>
<el-button
type=
"primary"
size=
"small"
@
click=
"
a
dd"
>
添加联系人
</el-button>
<el-button
type=
"primary"
size=
"small"
@
click=
"
handleA
dd"
>
添加联系人
</el-button>
</div>
</div>
<app-list
v-bind=
"tableOptions"
ref=
"list"
>
<app-list
v-bind=
"tableOptions"
ref=
"list"
>
<!-- 操作 -->
<!-- 操作 -->
...
@@ -11,7 +11,14 @@
...
@@ -11,7 +11,14 @@
<el-button
type=
"text"
@
click=
"handleDelete(row)"
size=
"mini"
>
删除
</el-button>
<el-button
type=
"text"
@
click=
"handleDelete(row)"
size=
"mini"
>
删除
</el-button>
</
template
>
</
template
>
</template>
</template>
<CreateContact
:visible
.
sync=
"isShowDialog"
:isEdit=
"isEdit"
:data=
"data"
/>
<CreateContact
:visible
.
sync=
"isShowDialog"
@
success=
"success"
:row=
"row"
:isEdit=
"isEdit"
v-if=
"isShowDialog"
:id=
"id"
/>
</app-list>
</app-list>
</div>
</div>
</template>
</template>
...
@@ -24,7 +31,6 @@ export default {
...
@@ -24,7 +31,6 @@ export default {
components
:
{
AppList
,
CreateContact
},
components
:
{
AppList
,
CreateContact
},
data
()
{
data
()
{
return
{
return
{
data
:
{},
isEdit
:
false
,
isEdit
:
false
,
isShowDialog
:
false
isShowDialog
:
false
}
}
...
@@ -57,7 +63,7 @@ export default {
...
@@ -57,7 +63,7 @@ export default {
{
prop
:
'wechat'
,
label
:
'微信号'
,
minWidth
:
'140px'
},
{
prop
:
'wechat'
,
label
:
'微信号'
,
minWidth
:
'140px'
},
{
prop
:
'sub_mobile'
,
label
:
'附属手机号'
,
minWidth
:
'140px'
},
{
prop
:
'sub_mobile'
,
label
:
'附属手机号'
,
minWidth
:
'140px'
},
{
prop
:
'qq'
,
label
:
'QQ号'
,
minWidth
:
'140px'
},
{
prop
:
'qq'
,
label
:
'QQ号'
,
minWidth
:
'140px'
},
{
prop
:
'created_by'
,
label
:
'创建员工'
,
minWidth
:
'140px'
},
{
prop
:
'created_by
.username
'
,
label
:
'创建员工'
,
minWidth
:
'140px'
},
{
prop
:
'created_at'
,
label
:
'创建时间'
,
minWidth
:
'140px'
},
{
prop
:
'created_at'
,
label
:
'创建时间'
,
minWidth
:
'140px'
},
{
label
:
'操作'
,
minWidth
:
'140px'
,
slots
:
'table-operate'
}
{
label
:
'操作'
,
minWidth
:
'140px'
,
slots
:
'table-operate'
}
]
]
...
@@ -66,15 +72,18 @@ export default {
...
@@ -66,15 +72,18 @@ export default {
},
},
methods
:
{
methods
:
{
success
()
{
this
.
$refs
.
list
.
refetch
()
},
handleEdit
(
row
)
{
handleEdit
(
row
)
{
this
.
Edit
=
false
this
.
Edit
=
false
this
.
data
=
row
this
.
row
=
row
this
.
isShowDialog
=
true
this
.
isShowDialog
=
true
},
},
a
dd
()
{
handleA
dd
()
{
this
.
Edit
=
true
this
.
Edit
=
true
this
.
data
=
{}
this
.
row
=
{}
this
.
isShowDialog
=
true
this
.
isShowDialog
=
true
},
},
handleDelete
()
{}
handleDelete
()
{}
...
...
src/modules/customer/components/CreateContact.vue
浏览文件 @
a4ccd0e4
<
template
>
<
template
>
<el-dialog
v-bind=
"$attrs"
v-on=
"$listeners"
top=
"
4
0vh"
:title=
"title"
>
<el-dialog
v-bind=
"$attrs"
v-on=
"$listeners"
top=
"
2
0vh"
:title=
"title"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"100px"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"100px"
>
<el-form-item
label=
"姓名"
prop=
"name"
>
<el-form-item
label=
"姓名"
prop=
"name"
>
<el-input
v-model=
"form.name"
/>
<el-input
v-model=
"form.name"
/>
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
createContact
}
from
'../api'
import
{
createContact
,
UpdateContact
}
from
'../api'
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
...
@@ -55,13 +55,22 @@ export default {
...
@@ -55,13 +55,22 @@ export default {
}
}
},
},
props
:
{
props
:
{
data
:
{
row
:
{
type
:
Object
,
type
:
Object
,
default
:
()
=>
({})
default
:
()
=>
{}
},
},
isEdit
:
{
id
:
{
type
:
Boolean
,
type
:
String
,
default
:
false
default
:
''
},
isEdit
:
{
type
:
Boolean
,
default
:
false
}
},
watch
:
{
row
:
{
immediate
:
true
,
handler
(
row
)
{
this
.
form
=
Object
.
assign
({},
this
.
form
,
row
)
}
}
}
},
},
computed
:
{
computed
:
{
...
@@ -76,16 +85,16 @@ export default {
...
@@ -76,16 +85,16 @@ export default {
this
.
isEdit
?
this
.
edit
()
:
this
.
create
()
this
.
isEdit
?
this
.
edit
()
:
this
.
create
()
})
})
},
},
edit
()
{
edit
(
row
)
{
const
params
=
Object
.
assign
({
group_id
:
this
.
id
},
this
.
form
)
const
params
=
Object
.
assign
({
id
:
row
.
id
},
this
.
form
)
cre
ateContact
(
params
).
then
(
res
=>
{
Upd
ateContact
(
params
).
then
(
res
=>
{
this
.
$message
.
success
(
'新建联系人成功'
)
this
.
$message
.
success
(
'新建联系人成功'
)
this
.
$emit
(
'update:visible'
,
false
)
this
.
$emit
(
'update:visible'
,
false
)
this
.
$emit
(
'success'
,
res
.
data
)
this
.
$emit
(
'success'
,
res
.
data
)
})
})
},
},
create
()
{
create
()
{
const
params
=
Object
.
assign
({
group
_id
:
this
.
id
},
this
.
form
)
const
params
=
Object
.
assign
({
customer
_id
:
this
.
id
},
this
.
form
)
createContact
(
params
).
then
(
res
=>
{
createContact
(
params
).
then
(
res
=>
{
this
.
$message
.
success
(
'新建联系人成功'
)
this
.
$message
.
success
(
'新建联系人成功'
)
this
.
$emit
(
'update:visible'
,
false
)
this
.
$emit
(
'update:visible'
,
false
)
...
...
src/modules/system/customergroup/views/List.vue
浏览文件 @
a4ccd0e4
...
@@ -31,6 +31,7 @@ export default {
...
@@ -31,6 +31,7 @@ export default {
components
:
{
AddCustomerGroup
},
components
:
{
AddCustomerGroup
},
data
()
{
data
()
{
return
{
return
{
data
:
{},
isEdit
:
false
,
isEdit
:
false
,
isShowDialog
:
false
isShowDialog
:
false
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论