Commit 4813bb0c authored by 赵茹林's avatar 赵茹林

Merge branch 'dev' into pre

parents d1e35cb7 1bb622e8
......@@ -89,6 +89,12 @@
padding: 0;
}
ol, ul {
margin: 0;
padding: 0;
list-style: none;
}
.el-collapse-item__arrow {
margin-left: 0;
}
......@@ -288,4 +294,29 @@
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;
}
}
// 修复样式
.el-tree-node__content {
.el-checkbox {
margin-right: 8px !important;
}
}
</style>
<template>
<div class="brokerage">
<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>
<li v-for="item2 in item1.children" class="brokerage-item">
<div class="brokerage-item-header clearfix">
{{filterName(item2.value, 'BROKERAGE_COURSE_TYPE')}}
<el-button
v-if="!$store.state.readonly"
@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
v-if="!$store.state.readonly"
:disabled="!((typeof scope.row.min_money == 'number') && (typeof scope.row.max_money == 'number') && (typeof scope.row.scale == 'number'))"
size="small" plain type="primary" @click="itemSave(scope.row)">保存</el-button>
<el-button
v-if="!$store.state.readonly && $store.state.deletePermission"
size="small" plain type="danger" @click="itemDelete(scope.row)">删除</el-button>
</div>
</template>
</el-table-column>
</el-table>
</li>
</ul>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
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: [{
label: '顾问',
value: '1',
children: [{
label: '试听课来源-转年课业绩',
money: '业绩区间',
scale: '提点比例',
value: '1',
data: []
}, {
label: '月课、季课来源-转年课业绩',
money: '业绩区间',
scale: '提点比例',
value: '2',
data: []
}, {
label: '年课来源 - 转两年课业绩提点配置',
money: '业绩区间',
scale: '提点比例',
value: '3',
data: []
}]
}, {
label: '主管',
value: '2',
children: [{
label: '主管业绩提点',
money: '业绩完成率',
scale: '提点比例',
value: '4',
data: []
}, {
label: '主管转化率系数(试听课)',
money: '团队转化率',
scale: '转化系数',
value: '5',
data: []
}, {
label: '主管转化率系数(月课、季课)',
money: '团队转化率',
scale: '转化系数',
value: '6',
data: []
}]
}]
}
},
mounted() {
this.getData();
},
methods: {
filterName(string, type) {
return this[type].find(i => {
return i.value == string
}).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) {
res.list.forEach(val1 => {
if (val1 && val1.length) {
var idx1 = this.list.findIndex(item1 => {
return item1.value == val1[0].sale_type
})
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;
}
})
}
}
}
</script>
<style lang="less">
.brokerage {
.brokerage-item {
margin: 0 10px 10px;
padding: 10px;
background-color: #fff;
.brokerage-item-header {
padding-bottom: 10px;
line-height: 32px;
color: #333333;
font-size: 16px;
}
}
}
</style>
<template>
<div class="login">
<div class="wrap-main">
<h1 class="title">唱唱启蒙——后台管理系统</h1>
<el-form :model="login" :rules="loginRules" ref="loginForm">
<el-form-item prop="username">
<el-input v-model="login.username" placeholder="用户名"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input type="password" v-model="login.password" placeholder="密码"></el-input>
</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'}" >
<div class="login">
<div class="wrap-main">
<h1 class="title">唱唱启蒙——后台管理系统</h1>
<el-form :model="login" :rules="loginRules" ref="loginForm">
<el-form-item prop="username">
<el-input v-model="login.username" placeholder="用户名"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input type="password" v-model="login.password" placeholder="密码"></el-input>
</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>
<!-- <el-button class="fr" size="medium" type="success" @click="goRegister">去注册</el-button> -->
</el-form-item>
</el-form>
</div>
<!-- <el-button class="fr" size="medium" type="success" @click="goRegister">去注册</el-button> -->
</el-form-item>
</el-form>
</div>
</div>
</template>
<script>
import { loginApi } from "../../service/api";
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 = '/';
import {loginApi} from "../../service/api";
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"}
]
}
};
},
goRegister(){
this.$router.push({
name:"register"
})
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 = '/';
})
}
});
},
goRegister() {
this.$router.push({
name: "register"
})
}
}
};
</script>
<style scoped lang="less">
@import "../../util/public";
.login {
height: 100%;
background: linear-gradient(
to bottom right,
@import "../../util/public";
.login {
height: 100%;
background: linear-gradient(to bottom right,
#ecec7c,
#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);
#787af4); /* 标准的语法(必须放在最后) */
}
.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>
......@@ -10,7 +10,7 @@
<el-form-item>
<div class="search-btn-wrapper">
<!--<el-button @click="onSearch" type="primary" plain>搜索</el-button>-->
<el-button @click="dialogUser.show = !dialogUser.show;" type="warning" plain>高级搜索</el-button>
<el-button @click="advancedOpen" type="warning" plain>高级搜索</el-button>
<!--<el-button v-if="!$store.state.readonly" @click="onAdd" type="success" plain>新增标签</el-button>-->
</div>
</el-form-item>
......@@ -73,6 +73,7 @@
<div style="display: flex;margin-bottom: 20px;">
<el-button style="margin-right: 20px; width: 70px;" type="primary" v-if="!$store.state.readonly && $store.state.export" plain :disabled="!tableData.length" @click="exportExcel">导出</el-button>
<el-cascader
v-model="tagValue"
style="width: calc(100% - 90px)" placeholder="选择标签" clearable @change="conditionsChange"
:options="treeDataOrigin" :props="{ value: 'id', label: 'name', multiple: true, checkStrictly: true }"></el-cascader>
</div>
......@@ -106,6 +107,8 @@
tagExpanded: [0],
tagExpandedWait: '',
tagValue: [], // 用于清空
tableData: [],
treeData: [],
treeDataOrigin: [],
......@@ -171,7 +174,8 @@
page: this.nowPage
}
getTagUserApi(json).then(res=>{
this.tableData = res.list
this.tableData = res.list;
this.total = res.total;
})
},
......@@ -191,12 +195,9 @@
},
dialogReset(callback) {
this.$nextTick(()=>{
this.$refs['dialogForm'].resetFields();
//this.$nextTick(()=>{
callback && callback();
//})
//this.dialog.form.id = '';
//this.dialog.form.pid = '';
this.conditions = arr;
this.tableData = [];
this.total = 0
})
},
dialogSave() {
......@@ -300,9 +301,18 @@
} else {
this.conditions = arr;
this.tableData = [];
this.total = 0
}
},
advancedOpen() {
this.tagValue = [];
this.conditions = [];
this.tableData = [];
this.total = 0;
this.dialogUser.show = !this.dialogUser.show
},
exportExcel() {
let json = {
conditions: JSON.stringify(this.conditions),
......
......@@ -1420,3 +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}`)
};
......@@ -162,7 +162,17 @@ export default [{
name: 'talkingSkill',
component: e => require(['@/components/talkingSkill'], e),
}
},]
}, {
value: '佣金配置',
routerName: 'brokerage',
path: '/brokerage',
cover: '11-8',
router: {
path: '/brokerage',
name: 'brokerage',
component: e => require(['@/components/brokerage'], e),
}
},]
},
{
name: '',
......
......@@ -282,3 +282,23 @@ export const STAFF_TYPE = [{
label: '增长',
value: 4
}];
export const BROKERAGE_COURSE_TYPE = [{
label: '试听课来源-转年课业绩',
value: 1
}, {
label: '月课、季课来源-转年课业绩',
value: 2
}, {
label: '年课来源 - 转两年课业绩提点配置',
value: 3
}, {
label: '主管业绩提点',
value: 4
}, {
label: '主管转化率系数(试听课)',
value: 5
}, {
label: '主管转化率系数(月课、季课)',
value: 6
}];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment