合并幼儿信息和紧急联系人信息
This commit is contained in:
parent
bee07af3f3
commit
34268b85ca
@ -94,4 +94,4 @@ export function importTemplate() {
|
||||
url: '/benyi/child/importTemplate',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,15 @@ export function getContactpeople(id) {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 查询幼儿紧急情况联系人详细
|
||||
export function getContactpeopleByChildId(id) {
|
||||
return request({
|
||||
url: '/benyi/contactpeople/bychild/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增幼儿紧急情况联系人
|
||||
export function addContactpeople(data) {
|
||||
return request({
|
||||
|
@ -6,19 +6,19 @@
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-form-item label="幼儿姓名" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入姓名"
|
||||
placeholder="请输入幼儿姓名"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="性别" prop="xb">
|
||||
<el-form-item label="幼儿性别" prop="xb">
|
||||
<el-select
|
||||
v-model="queryParams.xb"
|
||||
placeholder="请选择性别"
|
||||
placeholder="请选择幼儿性别"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 240px"
|
||||
@ -31,10 +31,10 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-form-item label="当前状态" prop="status">
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
placeholder="请选择状态"
|
||||
placeholder="请选择当前状态"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 240px"
|
||||
@ -226,6 +226,8 @@
|
||||
|
||||
<!-- 添加或修改幼儿信息对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="幼儿基础信息">
|
||||
<el-row :gutter="15">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-col :span="12">
|
||||
@ -240,12 +242,18 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="小名" prop="infantName">
|
||||
<el-input v-model="form.infantName" placeholder="请输入小名" />
|
||||
<el-input
|
||||
v-model="form.infantName"
|
||||
placeholder="请输入小名"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手机号码" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入家长手机号码" />
|
||||
<el-input
|
||||
v-model="form.phone"
|
||||
placeholder="请输入家长手机号码"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@ -427,6 +435,167 @@
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="监护人信息">
|
||||
<el-form
|
||||
ref="form_jhr"
|
||||
:model="form_jhr"
|
||||
:rules="rules_jhr"
|
||||
label-width="120px"
|
||||
>
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="父亲姓名" prop="fathername">
|
||||
<el-input
|
||||
v-model="form_jhr.fathername"
|
||||
placeholder="请输入父亲姓名"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="fphone">
|
||||
<el-input
|
||||
v-model="form_jhr.fphone"
|
||||
placeholder="请输入父亲联系电话"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="办公电话" prop="foffphone">
|
||||
<el-input
|
||||
v-model="form_jhr.foffphone"
|
||||
placeholder="请输入父亲办公电话"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="母亲姓名" prop="mothername">
|
||||
<el-input
|
||||
v-model="form_jhr.mothername"
|
||||
placeholder="请输入母亲姓名"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="mphone">
|
||||
<el-input
|
||||
v-model="form_jhr.mphone"
|
||||
placeholder="请输入母亲联系电话"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="办公电话" prop="moffphone">
|
||||
<el-input
|
||||
v-model="form_jhr.moffphone"
|
||||
placeholder="请输入母亲办公电话"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="其他联系人姓名" prop="grandfathername">
|
||||
<el-input
|
||||
v-model="form_jhr.grandfathername"
|
||||
placeholder="请输入其他联系人姓名"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="与幼儿关系" prop="gfgx">
|
||||
<el-select
|
||||
v-model="form_jhr.gfgx"
|
||||
placeholder="请选择与幼儿关系"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in jtgxOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="gfphone">
|
||||
<el-input
|
||||
v-model="form_jhr.gfphone"
|
||||
placeholder="请输入联系电话"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="办公电话" prop="gfoffphone">
|
||||
<el-input
|
||||
v-model="form_jhr.gfoffphone"
|
||||
placeholder="请输入办公电话"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="住址" prop="gfaddress">
|
||||
<el-input
|
||||
v-model="form_jhr.gfaddress"
|
||||
placeholder="请输入住址"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="其他联系人姓名" prop="grandmothername">
|
||||
<el-input
|
||||
v-model="form_jhr.grandmothername"
|
||||
placeholder="请输入其他联系人姓名"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="与幼儿关系" prop="gmgx">
|
||||
<el-select
|
||||
v-model="form_jhr.gmgx"
|
||||
placeholder="请选择与幼儿关系"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in jtgxOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="gmphone">
|
||||
<el-input
|
||||
v-model="form_jhr.gmphone"
|
||||
placeholder="请输入联系电话"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="办公电话" prop="gmoffphone">
|
||||
<el-input
|
||||
v-model="form_jhr.gmoffphone"
|
||||
placeholder="请输入办公电话"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="住址" prop="gmaddress">
|
||||
<el-input
|
||||
v-model="form_jhr.gmaddress"
|
||||
placeholder="请输入住址"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
@ -503,6 +672,14 @@ import {
|
||||
updateChild_tb,
|
||||
importTemplate,
|
||||
} from "@/api/benyi/child";
|
||||
import {
|
||||
listContactpeople,
|
||||
getContactpeople,
|
||||
getContactpeopleByChildId,
|
||||
delContactpeople,
|
||||
addContactpeople,
|
||||
updateContactpeople,
|
||||
} from "@/api/benyi/contactpeople";
|
||||
|
||||
import { listClass } from "@/api/system/class";
|
||||
import { getToken } from "@/utils/auth";
|
||||
@ -569,6 +746,8 @@ export default {
|
||||
sourceOptions: [],
|
||||
//班级
|
||||
classOptions: [],
|
||||
//家庭关系
|
||||
jtgxOptions: [],
|
||||
//是否可编辑
|
||||
isable: false,
|
||||
// 幼儿导入参数
|
||||
@ -630,6 +809,10 @@ export default {
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单参数
|
||||
form_jhr: {},
|
||||
//监护人验证
|
||||
rules_jhr: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
name: [
|
||||
@ -663,6 +846,9 @@ export default {
|
||||
this.getDicts("sys_dm_ryqd").then((response) => {
|
||||
this.sourceOptions = response.data;
|
||||
});
|
||||
this.getDicts("sys_dm_jtgx").then((response) => {
|
||||
this.jtgxOptions = response.data;
|
||||
});
|
||||
this.getLink();
|
||||
},
|
||||
components: {
|
||||
@ -826,6 +1012,29 @@ export default {
|
||||
this.diglogForm2.area = "";
|
||||
|
||||
this.resetForm("form");
|
||||
|
||||
this.form_jhr = {
|
||||
id: undefined,
|
||||
childid: undefined,
|
||||
fathername: undefined,
|
||||
fphone: undefined,
|
||||
foffphone: undefined,
|
||||
mothername: undefined,
|
||||
mphone: undefined,
|
||||
moffphone: undefined,
|
||||
grandfathername: undefined,
|
||||
gfgx: undefined,
|
||||
gfphone: undefined,
|
||||
gfoffphone: undefined,
|
||||
gfaddress: undefined,
|
||||
grandmothername: undefined,
|
||||
gmgx: undefined,
|
||||
gmphone: undefined,
|
||||
gmaddress: undefined,
|
||||
gmoffphone: undefined,
|
||||
createTime: undefined,
|
||||
};
|
||||
this.resetForm("form_jhr");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
@ -850,10 +1059,10 @@ export default {
|
||||
this.title = "添加幼儿信息";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
async handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids;
|
||||
getChild(id).then((response) => {
|
||||
await getChild(id).then((response) => {
|
||||
this.form = response.data;
|
||||
|
||||
this.diglogForm.province = response.data.birthProvincename;
|
||||
@ -870,6 +1079,12 @@ export default {
|
||||
|
||||
this.open = true;
|
||||
this.title = "修改幼儿信息";
|
||||
|
||||
//根据幼儿id获取监护人信息
|
||||
getContactpeopleByChildId(this.form.id).then((res) => {
|
||||
// console.log("childid:" + this.form.id + ";jhr:" + res.data);
|
||||
this.form_jhr = res.data;
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
@ -879,17 +1094,25 @@ export default {
|
||||
if (this.form.id != undefined) {
|
||||
updateChild(this.form).then((response) => {
|
||||
if (response.code === 200) {
|
||||
updateContactpeople(this.form_jhr).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
addChild(this.form).then((response) => {
|
||||
console.log(response);
|
||||
if (response.code === 200) {
|
||||
this.form_jhr.childid = response.data;
|
||||
addContactpeople(this.form_jhr).then((res) => {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -941,7 +1164,7 @@ export default {
|
||||
},
|
||||
//所在省市区触发联动方法
|
||||
onSelected_brith(data) {
|
||||
console.log("onSelected_brith=" + data);
|
||||
// console.log("onSelected_brith=" + data);
|
||||
if (
|
||||
data.province.code == undefined ||
|
||||
data.city.code == undefined ||
|
||||
@ -959,7 +1182,7 @@ export default {
|
||||
},
|
||||
//户口所在地
|
||||
onSelected_registered(data) {
|
||||
console.log("onSelected_registered=" + data);
|
||||
// console.log("onSelected_registered=" + data);
|
||||
if (
|
||||
data.province.code == undefined ||
|
||||
data.city.code == undefined ||
|
||||
@ -977,7 +1200,7 @@ export default {
|
||||
},
|
||||
//住址所在地
|
||||
onSelected_addr(data) {
|
||||
console.log("onSelected_addr=" + data);
|
||||
// console.log("onSelected_addr=" + data);
|
||||
if (
|
||||
data.province.code == undefined ||
|
||||
data.city.code == undefined ||
|
||||
|
@ -121,7 +121,7 @@
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="选择幼儿" prop="childid">
|
||||
<el-select v-model="form.childid" placeholder="请输入选择幼儿">
|
||||
<el-select v-model="form.childid" placeholder="请输入选择幼儿" disabled="true">
|
||||
<el-option
|
||||
v-for="dict in childOptions"
|
||||
:key="dict.id"
|
||||
|
@ -75,6 +75,21 @@ public class ByChildContactpeopleController extends BaseController {
|
||||
return AjaxResult.success(byChildContactpeopleService.selectByChildContactpeopleById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取幼儿紧急情况联系人详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('benyi:contactpeople:query')")
|
||||
@GetMapping(value = "/bychild/{id}")
|
||||
public AjaxResult getInfoByChildId(@PathVariable("id") Long id) {
|
||||
ByChildContactpeople byChildContactpeople = new ByChildContactpeople();
|
||||
byChildContactpeople.setChildid(id);
|
||||
List<ByChildContactpeople> list = byChildContactpeopleService.selectByChildContactpeopleList(byChildContactpeople);
|
||||
if (list != null && list.size() > 0) {
|
||||
byChildContactpeople = list.get(0);
|
||||
}
|
||||
return AjaxResult.success(byChildContactpeople);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增幼儿紧急情况联系人
|
||||
*/
|
||||
|
@ -8,6 +8,8 @@ import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
import com.ruoyi.framework.security.LoginUser;
|
||||
import com.ruoyi.framework.security.service.TokenService;
|
||||
import com.ruoyi.project.benyi.domain.ByChildContactpeople;
|
||||
import com.ruoyi.project.benyi.service.IByChildContactpeopleService;
|
||||
import com.ruoyi.project.common.SchoolCommon;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -44,6 +46,8 @@ public class ByChildController extends BaseController {
|
||||
private SchoolCommon schoolCommon;
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
@Autowired
|
||||
private IByChildContactpeopleService byChildContactpeopleService;
|
||||
|
||||
/**
|
||||
* 查询幼儿信息列表
|
||||
@ -100,8 +104,8 @@ public class ByChildController extends BaseController {
|
||||
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
||||
String operName = loginUser.getUsername();
|
||||
Long deptId = loginUser.getUser().getDeptId();
|
||||
String bjbh=schoolCommon.getClassId();
|
||||
String message = byChildService.importChild(childList, operName,deptId,bjbh);
|
||||
String bjbh = schoolCommon.getClassId();
|
||||
String message = byChildService.importChild(childList, operName, deptId, bjbh);
|
||||
return AjaxResult.success(message);
|
||||
}
|
||||
|
||||
@ -145,7 +149,7 @@ public class ByChildController extends BaseController {
|
||||
@PreAuthorize("@ss.hasPermi('benyi:child:add')")
|
||||
@Log(title = "幼儿信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ByChild byChild) {
|
||||
public AjaxResult add(@RequestBody ByChild byChild, @RequestBody ByChildContactpeople byChildContactpeople) {
|
||||
//首先判断当前账户是否为幼儿园账号
|
||||
if (schoolCommon.isSchool()) {
|
||||
//学校id
|
||||
@ -156,7 +160,18 @@ public class ByChildController extends BaseController {
|
||||
if (schoolCommon.isStringEmpty(byChild.getClassid())) {
|
||||
byChild.setClassid(schoolCommon.getClassId());
|
||||
}
|
||||
return toAjax(byChildService.insertByChild(byChild));
|
||||
int i = byChildService.insertByChild(byChild);
|
||||
Long chilId = byChild.getId();
|
||||
if (i > 0) {
|
||||
chilId = byChild.getId();
|
||||
// System.out.println("newId:" + chilId);
|
||||
// System.out.println("byChildContactpeople:" + byChildContactpeople);
|
||||
// byChildContactpeople.setChildid(chilId);
|
||||
// byChildContactpeopleService.insertByChildContactpeople(byChildContactpeople);
|
||||
return AjaxResult.success(chilId.intValue());
|
||||
} else {
|
||||
return AjaxResult.error("创建失败,请联系管理员");
|
||||
}
|
||||
} else {
|
||||
return AjaxResult.error("当前用户非幼儿园,无法添加幼儿");
|
||||
}
|
||||
@ -196,6 +211,8 @@ public class ByChildController extends BaseController {
|
||||
@Log(title = "幼儿信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
//删除幼儿信息 同时删除幼儿联系人信息
|
||||
byChildContactpeopleService.deleteByChildContactpeopleByChildIds(ids);
|
||||
return toAjax(byChildService.deleteByChildByIds(ids));
|
||||
}
|
||||
|
||||
|
@ -58,4 +58,12 @@ public interface ByChildContactpeopleMapper {
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteByChildContactpeopleByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 批量删除幼儿紧急情况联系人
|
||||
*
|
||||
* @param childIds 需要删除的幼儿紧急情况联系人ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteByChildContactpeopleByChildIds(Long[] childIds);
|
||||
}
|
||||
|
@ -58,4 +58,12 @@ public interface IByChildContactpeopleService {
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteByChildContactpeopleById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除幼儿紧急情况联系人
|
||||
*
|
||||
* @param childIds 需要删除的幼儿紧急情况联系人ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteByChildContactpeopleByChildIds(Long[] childIds);
|
||||
}
|
||||
|
@ -86,4 +86,15 @@ public class ByChildContactpeopleServiceImpl implements IByChildContactpeopleSer
|
||||
public int deleteByChildContactpeopleById(Long id) {
|
||||
return byChildContactpeopleMapper.deleteByChildContactpeopleById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除幼儿紧急情况联系人
|
||||
*
|
||||
* @param childIds 需要删除的幼儿紧急情况联系人ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteByChildContactpeopleByChildIds(Long[] childIds) {
|
||||
return byChildContactpeopleMapper.deleteByChildContactpeopleByChildIds(childIds);
|
||||
}
|
||||
}
|
||||
|
@ -149,4 +149,11 @@
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByChildContactpeopleByChildIds" parameterType="String">
|
||||
delete from by_child_contactpeople where childid in
|
||||
<foreach item="childid" collection="array" open="(" separator="," close=")">
|
||||
#{childid}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Loading…
x
Reference in New Issue
Block a user