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
3d93702d
Commit
3d93702d
authored
Dec 21, 2018
by
chenfenglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
云集绑定老师
parent
f0efc191
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
159 additions
and
36 deletions
+159
-36
dialog.vue
src/components/yunji/dialog.vue
+75
-0
index.vue
src/components/yunji/index.vue
+79
-36
api.js
src/service/api.js
+5
-0
No files found.
src/components/yunji/dialog.vue
0 → 100644
View file @
3d93702d
<
template
>
<el-dialog
:title=
"dialogObj.title"
:visible
.
sync=
"dialogObj.show"
>
<el-form
ref=
"form"
:model=
"form"
label-width=
"120px"
>
<el-form-item
label=
"老师"
>
<el-select
v-model=
"form.teacher_id"
placeholder=
"请选择"
>
<el-option
v-for=
"(data,index) in teacherList"
:key=
"index"
:label=
"data.name"
:value=
"data.id"
>
</el-option>
</el-select>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogObj.show = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"onSave"
>
确 定
</el-button>
</span>
</el-dialog>
</
template
>
<
script
>
import
{
getTeacherListApi
,
bindTeacherApi
}
from
"../../service/api"
;
export
default
{
props
:[
'dialogObj'
],
data
(){
return
{
form
:{
id
:
''
,
teacher_id
:
''
,
},
teacherList
:[],
}
},
methods
:{
initPage
(){
let
json
=
{
page
:
1
,
limit
:
200
}
getTeacherListApi
(
json
).
then
(
res
=>
{
this
.
teacherList
=
res
.
list
;
});
this
.
form
=
{
id
:
this
.
dialogObj
.
id
,
teacher_id
:
this
.
dialogObj
.
teacher_id
?
this
.
dialogObj
.
teacher_id
:
''
};
},
onSave
(){
let
teacher_id
=
this
.
form
.
teacher_id
?
this
.
form
.
teacher_id
:
0
bindTeacherApi
(
this
.
form
.
id
,
teacher_id
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'绑定成功!'
});
this
.
dialogObj
.
show
=
false
;
})
}
},
watch
:{
'dialogObj'
(
value
){
this
.
initPage
()
}
}
}
</
script
>
<
style
scoped
>
</
style
>
src/components/yunji/index.vue
View file @
3d93702d
...
...
@@ -13,14 +13,14 @@
</el-form-item>
</el-col>
<el-col
:span=
"4"
>
<el-form-item
label=
"
发货
状态"
>
<el-select
v-model=
"searchFrom.
status
"
placeholder=
"请选择"
@
change=
"getList"
>
<el-form-item
label=
"
购买
状态"
>
<el-select
v-model=
"searchFrom.
user_buy
"
placeholder=
"请选择"
@
change=
"getList"
>
<el-option
label=
"全部"
value=
""
></el-option>
<el-option
v-for=
"item in useTypeList"
:key=
"item.
status
"
:key=
"item.
user_buy
"
:label=
"item.value"
:value=
"item.
status
"
>
:value=
"item.
user_buy
"
>
</el-option>
</el-select>
</el-form-item>
...
...
@@ -37,6 +37,33 @@
</el-select>
</el-form-item>
</el-col>
<el-col
:span=
"6"
>
<el-form-item
label=
"购买时间"
>
<el-date-picker
v-model=
"searchFrom.payTime"
type=
"datetimerange"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
:default-time=
"['00:00:00','23:59:59']"
@
change=
"getList"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col
:span=
"6"
>
<el-form-item
label=
"同步时间"
>
<el-date-picker
v-model=
"searchFrom.syncTime"
type=
"datetimerange"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
:default-time=
"['00:00:00','23:59:59']"
@
change=
"getList"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col
:span=
"4"
>
<el-form-item>
<el-button
type=
"primary"
@
click=
"getList"
>
搜索
</el-button>
...
...
@@ -68,9 +95,9 @@
label=
"商品名称"
>
</el-table-column>
<el-table-column
label=
"
发货
状态"
>
label=
"
购买
状态"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
status
|
filterStatus
}}
{{
scope
.
row
.
user_id
|
filterStatus
}}
</
template
>
</el-table-column>
<el-table-column
...
...
@@ -98,22 +125,31 @@
<el-table-column
prop=
"buyer_comment"
label=
"备注"
>
</el-table-column>
<el-table-column
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<el-button
@
click=
"bindTeacher(scope.row)"
size=
"mini"
plain
type=
"success"
>
绑定老师
</el-button>
</
template
>
</el-table-column>
</el-table>
<page
:nowPage=
"nowPage"
:total=
"total"
@
pageChange=
"onPageChange"
@
sizeChange=
"onSizeChange"
/>
<teacher-dialog
:dialogObj=
"dialogObj"
></teacher-dialog>
</div>
</template>
<
script
>
import
page
from
'../framework/page'
import
teacherDialog
from
'./dialog'
import
{
getyunjiApi
,
getGoodsListApi
}
from
"../../service/api"
;
import
{
GOODSTYPE
}
from
"../../util/wordbook"
;
import
CommonJs
from
'../../util/common'
;
export
default
{
name
:
"smsRecord"
,
components
:{
page
page
,
teacherDialog
},
data
(){
return
{
...
...
@@ -122,32 +158,38 @@
limit
:
10
,
useTypeList
:[
{
status
:
4
0
,
value
:
'
待发货
'
user_buy
:
0
,
value
:
'
未购买
'
},
{
status
:
50
,
value
:
'已
发货
'
user_buy
:
1
,
value
:
'已
购买
'
},
],
searchFrom
:
{
goods_id
:
''
,
mobile
:
''
,
order_id
:
''
order_id
:
''
,
payTime
:[],
syncTime
:[],
},
list
:
[],
goodList
:[],
dialogObj
:{
show
:
false
,
title
:
'绑定老师'
,
order_id
:
0
,
teacher_id
:
0
},
}
},
filters
:{
filterStatus
:
function
(
value
)
{
let
msg
=
''
;
if
(
value
===
40
){
msg
=
'待发货'
}
else
if
(
value
==
50
){
msg
=
'已发货'
if
(
value
===
0
){
msg
=
'未购买'
}
else
{
msg
=
""
msg
=
"
已购课
"
}
return
msg
;
},
...
...
@@ -180,8 +222,8 @@
if
(
this
.
searchFrom
.
goods_name
){
json
.
goods_name
=
this
.
searchFrom
.
goods_name
}
if
(
this
.
searchFrom
.
status
||
this
.
searchFrom
.
status
==
0
){
json
.
status
=
this
.
searchFrom
.
status
if
(
this
.
searchFrom
.
user_buy
||
this
.
searchFrom
.
user_buy
==
0
){
json
.
user_buy
=
this
.
searchFrom
.
user_buy
}
if
(
this
.
searchFrom
.
order_id
){
json
.
order_id
=
this
.
searchFrom
.
order_id
...
...
@@ -189,23 +231,16 @@
if
(
this
.
searchFrom
.
goods_id
){
json
.
goods_id
=
this
.
searchFrom
.
goods_id
}
if
(
this
.
searchFrom
.
payTime
&&
this
.
searchFrom
.
payTime
.
length
>
0
){
json
.
start_at
=
CommonJs
.
dateFmt
(
this
.
searchFrom
.
payTime
[
0
],
"yyyy-MM-dd hh:mm:ss"
);
json
.
end_at
=
CommonJs
.
dateFmt
(
this
.
searchFrom
.
payTime
[
1
],
"yyyy-MM-dd hh:mm:ss"
)
}
if
(
this
.
searchFrom
.
syncTime
&&
this
.
searchFrom
.
syncTime
.
length
>
0
){
json
.
pull_start_at
=
CommonJs
.
dateFmt
(
this
.
searchFrom
.
syncTime
[
0
],
"yyyy-MM-dd hh:mm:ss"
);
json
.
pull_end_at
=
CommonJs
.
dateFmt
(
this
.
searchFrom
.
syncTime
[
1
],
"yyyy-MM-dd hh:mm:ss"
)
}
getyunjiApi
(
json
).
then
((
res
)
=>
{
if
(
this
.
searchFrom
.
status
!==
''
){
switch
(
this
.
searchFrom
.
status
){
case
40
:
res
.
list
=
res
.
list
.
filter
(
function
(
item
,
i
){
return
item
.
status
==
40
});
break
;
case
50
:
res
.
list
=
res
.
list
.
filter
(
function
(
item
,
i
){
return
item
.
status
==
50
});
break
;
}
}
this
.
total
=
res
.
total
;
this
.
list
=
res
.
list
?
res
.
list
:
[]
})
...
...
@@ -219,6 +254,14 @@
this
.
goodList
=
res
.
list
;
})
},
bindTeacher
(
data
){
this
.
dialogObj
=
{
show
:
true
,
title
:
'绑定老师'
,
id
:
data
.
id
,
teacher_id
:
data
.
teacher_id
}
},
}
}
...
...
src/service/api.js
View file @
3d93702d
...
...
@@ -782,4 +782,9 @@ export const getsmsRecordApi = function(json) {
const
getyunjiUrl
=
`/api/admin/yunji/order`
;
export
const
getyunjiApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$fetch
(
`
${
getyunjiUrl
}
`
,
json
)
}
//云集绑定老师
const
bindTeacherUrl
=
`api/admin/yunji/order/bind/teacher/`
;
export
const
bindTeacherApi
=
function
(
json
,
id
)
{
return
Vue
.
prototype
.
$put
(
`
${
bindTeacherUrl
}
/
${
json
}
/
${
id
}
`
)
}
\ No newline at end of file
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