shish hace 2 meses
padre
commit
d699e193b1
Se han modificado 1 ficheros con 84 adiciones y 2 borrados
  1. 84 2
      ghsApp/src/admin/home/order.vue

+ 84 - 2
ghsApp/src/admin/home/order.vue

@@ -83,6 +83,21 @@
     <view v-if="showFilterPanel" class="filter-overlay" @click="closeFilterPanel">
       <view class="filter-panel" @click.stop>
         <view class="filter-header">筛选订单</view>
+        <scroll-view class="filter-body" scroll-y>
+        <view class="filter-section">
+          <view class="filter-title">挂账</view>
+          <view class="filter-options">
+            <view
+              v-for="(item, index) in debtOptions"
+              :key="index"
+              class="filter-option"
+              :class="{ active: filterDebt === item.value }"
+              @click="onSelectDebt(index)"
+            >
+              {{ item.label }}
+            </view>
+          </view>
+        </view>
         <view class="filter-section">
           <view class="filter-title">在线支付</view>
           <view class="filter-options">
@@ -111,6 +126,21 @@
             </view>
           </view>
         </view>
+        <view class="filter-section">
+          <view class="filter-title">片区</view>
+          <view class="filter-options">
+            <view class="filter-option" :class="{ active: filterDistId === 0 }" @click="onSelectDist(0)">全部</view>
+            <view
+              v-for="(item, index) in distList"
+              :key="index"
+              class="filter-option"
+              :class="{ active: filterDistId === item.id }"
+              @click="onSelectDist(item.id)"
+            >
+              {{ item.name }}
+            </view>
+          </view>
+        </view>
         <view class="filter-section">
           <view class="filter-title">开单员工</view>
           <view class="filter-options">
@@ -146,6 +176,7 @@
             </view>
           </view>
         </view>
+        </scroll-view>
         <view class="filter-actions">
           <button class="filter-action-btn clear-btn" @click="clearFilters">重置</button>
           <button class="filter-action-btn confirm-btn" @click="confirmFilters">确定</button>
@@ -195,6 +226,7 @@ import {
 } from '@/utils/orderShare';
 import { getList } from '@/api/member';
 import { getStaffList } from '@/api/staff';
+import { getAllDist } from '@/api/dist';
 export default {
   name: 'order',
   components: {
@@ -212,7 +244,14 @@ export default {
     ...mapGetters(['getLoginInfo', 'getDictionariesInfo']),
     ...mapGetters({ dictInfo: 'getDictionariesInfo' }),
     hasActiveFilters() {
-      return this.filterOnlinePay !== -1 || this.filterBook !== -1 || this.filterShopAdminId !== 0 || this.filterSendType !== -1;
+      return (
+        this.filterDistId !== 0 ||
+        this.filterDebt !== -1 ||
+        this.filterOnlinePay !== -1 ||
+        this.filterBook !== -1 ||
+        this.filterShopAdminId !== 0 ||
+        this.filterSendType !== -1
+      );
     }
   },
   data() {
@@ -278,11 +317,19 @@ export default {
       pendingSharePayload: null,
       singleShareOrderId: 0,
       showFilterPanel: false,
+      distList: [],
       staffList: [],
+      filterDistId: 0,
+      filterDebt: -1,
       filterShopAdminId: 0,
       filterBook: -1,
       filterOnlinePay: -1,
       filterSendType: -1,
+      debtOptions: [
+        { label: '全部', value: -1 },
+        { label: '挂账', value: 1 },
+        { label: '非挂账', value: 0 }
+      ],
       onlinePayOptions: [
         { label: '全部', value: -1 },
         { label: '在线支付', value: 2 },
@@ -438,9 +485,17 @@ export default {
       });
     },
     init() {
+      this.loadDistList();
       this.loadStaffList();
       this.getOrderList();
     },
+    loadDistList() {
+      getAllDist().then((res) => {
+        if (res.code == 1) {
+          this.distList = res.data.list || [];
+        }
+      });
+    },
     loadStaffList() {
       getStaffList().then((res) => {
         if (res.code == 1) {
@@ -454,6 +509,15 @@ export default {
     closeFilterPanel() {
       this.showFilterPanel = false;
     },
+    onSelectDist(id) {
+      this.filterDistId = id;
+    },
+    onSelectDebt(index) {
+      const item = this.debtOptions[index];
+      if (item) {
+        this.filterDebt = item.value;
+      }
+    },
     onSelectOnlinePay(index) {
       const item = this.onlinePayOptions[index];
       if (item) {
@@ -476,6 +540,8 @@ export default {
       }
     },
     clearFilters() {
+      this.filterDistId = 0;
+      this.filterDebt = -1;
       this.filterOnlinePay = -1;
       this.filterBook = -1;
       this.filterShopAdminId = 0;
@@ -531,6 +597,8 @@ export default {
       this.searchTime = '';
       this.startTime = '';
       this.endTime = '';
+      this.filterDistId = 0;
+      this.filterDebt = -1;
       this.filterOnlinePay = -1;
       this.filterBook = -1;
       this.filterShopAdminId = 0;
@@ -563,6 +631,8 @@ export default {
         page: this.list.page,
         searchType: this.searchType,
         customId: this.customId,
+        customDistId: this.filterDistId,
+        debt: this.filterDebt,
         shopAdminId: this.filterShopAdminId,
         book: this.filterBook,
         onlinePay: this.filterOnlinePay,
@@ -714,12 +784,19 @@ page {
   background-color: rgba(0, 0, 0, 0.5);
 }
 .filter-panel {
+  display: flex;
+  flex-direction: column;
   width: 100%;
   max-height: 90vh;
-  overflow-y: auto;
+  overflow: hidden;
   border-radius: 0 0 24upx 24upx;
   background: #fff;
 }
+.filter-body {
+  flex: 1;
+  max-height: calc(90vh - 200upx);
+  overflow: hidden;
+}
 .filter-header {
   padding: 24upx 0;
   text-align: center;
@@ -761,8 +838,13 @@ page {
   font-weight: 700;
 }
 .filter-actions {
+  flex-shrink: 0;
   display: flex;
   padding: 30upx 40upx 40upx;
+  padding-bottom: calc(40upx + constant(safe-area-inset-bottom));
+  padding-bottom: calc(40upx + env(safe-area-inset-bottom));
+  border-top: 1upx solid #f0f0f0;
+  background: #fff;
 }
 .filter-action-btn {
   flex: 1;