基地校优化

This commit is contained in:
paidaxing444
2020-09-04 11:57:14 +08:00
parent d0c0116e6f
commit a295566e3d
7 changed files with 390 additions and 329 deletions

View File

@ -2,6 +2,11 @@ package com.ruoyi.web.controller.jxjs;
import java.util.List; import java.util.List;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.jxjs.domain.TsbzJxjsjbxx;
import com.ruoyi.jxjs.service.ITsbzJxjsjbxxService;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.web.controller.common.SchoolCommonController; import com.ruoyi.web.controller.common.SchoolCommonController;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -30,20 +35,22 @@ import com.ruoyi.common.core.page.TableDataInfo;
*/ */
@RestController @RestController
@RequestMapping("/jxjs/jdx") @RequestMapping("/jxjs/jdx")
public class TsbzJdxController extends BaseController public class TsbzJdxController extends BaseController {
{
@Autowired @Autowired
private ITsbzJdxService tsbzJdxService; private ITsbzJdxService tsbzJdxService;
@Autowired @Autowired
private SchoolCommonController schoolCommonController; private SchoolCommonController schoolCommonController;
@Autowired
private ITsbzJxjsjbxxService tsbzJxjsjbxxService;
@Autowired
private ISysDeptService deptService;
/** /**
* 查询基地校列表 * 查询基地校列表
*/ */
@PreAuthorize("@ss.hasPermi('jxjs:jdx:list')") @PreAuthorize("@ss.hasPermi('jxjs:jdx:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(TsbzJdx tsbzJdx) public TableDataInfo list(TsbzJdx tsbzJdx) {
{
startPage(); startPage();
List<TsbzJdx> list = tsbzJdxService.selectTsbzJdxList(tsbzJdx); List<TsbzJdx> list = tsbzJdxService.selectTsbzJdxList(tsbzJdx);
return getDataTable(list); return getDataTable(list);
@ -55,8 +62,7 @@ public class TsbzJdxController extends BaseController
@PreAuthorize("@ss.hasPermi('jxjs:jdx:export')") @PreAuthorize("@ss.hasPermi('jxjs:jdx:export')")
@Log(title = "基地校", businessType = BusinessType.EXPORT) @Log(title = "基地校", businessType = BusinessType.EXPORT)
@GetMapping("/export") @GetMapping("/export")
public AjaxResult export(TsbzJdx tsbzJdx) public AjaxResult export(TsbzJdx tsbzJdx) {
{
List<TsbzJdx> list = tsbzJdxService.selectTsbzJdxList(tsbzJdx); List<TsbzJdx> list = tsbzJdxService.selectTsbzJdxList(tsbzJdx);
ExcelUtil<TsbzJdx> util = new ExcelUtil<TsbzJdx>(TsbzJdx.class); ExcelUtil<TsbzJdx> util = new ExcelUtil<TsbzJdx>(TsbzJdx.class);
return util.exportExcel(list, "jdx"); return util.exportExcel(list, "jdx");
@ -67,8 +73,7 @@ public class TsbzJdxController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('jxjs:jdx:query')") @PreAuthorize("@ss.hasPermi('jxjs:jdx:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id) public AjaxResult getInfo(@PathVariable("id") String id) {
{
return AjaxResult.success(tsbzJdxService.selectTsbzJdxById(id)); return AjaxResult.success(tsbzJdxService.selectTsbzJdxById(id));
} }
@ -78,9 +83,18 @@ public class TsbzJdxController extends BaseController
@PreAuthorize("@ss.hasPermi('jxjs:jdx:add')") @PreAuthorize("@ss.hasPermi('jxjs:jdx:add')")
@Log(title = "基地校", businessType = BusinessType.INSERT) @Log(title = "基地校", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody TsbzJdx tsbzJdx) public AjaxResult add(@RequestBody TsbzJdx tsbzJdx) {
{ String uuid = schoolCommonController.getUuid();
tsbzJdx.setId(schoolCommonController.getUuid()); tsbzJdx.setId(uuid);
//将当前记录插入的dept表
SysDept dept = new SysDept();
dept.setSchoolid(uuid);
dept.setDeptName(tsbzJdx.getJdxmc());
dept.setCreateBy(SecurityUtils.getLoginUser().getUser().getUserName());
dept.setParentId(200L);
dept.setAncestors("0,100,200");
dept.setOrderNum(String.valueOf(tsbzJdxService.selectTsbzJdxList(null).size()));
deptService.insertDept(dept);
return toAjax(tsbzJdxService.insertTsbzJdx(tsbzJdx)); return toAjax(tsbzJdxService.insertTsbzJdx(tsbzJdx));
} }
@ -90,8 +104,15 @@ public class TsbzJdxController extends BaseController
@PreAuthorize("@ss.hasPermi('jxjs:jdx:edit')") @PreAuthorize("@ss.hasPermi('jxjs:jdx:edit')")
@Log(title = "基地校", businessType = BusinessType.UPDATE) @Log(title = "基地校", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody TsbzJdx tsbzJdx) public AjaxResult edit(@RequestBody TsbzJdx tsbzJdx) {
{ //创建dept实例 并且向要添加的dept中设置各个参数
SysDept dept = new SysDept();
//设置schoolID为xxdm
dept.setSchoolid(tsbzJdx.getId());
dept = deptService.selectDeptList(dept).get(0);
dept.setDeptName(tsbzJdx.getJdxmc());
dept.setUpdateBy(SecurityUtils.getLoginUser().getUser().getUserName());
deptService.updateDept(dept);
return toAjax(tsbzJdxService.updateTsbzJdx(tsbzJdx)); return toAjax(tsbzJdxService.updateTsbzJdx(tsbzJdx));
} }
@ -101,8 +122,17 @@ public class TsbzJdxController extends BaseController
@PreAuthorize("@ss.hasPermi('jxjs:jdx:remove')") @PreAuthorize("@ss.hasPermi('jxjs:jdx:remove')")
@Log(title = "基地校", businessType = BusinessType.DELETE) @Log(title = "基地校", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids) public AjaxResult remove(@PathVariable String[] ids) {
{ TsbzJxjsjbxx tsbzJxjsjbxx = null;
//判断当前基地校是否已分配学生
for (int i = 0; i < ids.length; i++) {
tsbzJxjsjbxx = new TsbzJxjsjbxx();
tsbzJxjsjbxx.setJdxid(ids[i]);
List<TsbzJxjsjbxx> list = tsbzJxjsjbxxService.selectTsbzJxjsjbxxList(tsbzJxjsjbxx);
if (list != null && list.size() > 0) {
return AjaxResult.error("当前基地校已分配见习教师,无法删除");
}
}
return toAjax(tsbzJdxService.deleteTsbzJdxByIds(ids)); return toAjax(tsbzJdxService.deleteTsbzJdxByIds(ids));
} }
} }

View File

@ -5,6 +5,7 @@ import java.util.List;
import javax.validation.constraints.Email; import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
@ -14,172 +15,184 @@ import com.ruoyi.common.core.domain.BaseEntity;
* *
* @author ruoyi * @author ruoyi
*/ */
public class SysDept extends BaseEntity public class SysDept extends BaseEntity {
{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 部门ID */ /**
* 部门ID
*/
private Long deptId; private Long deptId;
/** 父部门ID */ /**
* 父部门ID
*/
private Long parentId; private Long parentId;
/** 祖级列表 */ /**
* 祖级列表
*/
private String ancestors; private String ancestors;
/** 部门名称 */ /**
* 部门名称
*/
private String deptName; private String deptName;
/** 显示顺序 */ /**
* 显示顺序
*/
private String orderNum; private String orderNum;
/** 负责人 */ /**
* 负责人
*/
private String leader; private String leader;
/** 联系电话 */ /**
* 联系电话
*/
private String phone; private String phone;
/** 邮箱 */ /**
* 邮箱
*/
private String email; private String email;
/** 部门状态:0正常,1停用 */ /**
* 部门状态:0正常,1停用
*/
private String status; private String status;
/** 删除标志0代表存在 2代表删除 */ /**
* 删除标志0代表存在 2代表删除
*/
private String delFlag; private String delFlag;
/** 父部门名称 */ /**
* 父部门名称
*/
private String parentName; private String parentName;
/** 子部门 */ /**
* 学校id
*/
private String schoolid;
/**
* 子部门
*/
private List<SysDept> children = new ArrayList<SysDept>(); private List<SysDept> children = new ArrayList<SysDept>();
public Long getDeptId() public Long getDeptId() {
{
return deptId; return deptId;
} }
public void setDeptId(Long deptId) public void setDeptId(Long deptId) {
{
this.deptId = deptId; this.deptId = deptId;
} }
public Long getParentId() public Long getParentId() {
{
return parentId; return parentId;
} }
public void setParentId(Long parentId) public void setParentId(Long parentId) {
{
this.parentId = parentId; this.parentId = parentId;
} }
public String getAncestors() public String getAncestors() {
{
return ancestors; return ancestors;
} }
public void setAncestors(String ancestors) public void setAncestors(String ancestors) {
{
this.ancestors = ancestors; this.ancestors = ancestors;
} }
@NotBlank(message = "部门名称不能为空") @NotBlank(message = "部门名称不能为空")
@Size(min = 0, max = 30, message = "部门名称长度不能超过30个字符") @Size(min = 0, max = 30, message = "部门名称长度不能超过30个字符")
public String getDeptName() public String getDeptName() {
{
return deptName; return deptName;
} }
public void setDeptName(String deptName) public void setDeptName(String deptName) {
{
this.deptName = deptName; this.deptName = deptName;
} }
@NotBlank(message = "显示顺序不能为空") @NotBlank(message = "显示顺序不能为空")
public String getOrderNum() public String getOrderNum() {
{
return orderNum; return orderNum;
} }
public void setOrderNum(String orderNum) public void setOrderNum(String orderNum) {
{
this.orderNum = orderNum; this.orderNum = orderNum;
} }
public String getLeader() public String getLeader() {
{
return leader; return leader;
} }
public void setLeader(String leader) public void setLeader(String leader) {
{
this.leader = leader; this.leader = leader;
} }
@Size(min = 0, max = 11, message = "联系电话长度不能超过11个字符") @Size(min = 0, max = 11, message = "联系电话长度不能超过11个字符")
public String getPhone() public String getPhone() {
{
return phone; return phone;
} }
public void setPhone(String phone) public void setPhone(String phone) {
{
this.phone = phone; this.phone = phone;
} }
@Email(message = "邮箱格式不正确") @Email(message = "邮箱格式不正确")
@Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
public String getEmail() public String getEmail() {
{
return email; return email;
} }
public void setEmail(String email) public void setEmail(String email) {
{
this.email = email; this.email = email;
} }
public String getStatus() public String getStatus() {
{
return status; return status;
} }
public void setStatus(String status) public void setStatus(String status) {
{
this.status = status; this.status = status;
} }
public String getDelFlag() public String getDelFlag() {
{
return delFlag; return delFlag;
} }
public void setDelFlag(String delFlag) public void setDelFlag(String delFlag) {
{
this.delFlag = delFlag; this.delFlag = delFlag;
} }
public String getParentName() public String getParentName() {
{
return parentName; return parentName;
} }
public void setParentName(String parentName) public void setParentName(String parentName) {
{
this.parentName = parentName; this.parentName = parentName;
} }
public List<SysDept> getChildren() public List<SysDept> getChildren() {
{
return children; return children;
} }
public void setChildren(List<SysDept> children) public void setChildren(List<SysDept> children) {
{
this.children = children; this.children = children;
} }
public void setSchoolid(String schoolid) {
this.schoolid = schoolid;
}
public String getSchoolid() {
return schoolid;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
@ -197,6 +210,7 @@ public class SysDept extends BaseEntity
.append("createTime", getCreateTime()) .append("createTime", getCreateTime())
.append("updateBy", getUpdateBy()) .append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime()) .append("updateTime", getUpdateTime())
.append("schoolid", getSchoolid())
.toString(); .toString();
} }
} }

View File

@ -20,10 +20,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/> <result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
<result property="schoolid" column="schoolid"/>
</resultMap> </resultMap>
<sql id="selectDeptVo"> <sql id="selectDeptVo">
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time , schoolid
from sys_dept d from sys_dept d
</sql> </sql>
@ -92,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="email != null and email != ''">email,</if> <if test="email != null and email != ''">email,</if>
<if test="status != null">status,</if> <if test="status != null">status,</if>
<if test="createBy != null and createBy != ''">create_by,</if> <if test="createBy != null and createBy != ''">create_by,</if>
<if test="schoolid != null">schoolid,</if>
create_time create_time
)values( )values(
<if test="deptId != null and deptId != 0">#{deptId},</if> <if test="deptId != null and deptId != 0">#{deptId},</if>
@ -104,6 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="email != null and email != ''">#{email},</if> <if test="email != null and email != ''">#{email},</if>
<if test="status != null">#{status},</if> <if test="status != null">#{status},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="schoolid != null">#{schoolid},</if>
sysdate() sysdate()
) )
</insert> </insert>
@ -120,6 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="email != null">email = #{email},</if> <if test="email != null">email = #{email},</if>
<if test="status != null and status != ''">status = #{status},</if> <if test="status != null and status != ''">status = #{status},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="schoolid != null">schoolid = #{schoolid},</if>
update_time = sysdate() update_time = sysdate()
</set> </set>
where dept_id = #{deptId} where dept_id = #{deptId}

