新建党组织
label-position="top" :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" > >立即创建 >
import axios from 'axios'
export default {
name: "index",
data() {
return {
ruleForm: {
organizationName: "",
organizationSuperior: "",
departmentCode: "",
},
showDepartment:{},
rules: {
organizationName: [
{ required: true, message: "请输入党组织名称", trigger: "blur" },
],
organizationSuperior: [
{ required: true, message: "请输入上级党组织名称", trigger: "blur" },
],
departmentCode: [
{ required: true, message: "请输入所在院系", trigger: "blur" },
],
},
};
},
mounted() {
// 展示院系
this.faculty();
},
methods: {
// 展示院系
faculty(){
var token = localStorage.getItem('token')
axios.get('http://hrdj.vipgz6.91tunnel.com/system/departmentList',
{ headers: { "content-type": "application/json" },token },
).then((res) => {
console.log(res.data.data);
this.showDepartment = res.data.data;
}).catch(err=>{
console.log("展示失败",err);
})
},
// 提交
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
var data = JSON.stringify(this.ruleForm);
console.log("this.ruleForm)等于",data)
var token = localStorage.getItem('token')
axios.post('http://hrdj.vipgz6.91tunnel.com/organizationManagement/addOrganization',data,
{ headers: { "content-type": "application/json" },token },
).then((res) => {
console.log(res.data);
// console.log("这个搜索",this.tableData);
}).catch(err=>{
console.log("提交失败",err);
})
} else {
console.log("错误!!!");
return false;
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
},
},
};
div {
background-color: #fff;
}
/* /deep/.el-input__inner {
width: 50%;
} */
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)