From 8cecc91d81a38045479dc63d3b4137bc95b412f8 Mon Sep 17 00:00:00 2001 From: zhanglipeng <chinazhanglipeng@qq.com> Date: Thu, 8 Apr 2021 21:56:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E6=97=A5=E6=B5=81=E7=A8=8B=E8=AF=84?= =?UTF-8?q?=E4=BC=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/assets/styles/index.scss | 3 + ruoyi-ui/src/router/index.js | 2 +- .../views/benyi/dayflowassessment/index.vue | 2 +- .../views/benyi/dayflowassessment/teacher.vue | 164 +++++++----------- .../benyi/domain/ByDayFlowStandard.java | 11 ++ 5 files changed, 81 insertions(+), 101 deletions(-) diff --git a/ruoyi-ui/src/assets/styles/index.scss b/ruoyi-ui/src/assets/styles/index.scss index e22db61a7..505e1b802 100644 --- a/ruoyi-ui/src/assets/styles/index.scss +++ b/ruoyi-ui/src/assets/styles/index.scss @@ -222,6 +222,9 @@ aside { &.justify-between { justify-content: space-between; } + &.justify-end { + justify-content: flex-end; + } } ul, diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index 12da3257c..443d4ba3d 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -459,7 +459,7 @@ export const constantRoutes = [{ component: Layout, hidden: true, children: [{ - path: 'teacher/:id(\\d+)', + path: 'teacher', component: () => import ('@/views/benyi/dayflowassessment/teacher'), name: 'dayflowassessmentteacher', diff --git a/ruoyi-ui/src/views/benyi/dayflowassessment/index.vue b/ruoyi-ui/src/views/benyi/dayflowassessment/index.vue index 9196c8fbd..9046ca927 100644 --- a/ruoyi-ui/src/views/benyi/dayflowassessment/index.vue +++ b/ruoyi-ui/src/views/benyi/dayflowassessment/index.vue @@ -445,7 +445,7 @@ export default { this.$router.push({ path: "/benyi/dayflowassessment/teacher/" + id }); }, handleAdd() { - this.$router.push({ path: "/benyi/dayflowassessment/teacher/0"}); + this.$router.push({ path: "/benyi/dayflowassessment/teacher"}); }, /** 修改按钮操作 */ handleUpdate(row) { diff --git a/ruoyi-ui/src/views/benyi/dayflowassessment/teacher.vue b/ruoyi-ui/src/views/benyi/dayflowassessment/teacher.vue index 3e65fe80c..e9e4ea510 100644 --- a/ruoyi-ui/src/views/benyi/dayflowassessment/teacher.vue +++ b/ruoyi-ui/src/views/benyi/dayflowassessment/teacher.vue @@ -34,18 +34,6 @@ </el-select> </el-form-item> </el-col> - <el-col :xs="24" :ms="12" :md="5"> - <el-form-item label="评估内容" prop="bzid"> - <el-select v-model="form.bzid" placeholder="请选择评估内容"> - <el-option - v-for="dict in detailOptions" - :key="dict.id" - :label="dict.name" - :value="dict.id" - ></el-option> - </el-select> - </el-form-item> - </el-col> </el-row> </el-form> <div class="mb8 btn-list"> @@ -60,38 +48,47 @@ > </div> <el-tabs v-model="activeName" type="card"> - <div - class="block" - v-for="itemTask in dayflowtaskList" - :key="itemTask.code" + <el-tab-pane + v-for="item in detailOptions" + :key="item.id" + :label="item.name" + :name="item.name" > - <h2 class="block-item-title flex align-center"> - {{ itemTask.taskLable }} - </h2> - <div - class="checkbox-content" - v-for="itemBz in dayflowstandardList.filter( - (p) => p.taskCode == itemTask.code + class="block" + v-for="itemTask in dayflowtaskList.filter( + (p) => p.detailId == item.id )" - :key="itemBz.id" + :key="itemTask.code" > - <p class="checkbox-item flex align-center"> - <el-row v-model="checkList"> - <div :label="itemBz.id" :key="itemBz.id" - >{{ itemBz.standardTitle }}分值: {{ itemBz.score }}分 - <el-input-number - v-model="num" - :precision="1" - :step="0.1" - :min="-itemBz.score" - :max="itemBz.score" - ></el-input-number - ></div> - </el-row> - </p> + <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="itemBz.score" + ></el-input-number> + </div> + </div> + </div> </div> - </div> + </el-tab-pane> </el-tabs> </div> </template> @@ -115,15 +112,8 @@ export default { data() { return { - num: 0, - dayflowassessmentId: null, // 遮罩层 loading: true, - // 选中数组 - ids: [], - // 评估内容表格数据 - assessmentcontentList: [], - // 根据一日流程id查到的名下任务列表 dayflowtaskList: [], // 根据任务查询到名下标准 @@ -152,37 +142,27 @@ export default { scope: undefined, sort: undefined, }, - activeName: "一日流程评估", - checked: false, - checkList: [], - // 表单参数 - form: {}, + activeName: "早间接待", // 表单校验 rules: { classid: [{ required: true, message: "班级不能为空", trigger: "blur" }], pgdx: [ { required: true, message: "评估对象不能为空", trigger: "blur" }, ], - bzid: [ - { required: true, message: "评估内容不能为空", trigger: "blur" }, - ], }, }; }, created() { - // this.getList(); - const dayflowassessmentId = this.$route.params && this.$route.params.id; - // this.dayflowassessmentId = dayflowassessmentId; this.getClassList(); this.getDayFlowList(); + this.getTaskList(); }, watch: { "form.classid": function (val) { this.getUserListByBjbh(val); + this.getTaskList(); }, - "form.bzid": function (val) { - this.dayflowassessmentId = val; - this.queryParams_detail.detailId = val; + "form.pgdx": function (val) { this.getTaskList(); }, }, @@ -219,7 +199,7 @@ export default { }, /** 查询一日流程任务列表 */ getTaskList() { - listDayflowtask(this.queryParams_detail).then((response) => { + listDayflowtask(null).then((response) => { this.dayflowtaskList = response.rows; }); listStandard(null).then((response) => { @@ -257,43 +237,11 @@ export default { }, /** 提交按钮 */ submitForm: function () { - this.$confirm("确认评估数据?评估后数据不能取消", "警告", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning", - callback: (action) => { - if (action === "confirm") { - var items = ""; - this.checkList.forEach((item) => { - //当全选被选中的时候,循环遍历源数据,把数据的每一项加入到默认选中的数组去 - items = items + item + ","; - }); - if (this.checkList.length == 0) { - this.msgError("请至少选择一项数据"); - } else { - this.form.id = this.dayflowassessmentId; - // this.form.classid = this.classid; - this.form.items = items; - this.form.pgdx = this.teacherName; - this.form.bzbh = this.zbjsxm; - this.form.planid = this.planid; - this.form.kfz = this.kfz; - this.form.bzmf = this.bzmf; - updateDayflowassessment(this.form).then((response) => { - if (response.code === 200) { - this.msgSuccess("评估成功"); - this.$router.go(-1); - this.$store.dispatch("tagsView/delView", this.$route); - // this.$router.push({ - // path: - // "/benyi/dayflowassessment", - // }); - } - }); - } - } else { - } - }, + console.log(this.dayflowstandardList); + this.$refs["form"].validate((valid) => { + if (valid) { + + } }); }, }, @@ -324,9 +272,14 @@ div { // } } } +.number-input { + width: 120px; +} + .block { padding: 10px; color: #333; + .block-item-title { padding: 10px 0; margin: 0; @@ -340,7 +293,19 @@ div { 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; @@ -361,6 +326,7 @@ div { .checkbox-item { font-size: 14px; line-height: 22px; + } .check-info { padding-left: 24px; diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByDayFlowStandard.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByDayFlowStandard.java index f84dd0429..9f653ef6c 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByDayFlowStandard.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByDayFlowStandard.java @@ -74,6 +74,8 @@ public class ByDayFlowStandard extends BaseEntity { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date updatetime; + private String mrz; + public void setId(Long id) { this.id = id; } @@ -146,6 +148,14 @@ public class ByDayFlowStandard extends BaseEntity { this.updatetime = updatetime; } + public String getMrz() { + return mrz; + } + + public void setMrz(String mrz) { + this.mrz = mrz; + } + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) @@ -159,6 +169,7 @@ public class ByDayFlowStandard extends BaseEntity { .append("updateuser", getUpdateuser()) .append("updatetime", getUpdatetime()) .append("score", getScore()) + .append("mrz", getMrz()) .toString(); }