Просмотр исходного кода

Revert "feat:update"

This reverts commit c8c35ee4d72e9a23736cb2d2825782f547440353.
钱新宇 6 дней назад
Родитель
Сommit
4be860ecd7

+ 19 - 60
traceCodePackages/traceabilityReport/pages/blacklist/index.vue

@@ -13,18 +13,21 @@
         </view>
         </view>
       </view>
       </view>
       <view class="header-toolbar">
       <view class="header-toolbar">
-        <view class="filter-tabs">
-          <view class="tab-item" v-for="(tab, index) in timeFilters" :key="index"
-            :class="{ active: currentFilter === tab.value }" @click="switchFilter(tab.value)">
-            {{ tab.label }}
-          </view>
+        <view class="update-tip">
+          <!-- <text class="tip-icon">🕒</text> -->
+          <text>统计日期:{{
+            formatDate(
+              new Date().setDate(new Date().getDate() - 1),
+              "YYYY-MM-DD",
+            ) || "--"
+          }}</text>
         </view>
         </view>
 
 
         <view class="filter-wrap">
         <view class="filter-wrap">
           <view class="selector" @click.stop="toggleProvinceDropdown">
           <view class="selector" @click.stop="toggleProvinceDropdown">
             <text class="selector-text">{{
             <text class="selector-text">{{
               selectedProvince || "全部省份"
               selectedProvince || "全部省份"
-            }}</text>
+              }}</text>
             <text class="selector-arrow" :class="{ open: dropdownProvinceOpen }"></text>
             <text class="selector-arrow" :class="{ open: dropdownProvinceOpen }"></text>
           </view>
           </view>
         </view>
         </view>
@@ -69,9 +72,9 @@
     </scroll-view>
     </scroll-view>
 
 
     <view class="footer-btn-area">
     <view class="footer-btn-area">
-      <!-- <button class="action-btn history-btn" @click="handleHistory">
+      <button class="action-btn history-btn" @click="handleHistory">
         历史记录
         历史记录
-      </button> -->
+      </button>
       <button class="action-btn export-btn" @click="handleExport">
       <button class="action-btn export-btn" @click="handleExport">
         导出至邮箱
         导出至邮箱
       </button>
       </button>
@@ -156,13 +159,6 @@ export default {
         email: "",
         email: "",
       },
       },
       emailError: false,
       emailError: false,
-      currentFilter: "1",
-      timeFilters: [
-        { label: "昨日", value: "1" },
-        { label: "近7天", value: "7" },
-        { label: "近15天", value: "15" },
-        { label: "近30天", value: "30" },
-      ],
     };
     };
   },
   },
   created() {
   created() {
@@ -185,31 +181,18 @@ export default {
       });
       });
     },
     },
 
 
