feat:人员管理bug

This commit is contained in:
dzc committed 2025-09-23 20:00:56 +08:00
1 parent db5d661787
commit 2d9da09063
7 files changed
+125 -27

No files matched your search

@@ -0,0 +1,92 @@
<template>
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="180px"
v-loading="state.loading">
<!-- **************************** start 军车配置 start **************************** -->
<el-divider class="my-12">军车配置</el-divider>
<el-form-item prop="armyCarSetting.armyCarPrefixs">
<template #label>
<div class="flex items-center gap-1">
<span>军车车牌前缀</span>
</div>
</template>
<el-select style="width: 100%" v-model="form.armyCarSetting.armyCarPrefixs" multiple filterable allow-create
default-first-option :reserve-keyword="false" placeholder="请输入军车车牌前缀">
<el-option v-for="item in form.armyCarSetting.armyCarPrefixs" :key="item" :label="item" :value="item" />
</el-select>
</el-form-item>
<!-- **************************** end 军车配置 end **************************** -->
</el-form>
</template>
<script setup lang="ts" name="car-manage">
import { useMessage } from "/@/hooks/message"
import * as ComDhSettingApi from "/@/api/com/comDhSetting";
const dataFormRef = ref();
const state = reactive<any>({
loading: false,
})
// 提交表单数据
const form = reactive<any>({
// 军车配置
armyCarSetting: {
// 军车前缀
armyCarPrefixs: [],
},
})
const dataRules = ref({
// 军车配置
"armyCarSetting.armyCarPrefixs": [{ required: true, message: '军车前缀不能为空', trigger: 'blur' }],
})
onMounted(() => {
getSetting()
})
async function getSetting() {
state.loading = true
try {
const { data } = await ComDhSettingApi.getObj()
if (!data.armyCarSetting) {
data.armyCarSetting = {
armyCarPrefixs: [],
}
}
if (data) {
Object.assign(form, data)
}
} catch (err: any) {
console.error(err);
} finally {
state.loading = false
}
}
async function onSubmit() {
const valid = await dataFormRef.value.validate().catch(() => { });
if (!valid) return false;
state.loading = true
try {
const _form = {
...form,
}
await ComDhSettingApi.putObj(_form)
useMessage().success('修改成功');
} catch (err: any) {
console.error(err);
useMessage().error(err.msg);
} finally {
state.loading = false
}
}
defineExpose({
getSetting,
onSubmit
});
</script>
+13
View File
@@ -17,6 +17,9 @@
<div class="w-full" v-if="state.currentTab === 'CLEANING_DATA'">
<CleaningData ref="cleaningDataRef" />
</div>
<div class="w-full" v-if="state.currentTab === 'CAR_MANAGE'">
<CarManageSetting ref="carManageSettingRef" />
</div>
<div class="h-20" />
</div>
<div class="flex justify-center">
@@ -31,6 +34,7 @@ const CarSetting = defineAsyncComponent(() => import('./car/car-setting.vue'));
const CleaningData = defineAsyncComponent(() => import('./cleaningData/cleaning-data.vue'));
const DoorSetting = defineAsyncComponent(() => import('./door/door-setting.vue'));
const PanelSetting = defineAsyncComponent(() => import('./panel/index.vue'));
const CarManageSetting = defineAsyncComponent(() => import('./carManage/car-manage.vue'));
const data = {
tabs: [
@@ -49,6 +53,10 @@ const data = {
{
label: "数据清洗",
name: "CLEANING_DATA",
},
{
label: "车辆配置",
name: "CAR_MANAGE",
}
]
}
@@ -57,6 +65,7 @@ const doorSetting = ref()
const carSetting = ref()
const panelSetting = ref()
const cleaningDataRef = ref()
const carManageSettingRef = ref()
const state = reactive<any>({
currentTab: data.tabs[0].name,
@@ -83,5 +92,9 @@ function onSubmit() {
cleaningDataRef.value.onSubmit()
return
}
if (state.currentTab == "CAR_MANAGE") {
carManageSettingRef.value.onSubmit()
return
}
}
</script>
+4 -1
View File
@@ -6,6 +6,9 @@
<el-form-item style="width: 250px;" label="车牌号" prop="carNum">
<el-input v-model="state.queryForm.carNum" placeholder="请输入车牌号" />
</el-form-item>
<el-form-item style="width: 250px;" label="是否军车" prop="isArmyCar">
<dict-select v-model="state.queryForm.isArmyCar" :options="yes_no_type" placeholder="请选择" />
</el-form-item>
<el-form-item style="width: 250px;" label="车主姓名" prop="personName">
<el-input v-model="state.queryForm.personName" placeholder="请输入车主姓名" />
</el-form-item>
@@ -112,7 +115,7 @@ const storesPanel = usePanel()
// 引入组件
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
// 定义查询字典
const { dh_car_color, dh_car_num_color, dh_car_brand, dh_car_type, dh_car_status, dh_car_list_type } = useDict("dh_car_color", "dh_car_num_color", "dh_car_brand", "dh_car_type", "dh_car_status", "dh_car_list_type")
const { dh_car_color, dh_car_num_color, dh_car_brand, dh_car_type, dh_car_status, dh_car_list_type, yes_no_type } = useDict("dh_car_color", "dh_car_num_color", "dh_car_brand", "dh_car_type", "dh_car_status", "dh_car_list_type", "yes_no_type")
// 定义变量内容
const formDialogRef = ref()
+3
View File
@@ -6,6 +6,9 @@
<el-form-item style="width: 300px;" label="车牌号" prop="carNum">
<el-input v-model="state.queryForm.carNum" placeholder="请输入车牌号" />
</el-form-item>
<el-form-item style="width: 250px;" label="是否军车" prop="isArmyCar">
<dict-select v-model="state.queryForm.isArmyCar" :options="yes_no_type" placeholder="请选择" />
</el-form-item>
<el-form-item style="width: 300px;" label="是否为内部车辆" prop="isInner">
<dict-select v-model="state.queryForm.isInner" :options="yes_no_type" placeholder="请选择" />
</el-form-item>
+9 -20
View File
@@ -1,12 +1,16 @@
<!-- 人员出入次数统计详情 -->
<template>
<el-dialog title="人员进出详情" v-model="visible" width="80%" :close-on-click-modal="false" draggable>
<el-dialog title="人员进出详情" v-model="visible" width="85%" :close-on-click-modal="false" draggable>
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
<el-row shadow="hover" class="ml10">
<el-form-item style="width: 150px;" label="姓名" prop="personName">
<el-input v-model="state.queryForm.personName" placeholder="请输入人员姓名" />
</el-form-item>
<el-form-item style="width: 250px;" label="进出门类型" prop="enterOrExit">
<el-form-item style="width: 250px;" label="类型" prop="alarmTypeList">
<dict-select v-model="state.queryForm.alarmTypeList" :options="dk_type" multiple
placeholder="请选择类型" />
</el-form-item>
<el-form-item v-if="false" style="width: 250px;" label="进出门类型" prop="enterOrExit">
<dict-select v-model="state.queryForm.enterOrExit" :options="dh_enter_or_exit"
placeholder="请选择进出门类型" />
</el-form-item>
@@ -30,6 +34,7 @@
<el-table :data="state.dataList" v-loading="state.loading" height="50vh" border
:cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle"
@sort-change="sortChangeHandle">
<el-table-column prop="swingTime" label="抓拍时间" min-width="180" />
<el-table-column min-width="100" label="人员">
<el-table-column prop="personCode" min-width="100" label="人员编号">
<template #default="{ row }">
@@ -56,20 +61,6 @@
</template>
</el-table-column>
</el-table-column>
<el-table-column min-width="100" label="卡">
<el-table-column prop="cardType" min-width="100" label="卡类型">
<template #default="{ row }">
<dict-tag :options="dh_card_type" :value="row.cardType" />
</template>
</el-table-column>
<el-table-column prop="cardStatus" label="卡状态">
<template #default="{ row }">
<dict-tag :options="dh_card_status" :value="row.cardStatus" />
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="enterOrExit" min-width="100" label="进出门类型">
<template #default="{ row }">
<dict-tag :options="dh_enter_or_exit" :value="row.enterOrExit" />
@@ -93,7 +84,6 @@
</template>
</el-table-column>
<el-table-column prop="remark" label="开门失败原因" min-width="200" show-overflow-tooltip />
<el-table-column prop="swingTime" label="刷卡时间" min-width="180" />
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
@@ -107,17 +97,16 @@
<script setup lang="ts" name="doorTimesTableDialog">
import { BasicTableProps, useTable } from "/@/hooks/table";
import { useDict } from '/@/hooks/dict';
import { parseTime } from "/@/utils/formatTime"
import * as DoorRecordApi from "/@/api/door/doorRecord";
const { dh_enter_Mode } = useDict("dh_enter_Mode")
defineExpose({
openDialog
});
// 定义查询字典
const { dh_card_status, dh_card_type, dh_enter_or_exit, dh_image_type, dh_door_open_type } = useDict("dh_card_status", "dh_card_type", "dh_enter_or_exit", "dh_image_type", "dh_door_open_type")
const { dh_card_status, dh_card_type, dh_enter_or_exit, dk_type, dh_door_open_type, door_alarm_type } = useDict("dh_card_status", "dh_card_type", "dh_enter_or_exit", "dk_type", "dh_door_open_type", "door_alarm_type")
// 搜索变量
const queryRef = ref()
+1 -1
View File
@@ -133,7 +133,6 @@
<script setup lang="ts" name="doorAlarm">
import { BasicTableProps, useTable } from "/@/hooks/table";
import { useMessage, useMessageBox } from "/@/hooks/message";
import { useDict } from '/@/hooks/dict';
import { parseTime } from "/@/utils/formatTime"
import { usePanel } from "/@/stores/panel"
@@ -221,6 +220,7 @@ function getDictByValue(value: any, tag: any) {
return target.label
}
}
function openReplayDialog(row: any) {
const dateTime = row.swingTime
if (!dateTime) return
+3 -5
View File
@@ -176,13 +176,11 @@ const selectionChangHandle = (objs: { id: string }[]) => {
function openDoorTableDialogRef(row: any) {
const query: any = {
personName: row.personName,
alarmTypeList: ['61', '62'],
alarmTypeList: state.queryForm.alarmTypeList,
}
const routeQuery: any = useRoute()?.query
if (routeQuery) {
query.swingTimeList = [row.time + " 00:00:00", addDays(row.time, 1) + " 00:00:00"]
if (state.queryForm.swingTimeList) {
query.swingTimeList = [state.queryForm.swingTimeList[0], state.queryForm.swingTimeList[1]]
}
console.log("query:", query);
doorTableDialogRef.value.openDialog(query)
}