见习之星考核过程

This commit is contained in:
paidaxing444 2020-08-29 18:23:03 +08:00
parent db44caaa11
commit 5121947a71
4 changed files with 119 additions and 47 deletions

View File

@ -2,6 +2,7 @@ package com.ruoyi.web.controller.jxzxkhgl;
import java.util.List; import java.util.List;
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;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -32,6 +33,8 @@ import com.ruoyi.common.core.page.TableDataInfo;
public class TsbzJxzxkhgcsjController extends BaseController { public class TsbzJxzxkhgcsjController extends BaseController {
@Autowired @Autowired
private ITsbzJxzxkhgcsjService tsbzJxzxkhgcsjService; private ITsbzJxzxkhgcsjService tsbzJxzxkhgcsjService;
@Autowired
private SchoolCommonController schoolCommonController;
/** /**
* 查询考核过程数据列表 * 查询考核过程数据列表
@ -72,6 +75,7 @@ public class TsbzJxzxkhgcsjController extends BaseController {
@Log(title = "考核过程数据", businessType = BusinessType.INSERT) @Log(title = "考核过程数据", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody TsbzJxzxkhgcsj tsbzJxzxkhgcsj) { public AjaxResult add(@RequestBody TsbzJxzxkhgcsj tsbzJxzxkhgcsj) {
tsbzJxzxkhgcsj.setId(schoolCommonController.getUuid());
return toAjax(tsbzJxzxkhgcsjService.insertTsbzJxzxkhgcsj(tsbzJxzxkhgcsj)); return toAjax(tsbzJxzxkhgcsjService.insertTsbzJxzxkhgcsj(tsbzJxzxkhgcsj));
} }

View File

@ -43,6 +43,8 @@ public class TsbzJxzxkhgcsj extends BaseEntity {
@Excel(name = "创建人") @Excel(name = "创建人")
private Long createuserid; private Long createuserid;
private TsbzJxzxkhzbx tsbzJxzxkhzbx;
public void setId(String id) { public void setId(String id) {
this.id = id; this.id = id;
} }
@ -83,6 +85,15 @@ public class TsbzJxzxkhgcsj extends BaseEntity {
return createuserid; return createuserid;
} }
public TsbzJxzxkhzbx getTsbzJxzxkhzbx() {
return tsbzJxzxkhzbx;
}
public void setTsbzJxzxkhzbx(TsbzJxzxkhzbx tsbzJxzxkhzbx) {
this.tsbzJxzxkhzbx = tsbzJxzxkhzbx;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
@ -92,6 +103,7 @@ public class TsbzJxzxkhgcsj extends BaseEntity {
.append("content", getContent()) .append("content", getContent())
.append("createuserid", getCreateuserid()) .append("createuserid", getCreateuserid())
.append("createTime", getCreateTime()) .append("createTime", getCreateTime())
.append("tsbzJxzxkhzbx", getTsbzJxzxkhzbx())
.toString(); .toString();
} }
} }

View File

@ -11,25 +11,45 @@
<result property="content" column="content"/> <result property="content" column="content"/>
<result property="createuserid" column="createuserid"/> <result property="createuserid" column="createuserid"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<association property="tsbzJxzxkhzbx" column="zbid" javaType="TsbzJxzxkhzbx" resultMap="TsbzJxzxkhzbxResult"/>
</resultMap>
<resultMap type="TsbzJxzxkhzbx" id="TsbzJxzxkhzbxResult">
<result property="id" column="zbxid"/>
<result property="faid" column="faid"/>
<result property="khmk" column="khmk"/>
<result property="khnr" column="khnr"/>
<result property="tjsl" column="tjsl"/>
<result property="gjzd" column="gjzd"/>
<result property="tbly" column="tbly"/>
<result property="jkbj" column="jkbj"/>
<result property="starttime" column="starttime"/>
<result property="endtime" column="endtime"/>
<result property="zxrw" column="zxrw"/>
<result property="createuserid" column="createuserid"/>
<result property="createTime" column="create_time"/>
<result property="yly" column="yly"/>
<result property="yle" column="yle"/>
</resultMap> </resultMap>
<sql id="selectTsbzJxzxkhgcsjVo"> <sql id="selectTsbzJxzxkhgcsjVo">
select id, faid, zbid, content, createuserid, create_time from tsbz_jxzxkhgcsj select b.id,b.content,b.createuserid,b.create_time,a.id as zbxid,a.faid,a.khmk,a.khnr,a.tjsl,a.gjzd,a.tbly,a.jkbj,a.starttime,a.endtime,a.zxrw,a.yly,a.yle from tsbz_jxzxkhzbx a
left join tsbz_jxzxkhgcsj b
on a.faid=b.faid and a.id=b.zbid
</sql> </sql>
<select id="selectTsbzJxzxkhgcsjList" parameterType="TsbzJxzxkhgcsj" resultMap="TsbzJxzxkhgcsjResult"> <select id="selectTsbzJxzxkhgcsjList" parameterType="TsbzJxzxkhgcsj" resultMap="TsbzJxzxkhgcsjResult">
<include refid="selectTsbzJxzxkhgcsjVo"/> <include refid="selectTsbzJxzxkhgcsjVo"/>
<where> <where>
<if test="faid != null ">and faid = #{faid}</if> <if test="faid != null ">and a.faid = #{faid}</if>
<if test="zbid != null ">and zbid = #{zbid}</if> <if test="zbid != null ">and a.zbid = #{zbid}</if>
<if test="content != null and content != ''">and content = #{content}</if> <if test="content != null and content != ''">and b.content = #{content}</if>
<if test="createuserid != null ">and createuserid = #{createuserid}</if>
</where> </where>
</select> </select>
<select id="selectTsbzJxzxkhgcsjById" parameterType="String" resultMap="TsbzJxzxkhgcsjResult"> <select id="selectTsbzJxzxkhgcsjById" parameterType="String" resultMap="TsbzJxzxkhgcsjResult">
<include refid="selectTsbzJxzxkhgcsjVo"/> <include refid="selectTsbzJxzxkhgcsjVo"/>
where id = #{id} where b.id = #{id}
</select> </select>
<insert id="insertTsbzJxzxkhgcsj" parameterType="TsbzJxzxkhgcsj"> <insert id="insertTsbzJxzxkhgcsj" parameterType="TsbzJxzxkhgcsj">

View File

@ -1,14 +1,21 @@
<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="faid"> <el-form-item label="所属方案" prop="faid">
<el-input <el-select v-model="queryParams.faid" size="small">
v-model="queryParams.faid" <el-option
placeholder="请输入所属方案" v-for="item in jxzxkhfaOptions"
clearable :key="item.id"
size="small" :label="item.name"
@keyup.enter.native="handleQuery" :value="item.id"
/> />
</el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@ -37,16 +44,16 @@
v-hasPermi="['jxzxkhgl:jxzxkhgcsj:remove']" v-hasPermi="['jxzxkhgl:jxzxkhgcsj:remove']"
>删除</el-button> >删除</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="jxzxkhgcsjList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="jxzxkhgcsjList" @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="faid" /> <el-table-column label="所属方案" align="center" prop="faid" />
<el-table-column label="指标项" align="center" prop="zbid" /> <el-table-column label="指标项" align="center" prop="tsbzJxzxkhzbx.khnr" />
<el-table-column label="内容" align="center" prop="content" /> <el-table-column label="内容" align="center" prop="content" />
<el-table-column label="创建人" align="center" prop="createuserid" /> <!-- <el-table-column label="创建人" align="center" prop="createuserid" /> -->
<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
@ -66,7 +73,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
@ -100,7 +107,15 @@
</template> </template>
<script> <script>
import { listJxzxkhgcsj, getJxzxkhgcsj, delJxzxkhgcsj, addJxzxkhgcsj, updateJxzxkhgcsj } from "@/api/jxzxkhgl/jxzxkhgcsj"; import {
listJxzxkhgcsj,
getJxzxkhgcsj,
delJxzxkhgcsj,
addJxzxkhgcsj,
updateJxzxkhgcsj,
} from "@/api/jxzxkhgl/jxzxkhgcsj";
import { listJxzxkhfa, getJxzxkhfa } from "@/api/jxzxkhgl/jxzxkhfa";
export default { export default {
name: "Jxzxkhgcsj", name: "Jxzxkhgcsj",
@ -120,6 +135,8 @@ export default {
total: 0, total: 0,
// //
jxzxkhgcsjList: [], jxzxkhgcsjList: [],
//
jxzxkhfaOptions: [],
// //
title: "", title: "",
// //
@ -133,21 +150,32 @@ export default {
content: null, content: null,
createuserid: null, createuserid: null,
}, },
//
queryParams_fa: {
status: "1",
},
// //
form: {}, form: {},
// //
rules: { rules: {},
}
}; };
}, },
created() { created() {
this.getKhfa();
this.getList(); this.getList();
}, },
methods: { methods: {
//
getKhfa() {
listJxzxkhfa(this.queryParams_fa).then((response) => {
this.jxzxkhfaOptions = response.rows;
});
},
/** 查询考核过程数据列表 */ /** 查询考核过程数据列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listJxzxkhgcsj(this.queryParams).then(response => { listJxzxkhgcsj(this.queryParams).then((response) => {
console.log(response.rows);
this.jxzxkhgcsjList = response.rows; this.jxzxkhgcsjList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
@ -166,7 +194,7 @@ export default {
zbid: null, zbid: null,
content: null, content: null,
createuserid: null, createuserid: null,
createTime: null createTime: null,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -182,32 +210,33 @@ 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() {
this.reset();
this.open = true;
this.title = "添加考核过程数据";
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const id = row.id || this.ids const id = row.id || this.ids;
getJxzxkhgcsj(id).then(response => { console.log("id:" + id);
this.form = response.data; if (id != "") {
getJxzxkhgcsj(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改考核过程数据";
});
} else {
this.reset();
this.open = true; this.open = true;
this.title = "修改考核过程数据"; this.title = "添加考核过程数据";
}); }
}, },
/** 提交按钮 */ /** 提交按钮 */
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) {
updateJxzxkhgcsj(this.form).then(response => { updateJxzxkhgcsj(this.form).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("修改成功"); this.msgSuccess("修改成功");
this.open = false; this.open = false;
@ -215,7 +244,7 @@ export default {
} }
}); });
} else { } else {
addJxzxkhgcsj(this.form).then(response => { addJxzxkhgcsj(this.form).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
this.open = false; this.open = false;
@ -229,17 +258,24 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$confirm('是否确认删除考核过程数据编号为"' + ids + '"的数据项?', "警告", { this.$confirm(
'是否确认删除考核过程数据编号为"' + ids + '"的数据项?',
"警告",
{
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}).then(function() { }
)
.then(function () {
return delJxzxkhgcsj(ids); return delJxzxkhgcsj(ids);
}).then(() => { })
.then(() => {
this.getList(); this.getList();
this.msgSuccess("删除成功"); this.msgSuccess("删除成功");
}).catch(function() {}); })
.catch(function () {});
}, },
} },
}; };
</script> </script>