Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-services
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 85517313
authored
May 17, 2022
by
张权
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
联调接口
1 parent
06cf3148
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
164 additions
and
55 deletions
src/api/modules/expert.js
src/views/expert/components/tag-textarea.vue
src/views/expert/components/welcomeWords.vue
src/views/expert/detail.vue
src/views/expert/index.vue
src/api/modules/expert.js
View file @
8551731
...
...
@@ -20,4 +20,44 @@ const getMerchantTree = params => {
})
}
export
default
{
getExpertList
,
getMerchantTree
}
const
saveExpert
=
params
=>
{
params
.
method
=
'entmicro.api.operation.save'
return
http
({
url
:
'/rop-scrm-entmicro/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
const
delExpert
=
params
=>
{
params
.
method
=
'entmicro.api.operation.delete'
return
http
({
url
:
'/rop-scrm-entmicro/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
const
editExpert
=
params
=>
{
params
.
method
=
'entmicro.api.operation.update'
return
http
({
url
:
'/rop-scrm-entmicro/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
const
expertDetail
=
params
=>
{
params
.
method
=
'entmicro.api.operation.detail'
return
http
({
url
:
'/rop-scrm-entmicro/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
export
default
{
getExpertList
,
getMerchantTree
,
saveExpert
,
delExpert
,
editExpert
,
expertDetail
}
src/views/expert/components/tag-textarea.vue
View file @
8551731
...
...
@@ -124,20 +124,22 @@ export default {
console
.
log
(
textarea
[
0
].
childNodes
,
textarea
[
0
]?.
childNodes
?.
length
)
},
addCardLink
()
{
let
textarea
=
document
.
getElementsByClassName
(
'w-textarea_input'
)
console
.
log
(
textarea
[
0
].
childNodes
,
textarea
[
0
]?.
childNodes
?.
length
)
let
pnode
=
document
.
createElement
(
'span'
)
let
arr
=
[
'车主朋友,您好!\n我是您的福利官,欢迎您领取电子质保卡,\n请点击下方链接进行领取及查看:\n'
,
'https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/'
,
'\n祝您用车愉快!'
]
if
(
textarea
[
0
]?.
childNodes
?.
length
&&
(
textarea
[
0
]?.
childNodes
?.
length
!=
1
||
textarea
[
0
]?.
childNodes
[
0
]?.
nodeName
!=
'BR'
))
{
arr
[
0
]
=
'\n'
+
arr
[
0
]
}
arr
.
forEach
((
item
,
index
)
=>
{
let
node
=
document
.
createElement
(
'span'
)
node
.
innerText
=
item
if
(
index
==
1
)
node
.
setAttribute
(
'style'
,
'color:#409eff;'
)
pnode
.
appendChild
(
node
)
})
this
.
insertNode
(
pnode
)
let
textarea
=
document
.
getElementsByClassName
(
'w-textarea_input'
)[
0
].
innerHTML
textarea
=
textarea
+
'<br>车主朋友,您好!<br>我是您的福利官,欢迎您领取电子质保卡,<br>请点击下方链接进行领取及查看:<br><span style="color:#409eff;">https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/</span><br>祝您用车愉快!<br>'
document
.
getElementsByClassName
(
'w-textarea_input'
)[
0
].
innerHTML
=
textarea
// console.log(textarea[0].childNodes, textarea[0]?.childNodes?.length)
// let pnode = document.createElement('span')
// let arr = ['车主朋友,您好!\n我是您的福利官,欢迎您领取电子质保卡,\n请点击下方链接进行领取及查看:\n', 'https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/', '\n祝您用车愉快!\n']
// if (textarea[0]?.childNodes?.length && (textarea[0]?.childNodes?.length != 1 || textarea[0]?.childNodes[0]?.nodeName != 'BR')) {
// arr[0] = '\n' + arr[0]
// }
// arr.forEach((item, index) => {
// let node = document.createElement('span')
// node.innerText = item
// if (index == 1) node.setAttribute('style', 'color:#409eff;')
// pnode.appendChild(node)
// })
// this.insertNode(pnode)
},
addNode
()
{
let
target
=
this
.
$refs
.
wTextareaContent
...
...
src/views/expert/components/welcomeWords.vue
View file @
8551731
...
...
@@ -170,6 +170,7 @@ export default {
}
else
if
(
index
>=
10
&&
index
<
100
)
{
index
=
'0'
+
index
}
console
.
log
(
list
)
this
.
$refs
.
textContent
.
addImg
(
`https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/
${
index
}
.png`
)
},
updateText
(
val
)
{
...
...
src/views/expert/detail.vue
View file @
8551731
...
...
@@ -115,9 +115,17 @@ export default {
console
.
log
(
urlParam
,
79
)
let
param
=
JSON
.
parse
(
urlParam
.
id
)
this
.
clientType
=
param
.
clientType
console
.
log
(
param
.
expertId
)
if
(
param
.
expertId
)
{
this
.
getDetail
(
param
.
expertId
)
}
},
methods
:
{
addConfig
()
{},
getDetail
(
id
)
{
this
.
$apis
.
expert
.
expertDetail
({
id
}).
then
(
res
=>
{
console
.
log
(
res
)
})
},
delPerson
()
{
this
.
selectPerson
=
null
},
...
...
@@ -136,6 +144,27 @@ export default {
},
openMembers
()
{
this
.
membersVisible
=
!
this
.
membersVisible
},
handleSave
()
{
console
.
log
(
this
.
selectPerson
)
console
.
log
(
this
.
$refs
.
welcome
.
previewList
)
if
(
!
this
.
selectPerson
?.
staffId
)
{
return
this
.
$message
.
error
(
'请选择轻改专家'
)
}
let
params
=
{
businessType
:
this
.
clientType
==
1
?
0
:
-
1
,
staffId
:
this
.
selectPerson
.
staffId
,
welcomeInfo
:
this
.
$refs
.
welcome
.
previewList
}
this
.
$apis
.
expert
.
saveExpert
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
)
{
this
.
$router
.
push
({
path
:
'/expert/index'
})
}
})
}
}
}
...
...
src/views/expert/index.vue
View file @
8551731
...
...
@@ -2,7 +2,7 @@
<div
class=
"expert-container"
>
<div>
<div
class=
"btn-area"
>
<GLButton
id=
"clientBtn"
:size=
"size"
fn=
"新增配置"
type=
"primary"
@
click
.
stop=
"addConfig(
1
)"
>
<GLButton
id=
"clientBtn"
:size=
"size"
fn=
"新增配置"
type=
"primary"
@
click
.
stop=
"addConfig(
'top'
)"
>
新增配置
<i
class=
"el-icon-arrow-down"
></i>
</GLButton>
...
...
@@ -25,25 +25,34 @@
</el-cascader>
</div>
<span
slot=
"footer"
class=
"footer-btns"
>
<el-button
:size=
"size"
type=
"primary"
@
click=
"handleSearch"
>
查询
{{ isNotData }}
</el-button>
<el-button
:size=
"size"
type=
"primary"
@
click=
"handleSearch"
>
查询
</el-button>
<el-button
:size=
"size"
class=
"resetBtn"
@
click=
"handleReset"
>
重置
</el-button>
</span>
</glsx-combi-form>
<GLTable
ref=
"expertTable"
:hasNum=
"false"
:pageConf=
"batchPageConf"
:searchForm=
"batchListSearch"
:tableParams=
"batchTableParams"
:getListApi=
"getListApi"
>
<GLTable
:class=
"[{ hasDataTable: !hasData }]"
ref=
"expertTable"
:hasNum=
"false"
:pageConf=
"batchPageConf"
:searchForm=
"batchListSearch"
:tableParams=
"batchTableParams"
:getListApi=
"getListApi"
>
<span
slot=
"status"
slot-scope=
"scope"
>
<el-switch
:value=
"scope.scope.status == 0"
active-color=
"#5850ff"
inactive-color=
"#eee"
@
change=
"changStatus(scope.scope.status, scope.scope.id)"
></el-switch>
{{ scope.scope.status ==
1 ? '禁用' : '启
用' }}
{{ scope.scope.status ==
0 ? '启用' : '禁
用' }}
</span>
<div
class=
"table-btns"
slot=
"table-btns"
slot-scope=
"scope"
>
<
GLButton
fn=
"编辑"
type=
"text"
@
click=
"addConfig(scope)"
>
编辑
</GLB
utton>
<
GLButton
fn=
"编辑"
type=
"text"
@
click=
"addConfig(2)"
>
删除
</GLB
utton>
<
el-button
fn=
"编辑"
type=
"text"
@
click=
"selectClientType(scope.scope.businessType, scope.scope.id)"
>
编辑
</el-b
utton>
<
el-button
fn=
"编辑"
type=
"text"
@
click=
"handleDel(scope)"
>
删除
</el-b
utton>
</div>
<!-- <div slot="additionalContent" class="default-box">
<img class="default-img" :src="imagBaseURL + 'serviceser.png'" alt="" />
<span class="tip">用于「精品升级」客户线上化,配置轻改专家成员,可通过精品升级的质保卡活码拉新。</span>
<GLButton :size="size" fn="新增配置" icon="el-icon-plus" type="primary" @click="addConfig(1)">配置门店轻改专家</GLButton>
</div> -->
</GLTable>
<div
v-if=
"!hasData"
class=
"default-box"
>
<img
class=
"default-img"
:src=
"imagBaseURL + 'serviceser.png'"
alt=
""
/>
<span
class=
"tip"
>
用于「精品升级」客户线上化,配置轻改专家成员,可通过精品升级的质保卡活码拉新。
</span>
<div
class=
"btn-area"
>
<GLButton
id=
"clientBtn"
:size=
"size"
fn=
"新增配置"
type=
"primary"
@
click
.
stop=
"addConfig('center')"
>
新增配置
<i
class=
"el-icon-arrow-down"
></i>
</GLButton>
<ul
v-if=
"showCenterClientType"
class=
"client"
>
<li
@
click
.
stop=
"selectClientType(1)"
>
升级客户
</li>
<li
@
click
.
stop=
"selectClientType(2)"
>
战败客户
</li>
</ul>
</div>
</div>
</div>
</div>
</template>
...
...
@@ -65,9 +74,11 @@ export default {
children
:
'children'
,
checkStrictly
:
true
},
hasData
:
false
,
size
:
'small'
,
getListApi
:
this
.
$apis
.
expert
.
getExpertList
,
showClientType
:
false
,
showCenterClientType
:
false
,
batchPageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'pageNum'
,
totalCount
:
'count'
},
batchListSearch
:
{
departmentId
:
''
,
...
...
@@ -140,7 +151,7 @@ export default {
prop
:
'businessType'
,
width
:
200
,
formatter
:
cellValue
=>
{
return
cellValue
.
priceSection
==
-
1
?
'战败客户'
:
'升级客户'
return
cellValue
.
businessType
==
-
1
?
'战败客户'
:
'升级客户'
}
},
{
...
...
@@ -173,6 +184,7 @@ export default {
computed
:
{},
created
()
{
this
.
getMerchantList
()
this
.
isEmptyTable
()
},
mounted
()
{
document
.
getElementById
(
'app'
).
addEventListener
(
'click'
,
this
.
setClientType
)
...
...
@@ -183,7 +195,6 @@ export default {
methods
:
{
// 获取当前选择的商户
getCurMerchant
(
val
)
{
console
.
log
(
val
,
7897
)
let
id
=
val
[
val
.
length
-
1
]
this
.
batchListSearch
.
departmentId
=
id
// let labels = this.$refs.cascaderRef1.getCheckedNodes()[0].pathLabels
...
...
@@ -194,6 +205,37 @@ export default {
// }
// this.$refs.cascaderRef1.dropDownVisible = false
},
handleDel
({
id
})
{
this
.
$confirm
(
'是否确认删除?'
,
'退单'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
customClass
:
'customConfirm'
}).
then
(()
=>
{
this
.
$apis
.
expert
.
delExpert
({
id
}).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
)
{
this
.
handleSearch
()
this
.
$message
({
type
:
'success'
,
message
:
'删除成功!'
})
}
})
})
},
isEmptyTable
()
{
let
params
=
{
departmentId
:
''
,
staffName
:
''
,
businessType
:
''
,
pageSize
:
10
,
pageNum
:
1
}
this
.
$apis
.
expert
.
getExpertList
(
params
).
then
(
res
=>
{
this
.
hasData
=
!!
res
?.
data
?.
length
})
},
getMerchantList
()
{
this
.
$apis
.
expert
.
getMerchantTree
({}).
then
(
res
=>
{
this
.
shopList
=
this
.
traverse
(
2
,
res
,
'entmicroName'
,
'merchantAccountLevel'
)
...
...
@@ -215,35 +257,29 @@ export default {
},
setClientType
()
{
if
(
this
.
showClientType
)
this
.
showClientType
=
false
if
(
this
.
showCenterClientType
)
this
.
showCenterClientType
=
false
},
changStatus
(
openFlag
,
id
)
{
let
ids
=
[]
ids
.
push
(
id
)
let
target
=
'openConfigs'
if
(
openFlag
==
1
)
{
target
=
'closeConfigs'
}
let
params
=
{
ids
}
this
.
$apis
.
openconfig
[
target
](
params
).
then
(({
code
,
message
})
=>
{
if
(
code
==
0
)
{
this
.
$message
({
message
:
'操作成功!'
,
type
:
'success'
})
this
.
$refs
.
table
.
refreshTable
()
}
else
{
this
.
$message
.
error
(
message
)
changStatus
(
state
,
id
)
{
this
.
$apis
.
expert
.
editExpert
({
id
,
state
:
state
==
0
?
-
1
:
0
}).
then
(
res
=>
{
if
(
res
)
{
this
.
handleSearch
()
}
})
},
addConfig
()
{
this
.
showClientType
=
true
addConfig
(
area
)
{
if
(
area
==
'top'
)
{
this
.
showClientType
=
true
}
else
{
this
.
showCenterClientType
=
true
}
},
goDetail
()
{
this
.
$router
.
push
({
path
:
'/expert/detail/5'
})
},
selectClientType
(
type
,
id
)
{
this
.
showCenterClientType
=
false
this
.
showClientType
=
false
let
paraFormat
=
{
clientType
:
type
}
...
...
@@ -279,6 +315,13 @@ export default {
}
</
script
>
<
style
lang=
"scss"
scoped
>
/
deep
/
.hasDataTable
{
.el-table__empty-block,
.el-pagination
{
display
:
none
;
}
}
.btn-area
{
display
:
inline-block
;
position
:
relative
;
...
...
@@ -320,11 +363,10 @@ export default {
margin-left
:
16px
;
}
.expert-wrap
{
position
:
relative
;
margin-top
:
16px
;
padding
:
20px
20px
0
;
background-color
:
#fff
;
//
height
:
calc
(
100vh
-
148px
);
height
:
calc
(
100vh
-
148px
);
.select_wrapper
{
display
:
flex
;
align-items
:
center
;
...
...
@@ -339,11 +381,6 @@ export default {
}
}
.default-box
{
width
:
624px
;
position
:
absolute
;
top
:
50%
;
left
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment