Kaynağa Gözat

feat 管理端页面

wzh 4 ay önce
ebeveyn
işleme
a652718032

+ 17 - 0
api/hexiao.js

@@ -170,6 +170,21 @@ export function active(data){
     })
 }
 
+/**
+ * 上货详情
+ * @param data
+ * @returns {*}
+ */
+export function queryActiveDetail(id){
+    return request({
+        url: `/ywy/queryActiveRecordDetail`,
+        method: 'post',
+        params: {
+            recordId:id
+        }
+    })
+}
+
 export function writeOff(data){
     return request({
         url: `/ywy/writeOff`,
@@ -349,6 +364,8 @@ export function queryJxsAddRecordDetail(id){
 }
 
 
+
+
 export function ywyList(keyword){
     return request({
         url: `/jxs/jxsRetailListQuery`,

+ 8 - 7
pages/cjx/hexiao/jxs/hexiao_detail.vue

@@ -3,12 +3,17 @@
     <view class="info-card">
       <view class="info-row">
         <text class="info-label">核销业务员</text>
-        <text class="info-value">{{ recordInfo.ywyName }}</text>
+        <text class="info-value">{{ detail.ywyName }}</text>
       </view>
       <view class="info-row">
-        <text class="info-label">核销时间</text>
-        <text class="info-value">{{ recordInfo.uploadTime }}</text>
+        <text class="info-label">申请时间</text>
+        <text class="info-value">{{ detail.dealerApplyTime }}</text>
       </view>
+      <view class="info-row" v-if="detail.status == 3">
+        <text class="info-label">审核时间</text>
+        <text class="info-value">{{ detail.finishTime }}</text>
+      </view>
+
     </view>
 
     <view class="summary-card">
@@ -49,10 +54,6 @@ export default {
       },
       // 分类汇总数据
       summaryData: [
-        { category: '10元槟榔', count: 20, unit: '袋', key: 'product_10' },
-        { category: '20元槟榔', count: 20, unit: '袋', key: 'product_20' },
-        { category: '30元槟榔', count: 20, unit: '袋', key: 'product_30' },
-        { category: '能量饮料', count: 20, unit: '罐', key: 'product_drink' },
       ],
       // 所有明细的列表
       detailsList: [],

+ 0 - 4
pages/cjx/hexiao/jxs/hexiao_record.vue

@@ -59,10 +59,6 @@
             <text class="detail-label">业务员名称</text>
             <text class="detail-value">{{ record.ywyName }}</text>
           </view>
-          <view class="detail-row" v-if="record.status === 1">
-            <text class="detail-label">申请时间</text>
-            <text class="detail-value">{{ record.applyTime }}</text>
-          </view>
 
           <view class="detail-row" v-if="record.status === 2 || record.status === 3">
             <text class="detail-label">申请时间</text>

+ 217 - 0
pages/cjx/hexiao/ywy/add_goods_detail.vue

@@ -0,0 +1,217 @@
+<template>
+  <view class="page-container">
+    <view class="info-card">
+      <view class="info-row">
+        <text class="info-label">核销门店</text>
+        <text class="info-value">{{ detail.storeName }}</text>
+      </view>
+      <view class="info-row">
+        <text class="info-label">上传时间</text>
+        <text class="info-value">{{ detail.uploadTime }}</text>
+      </view>
+      <view class="info-row" v-if="detail.status == 1 || detail.status == 2">
+        <text class="info-label">申请时间</text>
+        <text class="info-value">{{ detail.applyTime }}</text>
+      </view>
+
+      <view class="info-row" v-if=" detail.status == 2">
+        <text class="info-label">审核时间</text>
+        <text class="info-value">{{ detail.writeOffTime }}</text>
+      </view>
+
+
+    </view>
+
+    <view class="summary-card">
+      <view
+          class="summary-tab"
+          v-for="item in detail.totals"
+          :key="item.key"
+      >
+        <text class="tab-category">{{ item.categoryName }}</text>
+        <text class="tab-count">{{ item.num }}</text>
+      </view>
+    </view>
+
+    <scroll-view class="details-list" scroll-y="true" @scrolltolower="loadMore">
+      <view v-if="detail.items.length === 0 && loadStatus !== 'loading'" class="empty-tip">
+        暂无明细记录
+      </view>
+      <view v-for="(item, index) in detail.items" :key="index" class="detail-item-card">
+        <text class="item-name">{{ item.productName }}</text>
+        <text class="item-code">扫码编号:{{ item.qrCodeNum }}</text>
+      </view>
+      <uni-load-more :status="loadStatus"></uni-load-more>
+    </scroll-view>
+  </view>
+</template>
+
+<script>
+import {queryActiveDetail} from "@/api/hexiao";
+
+export default {
+  data() {
+    return {
+      id:"",
+      // 总览信息
+      recordInfo: {
+        storeName: '湖南长沙超吉炫旗舰店',
+        verificationTime: '2025-08-11 09:30:00',
+      },
+      // 分类汇总数据
+      summaryData: [
+      ],
+      // 所有明细的列表
+      detailsList: [],
+      // 分页加载相关
+      pagination: { page: 1, limit: 15 },
+      loadStatus: 'more', // 'more', 'loading', 'noMore'
+      isLoading: false,
+      detail:{totals:[]}
+    };
+  },
+  onLoad(opt) {
+    // 页面加载时,获取第一页数据
+    // options.id 可以用来从上个页面传递记录ID
+    this.id = opt.id
+    this.getDetail(true);
+  },
+  onPullDownRefresh() {
+    this.fetchDetails(true);
+  },
+  methods: {
+    getDetail(){
+      queryActiveDetail(this.id).then(res=>{
+        this.detail = res.data;
+      })
+    },
+    // 模拟从API获取明细数据
+    async fetchDetails(isRefresh = false) {
+      if (this.isLoading || (this.loadStatus === 'noMore' && !isRefresh)) {
+        return;
+      }
+      if (isRefresh) {
+        this.pagination.page = 1;
+        this.detailsList = [];
+        this.loadStatus = 'more';
+      }
+      this.isLoading = true;
+      this.loadStatus = 'loading';
+
+      console.log(`请求第 ${this.pagination.page} 页明细...`);
+      await new Promise(resolve => setTimeout(resolve, 1000));
+
+      const mockData = Array.from({ length: this.pagination.limit }, (_, i) => {
+        const id = (this.pagination.page - 1) * this.pagination.limit + i + 1;
+        return {
+          name: `超吉炫10元精制槟榔 - ${id}`,
+          code: `BH2025010020${String(id).padStart(3, '0')}`
+        };
+      });
+      const noMoreData = this.pagination.page >= 5; // 模拟加载4页后没有更多
+
+      uni.stopPullDownRefresh();
+      if (mockData.length > 0 && !noMoreData) {
+        this.detailsList = [...this.detailsList, ...mockData];
+        this.pagination.page++;
+        this.loadStatus = 'more';
+      } else {
+        this.loadStatus = 'noMore';
+      }
+      this.isLoading = false;
+    },
+    // 滚动到底部加载更多
+    loadMore() {
+      this.fetchDetails();
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.page-container {
+  display: flex;
+  flex-direction: column;
+  height: 100vh;
+  background-color: #f5f6fa;
+}
+
+.info-card {
+  background-color: #ffffff;
+  border-radius: 16rpx;
+  margin: 20rpx;
+  padding: 20rpx 30rpx;
+  box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
+}
+
+.info-row {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  font-size: 28rpx;
+  padding: 15rpx 0;
+  .info-label { color: #666; }
+  .info-value { color: #333; }
+}
+
+.summary-card {
+  display: flex;
+  justify-content: space-around;
+  background: linear-gradient(to right, #6ca1ff, #3c82f8);
+  border-radius: 16rpx;
+  margin: 0 20rpx 20rpx;
+  padding: 20rpx 10rpx;
+  color: #ffffff;
+}
+
+.summary-tab {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  padding: 10rpx;
+
+  .tab-category {
+    font-size: 26rpx;
+    opacity: 0.9;
+  }
+  .tab-count {
+    font-size: 28rpx;
+    font-weight: bold;
+    margin-top: 10rpx;
+  }
+}
+
+.details-list {
+  flex: 1;
+  height: 100%;
+  padding: 0 20rpx;
+}
+
+.empty-tip {
+  text-align: center;
+  color: #999;
+  padding-top: 100rpx;
+}
+
+.detail-item-card {
+  background-color: #ffffff;
+  border-radius: 16rpx;
+  padding: 30rpx;
+  margin-bottom: 20rpx;
+  box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
+
+  .item-name {
+    display: block;
+    font-size: 30rpx;
+    font-weight: bold;
+    color: #333;
+  }
+
+  .item-code {
+    display: block;
+    font-size: 26rpx;
+    color: #999;
+    margin-top: 15rpx;
+  }
+}
+</style>

+ 5 - 2
pages/cjx/hexiao/ywy/add_goods_record.vue

@@ -33,9 +33,9 @@
       <view v-for="record in recordList" :key="record.id" class="record-card">
         <view class="card-decorator"></view>
         <view class="card-content">
-          <view class="card-header">
+          <view class="card-header" @click="detail(record.id)">
             <uni-icons type="calendar-filled" size="20" color="#3c82f8"></uni-icons>
-            <text class="record-id">{{ record.recordNo }}</text>
+            <text class="record-id" style="text-decoration: underline">{{ record.recordNo }}</text>
           </view>
 
           <view class="details-section">
@@ -145,6 +145,9 @@ export default {
     this.fetchRecords(true);
   },
   methods: {
+    detail(id){
+      uni.navigateTo({ url: `/pages/cjx/hexiao/ywy/add_goods_detail?id=`+id });
+    },
     confirm(e) {
       this.startTime = e[0];
       this.endTime = e[e.length-1];

+ 11 - 9
pages/cjx/hexiao/ywy/hexiao_detail.vue

@@ -5,15 +5,21 @@
         <text class="info-label">核销门店</text>
         <text class="info-value">{{ detail.storeName }}</text>
       </view>
-      <view class="info-row">
-        <text class="info-label">核销时间</text>
-        <text class="info-value">{{ detail.writeOffTime }}</text>
-      </view>
-
       <view class="info-row">
         <text class="info-label">上传时间</text>
         <text class="info-value">{{ detail.uploadTime }}</text>
       </view>
+      <view class="info-row" v-if="detail.status == 1 || detail.status == 2">
+        <text class="info-label">申请时间</text>
+        <text class="info-value">{{ detail.applyTime }}</text>
+      </view>
+
+      <view class="info-row" v-if=" detail.status == 2">
+        <text class="info-label">审核时间</text>
+        <text class="info-value">{{ detail.writeOffTime }}</text>
+      </view>
+
+
     </view>
 
     <view class="summary-card">
@@ -54,10 +60,6 @@ export default {
       },
       // 分类汇总数据
       summaryData: [
-        { category: '10元槟榔', count: 20, unit: '袋', key: 'product_10' },
-        { category: '20元槟榔', count: 20, unit: '袋', key: 'product_20' },
-        { category: '30元槟榔', count: 20, unit: '袋', key: 'product_30' },
-        { category: '能量饮料', count: 20, unit: '罐', key: 'product_drink' },
       ],
       // 所有明细的列表
       detailsList: [],

+ 2 - 2
pages/cjx/hexiao/ywy/hexiao_record.vue

@@ -74,12 +74,12 @@
           </view>
 
 
-          <view class="detail-row" v-if="record.status === 1 ||record.status === 3">
+          <view class="detail-row" v-if="record.status === 1 ||record.status === 2">
             <text class="detail-label">提交时间</text>
             <text class="detail-value">{{ record.applyTime }}</text>
           </view>
 
-          <view class="detail-row" v-if="record.status === 3">
+          <view class="detail-row" v-if="record.status === 2">
             <text class="detail-label">审核时间</text>
             <text class="detail-value">{{ record.writeOffTime }}</text>
           </view>

+ 3 - 3
pages/cjx/hexiao/ywy/patrol_record.vue

@@ -30,12 +30,12 @@
         <text>暂无上货记录</text>
       </view>
 
-      <view @click="detail(record.id)" v-for="record in recordList" :key="record.id" class="record-card">
+      <view v-for="record in recordList" :key="record.id" class="record-card">
         <view class="card-decorator"></view>
         <view class="card-content">
-          <view class="card-header">
+          <view class="card-header" @click="detail(record.id)" >
             <uni-icons type="shop-filled" size="20" color="#3c82f8"></uni-icons>
-            <text class="record-id">{{ record.storeName }}</text>
+            <text class="record-id" style="text-decoration: underline">{{ record.storeName }}</text>
           </view>
 
           <view class="details-section">

+ 1 - 0
pages/cjx/hexiao/ywy/scan_code.vue

@@ -64,6 +64,7 @@ export default {
     uni.setNavigationBarTitle({
       title: title
     });
+
     // 获取二维码列表
     // this.codeList = this.$store.state.qrCodeList;
   },