Commit accdc1ed authored by zhengke's avatar zhengke

修改

parent 1f3d81ef
......@@ -483,6 +483,31 @@ export function SetAssessmentType(data) {
})
}
/**
* 删除列表数据
* @param {*} data
*/
export function RemoveAssessmentType(data) {
return request({
url: '/TeacherAssessment/RemoveAssessmentType',
method: 'post',
data
})
}
/**
* 删除子类数据
* @param {*} data
*/
export function RemoveAssessmentSubtype(data) {
return request({
url: '/TeacherAssessment/RemoveAssessmentSubtype',
method: 'post',
data
})
}
......
......@@ -39,7 +39,8 @@
</div>
</div>
<div v-for="(item,index) in addMsg.SubtypeList" class="row wrap childConfig">
<q-btn size="10px" @click="delChild(index)" class="SubChild" round color="red" icon="iconfont icon-guanbi1" />
<q-btn size="10px" @click="delChild(item,index)" class="SubChild" round color="red"
icon="iconfont icon-guanbi1" />
<div class="col-12 q-pr-lg q-pb-lg">
<q-input filled v-model="item.SubTypeName" ref="SubTypeName" label="标题"></q-input>
</div>
......@@ -73,7 +74,8 @@
<script>
import {
SetAssessmentType,
GetAssessmentType
GetAssessmentType,
RemoveAssessmentSubtype
} from '../../api/teacher/index';
export default {
......@@ -102,17 +104,17 @@
initObj() {
if (this.saveObj && this.saveObj.Id > 0) {
let obj = {
Id:this.saveObj.Id
Id: this.saveObj.Id
}
GetAssessmentType(obj).then(res => {
if(res.Code==1){
if (res.Code == 1) {
this.addMsg = res.Data;
}
})
} else {
this.addMsg.Id=0;
this.addMsg.TypeName='';
this.addMsg.SubtypeList=[];
this.addMsg.Id = 0;
this.addMsg.TypeName = '';
this.addMsg.SubtypeList = [];
}
},
//关闭弹窗
......@@ -157,8 +159,25 @@
})
},
//删除子类
delChild(index) {
delChild(obj, index) {
console.log(obj, 'obj');
if (obj.Id > 0) {
let msg = {
Id:obj.Id
}
RemoveAssessmentSubtype(msg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据删除成功!',
position: 'top'
})
this.addMsg.SubtypeList.splice(index, 1);
}
})
}
},
//删除孙类
delSun(index1, index2) {
......
......@@ -47,6 +47,7 @@
<script>
import {
queryAssessmentTypeList,
RemoveAssessmentType
} from '../../api/teacher/index';
import assessForm from '../../components/teacher/assess-form'
export default {
......@@ -81,8 +82,8 @@
}
],
dataList: [],
objOption:null,
isShowAssess:false
objOption: null,
isShowAssess: false
}
},
created() {
......@@ -103,7 +104,7 @@
})
},
//新增修改
AddMsg(obj){
AddMsg(obj) {
if (obj) {
this.objOption = obj
} else {
......@@ -111,15 +112,50 @@
}
this.isShowAssess = true;
},
getClose(){
getClose() {
this.isShowAssess = false;
},
getRefresh(){
getRefresh() {
this.getAssessmentTypeList();
},
//删除数据
delConsult(Id) {
let that = this;
this.$q.dialog({
title: "提示",
message: '是否删除该配置?',
cancel: {
label: "取消",
flat: true
},
ok: {
label: "确认",
flat: true,
focus: true
}
}).onOk(() => {
let msg = {
Id: Id
}
RemoveAssessmentType(msg).then(res => {
if (res.Code == 1) {
that.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据删除成功!',
position: 'top'
})
that.getAssessmentTypeList();
}
})
});
}
}
}
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
</style>
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