|
@@ -84,6 +84,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<BasicTable
|
|
<BasicTable
|
|
|
|
|
+ ref="basicTableRef"
|
|
|
:tableData="tableData"
|
|
:tableData="tableData"
|
|
|
:tableConfig="tableConfig"
|
|
:tableConfig="tableConfig"
|
|
|
@update:pageSize="handleSizeChange"
|
|
@update:pageSize="handleSizeChange"
|
|
@@ -91,7 +92,7 @@
|
|
|
@update:selection="handleSelectionChange"
|
|
@update:selection="handleSelectionChange"
|
|
|
>
|
|
>
|
|
|
<template #violateName="scope">
|
|
<template #violateName="scope">
|
|
|
- <span>{{ scope.row.violateName || '-' }}</span>
|
|
|
|
|
|
|
+ <span>{{ scope.row.violateName ? scope.row.violateName + '(' + scope.row.staffNo + ')' : '-' }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
<template #deptName="scope">
|
|
<template #deptName="scope">
|
|
|
<span>{{ scope.row.deptName || '-' }}</span>
|
|
<span>{{ scope.row.deptName || '-' }}</span>
|
|
@@ -167,7 +168,7 @@
|
|
|
import RealtimeNotice from './components/RealtimeNotice.vue';
|
|
import RealtimeNotice from './components/RealtimeNotice.vue';
|
|
|
import dayjs from 'dayjs';
|
|
import dayjs from 'dayjs';
|
|
|
import { ElMessage } from 'element-plus';
|
|
import { ElMessage } from 'element-plus';
|
|
|
- import { TABLE_OPTIONS, VIOLATION_ACT_TABLE_COLUMNS, VIOLATION_NOTICE_TABLE_COLUMNS } from './configs/tables';
|
|
|
|
|
|
|
+ import { TABLE_OPTIONS, VIOLATION_ACT_TABLE_COLUMNS, VIOLATION_ACT_TABLE_COLUMNS_CHECKONLY } from './configs/tables';
|
|
|
import {
|
|
import {
|
|
|
ACT_NOTICE_DATA_SOURCE_LABEL,
|
|
ACT_NOTICE_DATA_SOURCE_LABEL,
|
|
|
ACT_VIOLATION_TYPE,
|
|
ACT_VIOLATION_TYPE,
|
|
@@ -181,7 +182,7 @@
|
|
|
ACT_MANAGEMENT_PROMISSION_CODE,
|
|
ACT_MANAGEMENT_PROMISSION_CODE,
|
|
|
} from './constants';
|
|
} from './constants';
|
|
|
import { ref, reactive, onMounted } from 'vue';
|
|
import { ref, reactive, onMounted } from 'vue';
|
|
|
- import { Search, Plus } from '@element-plus/icons-vue';
|
|
|
|
|
|
|
+ import { Close, Plus } from '@element-plus/icons-vue';
|
|
|
import { useRouter } from 'vue-router';
|
|
import { useRouter } from 'vue-router';
|
|
|
import { openMessageBox } from '@/utils/element-plus/messageBox';
|
|
import { openMessageBox } from '@/utils/element-plus/messageBox';
|
|
|
import type { QueryPageRequest } from '@/types/basic-query';
|
|
import type { QueryPageRequest } from '@/types/basic-query';
|
|
@@ -212,22 +213,22 @@
|
|
|
|
|
|
|
|
function getQuery() {
|
|
function getQuery() {
|
|
|
if (!selectableInputRef.value) return;
|
|
if (!selectableInputRef.value) return;
|
|
|
- tabelQuery.queryParam = {
|
|
|
|
|
|
|
+ tableQuery.queryParam = {
|
|
|
pageType: 1,
|
|
pageType: 1,
|
|
|
};
|
|
};
|
|
|
const selectableSearch = selectableInputRef.value.getValue();
|
|
const selectableSearch = selectableInputRef.value.getValue();
|
|
|
if (selectableSearch) {
|
|
if (selectableSearch) {
|
|
|
- tabelQuery.queryParam[selectableSearch.key as string] = selectableSearch.value;
|
|
|
|
|
|
|
+ tableQuery.queryParam[selectableSearch.key as string] = selectableSearch.value;
|
|
|
}
|
|
}
|
|
|
- if (searchData.isNotice) {
|
|
|
|
|
- tabelQuery.queryParam.isNotice = searchData.isNotice;
|
|
|
|
|
|
|
+ if (searchData.isNotice != null) {
|
|
|
|
|
+ tableQuery.queryParam.isNotice = searchData.isNotice;
|
|
|
}
|
|
}
|
|
|
- if (searchData.violateType) {
|
|
|
|
|
- tabelQuery.queryParam.violateType = searchData.violateType;
|
|
|
|
|
|
|
+ if (searchData.violateType != null) {
|
|
|
|
|
+ tableQuery.queryParam.violateType = searchData.violateType;
|
|
|
}
|
|
}
|
|
|
if (searchData.searchTime) {
|
|
if (searchData.searchTime) {
|
|
|
- tabelQuery.queryParam.startTime = dayjs(searchData.searchTime[0]).format('YYYY-MM-DD HH:MM:ss');
|
|
|
|
|
- tabelQuery.queryParam.endTime = dayjs(searchData.searchTime[1]).format('YYYY-MM-DD HH:MM:ss');
|
|
|
|
|
|
|
+ tableQuery.queryParam.startTime = dayjs(searchData.searchTime[0]).format('YYYY-MM-DD HH:MM:ss');
|
|
|
|
|
+ tableQuery.queryParam.endTime = dayjs(searchData.searchTime[1]).format('YYYY-MM-DD HH:MM:ss');
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -241,6 +242,7 @@
|
|
|
searchData.carNumber = undefined;
|
|
searchData.carNumber = undefined;
|
|
|
searchData.violateName = undefined;
|
|
searchData.violateName = undefined;
|
|
|
searchData.deptName = undefined;
|
|
searchData.deptName = undefined;
|
|
|
|
|
+ searchData.isNotice = undefined;
|
|
|
searchData.violateType = undefined;
|
|
searchData.violateType = undefined;
|
|
|
searchData.searchTime = undefined;
|
|
searchData.searchTime = undefined;
|
|
|
}
|
|
}
|
|
@@ -248,7 +250,7 @@
|
|
|
async function handleDownload() {
|
|
async function handleDownload() {
|
|
|
getQuery();
|
|
getQuery();
|
|
|
try {
|
|
try {
|
|
|
- const res = await exportActViolation(tabelQuery.queryParam);
|
|
|
|
|
|
|
+ const res = await exportActViolation(tableQuery.queryParam);
|
|
|
if (res.size === 0) return;
|
|
if (res.size === 0) return;
|
|
|
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
|
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
|
|
const url = window.URL.createObjectURL(blob);
|
|
const url = window.URL.createObjectURL(blob);
|
|
@@ -263,13 +265,13 @@
|
|
|
const basicTableRef = ref<InstanceType<typeof BasicTable>>();
|
|
const basicTableRef = ref<InstanceType<typeof BasicTable>>();
|
|
|
|
|
|
|
|
const { tableConfig, pagination } = useTableConfig(
|
|
const { tableConfig, pagination } = useTableConfig(
|
|
|
- actManagementPermission ? VIOLATION_ACT_TABLE_COLUMNS : VIOLATION_NOTICE_TABLE_COLUMNS,
|
|
|
|
|
|
|
+ actManagementPermission ? VIOLATION_ACT_TABLE_COLUMNS : VIOLATION_ACT_TABLE_COLUMNS_CHECKONLY,
|
|
|
TABLE_OPTIONS,
|
|
TABLE_OPTIONS,
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
const tableData = ref<ActTableData[]>([]);
|
|
const tableData = ref<ActTableData[]>([]);
|
|
|
|
|
|
|
|
- const tabelQuery = reactive<QueryPageRequest<ActTableQuery>>({
|
|
|
|
|
|
|
+ const tableQuery = reactive<QueryPageRequest<ActTableQuery>>({
|
|
|
pageNumber: pagination.pageNumber,
|
|
pageNumber: pagination.pageNumber,
|
|
|
pageSize: pagination.pageSize,
|
|
pageSize: pagination.pageSize,
|
|
|
queryParam: {
|
|
queryParam: {
|
|
@@ -278,13 +280,13 @@
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const handleSizeChange = (value: number) => {
|
|
const handleSizeChange = (value: number) => {
|
|
|
- pagination.pageNumber = value;
|
|
|
|
|
- tabelQuery.pageSize = value;
|
|
|
|
|
|
|
+ pagination.pageSize = value;
|
|
|
|
|
+ tableQuery.pageSize = value;
|
|
|
getTableData();
|
|
getTableData();
|
|
|
};
|
|
};
|
|
|
const handleCurrentChange = (value: number) => {
|
|
const handleCurrentChange = (value: number) => {
|
|
|
pagination.pageNumber = value;
|
|
pagination.pageNumber = value;
|
|
|
- tabelQuery.pageSize = value;
|
|
|
|
|
|
|
+ tableQuery.pageNumber = value;
|
|
|
getTableData();
|
|
getTableData();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -302,23 +304,36 @@
|
|
|
const handleBatchNotice = async () => {
|
|
const handleBatchNotice = async () => {
|
|
|
const confirmed = await openMessageBox('', '确认通知任务吗?', 'warning');
|
|
const confirmed = await openMessageBox('', '确认通知任务吗?', 'warning');
|
|
|
if (!confirmed) return;
|
|
if (!confirmed) return;
|
|
|
- const noticeIds = selectionItems.value.map((item) => item.id);
|
|
|
|
|
- await noticeActData(noticeIds);
|
|
|
|
|
- ElMessage.success('批量通知成功');
|
|
|
|
|
- getTableData();
|
|
|
|
|
|
|
+ const unNoticeItem = selectionItems.value.filter((item) => item.isNotice === ACT_NOTICE_STATE.INACTIVE);
|
|
|
|
|
+ if (!unNoticeItem.length) {
|
|
|
|
|
+ ElMessage.warning('通知成功!共通知0条记录');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ const noticeIds = unNoticeItem.map((item) => item.id);
|
|
|
|
|
+ try {
|
|
|
|
|
+ await noticeActData(noticeIds);
|
|
|
|
|
+ ElMessage.success(`通知成功!共通知${noticeIds.length}条记录`);
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ ElMessage.error('批量通知失败');
|
|
|
|
|
+ }
|
|
|
|
|
+ getTableData();
|
|
|
|
|
+ }
|
|
|
};
|
|
};
|
|
|
const handleBatchDelete = async () => {
|
|
const handleBatchDelete = async () => {
|
|
|
const confirmed = await openMessageBox('', '删除后任务不可恢复,确认删除吗?', 'warning');
|
|
const confirmed = await openMessageBox('', '删除后任务不可恢复,确认删除吗?', 'warning');
|
|
|
if (!confirmed) return;
|
|
if (!confirmed) return;
|
|
|
const deleteIds = selectionItems.value.map((item) => item.id);
|
|
const deleteIds = selectionItems.value.map((item) => item.id);
|
|
|
- await deleteActData(deleteIds);
|
|
|
|
|
- ElMessage.success('批量删除成功');
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ await deleteActData(deleteIds);
|
|
|
|
|
+ ElMessage.success('批量删除成功');
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ ElMessage.error('批量删除失败');
|
|
|
|
|
+ }
|
|
|
getTableData();
|
|
getTableData();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
async function getTableData() {
|
|
async function getTableData() {
|
|
|
tableConfig.loading = true;
|
|
tableConfig.loading = true;
|
|
|
- const res = await getActTableList(tabelQuery);
|
|
|
|
|
|
|
+ const res = await getActTableList(tableQuery);
|
|
|
tableData.value = res.records;
|
|
tableData.value = res.records;
|
|
|
pagination.total = res.totalRow;
|
|
pagination.total = res.totalRow;
|
|
|
tableConfig.loading = false;
|
|
tableConfig.loading = false;
|