幼儿评估

This commit is contained in:
paidaxing444 2020-11-06 15:42:02 +08:00
parent b47d7380f7
commit 796479c5f1
5 changed files with 210 additions and 8 deletions

View File

@ -0,0 +1,53 @@
import request from '@/utils/request'
// 查询幼儿评估列表
export function listAssessmentchild(query) {
return request({
url: '/benyi/assessmentchild/list',
method: 'get',
params: query
})
}
// 查询幼儿评估详细
export function getAssessmentchild(id) {
return request({
url: '/benyi/assessmentchild/' + id,
method: 'get'
})
}
// 新增幼儿评估
export function addAssessmentchild(data) {
return request({
url: '/benyi/assessmentchild',
method: 'post',
data: data
})
}
// 修改幼儿评估
export function updateAssessmentchild(data) {
return request({
url: '/benyi/assessmentchild',
method: 'put',
data: data
})
}
// 删除幼儿评估
export function delAssessmentchild(id) {
return request({
url: '/benyi/assessmentchild/' + id,
method: 'delete'
})
}
// 导出幼儿评估
export function exportAssessmentchild(query) {
return request({
url: '/benyi/assessmentchild/export',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,53 @@
import request from '@/utils/request'
// 查询幼儿评估记录列表
export function listAssessmentrecordchild(query) {
return request({
url: '/benyi/assessmentrecordchild/list',
method: 'get',
params: query
})
}
// 查询幼儿评估记录详细
export function getAssessmentrecordchild(id) {
return request({
url: '/benyi/assessmentrecordchild/' + id,
method: 'get'
})
}
// 新增幼儿评估记录
export function addAssessmentrecordchild(data) {
return request({
url: '/benyi/assessmentrecordchild',
method: 'post',
data: data
})
}
// 修改幼儿评估记录
export function updateAssessmentrecordchild(data) {
return request({
url: '/benyi/assessmentrecordchild',
method: 'put',
data: data
})
}
// 删除幼儿评估记录
export function delAssessmentrecordchild(id) {
return request({
url: '/benyi/assessmentrecordchild/' + id,
method: 'delete'
})
}
// 导出幼儿评估记录
export function exportAssessmentrecordchild(query) {
return request({
url: '/benyi/assessmentrecordchild/export',
method: 'get',
params: query
})
}

View File

@ -13,6 +13,7 @@
icon="el-icon-s-data"
size="mini"
@click="submitForm"
v-hasPermi="['benyi:assessmentchild:add']"
>生成图表</el-button
>
</div>
@ -72,9 +73,14 @@
:key="itemYs.id"
>
<p class="checkbox-item flex align-center">
<el-checkbox v-model="itemYs.id">{{
itemYs.name
}}</el-checkbox>
<el-checkbox-group
v-model="checkList"
@change="handlecheckedItemsChange"
>
<el-checkbox :label="itemYs.id" :key="itemYs.id">{{
itemYs.name
}}</el-checkbox>
</el-checkbox-group>
</p>
<div class="check-info" v-if="itemYs.ckbz">
{{ itemYs.ckbz }}
@ -156,15 +162,21 @@ import {
} from "@/api/benyi/assessmentcontent";
import { getChildByAssessment } from "@/api/benyi/child";
import {
addAssessmentchild,
updateAssessmentchild,
} from "@/api/benyi/assessmentchild";
export default {
name: "Assessmentstudent",
data() {
return {
childId: "",
childName: "",
childCsrq: "",
bjmc: "",
classid: "",
trem: "",
zbjsxm: "",
assessmentscope: "",
@ -174,6 +186,8 @@ export default {
ids: [],
//
assessmentcontentList: [],
//
form: {},
//
queryParams: {
parentid: undefined,
@ -184,23 +198,26 @@ export default {
},
activeName: "健康",
checked: false,
checkList: [],
};
},
created() {
// this.getList();
const childId = this.$route.params && this.$route.params.id;
console.log("childId:" + childId);
this.childId = childId;
// console.log("childId:" + childId);
this.getChild(childId);
},
methods: {
getChild(childId) {
getChildByAssessment(childId).then((response) => {
console.log(response);
// console.log(response);
if (response.code == "200") {
this.childName = response.data.name;
this.childCsrq = response.data.csrq;
this.trem = response.trem;
this.bjmc = response.data.bjmc;
this.classid = response.data.classid;
this.zbjsxm = response.data.zbjsmc;
if (response.isAssessment == "0") {
this.msgError(
@ -218,7 +235,7 @@ export default {
getList() {
this.loading = true;
listAssessmentcontent(this.queryParams).then((response) => {
console.log("rows:" + response.rows);
// console.log("rows:" + response.rows);
this.assessmentcontentList = response.rows;
this.loading = false;
});
@ -233,11 +250,55 @@ export default {
this.resetForm("queryForm");
this.handleQuery();
},
// //
// reset() {
// this.form = {
// id: undefined,
// childid: undefined,
// classid: undefined,
// contentid: undefined,
// type: undefined,
// xn: undefined,
// userid: undefined,
// createTime: undefined,
// };
// this.resetForm("form");
// },
/** 提交按钮 */
submitForm: function () {},
submitForm: function () {
var items = "";
this.checkList.forEach((item) => {
//
items = items + item + ",";
});
// console.log(items);
// console.log(""+this.checkList.length);
if (this.checkList.length == 0) {
this.msgError("请至少选择一项数据");
} else {
this.form.childid = this.childId;
this.form.classid = this.classid;
this.form.items = items;
this.form.type = "Y";
this.form.xn = this.trem;
addAssessmentchild(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("评估成功");
}
});
}
},
handleClick(tab) {
// this.activeName = tab
},
handlecheckedItemsChange(value) {
// var items = "";
// this.checkList.forEach((item) => {
// //
// items = items + item + ",";
// });
// console.log(items);
},
},
};
</script>

View File

@ -2,6 +2,8 @@ package com.ruoyi.project.benyi.controller;
import java.util.List;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.project.common.SchoolCommon;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -32,6 +34,8 @@ import com.ruoyi.framework.web.page.TableDataInfo;
public class ByAssessmentchildController extends BaseController {
@Autowired
private IByAssessmentchildService byAssessmentchildService;
@Autowired
private SchoolCommon schoolCommon;
/**
* 查询幼儿评估列表
@ -72,7 +76,23 @@ public class ByAssessmentchildController extends BaseController {
@Log(title = "幼儿评估", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ByAssessmentchild byAssessmentchild) {
return toAjax(byAssessmentchildService.insertByAssessmentchild(byAssessmentchild));
int iCount = 0;
byAssessmentchild.setUserid(SecurityUtils.getLoginUser().getUser().getUserId());
String strItems = byAssessmentchild.getItems();
//System.out.println("执行嘛?"+strItems);
//判断选中的checkbox是否为空
if (schoolCommon.isStringEmpty(strItems)) {
return AjaxResult.error("请至少选择一个评估项");
} else {
String[] strArr = strItems.split(",");
for (int i = 0; i < strArr.length; i++) {
//System.out.println("contentid:"+strArr[i]);
byAssessmentchild.setContentid(Long.valueOf(strArr[i]));
iCount = byAssessmentchildService.insertByAssessmentchild(byAssessmentchild);
}
}
return toAjax(iCount);
}
/**

View File

@ -55,6 +55,11 @@ public class ByAssessmentchild extends BaseEntity {
@Excel(name = "创建人")
private Long userid;
/**
* 临时创建用
*/
private String items;
public void setId(Long id) {
this.id = id;
}
@ -111,6 +116,15 @@ public class ByAssessmentchild extends BaseEntity {
return userid;
}
public void setItems(String items) {
this.items = items;
}
public String getItems() {
return items;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
@ -122,6 +136,7 @@ public class ByAssessmentchild extends BaseEntity {
.append("xn", getXn())
.append("userid", getUserid())
.append("createTime", getCreateTime())
.append("items", getItems())
.toString();
}
}