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
a3cb288f
Commit
a3cb288f
authored
Aug 27, 2019
by
赵茹林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
佣金配置 新增 数据展示、新增、编辑、删除
parent
0ec5374b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
295 additions
and
142 deletions
+295
-142
App.vue
src/App.vue
+18
-0
index.vue
src/components/brokerage/index.vue
+139
-18
index.vue
src/components/login/index.vue
+125
-116
api.js
src/service/api.js
+13
-1
wq
wq
+0
-7
No files found.
src/App.vue
View file @
a3cb288f
...
@@ -294,4 +294,22 @@
...
@@ -294,4 +294,22 @@
font-size: 14px;
font-size: 14px;
color: #606266;
color: #606266;
}
}
.tabs-refresh {
&.el-tabs--card > .el-tabs__header {
margin-bottom: 10px;
padding-left: 10px;
/* background-color: #fff; */
padding-top: 10px;
padding-bottom: 1px;
}
&.el-tabs--card > .el-tabs__header .el-tabs__nav {
overflow: hidden;
}
&.el-tabs--card > .el-tabs__header .el-tabs__item.is-active {
background-color: #fff;
}
}
</
style
>
</
style
>
src/components/brokerage/index.vue
View file @
a3cb288f
...
@@ -2,17 +2,55 @@
...
@@ -2,17 +2,55 @@
<div
class=
"brokerage"
>
<div
class=
"brokerage"
>
<el-tabs
v-model=
"type"
type=
"card"
style=
"background: #fff; padding-top: 10px
"
>
<el-tabs
v-model=
"type"
type=
"card"
class=
"tabs-refresh"
v-loading=
"loading
"
>
<el-tab-pane
v-for=
"item1 in list"
:key=
"item1.label"
:label=
"item1.label"
:name=
"item1.value"
>
<el-tab-pane
v-for=
"item1 in list"
:key=
"item1.label"
:label=
"item1.label"
:name=
"item1.value"
>
<ul
class=
"tab-content"
>
<ul>
<li
v-for=
"item2 in item1.children"
class=
"brokerage-item"
>
<li
v-for=
"item2 in item1.children"
class=
"brokerage-item"
>
{{
filterName
(
item2
.
value
,
'BROKERAGE_COURSE_TYPE'
)
}}
<div
class=
"brokerage-item-header clearfix"
>
<el-button
type=
"success"
plain
>
新增
</el-button>
{{
filterName
(
item2
.
value
,
'BROKERAGE_COURSE_TYPE'
)
}}
<!--
<el-table>
<el-button
@
click=
"itemAdd(item1.value, item2.value)"
class=
"fr"
type=
"success"
plain
size=
"small"
>
新增
</el-button>
<el-table-column
label=
"ID"
></el-table-column>
</div>
</el-table>
-->
<el-table
border
:data=
"item2.data"
>
<el-table-column
:label=
"item2.money"
>
<template
slot-scope=
"scope"
>
<div
style=
"display: flex;"
>
<el-input
style=
"width: 46%;"
type=
"number"
v-model
.
number=
"scope.row.min_money"
></el-input>
<div
style=
"display: flex; align-items: center; justify-content: center; width: 8%;"
>
~
</div>
<el-input
style=
"width: 46%;"
type=
"number"
v-model
.
number=
"scope.row.max_money"
></el-input>
</div>
</
template
>
</el-table-column>
<el-table-column
:label=
"item2.scale"
>
<
template
slot-scope=
"scope"
>
<el-input
type=
"number"
v-model
.
number=
"scope.row.scale"
></el-input>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
width=
"150px"
>
<
template
slot-scope=
"scope"
>
<div
style=
"display: flex;"
>
<el-button
:disabled=
"!((typeof scope.row.min_money == 'number') && (typeof scope.row.max_money == 'number') && (typeof scope.row.scale == 'number'))"
v-if=
"true"
size=
"small"
plain
type=
"primary"
@
click=
"itemSave(scope.row)"
>
保存
</el-button>
<el-button
v-if=
"true"
size=
"small"
plain
type=
"danger"
@
click=
"itemDelete(scope.row)"
>
删除
</el-button>
</div>
</
template
>
</el-table-column>
</el-table>
</li>
</li>
</ul>
</ul>
...
@@ -25,13 +63,14 @@
...
@@ -25,13 +63,14 @@
</template>
</template>
<
script
>
<
script
>
import
{
getBrokerageApi
}
from
'@/service/api'
;
import
{
getBrokerageApi
,
deleteBrokerageApi
,
postBrokerageApi
,
putBrokerageApi
}
from
'@/service/api'
;
import
{
BROKERAGE_COURSE_TYPE
}
from
'@/util/wordbook'
;
import
{
BROKERAGE_COURSE_TYPE
}
from
'@/util/wordbook'
;
export
default
{
export
default
{
name
:
"index"
,
name
:
"index"
,
data
()
{
data
()
{
return
{
return
{
loading
:
true
,
type
:
'1'
,
type
:
'1'
,
BROKERAGE_COURSE_TYPE
:
BROKERAGE_COURSE_TYPE
,
BROKERAGE_COURSE_TYPE
:
BROKERAGE_COURSE_TYPE
,
list
:
[{
list
:
[{
...
@@ -39,14 +78,20 @@
...
@@ -39,14 +78,20 @@
value
:
'1'
,
value
:
'1'
,
children
:
[{
children
:
[{
label
:
'试听课来源-转年课业绩'
,
label
:
'试听课来源-转年课业绩'
,
money
:
'业绩区间'
,
scale
:
'提点比例'
,
value
:
'1'
,
value
:
'1'
,
data
:
[]
data
:
[]
},
{
},
{
label
:
'月课、季课来源-转年课业绩'
,
label
:
'月课、季课来源-转年课业绩'
,
money
:
'业绩区间'
,
scale
:
'提点比例'
,
value
:
'2'
,
value
:
'2'
,
data
:
[]
data
:
[]
},
{
},
{
label
:
'年课来源 - 转两年课业绩提点配置'
,
label
:
'年课来源 - 转两年课业绩提点配置'
,
money
:
'业绩区间'
,
scale
:
'提点比例'
,
value
:
'3'
,
value
:
'3'
,
data
:
[]
data
:
[]
}]
}]
...
@@ -55,14 +100,20 @@
...
@@ -55,14 +100,20 @@
value
:
'2'
,
value
:
'2'
,
children
:
[{
children
:
[{
label
:
'主管业绩提点'
,
label
:
'主管业绩提点'
,
money
:
'业绩完成率'
,
scale
:
'提点比例'
,
value
:
'4'
,
value
:
'4'
,
data
:
[]
data
:
[]
},
{
},
{
label
:
'主管转化率系数(试听课)'
,
label
:
'主管转化率系数(试听课)'
,
money
:
'团队转化率'
,
scale
:
'转化系数'
,
value
:
'5'
,
value
:
'5'
,
data
:
[]
data
:
[]
},
{
},
{
label
:
'主管转化率系数(月课、季课)'
,
label
:
'主管转化率系数(月课、季课)'
,
money
:
'团队转化率'
,
scale
:
'转化系数'
,
value
:
'6'
,
value
:
'6'
,
data
:
[]
data
:
[]
}]
}]
...
@@ -79,6 +130,76 @@
...
@@ -79,6 +130,76 @@
}).
label
}).
label
},
},
itemAdd
(
id1
,
id2
)
{
this
.
list
.
forEach
(
val1
=>
{
if
(
val1
.
value
==
id1
)
{
val1
.
children
.
forEach
(
val2
=>
{
if
(
val2
.
value
==
id2
)
{
val2
.
data
.
push
({
sale_type
:
id1
,
course_type
:
id2
,
max_money
:
''
,
min_money
:
''
,
scale
:
''
,
id_add
:
(
new
Date
()).
getTime
(),
})
}
})
}
})
},
itemSave
(
row
)
{
if
((
typeof
row
.
min_money
==
'number'
)
&&
(
typeof
row
.
max_money
==
'number'
)
&&
(
typeof
row
.
scale
==
'number'
))
{
let
json
=
{
min_money
:
row
.
min_money
,
max_money
:
row
.
max_money
,
scale
:
row
.
scale
,
sale_type
:
row
.
sale_type
,
course_type
:
row
.
course_type
}
if
(
row
.
id
)
{
// 编辑的
putBrokerageApi
(
row
.
id
,
json
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'保存成功'
});
this
.
getData
();
})
}
else
{
// 新增的
postBrokerageApi
(
json
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'保存成功'
});
this
.
getData
();
})
}
}
},
itemDelete
(
row
)
{
if
(
row
.
id_add
)
{
this
.
list
.
forEach
(
val1
=>
{
if
(
val1
.
value
==
row
.
sale_type
)
{
val1
.
children
.
forEach
(
val2
=>
{
if
(
val2
.
value
==
row
.
course_type
)
{
var
idx
=
val2
.
data
.
findIndex
(
item
=>
{
return
item
.
id_add
==
row
.
id_add
})
val2
.
data
.
splice
(
idx
,
1
);
}
})
}
})
}
else
{
this
.
$confirm
(
`确定删除?`
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
deleteBrokerageApi
(
row
.
id
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'删除成功'
});
this
.
getData
();
})
}).
catch
(()
=>
{
this
.
$message
({
type
:
'info'
,
message
:
'已取消删除'
});
});
}
},
getData
()
{
getData
()
{
getBrokerageApi
().
then
(
res
=>
{
getBrokerageApi
().
then
(
res
=>
{
if
(
res
.
list
&&
res
.
list
.
length
)
{
if
(
res
.
list
&&
res
.
list
.
length
)
{
...
@@ -87,15 +208,14 @@
...
@@ -87,15 +208,14 @@
var
idx1
=
this
.
list
.
findIndex
(
item1
=>
{
var
idx1
=
this
.
list
.
findIndex
(
item1
=>
{
return
item1
.
value
==
val1
[
0
].
sale_type
return
item1
.
value
==
val1
[
0
].
sale_type
})
})
this
.
list
[
idx1
].
children
.
forEach
(
val2
=>
{
var
idx2
=
this
.
list
[
idx1
].
children
.
findIndex
(
item2
=>
{
var
idx2
=
this
.
list
[
idx1
].
children
.
findIndex
(
item2
=>
{
return
item2
.
value
==
val1
[
0
].
course_type
return
item2
.
value
==
val1
[
0
].
course_type
})
this
.
list
[
idx1
].
children
[
idx2
].
data
=
val1
;
})
})
this
.
list
[
idx1
].
children
[
idx2
].
data
=
val1
;
}
}
})
})
console
.
log
(
this
.
list
)
console
.
log
(
this
.
list
)
this
.
loading
=
false
;
}
}
})
})
}
}
...
@@ -105,12 +225,13 @@
...
@@ -105,12 +225,13 @@
<
style
lang=
"less"
>
<
style
lang=
"less"
>
.brokerage {
.brokerage {
.tab-content {
padding: 10px;
}
.brokerage-item {
.brokerage-item {
margin: 0 10px 10px;
padding: 10px;
background-color: #fff;
.brokerage-item-header {
padding-bottom: 10px;
}
}
}
}
}
</
style
>
</
style
>
src/components/login/index.vue
View file @
a3cb288f
<
template
>
<
template
>
<div
class=
"login"
>
<div
class=
"login"
>
<div
class=
"wrap-main"
>
<div
class=
"wrap-main"
>
<h1
class=
"title"
>
唱唱启蒙——后台管理系统
</h1>
<h1
class=
"title"
>
唱唱启蒙——后台管理系统
</h1>
<el-form
:model=
"login"
:rules=
"loginRules"
ref=
"loginForm"
>
<el-form
:model=
"login"
:rules=
"loginRules"
ref=
"loginForm"
>
<el-form-item
prop=
"username"
>
<el-form-item
prop=
"username"
>
<el-input
v-model=
"login.username"
placeholder=
"用户名"
></el-input>
<el-input
v-model=
"login.username"
placeholder=
"用户名"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
prop=
"password"
>
<el-form-item
prop=
"password"
>
<el-input
type=
"password"
v-model=
"login.password"
placeholder=
"密码"
></el-input>
<el-input
type=
"password"
v-model=
"login.password"
placeholder=
"密码"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
<el-button
class=
"btn"
size=
"medium"
type=
"primary"
@
click=
"submitForm"
>
登录
</el-button>
<el-button
class=
"btn"
size=
"medium"
type=
"primary"
@
click=
"submitForm"
>
登录
</el-button>
<router-link
class=
"fr"
:to=
"
{name:'register'}"
>
<router-link
class=
"fr"
:to=
"
{name:'register'}"
>
班主任注册入口
班主任注册入口
</router-link>
</router-link>
<!--
<el-button
class=
"fr"
size=
"medium"
type=
"success"
@
click=
"goRegister"
>
去注册
</el-button>
-->
<!--
<el-button
class=
"fr"
size=
"medium"
type=
"success"
@
click=
"goRegister"
>
去注册
</el-button>
-->
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
loginApi
}
from
"../../service/api"
;
import
{
loginApi
}
from
"../../service/api"
;
import
md5
from
"js-md5"
;
import
md5
from
"js-md5"
;
export
default
{
data
()
{
return
{
login
:
{
username
:
""
,
password
:
""
},
loginRules
:
{
username
:
[
{
required
:
true
,
message
:
"请输入您的用户名"
,
trigger
:
"blur"
}
],
password
:
[
{
required
:
true
,
message
:
"请输入您的密码"
,
trigger
:
"blur"
}
]
}
};
},
mounted
()
{
let
that
=
this
;
document
.
onkeydown
=
keyDownSearch
;
function
keyDownSearch
(
e
)
{
// 兼容FF和IE和Opera
let
theEvent
=
e
||
window
.
event
;
let
code
=
theEvent
.
keyCode
||
theEvent
.
which
||
theEvent
.
charCode
;
if
(
code
===
13
&&
that
.
$route
.
name
===
"login"
)
{
that
.
submitForm
();
//具体处理函数
return
false
;
}
return
true
;
}
},
methods
:
{
// 提交
submitForm
()
{
this
.
$refs
[
"loginForm"
].
validate
(
valid
=>
{
if
(
valid
)
{
let
json
=
{
username
:
this
.
login
.
username
,
password
:
md5
(
this
.
login
.
password
)
};
// debugger
loginApi
(
json
).
then
(
res
=>
{
if
(
res
.
teacher_info
){
let
data
=
JSON
.
stringify
(
res
.
teacher_info
)
localStorage
.
setItem
(
"phoneNum"
,
data
)
}
else
{
localStorage
.
setItem
(
"phoneNum"
,
""
)
}
this
.
$store
.
dispatch
(
'setToken'
,
res
.
token
);
this
.
$store
.
dispatch
(
'setUserName'
,
res
.
desc
);
this
.
$store
.
dispatch
(
'setPermission'
,
JSON
.
parse
(
res
.
roles
.
menu_ids
));
// debugger
window
.
location
.
href
=
'/'
;
})
export
default
{
}
data
()
{
});
return
{
login
:
{
username
:
""
,
password
:
""
},
loginRules
:
{
username
:
[
{
required
:
true
,
message
:
"请输入您的用户名"
,
trigger
:
"blur"
}
],
password
:
[
{
required
:
true
,
message
:
"请输入您的密码"
,
trigger
:
"blur"
}
]
}
};
},
},
goRegister
(){
mounted
()
{
this
.
$router
.
push
({
let
that
=
this
;
name
:
"register"
document
.
onkeydown
=
keyDownSearch
;
})
function
keyDownSearch
(
e
)
{
// 兼容FF和IE和Opera
let
theEvent
=
e
||
window
.
event
;
let
code
=
theEvent
.
keyCode
||
theEvent
.
which
||
theEvent
.
charCode
;
if
(
code
===
13
&&
that
.
$route
.
name
===
"login"
)
{
that
.
submitForm
();
//具体处理函数
return
false
;
}
}
}
return
true
;
};
}
},
methods
:
{
// 提交
submitForm
()
{
this
.
$refs
[
"loginForm"
].
validate
(
valid
=>
{
if
(
valid
)
{
let
json
=
{
username
:
this
.
login
.
username
,
password
:
md5
(
this
.
login
.
password
)
};
// debugger
loginApi
(
json
).
then
(
res
=>
{
debugger
if
(
res
.
teacher_info
)
{
let
data
=
JSON
.
stringify
(
res
.
teacher_info
)
localStorage
.
setItem
(
"phoneNum"
,
data
)
}
else
{
localStorage
.
setItem
(
"phoneNum"
,
""
)
}
this
.
$store
.
dispatch
(
'setToken'
,
res
.
token
);
this
.
$store
.
dispatch
(
'setUserName'
,
res
.
desc
);
this
.
$store
.
dispatch
(
'setPermission'
,
JSON
.
parse
(
res
.
roles
.
menu_ids
));
// debugger
window
.
location
.
href
=
'/'
;
})
}
});
},
goRegister
()
{
this
.
$router
.
push
({
name
:
"register"
})
}
}
};
</
script
>
</
script
>
<
style
scoped
lang=
"less"
>
<
style
scoped
lang=
"less"
>
@import "../../util/public";
@import "../../util/public";
.login {
height: 100%;
.login {
background: linear-gradient(
height: 100%;
to bottom right,
background: linear-gradient(
to bottom right,
#ecec7c,
#ecec7c,
#787af4
#787af4); /* 标准的语法(必须放在最后) */
); /* 标准的语法(必须放在最后) */
}
.wrap-main {
width: 300px;
height: 180px;
padding: 50px 20px;
border-radius: 5px;
box-shadow: 8px 8px 15px rgba(49, 49, 49, 0.5);
position: fixed;
line-height: 50px;
background-color: rgba(255, 255, 255, 0.3);
top: 50%;
left: 50%;
margin-left: -200px;
margin-top: -200px;
.btn {
display: block;
width: 100%;
}
.title {
position: absolute;
top: -100px;
width: 100%;
text-align: center;
left: 0;
color: white;
font-size: 26px;
text-shadow: 6px 6px 3px rgba(49, 49, 49, 0.5);
}
}
.fr{float: right;margin-top: 10px;}
.wrap-main {
width: 300px;
height: 180px;
padding: 50px 20px;
border-radius: 5px;
box-shadow: 8px 8px 15px rgba(49, 49, 49, 0.5);
position: fixed;
line-height: 50px;
background-color: rgba(255, 255, 255, 0.3);
top: 50%;
left: 50%;
margin-left: -200px;
margin-top: -200px;
.btn {
display: block;
width: 100%;
}
.title {
position: absolute;
top: -100px;
width: 100%;
text-align: center;
left: 0;
color: white;
font-size: 26px;
text-shadow: 6px 6px 3px rgba(49, 49, 49, 0.5);
}
.fr {
float: right;
margin-top: 10px;
}
}
}
</
style
>
</
style
>
src/service/api.js
View file @
a3cb288f
...
@@ -1420,7 +1420,19 @@ export const postMediaConvertApi = function (json) {
...
@@ -1420,7 +1420,19 @@ export const postMediaConvertApi = function (json) {
export
const
getUpdateTimeApi
=
function
()
{
export
const
getUpdateTimeApi
=
function
()
{
return
Vue
.
prototype
.
$fetch
(
`
${
_baseUrl
}
api/admin/get/report/time`
)
return
Vue
.
prototype
.
$fetch
(
`
${
_baseUrl
}
api/admin/get/report/time`
)
};
};
// 获取佣金配置
// 获取佣金配置
列表
export
const
getBrokerageApi
=
function
()
{
export
const
getBrokerageApi
=
function
()
{
return
Vue
.
prototype
.
$fetch
(
`
${
_baseUrl
}
api/admin/bkge/config/list`
)
return
Vue
.
prototype
.
$fetch
(
`
${
_baseUrl
}
api/admin/bkge/config/list`
)
};
};
// 添加佣金配置
export
const
postBrokerageApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$post
(
`
${
_baseUrl
}
api/admin/bkge/config/add`
,
json
)
};
// 修改佣金配置
export
const
putBrokerageApi
=
function
(
id
,
json
)
{
return
Vue
.
prototype
.
$put
(
`
${
_baseUrl
}
api/admin/bkge/config/
${
id
}
`
,
json
)
};
// 删除佣金配置
export
const
deleteBrokerageApi
=
function
(
id
)
{
return
Vue
.
prototype
.
$del
(
`
${
_baseUrl
}
api/admin/bkge/config/
${
id
}
`
)
};
wq
deleted
100644 → 0
View file @
0ec5374b
Merge branch 'dev' of http://git.singsingenglish.com/new-sing/admin into dev
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
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