Commit accdc1ed authored by zhengke's avatar zhengke

修改

parent 1f3d81ef
...@@ -483,6 +483,31 @@ export function SetAssessmentType(data) { ...@@ -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 @@ ...@@ -39,7 +39,8 @@
</div> </div>
</div> </div>
<div v-for="(item,index) in addMsg.SubtypeList" class="row wrap childConfig"> <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"> <div class="col-12 q-pr-lg q-pb-lg">
<q-input filled v-model="item.SubTypeName" ref="SubTypeName" label="标题"></q-input> <q-input filled v-model="item.SubTypeName" ref="SubTypeName" label="标题"></q-input>
</div> </div>
...@@ -73,7 +74,8 @@ ...@@ -73,7 +74,8 @@
<script> <script>
import { import {
SetAssessmentType, SetAssessmentType,
GetAssessmentType GetAssessmentType,
RemoveAssessmentSubtype
} from '../../api/teacher/index'; } from '../../api/teacher/index';
export default { export default {
...@@ -102,17 +104,17 @@ ...@@ -102,17 +104,17 @@
initObj() { initObj() {
if (this.saveObj && this.saveObj.Id > 0) { if (this.saveObj && this.saveObj.Id > 0) {
let obj = { let obj = {
Id:this.saveObj.Id Id: this.saveObj.Id
} }
GetAssessmentType(obj).then(res => { GetAssessmentType(obj).then(res => {
if(res.Code==1){ if (res.Code == 1) {
this.addMsg = res.Data; this.addMsg = res.Data;
} }
}) })
} else { } else {
this.addMsg.Id=0; this.addMsg.Id = 0;
this.addMsg.TypeName=''; this.addMsg.TypeName = '';
this.addMsg.SubtypeList=[]; this.addMsg.SubtypeList = [];
} }
}, },
//关闭弹窗 //关闭弹窗
...@@ -157,8 +159,25 @@ ...@@ -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); this.addMsg.SubtypeList.splice(index, 1);
}
})
}
}, },
//删除孙类 //删除孙类
delSun(index1, index2) { delSun(index1, index2) {
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
<script> <script>
import { import {
queryAssessmentTypeList, queryAssessmentTypeList,
RemoveAssessmentType
} from '../../api/teacher/index'; } from '../../api/teacher/index';
import assessForm from '../../components/teacher/assess-form' import assessForm from '../../components/teacher/assess-form'
export default { export default {
...@@ -81,8 +82,8 @@ ...@@ -81,8 +82,8 @@
} }
], ],
dataList: [], dataList: [],
objOption:null, objOption: null,
isShowAssess:false isShowAssess: false
} }
}, },
created() { created() {
...@@ -103,7 +104,7 @@ ...@@ -103,7 +104,7 @@
}) })
}, },
//新增修改 //新增修改
AddMsg(obj){ AddMsg(obj) {
if (obj) { if (obj) {
this.objOption = obj this.objOption = obj
} else { } else {
...@@ -111,15 +112,50 @@ ...@@ -111,15 +112,50 @@
} }
this.isShowAssess = true; this.isShowAssess = true;
}, },
getClose(){ getClose() {
this.isShowAssess = false; this.isShowAssess = false;
}, },
getRefresh(){ getRefresh() {
this.getAssessmentTypeList(); 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> </script>
<style lang="sass"> <style lang="sass">
@import url('~assets/css/table.sass') @import url('~assets/css/table.sass')
</style> </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