Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
罗超
confucius
Commits
370b8363
Commit
370b8363
authored
Aug 18, 2021
by
Mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
ff3de35e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
905 additions
and
12 deletions
+905
-12
wechat.js
src/api/system/wechat.js
+24
-0
welcome-from.vue
src/components/enterprise/welcome-from.vue
+387
-0
addchannelcode.vue
src/pages/enterprise/addchannelcode.vue
+493
-11
channelcodeList.vue
src/pages/enterprise/channelcodeList.vue
+1
-1
No files found.
src/api/system/wechat.js
View file @
370b8363
...
@@ -295,6 +295,30 @@ export function SetSynvEduEmployee(data) {
...
@@ -295,6 +295,30 @@ export function SetSynvEduEmployee(data) {
data
data
})
})
}
}
/**
* 保存渠道活码
*
*/
export
function
setWeChatChannelInfo
(
data
)
{
return
request
({
url
:
'/QYWeChat/SetWeChatChannelInfo'
,
method
:
'post'
,
data
})
}
/**
* 渠道活码 详情
*
*/
export
function
getWeChatChannelInfo
(
data
)
{
return
request
({
url
:
'/QYWeChat/GetWeChatChannelInfo'
,
method
:
'post'
,
data
})
}
src/components/enterprise/welcome-from.vue
0 → 100644
View file @
370b8363
<
style
>
.addwelcome
{
justify-content
:
space-between
;
}
.addwelcome
.box_l
{
width
:
400px
;
border-radius
:
6px
;
margin-right
:
15px
;
background
:
#fff
;
box-shadow
:
0
0
13px
0
rgb
(
47
83
151
/
10%
);
}
.addwelcome
.boxl_title
{
width
:
100%
;
height
:
56px
;
display
:
flex
;
align-items
:
center
;
border-bottom
:
1px
solid
#e8e8e8
;
}
.addwelcome
.box_r
{
width
:
1px
;
flex
:
1
;
border-radius
:
6px
;
background
:
#fff
;
padding
:
20px
;
}
.atooltip.el-tooltip__popper
[
x-placement
^=
"top"
]
.popper__arrow
{
border-top-color
:
#FFF
;
}
.atooltip.el-tooltip__popper
[
x-placement
^=
"top"
]
.popper__arrow
:after
{
border-top-color
:
#FFF
;
}
.atooltip
{
background
:
#FFF
!important
;
box-shadow
:
0px
5px
25px
0px
rgba
(
218
,
220
,
230
,
0.85
);
}
</
style
>
<
template
>
<div
class=
"addwelcome row"
style=
"background: transparent;"
>
<div
class=
"box_l"
>
<div
class=
"boxl_title"
>
<span
style=
"margin-left:24px ;color: rgba(0,0,0,.85); font-weight: 500; font-size: 16px;"
>
客户账号
</span>
</div>
<div
style=
"padding: 20px;"
>
<div
style=
"display: flex;align-items: flex-start;"
>
<i
class=
"el-icon-user"
style=
"margin-right:20px;font-size: 40px;color: #1890ff;"
></i>
<div
style=
"width: 1px; flex:1;background: #f3f6fb;word-wrap: break-word;padding: 10px;border-radius: 4px;min-height: 40px;"
>
{{
addMsg
.
Content
}}
</div>
</div>
<div
style=
"display: flex;align-items: flex-start;margin-top: 15px;"
v-for=
"(item,index) in addMsg.MediumModel"
:key=
"index"
>
<i
class=
"el-icon-user"
style=
"margin-right:20px;font-size: 40px;color: #1890ff;"
></i>
<div
v-if=
"item.Type==2"
style=
"width: 1px; flex:1;"
>
<q-img
:src=
"item.ImageModel.ImagePath"
style=
"width: 70%;"
>
</q-img>
</div>
<div
v-if=
"item.Type==3"
style=
"width: 1px; flex:1;padding: 10px 15px; border: 1px solid #eee; border-radius: 4px; background: #fff;"
>
<div>
{{
item
.
ImgTextModel
.
Title
}}
</div>
<div
style=
"display: flex;align-items: flex-start;justify-content: space-between;"
>
<div
style=
"width: 1px;flex:1"
>
{{
item
.
ImgTextModel
.
Description
}}
</div>
<q-img
:src=
"item.ImgTextModel.ImgPath"
style=
"width: 80px;height: 80px;margin-left: 10px;"
>
</q-img>
</div>
</div>
<div
v-if=
"item.Type==6"
style=
"width: 70%;padding: 10px 15px; border: 1px solid #eee; border-radius: 4px; background: #fff;"
>
<div>
{{
item
.
AppletModel
.
Title
}}
</div>
<q-img
:src=
"item.AppletModel.ImagePath"
style=
"width: 100%;"
>
</q-img>
</div>
</div>
</div>
</div>
<div
class=
"box_r"
>
<el-form
ref=
"addMsg"
:model=
"addMsg"
label-width=
"120px"
>
<el-form-item
label=
"文本内容:"
>
<q-input
v-model=
"addMsg.Content"
filled
clearable
type=
"textarea"
label=
"文本内容"
@
input=
"gettrigger"
/>
<div
style=
"margin-top: 10px;"
>
<q-btn
color=
"accent"
label=
"+插入客户名称"
size=
'sm'
class=
"q-mr-md"
@
click=
'insert'
/>
</div>
</el-form-item>
<el-form-item
label=
"添加内容:"
>
<div
v-if=
"addMsg.MediumModel.length>0"
>
<div
class=
"row items-center"
v-for=
"(x,y) in addMsg.MediumModel"
:key=
"y"
>
<i
class=
"el-icon-link"
></i>
<span
style=
"margin-left: 10px;cursor: pointer;"
>
{{
getType
(
x
,
'title'
)
}}
</span>
<i
style=
"margin-left: 10px;cursor: pointer"
class=
"el-icon-close"
@
click=
"deleteModel(y)"
></i>
</div>
</div>
<q-btn
color=
"white"
text-color=
"black"
label=
"+添加图片/图文/小程序"
size=
'md'
>
<q-popup-proxy
ref=
'popupproxy'
>
<q-banner>
<q-btn-group
push
>
<q-btn
label=
"图片"
icon=
"images"
@
click=
"selectimg()"
/>
<q-btn
label=
"图文"
icon=
"visibility"
@
click=
"selecttextimg()"
/>
<q-btn
label=
"小程序"
icon=
"update"
@
click=
"selectxcx()"
/>
</q-btn-group>
</q-banner>
</q-popup-proxy>
</q-btn>
</el-form-item>
</el-form>
</div>
<!-- 图片 -->
<selectMaterial
v-if=
"isshowselectMaterial"
:materialType=
"materialType"
:classifyList=
'classifyList'
@
close=
"getclose()"
@
success=
'getsuccess'
>
</selectMaterial>
<!-- 图文 -->
<imagetextform
v-if=
"isshowimagetext"
@
close=
"gettwclose()"
@
success=
'gettwsuccess'
:classifyList=
'classifyList'
></imagetextform>
<!-- 小程序 -->
<appletform
v-if=
"isshowapplet"
@
close=
"getxcxclose()"
@
success=
'getxcxsuccess'
:classifyList=
'classifyList'
>
</appletform>
</div>
</
template
>
<
script
>
import
{
setWeChatWelcomesInfo
,
getWeChatMediumGroupList
,
getWeChatWelcomesInfo
}
from
'../../api/system/wechat'
;
import
selectMaterial
from
"./selectMaterial"
import
imagetextform
from
"./imagetext-form"
import
appletform
from
"./applet-form"
import
{
queryEmployee
}
from
'../../api/users/user'
export
default
{
components
:
{
selectMaterial
,
imagetextform
,
//图文
appletform
,
//小程序
},
props
:
{
welcomeindex
:
{
type
:
Number
,
default
:
0
,
},
childrenindex
:{
type
:
Number
,
default
:
0
,
},
welcomename
:
{
type
:
String
,
default
:
''
,
},
welcomeList
:
{
type
:
Object
,
default
:
{},
},
},
data
()
{
return
{
loading
:
false
,
outerVisible
:
false
,
//选择人员弹窗
filterText
:
''
,
//人员选择 帅选
memberList
:
[],
//
allmemberList
:
[],
showMember
:
[],
membertype
:
'1'
,
ryList
:
[],
addMsg
:
{
Id
:
0
,
Content
:
""
,
MediumIds
:
''
,
//使用的素材id '1,2,3'格式
MediumModel
:[],
},
defaultProps
:
{
children
:
'ChildList'
,
label
:
'EmployeeName'
,
},
materialType
:
1
,
isshowselectMaterial
:
false
,
isshowimagetext
:
false
,
isshowapplet
:
false
,
classifyList
:
[],
}
},
created
()
{
this
.
addMsg
=
this
.
welcomeList
this
.
getWeChatMediumGroupList
()
},
watch
:{
welcomeList
(
newValue
,
oldValue
){
this
.
addMsg
=
newValue
console
.
log
(
newValue
,
oldValue
)
}
},
methods
:
{
getWeChatMediumGroupList
()
{
getWeChatMediumGroupList
({}).
then
(
res
=>
{
this
.
classifyList
=
res
.
Data
})
},
getMember2
(
type
)
{
if
(
type
==
1
){
this
.
outerVisible
=
true
}
this
.
dialogTitle
=
this
.
$t
(
'fnc.xzrenyuan'
);
queryEmployee
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
memberList
=
res
.
Data
;
this
.
allmemberList
=
JSON
.
parse
(
JSON
.
stringify
(
res
.
Data
));
if
(
type
==
2
){
let
idsList
=
[]
this
.
addMsg
.
UserIdList
.
map
(
j
=>
{
if
(
j
==
-
1
)
{
this
.
membertype
=
'1'
return
}
else
{
this
.
membertype
=
'2'
this
.
allmemberList
.
map
(
x
=>
{
if
(
x
.
Id
==
j
){
idsList
.
push
(
x
)
return
}
})
}
})
this
.
ryList
=
JSON
.
parse
(
JSON
.
stringify
(
idsList
))
this
.
showMember
=
JSON
.
parse
(
JSON
.
stringify
(
idsList
))
}
}
}).
catch
(()
=>
{
})
var
arr
=
[];
this
.
showMember
.
forEach
(
x
=>
{
arr
.
push
(
x
.
Id
);
})
setTimeout
(()
=>
{
if
(
this
.
$refs
.
tree
)
{
this
.
$refs
.
tree
.
setCheckedKeys
(
arr
);
}
},
100
)
},
insert
()
{
this
.
addMsg
.
Content
=
this
.
addMsg
.
Content
+
'##客户名称##'
this
.
gettrigger
()
},
selectimg
()
{
//素材选择 图片模式
this
.
materialType
=
2
;
this
.
isshowselectMaterial
=
true
;
if
(
this
.
$refs
.
popupproxy
)
{
this
.
$refs
.
popupproxy
.
hide
()
}
},
getclose
()
{
//素材关闭
this
.
isshowselectMaterial
=
false
},
getsuccess
(
data
)
{
//选择数据回来
this
.
ISidentical
(
data
)
this
.
isshowselectMaterial
=
false
},
ISidentical
(
data
){
//返回来的数据进行判断再添加
if
(
this
.
addMsg
.
MediumModel
.
length
>
0
){
let
isyes
=
false
this
.
addMsg
.
MediumModel
.
map
(
x
=>
{
if
(
x
.
Id
==
data
.
Id
){
isyes
=
true
;
return
}
})
if
(
isyes
==
false
){
this
.
addMsg
.
MediumModel
.
push
(
data
)
}
else
{
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`重复选择、请您重新选择!`
,
position
:
'top'
})
return
}
}
else
{
this
.
addMsg
.
MediumModel
=
[];
this
.
addMsg
.
MediumModel
.
push
(
data
)
}
this
.
gettrigger
()
},
selecttextimg
()
{
//图文
this
.
isshowimagetext
=
true
;
if
(
this
.
$refs
.
popupproxy
)
{
this
.
$refs
.
popupproxy
.
hide
()
}
},
gettwclose
()
{
//图文
this
.
isshowimagetext
=
false
;
},
gettwsuccess
(
data
)
{
//图文返回成功
this
.
ISidentical
(
data
)
this
.
isshowimagetext
=
false
},
selectxcx
()
{
//图文
this
.
isshowapplet
=
true
;
if
(
this
.
$refs
.
popupproxy
)
{
this
.
$refs
.
popupproxy
.
hide
()
}
},
getxcxclose
()
{
//小程序 关闭
this
.
isshowapplet
=
false
;
},
getxcxsuccess
(
data
)
{
//小程序 关闭
this
.
ISidentical
(
data
)
this
.
isshowapplet
=
false
},
getType
(
row
,
name
)
{
let
title
=
''
let
content
=
''
if
(
row
.
Type
==
2
)
{
title
=
row
.
ImageModel
.
ImageName
content
=
row
.
ImageModel
.
ImagePath
}
else
if
(
row
.
Type
==
3
)
{
title
=
row
.
ImgTextModel
.
Title
content
=
row
.
ImgTextModel
.
ImgPath
}
else
if
(
row
.
Type
==
6
)
{
title
=
row
.
AppletModel
.
Title
content
=
row
.
AppletModel
.
ImagePath
}
if
(
name
==
'title'
)
{
return
title
}
else
if
(
name
==
'content'
)
{
return
content
}
},
deleteModel
(
index
){
this
.
addMsg
.
MediumModel
.
splice
(
index
,
1
)
},
gettrigger
(){
//文本触发时
this
.
$emit
(
'success'
,
this
.
addMsg
,
this
.
welcomeindex
,
this
.
childrenindex
,
this
.
welcomename
)
}
}
}
</
script
>
\ No newline at end of file
src/pages/enterprise/addchannelcode.vue
View file @
370b8363
...
@@ -82,6 +82,26 @@
...
@@ -82,6 +82,26 @@
width
:
140px
;
width
:
140px
;
margin-right
:
10px
;
margin-right
:
10px
;
}
}
.addchannelcode
.ant-tag
{
display
:
inline-block
;
height
:
auto
;
margin-right
:
8px
;
padding
:
0
7px
;
font-size
:
12px
;
line-height
:
20px
;
white-space
:
nowrap
;
background
:
#fafafa
;
border
:
1px
solid
#d9d9d9
;
border-radius
:
2px
;
cursor
:
pointer
;
opacity
:
1
;
}
.addchannelcode
.ant-tag-has-color
{
color
:
#FFF
;
border
:
1px
solid
#1890ff
;
}
</
style
>
</
style
>
<
template
>
<
template
>
...
@@ -310,10 +330,6 @@
...
@@ -310,10 +330,6 @@
</div>
</div>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</div>
</div>
...
@@ -324,6 +340,153 @@
...
@@ -324,6 +340,153 @@
<div
class=
"ant-alert"
>
<div
class=
"ant-alert"
>
欢迎语推送规则:在通用、周期及特殊时期欢迎语共存情况下,推送优先顺序为特殊时期的欢迎语 > 按周期的欢迎语 > 通用欢迎语。若企业微信官方后台已配置了欢迎语,则在第三方系统配置的欢迎语均失效,客户收到的依然是官方推送的。
欢迎语推送规则:在通用、周期及特殊时期欢迎语共存情况下,推送优先顺序为特殊时期的欢迎语 > 按周期的欢迎语 > 通用欢迎语。若企业微信官方后台已配置了欢迎语,则在第三方系统配置的欢迎语均失效,客户收到的依然是官方推送的。
</div>
</div>
<el-form
label-width=
"120px"
style=
"padding: 15px 0 ;"
>
<el-form-item
label=
"扫码推送:"
>
<div
class=
"q-gutter-sm"
style=
"align-items: center;display: flex;"
>
<q-radio
v-model=
"addMsg.WelcomeEnable"
val=
"1"
label=
"开启"
/>
<q-radio
v-model=
"addMsg.WelcomeEnable"
val=
"2"
label=
"关闭"
/>
<span
style=
"color: red;"
>
(关闭后,客户扫该渠道活码,依然可对该客户自动打标签,但仅收到系统的【欢迎语】消息)
</span>
</div>
</el-form-item>
</el-form>
<div
v-if=
"addMsg.WelcomeEnable == 1"
>
<q-splitter
v-model=
"splitterModel"
>
<
template
v-slot:before
>
<q-tabs
v-model=
"tab"
vertical
>
<q-tab
name=
"mails"
label=
"通用欢迎语"
/>
<q-tab
name=
"alarms"
label=
"周期欢迎语"
/>
<q-tab
name=
"movies"
label=
"特殊时期欢迎语"
/>
</q-tabs>
</
template
>
<
template
v-slot:after
>
<div
v-if=
"tab=='mails'"
style=
"padding: 0 20px;"
>
<div
:key=
"index"
v-for=
"(item, index) in addMsg.WelcomeList"
>
<welcomefrom
:welcomeList=
'item'
:welcomeindex=
'index'
@
success=
"welcometrigger"
welcomename=
'WelcomeList'
></welcomefrom>
</div>
</div>
<div
v-if=
"tab=='alarms'"
style=
"padding: 0 20px;"
>
<el-form
label-width=
"120px"
style=
"padding: 15px 0 ;"
>
<el-form-item
label=
"状态:"
>
<div
class=
"q-gutter-sm"
style=
"align-items: center;display: flex;"
>
<q-radio
v-model=
"addMsg.WelcomeWeekEnable"
val=
"1"
label=
"开启"
/>
<q-radio
v-model=
"addMsg.WelcomeWeekEnable"
val=
"2"
label=
"关闭"
/>
</div>
</el-form-item>
</el-form>
<div
style=
"width: 100%;display: flex;align-items: center;justify-content: space-between;"
v-if=
"addMsg.WelcomeWeekEnable==1"
>
<el-tabs
v-model=
"editableTabsValue"
type=
"card"
addable
@
edit=
"handleTabsEdit"
style=
"width: 1px;flex:1"
>
<el-tab-pane
:key=
"index"
v-for=
"(item, index) in wwlist"
:name=
"index.toString()"
>
<span
slot=
"label"
>
{{
'欢迎语'
+
(
index
+
1
)
}}
<i
class=
"el-icon-circle-close"
v-if=
"index>0"
style=
"margin-left: 10px;font-size: 16px;"
@
click=
'handleTabsclose(index)'
></i></span>
<el-form
label-width=
"120px"
style=
"padding-top: 15px 0 ;"
>
<el-form-item
label=
"选择周期:"
>
<span
class=
"ant-tag"
:class=
"
{'ant-tag-has-color':x.chek}"
v-for="(x,y) in item.weeklist" :key='y'
@click="wwlist[index].weeklist[y].chek = !wwlist[index].weeklist[y].chek,$forceUpdate()"
:style="{background:x.chek?'#1890ff':'#FFF'}">
{{
x
.
Name
}}
</span>
</el-form-item>
</el-form>
<el-form
label-width=
"120px"
>
<el-form-item
label=
"时间段:"
v-for=
"(x,y) in item.childrenlist"
:key=
"y+'a1'"
style=
"border-bottom: 1px solid #e8e8e8;padding: 15px 0 ;"
>
<div
>
<div
style=
"display: flex;align-items: flex-start;"
class=
"tsbox"
>
<el-time-select
placeholder=
"起始时间"
v-model=
"x.SrartHours"
size=
"small"
:picker-options=
"
{ start: '00:00', step: '01:00', end: '23:00', }">
</el-time-select>
<el-time-select
placeholder=
"结束时间"
v-model=
"x.EndHours"
size=
"small"
:picker-options=
"
{ start: '00:00', step: '01:00', end: '23:00', minTime: x.SrartHours}">
</el-time-select>
<q-btn
flat
color=
"red"
v-if=
"y>0"
label=
"删除"
@
click=
"abv(index,y,x)"
/>
</div>
<div
style=
"padding: 15px 0 ;"
>
<welcomefrom
:welcomeList=
'x'
:welcomeindex=
'index'
:childrenindex=
"y"
@
success=
"welcometrigger"
welcomename=
'WelcomeWeekList'
></welcomefrom>
</div>
</div>
</el-form-item>
</el-form>
<div
style=
"padding: 10px;"
>
<q-btn
color=
"white"
text-color=
"black"
icon=
'add'
label=
"添加时间段"
@
click=
"addwelcomesjd(index)"
/>
</div>
</el-tab-pane>
</el-tabs>
</div>
</div>
<div
v-if=
"tab=='movies'"
style=
"padding: 0 20px;"
>
<el-form
label-width=
"120px"
style=
"padding: 15px 0 ;"
>
<el-form-item
label=
"状态:"
>
<div
class=
"q-gutter-sm"
style=
"align-items: center;display: flex;"
>
<q-radio
v-model=
"addMsg.WelcomeSpecialEnable"
val=
"1"
label=
"开启"
/>
<q-radio
v-model=
"addMsg.WelcomeSpecialEnable"
val=
"2"
label=
"关闭"
/>
</div>
</el-form-item>
</el-form>
<div
style=
"width: 100%;display: flex;align-items: center;justify-content: space-between;"
v-if=
"addMsg.WelcomeSpecialEnable==1"
>
<el-tabs
v-model=
"editableTabsValue2"
type=
"card"
addable
@
edit=
"handleTabsEdit2"
style=
"width: 1px;flex:1"
>
<el-tab-pane
:key=
"index"
v-for=
"(item, index) in wsplist"
:name=
"index.toString()"
>
<span
slot=
"label"
>
{{
'欢迎语'
+
(
index
+
1
)
}}
<i
class=
"el-icon-circle-close"
v-if=
"index>0"
style=
"margin-left: 10px;font-size: 16px;"
@
click=
'handleTabsclose(index,2)'
></i></span>
<el-form
label-width=
"120px"
style=
"padding-top: 15px 0 ;"
>
<el-form-item
label=
"选择日期:"
>
<el-date-picker
v-model=
"item.value"
type=
"daterange"
value-format=
"yyyy-MM-dd"
@
change=
"getdatepicker(index,2)"
size=
"small"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
>
</el-date-picker>
</el-form-item>
</el-form>
<el-form
label-width=
"120px"
>
<el-form-item
label=
"时间段:"
v-for=
"(x,y) in item.childrenlist"
:key=
"y+'a1'"
style=
"border-bottom: 1px solid #e8e8e8;padding: 15px 0 ;"
>
<div
>
<div
style=
"display: flex;align-items: flex-start;"
class=
"tsbox"
>
<el-time-select
placeholder=
"起始时间"
v-model=
"x.SrartHours"
size=
"small"
:picker-options=
"
{ start: '00:00', step: '01:00', end: '23:00', }">
</el-time-select>
<el-time-select
placeholder=
"结束时间"
v-model=
"x.EndHours"
size=
"small"
:picker-options=
"
{ start: '00:00', step: '01:00', end: '23:00', minTime: x.SrartHours}">
</el-time-select>
<q-btn
flat
color=
"red"
v-if=
"y>0"
label=
"删除"
@
click=
"abv(index,y,x,2)"
/>
</div>
<div
style=
"padding: 15px 0 ;"
>
<welcomefrom
:welcomeList=
'x'
:welcomeindex=
'index'
:childrenindex=
"y"
@
success=
"welcometrigger"
welcomename=
'WelcomeSpecialList'
></welcomefrom>
</div>
</div>
</el-form-item>
</el-form>
<div
style=
"padding: 10px;"
>
<q-btn
color=
"white"
text-color=
"black"
icon=
'add'
label=
"添加时间段"
@
click=
"addwelcomesjd(index,2)"
/>
</div>
</el-tab-pane>
</el-tabs>
</div>
</div>
</
template
>
</q-splitter>
</div>
</div>
</div>
<div
class=
"page-body"
>
<div
class=
"page-body"
>
<q-btn
color=
"accent"
class=
"q-mr-md"
label=
"保存"
@
click=
"savemove()"
style=
"width: 100px;"
<q-btn
color=
"accent"
class=
"q-mr-md"
label=
"保存"
@
click=
"savemove()"
style=
"width: 100px;"
...
@@ -342,6 +505,8 @@
...
@@ -342,6 +505,8 @@
import
{
import
{
getWeChatChannelGroupList
,
getWeChatChannelGroupList
,
getWeChatLableList
,
//获取标签的列表
getWeChatLableList
,
//获取标签的列表
setWeChatChannelInfo
,
//渠道活码的新增和修改
getWeChatChannelInfo
,
//获取详情
}
from
'../../api/system/wechat'
;
}
from
'../../api/system/wechat'
;
import
{
import
{
getDeptTree
getDeptTree
...
@@ -351,6 +516,8 @@
...
@@ -351,6 +516,8 @@
}
from
'../../api/users/user'
}
from
'../../api/users/user'
import
chaneelcodeform
from
'../../components/enterprise/chaneelcode-form'
import
chaneelcodeform
from
'../../components/enterprise/chaneelcode-form'
import
choiceapproval
from
'../../components/enterprise/choiceapproval'
import
choiceapproval
from
'../../components/enterprise/choiceapproval'
import
welcomefrom
from
'../../components/enterprise/welcome-from'
import
selectTree
from
'../../components/common/select-tree'
import
selectTree
from
'../../components/common/select-tree'
...
@@ -361,7 +528,8 @@
...
@@ -361,7 +528,8 @@
components
:
{
components
:
{
chaneelcodeform
,
//所有列表
chaneelcodeform
,
//所有列表
choiceapproval
,
choiceapproval
,
selectTree
selectTree
,
welcomefrom
},
},
name
:
"addchannelcode"
,
name
:
"addchannelcode"
,
data
()
{
data
()
{
...
@@ -381,6 +549,11 @@
...
@@ -381,6 +549,11 @@
LimitList
:
[],
//员工添加上限
LimitList
:
[],
//员工添加上限
EmpBackUp
:
''
,
//备用员工 多人的话 英文逗号分隔
EmpBackUp
:
''
,
//备用员工 多人的话 英文逗号分隔
WelcomeEnable
:
'1'
,
//是否启用欢迎语 1是
WelcomeEnable
:
'1'
,
//是否启用欢迎语 1是
WelcomeList
:[{
Id
:
0
,
Content
:
''
,
MediumIds
:
''
,
MediumModel
:[]}],
//通用欢迎语
WelcomeWeekEnable
:
'2'
,
//周期欢迎语 1启用
WelcomeWeekList
:[],
WelcomeSpecialEnable
:
'2'
,
//特殊时期欢迎语 1启用
WelcomeSpecialList
:[],
},
},
GroupList
:
[],
//分组数据
GroupList
:
[],
//分组数据
LableList
:
[],
//标签数据
LableList
:
[],
//标签数据
...
@@ -401,6 +574,16 @@
...
@@ -401,6 +574,16 @@
byval
:
[],
byval
:
[],
EmpBackUpList
:[],
//备用员工多人的时候临时数组
EmpBackUpList
:[],
//备用员工多人的时候临时数组
choiceapprovaltype
:
'1'
,
choiceapprovaltype
:
'1'
,
tab
:
'mails'
,
splitterModel
:
13
,
welcomeindex
:
'0'
,
wwlist
:[{
weeklist
:[{
Id
:
1
,
Name
:
'周一'
,
chek
:
false
},
{
Id
:
2
,
Name
:
'周二'
,
chek
:
false
},
{
Id
:
3
,
Name
:
'周三'
,
chek
:
false
},
{
Id
:
4
,
Name
:
'周四'
,
chek
:
false
},
{
Id
:
5
,
Name
:
'周五'
,
chek
:
false
},
{
Id
:
6
,
Name
:
'周六'
,
chek
:
false
},
{
Id
:
0
,
Name
:
'周日'
,
chek
:
false
}],
childrenlist
:[{
SrartHours
:
''
,
EndHours
:
''
,
Id
:
0
,
Content
:
''
,
MediumIds
:
''
,
MediumModel
:[]}]
}],
//周期欢迎语
editableTabsValue
:
'0'
,
editableTabsValue2
:
'0'
,
wsplist
:[{
StartDate
:
''
,
EndDate
:
''
,
value
:[],
childrenlist
:[{
SrartHours
:
''
,
EndHours
:
''
,
Id
:
0
,
Content
:
''
,
MediumIds
:
''
,
MediumModel
:[]}]
}],
//特殊欢迎语
isall
:
false
,
//验证通过
}
}
},
},
created
()
{
created
()
{
...
@@ -408,8 +591,36 @@
...
@@ -408,8 +591,36 @@
this
.
getLableList
()
//获取标签列表
this
.
getLableList
()
//获取标签列表
this
.
queryEmployee
()
//单选
this
.
queryEmployee
()
//单选
this
.
getDepartList
()
//部门下拉
this
.
getDepartList
()
//部门下拉
if
(
this
.
$route
.
query
&&
this
.
$route
.
query
.
Id
){
this
.
getqudaodetails
()
//获取详情
}
},
},
methods
:
{
methods
:
{
getqudaodetails
(){
//渠道详情
getWeChatChannelInfo
({
ChannelId
:
this
.
$route
.
query
.
Id
}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
addMsg
=
res
.
Data
console
.
log
(
this
.
addMsg
.
LabelIdList
)
this
.
addMsg
.
LabelIdList
.
map
(
z
=>
{
this
.
LableList
.
map
(
x
=>
{
let
isexist
=
false
x
.
ChildList
.
map
(
j
=>
{
if
(
z
==
x
.
Id
){
j
.
chek
=
true
isexist
=
true
}
})
if
(
isexist
==
true
){
return
}
})
})
}
}).
catch
(()
=>
{
})
},
queryEmployee
()
{
//下拉人员列表
queryEmployee
()
{
//下拉人员列表
queryEmployee
({}).
then
(
res
=>
{
queryEmployee
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
if
(
res
.
Code
==
1
)
{
...
@@ -522,6 +733,24 @@
...
@@ -522,6 +733,24 @@
this
.
$router
.
go
(
-
1
);
//返回上一层
this
.
$router
.
go
(
-
1
);
//返回上一层
},
},
savemove
()
{
savemove
()
{
this
.
isall
==
false
//初始化
if
(
this
.
addMsg
.
ChannelGroupId
==
''
){
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`请选择分组`
,
position
:
'top'
})
return
}
if
(
this
.
addMsg
.
Name
==
''
){
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`请选择渠道活码名称`
,
position
:
'top'
})
return
}
this
.
addMsg
.
LabelIdList
=
[]
this
.
addMsg
.
LabelIdList
=
[]
this
.
LableList
.
forEach
(
x
=>
{
//标签数据处理
this
.
LableList
.
forEach
(
x
=>
{
//标签数据处理
x
.
ChildList
.
forEach
(
x
=>
{
x
.
ChildList
.
forEach
(
x
=>
{
...
@@ -544,7 +773,178 @@
...
@@ -544,7 +773,178 @@
this
.
addMsg
.
EmpBackUp
=
data
.
join
(
','
)
this
.
addMsg
.
EmpBackUp
=
data
.
join
(
','
)
}
}
}
}
console
.
log
(
this
.
addMsg
)
//验证欢迎语
if
(
this
.
addMsg
.
WelcomeEnable
==
1
){
this
.
welcometverification
()
}
if
(
this
.
isall
==
false
){
console
.
log
(
this
.
addMsg
,
'最后打印'
)
//调用接口
setWeChatChannelInfo
(
this
.
addMsg
).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
color
:
'accent'
,
timeout
:
2000
,
message
:
res
.
Message
,
position
:
'top'
})
this
.
goblck
()
}
}).
catch
(()
=>
{
})
}
},
welcometverification
(){
//欢迎语的验证
//1 通用验证
if
(
this
.
addMsg
.
WelcomeList
[
0
].
Content
==
''
){
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`请输入通用欢迎语的内容`
,
position
:
'top'
})
this
.
isall
=
true
return
}
//2 周期欢迎语
if
(
this
.
addMsg
.
WelcomeWeekEnable
==
1
){
let
isweek
=
false
;
let
isContent
=
false
;
let
isHours
=
false
;
let
data
=
[]
this
.
wwlist
.
map
(
x
=>
{
isweek
=
false
;
let
obj
=
{}
let
weekl
=
[]
x
.
weeklist
.
map
(
j
=>
{
if
(
j
.
chek
==
true
){
isweek
=
true
weekl
.
push
(
j
.
Id
)
}
})
obj
.
Weeks
=
weekl
.
join
(
','
)
if
(
isweek
==
false
){
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`请选择欢迎语周期`
,
position
:
'top'
})
this
.
isall
=
true
return
}
x
.
childrenlist
.
map
(
j
=>
{
if
(
j
.
SrartHours
==
''
||
j
.
EndHours
==
''
)
{
isHours
=
true
;
return
}
if
(
j
.
Content
==
''
){
isContent
=
true
return
}
obj
.
SrartHours
=
j
.
SrartHours
;
obj
.
EndHours
=
j
.
EndHours
;
obj
.
Id
=
j
.
Id
;
obj
.
Content
=
j
.
Content
;
let
ids
=
[]
if
(
j
.
MediumModel
.
length
>
0
){
j
.
MediumModel
.
forEach
(
z
=>
{
ids
.
push
(
z
.
Id
)
})
}
obj
.
MediumIds
=
ids
.
join
(
','
);
data
.
push
(
JSON
.
parse
(
JSON
.
stringify
(
obj
))
)
})
if
(
isHours
==
true
){
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`请输入周期欢迎语的时间段`
,
position
:
'top'
})
this
.
isall
=
true
return
}
if
(
isContent
==
true
){
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`周期欢迎语的内容不能为空`
,
position
:
'top'
})
this
.
isall
=
true
return
}
this
.
addMsg
.
WelcomeWeekList
=
data
})
}
if
(
this
.
addMsg
.
WelcomeSpecialEnable
==
1
){
console
.
log
(
this
.
wsplist
)
let
datevalue
=
false
;
let
isContent
=
false
;
let
isHours
=
false
;
let
data
=
[]
this
.
wsplist
.
map
(
x
=>
{
let
obj
=
{}
if
(
!
x
.
value
||
x
.
value
==
[]
||
x
.
value
==
''
||
x
.
value
.
length
==
0
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`请选择特殊时期的欢迎语日期范围`
,
position
:
'top'
})
this
.
isall
=
true
return
}
obj
.
StartDate
=
x
.
value
[
0
]
obj
.
EndDate
=
x
.
value
[
1
]
x
.
childrenlist
.
map
(
j
=>
{
if
(
j
.
SrartHours
==
''
||
j
.
EndHours
==
''
)
{
isHours
=
true
;
return
}
if
(
j
.
Content
==
''
){
isContent
=
true
return
}
obj
.
SrartHours
=
j
.
SrartHours
;
obj
.
EndHours
=
j
.
EndHours
;
obj
.
Id
=
j
.
Id
;
obj
.
Content
=
j
.
Content
;
let
ids
=
[]
if
(
j
.
MediumModel
.
length
>
0
){
j
.
MediumModel
.
forEach
(
z
=>
{
ids
.
push
(
z
.
Id
)
})
}
obj
.
MediumIds
=
ids
.
join
(
','
);
data
.
push
(
JSON
.
parse
(
JSON
.
stringify
(
obj
))
)
})
if
(
isHours
==
true
){
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`请输入周期欢迎语的时间段`
,
position
:
'top'
})
this
.
isall
=
true
return
}
if
(
isContent
==
true
){
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`周期欢迎语的内容不能为空`
,
position
:
'top'
})
this
.
isall
=
true
return
}
this
.
addMsg
.
WelcomeSpecialList
=
data
})
}
},
},
getSpecialWeekListdata
()
{
getSpecialWeekListdata
()
{
let
isEmpId
=
false
;
let
isEmpId
=
false
;
...
@@ -631,6 +1031,7 @@
...
@@ -631,6 +1031,7 @@
message
:
`请选择特殊时期时间段`
,
message
:
`请选择特殊时期时间段`
,
position
:
'top'
position
:
'top'
})
})
this
.
isall
=
true
return
return
}
}
if
(
isHours
==
true
)
{
if
(
isHours
==
true
)
{
...
@@ -639,6 +1040,7 @@
...
@@ -639,6 +1040,7 @@
message
:
`请选择特殊时期时间`
,
message
:
`请选择特殊时期时间`
,
position
:
'top'
position
:
'top'
})
})
this
.
isall
=
true
return
return
}
}
if
(
isEmpId
==
true
)
{
if
(
isEmpId
==
true
)
{
...
@@ -647,6 +1049,7 @@
...
@@ -647,6 +1049,7 @@
message
:
`请选择特殊时期成员`
,
message
:
`请选择特殊时期成员`
,
position
:
'top'
position
:
'top'
})
})
this
.
isall
=
true
return
return
}
}
this
.
addMsg
.
SpecialWeekList
=
spdata
this
.
addMsg
.
SpecialWeekList
=
spdata
...
@@ -717,11 +1120,20 @@
...
@@ -717,11 +1120,20 @@
})
})
this
.
getalluser
()
this
.
getalluser
()
},
},
getdatepicker
(
index
)
{
//特殊时期日期范围判断
getdatepicker
(
index
,
type
=
1
)
{
//特殊时期日期范围判断
let
value
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
spweeklist
[
index
].
value
))
let
value
let
data
if
(
type
==
2
){
console
.
log
(
this
.
wsplist
)
value
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
wsplist
[
index
].
value
))
data
=
this
.
wsplist
}
else
{
value
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
spweeklist
[
index
].
value
))
data
=
this
.
spweeklist
}
let
iscorrect
=
false
let
iscorrect
=
false
if
(
this
.
spweeklist
.
length
>
1
)
{
if
(
data
.
length
>
1
)
{
this
.
spweeklist
.
map
((
x
,
i
)
=>
{
data
.
map
((
x
,
i
)
=>
{
if
(
x
.
value
&&
x
.
value
.
length
==
2
&&
i
!=
index
)
{
if
(
x
.
value
&&
x
.
value
.
length
==
2
&&
i
!=
index
)
{
if
((
new
Date
(
value
[
0
]).
getTime
()
>=
new
Date
(
x
.
value
[
0
]).
getTime
()
&&
new
Date
(
value
[
0
]).
getTime
()
<=
new
Date
(
x
.
value
[
1
]).
getTime
())
if
((
new
Date
(
value
[
0
]).
getTime
()
>=
new
Date
(
x
.
value
[
0
]).
getTime
()
&&
new
Date
(
value
[
0
]).
getTime
()
<=
new
Date
(
x
.
value
[
1
]).
getTime
())
||
(
new
Date
(
value
[
0
]).
getTime
()
>=
new
Date
(
x
.
value
[
0
]).
getTime
()
&&
new
Date
(
value
[
1
]).
getTime
()
<=
new
Date
(
x
.
value
[
1
]).
getTime
())
||
(
new
Date
(
value
[
0
]).
getTime
()
>=
new
Date
(
x
.
value
[
0
]).
getTime
()
&&
new
Date
(
value
[
1
]).
getTime
()
<=
new
Date
(
x
.
value
[
1
]).
getTime
())
...
@@ -742,7 +1154,12 @@
...
@@ -742,7 +1154,12 @@
message
:
`时间段存在冲突`
,
message
:
`时间段存在冲突`
,
position
:
'top'
position
:
'top'
})
})
if
(
type
==
2
){
this
.
wsplist
[
index
].
value
=
''
}
else
{
this
.
spweeklist
[
index
].
value
=
''
this
.
spweeklist
[
index
].
value
=
''
}
return
return
}
}
},
},
...
@@ -860,6 +1277,71 @@
...
@@ -860,6 +1277,71 @@
return
ok
;
return
ok
;
},
[]);
},
[]);
},
},
welcometrigger
(
list
,
index
,
childrenindex
,
name
,){
//欢迎语的触发事件
if
(
name
==
'WelcomeList'
){
//通用欢迎语
this
.
addMsg
.
WelcomeList
[
index
]
=
list
}
else
if
(
name
==
"WelcomeWeekList"
){
this
.
wwlist
[
index
].
childrenlist
[
childrenindex
]
=
list
}
else
if
(
name
==
'WelcomeSpecialList'
){
this
.
wsplist
[
index
].
childrenlist
[
childrenindex
]
=
list
}
},
handleTabsEdit
(
targetName
,
action
){
if
(
action
==
'add'
){
this
.
wwlist
.
push
({
weeklist
:[{
Id
:
1
,
Name
:
'周一'
,
chek
:
false
},
{
Id
:
2
,
Name
:
'周二'
,
chek
:
false
},
{
Id
:
3
,
Name
:
'周三'
,
chek
:
false
},
{
Id
:
4
,
Name
:
'周四'
,
chek
:
false
},
{
Id
:
5
,
Name
:
'周五'
,
chek
:
false
},
{
Id
:
6
,
Name
:
'周六'
,
chek
:
false
},
{
Id
:
0
,
Name
:
'周日'
,
chek
:
false
}],
childrenlist
:[{
SrartHours
:
''
,
EndHours
:
''
,
Id
:
0
,
Content
:
''
,
MediumIds
:
''
,
MediumModel
:[]}]
})
this
.
$forceUpdate
();
}
},
handleTabsEdit2
(
targetName
,
action
){
if
(
action
==
'add'
){
this
.
wsplist
.
push
({
StartDate
:
''
,
EndDate
:
''
,
value
:[],
childrenlist
:[{
SrartHours
:
''
,
EndHours
:
''
,
Id
:
0
,
Content
:
''
,
MediumIds
:
''
,
MediumModel
:[]}]
})
this
.
$forceUpdate
();
}
},
handleTabsclose
(
index
,
type
=
1
){
let
that
=
this
;
if
(
type
==
1
){
//周期
that
.
wwlist
.
splice
(
index
,
1
)
that
.
editableTabsValue
=
'0'
}
else
{
//特殊
that
.
wsplist
.
splice
(
index
,
1
)
that
.
editableTabsValue2
=
'0'
}
this
.
$forceUpdate
();
},
addwelcomesjd
(
index
,
type
=
1
){
//周期添加欢迎语时间段
let
obj
=
{
SrartHours
:
''
,
EndHours
:
''
,
Id
:
0
,
Content
:
''
,
MediumIds
:
''
,
MediumModel
:[]}
if
(
type
==
1
){
//周期
this
.
wwlist
[
index
].
childrenlist
.
push
(
obj
)
}
else
{
//特殊
this
.
wsplist
[
index
].
childrenlist
.
push
(
obj
)
}
},
abv
(
index
,
y
,
x
,
type
=
1
){
if
(
type
==
1
){
//周期
this
.
wwlist
[
index
].
childrenlist
.
splice
(
y
,
1
)
this
.
$forceUpdate
();
console
.
log
(
this
.
wwlist
[
index
].
childrenlist
)
}
else
{
//特殊
this
.
wsplist
[
index
].
childrenlist
.
splice
(
y
,
1
)
this
.
$forceUpdate
();
console
.
log
(
this
.
wsplist
[
index
].
childrenlist
)
}
}
}
}
}
}
...
...
src/pages/enterprise/channelcodeList.vue
View file @
370b8363
...
@@ -214,7 +214,7 @@
...
@@ -214,7 +214,7 @@
},
},
goedit
(
row
)
{
//编辑
goedit
(
row
)
{
//编辑
this
.
$router
.
push
({
this
.
$router
.
push
({
path
:
'/enterprise/add
Welcom
e'
,
path
:
'/enterprise/add
channelcod
e'
,
query
:
{
query
:
{
Id
:
row
.
Id
Id
:
row
.
Id
}
}
...
...
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