|
|
@@ -1,27 +1,6 @@
|
|
|
<template>
|
|
|
<view class="page-container">
|
|
|
<view class="sticky-header">
|
|
|
-<!-- <view class="search-wrapper">-->
|
|
|
-<!-- <view class="query">-->
|
|
|
-<!-- <u-row customStyle="margin-bottom: 10px" gutter="20">-->
|
|
|
-<!-- <u-col span="9">-->
|
|
|
-<!-- <u--input-->
|
|
|
-<!-- @focus="timeShow = true"-->
|
|
|
-<!-- v-model="startTimeXd"-->
|
|
|
-<!-- placeholder="开始日期 ~ 结束日期"-->
|
|
|
-<!-- prefixIcon="calendar"-->
|
|
|
-<!-- prefixIconStyle="font-size: 22px;color: #909399"-->
|
|
|
-<!-- @clear="handleSearch"-->
|
|
|
-<!-- ></u--input>-->
|
|
|
-<!-- </u-col>-->
|
|
|
-<!-- <u-col span="3">-->
|
|
|
-<!-- <view class="query-btn" @click="clearSearch">-->
|
|
|
-<!-- <view class="query-btn-text">清空</view>-->
|
|
|
-<!-- </view>-->
|
|
|
-<!-- </u-col>-->
|
|
|
-<!-- </u-row>-->
|
|
|
-<!-- </view>-->
|
|
|
-<!-- </view>-->
|
|
|
<view class="tabs-wrapper">
|
|
|
<view
|
|
|
v-for="tab in tabs"
|
|
|
@@ -34,6 +13,40 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view class="search-wrapper" v-if="currentTab === 5">
|
|
|
+ <view class="query">
|
|
|
+ <u-row customStyle="margin-bottom: 10px" gutter="20">
|
|
|
+ <u-col span="9">
|
|
|
+ <u--input
|
|
|
+ @focus="timeShow = true"
|
|
|
+ v-model="startTimeXd"
|
|
|
+ placeholder="开始日期 ~ 结束日期"
|
|
|
+ prefixIcon="calendar"
|
|
|
+ prefixIconStyle="font-size: 22px;color: #909399"
|
|
|
+ @clear="handleSearch"
|
|
|
+ ></u--input>
|
|
|
+ </u-col>
|
|
|
+ <u-col span="3">
|
|
|
+ <view class="query-btn" @click="clearSearch">
|
|
|
+ <view class="query-btn-text">清空</view>
|
|
|
+ </view>
|
|
|
+ </u-col>
|
|
|
+ </u-row>
|
|
|
+ <u-row customStyle="margin-bottom: 10px" gutter="20">
|
|
|
+ <u-col span="12">
|
|
|
+ <u--input
|
|
|
+ v-model="storeNameQuery"
|
|
|
+ placeholder="请输入门店名称"
|
|
|
+ prefixIcon="search"
|
|
|
+ prefixIconStyle="font-size: 22px;color: #909399"
|
|
|
+ @confirm="handleSearch"
|
|
|
+ @clear="handleSearch"
|
|
|
+ clearable
|
|
|
+ ></u--input>
|
|
|
+ </u-col>
|
|
|
+ </u-row>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
<view v-if="currentTab == 1">
|
|
|
<scroll-view class="list-container" scroll-y="true" @scrolltolower="loadMore" >
|
|
|
<view v-if="pendingList.length === 0 && loadStatus !== 'loading'" class="empty-list">
|
|
|
@@ -71,6 +84,48 @@
|
|
|
<button class="add-btn" @click="verify(-1)">一键核销</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view v-if="currentTab === 5" class="store-summary-container">
|
|
|
+ <scroll-view class="summary-list" scroll-y="true">
|
|
|
+ <view v-if="summaryList.length === 0" class="empty-list">
|
|
|
+ <text>暂无汇总数据</text>
|
|
|
+ </view>
|
|
|
+ <view v-else class="summary-table-wrapper">
|
|
|
+ <view class="table-header">
|
|
|
+ <view class="header-cell store-col">门店</view>
|
|
|
+ <view class="header-cell product-col">品相</view>
|
|
|
+ <view class="header-cell number-col">数量</view>
|
|
|
+ </view>
|
|
|
+ <view class="table-body">
|
|
|
+ <view class="table-row" v-for="(store, storeIndex) in summaryList" :key="storeIndex">
|
|
|
+ <view class="table-cell store-col">
|
|
|
+ <view class="store-name-cell">
|
|
|
+ <uni-icons type="shop" size="16" color="#3c82f8"></uni-icons>
|
|
|
+ <text class="store-name-text">{{ store.storeName }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view>
|
|
|
+ <view class="table-row-cl2" v-for="(item, itemIndex) in store.writeOffRecordDetailVos" :key="itemIndex">
|
|
|
+ <view class="table-cell product-col">
|
|
|
+ <text>{{ item.item }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="table-cell number-col">
|
|
|
+ <text>{{ item.writeOffAmount }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="table-row-cl2">
|
|
|
+ <view class="table-cell product-col">
|
|
|
+ <text>汇总</text>
|
|
|
+ </view>
|
|
|
+ <view class="table-cell number-col">
|
|
|
+ <text style="color: orange;">{{ store.summaryCount }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </scroll-view>
|
|
|
+ </view>
|
|
|
<scroll-view class="list-container" scroll-y="true" @scrolltolower="loadMore" v-if="currentTab>1 && currentTab<4">
|
|
|
<view v-if="recordList.length === 0 && loadStatus !== 'loading'" class="empty-list">
|
|
|
<text>暂无相关记录</text>
|
|
|
@@ -152,7 +207,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {queryJxsAddRecord,doCommitToJxs,doCommitToChang, queryHexiaoRecord,queryPendingWriteOffRecord,queryWriteOffDetailByItem} from "@/api/hexiao";
|
|
|
+import {queryJxsAddRecord,doCommitToJxs,doCommitToChang, queryHexiaoRecord,queryPendingWriteOffRecord,queryWriteOffDetailByItem,queryStoreSummary} from "@/api/hexiao";
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
|
@@ -163,16 +218,20 @@ export default {
|
|
|
startTimeXd:"",
|
|
|
mode: 'range',
|
|
|
searchQuery: '',
|
|
|
+ storeNameQuery: '',
|
|
|
tabs: [
|
|
|
{ name: '待审核', key: 'pending',id: 1 },
|
|
|
// { name: '核销中', key: 'verifying', id: 2},
|
|
|
{ name: '已提交', key: 'verified' , id :3},
|
|
|
{ name: '我的账户', key: 'zhanghu' , id :4},
|
|
|
+ { name: '门店汇总', key: 'storeSummary' , id :5},
|
|
|
],
|
|
|
currentTab: 1,
|
|
|
recordList: [],
|
|
|
hexiaoList:[],
|
|
|
+ summaryList: [],
|
|
|
pendingList:[],
|
|
|
+ grandTotal: 0,
|
|
|
pagination: { page: 1, limit: 10 },
|
|
|
loadStatus: 'more', // 'more', 'loading', 'noMore'
|
|
|
isLoading: false,
|
|
|
@@ -182,6 +241,18 @@ export default {
|
|
|
this.getReadyData(true);
|
|
|
},
|
|
|
onPullDownRefresh() {
|
|
|
+ if (this.currentTab === 1) {
|
|
|
+ this.getReadyData(true);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.currentTab === 4) {
|
|
|
+ this.itemByDetail();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.currentTab === 5) {
|
|
|
+ this.fetchStoreSummary(true);
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.fetchRecords(true);
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -223,6 +294,10 @@ export default {
|
|
|
this.itemByDetail();
|
|
|
return;
|
|
|
}
|
|
|
+ if (this.currentTab === 5) {
|
|
|
+ this.fetchStoreSummary(true);
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.fetchRecords(true); // 切换tab时重新加载数据
|
|
|
}
|
|
|
},
|
|
|
@@ -285,9 +360,14 @@ export default {
|
|
|
this.startTime = "";
|
|
|
this.endTime = "";
|
|
|
this.startTimeXd = "";
|
|
|
+ this.storeNameQuery = "";
|
|
|
this.handleSearch()
|
|
|
},
|
|
|
handleSearch() {
|
|
|
+ if (this.currentTab === 5) {
|
|
|
+ this.fetchStoreSummary(true);
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.fetchRecords(true);
|
|
|
},
|
|
|
verify(id) {
|
|
|
@@ -317,6 +397,32 @@ export default {
|
|
|
queryWriteOffDetailByItem({}).then(res=>{
|
|
|
this.hexiaoList = res.data;
|
|
|
})
|
|
|
+ },
|
|
|
+ async fetchStoreSummary(isRefresh = false) {
|
|
|
+ if (this.isLoading) return;
|
|
|
+ this.isLoading = true;
|
|
|
+ try {
|
|
|
+ const params = {
|
|
|
+ startTime: this.startTime,
|
|
|
+ endTime: this.endTime,
|
|
|
+ storeName: this.storeNameQuery
|
|
|
+ };
|
|
|
+ const res = await queryStoreSummary(params);
|
|
|
+ if (res.code === 0) {
|
|
|
+ this.summaryList = res.data || [];
|
|
|
+ this.grandTotal = res.data.grandTotal || 0;
|
|
|
+ } else {
|
|
|
+ this.summaryList = [];
|
|
|
+ this.grandTotal = 0;
|
|
|
+ uni.showToast({ title: '获取汇总数据失败', icon: 'none' });
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ this.summaryList = [];
|
|
|
+ this.grandTotal = 0;
|
|
|
+ } finally {
|
|
|
+ this.isLoading = false;
|
|
|
+ uni.stopPullDownRefresh();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -482,6 +588,106 @@ export default {
|
|
|
color: #F5F5F5;
|
|
|
}
|
|
|
|
|
|
+.store-summary-container {
|
|
|
+ background-color: #f5f6fa;
|
|
|
+ overflow: auto;
|
|
|
+ height: 100%;
|
|
|
+}
|
|
|
+
|
|
|
+.summary-list {
|
|
|
+ height: 100%;
|
|
|
+}
|
|
|
+
|
|
|
+.summary-table-wrapper {
|
|
|
+ background-color: #ffffff;
|
|
|
+ border-radius: 16rpx;
|
|
|
+ margin: 20rpx;
|
|
|
+ overflow: hidden;
|
|
|
+ box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
|
|
|
+}
|
|
|
+
|
|
|
+.table-header {
|
|
|
+ display: flex;
|
|
|
+ background-color: #f8f9fa;
|
|
|
+ padding: 24rpx 20rpx;
|
|
|
+ border-bottom: 1rpx solid #e8e8e8;
|
|
|
+
|
|
|
+ .header-cell {
|
|
|
+ font-size: 28rpx;
|
|
|
+ font-weight: 600;
|
|
|
+ color: #333;
|
|
|
+ text-align: center;
|
|
|
+
|
|
|
+ &.store-col {
|
|
|
+ width: 220rpx;
|
|
|
+ flex-shrink: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.product-col {
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.number-col {
|
|
|
+ width: 150rpx;
|
|
|
+ flex-shrink: 0;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.table-body {
|
|
|
+ .table-row {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding: 0 20rpx;
|
|
|
+ min-height: 100rpx;
|
|
|
+ border-bottom: 1rpx solid #a5a5a5;
|
|
|
+
|
|
|
+ .table-cell {
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #333;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding: 20rpx 0;
|
|
|
+ min-height: 100rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+
|
|
|
+ &.store-col {
|
|
|
+ width: 220rpx;
|
|
|
+ flex-shrink: 0;
|
|
|
+
|
|
|
+ .store-name-cell {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ uni-icons {
|
|
|
+ margin-right: 10rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .store-name-text {
|
|
|
+ font-weight: 500;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &.product-col {
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.number-col {
|
|
|
+ width: 150rpx;
|
|
|
+ flex-shrink: 0;
|
|
|
+ text-align: right;
|
|
|
+ justify-content: flex-end;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.table-row-cl2{
|
|
|
+ display: flex;
|
|
|
+}
|
|
|
+
|
|
|
.fixed-footer {
|
|
|
position: fixed;
|
|
|
bottom: 0;
|