Commit 232440eb authored by chenyishuai@singsingenglish.com's avatar chenyishuai@singsingenglish.com

Merge branch 'dev'

parents 708fe44f e985d1c5
......@@ -75,7 +75,7 @@ export default {
};
</script>
<style>
<style >
#app {
height: 100%;
}
......@@ -88,7 +88,24 @@ body {
.el-collapse-item__arrow {
margin-left: 0;
}
.fl {
float: left;
}
.fr {
float: right;
}
.clearfix {
*zoom: 1;
}
.clearfix:after {
content: "";
display: block;
height: 0;
visibility: hidden;
clear: both;
}
</style>
......@@ -34,8 +34,9 @@
label="班主任姓名">
<template slot-scope="scope">
<el-button type="text" @click="nameClick(scope.row,searchFirstFrom.dateValue)">
<!-- TOP{{scope.$index+1}}&nbsp;{{scope.row.teacher_name}} -->
{{scope.row.teacher_name}}
</el-button>
</el-button>
</template>
</el-table-column>
<el-table-column
......
......@@ -354,13 +354,13 @@ export default {
goods_type: "1,2"
};
getSourceStudentApi().then(res=>{
let obj = {}
res.forEach((item,index)=>{
obj[item.type]=item.name
})
studentSource = obj
console.log(obj)
});
let obj = {}
res.forEach((item,index)=>{
obj[item.type]=item.name
})
studentSource = obj
console.log(obj)
});
getGoodsListApi(json).then(res => {
console.log(res);
res.list.forEach(i => {
......
......@@ -305,6 +305,39 @@
</el-table>
</div>
</el-collapse-item>
<el-collapse-item title="设备列表" name="13">
<div>
<el-button @click="addTeacherType">
添加设备
</el-button>
<el-table
:data="teacherTypeList"
style="width: 100%">
<el-table-column
prop="name"
label="设备名称" >
</el-table-column>
<el-table-column
prop="type"
label="type" width='90'>
</el-table-column>
<el-table-column
label="操作"
min-width="150"
v-if="!$store.state.readonly">
<template slot-scope="scope">
<el-button
@click="initTeacherType(scope.row)"
type=""
plain
size="mini">
编辑
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</el-collapse-item>
</el-collapse>
</div>
<!-- <div class="item">
......@@ -363,6 +396,19 @@
<el-button type="primary" @click="editSourceStudent">确 定</el-button>
</span>
</el-dialog>
<el-dialog
:title="dialogTitle"
:visible.sync="teacherTypeDialog">
<el-form :model="formData" label-width="100px" inline>
<el-form-item label="设备名称" style="margin-left:10px;">
<el-input v-model="formData.name"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="teacherTypeDialog = false">取 消</el-button>
<el-button type="primary" @click="editTeacherType">确 定</el-button>
</span>
</el-dialog>
<el-dialog
:title="dialogTitle"
:visible.sync="yunjiDialog">
......@@ -410,6 +456,9 @@ import {
postSourceStudentApi,
putSourceStudentApi,
delSourceStudentApi,
getTeacherTypeListApi,
postTeacherTypeListApi,
putTeacherTypeListApi
} from "../../service/api";
import {GOODSTYPE,CLASSSOURCE} from '../../util/wordbook';
export default {
......@@ -428,6 +477,7 @@ export default {
sourceStudentDialog:false,
noticeDialog:false,
periodDialog:false,
teacherTypeDialog:false,
activeName: "1",
form: {
msg: ""
......@@ -470,7 +520,9 @@ export default {
yunjiList:[],
starList:[],
starV2List:[],
sourceStudentList:[]
sourceStudentList:[],
teacherTypeList:[],
goodsList:[]
};
},
mounted() {
......@@ -479,6 +531,33 @@ export default {
},
filters: {},
methods: {
initTeacherType(row){
this.dialogTitle ='编辑设备类型'
this.teacherTypeDialog = true
this.formData = row
},
addTeacherType(){
this.dialogTitle ='新增设备类型'
this.teacherTypeDialog = true
},
editTeacherType(){
if(this.dialogTitle=='新增设备类型'){
postTeacherTypeListApi({teacher_type_name:this.formData.name}).then(res=>{
getTeacherTypeListApi().then(res=>{
this.teacherTypeList=res
this.teacherTypeDialog = false
})
})
}else{
putTeacherTypeListApi({teacher_type_name:this.formData.name,type:this.formData.type}).then(res=>{
getTeacherTypeListApi().then(res=>{
this.teacherTypeList=res
this.teacherTypeDialog = false
})
})
}
},
initSource(row){
console.log(row)
this.formData = row
......@@ -762,32 +841,45 @@ export default {
// this.activeName = val.name;
if (val === "1") {
this.first();
}else if(val === "4"){
}
if(val === "4"){
this.four();
}else if(val === "5"){
}
if(val === "5"){
this.five();
}else if(val === "7"){
}
if(val === "7"){
this.seven();
}else if(val === "8"){
}
if(val === "8"){
this.eight();
}else if(val === "9"){
}
if(val === "9"){
getYunjiActivityPeriodApi().then(res =>{
this.yunjiList = res
// console.log(this.yunjiList)
})
}else if(val ==='10'){
}
if(val ==='10'){
getStarActivityPeriodApi().then(res =>{
this.starList= res
})
}else if(val ==='11'){
}
if(val ==='11'){
getStarActivityV2PeriodApi().then(res =>{
this.starV2List= res
})
}else if(val === '12'){
}
if(val === '12'){
getSourceStudentApi().then(res =>{
this.sourceStudentList= res
})
}
if(val === '13'){
getTeacherTypeListApi().then(res =>{
this.teacherTypeList= res
})
}
},
first() {
getConfigListApi({ key: "new_user_redirect" }).then(res => {
......
......@@ -255,7 +255,6 @@ export default {
];
}
},
propertyList: [],
spanArr: [],
contentSpanArr: [],
searchFrom: {
......
......@@ -21,6 +21,16 @@
</el-col>
</el-row>
</el-form-item>
<el-form-item label="招生来源">
<el-select v-model="newIntegral.source" placeholder="请选择" filterable>
<el-option
v-for="(data,index) in classSource"
:key="index"
:label="data.name"
:value="data.type" >
</el-option>
</el-select>
</el-form-item >
<el-form-item label="数量"
prop="num"
:rules="[{ required: true, message: '请输入数量', trigger: 'blur' }]">
......@@ -64,6 +74,7 @@
</template>
<script>
import {getSourceStudentApi} from "../../service/api";
export default {
name: "add",
data(){
......@@ -73,8 +84,14 @@
return time.getTime() < Date.now() - 8.64e7;
}
},
classSource:[]
}
},
created(){
getSourceStudentApi().then(res=>{
this.classSource = res
})
},
props:[
'newIntegral',
"goodsList"
......
......@@ -33,6 +33,9 @@
prop="num"
label="数量">
</el-table-column>
<el-table-column prop="source" label="招生来源">
<template slot-scope="scope">{{scope.row.source | classSourceFilter}}</template>
</el-table-column>
<el-table-column
prop="desc"
label="备注"
......@@ -60,11 +63,12 @@
</template>
<script>
import {getExchangeListApi,getGoodsListApi,addExchangeApi,editExchangeApi} from "../../service/api";
import {getExchangeListApi,getGoodsListApi,addExchangeApi,editExchangeApi,getSourceStudentApi} from "../../service/api";
import {INTEGRALTYPE,INTEGRALFUN} from "../../util/wordbook";
import page from '../framework/page'
import addExchange from './add'
import listDetail from './list'
let studentSource=[]
export default {
name: "index",
components: {
......@@ -72,6 +76,12 @@
addExchange,
listDetail
},
filters: {
classSourceFilter(val) {
// return CLASSSOURCE[val];
return studentSource[val];
},
},
data(){
let is_addOption = [];
for(let k in INTEGRALTYPE){
......@@ -96,7 +106,8 @@
num:'',
expire_at:'',
desc:'',
id:null
id:null,
source:''
},
goodsList:[],
is_addOption:is_addOption,
......@@ -133,6 +144,7 @@
desc:data.desc,
name:data.name,
id:data.id,
source:data.source
}
},
subEdit(){
......@@ -142,6 +154,7 @@
expire_at:this.newIntegral.expire_at,
desc:this.newIntegral.desc,
name:this.newIntegral.name,
source:this.newIntegral.source,
};
editExchangeApi(this.newIntegral.id,json).then(res=>{
this.$message({
......@@ -195,6 +208,14 @@
};
this.getGood();
this.getList()
getSourceStudentApi().then(res=>{
let obj = {}
res.forEach((item,index)=>{
obj[item.type]=item.name
})
studentSource = obj
console.log(obj)
});
},
getGood(){
getGoodsListApi({limit:1000}).then(res=>{
......
......@@ -81,9 +81,7 @@
</el-table-column>
</el-table>
<page :total="total" :limit="limit" @pageChange="onPageChange" @sizeChange="onSizeChange"/>
<el-dialog
:title="dialog.title"
:visible.sync="dialog.show">
<el-dialog :title="dialog.title" :visible.sync="dialog.show" width="500px">
<el-form ref="dialogForm" :rules="dialog.form.rules" :model="dialog.form" label-width="100px">
<el-form-item label="真实姓名:" prop="name">
......@@ -323,6 +321,12 @@
<style scoped lang="less">
@import "../../util/public";
.el-form {
.el-form-item:last-child {
margin-bottom: 0;
}
}
.avatar {
width: 50px;
margin-right: 5px;
......@@ -355,4 +359,8 @@
justify-content: flex-start;
align-items: center;
}
.page-div {
padding-top: 20px;
}
</style>
<template>
<el-dialog
title="添加员工"
center
append-to-body
:visible.sync="show"
width="800px">
<div v-loading="loading">
<el-form ref="form" :model="form" :rules="rules" >
<el-row>
<el-col :span="4"><label>Key</label></el-col>
<el-col :span="8">
<el-form-item prop="key">
<el-input v-model="form.key"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4"><label>关键词</label></el-col>
<el-col :span="8">
<el-form-item prop="value">
<el-input v-model="form.value"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4"><label>描述</label></el-col>
<el-col :span="8">
<el-form-item prop="desc">
<el-input v-model="form.desc" type="textarea"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="show = false">取 消</el-button>
<el-button type="primary" @click="save">确 定</el-button>
</span>
</div>
</el-dialog>
</template>
<script>
import {updateConfigApi,saveConfigApi} from "../../service/api";
import {TEACHERTYPE} from "../../util/wordbook";
import page from '../framework/page'
export default {
name: "dialogObj",
props:[
'dialogObj'
],
data(){
return{
show:false,
id: '',
loading:true,
form:{
key:'',
value:'',
desc:''
},
mediaList: [],
rules:{
value:[
{ required: true, message: '请输入关键词', trigger: 'change' }
],
desc:[
{ required: true, message: '请输入描述', trigger: 'change' }
],
key:[
{ required: true, message: '请输入Key', trigger: 'change' }
]
}
}
},
components:{
page
},
methods:{
save(){
if(this.dialogObj.id){
this.$refs['form'].validate((valid) => {
if(valid){
this.$confirm('此操作将修改该配置?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
updateConfigApi(this.id,this.form).then(res=>{
this.$message({
type: 'success',
message: '修改成功!'
});
this.$emit("reflash");
this.show = false;
})
})
}
});
}else{
this.$refs['form'].validate((valid) => {
if(valid){
this.$confirm('此操作将添加新配置?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
saveConfigApi(this.form).then(res=>{
this.$message({
type: 'success',
message: '新增成功!'
});
this.$emit("reflash");
this.show = false;
})
})
}
});
}
},
initDialog(){
this.show = this.dialogObj.show;
if (this.dialogObj.id) {
this.id = this.dialogObj.id;
}
this.form.key = this.dialogObj.key;
this.form.value = this.dialogObj.value;
this.form.desc = this.dialogObj.desc;
this.loading = false
}
},
watch:{
dialogObj:{
handler: function () {
this.loading = true;
this.initDialog()
},
deep: true
},
show(value){
this.$emit("changeShow",value);
}
}
}
</script>
<style scoped lang="less">
@import "../../util/public";
/*.el-col {*/
/*height: 50px;*/
/*text-align: center;*/
/*margin-bottom: 20px;*/
/*line-height: 40px;*/
/*.el-select{*/
/*width: 100%;*/
/*}*/
/*img{*/
/*width: 50px;*/
/*border-radius: 100px;*/
/*}*/
/*label{*/
/*color: #5982e6;*/
/*}*/
/*}*/
.dialog-footer{
display: block;
text-align: center;
margin-top: 30px;
}
.msg_sender_wrp {
display: flex;
flex-flow: row wrap;
justify-content: flex-start;
align-items: center;
/*position: absolute;*/
/*left: 100%;*/
/*top: 50%;*/
width: 500px;
/*z-index: 500;*/
/*-ms-transform: translateY(-50%);*/
/*transform: translateY(-50%);*/
/*background: #FFFFFF;*/
/*box-shadow: 0 1px 20px 0 #E4E8EB;*/
/*border-radius: 2px;*/
}
.el-icon-circle-plus-outline {
font-size: 28px;
}
.weui-desktop-msg-sender__tabs {
line-height: 38px;
background-color: #FFFFFF;
}
ul, ol {
padding-left: 0;
list-style-type: none;
}
.weui-desktop-msg-sender__tab {
padding: 0 15px;
float: left;
cursor: pointer;
}
.weui-desktop-msg-sender__tab_appmsg:before {
background: transparent url(https://mp.weixin.qq.com/mpres/en_US/htmledition/pages/modules/msg_sender/svg/default/sender_appmsg3f92fe.svg) no-repeat 0 0;
}
.weui-desktop-msg-sender__tab:before {
content: " ";
display: inline-block;
width: 22px;
height: 20px;
vertical-align: middle;
margin: -0.2em 5px 0 0;
}
.weui-desktop-msg-sender__tab_text:before {
background: transparent url(https://mp.weixin.qq.com/mpres/en_US/htmledition/pages/modules/msg_sender/svg/default/sender_text3f92fe.svg) no-repeat 0 0;
}
.weui-desktop-msg-sender__tab_img:before {
background: transparent url(https://mp.weixin.qq.com/mpres/en_US/htmledition/pages/modules/msg_sender/svg/default/sender_img3f92fe.svg) no-repeat 0 0;
}
.weui-desktop-msg-sender__tab_audio:before {
background: transparent url(https://mp.weixin.qq.com/mpres/en_US/htmledition/pages/modules/msg_sender/svg/default/sender_audio3f92fe.svg) no-repeat 0 0;
}
.weui-desktop-msg-sender__tab_video:before {
background: transparent url(https://mp.weixin.qq.com/mpres/en_US/htmledition/pages/modules/msg_sender/svg/default/sender_video3f92fe.svg) no-repeat 0 0;
}
</style>
<template>
<div class="user" v-loading="loading">
<el-form ref="searchFrom" :model="searchFrom" label-width="80px" inline>
<el-form-item label="设备名称">
<el-select
filterable placeholder="请选择" clearable
v-model="searchFrom.teacher_id" @change="getData" :disabled="!teacherList.length">
<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-item label="顾问名称">
<el-select
filterable placeholder="请选择" clearable
v-model="searchFrom.staff_id" @change="getData" :disabled="!staffList.length">
<el-option
v-for="(data,index) in staffList"
:key="index"
:label="data.name"
:value="data.id">
</el-option>
</el-select>
</el-form-item>
<!--<el-form-item label="入职日期">
<el-date-picker
v-model="startTime"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00','23:59:59']"
@change="onSearch">
</el-date-picker>
</el-form-item>-->
<el-form-item>
<el-button @click="getData" type="primary" plain>搜索</el-button>
</el-form-item>
</el-form>
<el-tabs v-model="searchFrom.type" type="card" style="background: white;padding-top: 10px" @tab-click="getData">
<el-tab-pane label="全部使用记录" name="-1"></el-tab-pane>
<el-tab-pane label="当前使用记录" name="1"></el-tab-pane>
<el-tab-pane label="历史使用记录" name="2"></el-tab-pane>
</el-tabs>
<el-table :data="tableData">
<el-table-column prop="id" label="ID"></el-table-column>
<el-table-column prop="teacher_name" label="设备名称"></el-table-column>
<el-table-column prop="staff_name" label="当前顾问"></el-table-column>
<el-table-column prop="start_at" label="设备开始使用时间"></el-table-column>
<el-table-column label="设备使用结束时间">
<template slot-scope="scope">
{{scope.row.over_at == '0000-00-00 00:00:00' ? '-' : scope.row.over_at}}
</template>
</el-table-column>
<el-table-column prop="created_at" label="创建时间"></el-table-column>
</el-table>
<page :total="total" :limit="limit" @pageChange="onPageChange" @sizeChange="onSizeChange"/>
</div>
</template>
<script>
import {getStaffRecordApi,getTeacherListApi,getStaffListApi} from "../../service/api";
import page from '../framework/page'
export default {
name: "index",
data() {
return {
searchFrom: {
type: '-1',
teacher_id: '',
staff_id: ''
},
teacherList: [],
staffList: [],
tableData: [],
total: 0,
nowPage: 1,
limit: 10,
loading: false
}
},
components: { page },
mounted() {
this.getTeacherList();
this.getStaffList();
this.getData()
},
methods: {
getTeacherList() {
let json = { page: 1, limit: 1000 };
getTeacherListApi(json).then(res => {
this.teacherList = res.list;
});
},
getStaffList() {
let json = { page: 1, limit: 1000 };
getStaffListApi(json).then(res => {
this.staffList = res.list;
});
},
getData() {
let json = {
limit: this.limit,
page: this.nowPage,
};
this.searchFrom.teacher_id ? json.teacher_id = this.searchFrom.teacher_id : '';
this.searchFrom.staff_id ? json.staff_id = this.searchFrom.staff_id : '';
this.searchFrom.type!=-1 ? json.type = this.searchFrom.type : '';
getStaffRecordApi(json).then(res => {
this.tableData = res.list;
this.total = res.total
});
},
onSearch(){
this.getData();
},
onPageChange(val) {
this.nowPage = val
this.getData()
},
onSizeChange(val) {
this.limit = val;
this.nowPage = 1;
this.getData()
},
}
}
</script>
<style lang="less" scoped>
.user {
height: 100%;
overflow: auto;
padding: 20px 0;
.btn-content {
text-align: center;
}
.page-div {
padding-top: 20px;
}
}
</style>
......@@ -48,8 +48,8 @@
<span v-if="type===1">{{teacherDetail.type}}</span>
<el-form-item v-if="type !== 1">
<el-select v-model="form.type" placeholder="请选择">
<el-option v-for="data in typeOption" :key="data.value" :label="data.label"
:value="data.value"></el-option>
<el-option v-for="data in dialogObj.teacherTypeList" :key="data.type" :label="data.name"
:value="data.type"></el-option>
</el-select>
</el-form-item>
</el-col>
......@@ -236,6 +236,7 @@
})
},
initDialog(){
console.log(this.dialogObj)
switch(this.dialogObj.type){
case 0:
this.title = '新增教师';
......
......@@ -33,7 +33,7 @@
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" plain @click="getUser" >搜索</el-button>
<el-button type="primary" plain @click="getUser">搜索</el-button>
</el-form-item>
<el-form-item v-if="$store.state.orderRefund">
<el-button type="success" plain @click="add">新增教师</el-button>
......@@ -53,15 +53,21 @@
width="250"
label="老师">
<template slot-scope="scope">
<a :href="scope.row.qr" target="_blank">
<img class="avatar" :src="scope.row.qr" alt="二维码">
</a>
<div>
老师名:{{scope.row.name}}
<br>
微信号:{{scope.row.alias}}
<br>
类别:{{scope.row.type | teacherType}}
<div style="display: flex;">
<a :href="scope.row.qr" target="_blank" class="clearfix">
<img class="avatar" :src="scope.row.qr" alt="二维码">
</a>
<div style="display: flex;">
老师名:{{scope.row.name}}
<br>
微信号:{{scope.row.alias}}
<br>
类别:{{scope.row.type | teacherType}}
<br>
顾问:{{scope.row.adviser}}
<br>
开始时间:{{scope.row.teacher_start}}
</div>
</div>
</template>
</el-table-column>
......@@ -147,19 +153,12 @@
width="100"
label="当月业绩">
</el-table-column>
<el-table-column
width="280"
label="操作">
<el-table-column width="320" label="操作">
<template slot-scope="scope">
<el-button size="mini" plain type="primary" @click="goToTeacherDetail(scope.row)">
查看详情
</el-button>
<el-button size="mini" plain type="warning" @click="edit(scope.row)" v-if="!$store.state.readonly">
编辑
</el-button>
<el-button size="mini" plain type="danger" @click="delTeacher(scope.row)" v-if="$store.state.deletePermission && !$store.state.readonly">
删除
</el-button>
<el-button size="mini" plain type="primary" @click="goToTeacherDetail(scope.row)">查看详情</el-button>
<el-button size="mini" plain type="warning" @click="edit(scope.row)" v-if="!$store.state.readonly">编辑</el-button>
<el-button size="mini" plain type="success" @click="transferToggle(scope.row)" v-if="!$store.state.readonly">移交</el-button>
<el-button size="mini" plain type="danger" @click="delTeacher(scope.row)" v-if="$store.state.deletePermission && !$store.state.readonly">删除</el-button>
</template>
</el-table-column>
</el-table>
......@@ -237,21 +236,67 @@
<teacher-detail :parentDetail="dialogDetail"></teacher-detail>
</div>
</el-dialog>
<el-dialog width="500px" :visible.sync="transfer.show">
<el-form ref="transferForm" :rules="transfer.form.rules" :model="transfer.form" label-width="100px">
<el-form-item label="当前设备:" prop="teacher_name">
{{transfer.form.teacher_name}}
</el-form-item>
<el-form-item label="当前顾问:" prop="staff_current_name">
{{transfer.form.staff_current_name}}
</el-form-item>
<el-form-item label="移交顾问:" prop="staff_id">
<el-select v-model="transfer.form.staff_id" filterable placeholder="请选择" :clearable="false" @change="transferStaffName">
<el-option
v-for="(data,index) in transfer.staff"
:key="index"
:label="data.name"
:value="data.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="移交时间:" prop="transfer_at">
<el-date-picker
v-model="transfer.form.transfer_at" type="date" value-format="yyyy-MM-dd" :clearable="false" placeholder="选择日期"></el-date-picker>
</el-form-item>
</el-form>
<div slot="footer">
<el-button @click="transferToggle">取消</el-button>
<el-button type="primary" @click="transferSave">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {getTeacherListApi,delTeacherApi} from "../../service/api";
import {getTeacherListApi,delTeacherApi,getStaffListApi,postTransferTeacherApi} from "../../service/api";
import {TEACHERTYPE} from "../../util/wordbook";
import page from '../framework/page'
import teacherDetail from '../teacherDetail/index'
import dialogCom from './dialog'
import Dialog from "../class/dialog";
let teacherTypeSource = {}
export default {
name: "index",
data(){
let nowDate = this.formatTime(new Date());
return {
transfer: {
show: false,
form: {
teacher_name: '',
teacher_id: '',
staff_current_name: '', // 当前顾问名
staff_name: '', // 移交顾问name
staff_id: '', // 移交顾问id
transfer_at: '',
rules: {
staff_id: [{required: true, message: '请选择', trigger: 'change'}],
transfer_at: [{required: true, message: '请选择', trigger: 'change'}],
},
},
staff: [0]
},
searchFrom:{
name:'',
alias:"",
......@@ -307,7 +352,7 @@
},
filters:{
teacherType(value){
return TEACHERTYPE[value]
return teacherTypeSource[value]
}
},
mounted(){
......@@ -324,6 +369,15 @@
}else{
this.getUser()
}
getTeacherTypeListApi().then(res=>{
this.dialogObj.teacherTypeList = res
let obj = {}
res.forEach((item,index)=>{
obj[item.type]=item.name
})
teacherTypeSource = obj
console.log(obj)
});
},
methods:{
onPageChange(val){
......@@ -380,6 +434,67 @@
this.res=res;
})
},
transferStaffName(data) {
this.transfer.form.staff_name = this.transfer.staff.find(x => x.id == data).name;
},
transferToggle(data) {
this.transfer.show = !this.transfer.show;
if (this.transfer.show){
if (this.transfer.staff[0] === 0) {
let json = { limit: 1000, page: 1 };
getStaffListApi(json).then(res => {
this.transfer.staff = res.list;
});
}
this.$nextTick(()=>{
this.$refs['transferForm'].resetFields();
this.transfer.form.teacher_name = data.name;
this.transfer.form.teacher_id = data.id;
this.transfer.form.staff_current_name = data.adviser;
})
} else {
this.$nextTick(()=>{
this.$refs['transferForm'].resetFields();
})
}
},
transferSave() {
this.$refs['transferForm'].validate((valid) => {
if (valid) {
this.$confirm(`确认将
${this.transfer.form.teacher_name} 移交给
${this.transfer.form.staff_name} 移交开始时间
${this.transfer.form.transfer_at}`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var json = {
teacher_id: this.transfer.form.teacher_id,
staff_id: this.transfer.form.staff_id,
transfer_at: this.transfer.form.transfer_at,
};
postTransferTeacherApi(json).then(res => {
this.$message({type: 'success', message: '移交成功!'});
this.transferToggle();
this.getUser();
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消移交'
});
});
} else {
console.log('error submit!!');
return false;
}
});
},
edit(data){
this.dialogObj.id = data.id;
this.dialogObj.type = 2;
......@@ -462,9 +577,9 @@
min-width: 80px;
width: 80px;
}
&>div:nth-child(6){
min-width: 280px;
width: 280px;
&>div:nth-child(7){
min-width: 320px + 12px;
width: 320px + 12px;
}
&>div:nth-child(2),
......
......@@ -6,7 +6,7 @@
<span>
<label>{{detail.type | teacherType}}</label> {{detail.name}}(T{{detail.squad}}
</span>
<el-button style="float: right;" size="small" type="success" v-if="!$store.state.readonly" plain @click="onAddUser(true)">老师绑定用户</el-button>
<el-button style="float: right;margin-top: -6px;" size="small" type="success" v-if="!$store.state.readonly" plain @click="onAddUser(true)">老师绑定用户</el-button>
</div>
<div class="card-content">
<div class="text item">
......@@ -14,12 +14,22 @@
<img :src="detail.qr"/>
</a>
</div>
<div class="text item">
<label>微信号:</label> {{detail.alias}}
<br>
<label>带班总人数:</label>{{detail.total_join_num}}
<br>
<label>老师状态:</label>{{detail.status === 0 ? '正常' : '禁用'}}
<div class="text item style-fix">
<span>
<label>微信号:</label> {{detail.alias}}
</span>
<span>
<label>带班总人数:</label>{{detail.total_join_num}}
</span>
<span>
<label>老师状态:</label>{{detail.status === 0 ? '正常' : '禁用'}}
</span>
<span>
<label>顾问:</label>{{detail.adviser}}
</span>
<span>
<label>开始时间:</label>{{detail.teacher_start}}
</span>
</div>
</div>
</el-card>
......@@ -1158,6 +1168,15 @@
label{
width: 120px;
}
&.style-fix {
/*display: flex;
flex-direction: column;
justify-content: space-between;*/
line-height: 25px;
span {
display: block;
}
}
}
.el-card{
/*height: 50px;*/
......
......@@ -80,6 +80,10 @@ const delTeacherUrl = `${_baseUrl}api/admin/teacher`;
export const delTeacherApi = function (id) {
return Vue.prototype.$del(`${delTeacherUrl}/${id}`)
};
//设备移交
export const postTransferTeacherApi = function (json) {
return Vue.prototype.$post(`${_baseUrl}api/admin/teacher/transfer`, json)
};
//获取课程列表
const getLessonUrl = `${_baseUrl}api/admin/course/list`;
export const getLessonApi = function (json) {
......@@ -1254,14 +1258,30 @@ export const putSourceStudentApi = function (type,json) {
return Vue.prototype.$put(`${_baseUrl}api/admin/source/student/edit/${type}`,json)
};
// /api/admin/source/student/list
//员工
// 获取员工列表
export const getStaffListApi = function (json) {
return Vue.prototype.$fetch(`${_baseUrl}api/admin/staff/list`, json)
};
// 添加员工
export const postStaffListApi = function (json) {
console.log(json)
return Vue.prototype.$post(`${_baseUrl}api/admin/staff/add`, json)
};
// 编辑员工
export const putStaffListApi = function (json) {
return Vue.prototype.$put(`${_baseUrl}api/admin/staff/edit/${json.id}`, json)
};
// 设备监管记录
export const getStaffRecordApi = function (json) {
return Vue.prototype.$fetch(`${_baseUrl}api/admin/staff/relation/list`, json)
};
// 系统配置设备
export const getTeacherTypeListApi = function (json) {
return Vue.prototype.$fetch(`${_baseUrl}api/admin/teacher/type/list`, json)
};
export const postTeacherTypeListApi = function (json) {
return Vue.prototype.$post(`${_baseUrl}api/admin/teacher/type/add`, json)
};
export const putTeacherTypeListApi = function (json) {
return Vue.prototype.$put(`${_baseUrl}api/admin/teacher/type/edit/${json.type}`, json)
};
//teacher/type/list
\ No newline at end of file
......@@ -619,6 +619,17 @@ export default [{
component: e => require(['@/components/smsRecord'], e),
}
},
{
value: '设备监管记录',
routerName: 'staffRecord',
path: '/staffRecord',
cover: '10-7',
router: {
path: '/staffRecord',
name: 'staffRecord',
component: e => require(['@/components/system/staffRecord'], e),
}
},
{
value: '员工管理',
routerName: 'staff',
......
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