见习之星考核过程

This commit is contained in:
paidaxing444 2020-08-30 12:44:23 +08:00
parent 5121947a71
commit 4f50af4797
6 changed files with 127 additions and 32 deletions

View File

@ -2,6 +2,7 @@ package com.ruoyi.web.controller.jxzxkhgl;
import java.util.List; import java.util.List;
import com.ruoyi.common.utils.SecurityUtils;
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;
@ -43,6 +44,7 @@ public class TsbzJxzxkhgcsjController extends BaseController {
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(TsbzJxzxkhgcsj tsbzJxzxkhgcsj) { public TableDataInfo list(TsbzJxzxkhgcsj tsbzJxzxkhgcsj) {
startPage(); startPage();
tsbzJxzxkhgcsj.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
List<TsbzJxzxkhgcsj> list = tsbzJxzxkhgcsjService.selectTsbzJxzxkhgcsjList(tsbzJxzxkhgcsj); List<TsbzJxzxkhgcsj> list = tsbzJxzxkhgcsjService.selectTsbzJxzxkhgcsjList(tsbzJxzxkhgcsj);
return getDataTable(list); return getDataTable(list);
} }
@ -65,7 +67,10 @@ public class TsbzJxzxkhgcsjController extends BaseController {
@PreAuthorize("@ss.hasPermi('jxzxkhgl:jxzxkhgcsj:query')") @PreAuthorize("@ss.hasPermi('jxzxkhgl:jxzxkhgcsj:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id) { public AjaxResult getInfo(@PathVariable("id") String id) {
return AjaxResult.success(tsbzJxzxkhgcsjService.selectTsbzJxzxkhgcsjById(id)); TsbzJxzxkhgcsj tsbzJxzxkhgcsj = new TsbzJxzxkhgcsj();
tsbzJxzxkhgcsj.setId(id);
tsbzJxzxkhgcsj.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
return AjaxResult.success(tsbzJxzxkhgcsjService.selectTsbzJxzxkhgcsjById(tsbzJxzxkhgcsj));
} }
/** /**
@ -76,6 +81,7 @@ public class TsbzJxzxkhgcsjController extends BaseController {
@PostMapping @PostMapping
public AjaxResult add(@RequestBody TsbzJxzxkhgcsj tsbzJxzxkhgcsj) { public AjaxResult add(@RequestBody TsbzJxzxkhgcsj tsbzJxzxkhgcsj) {
tsbzJxzxkhgcsj.setId(schoolCommonController.getUuid()); tsbzJxzxkhgcsj.setId(schoolCommonController.getUuid());
tsbzJxzxkhgcsj.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
return toAjax(tsbzJxzxkhgcsjService.insertTsbzJxzxkhgcsj(tsbzJxzxkhgcsj)); return toAjax(tsbzJxzxkhgcsjService.insertTsbzJxzxkhgcsj(tsbzJxzxkhgcsj));
} }

View File

@ -14,10 +14,10 @@ public interface TsbzJxzxkhgcsjMapper {
/** /**
* 查询考核过程数据 * 查询考核过程数据
* *
* @param id 考核过程数据ID * @param tsbzJxzxkhgcsj 考核过程数据ID
* @return 考核过程数据 * @return 考核过程数据
*/ */
public TsbzJxzxkhgcsj selectTsbzJxzxkhgcsjById(String id); public TsbzJxzxkhgcsj selectTsbzJxzxkhgcsjById(TsbzJxzxkhgcsj tsbzJxzxkhgcsj);
/** /**
* 查询考核过程数据列表 * 查询考核过程数据列表

View File

@ -14,10 +14,10 @@ public interface ITsbzJxzxkhgcsjService {
/** /**
* 查询考核过程数据 * 查询考核过程数据
* *
* @param id 考核过程数据ID * @param tsbzJxzxkhgcsj 考核过程数据ID
* @return 考核过程数据 * @return 考核过程数据
*/ */
public TsbzJxzxkhgcsj selectTsbzJxzxkhgcsjById(String id); public TsbzJxzxkhgcsj selectTsbzJxzxkhgcsjById(TsbzJxzxkhgcsj tsbzJxzxkhgcsj);
/** /**
* 查询考核过程数据列表 * 查询考核过程数据列表

View File

@ -23,12 +23,12 @@ public class TsbzJxzxkhgcsjServiceImpl implements ITsbzJxzxkhgcsjService {
/** /**
* 查询考核过程数据 * 查询考核过程数据
* *
* @param id 考核过程数据ID * @param tsbzJxzxkhgcsj 考核过程数据ID
* @return 考核过程数据 * @return 考核过程数据
*/ */
@Override @Override
public TsbzJxzxkhgcsj selectTsbzJxzxkhgcsjById(String id) { public TsbzJxzxkhgcsj selectTsbzJxzxkhgcsjById(TsbzJxzxkhgcsj tsbzJxzxkhgcsj) {
return tsbzJxzxkhgcsjMapper.selectTsbzJxzxkhgcsjById(id); return tsbzJxzxkhgcsjMapper.selectTsbzJxzxkhgcsjById(tsbzJxzxkhgcsj);
} }
/** /**

View File

@ -33,8 +33,8 @@
</resultMap> </resultMap>
<sql id="selectTsbzJxzxkhgcsjVo"> <sql id="selectTsbzJxzxkhgcsjVo">
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 select b.id,b.content,b.zbid,b.createuserid,a.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 left join (select * from tsbz_jxzxkhgcsj where createuserid= #{createuserid}) b
on a.faid=b.faid and a.id=b.zbid on a.faid=b.faid and a.id=b.zbid
</sql> </sql>
@ -45,9 +45,10 @@ on a.faid=b.faid and a.id=b.zbid
<if test="zbid != null ">and a.zbid = #{zbid}</if> <if test="zbid != null ">and a.zbid = #{zbid}</if>
<if test="content != null and content != ''">and b.content = #{content}</if> <if test="content != null and content != ''">and b.content = #{content}</if>
</where> </where>
order by a.id
</select> </select>
<select id="selectTsbzJxzxkhgcsjById" parameterType="String" resultMap="TsbzJxzxkhgcsjResult"> <select id="selectTsbzJxzxkhgcsjById" parameterType="TsbzJxzxkhgcsj" resultMap="TsbzJxzxkhgcsjResult">
<include refid="selectTsbzJxzxkhgcsjVo"/> <include refid="selectTsbzJxzxkhgcsjVo"/>
where b.id = #{id} where b.id = #{id}
</select> </select>

View File

@ -32,7 +32,7 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['jxzxkhgl:jxzxkhgcsj:edit']" v-hasPermi="['jxzxkhgl:jxzxkhgcsj:edit']"
>修改</el-button> >填报</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -42,7 +42,16 @@
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['jxzxkhgl:jxzxkhgcsj:remove']" v-hasPermi="['jxzxkhgl:jxzxkhgcsj:remove']"
>删除</el-button> >清空</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
icon="el-icon-check"
size="mini"
@click="handleDelete"
v-hasPermi="['jxzxkhgl:jxzxkhgcsj:edit']"
>提交</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>
@ -50,7 +59,8 @@
<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="tsbzJxzxkhzbx.faid" :formatter="faFormat" />
<el-table-column label="指标模块" align="center" prop="tsbzJxzxkhzbx.khmk" />
<el-table-column label="指标项" align="center" prop="tsbzJxzxkhzbx.khnr" /> <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" /> -->
@ -62,14 +72,14 @@
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['jxzxkhgl:jxzxkhgcsj:edit']" v-hasPermi="['jxzxkhgl:jxzxkhgcsj:edit']"
>修改</el-button> >填报</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['jxzxkhgl:jxzxkhgcsj:remove']" v-hasPermi="['jxzxkhgl:jxzxkhgcsj:remove']"
>删除</el-button> >清空</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -86,16 +96,38 @@
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="所属方案" prop="faid"> <el-form-item label="所属方案" prop="faid">
<el-input v-model="form.faid" placeholder="请输入所属方案" /> <el-select v-model="form.faid" size="small" :disabled="true">
<el-option
v-for="item in jxzxkhfaOptions"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="指标项" prop="zbid"> <el-form-item label="指标项" prop="zbid">
<el-input v-model="form.zbid" placeholder="请输入指标项" /> <el-input v-model="form.khnr" :disabled="true" />
<el-input v-model="form.zbid" v-if="false" />
</el-form-item> </el-form-item>
<el-form-item label="内容" prop="content"> <el-form-item label="内容" prop="content">
<el-input v-model="form.content" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.content" type="textarea" placeholder="请输入内容" />
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="createuserid"> <el-form-item label="选择文件" prop="fileurl">
<el-input v-model="form.createuserid" placeholder="请输入创建人" /> <el-input v-model="form.fileurl" v-if="false" />
<el-upload
class="upload-demo"
:action="uploadFileUrl"
:headers="headers"
:on-preview="handlePreview"
:on-remove="handleRemove"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:file-list="fileList"
:on-success="handleAvatarSuccess"
>
<el-button size="small" type="primary">选择文件</el-button>
</el-upload>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -116,11 +148,13 @@ import {
} from "@/api/jxzxkhgl/jxzxkhgcsj"; } from "@/api/jxzxkhgl/jxzxkhgcsj";
import { listJxzxkhfa, getJxzxkhfa } from "@/api/jxzxkhgl/jxzxkhfa"; import { listJxzxkhfa, getJxzxkhfa } from "@/api/jxzxkhgl/jxzxkhfa";
import { getToken } from "@/utils/auth";
export default { export default {
name: "Jxzxkhgcsj", name: "Jxzxkhgcsj",
data() { data() {
return { return {
khnr: "",
// //
loading: true, loading: true,
// //
@ -141,6 +175,12 @@ export default {
title: "", title: "",
// //
open: false, open: false,
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", //
headers: {
Authorization: "Bearer " + getToken(),
},
//
fileList: [],
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
@ -157,7 +197,11 @@ export default {
// //
form: {}, form: {},
// //
rules: {}, rules: {
content: [
{ required: true, message: "考核内容不能为空", trigger: "blur" },
],
},
}; };
}, },
created() { created() {
@ -165,6 +209,46 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
handleAvatarSuccess(res, file) {
//console.log(res);
if (res.code == "200") {
this.form.fileurl = res.fileName;
} else {
this.msgError(res.msg);
}
},
handleRemove(file, fileList) {
//console.log(file, fileList);
if (file.response.code == "200") {
this.form.fileurl = "";
}
},
handlePreview(file) {
//console.log(file);
},
handleExceed(files, fileList) {
this.$message.warning(
`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
files.length + fileList.length
} 个文件`
);
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
//
faFormat(row, column) {
// return this.selectDictLabel(this.classOptions, row.classid);
var actions = [];
var datas = this.jxzxkhfaOptions;
Object.keys(datas).map((key) => {
if (datas[key].id == "" + row.faid) {
actions.push(datas[key].name);
return false;
}
});
return actions.join("");
},
// //
getKhfa() { getKhfa() {
listJxzxkhfa(this.queryParams_fa).then((response) => { listJxzxkhfa(this.queryParams_fa).then((response) => {
@ -195,8 +279,10 @@ export default {
content: null, content: null,
createuserid: null, createuserid: null,
createTime: null, createTime: null,
khnr: null,
}; };
this.resetForm("form"); this.resetForm("form");
this.fileList = [];
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
@ -218,17 +304,23 @@ export default {
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const id = row.id || this.ids; const id = row.id || this.ids;
console.log("id:" + id); //console.log("id:" + row.tsbzJxzxkhzbx.khnr);
if (id != "") { if (id != "") {
getJxzxkhgcsj(id).then((response) => { getJxzxkhgcsj(id).then((response) => {
this.form = response.data; this.form = response.data;
console.log(response.data);
this.open = true; this.open = true;
this.title = "修改考核过程数据"; this.title = "修改考核过程数据";
this.form.khnr = row.tsbzJxzxkhzbx.khnr;
}); });
} else { } else {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加考核过程数据"; this.title = "添加考核过程数据";
this.form.faid = row.tsbzJxzxkhzbx.faid;
this.form.zbid = row.tsbzJxzxkhzbx.id;
this.form.khnr = row.tsbzJxzxkhzbx.khnr;
} }
}, },
/** 提交按钮 */ /** 提交按钮 */
@ -258,21 +350,17 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$confirm( this.$confirm("是否确认清空考核过程数据的数据项?", "警告", {
'是否确认删除考核过程数据编号为"' + ids + '"的数据项?', confirmButtonText: "确定",
"警告", cancelButtonText: "取消",
{ type: "warning",
confirmButtonText: "确定", })
cancelButtonText: "取消",
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 () {});
}, },