You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

361 lines
10 KiB

<template>
<div class="app-container">
<div v-show="viewState == 1">
<el-tabs
class="my-tabs"
v-model="activeName"
type="card"
@tab-click="handleClick"
>
<el-tab-pane label="自主学习计划" name="roleList">
<div class="container">
<el-table :data="tableData" border style="width: 100%">
<el-table-column
label="序号"
width="70px"
type="index"
align="center"
>
</el-table-column>
<el-table-column label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button
type="primary"
size="mini"
@click="editRow(scope.row)"
>
编辑
</el-button>
<el-button
type="danger"
size="mini"
@click.native.prevent="deleteRow(scope.row)"
>
删除
</el-button>
<!-- <el-button type="primary" size="mini" @click="detail(scope.row)">
查看
</el-button> -->
</template>
</el-table-column>
<el-table-column
prop="teacherNo"
label="教师工号"
align="center"
/>
<el-table-column
prop="studentNo"
label="学生学号"
align="center"
/>
<el-table-column
prop="planContent"
label="学习计划"
align="center"
/>
<el-table-column
prop="stateChinese"
label="数据状态"
align="center"
/>
<el-table-column label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button
type="primary"
size="mini"
@click="tijiao(scope.row)"
>
提交
</el-button>
</template>
</el-table-column>
<el-table-column
prop="planOpinion"
label="反馈意见"
align="center"
/>
</el-table>
</div>
</el-tab-pane>
<el-tab-pane label="新增计划" name="addrole">
<table class="e-table" cellspacing="0">
<tr>
<td>教师工号</td>
<td>
<el-select
v-model="form.teacherNo"
class="addinputw"
placeholder="请选择学习计划"
style="width: 300px"
>
<el-option
v-for="(item, i) in formList"
:key="i"
:label="item.name"
:value="item.userName"
/>
</el-select>
</td>
</tr>
<tr>
<td>学生学号</td>
<td>
<el-input
v-model="form.studentNo"
style="width: 300px"
></el-input>
</td>
</tr>
<tr>
<td>学习计划内容</td>
<td>
<el-input
v-model="form.planContent"
style="width: 300px"
></el-input>
</td>
</tr>
</table>
<div style="margin-top: 20px; text-align: center">
<el-button type="primary" @click="save()">保存</el-button>
</div>
</el-tab-pane>
<el-dialog
:title="dialogTitle + '学习计划'"
:visible.sync="editDialog"
width="40%"
>
<table class="e-table" cellspacing="0">
<tr>
<td>教师工号</td>
<td>
<el-input
v-model="form.teacherNo"
style="width: 300px"
></el-input>
</td>
</tr>
<tr>
<td>学生学号</td>
<td>
<!-- <span>{{form.studentNo}}</span> -->
<el-input
v-model="form.studentNo"
style="width: 300px"
></el-input>
</td>
</tr>
<tr>
<td>学习计划内容</td>
<td>
<!-- <span>{{form.planContent}}</span> -->
<el-input
v-model="form.planContent"
style="width: 300px"
></el-input>
</td>
</tr>
</table>
<div style="margin-top: 20px; text-align: center">
<el-button type="primary" @click="save()">保存</el-button>
</div>
</el-dialog>
<el-dialog
:title="dialogTitle + '学习计划'"
:visible.sync="editDialog1"
width="40%"
>
<table class="e-table" cellspacing="0">
<tr>
<td>教师工号</td>
<td>
<el-select
v-model="form.teacherNo"
class="addinputw"
placeholder="请选择学习计划"
style="width: 300px"
>
<el-option
v-for="(item, i) in formList"
:key="i"
:label="item.name"
:value="item.userName"
/>
</el-select>
</td>
</tr>
<tr>
<td>学生学号</td>
<td>
<!-- <span>{{form.studentNo}}</span> -->
<el-input
v-model="form.studentNo"
style="width: 300px"
></el-input>
</td>
</tr>
<tr>
<td>学习计划内容</td>
<td>
<!-- <span>{{form.planContent}}</span> -->
<el-input
v-model="form.planContent"
style="width: 300px"
></el-input>
</td>
</tr>
</table>
<div style="margin-top: 20px; text-align: center">
<el-button type="primary" @click="save1()">保存</el-button>
</div>
</el-dialog>
</el-tabs>
</div>
<!-- <organizationManageInfo v-show="viewState ==4" ref="divInfo" @doback="resetState" /> -->
</div>
</template>
<script>
import {
selectSysPlanXs,
alterSysPlant,
saveSysPlan,
deleteSysPlan,
upSysPlan,
selectTeacher,
} from "@/api/system/region/region.js";
// import organizationManageInfo from './organizationManageInfo.vue'
export default {
components: {
// organizationManageInfo,
},
data() {
return {
viewState: 1,
activeName: "roleList",
dialogTitle: "",
editDialog: false,
editDialog1: false,
form: {
teacherNo: "",
},
formBackup: Object.assign({}, this.form),
tableData: [],
userName: window.sessionStorage.getItem("userName"),
formList: {},
};
},
mounted() {
this.getPageList();
selectTeacher().then((res) => {
this.formList = res.data;
});
},
methods: {
getPageList() {
// 获取列表
selectSysPlanXs({ userName: this.userName }).then((res) => {
this.tableData = res.data;
});
console.log(this.userName);
},
handleClick(tab, event) {
if (tab.name == "addrole") {
this.dialogTitle = "新增";
this.roleForm = Object.assign({}, this.formBackup);
} else {
this.getPageList();
}
},
save() {
console.log("form", this.form);
if (this.form.sid) {
alterSysPlant(this.form).then((res) => {
this.editDialog = false;
this.getPageList();
this.$message({
message: res.msg,
type: "success",
});
});
} else {
saveSysPlan(this.form).then((res) => {
this.getPageList();
this.activeName = "roleList";
this.$message({
message: res.msg,
type: "success",
});
});
}
this.reset();
},
save1() {
upSysPlan(this.form).then((res) => {
this.getPageList();
this.editDialog1 = false;
this.$message({
type: "success",
message: "提交成功!",
});
});
},
reset() {
this.form = {};
},
resetState() {
this.viewState = 1;
},
tijiao(row) {
if (row.teacherNo) {
upSysPlan(row).then((res) => {
this.getPageList();
this.$message({
type: "success",
message: "提交成功!",
});
});
} else {
this.dialogTitle = "编辑";
this.editDialog1 = true;
this.form = Object.assign({}, row);
}
},
editRow(row) {
this.dialogTitle = "编辑";
this.editDialog = true;
this.form = Object.assign({}, row);
this.teacherNo = row.teacherNo;
},
detail(row) {
this.viewState = 4;
this.$refs["divInfo"].showAdd(row);
},
deleteRow(row) {
this.$confirm("确定要删除该资源吗, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
deleteSysPlan(row.sid).then((res) => {
this.getPageList();
this.$message({
type: "success",
message: "删除成功!",
});
});
});
},
},
};
</script>
<style scoped="scoped" lang="scss">
.my-tabs {
margin-top: 10px;
}
</style>