From e7b4d9b40ef3b443207666c47f75ae5329332e19 Mon Sep 17 00:00:00 2001 From: paidaxing444 <12qwaszx> Date: Fri, 24 Jul 2020 10:27:16 +0800 Subject: [PATCH] =?UTF-8?q?20200724-zlp-1=20=E5=B9=BC=E5=84=BF=E8=80=83?= =?UTF-8?q?=E5=8B=A4=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/api/benyi/child.js | 9 +++ .../src/views/benyi/checkindetail/index.vue | 76 ++++++++++++++++--- .../ByChildCheckinDetailController.java | 7 +- .../benyi/controller/ByChildController.java | 10 +++ .../benyi/controller/ByMathController.java | 3 + .../project/benyi/mapper/ByChildMapper.java | 8 ++ .../benyi/service/IByChildService.java | 8 ++ .../service/impl/ByChildServiceImpl.java | 11 +++ .../service/impl/ByThemeServiceImpl.java | 2 +- .../benyi/ByChildCheckinDetailMapper.xml | 1 + .../resources/mybatis/benyi/ByChildMapper.xml | 67 ++++++++++++++++ .../resources/mybatis/benyi/ByMathMapper.xml | 1 + 12 files changed, 189 insertions(+), 14 deletions(-) diff --git a/ruoyi-ui/src/api/benyi/child.js b/ruoyi-ui/src/api/benyi/child.js index c72ca6e39..5b4421c11 100644 --- a/ruoyi-ui/src/api/benyi/child.js +++ b/ruoyi-ui/src/api/benyi/child.js @@ -9,6 +9,15 @@ export function listChild(query) { }) } +// 查询幼儿信息列表 +export function listByCheck(query) { + return request({ + url: '/benyi/child/listByCheck', + method: 'get', + params: query + }) +} + // 查询幼儿信息详细 export function getChild(id) { return request({ diff --git a/ruoyi-ui/src/views/benyi/checkindetail/index.vue b/ruoyi-ui/src/views/benyi/checkindetail/index.vue index a4cc7315b..51eea4dfb 100644 --- a/ruoyi-ui/src/views/benyi/checkindetail/index.vue +++ b/ruoyi-ui/src/views/benyi/checkindetail/index.vue @@ -30,6 +30,17 @@ /> + + + 搜索 重置 @@ -78,7 +89,7 @@ - + @@ -99,6 +110,7 @@ icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['benyi:checkindetail:edit']" + :disabled="!checkSelectable(scope.row)" >修改 删除 @@ -127,10 +140,16 @@ :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange" + :disabled="isable" >全选
- {{child.name}} + {{child.name}}
@@ -163,7 +182,7 @@ import { exportDetail } from "@/api/benyi/checkindetail"; -import { listChild } from "@/api/benyi/child"; +import { listByCheck, listChild } from "@/api/benyi/child"; import { listClass } from "@/api/system/class"; @@ -171,6 +190,7 @@ export default { name: "Detail", data() { return { + isable: false, checkAll: false, checkedChilds: [], childs: [], @@ -204,7 +224,8 @@ export default { childid: undefined, childname: undefined, type: undefined, - createuserid: undefined + createuserid: undefined, + createTime: undefined }, // 表单参数 form: {}, @@ -229,6 +250,16 @@ export default { }); }, methods: { + //控制按钮可用 + checkSelectable(row) { + var date = new Date(); + //console.log(date.toLocaleDateString()); + return this.CompareDate(row.createTime, date.toLocaleDateString()); + }, + //比较日期大小 + CompareDate(d1, d2) { + return new Date(d1.replace(/-/g, "/")) > new Date(d2.replace(/-/g, "/")); + }, //班级列表 getClassList() { listClass(null).then(response => { @@ -280,6 +311,8 @@ export default { createTime: undefined }; this.resetForm("form"); + + this.checkedChilds = []; }, /** 搜索按钮操作 */ handleQuery() { @@ -299,18 +332,25 @@ export default { }, /** 新增按钮操作 */ handleAdd() { + this.reset(); + this.isable = false; this.open = true; this.title = "幼儿考勤"; - listChild(null).then(response => { + listByCheck(null).then(response => { this.childs = response.rows; }); }, /** 修改按钮操作 */ handleUpdate(row) { this.reset(); + this.isable = true; const id = row.id || this.ids; getDetail(id).then(response => { this.form = response.data; + listChild(null).then(response => { + this.childs = response.rows; + }); + this.checkedChilds.push(response.data.childid); this.open = true; this.title = "修改幼儿考勤"; }); @@ -323,14 +363,26 @@ export default { this.msgError("请至少选择一个幼儿"); return; } - //提交 - addDetail(this.form).then(response => { - if (response.code === 200) { - this.msgSuccess("添加考勤成功"); - this.open = false; - this.getList(); + if (valid) { + if (this.form.id != undefined) { + updateDetail(this.form).then(response => { + if (response.code === 200) { + this.msgSuccess("修改考勤成功"); + this.open = false; + this.getList(); + } + }); + } else { + //提交 + addDetail(this.form).then(response => { + if (response.code === 200) { + this.msgSuccess("添加考勤成功"); + this.open = false; + this.getList(); + } + }); } - }); + } } }); }, diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByChildCheckinDetailController.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByChildCheckinDetailController.java index 82058159f..eba571fc8 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByChildCheckinDetailController.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByChildCheckinDetailController.java @@ -1,5 +1,6 @@ package com.ruoyi.project.benyi.controller; +import java.util.Date; import java.util.List; import com.ruoyi.common.utils.SecurityUtils; @@ -48,6 +49,10 @@ public class ByChildCheckinDetailController extends BaseController { @GetMapping("/list") public TableDataInfo list(ByChildCheckinDetail byChildCheckinDetail) { startPage(); + System.out.println("checkintime=" + byChildCheckinDetail.getCreateTime()); + if (byChildCheckinDetail.getCreateTime() == null) { + byChildCheckinDetail.setCreateTime(new Date()); + } List list = byChildCheckinDetailService.selectByChildCheckinDetailList(byChildCheckinDetail); return getDataTable(list); } @@ -89,7 +94,7 @@ public class ByChildCheckinDetailController extends BaseController { for (int i = 0; i < strArr.length; i++) { Long cid = Long.parseLong(strArr[i]); byChildCheckinDetail.setChildid(cid); - ByChild byChild=byChildService.selectByChildById(cid); + ByChild byChild = byChildService.selectByChildById(cid); byChildCheckinDetail.setChildname(byChild.getName()); byChildCheckinDetail.setClassid(byChild.getClassid()); byChildCheckinDetail.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId()); diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByChildController.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByChildController.java index cc0129e55..b9bf0c28a 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByChildController.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByChildController.java @@ -48,6 +48,16 @@ public class ByChildController extends BaseController { return getDataTable(list); } + /** + * 查询幼儿考勤列表 + */ + @PreAuthorize("@ss.hasPermi('benyi:checkindetail:list')") + @GetMapping("/listByCheck") + public TableDataInfo listByCheck(ByChild byChild) { + List list = byChildService.selectByCheckList(byChild); + return getDataTable(list); + } + /** * 导出幼儿信息列表 */ diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByMathController.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByMathController.java index 1bb368b34..a79fddcdb 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByMathController.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByMathController.java @@ -74,6 +74,9 @@ public class ByMathController extends BaseController @GetMapping("/treeselect") public AjaxResult treeselect(ByMath byMath) { List byMathDetails = byMathService.selectByMathListTree(byMath); +// for(int i=0;iand childname like concat('%', #{childname}, '%') and type = #{type} and createuserid = #{createuserid} + and to_days(create_time) =to_days(#{createTime}) diff --git a/ruoyi/src/main/resources/mybatis/benyi/ByChildMapper.xml b/ruoyi/src/main/resources/mybatis/benyi/ByChildMapper.xml index f20798d54..99aa76460 100644 --- a/ruoyi/src/main/resources/mybatis/benyi/ByChildMapper.xml +++ b/ruoyi/src/main/resources/mybatis/benyi/ByChildMapper.xml @@ -120,6 +120,73 @@ + +