316 lines
8.1 KiB
Vue
316 lines
8.1 KiB
Vue
<template>
|
|
<div class="political-outlook">
|
|
<div class="content">
|
|
<div class="top-search">
|
|
<div class="search-item">
|
|
<span>人员类型</span>
|
|
<el-select
|
|
class="m-2"
|
|
placeholder="请选择"
|
|
size="small"
|
|
v-model="searchForm.memberType"
|
|
:clearable="true"
|
|
style="width: 150px"
|
|
>
|
|
<el-option v-for="(item, index) in memberTypeList" :key="index" :label="item.name" :value="item.value" />
|
|
</el-select>
|
|
</div>
|
|
<div class="search-item">
|
|
<span>所属企业</span>
|
|
<el-select
|
|
class="m-2"
|
|
placeholder="请选择"
|
|
size="small"
|
|
v-model="searchForm.belongCompany"
|
|
:clearable="true"
|
|
style="width: 150px"
|
|
>
|
|
<el-option v-for="(item, index) in enterpriseListData" :key="index" :label="item.enterpriseName" :value="item.id" />
|
|
</el-select>
|
|
</div>
|
|
<div class="search-item">
|
|
<span>在职状态</span>
|
|
<el-select
|
|
class="m-2"
|
|
placeholder="请选择"
|
|
size="small"
|
|
v-model="searchForm.workState"
|
|
:clearable="true"
|
|
style="width: 150px"
|
|
>
|
|
<el-option v-for="(item, index) in onlineWorkList" :key="index" :label="item.name" :value="item.value" />
|
|
</el-select>
|
|
</div>
|
|
<div class="search-item">
|
|
<span>姓名</span>
|
|
<el-input placeholder="请输入" v-model="searchForm.name" :clearable="true" style="width: 150px" />
|
|
</div>
|
|
<div class="search-item">
|
|
<span>身份证号</span>
|
|
<el-input placeholder="请输入" v-model="searchForm.idCard" :clearable="true" style="width: 180px" />
|
|
</div>
|
|
<el-button @click="getMemberCountList('search')">查询</el-button>
|
|
</div>
|
|
<div class="tabList">
|
|
<div style="width: 10%">序号</div>
|
|
<div style="width: 10%">照片</div>
|
|
<div>姓名</div>
|
|
<div>联系电话</div>
|
|
<div>所属部门</div>
|
|
<div>进场日期</div>
|
|
<div>在职状态</div>
|
|
<div>身份证号</div>
|
|
<div>人员类型</div>
|
|
<div style="width: 25%;">所属企业</div>
|
|
</div>
|
|
|
|
<el-scrollbar class="listBox" ref="refScrollbar">
|
|
<div v-for="(item, index) in partyMemberList" class="listStyle" :key="item.id">
|
|
<div style="width: 10%">{{index + 1}}</div>
|
|
<div class="list-img" style="width: 10%">
|
|
<el-image
|
|
fit="contain"
|
|
class="el-img"
|
|
:src="BASEURL + '/image/' + item.fieldAcquisitionUrl"
|
|
:preview-src-list="[BASEURL + '/image/' + item.fieldAcquisitionUrl]"
|
|
>
|
|
</el-image>
|
|
<!-- <img :src="item.fieldAcquisitionUrl" alt="" srcset=""> -->
|
|
</div>
|
|
<div>{{item.workerName}}</div>
|
|
<div>{{item.phoneNumber}}</div>
|
|
<div>{{item.personType == 1?item.teamName:item.personType == 2?item.departmentName:''}}</div>
|
|
<div>{{item.enterDate}}</div>
|
|
<div>{{onlineWorkList[item.inserviceType - 1].name}}</div>
|
|
<div>{{item.idCard}}</div>
|
|
<div>{{memberTypeList[item.personType - 1].name}}</div>
|
|
<div style="width: 25%;">{{item.enterpriseName}}</div>
|
|
</div>
|
|
<div class="notoDta" v-if="partyMemberList.length == 0">
|
|
<img src="@/assets/images/noData.png" alt="" />
|
|
<p>暂无数据</p>
|
|
</div>
|
|
</el-scrollbar>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { ref, onMounted } from "vue";
|
|
import { GlobalStore } from "@/stores";
|
|
import { getCompanyDataList, getMemberInfoList } from "@/api/modules/labor";
|
|
const store = GlobalStore();
|
|
const props = defineProps(["tip", "regionIdForUface"]);
|
|
const BASEURL = import.meta.env.VITE_API_URL;
|
|
const onlineWorkList = ref([
|
|
{ name: "在职", value: 1 },
|
|
{ name: "离职", value: 2 }
|
|
])
|
|
const enterpriseListData = ref([] as any);
|
|
const memberTypeList = ref([
|
|
{ name: "劳务人员", value: 1 },
|
|
{ name: "管理人员", value: 2 },
|
|
{ name: "临时人员", value: 3 }
|
|
]);
|
|
const alarmTypeList = ref(["报警", "预警"]);
|
|
let pageNo = ref(1 as any);
|
|
let moreScroll = ref(true as any);
|
|
const refScrollbar = ref(null as any); // 绑定到滚动的盒子上
|
|
const deviceList = ref([] as any); // 设备列表
|
|
const searchForm = ref({
|
|
memberType: '',
|
|
belongCompany: '',
|
|
workState: '',
|
|
name: '',
|
|
idCard: ''
|
|
});
|
|
|
|
const partyMemberList = ref({} as any);
|
|
//获取企业列表
|
|
const getCompanyList = async () => {
|
|
let data = {
|
|
projectSn: store.sn,
|
|
enterpriseName: "",
|
|
userEnterpriseId: store.userInfo?.userEnterpriseId
|
|
};
|
|
const res: any = await getCompanyDataList(data);
|
|
if (res.code == 200) {
|
|
enterpriseListData.value = res.result;
|
|
}
|
|
};
|
|
//获取数据
|
|
const getMemberCountList = async (tip:any) => {
|
|
let requestData:any = {
|
|
projectSn: store.sn,
|
|
personType: searchForm.value.memberType, //人员类型
|
|
enterpriseId: searchForm.value.belongCompany, //所属企业
|
|
inserviceType: searchForm.value.workState, //在职状态
|
|
idCard: searchForm.value.idCard, //身份证号
|
|
workerName: searchForm.value.name, //姓名
|
|
pageNo: tip == 'search'?1:pageNo.value,
|
|
pageSize: 100,
|
|
regionIdForUface: props.regionIdForUface
|
|
}
|
|
if(props.tip == '实时'){
|
|
requestData.presence = 1;
|
|
} else if(props.tip == '日累积') {
|
|
requestData.attendance = 1;
|
|
} else {
|
|
requestData.inserviceType = 1;
|
|
}
|
|
const res: any = await getMemberInfoList(requestData);
|
|
console.log("获取人员信息列表", res);
|
|
if(tip == 'more'){
|
|
partyMemberList.value = partyMemberList.value.concat(res.result.records);
|
|
} else {
|
|
partyMemberList.value = res.result.records;
|
|
}
|
|
// 为图片拼接IP
|
|
// partyMemberList.value.map((item:any) => {
|
|
// item.fieldAcquisitionUrl = BASEURL + '/image/' + item.fieldAcquisitionUrl
|
|
// })
|
|
if (res.result.pages == pageNo.value) {
|
|
moreScroll.value = false;
|
|
} else {
|
|
pageNo.value = pageNo.value + 1;
|
|
}
|
|
};
|
|
|
|
onMounted(async () => {
|
|
await getCompanyList();
|
|
await getMemberCountList('search');
|
|
refScrollbar.value.wrapRef.addEventListener("scroll", (e: any) => {
|
|
// console.log("滚动容器", e);
|
|
const scrollTop = e.target.scrollTop;
|
|
const scrollHeight = e.target.scrollHeight;
|
|
const clientHeight = e.target.clientHeight;
|
|
// console.log("滚动容器", scrollTop, scrollHeight, clientHeight);
|
|
// 向上加载更多
|
|
if (scrollTop >= scrollHeight - clientHeight - 1) {
|
|
// console.log("加载更多");
|
|
if (moreScroll.value) {
|
|
getMemberCountList("more");
|
|
}
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
@mixin flex {
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
.political-outlook {
|
|
width: 100%;
|
|
height: 97%;
|
|
.content {
|
|
height: 95%;
|
|
width: 100%;
|
|
margin-top: 10px;
|
|
// background: url("@/assets/images/cardImg.png") no-repeat;
|
|
background-size: 100% 100%;
|
|
.top-search {
|
|
@include flex;
|
|
justify-content: flex-end;
|
|
margin-bottom: 15px;
|
|
.search-item {
|
|
@include flex;
|
|
margin-right: 20px;
|
|
span {
|
|
color: white;
|
|
margin-right: 10px;
|
|
}
|
|
}
|
|
}
|
|
.tabList {
|
|
display: flex;
|
|
width: 100%;
|
|
height: 5%;
|
|
background: url("@/assets/images/vehicleManagement/ListTitleImg.png") no-repeat;
|
|
background-size: 100% 100%;
|
|
// position: absolute;
|
|
left: 75.5%;
|
|
top: 75%;
|
|
color: #ccc;
|
|
font-size: calc(100vw * 14 / 1920);
|
|
line-height: 30px;
|
|
align-items: center;
|
|
div {
|
|
text-align: center;
|
|
width: 15%;
|
|
}
|
|
}
|
|
.listBox {
|
|
height: 82%;
|
|
.listStyle {
|
|
display: flex;
|
|
align-items: center;
|
|
text-align: center;
|
|
color: #fff;
|
|
font-size: 12px;
|
|
margin-bottom: 5px;
|
|
.list-img {
|
|
.el-img {
|
|
width: 30px;
|
|
height: 30px;
|
|
img {
|
|
display: flex;
|
|
align-items: center;
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
}
|
|
}
|
|
div {
|
|
width: 15%;
|
|
white-space: nowrap; //单行
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
}
|
|
.listStyle:hover {
|
|
background: #091f3f;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
.notoDta {
|
|
top: 35%;
|
|
width: 20%;
|
|
left: 40%;
|
|
position: absolute;
|
|
text-align: center;
|
|
img {
|
|
width: 40%;
|
|
margin: 5% 30%;
|
|
}
|
|
p {
|
|
color: #fff;
|
|
font-size: calc(100vw * 14 / 1920);
|
|
margin: -6% 37%;
|
|
}
|
|
}
|
|
// element 组件样式
|
|
:deep() {
|
|
.el-date-editor .el-range-input,
|
|
.el-range-separator {
|
|
color: #fff;
|
|
}
|
|
.el-input__wrapper {
|
|
background: #112d59;
|
|
}
|
|
.el-input__inner {
|
|
color: #fff;
|
|
}
|
|
.el-button {
|
|
background-color: #2758c0;
|
|
color: white;
|
|
border-color: transparent;
|
|
}
|
|
}
|
|
// ::v-deep .el-select .el-input .el-select__caret {
|
|
// color: #fff;
|
|
// }
|
|
</style>
|