From b2c538e0600a4e23c66aa5564f1eb48c729300c8 Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期五, 24 五月 2024 13:47:33 +0800
Subject: [PATCH] fix:统计随机试卷
---
src/views/education/department/edit.vue | 70 +++++++++++++++++++++-------------
1 files changed, 43 insertions(+), 27 deletions(-)
diff --git a/src/views/education/department/edit.vue b/src/views/education/department/edit.vue
index 9cf1ea9..ef688f1 100644
--- a/src/views/education/department/edit.vue
+++ b/src/views/education/department/edit.vue
@@ -10,6 +10,16 @@
<!-- <el-option v-for="item in levelEnum" :key="item.key" :value="item.key" :label="item.value"></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
+ <el-form-item v-if="fig === 0" label="绠$悊鍛橈細">
+ <el-select v-model="form.adminId" filterable placeholder="閫夋嫨绠$悊鍛�">
+ <el-option
+ v-for="item in deptUserList"
+ :key="item.id"
+ :label="item.value"
+ :value="item.id">
+ </el-option>
+ </el-select>
+ </el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm">鎻愪氦</el-button>
<el-button @click="resetForm">閲嶇疆</el-button>
@@ -20,16 +30,17 @@
<script>
import { mapGetters, mapState, mapActions } from 'vuex'
-import subjectApi from '@/api/subject'
import departmentApi from '@/api/department'
-import enumItem from '@/store/modules/enumItem'
export default {
data () {
return {
- depart:[],
+ // 閮ㄩ棬浜哄憳
+ deptUserList: [],
+ depart: [],
form: {
id: null,
name: '',
+ adminId: null
// level: 1,
// levelName: ''
},
@@ -39,7 +50,6 @@
},
created () {
let id = this.$route.query.id
- console.log(id)
let _this = this
if (id && parseInt(id) !== 0) {
_this.formLoading = true
@@ -47,43 +57,49 @@
_this.form = re.response
_this.formLoading = false
})
+ // 鑾峰彇閮ㄩ棬浜哄憳
+ _this.getUserSelect(id)
}
- if (id == undefined) {
- _this.fig = 1 //鏄柊澧�
+ if (id === undefined) {
+ _this.fig = 1 // 鏄柊澧�
} else {
- _this.fig = 0 //鏄紪杈�
+ _this.fig = 0 // 鏄紪杈�
}
},
methods: {
+ getUserSelect (id) {
+ departmentApi.getDeptUserList(id).then(res => {
+ this.deptUserList = res.response
+ })
+ },
submitForm () {
let _this = this
this.formLoading = true
// this.form.levelName = this.enumFormat(this.levelEnum, this.form.level)
- let obj = {
- name:this.form.name
- }
- if (_this.fig==1){
- departmentApi.addData(this.form.name).then(res=>{
+ // let obj = {
+ // name: this.form.name
+ // }
+ if (_this.fig === 1) {
+ departmentApi.addData(this.form.name).then(res => {
console.log(res)
- if (res.code ==1){
-
- _this.$message.success(res.message)
- _this.delCurrentView(_this).then(() => {
- _this.$router.push('/education/department/list')
- })
- }else {
- _this.$message.error(res.message)
- }
- })
- }else {
- departmentApi.edit(this.form).then(res=>{
- console.log(res)
- if (res.code ==1){
+ if (res.code === 1) {
_this.$message.success(res.message)
_this.delCurrentView(_this).then(() => {
_this.$router.push('/education/department/list')
})
- }else {
+ } else {
+ _this.$message.error(res.message)
+ }
+ })
+ } else {
+ departmentApi.edit(this.form).then(res => {
+ console.log(res)
+ if (res.code === 1) {
+ _this.$message.success(res.message)
+ _this.delCurrentView(_this).then(() => {
+ _this.$router.push('/education/department/list')
+ })
+ } else {
_this.$message.error(res.message)
}
})
--
Gitblit v1.8.0