-    switchFilter(value) {
-      if (this.currentFilter === value) return;
-      this.currentFilter = value;
-      this.resetFetch();
-    },
-
     fetchList() {
     fetchList() {
       if (this.loading) return;
       if (this.loading) return;
       this.loading = true;
       this.loading = true;
 
 
-      const days = parseInt(this.currentFilter);
-      const toDate = new Date();
-      toDate.setDate(toDate.getDate() - 1);
-
-      const fromDate = new Date(toDate);
-      if (days > 1) {
-        fromDate.setDate(toDate.getDate() - (days - 1));
-      }
+      const yesterday = new Date();
+      yesterday.setDate(yesterday.getDate() - 1);
+      const dateStr = this.formatDate(yesterday, "YYYY-MM-DD");
 
 
-      const fromDateStr = this.formatDate(fromDate, "YYYY-MM-DD");
-      const toDateStr = this.formatDate(toDate, "YYYY-MM-DD");
 
 
       request("/blacklist-report/get-export-company-data", {
       request("/blacklist-report/get-export-company-data", {
-        fromDate: fromDateStr,
-        toDate: toDateStr,
+        fromDate: dateStr,
+        toDate: dateStr,
         path: "traceabilityReport/pages/blacklist/index.vue",
         path: "traceabilityReport/pages/blacklist/index.vue",
       }).then((res) => {
       }).then((res) => {
         if (res.code == 200) {
         if (res.code == 200) {
@@ -336,7 +319,7 @@ export default {
 /* Header Section */
 /* Header Section */
 .header-section {
 .header-section {
   background: linear-gradient(135deg, #2b32b2 0%, #1488cc 100%);
   background: linear-gradient(135deg, #2b32b2 0%, #1488cc 100%);
-  padding: 40rpx 40rpx 40rpx;
+  padding: 40rpx 40rpx 80rpx;
   /* Extra padding at bottom for overlap effect */
   /* Extra padding at bottom for overlap effect */
   position: relative;
   position: relative;
   z-index: 20;
   z-index: 20;
@@ -353,7 +336,7 @@ export default {
   align-items: center;
   align-items: center;
   position: relative;
   position: relative;
   z-index: 2;
   z-index: 2;
-  margin-bottom: 40rpx;
+  margin-bottom: 24rpx;
 }
 }
 
 
 .title-group {
 .title-group {
@@ -413,30 +396,6 @@ export default {
   font-size: 20rpx;
   font-size: 20rpx;
 }
 }
 
 
-/* Filter Tabs */
-.filter-tabs {
-  display: flex;
-  background: rgba(255, 255, 255, 0.2);
-  border-radius: 30rpx;
-  padding: 4rpx;
-  margin-right: 20rpx;
-}
-
-.tab-item {
-  padding: 8rpx 24rpx;
-  font-size: 24rpx;
-  color: rgba(255, 255, 255, 0.8);
-  border-radius: 26rpx;
-  transition: all 0.3s;
-}
-
-.tab-item.active {
-  background: #fff;
-  color: #1890ff;
-  font-weight: 600;
-  box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
-}
-
 /* Filter Styles */
 /* Filter Styles */
 .filter-wrap {
 .filter-wrap {
   position: relative;
   position: relative;
@@ -568,7 +527,7 @@ export default {
   padding: 0 24rpx;
   padding: 0 24rpx;
   /* Remove vertical padding from scroll container */
   /* Remove vertical padding from scroll container */
   box-sizing: border-box;
   box-sizing: border-box;
-  margin-top: -20rpx;
+  margin-top: -50rpx;
   /* Negative margin to pull list up */
   /* Negative margin to pull list up */
   position: relative;
   position: relative;
   z-index: 21;
   z-index: 21;

+ 42 - 194
traceCodePackages/traceabilityReport/pages/ganmaoling/index.vue

@@ -18,18 +18,21 @@
       </view>
       </view>
 
 
       <view class="header-toolbar">
       <view class="header-toolbar">
-        <view class="filter-tabs">
-          <view class="tab-item" v-for="(tab, index) in timeFilters" :key="index"
-            :class="{ active: currentFilter === tab.value }" @click="switchFilter(tab.value)">
-            {{ tab.label }}
-          </view>
+        <view class="update-tip">
+          <!-- <text class="tip-icon">🕒</text> -->
+          <text>统计日期:{{
+            formatDate(
+              new Date().setDate(new Date().getDate() - 1),
+              "YYYY-MM-DD",
+            ) || "--"
+          }}</text>
         </view>
         </view>
 
 
         <view class="filter-wrap">
         <view class="filter-wrap">
           <view class="selector" @click.stop="toggleProvinceDropdown">
           <view class="selector" @click.stop="toggleProvinceDropdown">
             <text class="selector-text">{{
             <text class="selector-text">{{
               selectedProvince || "全部省份"
               selectedProvince || "全部省份"
-              }}</text>
+            }}</text>
             <text class="selector-arrow" :class="{ open: dropdownProvinceOpen }"></text>
             <text class="selector-arrow" :class="{ open: dropdownProvinceOpen }"></text>
           </view>
           </view>
         </view>
         </view>
@@ -40,45 +43,33 @@
     <scroll-view class="list-scroll" scroll-y="true" refresher-enabled :refresher-triggered="isRefreshing"
     <scroll-view class="list-scroll" scroll-y="true" refresher-enabled :refresher-triggered="isRefreshing"
       @refresherrefresh="onRefresh">
       @refresherrefresh="onRefresh">
       <view class="list-container">
       <view class="list-container">
-        <view class="date-group" v-for="group in groupedRows" :key="group.date">
-          <view class="group-header" @click="toggleGroup(group)">
-            <view class="checkbox group-checkbox" :class="{ checked: isGroupChecked(group) }"></view>
-            <text class="group-date">{{ group.date }}</text>
-          </view>
-
-          <view class="card-item" v-for="(item, index) in group.list" :key="index" @click="toDetail(item)">
-            <view class="checkbox item-checkbox" :class="{ checked: item.checked }" @click.stop="toggleItem(item)">
+        <view class="card-item" v-for="(item, index) in rows" :key="index" @click="toDetail(item)">
+          <view class="card-header">
+            <view class="header-left">
+              <text class="index-num">{{ index + 1 }}</text>
+              <text class="company-name">{{ item.customerName }}</text>
+              <text class="level-tag" :class="getLevelClass(item.customerLevel)">
+                {{ item.customerLevel }}
+              </text>
             </view>
             </view>
+            <view class="header-right">
+              <text class="alert-count">{{ item.totalWarningAmount }}次预警</text>
+            </view>
+          </view>
 
 
-            <view class="card-content">
-              <view class="card-header">
-                <view class="header-left">
-                  <text class="index-num">{{ index + 1 }}</text>
-                  <text class="company-name">{{ item.customerName }}</text>
-                  <text class="level-tag" :class="getLevelClass(item.customerLevel)">
-                    {{ item.customerLevel }}
-                  </text>
-                </view>
-                <view class="header-right">
-                  <text class="alert-count">{{ item.totalWarningAmount }}次预警</text>
-                </view>
+          <view class="card-body">
+            <view class="info-grid">
+              <view class="info-item">
+                <text class="label">省份</text>
+                <text class="value">{{ item.customerProvinceName ?? '--' }}</text>
               </view>
               </view>
-
-              <view class="card-body">
-                <view class="info-grid">
-                  <view class="info-item">
-                    <text class="label">省份</text>
-                    <text class="value">{{ item.customerProvinceName ?? '--' }}</text>
-                  </view>
-                  <view class="info-item">
-                    <text class="label">责任人</text>
-                    <text class="value">{{ item.responsibleManager }}</text>
-                  </view>
-                  <view class="info-item">
-                    <text class="label">性质</text>
-                    <text class="value">{{ item.customerCategory }}</text>
-                  </view>
-                </view>
+              <view class="info-item">
+                <text class="label">责任人</text>
+                <text class="value">{{ item.responsibleManager }}</text>
+              </view>
+              <view class="info-item">
+                <text class="label">性质</text>
+                <text class="value">{{ item.customerCategory }}</text>
               </view>
               </view>
             </view>
             </view>
           </view>
           </view>
@@ -92,9 +83,9 @@
 
 
     <!-- 底部按钮区 -->
     <!-- 底部按钮区 -->
     <view class="footer-btn-area">
     <view class="footer-btn-area">
-      <!-- <button class="action-btn history-btn" @click="handleHistory">
+      <button class="action-btn history-btn" @click="handleHistory">
         历史记录
         历史记录
-      </button> -->
+      </button>
       <button class="action-btn export-btn" @click="handleExport">
       <button class="action-btn export-btn" @click="handleExport">
         导出至邮箱
         导出至邮箱
       </button>
       </button>
@@ -175,13 +166,6 @@ export default {
         email: "",
         email: "",
       },
       },
       emailError: false,
       emailError: false,
-      currentFilter: "1",
-      timeFilters: [
-        { label: "昨日", value: "1" },
-        { label: "近7天", value: "7" },
-        { label: "近15天", value: "15" },
-        { label: "近30天", value: "30" },
-      ],
     };
     };
   },
   },
   created() {
   created() {
@@ -211,25 +195,19 @@ export default {
       return "tag-default";
       return "tag-default";
     },
     },
 
 
-    switchFilter(value) {
-      if (this.currentFilter === value) return;
-      this.currentFilter = value;
-      this.resetFetch();
-    },
-
     fetchList() {
     fetchList() {
       if (this.loading) return;
       if (this.loading) return;
       this.loading = true;
       this.loading = true;
 
 
       request(
       request(
-        `/report/ganmaoling/list?days=${this.currentFilter}`,
+        `/report/ganmaoling/list?days=1`,
         {
         {
           path: "traceabilityReport/pages/ganmaoling/index.vue",
           path: "traceabilityReport/pages/ganmaoling/index.vue",
         },
         },
         "get",
         "get",
       ).then((res) => {
       ).then((res) => {
         if (res.code == 200) {
         if (res.code == 200) {
-          this.allRows = (res.data || []).map(item => ({ ...item, checked: false }));
+          this.allRows = res.data || [];
           this.applyFilter();
           this.applyFilter();
         }
         }
         this.loading = false;
         this.loading = false;
@@ -329,46 +307,12 @@ export default {
     },
     },
 
 
     handleHistory() {
     handleHistory() {
-      // uni.navigateTo({
-      //   url: "/traceCodePackages/traceabilityReport/pages/ganmaoling/history/index",
-      // });
-    },
-
-    toggleItem(item) {
-      item.checked = !item.checked;
-    },
-
-    toggleGroup(group) {
-      const allChecked = this.isGroupChecked(group);
-      group.list.forEach(item => {
-        item.checked = !allChecked;
+      uni.navigateTo({
+        url: "/traceCodePackages/traceabilityReport/pages/ganmaoling/history/index",
       });
       });
     },
     },
-
-    isGroupChecked(group) {
-      if (!group || !group.list || group.list.length === 0) return false;
-      return group.list.every(item => item.checked);
-    },
   },
   },
   computed: {
   computed: {
-    groupedRows() {
-      const groups = {};
-      this.rows.forEach((item) => {
-        const fullTime = item.updatedTime || "";
-        const date = fullTime.split(" ")[0] || fullTime.split("T")[0] || "未知日期";
-        if (!groups[date]) {
-          groups[date] = [];
-        }
-        groups[date].push(item);
-      });
-      // Sort by date descending
-      return Object.keys(groups)
-        .sort((a, b) => new Date(b.replace(/-/g, "/")) - new Date(a.replace(/-/g, "/")))
-        .map((date) => ({
-          date,
-          list: groups[date],
-        }));
-    },
     filteredProvinceList() {
     filteredProvinceList() {
       if (!this.provinceSearchText) {
       if (!this.provinceSearchText) {
         return this.provinceList;
         return this.provinceList;
@@ -488,30 +432,6 @@ export default {
   font-size: 20rpx;
   font-size: 20rpx;
 }
 }
 
 
-/* Filter Tabs */
-.filter-tabs {
-  display: flex;
-  background: rgba(255, 255, 255, 0.2);
-  border-radius: 30rpx;
-  padding: 4rpx;
-  margin-right: 20rpx;
-}
-
-.tab-item {
-  padding: 8rpx 24rpx;
-  font-size: 24rpx;
-  color: rgba(255, 255, 255, 0.8);
-  border-radius: 26rpx;
-  transition: all 0.3s;
-}
-
-.tab-item.active {
-  background: #fff;
-  color: #1890ff;
-  font-weight: 600;
-  box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
-}
-
 /* Filter Styles */
 /* Filter Styles */
 .filter-wrap {
 .filter-wrap {
   position: relative;
   position: relative;
@@ -621,7 +541,7 @@ export default {
   height: 0;
   height: 0;
   padding: 0 24rpx;
   padding: 0 24rpx;
   box-sizing: border-box;
   box-sizing: border-box;
-  margin-top: -20rpx;
+  margin-top: -50rpx;
   /* Overlap effect */
   /* Overlap effect */
   position: relative;
   position: relative;
   z-index: 2;
   z-index: 2;
@@ -633,85 +553,13 @@ export default {
   padding-bottom: calc(200rpx + env(safe-area-inset-bottom));
   padding-bottom: calc(200rpx + env(safe-area-inset-bottom));
 }
 }
 
 
-.date-group {
-  margin-bottom: 24rpx;
-}
-
-.group-header {
-  display: flex;
-  align-items: flex-start;
-  padding: 24rpx 30rpx;
-  background: #e6f7ff;
-  border-radius: 20rpx;
-  margin-bottom: 20rpx;
-  box-shadow: 0 4rpx 12rpx rgba(24, 144, 255, 0.1);
-}
-
-.group-date {
-  font-size: 32rpx;
-  font-weight: bold;
-  color: #1890ff;
-  margin-left: 20rpx;
-  line-height: 44rpx;
-  /* Match checkbox height for alignment */
-}
-
-.checkbox {
-  width: 44rpx;
-  height: 44rpx;
-  border: 3rpx solid #d9d9d9;
-  border-radius: 8rpx;
-  flex-shrink: 0;
-  position: relative;
-  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
-  box-sizing: border-box;
-  margin-top: 0;
-  /* Reset margin */
-  background: #fff;
-}
-
-.checkbox.checked {
-  background: #1890ff;
-  border-color: #1890ff;
-  box-shadow: 0 4rpx 10rpx rgba(24, 144, 255, 0.3);
-}
-
-.checkbox.checked::after {
-  content: '';
-  position: absolute;
-  left: 14rpx;
-  top: 8rpx;
-  width: 10rpx;
-  height: 20rpx;
-  border: 4rpx solid #fff;
-  border-top: 0;
-  border-left: 0;
-  transform: rotate(45deg);
-}
-
 .card-item {
 .card-item {
   background: #fff;
   background: #fff;
   border-radius: 20rpx;
   border-radius: 20rpx;
   padding: 30rpx;
   padding: 30rpx;
   margin-bottom: 24rpx;
   margin-bottom: 24rpx;
-  box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.04);
-  transition: all 0.2s;
-  display: flex;
-  align-items: flex-start;
-  /* Align to top */
-}
-
-.item-checkbox {
-  margin-right: 24rpx;
-  margin-top: 6rpx;
-  /* Align with first line of text */
-}
-
-.card-content {
-  flex: 1;
-  overflow: hidden;
-  display: flex;
-  flex-direction: column;
+  box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.05);
+  transition: transform 0.2s;
 }
 }
 
 
 .card-item:active {
 .card-item:active {