Răsfoiți Sursa

增加最近30天的时间选项

shish 3 săptămâni în urmă
părinte
comite
80f0290abc

+ 12 - 11
ghsApp/src/admin/home/order.vue

@@ -22,7 +22,7 @@
 
     <view class="input-wrap_box">
       <view class="select-dn_bx">
-        <DateSelect ref="dateSelectRef" class="bar" top="0" @selectDateFn="selectDateFn" defaultShowName="时间" />
+        <DateSelect ref="dateSelectRef" class="bar" top="0" @selectDateFn="selectDateFn" defaultShowName="近30天" />
       </view>
       <view class="search-container">
         <AppSearchModule ref="appSearch" placeholder="这里搜索" @input="searchFn" />
@@ -306,7 +306,7 @@ export default {
       },
       searchType: 0,
       searchTypeName: '客户',
-      searchTime: '',
+      searchTime: 'last30Days',
       startTime: '',
       endTime: '',
       fromDetail: { status: 1 },
@@ -547,14 +547,17 @@ export default {
       this.filterBook = -1;
       this.filterShopAdminId = 0;
       this.filterSendType = -1;
-      this.searchTime = '';
-      this.startTime = '';
-      this.endTime = '';
-      this.resetDateSelect();
+      this.resetDefaultDateRange();
       this.closeFilterPanel();
       this.resetList();
       this.getOrderList();
     },
+    resetDefaultDateRange() {
+      this.searchTime = 'last30Days'
+      this.startTime = ''
+      this.endTime = ''
+      this.resetDateSelect()
+    },
     resetDateSelect() {
       if (this.$refs.dateSelectRef && this.$refs.dateSelectRef.reset) {
         this.$refs.dateSelectRef.reset();
@@ -595,15 +598,13 @@ export default {
       }
       this.closeMore();
       this.customId = 0;
-      this.searchTime = '';
-      this.startTime = '';
-      this.endTime = '';
       this.filterDistId = 0;
       this.filterDebt = -1;
       this.filterOnlinePay = -1;
       this.filterBook = -1;
       this.filterShopAdminId = 0;
       this.filterSendType = -1;
+      this.resetDefaultDateRange();
       this.resetList();
       this.getOrderList();
     },
@@ -702,7 +703,7 @@ page {
   padding-bottom: 1upx;
   overflow: hidden;
   .select-dn_bx {
-    padding-left: 14upx;
+    padding-left: 10upx;
     padding-right: 10upx;
   }
   .app-tabs {
@@ -733,7 +734,7 @@ page {
     height: 100upx;
     display: flex;
     align-items: center;
-    padding: 0 30upx;
+    padding: 0 10upx;
     & > view:nth-child(2) {
       flex: 1;
     }

+ 48 - 3
ghsApp/src/admin/shop/debtChange.vue

@@ -1,5 +1,18 @@
+<!--
+  门店应收款变动明细页
+  供货商端查看全店欠款变动流水,默认查近30天,可按日期筛选
+-->
 <template>
 <view class="app-content">
+		<view class="filter-bar">
+			<DateSelect
+				ref="dateSelectRef"
+				class="bar"
+				top="0"
+				@selectDateFn="selectDateFn"
+				defaultShowName="近30天"
+			/>
+		</view>
 		<block v-if="!$util.isEmpty(list.data)">
 			<t-table :headerBackgroundColor="'#F0F2F6'">
 				<t-tr header>
@@ -30,21 +43,48 @@
 </template>
 <script>
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import DateSelect from '@/components/module/dateSelect';
 import { totalDebtChangeList } from '@/api/shop'
 import list from '@/mixins/list'
 export default {
 	name: "debtChange",
 	components: {
-		AppWrapperEmpty
+		AppWrapperEmpty,
+		DateSelect
 	},
 	mixins:[list],
 	data() {
 		return {
+			searchTime: 'last30Days',
+			startTime: '',
+			endTime: ''
 		};
 	},
 	methods: {
+		// 重置为默认近30天
+		resetDefaultDateRange() {
+			this.searchTime = 'last30Days'
+			this.startTime = ''
+			this.endTime = ''
+			if (this.$refs.dateSelectRef && this.$refs.dateSelectRef.reset) {
+				this.$refs.dateSelectRef.reset()
+			}
+		},
+		selectDateFn(val) {
+			this.searchTime = val.searchTime
+			this.startTime = val.startTime || ''
+			this.endTime = val.endTime || ''
+			this.resetList()
+			this.init()
+		},
 		async init(){
-			const res = await totalDebtChangeList({ page:this.list.page,customId:this.option.customId })
+			const res = await totalDebtChangeList({
+				page: this.list.page,
+				customId: this.option.customId,
+				searchTime: this.searchTime,
+				startTime: this.startTime,
+				endTime: this.endTime
+			})
 			if (this.$util.isEmpty(res.data.list)){
 				this.completes(res)
 				return
@@ -73,4 +113,9 @@ export default {
 	
 };
 </script>
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.filter-bar {
+	padding: 16upx 24upx;
+	background: #fff;
+}
+</style>

+ 15 - 6
hdApp/src/admin/home/order.vue

@@ -13,7 +13,7 @@
         <view class="filter-row">
           <view class="filter-chip date-chip">
             <image class="filter-icon" :src="iconSrc('order-calendar')" mode="aspectFit" />
-            <DateSelect class="date-select" top="0" @selectDateFn="selectDateFn" defaultShowName="时间" />
+            <DateSelect ref="dateSelectRef" class="date-select" top="0" @selectDateFn="selectDateFn" defaultShowName="近30天" />
           </view>
           <view class="filter-chip mode-chip" :class="{ active: searchStyle == 0 }" @click="changeSearchStyle">
             <image class="filter-icon" :src="iconSrc('order-account-name')" mode="aspectFit" />
@@ -367,7 +367,7 @@ export default {
       showSearch: false,
       searchList: [],
       customId: 0,
-      searchTime: "",
+      searchTime: "last30Days",
       startTime: "",
       endTime: "",
       repeat: -1,
@@ -729,6 +729,17 @@ export default {
     selectStaffFn () {
       this.$refs.getStaffRef.open("top");
     },
+    // 重置日期为默认近30天
+    resetDefaultDateRange () {
+      this.searchTime = "last30Days";
+      this.startTime = "";
+      this.endTime = "";
+      if (this.$refs.dateSelectRef) {
+        this.$refs.dateSelectRef.defaultDateName = "近30天";
+        this.$refs.dateSelectRef.startDate = "";
+        this.$refs.dateSelectRef.endDate = "";
+      }
+    },
     clearFn () {
       this.resetList();
       this.shopAdminId = 0;
@@ -736,9 +747,7 @@ export default {
       this.lastSearchText = "";
       this.showSearch = false;
       this.customId = 0;
-      this.searchTime = "";
-      this.startTime = "";
-      this.endTime = "";
+      this.resetDefaultDateRange();
       if (this.$refs && this.$refs.searchRef) {
         this.$refs.searchRef.search = "";
       }
@@ -967,7 +976,7 @@ export default {
   top: 0;
   z-index: 30;
   width: 100%;
-  padding: 10upx 22upx 16upx;
+  padding: 10upx 8upx 16upx;
   background: linear-gradient(180deg, #f4fbf7 0%, #f8fcfa 60upx, #ffffff 100upx, #ffffff 100%);
   border-radius: 0;
   box-shadow: 0 8upx 20upx rgba(24, 37, 30, 0.06);