幼儿紧急联系人
This commit is contained in:
53
ruoyi-ui/src/api/benyi/contactpeople.js
Normal file
53
ruoyi-ui/src/api/benyi/contactpeople.js
Normal file
@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询幼儿紧急情况联系人列表
|
||||
export function listContactpeople(query) {
|
||||
return request({
|
||||
url: '/benyi/contactpeople/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询幼儿紧急情况联系人详细
|
||||
export function getContactpeople(id) {
|
||||
return request({
|
||||
url: '/benyi/contactpeople/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增幼儿紧急情况联系人
|
||||
export function addContactpeople(data) {
|
||||
return request({
|
||||
url: '/benyi/contactpeople',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改幼儿紧急情况联系人
|
||||
export function updateContactpeople(data) {
|
||||
return request({
|
||||
url: '/benyi/contactpeople',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除幼儿紧急情况联系人
|
||||
export function delContactpeople(id) {
|
||||
return request({
|
||||
url: '/benyi/contactpeople/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出幼儿紧急情况联系人
|
||||
export function exportContactpeople(query) {
|
||||
return request({
|
||||
url: '/benyi/contactpeople/export',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
353
ruoyi-ui/src/views/benyi/contactpeople/index.vue
Normal file
353
ruoyi-ui/src/views/benyi/contactpeople/index.vue
Normal file
@ -0,0 +1,353 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
||||
<el-form-item label="幼儿id" prop="childid">
|
||||
<el-input
|
||||
v-model="queryParams.childid"
|
||||
placeholder="请输入幼儿id"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="父亲姓名" prop="fathername">
|
||||
<el-input
|
||||
v-model="queryParams.fathername"
|
||||
placeholder="请输入父亲姓名"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="母亲姓名" prop="mothername">
|
||||
<el-input
|
||||
v-model="queryParams.mothername"
|
||||
placeholder="请输入母亲姓名"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['benyi:contactpeople:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['benyi:contactpeople:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['benyi:contactpeople:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="contactpeopleList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="编号" align="center" prop="id" />
|
||||
<el-table-column label="幼儿id" align="center" prop="childid" />
|
||||
<el-table-column label="父亲姓名" align="center" prop="fathername" />
|
||||
<el-table-column label="父亲联系电话" align="center" prop="fphone" />
|
||||
<el-table-column label="父亲办公电话" align="center" prop="foffphone" />
|
||||
<el-table-column label="母亲姓名" align="center" prop="mothername" />
|
||||
<el-table-column label="母亲联系电话" align="center" prop="mphone" />
|
||||
<el-table-column label="母亲办公电话" align="center" prop="moffphone" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['benyi:contactpeople:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['benyi:contactpeople:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改幼儿紧急情况联系人对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="幼儿id" prop="childid">
|
||||
<el-input v-model="form.childid" placeholder="请输入幼儿id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="父亲姓名" prop="fathername">
|
||||
<el-input v-model="form.fathername" placeholder="请输入父亲姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="父亲联系电话" prop="fphone">
|
||||
<el-input v-model="form.fphone" placeholder="请输入父亲联系电话" />
|
||||
</el-form-item>
|
||||
<el-form-item label="父亲办公电话" prop="foffphone">
|
||||
<el-input v-model="form.foffphone" placeholder="请输入父亲办公电话" />
|
||||
</el-form-item>
|
||||
<el-form-item label="母亲姓名" prop="mothername">
|
||||
<el-input v-model="form.mothername" placeholder="请输入母亲姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="母亲联系电话" prop="mphone">
|
||||
<el-input v-model="form.mphone" placeholder="请输入母亲联系电话" />
|
||||
</el-form-item>
|
||||
<el-form-item label="母亲办公电话" prop="moffphone">
|
||||
<el-input v-model="form.moffphone" placeholder="请输入母亲办公电话" />
|
||||
</el-form-item>
|
||||
<el-form-item label="其他紧急联系姓名" prop="grandfathername">
|
||||
<el-input v-model="form.grandfathername" placeholder="请输入其他紧急联系姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="与幼儿关系" prop="gfgx">
|
||||
<el-input v-model="form.gfgx" placeholder="请输入与幼儿关系" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话" prop="gfphone">
|
||||
<el-input v-model="form.gfphone" placeholder="请输入联系电话" />
|
||||
</el-form-item>
|
||||
<el-form-item label="办公电话" prop="gfoffphone">
|
||||
<el-input v-model="form.gfoffphone" placeholder="请输入办公电话" />
|
||||
</el-form-item>
|
||||
<el-form-item label="住址" prop="gfaddress">
|
||||
<el-input v-model="form.gfaddress" placeholder="请输入住址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="其他联系人姓名2" prop="grandmothername">
|
||||
<el-input v-model="form.grandmothername" placeholder="请输入其他联系人姓名2" />
|
||||
</el-form-item>
|
||||
<el-form-item label="与幼儿关系2" prop="gmgx">
|
||||
<el-input v-model="form.gmgx" placeholder="请输入与幼儿关系2" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话2" prop="gmphone">
|
||||
<el-input v-model="form.gmphone" placeholder="请输入联系电话2" />
|
||||
</el-form-item>
|
||||
<el-form-item label="住址2" prop="gmaddress">
|
||||
<el-input v-model="form.gmaddress" placeholder="请输入住址2" />
|
||||
</el-form-item>
|
||||
<el-form-item label="办公电话2" prop="gmoffphone">
|
||||
<el-input v-model="form.gmoffphone" placeholder="请输入办公电话2" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listContactpeople,
|
||||
getContactpeople,
|
||||
delContactpeople,
|
||||
addContactpeople,
|
||||
updateContactpeople,
|
||||
} from "@/api/benyi/contactpeople";
|
||||
|
||||
export default {
|
||||
name: "Contactpeople",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 幼儿紧急情况联系人表格数据
|
||||
contactpeopleList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
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,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询幼儿紧急情况联系人列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listContactpeople(this.queryParams).then((response) => {
|
||||
this.contactpeopleList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
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");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map((item) => item.id);
|
||||
this.single = selection.length != 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加幼儿紧急情况联系人";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids;
|
||||
getContactpeople(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改幼儿紧急情况联系人";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function () {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.id != undefined) {
|
||||
updateContactpeople(this.form).then((response) => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
addContactpeople(this.form).then((response) => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$confirm(
|
||||
'是否确认删除幼儿紧急情况联系人编号为"' + ids + '"的数据项?',
|
||||
"警告",
|
||||
{
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
}
|
||||
)
|
||||
.then(function () {
|
||||
return delContactpeople(ids);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(function () {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
@ -204,7 +204,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
handleAvatarSuccess(res, file) {
|
||||
console.log(res);
|
||||
//console.log(res);
|
||||
if (res.code == "200") {
|
||||
this.form.fileurl = res.fileName;
|
||||
this.form.filetype = res.fileName.split(".")[1];
|
||||
@ -213,13 +213,13 @@ export default {
|
||||
}
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
console.log(file, fileList);
|
||||
//console.log(file, fileList);
|
||||
if (file.response.code == "200") {
|
||||
this.form.fileurl = "";
|
||||
}
|
||||
},
|
||||
handlePreview(file) {
|
||||
console.log(file);
|
||||
//console.log(file);
|
||||
},
|
||||
handleExceed(files, fileList) {
|
||||
this.$message.warning(
|
||||
|
Reference in New Issue
Block a user