Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
admin-base
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
new-sing
admin-base
Commits
d9f90def
Commit
d9f90def
authored
Nov 07, 2018
by
王
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
外部投放
parent
23529c31
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
205 additions
and
9 deletions
+205
-9
index.vue
src/components/externalLaunch/index.vue
+192
-7
index.vue
src/components/promotion/index.vue
+2
-2
api.js
src/service/api.js
+11
-0
No files found.
src/components/externalLaunch/index.vue
View file @
d9f90def
/**
* Created by wang on 18/10/31.
*/
<
template
>
<div>
外部投放
</div>
<div
class=
"index"
>
<el-form
ref=
"searchFrom"
:model=
"searchFrom"
label-width=
"80px"
>
<el-row>
<el-col
:lg=
"10"
:sm=
"24"
:md=
"24"
>
<el-form-item
label=
"购买时间"
>
<el-date-picker
v-model=
"searchFrom.time"
type=
"datetimerange"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
:default-time=
"['00:00:00','23:59:59']"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col
:lg=
"4"
:sm=
"24"
:md=
"12"
>
<el-form-item
label=
"来源"
>
<el-input
v-model=
"searchFrom.source"
placeholder=
"名称"
size=
"small"
></el-input>
</el-form-item>
</el-col>
<el-col
:lg=
"4"
:sm=
"24"
:md=
"12"
>
<el-form-item>
<el-button
type=
"primary"
plain
size=
"small"
@
click=
"initPage"
>
搜索
</el-button>
</el-form-item>
</el-col>
<el-col
:lg=
"4"
:sm=
"24"
:md=
"12"
>
<el-form-item>
<el-button
type=
"primary"
plain
size=
"small"
@
click=
"doExport"
>
导出
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table
:data=
"tableData"
style=
"width: 100%"
>
<el-table-column
prop=
"name"
label=
"宝贝名称"
>
</el-table-column>
<el-table-column
prop=
"telephone"
label=
"手机号"
>
</el-table-column>
<el-table-column
prop=
"desc"
label=
"备注"
>
</el-table-column>
<el-table-column
prop=
"create_at"
label=
"添加时间"
>
</el-table-column>
<el-table-column
prop=
"source"
label=
"来源"
>
</el-table-column>
<el-table-column
label=
"操作"
min-width=
"150"
v-if=
"!$store.state.readonly"
>
<template
slot-scope=
"scope"
>
<el-button
@
click=
"editComment(scope.row.id, scope.row.desc)"
type=
"text"
plain
size=
"mini"
>
编辑备注
</el-button>
</
template
>
</el-table-column>
</el-table>
<page
:total=
"total"
:limit=
"limit"
@
pageChange=
"onPageChange"
@
sizeChange=
"onSizeChange"
/>
<el-dialog
title=
"编辑备注"
center
append-to-body
:visible
.
sync=
"showCommentDialog"
:close-on-click-modal=
"false"
:close-on-press-escape=
"false"
:show-close=
"false"
width=
"600px"
>
<div>
<el-form
ref=
"commentFrom"
:model=
"commentForm"
>
<el-form-item
prop=
"desc"
>
<el-input
type=
"textarea"
v-model=
"commentForm.desc"
></el-input>
</el-form-item>
</el-form>
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"showCommentDialog = false;commentForm={}"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"saveComment"
>
确 定
</el-button>
</span>
</el-dialog>
</div>
</template>
<
script
>
export
default
{
name
:
"index"
import
page
from
'../framework/page'
import
CommonJs
from
'../../util/common'
;
import
{
getAdsInnerListApi
,
updateAdsInnerApi
}
from
"../../service/api"
;
export
default
{
name
:
"index"
,
components
:{
page
},
data
(){
return
{
total
:
0
,
nowPage
:
1
,
limit
:
10
,
searchFrom
:
{
source
:
''
},
tableData
:[],
commentForm
:
{},
showCommentDialog
:
false
}
},
created
(){
this
.
initPage
()
},
methods
:{
initPage
(){
let
json
=
{
limit
:
this
.
limit
,
page
:
this
.
nowPage
}
if
(
this
.
searchFrom
.
time
)
{
json
.
time
=
this
.
searchFrom
.
time
}
if
(
this
.
searchFrom
.
source
)
{
json
.
source
=
this
.
searchFrom
.
source
}
if
(
this
.
searchFrom
.
time
&&
this
.
searchFrom
.
time
.
length
>
0
){
json
.
date_start
=
CommonJs
.
dateFmt
(
this
.
searchFrom
.
time
[
0
],
"yyyy-MM-dd hh:mm:ss"
);
json
.
date_end
=
CommonJs
.
dateFmt
(
this
.
searchFrom
.
time
[
1
],
"yyyy-MM-dd hh:mm:ss"
)
}
getAdsInnerListApi
(
json
).
then
((
res
)
=>
{
this
.
tableData
=
res
.
list
;
this
.
total
=
res
.
total
})
},
onPageChange
(
val
){
this
.
nowPage
=
val
this
.
initPage
()
},
onSizeChange
(
val
){
this
.
nowPage
=
1
this
.
limit
=
val
this
.
initPage
()
},
doExport
(){
let
query
=
`?type=export`
;
if
(
this
.
searchFrom
.
source
){
query
=
query
+
'&source='
+
this
.
searchFrom
.
source
}
if
(
this
.
searchFrom
.
time
&&
this
.
searchFrom
.
time
.
length
>
0
){
query
=
query
+
'&date_start='
+
CommonJs
.
dateFmt
(
this
.
searchFrom
.
time
[
0
],
"yyyy-MM-dd hh:mm:ss"
);
query
=
query
+
'&date_end='
+
CommonJs
.
dateFmt
(
this
.
searchFrom
.
time
[
1
],
"yyyy-MM-dd hh:mm:ss"
)
}
window
.
open
(
`/api/public/ads/export/all
${
query
}
`
)
},
saveComment
(){
let
id
=
this
.
commentForm
.
id
;
let
desc
=
this
.
commentForm
.
desc
?
this
.
commentForm
.
desc
:
''
;
if
(
!
desc
)
return
;
updateAdsInnerApi
(
id
,{
desc
:
desc
}).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'编辑备注成功'
});
this
.
showCommentDialog
=
false
this
.
initPage
();
});
},
editComment
(
id
,
desc
)
{
this
.
showCommentDialog
=
true
;
this
.
commentForm
=
{
id
:
id
,
desc
:
desc
};
},
}
}
</
script
>
<
style
scoped
>
<
style
scoped
lang=
"less"
>
.index {
padding: 20px 0;
}
</
style
>
src/components/promotion/index.vue
View file @
d9f90def
...
...
@@ -43,7 +43,7 @@
:data=
"tableData"
style=
"width: 100%"
>
<el-table-column
prop=
"
user_
name"
prop=
"name"
label=
"宝贝名称"
>
</el-table-column>
<el-table-column
...
...
@@ -122,7 +122,7 @@
query
=
query
+
'&date_start='
+
CommonJs
.
dateFmt
(
this
.
searchFrom
.
time
[
0
],
"yyyy-MM-dd hh:mm:ss"
);
query
=
query
+
'&date_end='
+
CommonJs
.
dateFmt
(
this
.
searchFrom
.
time
[
1
],
"yyyy-MM-dd hh:mm:ss"
)
}
window
.
open
(
`
https://wechat-test.changchangenglish.com
/api/public/ads/export/all
${
query
}
`
)
window
.
open
(
`/api/public/ads/export/all
${
query
}
`
)
}
}
}
...
...
src/service/api.js
View file @
d9f90def
...
...
@@ -594,3 +594,14 @@ const getAdsListlUrl = 'api/public/ads/list';
export
const
getAdsListApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$fetch
(
getAdsListlUrl
,
json
)
};
const
getAdsInnerListUrl
=
'api/admin/ads/list'
;
export
const
getAdsInnerListApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$fetch
(
getAdsInnerListUrl
,
json
)
};
// 外部投放修改备注
const
updateAdsInnerUrl
=
'api/admin/ads'
;
export
const
updateAdsInnerApi
=
function
(
id
,
json
)
{
return
Vue
.
prototype
.
$put
(
`
${
updateAdsInnerUrl
}
/
${
id
}
`
,
json
)
};
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