浏览代码

查询 损失记录bug修复

chauncey 10 月之前
父节点
当前提交
b4c210c940

+ 8 - 9
src/main.scss

@@ -8,8 +8,8 @@
   box-sizing: border-box;
   &::-webkit-scrollbar {
     position: relative;
-    width: 0;
-    height: 0;
+    width: 2px;
+    height: 5px;
   }
   &::-webkit-scrollbar-thumb {
     background-color: transparent;
@@ -48,10 +48,9 @@ body {
   cursor: pointer;
 }
 
-
-  .paginationPosition {
-    /* mt-4 flex justify-end */
-    display: flex;
-    justify-content: flex-end;
-    margin-top: 20px;
-  }
+.paginationPosition {
+  /* mt-4 flex justify-end */
+  display: flex;
+  justify-content: flex-end;
+  margin-top: 20px;
+}

+ 4 - 4
src/types/disaster-control/index.ts

@@ -11,18 +11,18 @@ export interface DisposalManagementListQuery {
 }
 
 export interface LossReportReportTaskQuery {
-  taskStage?: string;
+  taskStage?: string | null;
 }
 
 export interface DisposalManagementTableQuery extends DisposalManagementListQuery, LossReportReportTaskQuery {
   handleTaskIds: number[];
-  reportDeptIds?: number[];
-  status?: string;
+  reportDeptIds?: number[] | null;
+  status?: string | null;
 }
 
 export interface LossRecordTableQuery {
   handleTaskIds: number[];
-  handleDeptIds?: number[];
+  handleDeptIds?: number[] | null;
   fixStatus?: string | null;
   isLoss?: number;
 }

+ 7 - 13
src/views/disaster/disaster-control/PageDisposalManagement.vue

@@ -221,9 +221,9 @@
   const { openMessageBox } = useMessageBox();
   const firstLevelDepts = ref<DeptTreeItem[]>([]);
   const searchData = reactive({
-    reportDeptIds: [],
-    status: '',
-    taskStage: '',
+    reportDeptIds: null,
+    status: null,
+    taskStage: null,
   });
 
   const currentPage = ref(1);
@@ -342,12 +342,9 @@
   const getDisposalTableData = async () => {
     tableConfig.loading = true;
 
-    const { reportDeptIds, ...otherSearchData } = searchData;
-
     const params = {
       handleTaskIds: taskIds.value,
-      ...otherSearchData,
-      ...(reportDeptIds.length > 0 ? { reportDeptIds } : {}),
+      ...searchData,
     };
 
     const res = await getDisasterControlTableData(params);
@@ -378,29 +375,26 @@
   };
 
   const handleBatchRelease = async (id: number) => {
-    const confirmed = await openMessageBox('','确定发布吗?','warn');
+    const confirmed = await openMessageBox('', '确定发布吗?', 'warn');
     if (!confirmed) return;
     await publishDisasterHandleTask(id);
     ElMessage.success('发布成功');
-    await getDisposalData();
     await getDisposalTableData();
   };
 
   const handleBatchWithdraw = async (id: number) => {
-    const confirmed = await openMessageBox('','确定撤回吗?','warn');
+    const confirmed = await openMessageBox('', '确定撤回吗?', 'warn');
     if (!confirmed) return;
     await withdrawDisasterHandleTask(id);
     ElMessage.success('撤回成功');
-    await getDisposalData();
     await getDisposalTableData();
   };
 
   const handleBatchDelete = async (id: number) => {
-    const confirmed = await openMessageBox('','确定删除吗?','warn');
+    const confirmed = await openMessageBox('', '确定删除吗?', 'warn');
     if (!confirmed) return;
     await deleteDisasterHandleTask(id);
     ElMessage.success('删除成功');
-    await getDisposalData();
     await getDisposalTableData();
   };
 

+ 5 - 7
src/views/disaster/disaster-control/src/components/LossRecord.vue

@@ -76,10 +76,10 @@
                   </div>
                 </template>
                 <template #action="scope">
-                  <div class="action-container" v-if="scope.row.affectedItems">
+                  <div class="action-container" v-if="scope.row.isLoss">
                     <ActionButton
                       text="编辑"
-                      v-if="isOverdue(scope.row.dueCompleteTime) && scope.row.fixStatus === FIX_STATUS.TO_BE_RECTIFIED"
+                      v-if="isOverdue(item.dueCompleteTime) && scope.row.fixStatus === FIX_STATUS.TO_BE_RECTIFIED"
                       @click="handleEdit(scope.row.id, item.id)"
                     />
                     <ActionButton text="查看" />
@@ -94,7 +94,7 @@
                     <ActionButton
                       text="编辑"
                       @click="handleEdit(scope.row.id, item.id)"
-                      v-if="isOverdue(scope.row.dueCompleteTime) && scope.row.fixStatus !== FIX_STATUS.TEMPORARY_CLOSED"
+                      v-if="isOverdue(item.dueCompleteTime) && scope.row.fixStatus !== FIX_STATUS.TEMPORARY_CLOSED"
                     />
                     <ActionButton
                       text="删除"
@@ -160,7 +160,7 @@
   const collapseItemRef = ref<InstanceType<typeof CollapseItem>[]>([]);
   const { tableConfig } = useTableConfig(LOSS_RECORD_TABLE_COLUMNS, DISPOSAL_MANAGEMENT_TABLE_OPTIONS, false);
   const searchData = reactive({
-    handleDeptIds: [],
+    handleDeptIds: null,
     fixStatus: null,
   });
   const handleSearch = () => {
@@ -199,11 +199,9 @@
 
   const getDisposalTableData = async () => {
     tableConfig.loading = true;
-    const { handleDeptIds, ...otherSearchData } = searchData;
     const res = await getLossRecordTableData({
       handleTaskIds: taskIds.value,
-      ...otherSearchData,
-      ...(handleDeptIds.length > 0 ? { handleDeptIds } : {}),
+      ...searchData,
     });
     collapseList.value.forEach((item) => {
       item.tableData = res.filter((tableItem) => tableItem.handleTaskId === item.handleTaskId);

+ 1 - 1
src/views/disaster/disaster-control/src/components/ReportTask.vue

@@ -78,7 +78,7 @@
   import { ElMessage } from 'element-plus';
   const router = useRouter();
   const searchData = reactive({
-    taskStage: '',
+    taskStage: null,
   });
   const tableData = ref<LossReportReportTaskResponse[]>([]);
   const { tableConfig, pagination } = useTableConfig(