Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
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 434bb08a
authored
Dec 27, 2020
by
xinlaa
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
群发接口调试
1 parent
4fd9f143
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
100 additions
and
47 deletions
linkwe-ui/src/api/groupMessage.js
linkwe-ui/src/api/material/index.js
linkwe-ui/src/views/drainageCode/staff/list.vue
linkwe-ui/src/views/groupMessage/add.vue
linkwe-ui/src/views/groupMessage/record.vue
linkwe-ui/src/api/groupMessage.js
View file @
434bb08
...
...
@@ -40,3 +40,21 @@ export function add(data) {
data
,
})
}
/**
*
* @param {*} data
* {
* sender:创建人
content:内容
pushType:群发类型 0 发给客户 1 发给客户群
beginTime:开始时间
endTime:结束时间}
*/
export
function
getList
(
data
)
{
return
request
({
url
:
service
+
'/list'
,
method
:
'get'
,
data
,
})
}
linkwe-ui/src/api/material/index.js
View file @
434bb08
...
...
@@ -149,3 +149,18 @@ export function removeTree(ids) {
method
:
'DELETE'
,
})
}
/**
* 获取素材media_id
* @param {*} data
* url [string] 是 素材路径
type [string] 是 素材类型
name [string] 是 文件名称
*/
export
function
getMaterialMediaId
(
data
)
{
return
request
({
url
:
service
+
'/temporaryMaterialMediaId'
,
method
:
'POST'
,
data
,
})
}
linkwe-ui/src/views/drainageCode/staff/list.vue
View file @
434bb08
...
...
@@ -78,7 +78,7 @@ export default {
this
.
list
=
rows
this
.
total
=
+
total
this
.
loading
=
false
this
.
multipleSelection
=
[]
this
.
ids
=
[]
})
.
catch
(()
=>
{
this
.
loading
=
false
...
...
@@ -129,41 +129,43 @@ export default {
this
.
getList
(
1
)
})
},
download
(
id
,
userName
,
activityScene
)
{
let
name
=
userName
+
"-"
+
activityScene
+
".png"
download
(
id
).
then
((
res
)
=>
{
if
(
res
!=
null
)
{
let
blob
=
new
Blob
([
res
],
{
type
:
'application/zip'
});
let
url
=
window
.
URL
.
createObjectURL
(
blob
)
;
const
link
=
document
.
createElement
(
'a'
)
;
// 创建a标签
link
.
href
=
url
;
link
.
download
=
name
;
// 重命名文件
link
.
click
()
;
URL
.
revokeObjectURL
(
url
)
;
// 释放内存
download
(
id
,
userName
,
activityScene
)
{
let
name
=
userName
+
'-'
+
activityScene
+
'.png'
download
(
id
).
then
((
res
)
=>
{
if
(
res
!=
null
)
{
let
blob
=
new
Blob
([
res
],
{
type
:
'application/zip'
})
let
url
=
window
.
URL
.
createObjectURL
(
blob
)
const
link
=
document
.
createElement
(
'a'
)
// 创建a标签
link
.
href
=
url
link
.
download
=
name
// 重命名文件
link
.
click
()
URL
.
revokeObjectURL
(
url
)
// 释放内存
}
})
},
/** 下载 */
downloadBatch
(
qrCode
)
{
this
.
$confirm
(
'是否确认下载所有图片吗?'
,
'警告'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
})
.
then
(()
=>
{
return
downloadBatch
(
this
.
ids
+
''
)
// window.open(downloadBatch(this.ids))
})
.
then
(()
=>
{
return
downloadBatch
(
this
.
ids
+
''
)
// window.open(downloadBatch(this.ids))
}).
then
((
res
)
=>
{
if
(
res
!=
null
)
{
let
blob
=
new
Blob
([
res
],
{
type
:
'application/zip'
});
let
url
=
window
.
URL
.
createObjectURL
(
blob
);
const
link
=
document
.
createElement
(
'a'
);
// 创建a标签
link
.
href
=
url
;
link
.
download
=
'批量员工活码.zip'
;
// 重命名文件
link
.
click
();
URL
.
revokeObjectURL
(
url
);
// 释放内存
.
then
((
res
)
=>
{
if
(
res
!=
null
)
{
let
blob
=
new
Blob
([
res
],
{
type
:
'application/zip'
})
let
url
=
window
.
URL
.
createObjectURL
(
blob
)
const
link
=
document
.
createElement
(
'a'
)
// 创建a标签
link
.
href
=
url
link
.
download
=
'批量员工活码.zip'
// 重命名文件
link
.
click
()
URL
.
revokeObjectURL
(
url
)
// 释放内存
}
}).
catch
(
function
()
{})
})
.
catch
(
function
()
{})
},
},
}
...
...
@@ -171,14 +173,19 @@ export default {
<
template
>
<div>
<el-form
:model=
"query"
ref=
"queryForm"
:inline=
"true"
label-width=
"100px"
>
<el-form
:model=
"query"
ref=
"queryForm"
:inline=
"true"
label-width=
"100px"
class=
"top-search"
>
<el-form-item
label=
"使用员工"
>
<el-input
v-model=
"query.useUserName"
placeholder=
"请输入"
clearable
style=
"width: 240px;"
@
keyup
.
enter
.
native=
"handleQuery"
@
keyup
.
enter
.
native=
"getList(1)"
/>
</el-form-item>
<!--
<el-form-item
label=
"姓名"
>
...
...
@@ -186,8 +193,7 @@ export default {
v-model=
"query.operName"
placeholder=
"请输入"
clearable
style=
"width: 240px;"
@
keyup
.
enter
.
native=
"handleQuery"
@
keyup
.
enter
.
native=
"getList(1)"
/>
</el-form-item>
-->
<el-form-item
label=
"手机号"
>
...
...
@@ -195,8 +201,7 @@ export default {
v-model=
"query.mobile"
placeholder=
"请输入"
clearable
style=
"width: 240px;"
@
keyup
.
enter
.
native=
"handleQuery"
@
keyup
.
enter
.
native=
"getList(1)"
/>
</el-form-item>
<el-form-item
label=
"活动场景"
>
...
...
@@ -204,8 +209,7 @@ export default {
v-model=
"query.activityScene"
placeholder=
"请输入"
clearable
style=
"width: 240px;"
@
keyup
.
enter
.
native=
"handleQuery"
@
keyup
.
enter
.
native=
"getList(1)"
/>
</el-form-item>
<el-form-item
label=
"创建人"
>
...
...
@@ -213,14 +217,12 @@ export default {
v-model=
"query.createBy"
placeholder=
"请输入"
clearable
style=
"width: 240px;"
@
keyup
.
enter
.
native=
"handleQuery"
@
keyup
.
enter
.
native=
"getList(1)"
/>
</el-form-item>
<el-form-item
label=
"创建日期"
>
<el-date-picker
v-model=
"dateRange"
style=
"width: 240px"
value-format=
"yyyy-MM-dd"
type=
"daterange"
range-separator=
"-"
...
...
@@ -307,7 +309,7 @@ export default {
<
template
slot-scope=
"{ row }"
>
<el-button
type=
"text"
@
click=
"download(row.id,
row.useUserName,
row.activityScene)"
@
click=
"download(row.id,
row.useUserName,
row.activityScene)"
v-hasPermi=
"['monitor:operlog:query']"
>
下载
</el-button
>
...
...
linkwe-ui/src/views/groupMessage/add.vue
View file @
434bb08
<
script
>
import
{
add
}
from
'@/api/groupMessage'
import
{
getMaterialMediaId
}
from
'@/api/material'
import
PhoneDialog
from
'@/components/PhoneDialog'
import
SelectUser
from
'@/components/SelectUser'
import
SelectTag
from
'@/components/SelectTag'
...
...
@@ -103,19 +104,36 @@ export default {
// 选择素材确认按钮
submitSelectMaterial
(
text
,
image
,
file
)
{
this
.
form
.
textMessage
.
content
=
text
.
content
this
.
form
.
imageMessage
.
media_id
=
image
.
id
//
this.form.imageMessage.media_id = image.id
this
.
form
.
imageMessage
.
pic_url
=
image
.
materialUrl
this
.
form
.
imageMessage
.
_materialName
=
image
.
materialName
},
submit
()
{
let
form
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
form
))
form
.
tag
=
form
.
tag
.
map
((
d
)
=>
d
.
tagId
)
+
''
form
.
department
+=
''
form
.
staffId
+=
''
add
(
form
)
Promise
.
resolve
(()
=>
{
if
(
form
.
messageType
==
1
)
{
// debugger
let
dataMediaId
=
{
url
:
form
.
imageMessage
.
pic_url
,
type
:
'0'
,
name
:
form
.
imageMessage
.
_materialName
,
}
return
getMaterialMediaId
(
dataMediaId
).
then
((
res
)
=>
{
form
.
imageMessage
.
media_id
=
res
.
data
})
}
})
.
then
(()
=>
{
form
.
messageType
=
this
.
activeName
form
.
tag
=
form
.
tag
.
map
((
d
)
=>
d
.
tagId
)
+
''
form
.
department
+=
''
form
.
staffId
+=
''
return
add
(
form
)
})
.
then
(({
data
})
=>
{
this
.
msgSuccess
(
'操作成功'
)
this
.
loading
=
false
this
.
$router
.
back
(
)
this
.
$router
.
push
(
'/groupMessage/record'
)
})
.
catch
(()
=>
{
this
.
loading
=
false
...
...
linkwe-ui/src/views/groupMessage/record.vue
View file @
434bb08
This diff is collapsed.
Click to expand it.
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