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) {
...
@@ -40,3 +40,21 @@ export function add(data) {
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) {
...
@@ -149,3 +149,18 @@ export function removeTree(ids) {
method
:
'DELETE'
,
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 {
...
@@ -78,7 +78,7 @@ export default {
this
.
list
=
rows
this
.
list
=
rows
this
.
total
=
+
total
this
.
total
=
+
total
this
.
loading
=
false
this
.
loading
=
false
this
.
multipleSelection
=
[]
this
.
ids
=
[]
})
})
.
catch
(()
=>
{
.
catch
(()
=>
{
this
.
loading
=
false
this
.
loading
=
false
...
@@ -129,41 +129,43 @@ export default {
...
@@ -129,41 +129,43 @@ export default {
this
.
getList
(
1
)
this
.
getList
(
1
)
})
})
},
},
download
(
id
,
userName
,
activityScene
)
{
download
(
id
,
userName
,
activityScene
)
{
let
name
=
userName
+
"-"
+
activityScene
+
".png"
let
name
=
userName
+
'-'
+
activityScene
+
'.png'
download
(
id
).
then
((
res
)
=>
{
download
(
id
).
then
((
res
)
=>
{
if
(
res
!=
null
)
{
if
(
res
!=
null
)
{
let
blob
=
new
Blob
([
res
],
{
type
:
'application/zip'
});
let
blob
=
new
Blob
([
res
],
{
type
:
'application/zip'
})
let
url
=
window
.
URL
.
createObjectURL
(
blob
)
;
let
url
=
window
.
URL
.
createObjectURL
(
blob
)
const
link
=
document
.
createElement
(
'a'
)
;
// 创建a标签
const
link
=
document
.
createElement
(
'a'
)
// 创建a标签
link
.
href
=
url
;
link
.
href
=
url
link
.
download
=
name
;
// 重命名文件
link
.
download
=
name
// 重命名文件
link
.
click
()
;
link
.
click
()
URL
.
revokeObjectURL
(
url
)
;
// 释放内存
URL
.
revokeObjectURL
(
url
)
// 释放内存
}
}
})
})
},
},
/** 下载 */
/** 下载 */
downloadBatch
(
qrCode
)
{
downloadBatch
(
qrCode
)
{
this
.
$confirm
(
'是否确认下载所有图片吗?'
,
'警告'
,
{
this
.
$confirm
(
'是否确认下载所有图片吗?'
,
'警告'
,
{
confirmButtonText
:
'确定'
,
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
type
:
'warning'
,
})
.
then
(()
=>
{
return
downloadBatch
(
this
.
ids
+
''
)
// window.open(downloadBatch(this.ids))
})
})
.
then
(()
=>
{
.
then
((
res
)
=>
{
return
downloadBatch
(
this
.
ids
+
''
)
if
(
res
!=
null
)
{
// window.open(downloadBatch(this.ids))
let
blob
=
new
Blob
([
res
],
{
type
:
'application/zip'
})
}).
then
((
res
)
=>
{
let
url
=
window
.
URL
.
createObjectURL
(
blob
)
if
(
res
!=
null
)
{
const
link
=
document
.
createElement
(
'a'
)
// 创建a标签
let
blob
=
new
Blob
([
res
],
{
type
:
'application/zip'
});
link
.
href
=
url
let
url
=
window
.
URL
.
createObjectURL
(
blob
);
link
.
download
=
'批量员工活码.zip'
// 重命名文件
const
link
=
document
.
createElement
(
'a'
);
// 创建a标签
link
.
click
()
link
.
href
=
url
;
URL
.
revokeObjectURL
(
url
)
// 释放内存
link
.
download
=
'批量员工活码.zip'
;
// 重命名文件
link
.
click
();
URL
.
revokeObjectURL
(
url
);
// 释放内存
}
}
}).
catch
(
function
()
{})
})
.
catch
(
function
()
{})
},
},
},
},
}
}
...
@@ -171,14 +173,19 @@ export default {
...
@@ -171,14 +173,19 @@ export default {
<
template
>
<
template
>
<div>
<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-form-item
label=
"使用员工"
>
<el-input
<el-input
v-model=
"query.useUserName"
v-model=
"query.useUserName"
placeholder=
"请输入"
placeholder=
"请输入"
clearable
clearable
style=
"width: 240px;"
@
keyup
.
enter
.
native=
"getList(1)"
@
keyup
.
enter
.
native=
"handleQuery"
/>
/>
</el-form-item>
</el-form-item>
<!--
<el-form-item
label=
"姓名"
>
<!--
<el-form-item
label=
"姓名"
>
...
@@ -186,8 +193,7 @@ export default {
...
@@ -186,8 +193,7 @@ export default {
v-model=
"query.operName"
v-model=
"query.operName"
placeholder=
"请输入"
placeholder=
"请输入"
clearable
clearable
style=
"width: 240px;"
@
keyup
.
enter
.
native=
"getList(1)"
@
keyup
.
enter
.
native=
"handleQuery"
/>
/>
</el-form-item>
-->
</el-form-item>
-->
<el-form-item
label=
"手机号"
>
<el-form-item
label=
"手机号"
>
...
@@ -195,8 +201,7 @@ export default {
...
@@ -195,8 +201,7 @@ export default {
v-model=
"query.mobile"
v-model=
"query.mobile"
placeholder=
"请输入"
placeholder=
"请输入"
clearable
clearable
style=
"width: 240px;"
@
keyup
.
enter
.
native=
"getList(1)"
@
keyup
.
enter
.
native=
"handleQuery"
/>
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"活动场景"
>
<el-form-item
label=
"活动场景"
>
...
@@ -204,8 +209,7 @@ export default {
...
@@ -204,8 +209,7 @@ export default {
v-model=
"query.activityScene"
v-model=
"query.activityScene"
placeholder=
"请输入"
placeholder=
"请输入"
clearable
clearable
style=
"width: 240px;"
@
keyup
.
enter
.
native=
"getList(1)"
@
keyup
.
enter
.
native=
"handleQuery"
/>
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"创建人"
>
<el-form-item
label=
"创建人"
>
...
@@ -213,14 +217,12 @@ export default {
...
@@ -213,14 +217,12 @@ export default {
v-model=
"query.createBy"
v-model=
"query.createBy"
placeholder=
"请输入"
placeholder=
"请输入"
clearable
clearable
style=
"width: 240px;"
@
keyup
.
enter
.
native=
"getList(1)"
@
keyup
.
enter
.
native=
"handleQuery"
/>
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"创建日期"
>
<el-form-item
label=
"创建日期"
>
<el-date-picker
<el-date-picker
v-model=
"dateRange"
v-model=
"dateRange"
style=
"width: 240px"
value-format=
"yyyy-MM-dd"
value-format=
"yyyy-MM-dd"
type=
"daterange"
type=
"daterange"
range-separator=
"-"
range-separator=
"-"
...
@@ -307,7 +309,7 @@ export default {
...
@@ -307,7 +309,7 @@ export default {
<
template
slot-scope=
"{ row }"
>
<
template
slot-scope=
"{ row }"
>
<el-button
<el-button
type=
"text"
type=
"text"
@
click=
"download(row.id,
row.useUserName,
row.activityScene)"
@
click=
"download(row.id,
row.useUserName,
row.activityScene)"
v-hasPermi=
"['monitor:operlog:query']"
v-hasPermi=
"['monitor:operlog:query']"
>
下载
</el-button
>
下载
</el-button
>
>
...
...
linkwe-ui/src/views/groupMessage/add.vue
View file @
434bb08
<
script
>
<
script
>
import
{
add
}
from
'@/api/groupMessage'
import
{
add
}
from
'@/api/groupMessage'
import
{
getMaterialMediaId
}
from
'@/api/material'
import
PhoneDialog
from
'@/components/PhoneDialog'
import
PhoneDialog
from
'@/components/PhoneDialog'
import
SelectUser
from
'@/components/SelectUser'
import
SelectUser
from
'@/components/SelectUser'
import
SelectTag
from
'@/components/SelectTag'
import
SelectTag
from
'@/components/SelectTag'
...
@@ -103,19 +104,36 @@ export default {
...
@@ -103,19 +104,36 @@ export default {
// 选择素材确认按钮
// 选择素材确认按钮
submitSelectMaterial
(
text
,
image
,
file
)
{
submitSelectMaterial
(
text
,
image
,
file
)
{
this
.
form
.
textMessage
.
content
=
text
.
content
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
.
pic_url
=
image
.
materialUrl
this
.
form
.
imageMessage
.
_materialName
=
image
.
materialName
},
},
submit
()
{
submit
()
{
let
form
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
form
))
let
form
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
form
))
form
.
tag
=
form
.
tag
.
map
((
d
)
=>
d
.
tagId
)
+
''
Promise
.
resolve
(()
=>
{
form
.
department
+=
''
if
(
form
.
messageType
==
1
)
{
form
.
staffId
+=
''
// debugger
add
(
form
)
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
})
=>
{
.
then
(({
data
})
=>
{
this
.
msgSuccess
(
'操作成功'
)
this
.
msgSuccess
(
'操作成功'
)
this
.
loading
=
false
this
.
loading
=
false
this
.
$router
.
back
(
)
this
.
$router
.
push
(
'/groupMessage/record'
)
})
})
.
catch
(()
=>
{
.
catch
(()
=>
{
this
.
loading
=
false
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