Selaa lähdekoodia

feat 管理端页面

wzh 4 kuukautta sitten
vanhempi
commit
1e5a970123

+ 1 - 0
.gitignore

@@ -22,3 +22,4 @@ selenium-debug.log
 package-lock.json
 yarn.lock
 /unpackage/
+/unpackage/

+ 115 - 11
api/hexiao.js

@@ -55,6 +55,55 @@ export function doCommitToJxs(id){
     })
 }
 
+/**
+ * 获取产品列表
+ */
+export function getProductList(){
+    return request({
+        url: `/dealer/getProductList`,
+        method: 'post',
+    })
+}
+
+/**
+ * 添加订单
+ */
+export function addDealerOrder(data){
+    return request({
+        url: `/dealer/save`,
+        method: 'post',
+        data: data
+    })
+}
+
+
+/**
+ * 修改订单
+ */
+export function editDealerOrder(data){
+    return request({
+        url: `/dealer/edit`,
+        method: 'post',
+        data: data
+    })
+}
+
+/**
+ * 确定订单
+ */
+export function confirmDealerOrder(id){
+    return request({
+        url: `/dealer/confirmReceipt`,
+        method: 'post',
+        params: {
+            id:id
+        }
+    })
+}
+
+
+
+
 export function parseLocation(latitute,longitute){
     return request({
         url: `/miniapp/getLocation`,
@@ -66,14 +115,40 @@ export function parseLocation(latitute,longitute){
     })
 }
 
-export function xundianRecord(pageIndex,pageSize,storeName){
+/**
+ * 积分明细
+ * @param pageIndex
+ * @param pageSize
+ */
+export function scoreRecord(pageIndex,pageSize){
     return request({
-        url: `/ywy/queryXunJi`,
+        url: `/ywy/queryPointRecord`,
         method: 'post',
         params: {
             pageIndex:pageIndex,
             pageSize:pageSize,
-            storeName:storeName
+        }
+    })
+}
+
+export function xundianRecord(data){
+    return request({
+        url: `/ywy/queryXunJi`,
+        method: 'post',
+        data
+    })
+}
+
+/**
+ * 获取巡店明细的详情
+ * @param id
+ */
+export function getXundianDetail(id){
+    return request({
+        url: `/ywy/queryXunJiDetail`,
+        method: 'post',
+        params: {
+            recordId:id
         }
     })
 }
@@ -126,15 +201,19 @@ export function removeRetail(id){
 
 
 
-export function getStoreList(pageIndex,pageSize,storeName){
+export function getStoreList(pageIndex,pageSize,storeName,ywyId){
+    let data = {
+        pageIndex:pageIndex,
+        pageSize:pageSize,
+        storeName:storeName,
+    }
+    if(ywyId>0){
+        data.ywyId = ywyId;
+    }
     return request({
         url: `/store/queryPage`,
         method: 'post',
-        params: {
-            pageIndex:pageIndex,
-            pageSize:pageSize,
-            storeName:storeName
-        }
+        params: data
     })
 }
 
@@ -217,18 +296,43 @@ export function queryAddRecordDetail(id){
 }
 
 /**
- * 经销商核销记录
+ * 经销商查询核销记录
+ * @param data
+ * @returns {*}
+ */
+export function queryHexiaoRecord(data){
+    return request({
+        url: `/jxs/writeOffRecord`,
+        method: 'post',
+        data: data
+    });
+}
+/**
+ * 经销商订货记录
  * @param id
  * @returns {*}
  */
 export function queryJxsAddRecord(data){
     return request({
-        url: `/jxs/writeOffRecord`,
+        url: `/dealer/list`,
         method: 'post',
         data: data
     });
 }
 
+/**
+ * 获取订单详情
+ * @param id
+ */
+export function getOrderDetail(id){
+    return request({
+        url: `/dealer/getOrderDetail`,
+        method: 'post',
+        params: {
+            id:id
+        }
+    });
+}
 /**
  * 经销商核销记录
  * @param id

+ 40 - 0
pages.json

@@ -233,6 +233,46 @@
 					"navigationBarTitleText" : "溯源信息",
 					"navigationStyle": "custom"
 				}
+			},
+			{
+				"path" : "hexiao/jxs/order",
+				"style" :
+				{
+					"navigationBarTitleText" : "订单",
+					"enablePullDownRefresh" : false
+				}
+			},
+			{
+				"path" : "hexiao/jxs/add_order",
+				"style" :
+				{
+					"navigationBarTitleText" : "添加订单",
+					"enablePullDownRefresh" : false
+				}
+			},
+			{
+				"path" : "hexiao/jxs/order_detail",
+				"style" :
+				{
+					"navigationBarTitleText" : "订单详情",
+					"enablePullDownRefresh" : false
+				}
+			},
+			{
+				"path" : "hexiao/score_list",
+				"style" :
+				{
+					"navigationBarTitleText" : "积分明细",
+					"enablePullDownRefresh" : false
+				}
+			},
+			{
+				"path" : "hexiao/ywy/patrol_detail",
+				"style" : 
+				{
+					"navigationBarTitleText" : "巡店详情",
+					"enablePullDownRefresh" : false
+				}
 			}
 		]
 	}, {

+ 26 - 17
pages/cjx/hexiao/jxs/hexiao_record.vue

@@ -43,21 +43,38 @@
       <view v-for="record in recordList" :key="record.orderNo" class="record-card">
         <view class="card-header">
           <uni-icons type="paperclip" size="20" color="#3c82f8"></uni-icons>
-          <text class="record-id" @click="detail(record.id)" style="text-decoration: underline">{{ record.orderNo }}</text>
-          <view class="status-badge pending" v-if="record.status === 0">
+          <text class="record-id" @click="detail(record.orderNo)" style="text-decoration: underline">{{ record.orderNo }}</text>
+          <view class="status-badge pending" v-if="record.status === 1">
             {{ getStatusText(record.status) }}
           </view>
-          <view class="status-badge verifying"  v-if="record.status === 1">
+          <view class="status-badge verifying"  v-if="record.status === 2">
             {{ getStatusText(record.status) }}
           </view>
-          <view class="status-badge verified"  v-if="record.status === 2">
+          <view class="status-badge verified"  v-if="record.status === 3">
             {{ getStatusText(record.status) }}
           </view>
         </view>
-
         <view class="card-body">
           <view class="detail-row">
-            <text class="detail-label">待核销商品总数</text>
+            <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>
+            <text class="detail-value">{{ record. dealerApplyTime }}</text>
+          </view>
+
+          <view class="detail-row" v-if="record.status === 3">
+            <text class="detail-label">审核时间</text>
+            <text class="detail-value">{{ record.finishTime }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">商品总数</text>
             <text class="detail-value">{{ record.writeOffNum }}</text>
           </view>
           <view class="detail-row product-item" v-for="(item, index) in record.writeOffRecordDetailVos" :key="index">
@@ -65,15 +82,8 @@
             <text class="detail-value">{{ item.num }}</text>
           </view>
 
-          <view class="detail-row" v-if="record.applicationTime">
-            <text class="detail-label">申请时间</text>
-            <text class="detail-value">{{ record.applicationTime }}</text>
-          </view>
 
-          <view class="detail-row" v-if="record.verificationTime">
-            <text class="detail-label">核销时间</text>
-            <text class="detail-value">{{ record.verificationTime }}</text>
-          </view>
+
         </view>
 
         <view class="card-footer" v-if="record.status === 1">
@@ -89,8 +99,7 @@
 </template>
 
 <script>
-import {queryJxsAddRecord,doCommitToJxs} from "@/api/hexiao";
-import {doCommitToChang} from "../../../../api/hexiao";
+import {queryJxsAddRecord,doCommitToJxs,doCommitToChang, queryHexiaoRecord} from "@/api/hexiao";
 
 export default {
   data() {
@@ -173,7 +182,7 @@ export default {
       data.endTime = this.endTime;
       data.pageIndex = this.pagination.page
       data.pageSize = this.pagination.limit
-      queryJxsAddRecord(data).then(res=>{
+      queryHexiaoRecord(data).then(res=>{
         let finalData = res.data.records;
         if(!finalData){
           finalData = [];

+ 3 - 1
pages/cjx/hexiao/jxs/index.vue

@@ -35,7 +35,7 @@
       </view>
 
 
-      <view class="card stat-card mendian-card" @click="navigateTo('storeStats')">
+      <view class="card stat-card mendian-card">
         <view class="stat-content">
           <view class="stat-title">门店统计</view>
           <view class="stat-value">{{ stats.storeCount }}</view>
@@ -142,6 +142,8 @@ export default {
       }
       if("stockRecords" === page){
         uni.navigateTo({ url: `/pages/cjx/hexiao/ywy/add_goods_record` });
+      }else if("pointsStats" === page){
+        uni.navigateTo({ url: `/pages/cjx/hexiao/score_list` });
       }else{
         this.build();
       }

+ 277 - 0
pages/cjx/hexiao/jxs/order_detail.vue

@@ -0,0 +1,277 @@
+<template>
+  <view class="page-container">
+    <view class="info-card">
+      <view class="card-header">
+        <view class="card-title">基本信息</view>
+      </view>
+      <view class="card-body">
+        <view class="detail-row">
+          <text class="label">订单编号</text>
+          <text class="value">{{ orderDetails.orderNo }}</text>
+        </view>
+        <view class="detail-row">
+          <text class="label">订单状态</text>
+          <text class="value status">{{ getStatusText(orderDetails.status) }}</text>
+        </view>
+        <view class="detail-row">
+          <text class="label">商品种类</text>
+          <text class="value">{{ orderDetails.items.length }}种</text>
+        </view>
+        <view class="detail-row">
+          <text class="label">创建时间</text>
+          <text class="value">{{ orderDetails.createTime }}</text>
+        </view>
+        <view class="detail-row no-border">
+          <text class="label">订单备注</text>
+          <text class="value">{{ orderDetails.remark || '无' }}</text>
+        </view>
+      </view>
+    </view>
+
+    <view class="info-card">
+      <view class="card-header">
+        <view class="card-title">收货信息</view>
+      </view>
+      <view class="card-body">
+        <view class="address-info">
+          <view class="address-text">{{ orderDetails.delivery.address }}</view>
+          <view class="user-info">
+            <text>{{ orderDetails.delivery.receiverName }}</text>
+            <text>{{ orderDetails.delivery.receiverPhone }}</text>
+          </view>
+        </view>
+      </view>
+    </view>
+
+    <view class="info-card">
+      <view class="card-header">
+        <view class="card-title">商品信息</view>
+      </view>
+      <view class="card-body product-list">
+        <view class="product-item" v-for="(item, index) in orderDetails.items" :key="item.id">
+          <view class="product-name">
+            <text class="product-index">{{ index + 1 }}.</text>
+            <text>{{ item.productName }}</text>
+          </view>
+          <view class="product-quantity">
+            订货数量:{{ item.quantity }}
+          </view>
+        </view>
+      </view>
+    </view>
+
+    <view class="footer-action" v-if="orderDetails.status == 0 || orderDetails.status == 4">
+      <button class="action-btn" @click="modifyOrder">修改订单</button>
+    </view>
+
+    <view class="footer-action" v-if="orderDetails.status == 2">
+      <button class="action-btn" @click="confirmOrder">确认收货</button>
+    </view>
+  </view>
+</template>
+
+<script>
+import {getOrderDetail,confirmDealerOrder } from "@/api/hexiao";
+
+export default {
+  data() {
+    return {
+      // 订单详情数据,通常从API获取
+      orderDetails: {
+        orderId: '',
+        status: 'rejected',
+        statusText: '已驳回',
+        productTypes: 0,
+        creationTime: '',
+        remarks: '',
+        shippingInfo: {
+          address: '',
+          name: '',
+          phone: ''
+        },
+        items: [],
+        id: '',
+      }
+    };
+  },
+  onLoad(options) {
+    // 页面加载时,会传入一个订单ID
+    console.log('加载的订单ID:', options.id);
+    this.id = options.id;
+    // 根据ID从服务器获取订单详情
+    this.fetchOrderDetails();
+  },
+  methods: {
+    getStatusText(status) {
+      const statusMap = {
+        0: '待审核',
+        1: '待审核',
+        2: '已发货',
+        3: '已完成',
+        4: '已驳回'
+      };
+      return statusMap[status] || '未知';
+    },
+    // 模拟从API获取数据
+    fetchOrderDetails() {
+      let orderId = this.id;
+      uni.showLoading({ title: '加载中...' });
+      // 模拟网络请求
+      getOrderDetail(orderId).then(res=>{
+        this.orderDetails = res.data;
+        uni.hideLoading();
+      })
+    },
+
+    // 点击订单状态
+    viewStatusReason() {
+      if (this.orderDetails.status === 'rejected') {
+        uni.showModal({
+          title: '驳回原因',
+          content: '库存不足,请修改订单后重新提交。',
+          showCancel: false
+        });
+      }
+    },
+
+    // 修改订单
+    modifyOrder() {
+      // 跳转到下单页面,并带上订单ID,以便复用数据
+      uni.navigateTo({ url: `/pages/cjx/hexiao/jxs/add_order?id=`+ this.id});
+    },
+    confirmOrder(){
+      confirmDealerOrder(this.id).then(res=>{
+        this.fetchOrderDetails();
+      })
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.page-container {
+  min-height: 100vh;
+  background: linear-gradient(to bottom, #e4efff, #f5f6fa 60%);
+  padding: 30rpx;
+  box-sizing: border-box;
+  padding-bottom: 180rpx; // 为底部按钮留出空间
+}
+
+.info-card {
+  background-color: #ffffff;
+  border-radius: 20rpx;
+  padding: 30rpx;
+  margin-bottom: 30rpx;
+  box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
+  position: relative;
+
+  &::before {
+    content: '';
+    position: absolute;
+    left: 0;
+    top: 35rpx;
+    width: 8rpx;
+    height: 30rpx;
+    background-color: #3c82f8;
+    border-radius: 0 4rpx 4rpx 0;
+  }
+}
+
+.card-header {
+  padding-bottom: 20rpx;
+  .card-title {
+    font-size: 32rpx;
+    font-weight: bold;
+  }
+}
+
+.card-body {
+  padding-top: 20rpx;
+  border-top: 1rpx solid #f5f5f5;
+}
+
+.detail-row {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding: 15rpx 0;
+  font-size: 28rpx;
+  border-bottom: 1rpx solid #f9f9f9;
+
+  .label { color: #666; }
+  .value { color: #333; }
+
+  .status {
+    color: #3c82f8;
+    text-decoration: underline;
+    cursor: pointer;
+  }
+
+  &.no-border {
+    border-bottom: none;
+  }
+}
+
+.address-info {
+  .address-text {
+    font-size: 30rpx;
+    color: #333;
+    font-weight: 500;
+  }
+  .user-info {
+    margin-top: 15rpx;
+    font-size: 28rpx;
+    color: #666;
+    text { margin-right: 20rpx; }
+  }
+}
+
+.product-list {
+  .product-item {
+    padding: 20rpx 0;
+    border-bottom: 1rpx solid #f9f9f9;
+    &:last-child {
+      border-bottom: none;
+    }
+    .product-name {
+      font-size: 30rpx;
+      font-weight: 500;
+      display: flex;
+      align-items: center;
+      .product-index {
+        color: #999;
+        margin-right: 15rpx;
+      }
+    }
+    .product-quantity {
+      font-size: 26rpx;
+      color: #666;
+      margin-top: 10rpx;
+      padding-left: 38rpx;
+    }
+  }
+}
+
+.footer-action {
+  position: fixed;
+  left: 0;
+  bottom: 0;
+  width: 100%;
+  padding: 20rpx 30rpx;
+  background-color: #f5f6fa;
+  box-sizing: border-box;
+  padding-bottom: calc(20rpx + constant(safe-area-inset-bottom));
+  padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
+  z-index: 100;
+}
+
+.action-btn {
+  background-color: #3c82f8;
+  color: #ffffff;
+  border-radius: 50rpx;
+  font-size: 32rpx;
+  height: 90rpx;
+  line-height: 90rpx;
+  &::after { border: none; }
+}
+</style>

+ 5 - 2
pages/cjx/hexiao/jxs/ywy_list.vue

@@ -155,7 +155,7 @@ export default {
       });
     },
     goToStores(id) {
-
+      uni.navigateTo({ url: '/pages/cjx/hexiao/ywy/retail?id='+id });
 
     },
     viewSalesData(id) {
@@ -165,7 +165,10 @@ export default {
     editSalesperson(id) {
       uni.navigateTo({ url: '/pages/cjx/hexiao/jxs/add_ywy?id='+id });
       console.log('编辑业务员 ID:', id); },
-    viewPatrolRecords(id) { console.log('查看巡店记录 ID:', id); this.build()},
+    viewPatrolRecords(id) {
+      uni.navigateTo({ url: '/pages/cjx/hexiao/ywy/patrol_record?id='+id });
+
+    },
     deleteSalesperson(id) {
       let self = this;
       uni.showModal({

+ 214 - 0
pages/cjx/hexiao/score_list.vue

@@ -0,0 +1,214 @@
+<template>
+  <view class="page-container">
+    <view class="sticky-header">
+      <view class="points-summary">
+        <view class="summary-left">
+          <text class="label">我的积分</text>
+          <text class="value">{{totalPoints}}</text>
+        </view>
+        <button class="use-points-btn" @click="goToUsagePage">去使用</button>
+      </view>
+    </view>
+
+    <scroll-view class="records-list" scroll-y="true" @scrolltolower="loadMore">
+      <view v-if="recordList.length === 0 && loadStatus !== 'loading'" class="empty-list">
+        <text>暂无积分记录</text>
+      </view>
+
+      <view v-for="record in recordList" :key="record.id" class="record-card">
+        <view class="record-info">
+          <text class="record-type">{{ record.type }}</text>
+          <text class="record-detail">门店名称:{{ record.storeName }}</text>
+          <text class="record-detail">获得时间:{{ record.time }}</text>
+        </view>
+        <view class="record-points" :class="record.amount > 0 ? 'income' : 'expense'">
+          {{ record.amount > 0 ? '+' : '' }}{{ record.amount }}
+        </view>
+      </view>
+
+      <uni-load-more :status="loadStatus"></uni-load-more>
+    </scroll-view>
+  </view>
+</template>
+
+<script>
+import {scoreRecord} from "@/api/hexiao";
+
+export default {
+  data() {
+    return {
+      totalPoints: 0,
+      recordList: [],
+      pagination: { page: 1, limit: 15 },
+      loadStatus: 'more', // 'more', 'loading', 'noMore'
+      isLoading: false,
+    };
+  },
+  onLoad(opt) {
+    this.totalPoints = opt.pointsCount;
+    this.fetchRecords(true);
+  },
+  onPullDownRefresh() {
+    this.fetchRecords(true);
+  },
+  methods: {
+    // 格式化数字,添加千位分隔符
+    formatNumber(num) {
+      return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
+    },
+    // 模拟获取积分记录
+    async fetchRecords(isRefresh = false) {
+      if (this.isLoading || (this.loadStatus === 'noMore' && !isRefresh)) {
+        return;
+      }
+      if (isRefresh) {
+        this.pagination.page = 1;
+        this.recordList = [];
+        this.loadStatus = 'more';
+      }
+      this.isLoading = true;
+      this.loadStatus = 'loading';
+
+      // --- 模拟API请求 ---
+      console.log(`请求第 ${this.pagination.page} 页...`);
+
+      scoreRecord(this.pagination.page,this.pagination.limit).then(res=>{
+        let data = res.data;
+        let mockData = data.records;
+        if(mockData == null){
+          mockData = [];
+        }
+        uni.stopPullDownRefresh();
+        if (mockData.length > 0 ) {
+          this.recordList = [...this.recordList, ...mockData];
+          this.pagination.page++;
+          this.loadStatus = 'more';
+        } else {
+          this.loadStatus = 'noMore';
+        }
+        this.isLoading = false;
+
+      })
+      // --- 模拟结束 ---
+
+
+    },
+    // 上拉加载更多
+    loadMore() {
+      this.fetchRecords();
+    },
+    // 跳转到积分使用页面
+    goToUsagePage() {
+      console.log('跳转到积分商城或使用页面');
+      // uni.navigateTo({ url: '/pages/points/shop' });
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.page-container {
+  display: flex;
+  flex-direction: column;
+  height: 100vh;
+  background: linear-gradient(to bottom, #e4efff, #f5f6fa 30%);
+}
+
+.sticky-header {
+  position: sticky;
+  top: 0;
+  z-index: 100;
+  background: linear-gradient(to bottom, #e4efff, #f5f6fa);
+  padding-bottom: 20rpx;
+}
+
+.points-summary {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding: 30rpx;
+  margin: 20rpx;
+  background: linear-gradient(to right, #6ca1ff, #3c82f8);
+  border-radius: 20rpx;
+  color: #ffffff;
+  box-shadow: 0 8rpx 20rpx rgba(60, 130, 248, 0.3);
+
+  .summary-left {
+    display: flex;
+    flex-direction: column;
+  }
+  .label {
+    font-size: 28rpx;
+    opacity: 0.9;
+  }
+  .value {
+    font-size: 52rpx;
+    font-weight: bold;
+    margin-top: 10rpx;
+  }
+  .use-points-btn {
+    margin: 0;
+    background-color: rgba(255, 255, 255, 0.9);
+    color: #3c82f8;
+    font-size: 26rpx;
+    padding: 0 30rpx;
+    height: 60rpx;
+    line-height: 60rpx;
+    border-radius: 30rpx;
+    font-weight: 500;
+    &::after {
+      border: none;
+    }
+  }
+}
+
+.records-list {
+  flex: 1;
+  height: 100%;
+  padding: 0 20rpx;
+}
+
+.empty-list {
+  text-align: center;
+  color: #999;
+  padding-top: 150rpx;
+}
+
+.record-card {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  background-color: #ffffff;
+  border-radius: 16rpx;
+  padding: 30rpx;
+  margin-bottom: 20rpx;
+  box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
+}
+
+.record-info {
+  display: flex;
+  flex-direction: column;
+  .record-type {
+    font-size: 30rpx;
+    font-weight: 500;
+    color: #333;
+  }
+  .record-detail {
+    font-size: 24rpx;
+    color: #999;
+    margin-top: 12rpx;
+  }
+}
+
+.record-points {
+  font-size: 36rpx;
+  font-weight: bold;
+
+  &.income {
+    color: #4caf50; // 绿色代表收入
+  }
+  &.expense {
+    color: #e54d42; // 红色代表支出
+  }
+}
+</style>

+ 16 - 10
pages/cjx/hexiao/ywy/hexiao_detail.vue

@@ -3,32 +3,37 @@
     <view class="info-card">
       <view class="info-row">
         <text class="info-label">核销门店</text>
-        <text class="info-value">{{ recordInfo.storeName }}</text>
+        <text class="info-value">{{ detail.storeName }}</text>
       </view>
       <view class="info-row">
         <text class="info-label">核销时间</text>
-        <text class="info-value">{{ recordInfo.verificationTime }}</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>
 
     <view class="summary-card">
       <view
           class="summary-tab"
-          v-for="item in summaryData"
+          v-for="item in detail.totals"
           :key="item.key"
       >
-        <text class="tab-category">{{ item.category }}</text>
-        <text class="tab-count">{{ item.count }}{{ item.unit }}</text>
+        <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="detailsList.length === 0 && loadStatus !== 'loading'" class="empty-tip">
+      <view v-if="detail.items.length === 0 && loadStatus !== 'loading'" class="empty-tip">
         暂无明细记录
       </view>
-      <view v-for="(item, index) in detailsList" :key="index" class="detail-item-card">
-        <text class="item-name">{{ item.name }}</text>
-        <text class="item-code">扫码编号:{{ item.code }}</text>
+      <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>
@@ -60,6 +65,7 @@ export default {
       pagination: { page: 1, limit: 15 },
       loadStatus: 'more', // 'more', 'loading', 'noMore'
       isLoading: false,
+      detail:{totals:[]}
     };
   },
   onLoad(opt) {
@@ -74,7 +80,7 @@ export default {
   methods: {
     getDetail(){
       queryAddRecordDetail(this.id).then(res=>{
-        debugger;
+        this.detail = res.data;
       })
     },
     // 模拟从API获取明细数据

+ 18 - 9
pages/cjx/hexiao/ywy/hexiao_record.vue

@@ -43,7 +43,7 @@
       <view v-for="record in recordList" :key="record.orderNo" class="record-card">
         <view class="card-header">
           <uni-icons type="paperclip" size="20" color="#3c82f8"></uni-icons>
-          <text class="record-id" @click="detail(record.id)" style="text-decoration: underline">{{ record.orderNo }}</text>
+          <text class="record-id" @click="detail(record.orderNo)" style="text-decoration: underline">{{ record.orderNo }}</text>
           <view class="status-badge pending" v-if="record.status === 0">
             {{ getStatusText(record.status) }}
           </view>
@@ -57,7 +57,15 @@
 
         <view class="card-body">
           <view class="detail-row">
-            <text class="detail-label">待核销商品总数</text>
+            <text class="detail-label">门店名称</text>
+            <text class="detail-value">{{ record.storeName }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">上传时间</text>
+            <text class="detail-value">{{ record.uploadTime }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">商品总数</text>
             <text class="detail-value">{{ record.writeOffNum }}</text>
           </view>
           <view class="detail-row product-item" v-for="(item, index) in record.writeOffRecordDetailVos" :key="index">
@@ -65,14 +73,15 @@
             <text class="detail-value">{{ item.num }}</text>
           </view>
 
-          <view class="detail-row" v-if="record.applicationTime">
-            <text class="detail-label">申请时间</text>
-            <text class="detail-value">{{ record.applicationTime }}</text>
+
+          <view class="detail-row" v-if="record.status === 1 ||record.status === 3">
+            <text class="detail-label">提交时间</text>
+            <text class="detail-value">{{ record.applyTime }}</text>
           </view>
 
-          <view class="detail-row" v-if="record.verificationTime">
-            <text class="detail-label">核时间</text>
-            <text class="detail-value">{{ record.verificationTime }}</text>
+          <view class="detail-row" v-if="record.status === 3">
+            <text class="detail-label">核时间</text>
+            <text class="detail-value">{{ record.writeOffTime }}</text>
           </view>
         </view>
 
@@ -327,7 +336,7 @@ export default {
 
   &.pending { background-color: #3c82f8; }
   &.verifying { background-color: #ff9900; }
-  &.verified { background-color: #909399; }
+  &.verified { background-color: #54CFAB; }
 }
 
 .card-body {

+ 2 - 0
pages/cjx/hexiao/ywy/index.vue

@@ -151,6 +151,8 @@ export default {
         uni.navigateTo({ url: `/pages/cjx/hexiao/ywy/hexiao_record` });
       }else if("patrolRecords" === page){
         uni.navigateTo({ url: `/pages/cjx/hexiao/ywy/patrol_record` });
+      }else if("pointsStats" === page){
+        uni.navigateTo({ url: `/pages/cjx/hexiao/score_list?score=`+stats.pointsCount });
       }
       else{
         this.build();

+ 168 - 42
pages/cjx/hexiao/ywy/patrol_record.vue

@@ -1,59 +1,52 @@
 <template>
   <view class="page-container">
-<!--    <view class="search-wrapper">-->
-<!--      <view class="search-bar">-->
-<!--        <uni-icons type="search" size="20" color="#999"></uni-icons>-->
-<!--        <input-->
-<!--            class="search-input"-->
-<!--            v-model="searchQuery"-->
-<!--            placeholder="输入门店名称/上货日期搜索"-->
-<!--            placeholder-class="placeholder"-->
-<!--            confirm-type="search"-->
-<!--            @confirm="handleSearch"-->
-<!--        />-->
-<!--      </view>-->
-<!--    </view>-->
+    <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"
+                @input="handleSearch"
+                @change="change"
+            ></u--input>
+          </u-col>
+          <u-col span="3">
+            <view class="query-btn" @click="show = !show">
+              <view class="query-btn-icon">
+              </view>
+              <view class="query-btn-text">筛选</view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
+    </view>
 
     <scroll-view class="list-container" scroll-y="true" @scrolltolower="loadMore">
       <view v-if="recordList.length === 0 && loadStatus !== 'loading'" class="empty-list">
         <text>暂无上货记录</text>
       </view>
 
-      <view v-for="record in recordList" :key="record.id" class="record-card">
+      <view @click="detail(record.id)" v-for="record in recordList" :key="record.id" class="record-card">
         <view class="card-decorator"></view>
         <view class="card-content">
           <view class="card-header">
             <uni-icons type="shop-filled" size="20" color="#3c82f8"></uni-icons>
-            <text class="record-id">{{ record.recordNo }}</text>
+            <text class="record-id">{{ record.storeName }}</text>
           </view>
 
           <view class="details-section">
-            <view class="detail-row">
-              <text class="detail-label">上货商品总数</text>
-              <text class="detail-value">{{ record.totalNum }}</text>
-            </view>
-
-            <view class="detail-row" v-for="item in record.queryActiveRecordDetailVos">
-              <text class="detail-label">{{ item.productName }}</text>
-              <text class="detail-value">{{ item.num }}</text>
-            </view>
 
-            <view class="detail-row product-item" v-for="(product, index) in record.products" :key="index">
-              <text class="detail-label product-name">{{ product.name }}</text>
-              <text class="detail-value">{{ product.quantity }}{{ product.unit }}</text>
-            </view>
-
-            <view class="detail-row">
-              <text class="detail-label">上货门店</text>
-              <text class="detail-value">{{ record.storeName }}</text>
-            </view>
             <view class="detail-row">
-              <text class="detail-label">上货时间</text>
-              <text class="detail-value">{{ record.activeTime }}</text>
+              <text class="detail-label">巡店时间</text>
+              <text class="detail-value">{{ record.getTime }}</text>
             </view>
             <view class="detail-row">
               <text class="detail-label">上货奖励</text>
-              <text class="detail-value reward">{{ record.reward==null?"0":record.reward }}积分</text>
+              <text class="detail-value reward">{{ record.point==null?"0":record.point }}积分</text>
             </view>
           </view>
         </view>
@@ -61,18 +54,63 @@
 
       <uni-load-more :status="loadStatus"></uni-load-more>
     </scroll-view>
+    <u-popup :show="show" mode="bottom"  @close="show = false" >
+      <view class="popup-content">
+        <view class="popup-text">筛选</view>
+        <u-row customStyle="margin-bottom: 10px">
+          <u-col span="3">
+            <view class="explain">选择日期</view>
+          </u-col>
+          <u-col span="9">
+            <u--input
+                v-model="startTimeXd"
+                placeholder="开始日期 ~ 结束日期"
+                prefixIcon="calendar"
+                prefixIconStyle="font-size: 22px;color: #909399"
+                @focus="timeShow = true"
+            ></u--input>
+          </u-col>
+        </u-row>
+        <u-row customStyle="margin-bottom: 10px">
+          <u-col span="3">
+            <view class="explain">门店名称</view>
+          </u-col>
+          <u-col span="9">
+            <u--input v-model="searchQuery"
+                      placeholder="请输入内容"
+                      border="surround"
+            ></u--input>
+          </u-col>
+        </u-row>
+        <view class="popup-btn">
+          <u-button @click="handleSearch"  class="popup-btn-one">搜索</u-button>
+          <u-button @click="resetForm" class="popup-btn-one" type="primary">重置</u-button>
+        </view>
+      </view>
+
+    </u-popup>
+    <u-calendar @close="timeShow = false" :show="timeShow" :mode="mode" @confirm="confirm"></u-calendar>
   </view>
 </template>
 
 <script>
-import {queryActiveRecord} from "@/api/hexiao";
-import {xundianRecord} from "../../../../api/hexiao";
+import {xundianRecord} from "@/api/hexiao";
 
 export default {
   data() {
     return {
+      startTime: '',
+      endTime: '',
+      timeShow: false,
+      startTimeXd:"",
+      mode: 'range',
+      show:false,
+
+
+
       searchQuery: '',
       recordList: [],
+      ywyId:0,
       pagination: {
         page: 1,
         limit: 10,
@@ -81,15 +119,23 @@ export default {
       isLoading: false,
     };
   },
-  onLoad() {
+  onLoad(opt) {
     // 页面加载时获取第一页数据
+    if(opt.id){
+      this.ywyId = opt.id
+    }
     this.fetchRecords(true);
+
   },
   // 监听下拉刷新
   onPullDownRefresh() {
     this.fetchRecords(true);
   },
   methods: {
+    detail(id){
+      uni.navigateTo({ url: `/pages/cjx/hexiao/ywy/patrol_detail?id=`+id });
+
+    },
     // 核心:获取记录列表数据
     async fetchRecords(isRefresh = false) {
       if (this.isLoading || (this.loadStatus === 'noMore' && !isRefresh)) {
@@ -108,7 +154,18 @@ export default {
       // 在这里替换成您真实的 uni.request API 调用
       console.log(`正在请求第 ${this.pagination.page} 页数据...`);
 
-      xundianRecord(this.pagination.page,this.pagination.limit).then(res=>{
+      let data = {
+        pageIndex:this.pagination.page,
+        pageSize:this.pagination.limit,
+        storeName:this.searchQuery,
+        startTime:this.startTime,
+        endTime:this.endTime
+      };
+
+      if(this.ywyId>0){
+        data.ywyId = this.ywyId
+      }
+      xundianRecord(data).then(res=>{
         let mockData = res.data.records;
         if (mockData.length > 0) {
           this.recordList = [...this.recordList, ...mockData];
@@ -128,7 +185,22 @@ export default {
 
 
     },
+    resetForm(){
+      this.searchQuery = "";
+      this.startTime = "";
+      this.endTime = "";
+      this.startTimeXd = "";
+    },
+    confirm(e) {
+      this.startTime = e[0];
+      this.endTime = e[e.length-1];
+      this.startTimeXd = e[0]+' ~ '+e[e.length-1];
+      if(!this.show){
+        this.handleSearch()
+      }
+      this.timeShow = false;
 
+    },
     // 上拉加载更多
     loadMore() {
       this.fetchRecords();
@@ -137,8 +209,7 @@ export default {
     // 搜索
     handleSearch() {
       // 在实际项目中,搜索应该调用API,这里为简单起见只做前端筛选
-      // this.fetchRecords(true);
-      uni.showToast({ title: '触发搜索', icon: 'none' });
+      this.fetchRecords(true);
     }
   }
 }
@@ -252,4 +323,59 @@ export default {
     font-weight: 500;
   }
 }
+
+
+
+
+
+
+
+
+.query-btn {
+  background-color: #409eff;
+  color: #fff;
+  padding: 20rpx;
+  border-radius: 10rpx;
+  height: 34rpx;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+.query-btn-icon {
+  height: 32rpx;
+  width: 32rpx;
+  background-image:
+      url("https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/queryIoc.png");
+  background-size: cover;
+  background-position: center;
+  background-repeat: no-repeat;
+}
+.query-btn-text {
+  font-weight: 400;
+  font-size: 30rpx;
+  color: #F5F5F5;
+}
+.popup-content{
+  height: 25vh;
+  padding: 10px;
+}
+.popup-text{
+  font-family: PingFang SC;
+  font-weight: bold;
+  font-size: 36rpx;
+  color: #1C1E1D;
+  text-align: center;
+  margin-bottom: 10px;
+}
+.popup-btn{
+  display: flex;
+  justify-content: space-around;
+}
+.popup-btn-one{
+  width: 275rpx;
+  height: 70rpx;
+  background: linear-gradient(0deg, #6FA4FE, #488CFF);
+  box-shadow: 0rpx 9rpx 16rpx 0rpx rgba(153,153,153,0.35);
+  border-radius: 35rpx;
+}
 </style>

+ 10 - 7
pages/cjx/hexiao/ywy/retail.vue

@@ -45,15 +45,15 @@
               <uni-icons type="eye-filled" size="18" color="#3c82f8"></uni-icons>
               <text>详情</text>
             </view>
-            <view class="action-btn" @click="editStore(store.id)">
+            <view class="action-btn" @click="editStore(store.id)" v-if="ywyId === 0">
               <uni-icons type="compose" size="18" color="#3c82f8"></uni-icons>
               <text>编辑</text>
             </view>
-            <view class="action-btn" @click="patrolStore(store.id)">
+            <view class="action-btn" @click="patrolStore(store.id)" v-if="ywyId === 0">
               <uni-icons type="home-filled" size="18" color="#3c82f8"></uni-icons>
               <text>巡店</text>
             </view>
-            <view class="action-btn delete-btn" @click="deleteStore(store.id)">
+            <view class="action-btn delete-btn" @click="deleteStore(store.id)" v-if="ywyId === 0">
               <uni-icons type="trash-filled" size="18" color="#e54d42"></uni-icons>
               <text>删除</text>
             </view>
@@ -62,11 +62,11 @@
       </view>
     </scroll-view>
 
-    <view class="fixed-footer">
+    <view class="fixed-footer" v-if="ywyId === 0">
       <button class="add-store-btn" @click="addNewStore">新增门店</button>
     </view>
 
-    <CustomTabbar :current="1"/>
+    <CustomTabbar v-if="ywyId === 0" :current="1"/>
   </view>
 </template>
 
@@ -89,13 +89,16 @@ export default {
         page: 1,
         limit: 10,
       },
+      ywyId:0,
     };
   },
   onShow(){
     this.fetchStoreList(true);
   },
   onLoad(opt) {
-
+    if(opt.id){
+      this.ywyId = opt.id;
+    }
    this.fetchStoreList(true);
   },
   methods: {
@@ -116,7 +119,7 @@ export default {
       // 在这里替换成您真实的 uni.request API 调用
       console.log(`正在请求第 ${this.pagination.page} 页数据, 搜索词: "${this.searchQuery}"`);
 
-      getStoreList(this.pagination.page,this.pagination.limit,this.searchQuery).then(res=>{
+      getStoreList(this.pagination.page,this.pagination.limit,this.searchQuery,this.ywyId).then(res=>{
         let data = res.data;
         let mockData = data.records;
         if (mockData.length > 0) {