View File

@ -425,7 +425,7 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$confirm('是否确认删除基地校编号为"' + ids + '"的数据项?', "警告", { this.$confirm('是否确认删除基地校数据项?', "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",

View File

@ -1,6 +1,12 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> <el-form
:model="queryParams"
ref="queryForm"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="姓名" prop="name"> <el-form-item label="姓名" prop="name">
<el-input <el-input
v-model="queryParams.name" v-model="queryParams.name"
@ -172,22 +178,13 @@
@click="handleDelete" @click="handleDelete"
v-hasPermi="['jxjs:jxjsjbxx:remove']" v-hasPermi="['jxjs:jxjsjbxx:remove']"
>删除</el-button> >删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['jxjs:jxjsjbxx:export']"
>导出</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="jxjsjbxxList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="jxjsjbxxList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="编号" align="center" prop="id" /> <!-- <el-table-column label="编号" align="center" prop="id" /> -->
<el-table-column label="姓名" align="center" prop="name" /> <el-table-column label="姓名" align="center" prop="name" />
<el-table-column label="性别" align="center" prop="xb" :formatter="xbFormat" /> <el-table-column label="性别" align="center" prop="xb" :formatter="xbFormat" />
<el-table-column label="政治面貌" align="center" prop="zzmm" :formatter="zzmmFormat" /> <el-table-column label="政治面貌" align="center" prop="zzmm" :formatter="zzmmFormat" />
@ -256,12 +253,15 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="出生日期" prop="csrq"> <el-form-item label="出生日期" prop="csrq">
<el-date-picker clearable size="small" style="width: 200px" <el-date-picker
clearable
size="small"
style="width: 200px"
v-model="form.csrq" v-model="form.csrq"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="选择出生日期"> placeholder="选择出生日期"
</el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="电子邮件" prop="email"> <el-form-item label="电子邮件" prop="email">
<el-input v-model="form.email" placeholder="请输入电子邮件" /> <el-input v-model="form.email" placeholder="请输入电子邮件" />
@ -384,7 +384,13 @@
</template> </template>
<script> <script>
import { listJxjsjbxx, getJxjsjbxx, delJxjsjbxx, addJxjsjbxx, updateJxjsjbxx, exportJxjsjbxx } from "@/api/jxjs/jxjsjbxx"; import {
listJxjsjbxx,
getJxjsjbxx,
delJxjsjbxx,
addJxjsjbxx,
updateJxjsjbxx,
} from "@/api/jxjs/jxjsjbxx";
export default { export default {
name: "Jxjsjbxx", name: "Jxjsjbxx",
@ -464,49 +470,44 @@ export default {
jxbh: [ jxbh: [
{ required: true, message: "进修编号不能为空", trigger: "blur" }, { required: true, message: "进修编号不能为空", trigger: "blur" },
], ],
xb: [ xb: [{ required: true, message: "教师性别不能为空", trigger: "blur" }],
{ required: true, message: "教师性别不能为空", trigger: "blur" },
],
csrq: [ csrq: [
{ required: true, message: "出生日期不能为空", trigger: "blur" }, { required: true, message: "出生日期不能为空", trigger: "blur" },
], ],
phone: [ phone: [{ required: true, message: "电话不能为空", trigger: "blur" }],
{ required: true, message: "电话不能为空", trigger: "blur" }, },
],
}
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getDicts("sys_user_sex").then(response => { this.getDicts("sys_user_sex").then((response) => {
this.xbOptions = response.data; this.xbOptions = response.data;
}); });
this.getDicts("sys_dm_zzmm").then(response => { this.getDicts("sys_dm_zzmm").then((response) => {
this.zzmmOptions = response.data; this.zzmmOptions = response.data;
}); });
this.getDicts("sys_dm_mz").then(response => { this.getDicts("sys_dm_mz").then((response) => {
this.mzOptions = response.data; this.mzOptions = response.data;
}); });
this.getDicts("sys_dm_rjxd").then(response => { this.getDicts("sys_dm_rjxd").then((response) => {
this.rjxdOptions = response.data; this.rjxdOptions = response.data;
}); });
this.getDicts("sys_dm_rjxk").then(response => { this.getDicts("sys_dm_rjxk").then((response) => {
this.rjxkOptions = response.data; this.rjxkOptions = response.data;
}); });
this.getDicts("sys_dm_rjnj").then(response => { this.getDicts("sys_dm_rjnj").then((response) => {
this.rjnjOptions = response.data; this.rjnjOptions = response.data;
}); });
this.getDicts("sys_dm_xl").then(response => { this.getDicts("sys_dm_xl").then((response) => {
this.xlOptions = response.data; this.xlOptions = response.data;
}); });
this.getDicts("sys_dm_xw").then(response => { this.getDicts("sys_dm_xw").then((response) => {
this.xwOptions = response.data; this.xwOptions = response.data;
}); });
this.getDicts("sys_dm_sfsfs").then(response => { this.getDicts("sys_dm_sfsfs").then((response) => {
this.sfsfsOptions = response.data; this.sfsfsOptions = response.data;
}); });
this.getDicts("sys_dm_rxnf").then(response => { this.getDicts("sys_dm_rxnf").then((response) => {
this.lqnfOptions = response.data; this.lqnfOptions = response.data;
}); });
}, },
@ -514,7 +515,7 @@ export default {
/** 查询见习教师基本信息列表 */ /** 查询见习教师基本信息列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listJxjsjbxx(this.queryParams).then(response => { listJxjsjbxx(this.queryParams).then((response) => {
this.jxjsjbxxList = response.rows; this.jxjsjbxxList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
@ -590,7 +591,7 @@ export default {
xw: null, xw: null,
sfsfs: null, sfsfs: null,
lqnf: null, lqnf: null,
createTime: null createTime: null,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -606,9 +607,9 @@ export default {
}, },
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map((item) => item.id);
this.single = selection.length!==1 this.single = selection.length !== 1;
this.multiple = !selection.length this.multiple = !selection.length;
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
@ -619,8 +620,8 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const id = row.id || this.ids const id = row.id || this.ids;
getJxjsjbxx(id).then(response => { getJxjsjbxx(id).then((response) => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改见习教师基本信息"; this.title = "修改见习教师基本信息";
@ -628,10 +629,10 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {
updateJxjsjbxx(this.form).then(response => { updateJxjsjbxx(this.form).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("修改成功"); this.msgSuccess("修改成功");
this.open = false; this.open = false;
@ -639,7 +640,7 @@ export default {
} }
}); });
} else { } else {
addJxjsjbxx(this.form).then(response => { addJxjsjbxx(this.form).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
this.open = false; this.open = false;
@ -653,30 +654,24 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$confirm('是否确认删除见习教师基本信息编号为"' + ids + '"的数据项?', "警告", { this.$confirm(
'是否确认删除见习教师基本信息数据项?',
"警告",
{
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}).then(function() { }
)
.then(function () {
return delJxjsjbxx(ids); return delJxjsjbxx(ids);
}).then(() => { })
.then(() => {
this.getList(); this.getList();
this.msgSuccess("删除成功"); this.msgSuccess("删除成功");
}).catch(function() {}); })
.catch(function () {});
},
}, },
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有见习教师基本信息数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return exportJxjsjbxx(queryParams);
}).then(response => {
this.download(response.msg);
}).catch(function() {});
}
}
}; };
</script> </script>

View File

@ -293,11 +293,8 @@ export default {
endtime: [ endtime: [
{ required: true, message: "考核结束时间不能为空", trigger: "blur" }, { required: true, message: "考核结束时间不能为空", trigger: "blur" },
], ],
filename: [
{ required: true, message: "考核文件名称不能为空", trigger: "blur" },
],
filepath: [ filepath: [
{ required: true, message: "文件路径不能为空", trigger: "blur" }, { required: true, message: "文件不能为空", trigger: "blur" },
], ],
khnf: [ khnf: [
{ required: true, message: "考核年份不能为空", trigger: "blur" }, { required: true, message: "考核年份不能为空", trigger: "blur" },

View File

@ -57,6 +57,7 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
v-if="!(scope.row.parentId==200)"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@ -64,6 +65,7 @@
v-hasPermi="['system:dept:edit']" v-hasPermi="['system:dept:edit']"
>修改</el-button> >修改</el-button>
<el-button <el-button
v-if="!(scope.row.parentId==200)"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-plus" icon="el-icon-plus"
@ -71,7 +73,7 @@
v-hasPermi="['system:dept:add']" v-hasPermi="['system:dept:add']"
>新增</el-button> >新增</el-button>
<el-button <el-button
v-if="scope.row.parentId != 0" v-if="!(scope.row.parentId == 0)&&!(scope.row.parentId==200)"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@ -88,7 +90,12 @@
<el-row> <el-row>
<el-col :span="24" v-if="form.parentId !== 0"> <el-col :span="24" v-if="form.parentId !== 0">
<el-form-item label="上级部门" prop="parentId"> <el-form-item label="上级部门" prop="parentId">
<treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择上级部门" /> <treeselect
v-model="form.parentId"
:options="deptOptions"
:normalizer="normalizer"
placeholder="选择上级部门"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -138,7 +145,14 @@
</template> </template>
<script> <script>
import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from "@/api/system/dept"; import {
listDept,
getDept,
delDept,
addDept,
updateDept,
listDeptExcludeChild,
} from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@ -164,41 +178,41 @@ export default {
// 查询参数 // 查询参数
queryParams: { queryParams: {
deptName: undefined, deptName: undefined,
status: undefined status: undefined,
}, },
// 表单参数 // 表单参数
form: {}, form: {},
// 表单校验 // 表单校验
rules: { rules: {
parentId: [ parentId: [
{ required: true, message: "上级部门不能为空", trigger: "blur" } { required: true, message: "上级部门不能为空", trigger: "blur" },
], ],
deptName: [ deptName: [
{ required: true, message: "部门名称不能为空", trigger: "blur" } { required: true, message: "部门名称不能为空", trigger: "blur" },
], ],
orderNum: [ orderNum: [
{ required: true, message: "菜单顺序不能为空", trigger: "blur" } { required: true, message: "菜单顺序不能为空", trigger: "blur" },
], ],
email: [ email: [
{ {
type: "email", type: "email",
message: "'请输入正确的邮箱地址", message: "'请输入正确的邮箱地址",
trigger: ["blur", "change"] trigger: ["blur", "change"],
} },
], ],
phone: [ phone: [
{ {
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: "请输入正确的手机号码", message: "请输入正确的手机号码",
trigger: "blur" trigger: "blur",
} },
] ],
} },
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getDicts("sys_normal_disable").then(response => { this.getDicts("sys_normal_disable").then((response) => {
this.statusOptions = response.data; this.statusOptions = response.data;
}); });
}, },
@ -206,7 +220,7 @@ export default {
/** 查询部门列表 */ /** 查询部门列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listDept(this.queryParams).then(response => { listDept(this.queryParams).then((response) => {
this.deptList = this.handleTree(response.data, "deptId"); this.deptList = this.handleTree(response.data, "deptId");
this.loading = false; this.loading = false;
}); });
@ -219,7 +233,7 @@ export default {
return { return {
id: node.deptId, id: node.deptId,
label: node.deptName, label: node.deptName,
children: node.children children: node.children,
}; };
}, },
// 字典状态字典翻译 // 字典状态字典翻译
@ -241,7 +255,7 @@ export default {
leader: undefined, leader: undefined,
phone: undefined, phone: undefined,
email: undefined, email: undefined,
status: "0" status: "0",
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -262,28 +276,28 @@ export default {
} }
this.open = true; this.open = true;
this.title = "添加部门"; this.title = "添加部门";
listDept().then(response => { listDept().then((response) => {
this.deptOptions = this.handleTree(response.data, "deptId"); this.deptOptions = this.handleTree(response.data, "deptId");
}); });
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
getDept(row.deptId).then(response => { getDept(row.deptId).then((response) => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改部门"; this.title = "修改部门";
}); });
listDeptExcludeChild(row.deptId).then(response => { listDeptExcludeChild(row.deptId).then((response) => {
this.deptOptions = this.handleTree(response.data, "deptId"); this.deptOptions = this.handleTree(response.data, "deptId");
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function () { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.deptId != undefined) { if (this.form.deptId != undefined) {
updateDept(this.form).then(response => { updateDept(this.form).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("修改成功"); this.msgSuccess("修改成功");
this.open = false; this.open = false;
@ -291,7 +305,7 @@ export default {
} }
}); });
} else { } else {
addDept(this.form).then(response => { addDept(this.form).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
this.open = false; this.open = false;
@ -304,17 +318,24 @@ export default {
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
this.$confirm('是否确认删除名称为"' + row.deptName + '"的数据项?', "警告", { this.$confirm(
'是否确认删除名称为"' + row.deptName + '"的数据项?',
"警告",
{
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}).then(function() { }
)
.then(function () {
return delDept(row.deptId); return delDept(row.deptId);
}).then(() => { })
.then(() => {
this.getList(); this.getList();
this.msgSuccess("删除成功"); this.msgSuccess("删除成功");
}).catch(function() {}); })
} .catch(function () {});
} },
},
}; };
</script> </script>