中水北方需求
This commit is contained in:
parent
22c9cfd642
commit
b08169e47e
@ -3,6 +3,7 @@ NODE_ENV = 'development'
|
||||
|
||||
# 本地环境接口地址(/api/index.ts文件中使用)
|
||||
# 后端本地
|
||||
# VITE_API_URL = 'http://10.0.1.49'
|
||||
# VITE_API_URL = 'http://192.168.34.155:28890' #彭杰鞍钢本地
|
||||
# VITE_API_URL = 'http://192.168.34.155:19111'
|
||||
# VITE_API_URL = 'http://192.168.34.221:9111' #雄哥本地
|
||||
|
||||
@ -21,6 +21,10 @@ export const getRealTimeDataApi = (params: {}) => {
|
||||
export const getMemberInfoList = (params: {}) => {
|
||||
return http.post(BASEURL + `/xmgl/workerInfo/selectWorkerInfoList`, params);
|
||||
};
|
||||
// 一键出场
|
||||
export const outMember = (params: {}) => {
|
||||
return http.post(BASEURL + `/xmgl/workerAttendance/reissueAttendanceCard`, params);
|
||||
};
|
||||
//查询所属企业
|
||||
export const getCompanyDataList = (params: {}) => {
|
||||
return http.post(BASEURL + `/xmgl/enterpriseInfo/list`, params);
|
||||
|
||||
BIN
src/assets/images/larborManagement/back-ic.png
Normal file
BIN
src/assets/images/larborManagement/back-ic.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 634 B |
BIN
src/assets/images/larborManagement/xd-bg-warn.png
Normal file
BIN
src/assets/images/larborManagement/xd-bg-warn.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/assets/images/larborManagement/xd-ic-warn.png
Normal file
BIN
src/assets/images/larborManagement/xd-ic-warn.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 281 B |
@ -8,7 +8,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="political-outlook" v-if="postData.type == 1">
|
||||
<memberCountList ref="historyAlarmList" :tip="postData.tip" :regionIdForUface="postData.regionIdForUface"></memberCountList>
|
||||
<memberCountList ref="historyAlarmList" :tip="postData.tip" :regionIdForUface="postData.regionIdForUface" @refresh="handleRefresh"></memberCountList>
|
||||
</div>
|
||||
<div class="political-outlook" v-if="postData.type == 2">
|
||||
<MemberAllShow ref="memberAllShow" :tip="postData.tip"></MemberAllShow>
|
||||
@ -29,6 +29,7 @@ import memberCountList from "./member-count-list.vue";
|
||||
import MemberAllShow from "./member-all-show.vue";
|
||||
import MemberMoreList from "./member-more-list.vue";
|
||||
import { GlobalStore } from "@/stores";
|
||||
const emit = defineEmits(["refresh"]);
|
||||
let showDialog = ref(false as any);
|
||||
const postData = ref({} as any);
|
||||
let dialogTitle = ref("" as any);
|
||||
@ -46,7 +47,9 @@ function openDialog(obj: any) {
|
||||
postData.value = obj
|
||||
showDialog.value = true;
|
||||
}
|
||||
|
||||
const handleRefresh = () => {
|
||||
emit("refresh");
|
||||
};
|
||||
// 暴露给父组件的参数和方法(外部需要什么,都可以从这里暴露出去)
|
||||
defineExpose({
|
||||
openDialog
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<RightCenter class="rightCenter" ref="rightCenterRef"></RightCenter>
|
||||
<RightBottom class="rightBottom" ref="rightBottomRef"></RightBottom>
|
||||
</div>
|
||||
<dataDialog ref="partyBuildRef"></dataDialog>
|
||||
<dataDialog ref="partyBuildRef" @refresh="callChildFn"></dataDialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@ -27,13 +27,14 @@
|
||||
<el-scrollbar style="height: 60%">
|
||||
<div
|
||||
class="sd-item"
|
||||
:class="index == 0 ? 'mt' : ''"
|
||||
:class="[index == 0 ? 'mt' : '', item.alarmFlag ? 'warn' : '']"
|
||||
@click="openDialogData('实时', item.id)"
|
||||
v-for="(item, index) in regionList"
|
||||
:key="item.id"
|
||||
>
|
||||
<div class="sd-item-top">
|
||||
<img src="@/assets/images/larborManagement/xd-ic.png" alt="" />
|
||||
<img v-if="!item.alarmFlag" src="@/assets/images/larborManagement/xd-ic.png" alt="" />
|
||||
<img v-else src="@/assets/images/larborManagement/xd-ic-warn.png" alt="" />
|
||||
<span>{{ item.regionName }}</span>
|
||||
</div>
|
||||
<div class="sd-item-bottom">
|
||||
@ -117,12 +118,12 @@
|
||||
</div>
|
||||
<!-- 企业 -->
|
||||
<div class="search-item">
|
||||
<el-select v-model="searchForm.enterpriseId" @change="getTeamList" placeholder="请选择企业" size="small" clearable>
|
||||
<el-select v-model="searchForm.enterpriseId" @change="handleChangeEnterprise" placeholder="请选择企业" size="small" clearable>
|
||||
<el-option v-for="item in companyList" :key="item.id" :label="item.enterpriseName" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<el-select v-model="searchForm.teamId" @change="getDepartmentList" placeholder="请选择班组" size="small" clearable>
|
||||
<el-select v-model="searchForm.teamId" placeholder="请选择班组" size="small" clearable>
|
||||
<el-option v-for="item in teamList" :key="item.id" :label="item.teamName" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
@ -491,6 +492,9 @@ const option = reactive({
|
||||
|
||||
// 打开弹窗
|
||||
const openDialogData = (tip: any, regionIdForUface = "") => {
|
||||
if (regionIdForUface) {
|
||||
getPresentByRegion();
|
||||
}
|
||||
emits("openDialog", { type: 1, tip, regionIdForUface });
|
||||
};
|
||||
const openDialogHistoryData = (tip: any) => {
|
||||
@ -505,7 +509,12 @@ const getPresentByRegion = async () => {
|
||||
}
|
||||
console.log("人员分布", res);
|
||||
};
|
||||
|
||||
const handleChangeEnterprise = () => {
|
||||
searchForm.teamId = "";
|
||||
searchForm.departmentId = "";
|
||||
getTeamList();
|
||||
getDepartmentList();
|
||||
};
|
||||
// 获取闸机分组列表
|
||||
const getUfaceDevGroupList = async () => {
|
||||
const res = await getUfaceDevGroupListApi({ projectSn: store.sn });
|
||||
@ -543,7 +552,9 @@ const timeChange = (e: any) => {
|
||||
};
|
||||
|
||||
function drawChart() {
|
||||
let myEchartsNum = echarts.init(document.getElementById("myEchartsNum"));
|
||||
let dom = document.getElementById("myEchartsNum");
|
||||
if (!dom) return;
|
||||
let myEchartsNum = echarts.init(dom);
|
||||
myEchartsNum.setOption(option);
|
||||
}
|
||||
//获取人员数据
|
||||
@ -678,6 +689,9 @@ const loadMethod = async () => {
|
||||
await getPersonList2();
|
||||
await getQueryTodayList2();
|
||||
await getCrewRealTimeData();
|
||||
if (COMPANY == "zsbf") {
|
||||
await getPresentByRegion();
|
||||
}
|
||||
};
|
||||
//将方法暴露给父组件
|
||||
defineExpose({
|
||||
@ -685,12 +699,14 @@ defineExpose({
|
||||
});
|
||||
onMounted(async () => {
|
||||
getUfaceDevList();
|
||||
getPresentByRegion();
|
||||
getUfaceDevGroupList();
|
||||
getPersonList();
|
||||
getQueryTodayList();
|
||||
getCrewRealTimeData();
|
||||
getCompanyList();
|
||||
if (COMPANY == "zsbf") {
|
||||
getPresentByRegion();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -913,6 +929,7 @@ onMounted(async () => {
|
||||
color: #ffffff;
|
||||
line-height: 24px;
|
||||
margin: 0 16px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.date {
|
||||
font-size: 12px;
|
||||
@ -998,6 +1015,13 @@ onMounted(async () => {
|
||||
&.mt {
|
||||
margin-top: 24px;
|
||||
}
|
||||
&.warn {
|
||||
background: url("@/assets/images/larborManagement/xd-bg-warn.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
.sd-item-bottom .num {
|
||||
color: #ff0000;
|
||||
}
|
||||
}
|
||||
// background: rgba(39, 88, 192, 0.06);
|
||||
.sd-item-top {
|
||||
display: flex;
|
||||
|
||||
@ -57,16 +57,18 @@
|
||||
<div>姓名</div>
|
||||
<div>联系电话</div>
|
||||
<div>所属部门</div>
|
||||
<div>进场日期</div>
|
||||
<div>{{ props.regionIdForUface ? "进场日期" : "登记日期" }}</div>
|
||||
<div>在职状态</div>
|
||||
<div>身份证号</div>
|
||||
<div>人员类型</div>
|
||||
<div style="width: 25%;">所属企业</div>
|
||||
<div style="width: 20%">所属企业</div>
|
||||
<div v-if="props.regionIdForUface" style="width: 30%">异常分析</div>
|
||||
<!-- <div v-if="props.regionIdForUface">操作</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 v-for="(item, index) in partyMemberList" class="listStyle" :class="{ danger: item.alarmFlag }" :key="item.id">
|
||||
<div style="width: 10%">{{ index + 1 }}</div>
|
||||
<div class="list-img" style="width: 10%">
|
||||
<el-image
|
||||
fit="contain"
|
||||
@ -77,14 +79,21 @@
|
||||
</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 :title="item.workerName">{{ item.workerName }}</div>
|
||||
<div :title="item.phoneNumber">{{ item.phoneNumber }}</div>
|
||||
<div :title="item.personType == 1 ? item.teamName : item.personType == 2 ? item.departmentName : ''">{{ item.personType == 1 ? item.teamName : item.personType == 2 ? item.departmentName : '' }}</div>
|
||||
<div :title="props.regionIdForUface ? item.attendTime : item.enterDate">{{ props.regionIdForUface ? item.attendTime : item.enterDate }}</div>
|
||||
<div :title="onlineWorkList[item.inserviceType - 1].name">{{ onlineWorkList[item.inserviceType - 1].name }}</div>
|
||||
<div :title="item.idCard">{{ item.idCard }}</div>
|
||||
<div :title="memberTypeList[item.personType - 1].name">{{ memberTypeList[item.personType - 1].name }}</div>
|
||||
<div style="width: 20%" :title="item.enterpriseName">{{ item.enterpriseName }}</div>
|
||||
<div :title="item.alarmFlag" v-if="props.regionIdForUface" style="width: 30%">{{ item.alarmFlag }}</div>
|
||||
<!-- <div v-if="props.regionIdForUface">
|
||||
<el-link :underline="false" type="primary" size="small" @click="handleOut(item)">
|
||||
<img class="back-ic" src="@/assets/images/larborManagement/back-ic.png" alt="" />
|
||||
一键出场
|
||||
</el-link>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="notoDta" v-if="partyMemberList.length == 0">
|
||||
<img src="@/assets/images/noData.png" alt="" />
|
||||
@ -96,33 +105,34 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted } from "vue";
|
||||
import { ref, onMounted, onBeforeUnmount } from "vue";
|
||||
import { GlobalStore } from "@/stores";
|
||||
import { getCompanyDataList, getMemberInfoList } from "@/api/modules/labor";
|
||||
import dayjs from "dayjs";
|
||||
import { getCompanyDataList, getMemberInfoList, outMember } from "@/api/modules/labor";
|
||||
import { ElMessage } from "element-plus";
|
||||
const store = GlobalStore();
|
||||
const props = defineProps(["tip", "regionIdForUface"]);
|
||||
const emit = defineEmits(["refresh"]);
|
||||
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: ''
|
||||
memberType: "",
|
||||
belongCompany: "",
|
||||
workState: "",
|
||||
name: "",
|
||||
idCard: ""
|
||||
});
|
||||
|
||||
const partyMemberList = ref({} as any);
|
||||
@ -139,28 +149,28 @@ const getCompanyList = async () => {
|
||||
}
|
||||
};
|
||||
//获取数据
|
||||
const getMemberCountList = async (tip:any) => {
|
||||
let requestData:any = {
|
||||
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,
|
||||
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 == '实时'){
|
||||
};
|
||||
if (props.tip == "实时") {
|
||||
requestData.presence = 1;
|
||||
} else if(props.tip == '日累积') {
|
||||
} else if (props.tip == "日累积") {
|
||||
requestData.attendance = 1;
|
||||
} else {
|
||||
requestData.inserviceType = 1;
|
||||
}
|
||||
const res: any = await getMemberInfoList(requestData);
|
||||
console.log("获取人员信息列表", res);
|
||||
if(tip == 'more'){
|
||||
if (tip == "more") {
|
||||
partyMemberList.value = partyMemberList.value.concat(res.result.records);
|
||||
} else {
|
||||
partyMemberList.value = res.result.records;
|
||||
@ -175,10 +185,57 @@ const getMemberCountList = async (tip:any) => {
|
||||
pageNo.value = pageNo.value + 1;
|
||||
}
|
||||
};
|
||||
const handleOut = async (item: any) => {
|
||||
console.log("一键出场", item);
|
||||
const params = {
|
||||
enterpriseId: item.enterpriseId,
|
||||
teamId: item.teamId,
|
||||
departmentId: item.departmentId,
|
||||
workerId: item.id,
|
||||
type: 2,
|
||||
time: dayjs().format("YYYY-MM-DD HH:mm:ss"),
|
||||
inletOutletPosition: "",
|
||||
cardType: 2,
|
||||
personSn: item.personSn,
|
||||
projectSn: store.sn,
|
||||
photoUrl: item.fieldAcquisitionUrl,
|
||||
regionId: props.regionIdForUface
|
||||
};
|
||||
const res: any = await outMember(params);
|
||||
if (res.code == 200) {
|
||||
ElMessage.success("一键出场成功");
|
||||
getMemberCountList("search");
|
||||
emit("refresh");
|
||||
} else {
|
||||
ElMessage.error(res.message);
|
||||
}
|
||||
console.log("一键出场", res);
|
||||
};
|
||||
//定时器
|
||||
const interval = ref(null as any);
|
||||
//定时调用
|
||||
const startInterval = async () => {
|
||||
interval.value = setInterval(() => {
|
||||
getMemberCountList("search");
|
||||
}, 30 * 1000);
|
||||
};
|
||||
// 在组件销毁时清除 interval
|
||||
const destroyInterval = () => {
|
||||
if (interval.value) {
|
||||
clearInterval(interval.value);
|
||||
}
|
||||
};
|
||||
// 在组件销毁时调用 destroyInterval 方法清除 interval
|
||||
onBeforeUnmount(() => {
|
||||
destroyInterval();
|
||||
});
|
||||
window.onbeforeunload = () => {
|
||||
destroyInterval();
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
await getCompanyList();
|
||||
await getMemberCountList('search');
|
||||
await getMemberCountList("search");
|
||||
refScrollbar.value.wrapRef.addEventListener("scroll", (e: any) => {
|
||||
// console.log("滚动容器", e);
|
||||
const scrollTop = e.target.scrollTop;
|
||||
@ -193,6 +250,7 @@ onMounted(async () => {
|
||||
}
|
||||
}
|
||||
});
|
||||
startInterval();
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -268,6 +326,9 @@ onMounted(async () => {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
&.danger {
|
||||
color: #ff0000;
|
||||
}
|
||||
}
|
||||
.listStyle:hover {
|
||||
background: #091f3f;
|
||||
@ -309,6 +370,10 @@ onMounted(async () => {
|
||||
border-color: transparent;
|
||||
}
|
||||
}
|
||||
.back-ic {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
// ::v-deep .el-select .el-input .el-select__caret {
|
||||
// color: #fff;
|
||||
// }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user