zhgdyun/src/views/projectFront/operationManagement/edgeProtectionInspection.vue
2025-06-04 11:28:25 +08:00

1415 lines
43 KiB
Vue

<template>
<div class="payoff">
<el-row type="flex" style="width: 100%; height: 100%">
<el-col class="left-col">
<vue-scroll>
<div class="scroll">
<div class="list-wrapper">
<div
v-for="(item, index) in operationList"
:key="item.id"
:class="['list-item', { 'is-active': activeIndex == index }]"
@click="handleItemClick(index)"
>
<span class="title">{{ item.operationName }}</span>
</div>
</div>
</div>
</vue-scroll>
</el-col>
<el-col class="right-col">
<el-row style="width: 100%; height: 100%">
<el-col
class="top-col"
:span="4"
:class="styleType == 3 ? 'changeStyle' : ''"
>
<el-form
size="medium"
:model="queryParams"
ref="queryForm"
:inline="true"
>
<el-form-item label="选择设备" prop="devSn">
<el-select
v-model="queryParams.devSn"
placeholder="请选择"
clearable
filterable
>
<el-option
v-for="(item, index) in allUfaceDev"
:key="item.devSn"
:label="item.devName"
:value="item.devSn"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="时间" prop="createDate">
<el-date-picker
v-model="queryParams.createDate"
type="daterange"
value-format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" plain @click="handleQuery"
>查询</el-button
>
<el-button type="warning" plain @click="handleRefresh"
>刷新</el-button
>
</el-form-item>
<el-form-item>
<el-button
v-permission="{
key: 'demonGeneration',
menuPath:
'/project/operationManagement/edgeProtectionInspection',
}"
type="primary"
@click="ruleConfigDialog"
>演示数据生成</el-button
>
</el-form-item>
<el-form-item>
<el-button
v-permission="{
key: 'datchDelete',
menuPath:
'/project/operationManagement/edgeProtectionInspection',
}"
type="primary"
@click="deleteAttendanceBatch"
>批量删除</el-button
>
</el-form-item>
</el-form>
</el-col>
<el-col
class="bottom-col"
:span="20"
:class="styleType == 3 ? 'bottomTwo' : ''"
>
<div class="scroll" :class="styleType == 3 ? 'boxBottom' : ''">
<el-table
:max-height="570"
:height="570"
ref="multipleTable"
v-loading="loading"
:data="userList"
class="tables table-box"
:class="{'scrollbar-exists': scrollbarFlag}"
>
<template slot="empty">
<el-empty :image="require('@/assets/images/noData4.png')" :image-size="100" description="暂无数据"></el-empty>
</template>
<el-table-column
type="selection" align="center"
width="55"
></el-table-column>
<el-table-column
label="设备名称"
align="center"
prop="devName"
/>
<el-table-column
label="设备编号"
align="center"
prop="devSn"
>
<template #default="{ row }">
<span>{{ row.devSn }}</span>
</template>
</el-table-column>
<el-table-column
label="创建时间"
align="center"
prop="createDate"
/>
<el-table-column
label="剩余电量百分比(%)"
align="center"
prop="battery"
/>
<el-table-column
label="人员靠近"
align="center"
prop="proximity"
>
<template #default="{ row }">
<span>{{ deviceStateUp(row.proximity,proximityList,'proximityName','proximityId') }}</span>
</template>
</el-table-column>
<el-table-column
label="防翻越"
align="center"
prop="antiCross"
>
<template #default="{ row }">
<span>{{ deviceStateUp(row.antiCross,antiCrossList,'antiCrossName','antiCrossId') }}</span>
</template>
</el-table-column>
<el-table-column
label="线锁一状态"
align="center"
prop="portStatus1"
>
<template #default="{ row }">
<span>{{ deviceStateUp(row.portStatus1,portStatusList,'portStatusName','portStatusId') }}</span>
</template>
</el-table-column>
<el-table-column
label="线锁二状态"
align="center"
prop="portStatus2"
>
<template #default="{ row }">
<span>{{ deviceStateUp(row.portStatus2,portStatusList,'portStatusName','portStatusId') }}</span>
</template>
</el-table-column>
<el-table-column
label="磁锁一状态"
align="center"
prop="magStatus1"
>
<template #default="{ row }">
<span>{{ deviceStateUp(row.magStatus1,magStatusList,'magStatusName','magStatusId') }}</span>
</template>
</el-table-column>
<el-table-column
label="磁锁二状态"
align="center"
prop="magStatus2"
>
<template #default="{ row }">
<span>{{ deviceStateUp(row.magStatus2,magStatusList,'magStatusName','magStatusId') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template #default="{ row }">
<el-button
v-permission="{
key: 'edit',
menuPath:
'/project/operationManagement/edgeProtectionInspection',
}"
style="border: 0 !important"
type="text"
icon="el-icon-edit"
@click="handleUpdate(row)"
>编辑</el-button
>
<el-button
v-permission="{
key: 'delete',
menuPath:
'/project/operationManagement/edgeProtectionInspection',
}"
style="border: 0 !important; color: #f56c6c"
type="text"
icon="el-icon-delete"
@click="handleDelete(row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<el-row type="flex" justify="center">
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:pageSizes="[...$store.state.PAGESIZRS, 100, 200, 500, 1000]"
@pagination="getList"
layout="total,sizes, prev, pager, next, jumper"
/>
</el-row>
</div>
</el-col>
</el-row>
</el-col>
</el-row>
<!-- 编辑弹窗 -->
<el-dialog :visible.sync="open" width="600px" append-to-body title="编辑">
<el-form
ref="editForm"
:model="editForm"
:rules="editFormRules"
size="medium"
label-width="220px"
>
<el-form-item label="选择设备" prop="devSn">
<el-select
v-model="editForm.devSn"
placeholder="请选择"
clearable
filterable
>
<el-option
v-for="(item, index) in allUfaceDev"
:key="item.devSn"
:label="item.devName"
:value="item.devSn"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="剩余电量百分比(%)" prop="battery">
<el-input-number :controls="false" v-model="editForm.battery"></el-input-number>
</el-form-item>
<el-form-item label="创建时间" prop="createDate">
<el-date-picker
value-format="yyyy-MM-dd hh:mm:ss"
type="datetime"
placeholder="上传时间"
v-model="editForm.createDate"
></el-date-picker>
</el-form-item>
<el-form-item label="人员靠近" prop="proximity">
<el-select
v-model="editForm.proximity"
placeholder="请选择"
clearable
filterable
>
<el-option
v-for="(item, index) in proximityList"
:key="item.proximityId"
:label="item.proximityName"
:value="item.proximityId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="防翻越" prop="antiCross">
<el-select
v-model="editForm.antiCross"
placeholder="请选择"
clearable
filterable
>
<el-option
v-for="(item, index) in antiCrossList"
:key="item.antiCrossId"
:label="item.antiCrossName"
:value="item.antiCrossId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="线锁一状态" prop="portStatus1">
<el-select
v-model="editForm.portStatus1"
placeholder="请选择"
clearable
filterable
>
<el-option
v-for="(item, index) in portStatusList"
:key="item.portStatusId"
:label="item.portStatusName"
:value="item.portStatusId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="线锁二状态" prop="portStatus2">
<el-select
v-model="editForm.portStatus2"
placeholder="请选择"
clearable
filterable
>
<el-option
v-for="(item, index) in portStatusList"
:key="item.portStatusId"
:label="item.portStatusName"
:value="item.portStatusId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="磁锁一状态" prop="magStatus1">
<el-select
v-model="editForm.magStatus1"
placeholder="请选择"
clearable
filterable
>
<el-option
v-for="(item, index) in magStatusList"
:key="item.magStatusId"
:label="item.magStatusName"
:value="item.magStatusId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="磁锁二状态" prop="magStatus2">
<el-select
v-model="editForm.magStatus2"
placeholder="请选择"
clearable
filterable
>
<el-option
v-for="(item, index) in magStatusList"
:key="item.magStatusId"
:label="item.magStatusName"
:value="item.magStatusId"
></el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" style="text-align: center">
<el-button @click="cancel">取消</el-button>
<el-button type="primary" @click="submitForm">确定</el-button>
</div>
</el-dialog>
<!-- 下载模拟数据弹窗 -->
<el-dialog
:visible.sync="downSimulateShow"
width="600px"
append-to-body
title="下载模拟数据"
>
<el-radio-group class="simulate_box" v-model="staffSimulateRadio">
<el-radio
:label="item.staffSimulateId"
v-for="item in staffSimulateList"
:key="item.staffSimulateId"
>{{ item.staffSimulateName }}</el-radio
>
</el-radio-group>
<div slot="footer">
<el-button @click="downSimulateShow = false">取消</el-button>
<el-button type="primary" @click="submitDownSimulate">确定</el-button>
</div>
</el-dialog>
<!-- 演示数据生成弹窗 -->
<el-dialog
:visible.sync="ruleConfigShow"
width="800px"
append-to-body
title="规则配置"
class="ruleConfig_box"
>
<el-form
ref="ruleConfigForm"
:model="ruleConfigForm"
:rules="ruleConfigFormRules"
size="medium"
label-width="160px"
>
<el-form-item label="选择设备" prop="devSns">
<el-checkbox-group v-model="ruleConfigForm.devSns">
<el-checkbox
:label="item.devSn"
v-for="item in allUfaceDev"
:key="item.devSn"
>{{ item.devName }}</el-checkbox
>
</el-checkbox-group>
</el-form-item>
<el-form-item label="数据量" prop="devGenerateNum">
<span class="mr_8">所选设备每个设备随机生成</span
><el-input-number
v-model="ruleConfigForm.devGenerateNum"
:min="0"
:max="999"
></el-input-number
><span class="ml_8">条数据</span>
</el-form-item>
<el-form-item label="模拟上传时间范围" prop="startTime">
<div class="flex">
<el-form-item prop="startTime">
<el-date-picker
value-format="yyyy-MM-dd HH:mm:ss"
type="datetime"
placeholder="开始时间"
:picker-options="handleTimeChange(ruleConfigForm.endTime, 'startTime')"
v-model="ruleConfigForm.startTime"
></el-date-picker>
</el-form-item>
<span class="mr_8 ml_8">至</span>
<el-form-item prop="endTime">
<el-date-picker
:picker-options="handleTimeChange(ruleConfigForm.startTime, 'endTime')"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetime"
placeholder="结束时间"
v-model="ruleConfigForm.endTime"
></el-date-picker>
</el-form-item>
</div>
</el-form-item>
<el-form-item class="ruleconfig_staff1" label="剩余电量百分比(%)">
<el-input-number
placeholder="小"
:controls="false"
v-model="ruleConfigForm.batteryBegin"
:max="ruleConfigForm.batteryEnd ? ruleConfigForm.batteryEnd : Infinity"
controls-position="right"
></el-input-number>
<span class="mr_8 ml_8">~</span>
<el-input-number
:controls="false"
:min="ruleConfigForm.batteryBegin ? ruleConfigForm.batteryBegin : -Infinity"
v-model="ruleConfigForm.batteryEnd"
controls-position="right"
placeholder="大"
></el-input-number>
</el-form-item>
<el-form-item label="人员靠近" prop="proximitys">
<el-checkbox-group v-model="ruleConfigForm.proximitys">
<el-checkbox
v-for="item in proximityList"
:key="item.proximityId"
:label="item.proximityId.toString()"
>{{ item.proximityName }}</el-checkbox
>
</el-checkbox-group>
</el-form-item>
<el-form-item label="防翻越" prop="antiCrosses">
<el-checkbox-group v-model="ruleConfigForm.antiCrosses">
<el-checkbox
v-for="item in antiCrossList"
:key="item.antiCrossId"
:label="item.antiCrossId.toString()"
>{{ item.antiCrossName }}</el-checkbox
>
</el-checkbox-group>
</el-form-item>
<el-form-item label="线锁一状态" prop="portStatus1s">
<el-checkbox-group v-model="ruleConfigForm.portStatus1s">
<el-checkbox
v-for="item in portStatusList"
:key="item.portStatusId"
:label="item.portStatusId.toString()"
>{{ item.portStatusName }}</el-checkbox
>
</el-checkbox-group>
</el-form-item>
<el-form-item label="线锁二状态" prop="portStatus2s">
<el-checkbox-group v-model="ruleConfigForm.portStatus2s">
<el-checkbox
v-for="item in portStatusList"
:key="item.portStatusId"
:label="item.portStatusId.toString()"
>{{ item.portStatusName }}</el-checkbox
>
</el-checkbox-group>
</el-form-item>
<el-form-item label="磁锁一状态" prop="magStatus1s">
<el-checkbox-group v-model="ruleConfigForm.magStatus1s">
<el-checkbox
v-for="item in magStatusList"
:key="item.magStatusId"
:label="item.magStatusId.toString()"
>{{ item.magStatusName }}</el-checkbox
>
</el-checkbox-group>
</el-form-item>
<el-form-item label="磁锁二状态" prop="magStatus2s">
<el-checkbox-group v-model="ruleConfigForm.magStatus2s">
<el-checkbox
v-for="item in magStatusList"
:key="item.magStatusId"
:label="item.magStatusId.toString()"
>{{ item.magStatusName }}</el-checkbox
>
</el-checkbox-group>
</el-form-item>
</el-form>
<div slot="footer" style="text-align: center">
<el-button
:loading="ruleConfigLoading"
type="primary"
@click="submitRuleConfigForm"
>{{
ruleConfigLoading ? "正在生成数据,请耐心等待!" : "开始生成"
}}</el-button
>
<el-button type="primary" @click="ruleConfigReset">重置配置</el-button>
<el-button @click="ruleConfigCancel">取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
enterpriseList,
teamList,
departmentList,
payrollRecord,
exportSalaryPdf,
exportSalaryExcel,
updateWorkerWagesPayment,
} from "@/assets/js/api/laborManagement/payoff";
import {
exportAttendanceExcel,
deleteBatchFrontierProtectionDevCurrentApi,
editFrontierProtectionDevCurrentApi,
mockDataFrontierProtectionDevCurrentApi,
getDepartmentAndTeamListApi,
getMockFrontierProtectionDevCurrentDataConfigApi,
saveMockFrontierProtectionDevCurrentDataConfigApi,
resetMockFrontierProtectionDevCurrentDataConfigApi
} from "@/assets/js/api/operationManagement";
import { selectDustNoisePageListApi } from "@/assets/js/api/environmentManage";
import {
getWorkerInfoList,
getPageListApi,
getEnterpriseInfoList,
} from "@/assets/js/api/laborPerson";
import {
getfpdcdPageApi,
getfpdcdListApi, //设备下拉
} from "@/assets/js/api/edgeProtection";
import { nowDate } from "@/util";
import dayjs from "dayjs";
export default {
data: () => ({
// 模拟数据下载弹窗
downSimulateShow: false,
staffSimulateRadio: 50,
staffSimulateList: [
{
staffSimulateId: 50,
staffSimulateName: "人员模拟数据(50)人.zip",
},
{
staffSimulateId: 100,
staffSimulateName: "人员模拟数据(100)人.zip",
},
{
staffSimulateId: 500,
staffSimulateName: "人员模拟数据(500)人.zip",
},
{
staffSimulateId: 1000,
staffSimulateName: "人员模拟数据(1000)人.zip",
},
],
deviceStateList: [
{
deviceStateId: 0,
deviceStateName: "状态",
},
{
deviceStateId: 1,
deviceStateName: "报警",
},
{
deviceStateId: 2,
deviceStateName: "其他",
},
],
cardTypeList: [
{
cardTypeId: 1,
cardTypeName: "布防",
},
{
cardTypeId: 2,
cardTypeName: "撤防",
},
{
cardTypeId: 3,
cardTypeName: "SOS",
},
{
cardTypeId: 4,
cardTypeName: "盗警",
},
{
cardTypeId: 5,
cardTypeName: "交流电故障",
},
],
proximityList: [{
proximityId: 1,
proximityName: "正常",
}, {
proximityId: 2,
proximityName: "入侵",
},{
proximityId: 3,
proximityName: "正常入侵",
}],
antiCrossList: [{
antiCrossId: 1,
antiCrossName: "正常",
}, {
antiCrossId: 2,
antiCrossName: "报警",
},{
antiCrossId: 3,
antiCrossName: "失效",
}],
portStatusList: [{
portStatusId: 1,
portStatusName: "正常",
}, {
portStatusId: 2,
portStatusName: "断开",
},{
portStatusId: 3,
portStatusName: "正常断开",
}],
magStatusList: [{
magStatusId: 1,
magStatusName: "正常",
}, {
magStatusId: 2,
magStatusName: "报警",
},{
magStatusId:
3,
magStatusName: "失效",
}],
checkAll: false,
isIndeterminate: true,
ruleConfigLoading: false,
isDepartmentTeamList: [],
personList: [],
allUfaceDev: [],
// 演示数据生成弹窗
ruleConfigShow: false,
ruleConfigForm: {
devSns: [],
devGenerateNum: "",
startTime: "",
endTime: "",
batteryBegin:"",
batteryEnd:"",
proximitys: [],
antiCrosses: [],
portStatus1s: [],
portStatus2s: [],
magStatus1s: [],
magStatus2s: [],
},
ruleConfigFormRules: {
devSns: [
{
type: "array",
required: true,
message: "请至少选择一个设备",
trigger: "change",
},
],
devGenerateNum: [
{ required: true, message: "请输入数据量", trigger: "blur" },
],
startTime: [
{
required: true,
message: "请选择模拟开始时间",
trigger: "change",
},
],
endTime: [
{
required: true,
message: "请选择模拟结束时间",
trigger: "change",
},
],
proximitys: [
{
type: "array",
required: true,
message: "请至少选择一个人员靠近状态",
trigger: "change",
},
],
antiCrosses: [
{
type: "array",
required: true,
message: "请至少选择一个防翻越状态",
trigger: "change",
},
],
portStatus1s: [
{
type: "array",
required: true,
message: "请至少选择一个线锁一状态",
trigger: "change",
},
],
portStatus2s: [
{
type: "array",
required:
true,
message: "请至少选择一个线锁二状态",
trigger: "change",
},
],
magStatus1s: [
{
type: "array",
required: true,
message: "请至少选择一个磁锁一状态",
trigger: "change",
},
],
magStatus2s: [
{
type: "array",
required: true,
message: "请至少选择一个磁锁二状态",
trigger: "change",
},
],
},
// 3 衢州版 2 星璇版 1 正常版本
styleType: "",
// 项目SN
projectSn: "",
// 弹窗标题
title: "",
// 控制弹窗的打开与关闭
open: false,
// 遮罩层
loading: false,
// 当前激活的项目
activeIndex: 0,
// 项目列表
operationList: [
{
operationId: 1,
operationName: "实时数据",
},
],
// 总条数
total: 1,
// 用户数据
userList: [],
// 班组列表选项
teamOptions: [],
// 部门列表选项
departmentOptions: [],
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 10,
projectSn: undefined, // 项目SN
enterpriseId: undefined, // 企业ID
createDate: [], // 报警时间
devSn: "",
},
editForm: {},
editFormRules: {
devSn: [{ required: true, message: "请选择设备", trigger: "change" }],
deviceStatus: [
{ required: true, message: "请选择设备", trigger: "change" },
],
detailStatus: [
{ required: true, message: "请输入状态内容", trigger: "blur" },
],
createDate: [
{ required: true, message: "请选择报警时间", trigger: "change" },
],
},
enterpriseListData: [],
scrollbarFlag: false,
}),
computed: {
headers() {
return { Authorization: this.$store.state.userInfo.token };
},
deviceStateUp() {
return (deviceStatus, dataList, lable, id) => {
const resultList = [...dataList];
const find = resultList.find(
(item) => item[id] == deviceStatus
);
return find ? find[lable] : "";
};
},
},
created() {
this.projectSn = this.$store.state.projectSn;
this.styleType = this.$store.state.userInfo.styleType;
// 查询企业列表
this.getEnterpriseList();
// this.getPersonListFn();
this.getMachineList();
this.getCompanyList();
},
methods: {
handleTimeChange(diffTime, type) {
return {
disabledDate: (time) => {
// console.log(time, diffTime, type)
const date1 = dayjs(time)
const date2 = dayjs(diffTime)
if(type == 'startTime'){
return date1.diff(date2) > 0 ? true : false;
} else if(type == 'endTime'){
return date2.diff(date1) > 0 ? true : false;
}
return false
},
};
},
enterpriseChange(enterpriseIds, departmentTeamIds, type) {
getDepartmentAndTeamListApi({
projectSn: this.projectSn,
enterpriseIds:
enterpriseIds instanceof Array
? enterpriseIds.join(",")
: enterpriseIds,
}).then((res) => {
if (res.success) {
this.isDepartmentTeamList = res.result;
if (type != 1) {
this.ruleConfigForm.departmentTeamIds = [];
this.editForm.departmentTeamId = "";
}
this.departmentTeamChange(enterpriseIds, departmentTeamIds, type);
}
});
},
departmentTeamChange(enterpriseIds, departmentTeamIds, type) {
let reqeustData = {
projectSn: this.$store.state.projectSn,
};
if (
enterpriseIds instanceof Array &&
departmentTeamIds instanceof Array
) {
reqeustData.enterpriseIds = enterpriseIds;
reqeustData.departmentTeamIds = departmentTeamIds;
} else {
reqeustData.enterpriseId = enterpriseIds;
reqeustData.departmentTeamId = departmentTeamIds;
}
getWorkerInfoList(reqeustData).then((res) => {
this.personList = res.result.records;
if (type != 1) {
this.ruleConfigForm.personSns = [];
this.editForm.personSn = "";
}
});
},
// 演示数据生成弹窗
ruleConfigDialog() {
// this.ruleConfigReset();
getMockFrontierProtectionDevCurrentDataConfigApi({
projectSn: this.projectSn,
}).then((res) => {
if (res.success) {
if (res.result instanceof Array && res.result.length > 0) {
const result = res.result[0];
this.ruleConfigForm = {
...result,
devSns: result.devSns ? result.devSns.split(",") : [],
proximitys: result.proximitys ? result.proximitys.split(",") : [],
antiCrosses: result.antiCrosses ? result.antiCrosses.split(",") : [],
portStatus1s: result.portStatus1s ? result.portStatus1s.split(",") : [],
portStatus2s: result.portStatus2s ? result.portStatus2s.split(",") : [],
magStatus1s: result.magStatus1s ? result.magStatus1s.split(",") : [],
magStatus2s: result.magStatus2s ? result.magStatus2s.split(",") : [],
};
}
this.$nextTick(() => {
this.$refs["ruleConfigForm"].clearValidate();
})
}
});
this.ruleConfigShow = true;
},
submitRuleConfigForm() {
this.$refs["ruleConfigForm"].validate((valid) => {
if (!valid) return;
this.ruleConfigLoading = true;
const params = {
...this.ruleConfigForm,
devSns: this.ruleConfigForm.devSns.join(","),
proximitys: this.ruleConfigForm.proximitys.join(","),
antiCrosses: this.ruleConfigForm.antiCrosses.join(","),
portStatus1s: this.ruleConfigForm.portStatus1s.join(","),
portStatus2s: this.ruleConfigForm.portStatus2s.join(","),
magStatus1s: this.ruleConfigForm.magStatus1s.join(","),
magStatus2s: this.ruleConfigForm.magStatus2s.join(","),
projectSn: this.projectSn,
};
mockDataFrontierProtectionDevCurrentApi(params)
.then((res) => {
if (res.success) {
this.$message.success(res.message);
this.getList();
this.ruleConfigShow = false;
}
})
.finally(() => {
this.ruleConfigLoading = false;
});
});
},
ruleConfigCancel() {
// this.ruleConfigReset();
this.ruleConfigShow = false;
},
// 表单重置
ruleConfigReset() {
// this.ruleConfigForm = {
// devSns: [],
// devGenerateNum: "",
// startTime: "",
// endTime: "",
// detailStatuses: []
// };
// this.resetForm("ruleConfigForm");
const params = {
// ...this.ruleConfigForm,
// devSns: this.ruleConfigForm.devSns.join(","),
// proximitys: this.ruleConfigForm.proximitys.join(","),
// antiCrosses: this.ruleConfigForm.antiCrosses.join(","),
// portStatus1s: this.ruleConfigForm.portStatus1s.join(","),
// portStatus2s: this.ruleConfigForm.portStatus2s.join(","),
// magStatus1s: this.ruleConfigForm.magStatus1s.join(","),
// magStatus2s: this.ruleConfigForm.magStatus2s.join(","),
projectSn: this.projectSn,
};
// saveMockFrontierProtectionDevCurrentDataConfigApi
resetMockFrontierProtectionDevCurrentDataConfigApi(params).then((res) => {
if (res.success) {
this.$message.success(res.message);
// this.ruleConfigShow = false;
this.ruleConfigDialog();
}
});
},
// 打卡人员模拟数据弹窗
downSimulateDialog() {
this.downSimulateShow = true;
},
// 下载人员模拟数据
submitDownSimulate() {
this.downSimulateShow = false;
const find = this.staffSimulateList.find(
(item) => item.staffSimulateId === this.staffSimulateRadio
);
exportAttendanceExcel({
workerNum: this.staffSimulateRadio,
projectSn: this.projectSn,
fetchName: find ? find.staffSimulateName : "",
url: "xmgl/workerInfo/downloadMockWorkerInfo",
}).then((res) => {
window.open(res.result);
});
},
getPersonListFn() {
let reqeustData = {
projectSn: this.$store.state.projectSn,
enterpriseId: "",
};
getWorkerInfoList(reqeustData).then((res) => {
this.personList = res.result.records;
});
},
//获取所有的闸机设备
getMachineList() {
getfpdcdListApi({ projectSn: this.$store.state.projectSn }).then(
(list) => {
this.allUfaceDev = list.result;
}
);
},
// 批量删除考勤人员
deleteAttendanceBatch() {
if (this.$refs.multipleTable.selection.length === 0)
return this.$message.warning("请勾选需要删除的数据!");
this.$confirm("删除后操作不可恢复,请谨慎操作!", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
const ids = this.$refs.multipleTable.selection
.map((item) => item.id)
.join(",");
console.log(this.$refs.multipleTable.selection);
deleteBatchFrontierProtectionDevCurrentApi({ ids }).then((res) => {
this.getList();
});
})
.catch(() => {});
},
/** 查询企业列表 */
getEnterpriseList() {
const params = {
projectSn: this.projectSn,
enterpriseName: undefined,
userEnterpriseId: this.$store.state.userInfo.userEnterpriseId,
enterpriseTypeId: undefined,
};
enterpriseList(params).then((res) => {
// 查询数据
this.getList();
// 查询班组列表
this.getTeamList();
// 查询部门列表
this.getDepartmentList();
});
},
/** 查询用户数据 */
getList() {
this.loading = true;
this.queryParams.projectSn = this.projectSn;
getfpdcdPageApi({
projectSn: this.projectSn,
pageNo: this.queryParams.pageNo,
pageSize: this.queryParams.pageSize,
devSn: this.queryParams.devSn,
createDate_begin:
this.queryParams.createDate.length > 0
? this.queryParams.createDate[0]
: "",
createDate_end:
this.queryParams.createDate.length > 0
? this.queryParams.createDate[1]
: "",
mockDesc: 1
// isMock: this.queryParams.enterpriseId == 2 ? 1 : "",
}).then(({ result }) => {
console.log("查询用户数据: ", result);
this.userList = result.records;
this.total = result.total - 0;
this.$nextTick(() => {
this.scrollbarFn();
})
this.loading = false;
});
},
scrollbarFn() {
const div = document.querySelector('.table-box .el-table__body-wrapper');
if (div.scrollHeight > div.clientHeight) {
this.scrollbarFlag = true;
} else {
this.scrollbarFlag = false;
}
},
//获取所属 企业下拉
getCompanyList() {
let data = {
projectSn: this.projectSn,
enterpriseName: "",
userEnterpriseId: this.$store.state.userInfo.userEnterpriseId,
};
getEnterpriseInfoList(data).then((res) => {
this.enterpriseListData = res.result;
});
},
/** 查询班组列表 */
getTeamList() {
const params = {
// enterpriseId: this.queryParams.enterpriseId,
projectSn: this.projectSn,
};
teamList(params).then((res) => {
console.log("查询班组列表: ", res);
this.teamOptions = res.result.list;
// this.isDepartmentTeamList = [...this.isDepartmentTeamList, ...res.result.list];
});
},
/** 查询部门列表 */
getDepartmentList() {
const params = {
// enterpriseId: this.queryParams.enterpriseId,
projectSn: this.projectSn,
};
departmentList(params).then((res) => {
console.log("查询部门列表: ", res);
this.departmentOptions = res.result.list;
// this.isDepartmentTeamList = [...this.isDepartmentTeamList, ...res.result.list];
});
},
/** 项目列表 点击操作 */
handleItemClick(index) {
if (this.activeIndex == index) return;
this.activeIndex = index;
this.queryParams.pageNo = 1;
this.getList();
// this.getTeamList();
// this.getDepartmentList();
},
// 表单重置
reset() {
this.editForm = {
devSn: "",
deviceStatus: "",
detailStatus: "",
battery: "",
proximity: "",
antiCross: "",
portStatus1: "",
portStatus2: "",
magStatus1: "",
magStatus2: "",
createDate: "",
};
this.resetForm("editForm");
},
/** 查询 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
handleRefresh() {
this.queryParams.pageNo = 1;
this.queryParams.devSn = "";
this.queryParams.createDate = [];
this.getList();
},
/** 导出 */
handleExport() {
let params = {
projectSn: this.projectSn,
teamName: this.queryParams.teamName,
departmentId: this.queryParams.departmentId,
payStatus: this.queryParams.payStatus,
payMonth: this.queryParams.payMonth,
enterpriseId: this.queryParams.enterpriseId,
};
exportSalaryPdf(params);
},
/** 导出Excel */
handleExportExcel() {
let params = {
projectSn: this.projectSn,
teamName: this.queryParams.teamName,
departmentId: this.queryParams.departmentId,
payStatus: this.queryParams.payStatus,
payMonth: this.queryParams.payMonth,
enterpriseId: this.queryParams.enterpriseId,
};
// console.log('导出参数',params)
exportSalaryExcel(params);
},
handleUploadSuccess(res) {
console.log("导入成功");
if (res.code == 200) {
this.$message.success(res.message);
this.getEnterpriseList();
this.$refs.upload.clearFiles();
} else {
this.$message.error(res.message);
}
},
handleUploadError() {
this.$message.error("导入失败");
},
// 删除人员考勤
handleDelete(row) {
this.$confirm("删除后操作不可恢复,请谨慎操作!", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
deleteBatchFrontierProtectionDevCurrentApi({ ids: row.id }).then(
(res) => {
this.getList();
}
);
})
.catch(() => {});
},
/** 编辑 || 更新 */
handleUpdate(row) {
this.reset();
this.editForm = Object.assign(this.editForm, row);
console.log("this.editForm: ", this.editForm);
this.open = true;
},
/** 取消按钮 */
cancel() {
this.reset();
this.open = false;
},
/** 提交按钮 */
submitForm: function () {
this.$refs["editForm"].validate((valid) => {
if (!valid) return;
const params = {
...this.editForm,
projectSn: this.projectSn,
};
editFrontierProtectionDevCurrentApi(params).then((res) => {
this.getList();
this.cancel();
});
});
},
handleAvatarSuccess(res, file) {
if (res.status == "SUCCESS") {
this.editForm.fileList.push({
name: file.response.data[0].imageUrl,
url: this.$store.state.FILEURL + file.response.data[0].imageUrl,
});
}
},
handleExceed(files, fileList) {
this.$message.warning(
this.$t("message.docManage.dialog_upload_files.limitingChoice")
);
},
handleDeleteDialog(file, fileList) {
this.editForm.fileList = fileList;
},
},
};
</script>
<style lang="scss">
.text_hint {
width: 280px;
}
</style>
<style lang="scss" scoped>
:deep(.el-table__empty-block) {
width: 100% !important;
.el-empty__description {
margin-top: 0px;
p {
line-height: 30px;
}
}
}
:deep(.el-table__fixed-right) {
bottom: 0 !important;
right: 0 !important;
}
.scrollbar-exists :deep(.el-table__fixed-right) {
right: 4px !important;
}
.flex {
display: flex;
}
.ruleConfig_box :deep(.el-dialog__title) {
font-weight: bold;
}
.mr_8 {
margin-right: 8px;
}
.ml_8 {
margin-left: 8px;
}
.el-input {
width: 220px;
}
.ruleconfig_staff {
display: flex;
flex-direction: column;
flex-wrap: wrap;
// align-content: center;
.el-input-number {
width: 70px;
}
}
.simulate_box {
display: flex;
flex-direction: column;
padding-left: 80px;
.el-radio {
line-height: 30px;
}
}
.el-icon-question {
margin-left: 5px;
}
.payoff {
display: flex;
width: 100%;
height: 100%;
.left-col {
width: calc(10% - 20px);
padding-top: 20px;
margin-right: 20px;
height: 100%;
background-color: #fff;
// 工程列表
.list-wrapper {
box-sizing: border-box;
height: 100%;
border-top: 2px solid #f3f5fd;
}
.list-item {
box-sizing: border-box;
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
height: 45px;
padding: 10px 20px;
cursor: pointer;
transition: all 0.3s ease-in;
background-color: #fff;
border-left: 3px solid transparent;
border-bottom: 2px solid #f3f5fd;
}
.list-item.is-active {
width: 100%;
box-sizing: border-box;
// border-left-color: #0e74d6;
// background-color: #f3f6fd;
border-left-color: #4E7CFF;
color: #4E7CFF;
background-color: rgba(78, 124, 255, 0.25) !important;
}
}
.right-col {
width: 90%;
height: 100%;
.top-col,
.bottom-col {
background: #fff;
}
.top-col {
padding: 20px 25px;
width: 100%;
height: 10%;
margin-bottom: 20px;
}
.bottom-col {
width: 100%;
height: calc(90% - 20px);
}
}
}
/* 查询表单 按钮样式 */
// .right-col ::v-deep .el-button {
// border-color: #4e7cff;
// }
.scroll {
overflow-y: auto;
}
.boxBottom {
margin-top: 30px;
}
::v-deep .el-input__inner {
line-height: 1px !important;
}
</style>