|
|
@@ -1,27 +1,27 @@
|
|
|
<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="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,8 +34,44 @@
|
|
|
</view>
|
|
|
</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">
|
|
|
+ <text>暂无相关记录</text>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view v-for="(pendInfo) in pendingList" :key="pendInfo.ywyId" class="record-card">
|
|
|
+
|
|
|
|
|
|
- <scroll-view class="list-container" scroll-y="true" @scrolltolower="loadMore">
|
|
|
+ <view class="card-header" @click="detail(pendInfo.ywyId,1)">
|
|
|
+ <uni-icons type="paperclip" size="20" color="#3c82f8"></uni-icons>
|
|
|
+ <text class="record-id" style="text-decoration: underline">{{ pendInfo.ywyName }}</text>
|
|
|
+ <view class="status-badge pending">
|
|
|
+ {{ getStatusText(0) }}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+
|
|
|
+ <view class="card-body">
|
|
|
+
|
|
|
+ <view class="detail-row product-item" v-for="(item, index) in pendInfo.detail" :key="index">
|
|
|
+ <text class="detail-label">{{ item.categoryName }}</text>
|
|
|
+ <text class="detail-value">{{ item.num }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="card-footer">
|
|
|
+ <button class="verify-btn" @click="verify(pendInfo.ywyId)">核销</button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <uni-load-more :status="loadStatus"></uni-load-more>
|
|
|
+ </scroll-view>
|
|
|
+ <view class="fixed-footer" v-if="pendingList.length>0">
|
|
|
+ <button class="add-btn" @click="verify(-1)">一键核销</button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <scroll-view class="list-container" scroll-y="true" @scrolltolower="loadMore" v-if="currentTab>1">
|
|
|
<view v-if="recordList.length === 0 && loadStatus !== 'loading'" class="empty-list">
|
|
|
<text>暂无相关记录</text>
|
|
|
</view>
|
|
|
@@ -43,14 +79,11 @@
|
|
|
<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.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 === 2">
|
|
|
+ <text class="record-id" @click="detail(record.id)" style="text-decoration: underline">{{ record.orderNo }}</text>
|
|
|
+ <view class="status-badge verifying" v-if="record.status === 0">
|
|
|
{{ getStatusText(record.status) }}
|
|
|
</view>
|
|
|
- <view class="status-badge verified" style="background-color: #54CFAB" v-if="record.status === 3">
|
|
|
+ <view class="status-badge verified" style="background-color: #54CFAB" v-if="record.status === 1">
|
|
|
{{ getStatusText(record.status) }}
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -59,18 +92,12 @@
|
|
|
<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">
|
|
|
+ <view class="detail-row" >
|
|
|
<text class="detail-label">申请时间</text>
|
|
|
<text class="detail-value">{{ record. dealerApplyTime }}</text>
|
|
|
</view>
|
|
|
|
|
|
- <view class="detail-row" v-if="record.status === 3">
|
|
|
+ <view class="detail-row" v-if="record.status === 1">
|
|
|
<text class="detail-label">审核时间</text>
|
|
|
<text class="detail-value">{{ record.finishTime }}</text>
|
|
|
</view>
|
|
|
@@ -87,9 +114,6 @@
|
|
|
|
|
|
</view>
|
|
|
|
|
|
- <view class="card-footer" v-if="record.status === 1">
|
|
|
- <button class="verify-btn" @click="verify(record.id,record.orderNo)">一键审核</button>
|
|
|
- </view>
|
|
|
</view>
|
|
|
|
|
|
<uni-load-more :status="loadStatus"></uni-load-more>
|
|
|
@@ -101,6 +125,7 @@
|
|
|
|
|
|
<script>
|
|
|
import {queryJxsAddRecord,doCommitToJxs,doCommitToChang, queryHexiaoRecord} from "@/api/hexiao";
|
|
|
+import {queryPendingWriteOffRecord} from "../../../api/hexiao";
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
|
@@ -112,20 +137,20 @@ export default {
|
|
|
mode: 'range',
|
|
|
searchQuery: '',
|
|
|
tabs: [
|
|
|
- { name: '全部', key: 'all' ,id:-1 },
|
|
|
{ name: '待审核', key: 'pending',id: 1 },
|
|
|
{ name: '核销中', key: 'verifying', id: 2},
|
|
|
{ name: '已核销', key: 'verified' , id :3},
|
|
|
],
|
|
|
- currentTab: -1,
|
|
|
+ currentTab: 1,
|
|
|
recordList: [],
|
|
|
+ pendingList:[],
|
|
|
pagination: { page: 1, limit: 10 },
|
|
|
loadStatus: 'more', // 'more', 'loading', 'noMore'
|
|
|
isLoading: false,
|
|
|
};
|
|
|
},
|
|
|
onLoad() {
|
|
|
- this.fetchRecords(true);
|
|
|
+ this.getReadyData(true);
|
|
|
},
|
|
|
onPullDownRefresh() {
|
|
|
this.fetchRecords(true);
|
|
|
@@ -151,16 +176,24 @@ export default {
|
|
|
},
|
|
|
getStatusText(status) {
|
|
|
const statusMap = {
|
|
|
- 1: '待审核',
|
|
|
- 2: '核销中',
|
|
|
- 3: '已核销'
|
|
|
+ 0: '核销中',
|
|
|
+ 1: '已核销'
|
|
|
};
|
|
|
return statusMap[status] || '未知';
|
|
|
},
|
|
|
changeTab(tabKey) {
|
|
|
if (this.currentTab === tabKey) return;
|
|
|
this.currentTab = tabKey;
|
|
|
- this.fetchRecords(true); // 切换tab时重新加载数据
|
|
|
+ if(this.currentTab ==1){
|
|
|
+ this.getReadyData(true);
|
|
|
+ }else{
|
|
|
+ this.fetchRecords(true); // 切换tab时重新加载数据
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getReadyData(isRefresh = false) {
|
|
|
+ queryPendingWriteOffRecord({pageIndex:this.pagination.page,pageSize:100,ywyName:this.searchQuery}).then(res=>{
|
|
|
+ this.pendingList = res.data.records?res.data.records:[];
|
|
|
+ })
|
|
|
},
|
|
|
async fetchRecords(isRefresh = false) {
|
|
|
if (this.isLoading || (this.loadStatus === 'noMore' && !isRefresh)) {
|
|
|
@@ -177,7 +210,7 @@ export default {
|
|
|
|
|
|
let data = {};
|
|
|
if(this.currentTab !== -1){
|
|
|
- data.status = this.currentTab;
|
|
|
+ data.status = this.currentTab-2;
|
|
|
}
|
|
|
data.startTime = this.startTime;
|
|
|
data.endTime = this.endTime;
|
|
|
@@ -202,7 +235,11 @@ export default {
|
|
|
|
|
|
|
|
|
},
|
|
|
- detail(id){
|
|
|
+ detail(id,type){
|
|
|
+ if(type == 1){
|
|
|
+ uni.navigateTo({ url: `/pages/hexiao/jxs/hexiao_pending_detail?id=`+id });
|
|
|
+ return;
|
|
|
+ }
|
|
|
uni.navigateTo({ url: `/pages/hexiao/jxs/hexiao_detail?id=`+id });
|
|
|
},
|
|
|
loadMore() {
|
|
|
@@ -217,15 +254,19 @@ export default {
|
|
|
handleSearch() {
|
|
|
this.fetchRecords(true);
|
|
|
},
|
|
|
- verify(id,orderNo) {
|
|
|
+ verify(id) {
|
|
|
+ let title = "确认核销该订单吗?";
|
|
|
+ if(id == -1){
|
|
|
+ title = "一键核销";
|
|
|
+ }
|
|
|
uni.showModal({
|
|
|
title: '提示',
|
|
|
- content: `确认核销订单 ${orderNo} 吗?`,
|
|
|
+ content: title,
|
|
|
success: (res) => {
|
|
|
if (res.confirm) {
|
|
|
doCommitToChang(id).then(res=>{
|
|
|
if(res.code === 0){
|
|
|
- this.fetchRecords(true);
|
|
|
+ this.getReadyData(true);
|
|
|
uni.showToast({ title: '核销成功' });
|
|
|
}else{
|
|
|
uni.showToast({ title: '核销失败' });
|
|
|
@@ -399,4 +440,26 @@ export default {
|
|
|
font-size: 30rpx;
|
|
|
color: #F5F5F5;
|
|
|
}
|
|
|
+
|
|
|
+.fixed-footer {
|
|
|
+ position: fixed;
|
|
|
+ bottom: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 100%;
|
|
|
+ background-color: #f5f6fa;
|
|
|
+ padding: 20rpx 30rpx;
|
|
|
+ padding-bottom: calc(20rpx + constant(safe-area-inset-bottom));
|
|
|
+ padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
|
|
|
+ box-sizing: border-box;
|
|
|
+ z-index: 100;
|
|
|
+}
|
|
|
+.add-btn {
|
|
|
+ background-color: #3c82f8;
|
|
|
+ color: white;
|
|
|
+ border-radius: 50rpx;
|
|
|
+ font-size: 32rpx;
|
|
|
+ height: 90rpx;
|
|
|
+ line-height: 90rpx;
|
|
|
+ &::after { border: none; }
|
|
|
+}
|
|
|
</style>
|