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
Show 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 @@
font-size: 14px;
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
>
src/components/brokerage/index.vue
View file @
a3cb288f
...
...
@@ -2,17 +2,55 @@
<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"
>
<ul
class=
"tab-content"
>
<ul>
<li
v-for=
"item2 in item1.children"
class=
"brokerage-item"
>
<div
class=
"brokerage-item-header clearfix"
>
{{
filterName
(
item2
.
value
,
'BROKERAGE_COURSE_TYPE'
)
}}
<el-button
type=
"success"
plain
>
新增
</el-button>
<!--
<el-table>
<el-table-column
label=
"ID"
></el-table-column>
</el-table>
-->
<el-button
@
click=
"itemAdd(item1.value, item2.value)"
class=
"fr"
type=
"success"
plain
size=
"small"
>
新增
</el-button>
</div>
<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>
</ul>
...
...
@@ -25,13 +63,14 @@
</template>
<
script
>
import
{
getBrokerageApi
}
from
'@/service/api'
;
import
{
getBrokerageApi
,
deleteBrokerageApi
,
postBrokerageApi
,
putBrokerageApi
}
from
'@/service/api'
;
import
{
BROKERAGE_COURSE_TYPE
}
from
'@/util/wordbook'
;
export
default
{
name
:
"index"
,
data
()
{
return
{
loading
:
true
,
type
:
'1'
,
BROKERAGE_COURSE_TYPE
:
BROKERAGE_COURSE_TYPE
,
list
:
[{
...
...
@@ -39,14 +78,20 @@
value
:
'1'
,
children
:
[{
label
:
'试听课来源-转年课业绩'
,
money
:
'业绩区间'
,
scale
:
'提点比例'
,
value
:
'1'
,
data
:
[]
},
{
label
:
'月课、季课来源-转年课业绩'
,
money
:
'业绩区间'
,
scale
:
'提点比例'
,
value
:
'2'
,
data
:
[]
},
{
label
:
'年课来源 - 转两年课业绩提点配置'
,
money
:
'业绩区间'
,
scale
:
'提点比例'
,
value
:
'3'
,
data
:
[]
}]
...
...
@@ -55,14 +100,20 @@
value
:
'2'
,
children
:
[{
label
:
'主管业绩提点'
,
money
:
'业绩完成率'
,
scale
:
'提点比例'
,
value
:
'4'
,
data
:
[]
},
{
label
:
'主管转化率系数(试听课)'
,
money
:
'团队转化率'
,
scale
:
'转化系数'
,
value
:
'5'
,
data
:
[]
},
{
label
:
'主管转化率系数(月课、季课)'
,
money
:
'团队转化率'
,
scale
:
'转化系数'
,
value
:
'6'
,
data
:
[]
}]
...
...
@@ -79,6 +130,76 @@
}).
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
()
{
getBrokerageApi
().
then
(
res
=>
{
if
(
res
.
list
&&
res
.
list
.
length
)
{
...
...
@@ -87,15 +208,14 @@
var
idx1
=
this
.
list
.
findIndex
(
item1
=>
{
return
item1
.
value
==
val1
[
0
].
sale_type
})
this
.
list
[
idx1
].
children
.
forEach
(
val2
=>
{
var
idx2
=
this
.
list
[
idx1
].
children
.
findIndex
(
item2
=>
{
return
item2
.
value
==
val1
[
0
].
course_type
})
this
.
list
[
idx1
].
children
[
idx2
].
data
=
val1
;
})
}
})
console
.
log
(
this
.
list
)
this
.
loading
=
false
;
}
})
}
...
...
@@ -105,12 +225,13 @@
<
style
lang=
"less"
>
.brokerage {
.tab-content {
.brokerage-item {
margin: 0 10px 10px;
padding: 10px;
background-color: #fff;
.brokerage-item-header {
padding-bottom: 10px;
}
.brokerage-item {
}
}
</
style
>
src/components/login/index.vue
View file @
a3cb288f
...
...
@@ -11,7 +11,7 @@
</el-form-item>
<el-form-item>
<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>
<!--
<el-button
class=
"fr"
size=
"medium"
type=
"success"
@
click=
"goRegister"
>
去注册
</el-button>
-->
...
...
@@ -22,9 +22,10 @@
</
template
>
<
script
>
import
{
loginApi
}
from
"../../service/api"
;
import
md5
from
"js-md5"
;
export
default
{
import
{
loginApi
}
from
"../../service/api"
;
import
md5
from
"js-md5"
;
export
default
{
data
()
{
return
{
login
:
{
...
...
@@ -33,10 +34,10 @@ export default {
},
loginRules
:
{
username
:
[
{
required
:
true
,
message
:
"请输入您的用户名"
,
trigger
:
"blur"
}
{
required
:
true
,
message
:
"请输入您的用户名"
,
trigger
:
"blur"
}
],
password
:
[
{
required
:
true
,
message
:
"请输入您的密码"
,
trigger
:
"blur"
}
{
required
:
true
,
message
:
"请输入您的密码"
,
trigger
:
"blur"
}
]
}
};
...
...
@@ -44,6 +45,7 @@ export default {
mounted
()
{
let
that
=
this
;
document
.
onkeydown
=
keyDownSearch
;
function
keyDownSearch
(
e
)
{
// 兼容FF和IE和Opera
let
theEvent
=
e
||
window
.
event
;
...
...
@@ -61,20 +63,21 @@ export default {
this
.
$refs
[
"loginForm"
].
validate
(
valid
=>
{
if
(
valid
)
{
let
json
=
{
username
:
this
.
login
.
username
,
password
:
md5
(
this
.
login
.
password
)
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"
,
""
)
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
));
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
=
'/'
;
...
...
@@ -82,26 +85,26 @@ export default {
}
});
},
goRegister
()
{
goRegister
()
{
this
.
$router
.
push
({
name
:
"register"
name
:
"register"
})
}
}
};
};
</
script
>
<
style
scoped
lang=
"less"
>
@import "../../util/public";
.login {
@import "../../util/public";
.login {
height: 100%;
background: linear-gradient(
to bottom right,
background: linear-gradient(to bottom right,
#ecec7c,
#787af4
); /* 标准的语法(必须放在最后) */
}
.wrap-main {
#787af4
); /* 标准的语法(必须放在最后) */
}
.wrap-main {
width: 300px;
height: 180px;
padding: 50px 20px;
...
...
@@ -114,10 +117,12 @@ export default {
left: 50%;
margin-left: -200px;
margin-top: -200px;
.btn {
display: block;
width: 100%;
}
.title {
position: absolute;
top: -100px;
...
...
@@ -128,6 +133,10 @@ export default {
font-size: 26px;
text-shadow: 6px 6px 3px rgba(49, 49, 49, 0.5);
}
.fr{float: right;margin-top: 10px;}
.fr {
float: right;
margin-top: 10px;
}
}
</
style
>
src/service/api.js
View file @
a3cb288f
...
...
@@ -1420,7 +1420,19 @@ export const postMediaConvertApi = function (json) {
export
const
getUpdateTimeApi
=
function
()
{
return
Vue
.
prototype
.
$fetch
(
`
${
_baseUrl
}
api/admin/get/report/time`
)
};
// 获取佣金配置
// 获取佣金配置
列表
export
const
getBrokerageApi
=
function
()
{
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