82

parent 70a4cb9f
......@@ -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 => {
......
......@@ -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=>{
......
......@@ -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 = '新增教师';
......
......@@ -241,12 +241,13 @@
</template>
<script>
import {getTeacherListApi,delTeacherApi} from "../../service/api";
import {getTeacherListApi,delTeacherApi,getTeacherTypeListApi} 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(){
......@@ -307,7 +308,7 @@
},
filters:{
teacherType(value){
return TEACHERTYPE[value]
return teacherTypeSource[value]
}
},
mounted(){
......@@ -324,6 +325,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){
......
......@@ -1259,9 +1259,18 @@ 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 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
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