NurseStationUI/src/views/system/person/index.vue

1278 lines
37 KiB
Vue
Raw Normal View History

<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<!-- <el-form-item label="护理站表id" prop="nurseStationId">
<el-input
v-model="queryParams.nurseStationId"
placeholder="请输入护理站表id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> -->
<!-- <el-form-item label="所属科室编码" prop="departmentCode">
<el-input
v-model="queryParams.departmentCode"
placeholder="请输入所属科室编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> -->
<!-- <el-form-item label="创建人id" prop="userId">
<el-input
v-model="queryParams.userId"
placeholder="请输入创建人id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> -->
<!-- <el-form-item label="护理站人员编码" prop="nursePersonCode">
<el-input
v-model="queryParams.nursePersonCode"
placeholder="请输入护理站人员编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> -->
<!-- <el-form-item
label="所属护理站"
prop="nursePersonName"
label-width="90px"
>
<el-select
v-model="queryParams.nursePersonName"
clearable
placeholder="请选择护理站"
v-loadmore="loadMore"
>
<el-option
v-for="item in nurseStationlist"
:key="item.id"
:label="item.nurseStationName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item> -->
<el-form-item label="护理站" prop="departmentName">
<el-select
v-model="queryParams.nurseStationId"
clearable
placeholder="请选择护理站"
v-loadmore="loadMore"
@keyup.enter.native="handleQuery"
>
<el-option
v-for="item in nurseStationlist"
:key="item.id"
:label="item.nurseStationName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="所属科室" prop="departmentName">
<el-input
v-model="queryParams.departmentName"
placeholder="请输入所属科室"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="姓名" prop="nursePersonName">
<el-input
v-model="queryParams.nursePersonName"
placeholder="请输入居住地址"
clearable
@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"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:person:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:person:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:person:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:person:export']"
>导出</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="nurseStationPersonList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="主键id" align="center" prop="id" /> -->
<!-- <el-table-column label="护理站表id" align="center" prop="nurseStationId" /> -->
<!-- <el-table-column
label="所属科室编码"
align="center"
prop="departmentCode"
/> -->
<!-- <el-table-column label="创建人id" align="center" prop="userId" /> -->
<!-- <el-table-column
label="护理站人员编码"
align="center"
prop="nursePersonCode"
/> -->
<el-table-column
label="护理站名称"
align="center"
prop="nurseStationName"
/>
<el-table-column label="科室名称" align="center" prop="departmentName" />
<el-table-column label="编码" align="center" prop="departmentCode" />
<el-table-column label="姓名" align="center" prop="nursePersonName" />
<el-table-column label="性别" align="center" prop="sex">
<template slot-scope="scope">
{{ scope.row.sex == "MALE" ? "男" : "" }}
{{ scope.row.sex == "FEMALE" ? "女" : "" }}
</template>
</el-table-column>
<el-table-column
label="护理站人员类型"
align="center"
prop="nursePersonType"
>
<template slot-scope="scope">
{{ scope.row.nursePersonType == "NURSE" ? "护士" : "" }}
{{ scope.row.nursePersonType == "NURSE_TEACHER" ? "护理师" : "" }}
</template>
</el-table-column>
<el-table-column label="联系电话" align="center" prop="phone" />
<el-table-column label="居住地址" align="center" prop="address" />
<el-table-column label="创建人" align="center" prop="createBy" />
<el-table-column label="创建时间" align="center" prop="createTime" />
<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="['system:person:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:person: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="open2"
width="1048px"
append-to-body
>
<el-form
ref="form"
:model="form"
:rules="rules"
label-width="80px"
:inline="true"
>
<!-- <el-form-item label="护理站表id" prop="nurseStationId">
<el-input v-model="form.nurseStationId" placeholder="请输入护理站表id" />
</el-form-item> -->
<div
v-for="(item, index) in form.nurseStationPersonList"
:key="index"
style="margin-top: 10px"
>
<!-- <el-form-item label="所属科室编码"
label-width="120px" :prop="`nurseStationPersonList.${index}.departmentCode`">
<el-input
v-model="item.departmentCode"
placeholder="请输入所属科室编码"
/>
</el-form-item> -->
<!-- <el-form-item label="创建人id" prop="userId">
<el-input v-model="form.userId" placeholder="请输入创建人id" />
</el-form-item> -->
<!-- <el-form-item label="护理站人员编码"
label-width="120px" :prop="`nurseStationPersonList.${index}.nursePersonCode`">
<el-input
v-model="item.nursePersonCode"
placeholder="请输入护理站人员编码"
/>
</el-form-item> -->
<el-form-item
label="所属护理站"
label-width="120px"
:rules="rules.nurseStationPersonList.nurseStationId"
:prop="`nurseStationPersonList.${index}.nurseStationId`"
>
<el-button
type=""
@click="clickinnerVisible(item, index)"
v-if="item.nurseStationName == '请选择护理站名称'"
style="
width: 200px;
text-align: left;
height: 36px;
color: #c0c4cc;
"
>{{ item.nurseStationName }}</el-button
>
<el-button
type=""
@click="clickinnerVisible(item, index)"
v-else
style="
width: 200px;
text-align: left;
height: 36px;
padding-left: -10px;
"
>{{ item.nurseStationName }}</el-button
>
</el-form-item>
<el-form-item
label="所属科室"
label-width="120px"
:rules="rules.nurseStationPersonList.departmentName"
:prop="`nurseStationPersonList.${index}.departmentCode`"
>
<el-button
type=""
@click="departclick(item, index)"
v-if="item.departmentName == '请选择所属科室'"
style="
width: 200px;
text-align: left;
height: 36px;
color: #c0c4cc;
"
>{{ item.departmentName }}</el-button
>
<el-button
type=""
@click="departclick(item, index)"
v-else
style="
width: 200px;
text-align: left;
height: 36px;
padding-left: -10px;
"
>{{ item.departmentName }}</el-button
>
</el-form-item>
<el-form-item
label="护理人姓名"
label-width="120px"
:rules="rules.nurseStationPersonList.nursePersonName"
:prop="`nurseStationPersonList.${index}.nursePersonName`"
>
<el-input
maxlength="15"
v-model="item.nursePersonName"
placeholder="请输入护理人姓名"
/>
</el-form-item>
<el-form-item
label="护理人职称"
label-width="120px"
:rules="rules.nurseStationPersonList.nursePersonType"
:prop="`nurseStationPersonList.${index}.nursePersonType`"
>
<el-select
v-model="item.nursePersonType"
clearable
placeholder="请选择"
style="width: 200px"
>
<el-option
v-for="item in nursePersonTypes"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label="性别"
style="margin-left: 42px"
:rules="rules.nurseStationPersonList.sex"
:prop="`nurseStationPersonList.${index}.sex`"
>
<el-select
v-model="item.sex"
clearable
placeholder="请选择"
style="width: 200px"
>
<el-option
v-for="item in sexs"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label="联系电话"
label-width="120px"
:rules="rules.nurseStationPersonList.phone"
:prop="`nurseStationPersonList.${index}.phone`"
>
<el-input
v-model="item.phone"
placeholder="请输入联系电话"
maxlength="11"
/>
</el-form-item>
<el-form-item
label="居住地址"
label-width="120px"
:rules="rules.nurseStationPersonList.address"
:prop="`nurseStationPersonList.${index}.address`"
>
<el-input
v-model="item.address"
placeholder="请输入居住地址"
maxlength="50"
/>
</el-form-item>
<el-button
type="primary"
circle
plain
icon="el-icon-circle-plus-outline"
@click="adddisease"
v-if="index == 0"
></el-button>
<el-button
type="danger"
icon="el-icon-delete"
circle
plain
@click="deldisease(index)"
v-if="index != 0"
></el-button>
</div>
</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>
<!-- 护理站名称弹框 -->
<el-dialog
:title="title2"
:visible.sync="innerVisible"
width="1000px"
append-to-body
>
<el-form
ref="queryForm"
:model="queryParams2"
:rules="rules"
label-width="80px"
:inline="true"
>
<!-- <el-form
:model="queryParams2"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="90px"
> -->
<el-form-item
label="护理站编码"
prop="nurseStationCode"
label-width="120"
>
<el-input
v-model="queryParams2.nurseStationCode"
placeholder="请输入护理站编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item
label="护理站名称"
prop="nurseStationName"
label-width="120"
>
<el-input
v-model="queryParams2.nurseStationName"
placeholder="请输入护理站名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery2"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery2"
>重置</el-button
>
</el-form-item>
</el-form>
<el-table :data="stationLists" @cell-dblclick="nurseclick">
<el-table-column label="请选择" width="70" align="center">
<template slot-scope="scope">
<el-button
type="primary"
style="width: 15px; height: 15px"
v-if="stationid == scope.row.id"
circle
@click="nurseclick(scope.row)"
></el-button>
<el-button
v-else
style="width: 15px; height: 15px"
circle
@click="nurseclick(scope.row)"
></el-button>
</template>
</el-table-column>
<el-table-column
property="nurseStationCode"
label="护理站编码"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="nurseStationName"
label="护理站名称"
width="150"
align="center"
>
</el-table-column>
<el-table-column
label="护理站类型"
align="center"
prop="nurseStationType"
>
<template slot-scope="scope">
{{
scope.row.nurseStationType == "LX202209140018" ? "生活护理" : ""
}}
{{
scope.row.nurseStationType == "LX202209140019" ? "医疗护理" : ""
}}
</template>
</el-table-column>
<el-table-column
property="phone"
label="联系电话"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="address"
label="护理地址"
width="150"
align="center"
>
</el-table-column>
</el-table>
<pagination
v-show="total2 > 0"
:total="total2"
:page.sync="queryParams2.pageNum"
:limit.sync="queryParams2.pageSize"
@pagination="handleQuery2"
/>
</el-dialog>
<!-- 所属科室弹框 -->
<el-dialog
:title="title3"
:visible.sync="innerVisible2"
width="1000px"
append-to-body
>
<el-form
ref="queryForm"
:model="queryParams3"
:rules="rules"
label-width="80px"
:inline="true"
>
<!-- <el-form
:model="queryParams2"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="90px"
> -->
<el-form-item label="科室编码" prop="departmentCode" label-width="120">
<el-input
v-model="queryParams3.departmentCode"
placeholder="请输入科室编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="科室名称" prop="departmentName" label-width="120">
<el-input
v-model="queryParams3.departmentName"
placeholder="请输入科室名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery3"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery3"
>重置</el-button
>
</el-form-item>
</el-form>
<el-table :data="StationDepartmentLists" @cell-dblclick="StationDepartmentclick">
<el-table-column label="请选择" width="70" align="center">
<template slot-scope="scope">
<el-button
type="primary"
style="width: 15px; height: 15px"
v-if="departid == scope.row.id"
circle
@click="StationDepartmentclick(scope.row)"
></el-button>
<el-button
v-else
style="width: 15px; height: 15px"
circle
@click="StationDepartmentclick(scope.row)"
></el-button>
</template>
</el-table-column>
<el-table-column
property="departmentCode"
label="科室编码"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="departmentName"
label="科室名称"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="departmentPerson"
label="科室负责人"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="phone"
label="联系电话"
width="150"
align="center"
>
</el-table-column>
</el-table>
<pagination
v-show="total3 > 0"
:total="total3"
:page.sync="queryParams3.pageNum"
:limit.sync="queryParams3.pageSize"
@pagination="departclick"
/>
</el-dialog>
<!-- 修改 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="护理站名称" prop="nurseStationId">
<el-input
:disabled="true"
v-model="form.nurseStationName"
placeholder="请输入护理站名称"
/>
</el-form-item>
<el-form-item label="科室名称" prop="departmentName">
<el-input
:disabled="true"
v-model="form.departmentName"
placeholder="请输入科室名称"
/>
</el-form-item>
<el-form-item label="姓名" prop="nursePersonName">
<el-input
maxlength="15"
v-model="form.nursePersonName"
placeholder="请输入护理站人姓名"
/>
</el-form-item>
<el-form-item
label="护理人职称"
prop="nursePersonType"
label-width="120px"
style="margin-left: -22px"
>
<el-select
v-model="form.nursePersonType"
clearable
placeholder="请选择"
style="width: 363px"
>
<el-option
v-for="item in nursePersonTypes"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="性别" prop="sex">
<el-select
v-model="form.sex"
clearable
placeholder="请选择"
style="width: 363px"
>
<el-option
v-for="item in sexs"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="联系电话" prop="phone">
<el-input v-model="form.phone" placeholder="请输入联系电话" maxlength="11"/>
</el-form-item>
<el-form-item label="居住地址" prop="address">
<el-input v-model="form.address" placeholder="请输入居住地址" maxlength="50"/>
</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 {
listPerson,
getPerson,
delPerson,
addPerson,
updatePerson,
stationList,
StationDepartmentList,
} from "@/api/system/person";
export default {
name: "Person",
data() {
return {
//男女选择
sexs: [
{
label: "男",
value: "MALE",
},
{
label: "女",
value: "FEMALE",
},
],
nursePersonTypes: [
{
label: "护士",
value: "NURSE",
},
{
label: "护理师",
value: "NURSE_TEACHER",
},
],
innerVisible: false,
innerVisible2: false,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
// total:null,
total: 0,
total2: 0,
total3: 0,
total4: 0,
// 护理站人员信息表格数据
nurseStationPersonList: [],
// 护理站名称
stationLists: [],
// 所属科室
StationDepartmentLists: [],
nurseStationlist: [],
stationid: "",
departid: "",
nurseStationName: "请选择护理站名称",
departmentName: "请选择所属科室",
// 弹出层标题
title: "",
title2: "",
title3: "",
// 是否显示弹出层
open: false,
open2: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
nurseStationId: null,
departmentCode: null,
userId: null,
nursePersonCode: null,
nursePersonName: null,
nursePersonType: null,
phone: null,
address: null,
},
queryParams2: {
pageNum: 1,
pageSize: 10,
nurseStationName: null,
id: null,
nurseStationId: null,
},
queryParams3: {
pageNum: 1,
pageSize: 10,
nurseStationName: null,
id: null,
departmentCode: null,
departmentName: null,
nurseStationId: null,
},
nurseStationqueryParams: {
pageNum: 1,
pageSize: 10,
},
// 表单参数
form: {},
index: "",
// 表单校验
rules: {
nursePersonName: [
{
required: true,
message: "护理站人员名称不能为空",
trigger: "blur",
},
],
departmentName: [
{ required: true, message: "所属科室不能为空", trigger: "blur" },
],
nurseStationId: [
{ required: true, message: "所属护理站不能为空", trigger: "blur" },
],
nursePersonName: [
{ required: true, message: "护理人姓名不能为空", trigger: "blur" },
],
nursePersonType: [
{ required: true, message: "护理人职称不能为空", trigger: "blur" },
],
sex: [{ required: true, message: "性别不能为空", trigger: "blur" }],
phone: [
{ required: true, message: "联系电话不能为空", trigger: "blur" },
],
address: [
{ required: true, message: "居住地址不能为空", trigger: "blur" },
],
nurseStationPersonList: {
nursePersonName: [
{
required: true,
message: "护理站人员名称不能为空",
trigger: "blur",
},
],
departmentName: [
{ required: true, message: "所属科室不能为空", trigger: "blur" },
],
nurseStationId: [
{ required: true, message: "所属护理站不能为空", trigger: "blur" },
],
nursePersonName: [
{ required: true, message: "护理人姓名不能为空", trigger: "blur" },
],
nursePersonType: [
{ required: true, message: "护理人职称不能为空", trigger: "blur" },
],
sex: [{ required: true, message: "性别不能为空", trigger: "blur" }],
phone: [
{ required: true, message: "联系电话不能为空", trigger: "blur" },
],
address: [
{ required: true, message: "居住地址不能为空", trigger: "blur" },
],
// nurseStationPersonList: {
// nursePersonName: [
// {
// required: true,
// message: "请输入护理站人员名称",
// trigger: "blur",
// },
// ],
// },
},
},
};
},
created() {
this.getList();
this.nurselist();
},
methods: {
departclick(item, index) {
// // 所属科室
StationDepartmentList(this.queryParams3).then((res) => {
this.StationDepartmentLists = res.rows;
this.total3 = res.total;
this.loading = false;
});
console.log(item);
this.innerVisible2 = true;
this.index = index;
},
//xialakuang
loadMore() {
console.log("1");
var a = Math.ceil(this.total4 / 10);
console.log(this.nurseStationlist.length);
if (this.nurseStationlist.length + 1 >= this.total4) {
} else {
if (this.nurseStationqueryParams.pageNum >= a) {
} else {
this.nurseStationqueryParams.pageNum++;
stationList(this.nurseStationqueryParams).then((res) => {
console.log(res);
res.rows.forEach((e) => {
this.nurseStationlist.push(e);
});
});
}
}
},
nurselist() {
stationList(this.nurseStationqueryParams).then((res) => {
console.log(res);
this.nurseStationlist = res.rows;
this.total4 = res.total;
console.log(this.nurseStationlist);
});
},
//删除deldisease
deldisease(index) {
this.form.nurseStationPersonList.splice(index, 1);
console.log(this.form.nurseStationPersonList);
},
adddisease() {
// this.nurseStationName = "请选择护理站名称";
// this.departmentName="请选择所属科室"
var obj = {
nursePersonCode: "",
nursePersonCode: "",
nursePersonName: "",
nursePersonType: "",
phone: "",
address: "",
sex: "",
nurseStationId: "",
departmentName: "请选择所属科室",
// departname: "",
nurseStationName: "请选择护理站名称",
};
if (this.form.nurseStationPersonList.length == 5) {
this.$message.error("最多只能5条");
} else {
this.form.nurseStationPersonList.push(obj);
}
},
// 护理站名称
nurseclick(row) {
console.log(row);
this.nursename = row.nurseStationName;
this.stationid = row.id;
this.form.nurseStationId = row.id;
console.log(this.form);
this.innerVisible = false;
this.form.nursename = row.nurseStationName;
this.form.nurseStationPersonList[this.index].nurseStationName =
row.nurseStationName;
this.form.nurseStationPersonList[this.index].nurseStationId = row.id;
},
// 所属科室
StationDepartmentclick(row) {
console.log(row);
this.departname = row.departmentName;
this.departid = row.id;
this.departmentCode = row.departmentCode;
// this.form.nurseStationId = row.id;
this.innerVisible2 = false;
this.form.departname = row.departmentName;
this.form.nurseStationPersonList[this.index].departmentName =
row.departmentName;
this.form.nurseStationPersonList[this.index].departmentCode =
row.departmentCode;
console.log(this.form);
},
/** 查询护理站人员信息列表 */
getList() {
// 护理站名称
this.loading = true;
listPerson(this.queryParams).then((response) => {
this.nurseStationPersonList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.open2 = false;
this.nurseStationName = "请选择护理站名称";
this.departmentName = "请选择所属科室";
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
nurseStationId: null,
departmentCode: null,
userId: null,
nursePersonCode: null,
nursePersonName: null,
nursePersonType: null,
phone: null,
address: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
nurseStationPersonList: [
{
id: "",
nurseStationId: "",
departmentCode: "",
nursePersonCode: "",
nursePersonName: "",
nursePersonType: "",
nurseStationName: "请选择护理站名称",
phone: "",
address: "",
sex: "",
departmentName: "请选择所属科室",
},
],
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery2() {
this.queryParams.pageNum = 1;
stationList(this.queryParams2).then((res) => {
this.stationLists = res.rows;
this.total2 = res.total;
this.loading = false;
});
this.innerVisible = true;
},
clickinnerVisible(item, index) {
stationList(this.queryParams2).then((res) => {
this.stationLists = res.rows;
this.total2 = res.total;
this.loading = false;
});
console.log(item);
this.stationid = item.nurseStationId;
this.innerVisible = true;
this.index = index;
},
handleQuery3() {
console.log(this.queryParams3);
StationDepartmentList(this.queryParams3).then((response) => {
this.StationDepartmentLists = response.rows;
this.total3 = response.total;
this.loading = false;
});
this.queryParams.pageNum = 1;
this.getList();
},
handleQuery() {
stationList(this.nurseStationqueryParams).then((res) => {
console.log(res);
this.nurseStationlist = res.rows;
this.total4 = res.total;
console.log(this.nurseStationlist);
});
this.queryParams.pageNum = 1;
this.getList();
// this.nurselist()
// this.stationList();
// this.nurseStationlist()
},
/** 重置按钮操作 */
resetQuery2() {
this.queryParams2 = {
pageNum: 1,
pageSize: 10,
nurseStationName: null,
id: null,
nurseStationId: null,
};
stationList(this.queryParams2).then((res) => {
this.stationLists = res.rows;
this.total2 = res.total;
});
},
resetQuery3() {
this.queryParams3 = {
pageNum: 1,
pageSize: 10,
nurseStationName: null,
id: null,
departmentCode: null,
departmentName: null,
nurseStationId: null,
};
StationDepartmentList(this.queryParams3).then((response) => {
this.StationDepartmentLists = response.rows;
this.total3 = response.total;
this.loading = false;
});
},
resetQuery() {
this.resetForm("queryForm");
this.queryParams = {
pageNum: 1,
pageSize: 10,
nurseStationId: null,
departmentCode: null,
userId: null,
nursePersonCode: null,
nursePersonName: null,
nursePersonType: null,
phone: null,
address: null,
};
stationList(this.queryParams2).then((res) => {
this.stationLists = res.rows;
this.total2 = res.total;
});
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open2 = true;
this.title = "添加护理站人员信息";
this.title2 = "请选择护理站";
this.title3 = "请选择科室";
},
/** 修改按钮操作 */
handleUpdate(row) {
// this.reset();
const id = row.id || this.ids;
getPerson(id).then((response) => {
console.log(response);
this.form = response.data;
this.open = true;
this.title = "修改护理站人员信息";
});
},
/** 提交按钮 */
submitForm() {
console.log(this.form);
this.$refs["form"].validate((valid) => {
// this.form.nursename = null;
// this.form.nurseStationId = null;
if (valid) {
if (this.form.id != null) {
updatePerson(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addPerson(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open2 = false;
this.getList();
this.nurseStationName = "请选择护理站名称";
this.departmentName = "请选择所属科室";
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm('是否确认删除护理站人员信息编号为"' + ids + '"的数据项?')
.then(function () {
return delPerson(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"system/person/export",
{
...this.queryParams,
},
`person_${new Date().getTime()}.xlsx`
);
},
},
};
</script>