一日流程评估-二次评估

This commit is contained in:
zhanglipeng
2021-05-25 18:23:11 +08:00
parent c1bdf1c3fe
commit 92f4556d22
7 changed files with 480 additions and 30 deletions

View File

@ -521,6 +521,22 @@ export const constantRoutes = [
}
]
},
{
path: "/benyi/dayflowassessmentupdate",
component: Layout,
hidden: true,
children: [
{
path: "edit/:id(\\d+)",
component: () => import("@/views/benyi/dayflowassessment/edit"),
name: "dayflowassessmentteacheredit",
meta: {
title: `一日流程评估`,
icon: ""
}
}
]
},
{
path: "/benyi/assessmentchild",
component: Layout,

View File

@ -46,7 +46,6 @@
v-model="itemBz.mrz"
:precision="2"
:step="0.1"
:max="itemBz.score"
:disabled="true"
></el-input-number>
</div>
@ -118,10 +117,6 @@ export default {
this.getTaskList();
},
methods: {
setTitle() {
// const $tag = document.querySelector('.tags-view-item.router-link-exact-active.router-link-active.active');
// console.log(tag);
},
getDetail() {
getDayflowassessment(this.id).then((response) => {
//console.log(response);

View File

@ -0,0 +1,357 @@
<template>
<div class="app-container">
<div class="flex align-center justify-between student-main-title">
<p class="title flex align-center">
<span>班级{{ classFormat(this.classid) }} </span>
<span> 评估对象{{ pgdxFormat(this.pgdx) }} </span>
</p>
</div>
<div class="mb8 btn-list">
<el-button
type="primary"
icon="el-icon-success"
size="mini"
@click="submitForm"
v-hasPermi="['benyi:dayflowassessment:edit']"
v-prevent-re-click
>提交评估</el-button
>
<el-button
type="primary"
icon="el-icon-circle-check"
size="mini"
@click="saveForm"
v-hasPermi="['benyi:dayflowassessment:edit']"
v-prevent-re-click
>保存评估</el-button
>
</div>
<el-tabs v-model="activeName" type="card">
<el-tab-pane
v-for="item in detailOptions"
:key="item.id"
:label="item.name"
:name="item.name"
>
<div
class="block"
v-for="itemTask in dayflowtaskList.filter(
(p) => p.detailId == item.id
)"
:key="itemTask.code"
>
<h2 class="block-item-title flex align-center">
{{ itemTask.taskLable }}
</h2>
<div
class="checkbox-content"
v-for="(itemBz, index) in dayflowstandardList.filter(
(p) => p.taskCode == itemTask.code
)"
:key="itemBz.id"
>
<div
class="checkbox-item flex align-center justify-between"
:class="{ line: index !== 0 }"
>
<p class="left-info">
{{ itemBz.standardTitle }}
</p>
<div class="right-number flex align-center justify-end">
<span>分值: {{ itemBz.score }}分</span>
<el-input-number
class="number-input"
v-model="itemBz.mrz"
:precision="2"
:step="0.1"
:max="0"
></el-input-number>
</div>
</div>
</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import {
listDayflowassessment,
getDayflowassessment,
addDayflowassessment,
} from "@/api/benyi/dayflowassessment";
import { listDayflowtask } from "@/api/benyi/dayflow/dayflowtask";
import { listDetail, getDetail } from "@/api/benyi/dayflow/dayflowmanger";
import { listStandardAssessment } from "@/api/benyi/dayflow/biaozhun/standard";
import { listDept, getDept } from "@/api/system/dept";
import { listClass, getUserList } from "@/api/system/class";
import { listUser } from "@/api/system/user";
export default {
name: "dayflowassessmentteacheredit",
data() {
return {
id: "",
classid: "",
pgdx: "",
// 遮罩层
loading: false,
// 根据一日流程id查到的名下任务列表
dayflowtaskList: [],
// 根据任务查询到名下标准
dayflowstandardList: [],
//班级
classOptions: [],
//用户
userOptions: [],
//评估对象
pgdxOptions: [],
// 一日流程表格数据
detailOptions: [],
// 表单参数
form: {},
// 查询一日流程标准
queryParams_standard: {
id: undefined,
},
// 查询参数
queryParams: {
parentid: undefined,
name: undefined,
iselement: undefined,
scope: undefined,
sort: undefined,
},
activeName: "早间接待",
};
},
created() {
this.id = this.$route.params && this.$route.params.id;
console.log(this.id);
this.queryParams_standard.id = this.id;
this.getDetail();
this.getClassList();
this.getUserList();
this.getDayFlowList();
this.getTaskList();
},
methods: {
getDetail() {
getDayflowassessment(this.id).then((response) => {
//console.log(response);
this.classid = response.data.classid;
this.pgdx = response.data.pgdx;
});
},
/** 查询一日流程列表 */
getDayFlowList() {
listDetail(null).then((response) => {
this.detailOptions = response.rows;
});
},
// 班级字典翻译
classFormat(classid) {
var actions = [];
var datas = this.classOptions;
Object.keys(datas).map((key) => {
if (datas[key].bjbh == "" + classid) {
actions.push(datas[key].bjmc);
return false;
}
});
return actions.join("");
},
/** 查询用户列表 */
getUserList() {
listUser(null).then((response) => {
this.userOptions = response.rows;
});
},
// 教师字典翻译
pgdxFormat(pgdx) {
var actions = [];
var datas = this.userOptions;
Object.keys(datas).map((key) => {
if (datas[key].userId == "" + pgdx) {
actions.push(datas[key].nickName);
return false;
}
});
return actions.join("");
},
//班级列表
getClassList() {
listClass(null).then((response) => {
this.classOptions = response.rows;
});
},
//班级列表
getUserListByBjbh(val) {
getUserList(val).then((response) => {
this.pgdxOptions = response.rows;
});
},
/** 查询一日流程任务列表 */
getTaskList() {
listDayflowtask(null).then((response) => {
this.dayflowtaskList = response.rows;
});
listStandardAssessment(this.queryParams_standard).then((response) => {
this.dayflowstandardList = response.rows;
});
},
/** 提交按钮 */
submitForm: function () {
//console.log(this.dayflowstandardList);
// console.log(this.form);
this.form.id = this.id;
this.$confirm("确认提交评估数据?评估后数据不能修改", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
callback: (action) => {
if (action === "confirm") {
this.loading = true;
this.form.list = this.dayflowstandardList;
this.form.status = "1";
addDayflowassessment(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("评估成功");
this.loading = false;
}
});
}
},
});
},
/** 保存按钮 */
saveForm: function () {
//console.log(this.dayflowstandardList);
// console.log(this.form);
this.form.id = this.id;
this.$confirm("确认保存评估数据?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
callback: (action) => {
if (action === "confirm") {
this.loading = true;
this.form.list = this.dayflowstandardList;
this.form.status = "0";
addDayflowassessment(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("保存成功");
this.loading = false;
}
});
}
},
});
},
},
};
</script>
<style lang="scss" scoped>
// 禁止复制
div {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.title {
padding: 10px 0;
font-weight: 600;
flex-wrap: wrap;
padding-right: 10px;
line-height: 20px;
span {
font-size: 16px;
padding: 0 4px;
// &:nth-of-type(2) {
// font-size: 14px;
// font-weight: normal;
// }
}
}
.number-input {
width: 120px;
}
.block {
padding: 10px;
color: #333;
.block-item-title {
padding: 10px 0;
margin: 0;
font-size: 16px;
font-weight: 500;
&::before {
content: "";
margin-right: 8px;
width: 4px;
height: 14px;
background: #1890ff;
}
}
.checkbox-item {
padding: 6px 0;
&.line {
border-top: 1px solid #dadada;
}
.left-info {
line-height: 22px;
}
.right-number {
flex: 0 0 205px;
}
}
.block-content {
border-radius: 5px;
padding: 10px;
background: #fcfcfc;
.block-content-title {
font-size: 14px;
font-weight: bold;
line-height: 24px;
padding-bottom: 5px;
.num {
font-size: 16px;
}
}
.checkbox-content {
padding-left: 20px;
margin-bottom: 15px;
}
.checkbox-item {
font-size: 14px;
line-height: 22px;
}
.check-info {
padding-left: 24px;
line-height: 18px;
font-size: 12px;
color: #999;
p {
padding-left: 10px;
}
}
.el-checkbox {
display: flex;
white-space: normal;
.el-checkbox__input {
margin-top: 2px;
}
}
}
}
@media (max-width: 768.98px) {
.title span {
font-size: 12px;
}
}
</style>

View File

@ -305,7 +305,7 @@ export default {
const id = row.id;
//console.log(id);
this.$router.push({
path: "/benyi/dayflowassessment/teacher/" + id,
path: "/benyi/dayflowassessmentupdate/edit/" + id,
});
},
handleAdd() {

View File

@ -39,13 +39,22 @@
<div class="mb8 btn-list">
<el-button
type="primary"
icon="el-icon-s-data"
icon="el-icon-success"
size="mini"
@click="submitForm"
v-hasPermi="['benyi:dayflowassessment:edit']"
v-prevent-re-click
>提交评估</el-button
>
<el-button
type="primary"
icon="el-icon-circle-check"
size="mini"
@click="saveForm"
v-hasPermi="['benyi:dayflowassessment:edit']"
v-prevent-re-click
>保存评估</el-button
>
</div>
<el-tabs v-model="activeName" type="card">
<el-tab-pane
@ -244,7 +253,7 @@ export default {
this.$refs["form"].validate((valid) => {
if (valid) {
// console.log(this.form);
this.$confirm("确认提交评估数据?评估后数据不能取消", "警告", {
this.$confirm("确认提交评估数据?评估后数据不能修改", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
@ -265,6 +274,33 @@ export default {
}
});
},
/** 保存按钮 */
saveForm: function () {
//console.log(this.dayflowstandardList);
this.$refs["form"].validate((valid) => {
if (valid) {
// console.log(this.form);
this.$confirm("确认保存评估数据?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
callback: (action) => {
if (action === "confirm") {
this.loading = true;
this.form.list = this.dayflowstandardList;
this.form.status = "0";
addDayflowassessment(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("保存成功");
this.loading = false;
}
});
}
},
});
}
});
},
},
};
</script>