护理站人员 用户权限

This commit is contained in:
shidongli 2022-09-23 09:02:16 +08:00
parent f59fd466b6
commit be49874bc6

View File

@ -8,10 +8,10 @@
v-show="showSearch" v-show="showSearch"
label-width="68px" label-width="68px"
> >
<el-form-item label="护理站" prop="nurseStationId"> <el-form-item label="护理站" prop="nurseStationId" v-if="nurseStationlist.find((e) => e.isAdmin == '1')">
<el-select <el-select
v-model="queryParams.nurseStationId" v-model="queryParams.nurseStationId"
clearable
placeholder="请选择护理站" placeholder="请选择护理站"
v-loadmore="loadMore" v-loadmore="loadMore"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
@ -25,6 +25,22 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="护理站" prop="nurseStationId" v-else>
<el-select
v-model="queryParams.nurseStationId"
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-form-item label="所属科室" prop="departmentName">
<el-input <el-input
v-model="queryParams.departmentName" v-model="queryParams.departmentName"
@ -1030,6 +1046,7 @@ import {
StationDepartmentList, StationDepartmentList,
} from "@/api/system/person"; } from "@/api/system/person";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
import { getListByUser } from "@/api/system/userlist.js";
export default { export default {
name: "Person", name: "Person",
@ -1133,6 +1150,7 @@ export default {
// //
open: false, open: false,
open2: false, open2: false,
//
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
@ -1252,16 +1270,14 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
this.getList2();
this.nurselist(); this.nurselist();
this.info();
}, },
methods: { methods: {
// // // //
departclick(item, index) { departclick(item, index) {
StationDepartmentList(this.queryParams3).then((res) => {
this.StationDepartmentLists = res.rows;
this.total3 = res.total;
this.loading = false;
});
console.log(item); console.log(item);
this.departid = item.departmentCode; this.departid = item.departmentCode;
this.innerVisible2 = true; this.innerVisible2 = true;
@ -1281,11 +1297,7 @@ export default {
}, },
// //
clickinnerVisible(item, index) { clickinnerVisible(item, index) {
stationList(this.queryParams2).then((res) => {
this.stationLists = res.rows;
this.total2 = res.total;
this.loading = false;
});
// console.log(item); // console.log(item);
this.stationid = item.nurseStationId; this.stationid = item.nurseStationId;
this.innerVisible = true; this.innerVisible = true;
@ -1304,24 +1316,24 @@ export default {
// this.index = index; // this.index = index;
}, },
//xialakuang //xialakuang
loadMore() { // loadMore() {
console.log("1"); // console.log("1");
var a = Math.ceil(this.total4 / 10); // var a = Math.ceil(this.total4 / 10);
console.log(this.nurseStationlist.length); // console.log(this.nurseStationlist.length);
if (this.nurseStationlist.length + 1 >= this.total4) { // if (this.nurseStationlist.length + 1 >= this.total4) {
} else { // } else {
if (this.nurseStationqueryParams.pageNum >= a) { // if (this.nurseStationqueryParams.pageNum >= a) {
} else { // } else {
this.nurseStationqueryParams.pageNum++; // this.nurseStationqueryParams.pageNum++;
stationList(this.nurseStationqueryParams).then((res) => { // stationList(this.nurseStationqueryParams).then((res) => {
console.log(res); // console.log(res);
res.rows.forEach((e) => { // res.rows.forEach((e) => {
this.nurseStationlist.push(e); // this.nurseStationlist.push(e);
}); // });
}); // });
} // }
} // }
}, // },
nurselist() { nurselist() {
stationList(this.nurseStationqueryParams).then((res) => { stationList(this.nurseStationqueryParams).then((res) => {
console.log(res); console.log(res);
@ -1417,6 +1429,21 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
getList2() {
//
this.loading = true;
stationList(this.queryParams2).then((res) => {
this.stationLists = res.rows;
this.total2 = res.total;
this.loading = false;
});
StationDepartmentList(this.queryParams3).then((res) => {
this.StationDepartmentLists = res.rows;
this.total3 = res.total;
this.loading = false;
});
},
// //
cancel() { cancel() {
this.open = false; this.open = false;
@ -1428,6 +1455,7 @@ export default {
}, },
// //
reset() { reset() {
this.form = { this.form = {
id: null, id: null,
nurseStationId: null, nurseStationId: null,
@ -1461,6 +1489,7 @@ export default {
], ],
}; };
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -1506,7 +1535,6 @@ export default {
id: null, id: null,
nurseStationId: null, nurseStationId: null,
}; };
stationList(this.queryParams2).then((res) => { stationList(this.queryParams2).then((res) => {
this.stationLists = res.rows; this.stationLists = res.rows;
this.total2 = res.total; this.total2 = res.total;
@ -1522,7 +1550,6 @@ export default {
departmentName: null, departmentName: null,
nurseStationId: null, nurseStationId: null,
}; };
StationDepartmentList(this.queryParams3).then((response) => { StationDepartmentList(this.queryParams3).then((response) => {
this.StationDepartmentLists = response.rows; this.StationDepartmentLists = response.rows;
this.total3 = response.total; this.total3 = response.total;
@ -1531,6 +1558,7 @@ export default {
}, },
resetQuery() { resetQuery() {
if (this.nurseStationlist[0].isAdmin == "1") {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.queryParams = { this.queryParams = {
pageNum: 1, pageNum: 1,
@ -1545,6 +1573,14 @@ export default {
address: null, address: null,
}; };
this.handleQuery(); this.handleQuery();
} else {
console.log(1);
this.queryParams.departmentName = null;
this.queryParams.pageSize = 10;
this.queryParams.pageNum = 1;
this.queryParams.nursePersonName = null;
this.handleQuery();
}
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
@ -1668,6 +1704,58 @@ export default {
`person_${new Date().getTime()}.xlsx` `person_${new Date().getTime()}.xlsx`
); );
}, },
//
info() {
getListByUser(this.nurseStationqueryParams).then((res) => {
console.log(res);
if (res.rows[0].isAdmin == "1") {
console.log(true);
this.nurseStationlist = res.rows;
this.total2 = res.total;
} else {
this.total2 = res.total;
this.nurseStationlist = res.rows;
this.queryParams.nurseStationId = res.rows[0].id;
this.handleQuery();
}
});
},
//
loadMore() {
var a = Math.ceil(this.total4 / 10);
if (this.nurseStationlist.length + 1 >= this.total4) {
} else {
if (this.nurseStationqueryParams.pageNum >= a) {
} else {
this.nurseStationqueryParams.pageNum++;
console.log(this.nurseStationqueryParams.pageNum);
getListByUser(this.nurseStationqueryParams).then((res) => {
console.log(res);
res.rows.forEach((e) => {
this.nurseStationlist.push(e);
});
});
}
}
},
// 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);
// });
// });
// }
// }
// },
}, },
}; };
</script> </script>