This commit is contained in:
zhoutianchi
2026-01-14 10:52:06 +08:00
parent 8c1f4ec05e
commit d0c8ea0223
140 changed files with 16969 additions and 11469 deletions

View File

@@ -0,0 +1,150 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="140px">
<el-form-item label="招生计划" prop="groupId">
<el-select v-model="dataForm.groupId" filterable :disabled="!dataForm.id ? false : true" placeholder="请选择招生计划" size="small" style="width: 100%">
<el-option
v-for="item in planList"
:key="item.id"
:label="item.groupName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="学校名称" prop="schoolName">
<el-input v-model="dataForm.schoolName" placeholder="学校名称"></el-input>
</el-form-item>
<el-form-item label="对接学院" prop="xy">
<el-select v-model="dataForm.xy" filterable clearable placeholder="请选择对接学院" size="small" style="width: 100%;">
<el-option
v-for="item in deptList"
:key="item.deptCode"
:label="item.deptName"
:value="item.deptCode">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="地区" prop="area">
<el-select v-model="dataForm.area" filterable placeholder="请选择地区" size="small" style="width: 100%;">
<el-option
v-for="item in areaList"
:key="item.code"
:label="item.name"
:value="item.code">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()" v-if="canSubmit">确定</el-button>
</span>
</el-dialog>
</template>
<script>
import {addObj, areaList, getObj, putObj} from '@/api/recruit/recruitstudentschool'
import {getDeptList} from "@/api/basic/basicclass";
import {list} from "@/api/recruit/recruitstudentplangroup";
export default {
data () {
return {
visible: false,
canSubmit: false,
dataForm: {
id:"",
groupId:"",
area:"",
xy:"",
schoolName:"",
},
disabled:false,
planList: [],
areaList:[],
deptList:[],
dataRule: {
groupId: [
{ required: true, message: '招生计划不能为空', trigger: 'blur' },
],
schoolName: [
{ required: true, message: '学校名称不能为空', trigger: 'blur' },
{ min: 1, max: 20, message: '学校名称长度不大于20个字符', trigger: 'blur' }
],
area: [
{ required: true, message: '地区不能为空', trigger: 'blur' },
],
}
}
},
created () {
},
methods: {
init (id) {
this.dataForm.id = id || null;
this.visible = true;
this.canSubmit = true;
this.initData();
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
getObj(this.dataForm.id).then(response => {
this.dataForm = response.data.data
this.dataForm.area = this.dataForm.area+"";
})
}else{
this.disabled = true;
}
})
},
initData() {
//查询二级学院信息
getDeptList().then(data => {
this.deptList = data.data.data
this.deptList.push({deptCode:"190",deptName:"招生就业处"})
})
list().then(data =>{
this.planList = data.data.data
if(!this.dataForm.id){
this.dataForm.groupId=this.planList[0].id
}
});
//获取所有省
areaList({type:"0",parentId:112}).then(res=>{
this.areaList = res.data.data;
});
},
// 表单提交
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.canSubmit = false;
if (this.dataForm.id) {
putObj(this.dataForm).then(data => {
this.$notify.success('修改成功')
this.visible = false
this.$emit('refreshDataList')
}).catch(() => {
this.canSubmit = true;
});
} else {
addObj(this.dataForm).then(data => {
this.$notify.success('添加成功')
this.visible = false
this.$emit('refreshDataList')
}).catch(() => {
this.canSubmit = true;
});
}
}
})
}
}
}
</script>