فهرست منبع

清除查询按钮

gongtianxiao 1 ماه پیش
والد
کامیت
76f4c7d92b

+ 12 - 30
src/components/manage/asset/FullAssetListPanel.vue

@@ -10,7 +10,6 @@
           :options="fillMonthOptions"
           @selected="filterFillMonth = $event"
         />
-        <BaseButton text="查询" @click="handleQuery" />
       </div>
     </div>
 
@@ -46,7 +45,6 @@
           :options="CERT_FILTER_OPTIONS"
           @selected="filterCert = $event"
         />
-        <BaseButton text="查询" @click="handleQuery" />
         <BaseButton text="重置" variant="outline" @click="resetFilters" />
       </div>
     </div>
@@ -189,12 +187,6 @@ const filterState = ref('全部');
 const filterUsage = ref('全部');
 const filterCert = ref('全部');
 const filterFillMonth = ref('全部');
-const appliedKeyword = ref('');
-const appliedGroup = ref('全部');
-const appliedState = ref('全部');
-const appliedUsage = ref('全部');
-const appliedCert = ref('全部');
-const appliedFillMonth = ref('全部');
 const currentPage = ref(1);
 const selectAllRef = ref(null);
 
@@ -221,12 +213,12 @@ const listLoading = computed(() => enterpriseStore.approvedLoading);
 
 const filteredAssets = computed(() =>
   filterAssets(allAssets.value, {
-    keyword: appliedKeyword.value,
-    group: appliedGroup.value,
-    state: appliedState.value,
-    usage: appliedUsage.value,
-    cert: appliedCert.value,
-    fillMonth: appliedFillMonth.value,
+    keyword: keyword.value,
+    group: filterGroup.value,
+    state: filterState.value,
+    usage: filterUsage.value,
+    cert: filterCert.value,
+    fillMonth: filterFillMonth.value,
     extractFillMonth,
   })
 );
@@ -283,16 +275,6 @@ watch([allPageSelected, somePageSelected], () => {
   }
 });
 
