<template>
|
<div class="Maintenancemanagement">
|
<div class="Maintenancemanagement_l">
|
<div class="content">
|
<div class="checkbox">
|
<span
|
style="
|
color: rgba(0, 9, 56, 1);
|
font-size: 1.13rem;
|
font-weight: bold;
|
"
|
>在检人员监控</span
|
>
|
<div style="color: rgba(0, 9, 56, 1); font-size: 0.88rem">
|
正在检修人员数量:<span
|
style="color: red; font-size: 1.25rem; font-weight: bold"
|
>{{ totalCount }}</span
|
>位
|
</div>
|
</div>
|
<div class="serch">
|
<div class="time_box">
|
<el-select
|
v-model="queryForm.selectType"
|
:empty-values="[null, undefined]"
|
placeholder="请选择"
|
size="small"
|
style="width: 9rem; height: 2rem; margin-right: 0.98rem"
|
>
|
<el-option
|
v-for="item in stateType"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
/>
|
</el-select>
|
</div>
|
<div class="serch_box">
|
<div class="serchb">全局搜索</div>
|
<input
|
v-model="queryForm.inputcontent"
|
placeholder="请输入关键词搜索"
|
style="border-left: 0.06rem solid #e2e2e2"
|
/>
|
</div>
|
<el-button
|
@click="handleQuery"
|
type="primary"
|
size="small"
|
style="margin-left: 0.98rem; height: 2rem"
|
>查询</el-button
|
>
|
<el-button size="small" style="height: 2rem" @click="resetQuery"
|
>重置</el-button
|
>
|
</div>
|
<div style="margin-top: 1rem; height: 100%">
|
<el-table
|
empty-text="暂无数据"
|
height="450"
|
:data="tableData"
|
style="width: 100%"
|
:header-cell-style="{
|
background: 'rgba(250,250,250,1)',
|
color: '#101010',
|
fontSize: '0.88rem',
|
height: '3rem',
|
border: 'none',
|
}"
|
:row-style="{
|
color: '#101010',
|
fontSize: '0.88rem',
|
height: '3rem',
|
}"
|
>
|
<el-table-column prop="userTrueName" label="姓名" align="center" />
|
<el-table-column prop="userteam" label="班组" align="center" />
|
<el-table-column prop="headImageUrl" label="人脸" align="center">
|
<template #default="scope">
|
<el-image
|
style="width: 5rem; height: 5rem"
|
:src="'http://192.168.1.103:9093' + scope.row.headImageUrl"
|
:fit="fit"
|
/>
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="maintenanceDate"
|
label="分配时间"
|
align="center"
|
/>
|
<el-table-column prop="fuzyuan" label="检修状态" align="center">
|
<template #default="scope">
|
<span
|
style="color: #e7a307; font-size: 0.88rem"
|
v-if="scope.row.maintenanceStatus == 0"
|
>待开始</span
|
>
|
<span
|
style="color: red; font-size: 0.88rem"
|
v-if="scope.row.maintenanceStatus == 1"
|
>检修中</span
|
>
|
<span
|
style="color: #eee; font-size: 0.88rem"
|
v-if="scope.row.maintenanceStatus == 2"
|
>已完成</span
|
>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
<div
|
style="
|
display: flex;
|
justify-content: right;
|
align-self: flex-end;
|
margin-bottom: 1.19rem;
|
margin-right: 1.25rem;
|
"
|
>
|
<el-pagination
|
size="small"
|
background
|
layout="prev, pager, next"
|
:current-page="pageQuery.page"
|
:page-size="pageQuery.rows"
|
:total="pageTotal"
|
@size-change="handleSizeChange"
|
@current-change="handleCurrentChange"
|
/>
|
</div>
|
</div>
|
</div>
|
<div class="Maintenancemanagement_r">
|
<div class="content">
|
<div class="checkbox">
|
<span
|
style="
|
color: rgba(0, 9, 56, 1);
|
font-size: 1.13rem;
|
font-weight: bold;
|
"
|
>设置检修权限</span
|
>
|
</div>
|
<div class="serch">
|
<div class="serch_box">
|
<div class="serchb">全局搜索</div>
|
<input
|
v-model="queryForm1.inputcontent"
|
placeholder="请输入关键词搜索"
|
style="border-left: 0.06rem solid #e2e2e2"
|
/>
|
</div>
|
<el-button
|
@click="handleQuery1"
|
type="primary"
|
size="small"
|
style="margin-left: 0.98rem; height: 2rem"
|
>查询</el-button
|
>
|
<el-button size="small" style="height: 2rem" @click="resetQuery1"
|
>重置</el-button
|
>
|
</div>
|
<div style="margin-top: 1rem; height: 100%">
|
<el-table
|
empty-text="暂无数据"
|
height="450"
|
:data="gridData"
|
style="width: 100%"
|
:header-cell-style="{
|
background: 'rgba(250,250,250,1)',
|
color: '#101010',
|
fontSize: '0.88rem',
|
height: '3rem',
|
border: 'none',
|
}"
|
:row-style="{
|
color: '#101010',
|
fontSize: '0.88rem',
|
height: '3rem',
|
}"
|
>
|
<el-table-column
|
prop="userTrueName"
|
label="姓名"
|
align="center"
|
min-width="3%"
|
/>
|
<el-table-column
|
prop="userName"
|
label="账号"
|
align="center"
|
min-width="3%"
|
/>
|
<el-table-column
|
prop="cardNumber"
|
label="卡号"
|
align="center"
|
min-width="3%"
|
/>
|
|
<el-table-column
|
prop="userteam"
|
label="班组"
|
align="center"
|
min-width="3%"
|
/>
|
<el-table-column
|
prop="headImageUrl"
|
label="人脸"
|
align="center"
|
min-width="3%"
|
>
|
<template #default="scope">
|
<el-image
|
style="width: 5rem; height: 5rem"
|
:src="'http://192.168.1.103:9093' + scope.row.headImageUrl"
|
:fit="fit"
|
/>
|
</template>
|
</el-table-column>
|
<el-table-column label="操作" align="center" min-width="4%">
|
<template #default="scope">
|
<div
|
v-if="scope.row.isPossible == null"
|
style="
|
display: flex;
|
flex-direction: column;
|
justify-content: space-between;
|
align-items: center;
|
"
|
>
|
<el-button
|
style="
|
height: 2.32rem;
|
width: 9rem;
|
font-size: 0.75rem;
|
color: #fff;
|
margin-left: 1rem;
|
"
|
size="small"
|
type="primary"
|
@click="allow(scope.row)"
|
>允许进入检修</el-button
|
>
|
<el-button
|
style="
|
height: 2.32rem;
|
width: 9rem;
|
font-size: 0.75rem;
|
color: #fff;
|
margin-top: 0.25rem;
|
"
|
size="small"
|
@click="forbid(scope.row)"
|
type="warning"
|
>禁止进入检修</el-button
|
>
|
</div>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
<div
|
style="
|
display: flex;
|
justify-content: right;
|
align-self: flex-end;
|
margin-bottom: 1.19rem;
|
margin-right: 1.25rem;
|
"
|
>
|
<el-pagination
|
size="small"
|
background
|
layout="prev, pager, next"
|
:current-page="pageQuery1.page"
|
:page-size="pageQuery1.rows"
|
:total="pageTotal1"
|
@size-change="handleSizeChange1"
|
@current-change="handleCurrentChange1"
|
/>
|
</div>
|
</div>
|
</div>
|
|
<!-- 允许进入检修 -->
|
<el-dialog
|
v-model="claimdialogVisible"
|
title="允许进入检修"
|
width="400"
|
align-center
|
>
|
<div
|
style="
|
height: 5rem;
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
"
|
>
|
<el-icon color="#FAAD14">
|
<WarningFilled />
|
</el-icon>
|
<span style="color: rgba(0, 0, 0, 1); font-size: 1.25rem"
|
>是否确认【{{ info.userTrueName }}】今日允许进入检修?</span
|
>
|
</div>
|
<template #footer>
|
<div class="dialog-footer" style="text-align: right">
|
<el-button @click="claimdialogVisible = false">取消</el-button>
|
<el-button type="primary" @click="allowfn"> 确认 </el-button>
|
</div>
|
</template>
|
</el-dialog>
|
|
<!-- 禁止进入检修 -->
|
<el-dialog
|
v-model="claimdialogVisible1"
|
title="禁止进入检修"
|
width="400"
|
align-center
|
>
|
<div
|
style="
|
height: 5rem;
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
"
|
>
|
<el-icon color="#FAAD14">
|
<WarningFilled />
|
</el-icon>
|
<span style="color: rgba(0, 0, 0, 1); font-size: 1.25rem"
|
>是否确认【{{ info.userTrueName }}】今日禁止进入检修?</span
|
>
|
</div>
|
<template #footer>
|
<div class="dialog-footer" style="text-align: right">
|
<el-button @click="claimdialogVisible1 = false">取消</el-button>
|
<el-button type="primary" @click="forbidfn"> 确认 </el-button>
|
</div>
|
</template>
|
</el-dialog>
|
</div>
|
</template>
|
<script setup>
|
import { ref, toRef, onMounted } from "vue";
|
import { ElMessage } from "element-plus";
|
import {
|
ShowMaintence,
|
PersonnelMonitoring,
|
RunOperation,
|
ChangeTasState,
|
} from "@/api/newapi/Maintenance";
|
//变量
|
const obj = {
|
selectType: "",
|
inputcontent: "",
|
};
|
const queryForm = toRef({ ...obj });
|
const queryForm1 = toRef({ ...obj });
|
const tableData = ref([]);
|
const gridData = ref([]);
|
const stateType = ref([
|
{
|
label: "全部状态",
|
value: "",
|
},
|
{
|
label: "待开始",
|
value: "0",
|
},
|
{
|
label: "检修中",
|
value: "1",
|
},
|
{
|
label: "已完成",
|
value: "2",
|
},
|
]);
|
//分页请求参数
|
const pageQuery = ref({
|
page: 1, //当前页面
|
rows: 20, //每页显示条数
|
order: "desc", //排序方式
|
sort: "", //排序字段
|
wheres: "", //条件查询
|
});
|
//分页请求参数
|
const pageQuery1 = ref({
|
page: 1, //当前页面
|
rows: 20, //每页显示条数
|
order: "desc", //排序方式
|
sort: "", //排序字段
|
wheres: "", //条件查询
|
});
|
const pageTotal = ref(0);
|
const pageTotal1 = ref(0);
|
const claimdialogVisible = ref(false);
|
const claimdialogVisible1 = ref(false);
|
const info = ref({});
|
const account = localStorage.getItem("user")
|
? JSON.parse(localStorage.getItem("user")).userName
|
: ""; //获取账号
|
//正在检修的人数
|
const totalCount = ref(0);
|
|
const allow = (val) => {
|
console.log(val);
|
info.value = val;
|
claimdialogVisible.value = true;
|
};
|
const allowfn = () => {
|
RunOperation(info.value.id, true).then((res) => {
|
ElMessage({
|
message: "操作成功",
|
type: "success",
|
plain: true,
|
});
|
claimdialogVisible.value = false;
|
initData();
|
});
|
};
|
const forbid = (val) => {
|
console.log(val);
|
|
info.value = val;
|
claimdialogVisible1.value = true;
|
};
|
const forbidfn = () => {
|
RunOperation(info.value.id, false).then((res) => {
|
ElMessage({
|
message: "操作成功",
|
type: "success",
|
plain: true,
|
});
|
claimdialogVisible1.value = false;
|
initData();
|
});
|
};
|
|
//分页页面大小改变
|
const handleSizeChange = (val) => {
|
pageQuery.value.rows = val;
|
};
|
|
//分页页面改变
|
const handleCurrentChange = (val) => {
|
pageQuery.value.page = val;
|
};
|
//分页页面大小改变
|
const handleSizeChange1 = (val) => {
|
pageQuery.value.rows = val;
|
};
|
|
//分页页面改变
|
const handleCurrentChange1 = (val) => {
|
pageQuery.value.page = val;
|
};
|
|
//查询
|
const handleQuery = () => {
|
PersonnelMonitoring({
|
pageIndex: pageQuery.value.page,
|
pageSize: pageQuery.value.rows,
|
searchKeyword: queryForm.value.inputcontent,
|
status: queryForm.value.selectType,
|
account: account,
|
}).then((res) => {
|
tableData.value = res.data.items;
|
pageTotal.value = res.data.totalCount;
|
totalCount.value = res.data.items.filter(
|
(v) => v.maintenanceStatus == 1
|
).length;
|
});
|
};
|
|
const handleQuery1 = () => {
|
ShowMaintence({
|
pageIndex: pageQuery.value.page,
|
pageSize: pageQuery.value.rows,
|
searchKeyword: queryForm1.value.inputcontent,
|
account: account,
|
}).then((res) => {
|
gridData.value = res.data.items;
|
pageTotal1.value = res.data.totalCount;
|
});
|
};
|
|
//重置
|
const resetQuery = () => {
|
queryForm.value = { ...obj };
|
handleQuery();
|
};
|
const resetQuery1 = () => {
|
queryForm1.value = { ...obj };
|
handleQuery1();
|
};
|
|
const initData = () => {
|
ShowMaintence({
|
pageIndex: pageQuery.value.page,
|
pageSize: pageQuery.value.rows,
|
searchKeyword: queryForm1.value.inputcontent,
|
account: account,
|
}).then((res) => {
|
gridData.value = res.data.items;
|
pageTotal1.value = res.data.totalCount;
|
});
|
PersonnelMonitoring({
|
pageIndex: pageQuery.value.page,
|
pageSize: pageQuery.value.rows,
|
searchKeyword: queryForm.value.inputcontent,
|
status: queryForm.value.selectType,
|
account: account,
|
}).then((res) => {
|
tableData.value = res.data.items;
|
pageTotal.value = res.data.totalCount;
|
totalCount.value = res.data.items.filter(
|
(v) => v.maintenanceStatus == 1
|
).length;
|
});
|
};
|
|
onMounted(() => {
|
initData();
|
});
|
</script>
|
<style lang="scss" scoped>
|
.Maintenancemanagement {
|
display: flex;
|
|
.Maintenancemanagement_l,
|
.Maintenancemanagement_r {
|
width: 50%;
|
display: flex;
|
background-color: #fff;
|
margin-right: 1rem;
|
|
.content {
|
width: 100%;
|
display: flex;
|
flex-direction: column;
|
|
.checkbox {
|
display: flex;
|
justify-content: space-between;
|
padding: 0.88rem 0.88rem;
|
}
|
|
.serch {
|
display: flex;
|
margin-top: 1.31rem;
|
align-items: center;
|
|
.time_box {
|
display: flex;
|
align-items: center;
|
text-align: center;
|
margin-left: 0.98rem;
|
}
|
|
.serch_box {
|
display: flex;
|
align-items: center;
|
text-align: center;
|
margin-left: 0.98rem;
|
border-radius: 0.38rem;
|
|
.serchb {
|
box-sizing: border-box;
|
width: 6.88rem;
|
height: 2rem;
|
text-align: center;
|
font-size: 0.75rem;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
border: 0.06rem solid rgba(222, 222, 222, 1);
|
}
|
|
input {
|
box-sizing: border-box;
|
outline: none;
|
width: 19rem;
|
height: 2rem;
|
border: 0.06rem solid rgba(222, 222, 222, 1);
|
border-radius: 0 0.25rem 0.25rem 0;
|
padding-left: 0.3125rem;
|
font-size: 1rem;
|
}
|
}
|
}
|
|
.btns {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
margin-top: 1.31rem;
|
margin-left: 1.13rem;
|
padding-right: 2rem;
|
box-sizing: border-box;
|
}
|
}
|
}
|
|
.Maintenancemanagement_r {
|
width: 50%;
|
display: flex;
|
background-color: #fff;
|
margin-right: 0;
|
}
|
}
|
</style>
|