-const handleQuery = () => {
-  appliedKeyword.value = keyword.value;
-  appliedGroup.value = filterGroup.value;
-  appliedState.value = filterState.value;
-  appliedUsage.value = filterUsage.value;
-  appliedCert.value = filterCert.value;
-  appliedFillMonth.value = filterFillMonth.value;
-  currentPage.value = 1;
-};
-
 const resetFilters = () => {
   keyword.value = '';
   filterGroup.value = '全部';
@@ -300,15 +282,15 @@ const resetFilters = () => {
   filterUsage.value = '全部';
   filterCert.value = '全部';
   filterFillMonth.value = '全部';
-  appliedKeyword.value = '';
-  appliedGroup.value = '全部';
-  appliedState.value = '全部';
-  appliedUsage.value = '全部';
-  appliedCert.value = '全部';
-  appliedFillMonth.value = '全部';
   currentPage.value = 1;
 };
 
+// 筛选条件变化时回到第 1 页,避免当前页超出范围
+watch(
+  () => [keyword.value, filterGroup.value, filterState.value, filterUsage.value, filterCert.value, filterFillMonth.value],
+  () => { currentPage.value = 1; }
+);
+
 const prevPage = () => {
   if (currentPage.value > 1) currentPage.value -= 1;
 };

+ 3 - 15
src/components/manage/pages/ManageBasicArchive.vue

@@ -154,7 +154,6 @@
             <span>填报人</span>
             <input v-model="histReporter" type="text" placeholder="姓名" />
           </label>
-          <BaseButton text="查询" @click="handleHistQuery" />
           <BaseButton text="导出往期上报报表" variant="outline" @click="handleHistExport" />
         </div>
       </div>
@@ -620,9 +619,6 @@ const statusTagType = computed(() => {
 const histPeriod = ref('全部');
 const histStatus = ref('全部');
 const histReporter = ref('');
-const appliedHistPeriod = ref('全部');
-const appliedHistStatus = ref('全部');
-const appliedHistReporter = ref('');
 
 const historyLoading = computed(
   () =>
@@ -1119,10 +1115,10 @@ const HISTORY_EXPORT_COLUMNS = [
 ];
 
 const filteredHistoryRows = computed(() => {
-  const kw = appliedHistReporter.value.trim();
+  const kw = histReporter.value.trim();
   return historySourceRows.value.filter((row) => {
-    if (appliedHistPeriod.value !== '全部' && row.period !== appliedHistPeriod.value) return false;
-    if (appliedHistStatus.value !== '全部' && row.status !== appliedHistStatus.value) return false;
+    if (histPeriod.value !== '全部' && row.period !== histPeriod.value) return false;
+    if (histStatus.value !== '全部' && row.status !== histStatus.value) return false;
     if (kw && !row.reporter.includes(kw)) return false;
     return true;
   });
@@ -1130,12 +1126,6 @@ const filteredHistoryRows = computed(() => {
 
 const loadHistoryData = () => enterpriseStore.fetchReportProgress({ force: true });
 
-const handleHistQuery = () => {
-  appliedHistPeriod.value = histPeriod.value;
-  appliedHistStatus.value = histStatus.value;
-  appliedHistReporter.value = histReporter.value;
-};
-
 const formatReportMonthForExport = (period) => {
   const match = String(period ?? '').match(/^(\d{4})-(\d{2})$/);
   if (!match) return period ?? '';
@@ -1193,9 +1183,7 @@ const applyRouteSubNav = () => {
     status && ['审核中', '已通过', '已驳回'].includes(String(status)) ? String(status) : '全部';
 
   histPeriod.value = nextPeriod;
-  appliedHistPeriod.value = nextPeriod;
   histStatus.value = nextStatus;
-  appliedHistStatus.value = nextStatus;
   loadHistoryData();
 };
 

+ 3 - 22
src/components/manage/pages/ManageFinanceReport.vue

@@ -17,7 +17,6 @@
       <div v-if="auditTab === 'pending'" class="filter-bar">
         <BaseSelect text="集团" :selectedText="filterGroup" :options="groupOptions" @selected="filterGroup = $event" />
         <BaseSelect text="填报期" :selectedText="filterPeriod" :options="periodOptions" @selected="filterPeriod = $event" />
-        <BaseButton text="查询" @click="handleQuery" />
       </div>
       <div v-else-if="auditTab === 'passed'" class="filter-bar">
         <BaseSelect text="集团" :selectedText="filterGroup" :options="groupOptions" @selected="filterGroup = $event" />
@@ -29,13 +28,11 @@
           :options="auditMonthOptions"
           @selected="filterAuditMonth = $event"
         />
-        <BaseButton text="查询" @click="handleQuery" />
         <BaseButton text="导出已通过清单" variant="outline" @click="handleExportPassed" />
       </div>
       <div v-else class="filter-bar">
         <BaseSelect text="集团" :selectedText="filterGroup" :options="groupOptions" @selected="filterGroup = $event" />
         <BaseSelect text="填报期" :selectedText="filterPeriod" :options="periodOptions" @selected="filterPeriod = $event" />
-        <BaseButton text="查询" @click="handleQuery" />
       </div>
 
       <div v-if="auditTab === 'pending'" class="panel-toolbar">
@@ -171,9 +168,6 @@ const auditTab = ref('pending');
 const filterGroup = ref('全部');
 const filterPeriod = ref('全部');
 const filterAuditMonth = ref('全部');
-const appliedGroup = ref('全部');
-const appliedPeriod = ref('全部');
-const appliedAuditMonth = ref('全部');
 
 const selectedIds = ref([]);
 const viewedIds = ref([]);
@@ -286,14 +280,14 @@ const pendingSourceRows = computed(() =>
 );
 
 const matchFilter = (row) => {
-  if (appliedGroup.value !== '全部' && normalizeGroupName(row.qingpuGroup) !== appliedGroup.value) return false;
-  if (appliedPeriod.value !== '全部' && row.period !== appliedPeriod.value) return false;
+  if (filterGroup.value !== '全部' && normalizeGroupName(row.qingpuGroup) !== filterGroup.value) return false;
+  if (filterPeriod.value !== '全部' && row.period !== filterPeriod.value) return false;
   return true;
 };
 
 const matchPassedFilter = (row) => {
   if (!matchFilter(row)) return false;
-  if (appliedAuditMonth.value !== '全部' && row.auditMonth !== appliedAuditMonth.value) return false;
+  if (filterAuditMonth.value !== '全部' && row.auditMonth !== filterAuditMonth.value) return false;
   return true;
 };
 
@@ -400,14 +394,6 @@ const loadTabData = () => {
   return enterpriseStore.fetchByState(REPORT_STATE.PENDING);
 };
 
-const handleQuery = () => {
-  appliedGroup.value = filterGroup.value;
-  appliedPeriod.value = filterPeriod.value;
-  if (auditTab.value === 'passed') {
-    appliedAuditMonth.value = filterAuditMonth.value;
-  }
-};
-
 const handleView = (row) => {
   auditRecord.value = row;
   markViewed(row.id);
@@ -567,9 +553,7 @@ const applyRouteSubNav = () => {
     : '全部';
   const nextPeriod = period ? String(period) : '全部';
   filterGroup.value = nextGroup;
-  appliedGroup.value = nextGroup;
   filterPeriod.value = nextPeriod;
-  appliedPeriod.value = nextPeriod;
   loadTabData();
 };
 
@@ -588,11 +572,8 @@ watch(auditTab, () => {
   if (!hasRouteFilter) {
     filterGroup.value = '全部';
     filterPeriod.value = '全部';
-    appliedGroup.value = '全部';
-    appliedPeriod.value = '全部';
   }
   filterAuditMonth.value = '全部';
-  appliedAuditMonth.value = '全部';
   loadTabData();
 }, { immediate: true });
 </script>