This commit is contained in:
2025-06-19 17:33:18 +08:00
commit f8f31dc4d9
437 changed files with 103080 additions and 0 deletions
@@ -0,0 +1,10 @@
{
"usingComponents": {
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index",
"van-empty": "@vant/weapp/empty/index",
"van-divider": "@vant/weapp/divider/index"
},
"enablePullDownRefresh": true,
"navigationBarTitleText": "待办"
}
@@ -0,0 +1,151 @@
/* pages/backlog/backlogList/backlogList.wxss */
page {
// .container {
width: 100vw;
height: 100vh;
position: relative;
.top {
width: 100%;
background: #ffffff;
position: absolute;
top: 0;
z-index: 10;
.tab-container {
width: 100%;
height: 48px;
display: flex;
overflow: hidden;
.tabs {
width: 100%;
// overflow-x: auto;
}
}
}
>.list {
width: 100%;
height: calc(100vh - 48px);
padding: 8px 0 48px;
box-sizing: border-box;
background: #EFF1F4;
position: absolute;
top: 46px;
// overflow-y: auto;
.scroll-view_H {
height: 100%;
// padding: 0 8px;
box-sizing: border-box;
}
.item {
padding: 12px 10px;
margin: 0 8px 8px;
background: #fff;
border-radius: 8px;
.row:first-child {
margin-bottom: 8px;
}
.row {
color: #2E3A4F;
display: flex;
justify-content: space-between;
align-items: center;
.number-plate {
display: flex;
.status {
padding: 0 4px;
margin: 0 4px;
border-radius: 2px;
color: #FFFFFF;
font-size: 14px;
flex-shrink: 1;
}
.status1 {
background: linear-gradient(90deg, #0D92FF 0%, #38B1FE 100%);
}
.status2 {
background: linear-gradient(270deg, #4CDBAD 0%, #2FCBAB 100%);
}
.status3 {
background: linear-gradient(270deg, #A1A8BB 0%, #838EAA 100%);
}
.val {
font-size: 16px;
font-weight: bold;
flex-shrink: 0;
display: flex;
align-items: center;
}
}
.project-name, .code {
font-size: 14px;
}
.time {
font-size: 14px;
color: #858CA0;
}
.type-list {
display: flex;
.type {
height: 22px;
line-height: 22px;
padding: 0 8px;
margin-left: 5px;
background: #FFF1F0;
border-radius: 4px;
border: 1px solid #FFA39E;
color: #FF4D4F;
font-size: 12px;
}
.color-red {
color: #FF4D4F;
}
}
}
// .item {
// padding: 12px 10px;
// margin-bottom: 8px;
// background: #fff;
// border-radius: 8px;
// .row:first-child {
// margin-bottom: 8px;
// }
// .row {
// color: #2E3A4F;
// display: flex;
// justify-content: space-between;
// align-items: center;
// .project-name {
// font-size: 14px;
// }
// .time {
// font-size: 14px;
// color: #858CA0;
// }
// .type-list {
// display: flex;
// .type {
// height: 22px;
// line-height: 22px;
// padding: 0 8px;
// margin-left: 5px;
// background: #FFF1F0;
// border-radius: 4px;
// border: 1px solid #FFA39E;
// color: #FF4D4F;
// font-size: 12px;
// }
// }
// }
// }
}
.is-last {
padding-bottom: 80px;
}
.no-data {
width: 100%;
height: 100%;
background: #fff;
}
}
// }
}
@@ -0,0 +1,302 @@
// pages/backlog/backlogList/backlogList.ts
import { getAction } from '../../../api/base';
Page({
/**
* 页面的初始数据
*/
data: {
tabList: [] as any,
active: 0,
flowStatus: 2,
current: 1,
recordList: [],
loading: false,
isLast: false
},
getTabList() {
getAction('api/vehicles/backlog/getBacklogCount').then((res: any) => {
if (res.code == 200) {
console.log(res.result);
this.setData({
tabList: res.result
});
console.log(this.data.tabList);
} else {
wx.showToast({
title: res.message,
icon: 'none'
});
}
});
},
getList() {
let parms = {
type: this.data.flowStatus,
pageNo: this.data.current,
pageSize: 10
};
wx.showLoading({
title: '加载中'
});
if (!this.data.loading) {
this.setData({
loading: true
});
}
getAction('api/vehicles/backlog/getBacklogPage', parms)
.then((res: any) => {
wx.hideLoading();
this.setData({
loading: false
});
if (res.code == 200) {
let tmpArr = this.data.recordList.concat(res.result.records);
this.setData({
listTotal: res.result.total,
recordList: tmpArr
});
if (res.result.total == tmpArr.length) {
// tmpArr 目前只是调试流程用
this.setData({
isLast: true
});
} else {
}
} else {
wx.showToast({
title: res.message,
icon: 'none'
});
}
})
.catch((err: any) => {
wx.hideLoading();
wx.showToast({
title: err.message,
icon: 'none'
});
});
},
// 变更tab
tabOnChange(e: any) {
console.log(e);
this.setData({
active: e.detail.index,
flowStatus: this.data.tabList[e.detail.index].type,
recordList: [],
current: 1,
isLast: false
});
this.getList();
},
// 跳转到对应的详情页
toDetailPage(e: any) {
let that = this;
console.log('跳转', e.currentTarget.dataset.inf);
wx.setStorageSync('backlogInf', e.currentTarget.dataset.inf);
let url = '';
switch (e.currentTarget.dataset.inf.type) {
case '1': //出险
url = '../insurance/insurance';
break;
case '2': //违章
url = '../violation/violation';
break;
case '3': //事故
url = '../accident/accident';
break;
case '4': //维修
wx.removeStorageSync('backlogInf');
wx.setStorageSync('selectMaintain', e.currentTarget.dataset.inf);
switch (e.currentTarget.dataset.inf.flowStatus) {
case 2:
url = '../../vehicleMaintenance/maintainSend/maintainSend';
break;
case 3:
url = '../../vehicleMaintenance/maintainSend/maintainSend';
break;
case 4:
url = '../../vehicleMaintenance/maintainCheck/maintainCheck';
break;
case 5:
url = '../../vehicleMaintenance/maintainCheck/maintainCheck';
break;
case 10:
url = '../../vehicleMaintenance/maintainCheck/maintainCheck';
break;
case 6:
url =
'../../vehicleMaintenance/maintainProcedure/maintainProcedure';
break;
case 7:
url =
'../../vehicleMaintenance/maintainProcedure/maintainProcedure';
break;
case 8:
url = '../../vehicleMaintenance/maintainResult/maintainResult';
break;
case 9:
url = '../../vehicleMaintenance/maintainResult/maintainResult';
break;
}
// url = '';
break;
case '5': //保养
wx.removeStorageSync('backlogInf');
url = '';
if (e.currentTarget.dataset.inf.planOrBill == 'plan') {
url = '../../UpkeepPlan/UpkeepPlanInfo/UpkeepPlanInfo';
wx.setStorageSync('info', {
info: e.currentTarget.dataset.inf
});
} else {
wx.setStorageSync('selectMaintain', e.currentTarget.dataset.inf);
switch (e.currentTarget.dataset.inf.flowStatus) {
case 2:
url = '../../UpkeepBill/UpkeepBillSend/UpkeepBillSend';
break;
case 3:
url = '../../UpkeepBill/UpkeepBillSend/UpkeepBillSend';
break;
case 4:
url = '../../UpkeepBill/UpkeepBillCheck/UpkeepBillCheck';
break;
case 5:
url = '../../UpkeepBill/UpkeepBillCheck/UpkeepBillCheck';
break;
case 10:
url = '../../UpkeepBill/UpkeepBillCheck/UpkeepBillCheck';
break;
case 6:
url = '../../UpkeepBill/UpkeepBillProcedure/UpkeepBillProcedure';
break;
case 7:
url = '../../UpkeepBill/UpkeepBillProcedure/UpkeepBillProcedure';
break;
case 8:
url = '../../UpkeepBill/UpkeepBillResult/UpkeepBillResult';
break;
case 9:
url = '../../UpkeepBill/UpkeepBillResult/UpkeepBillResult';
break;
}
}
break;
case '6': //年检
url = '../annualInspection/annualInspection';
break;
case '7': //回访
wx.setStorageSync('customerFollowData', e.currentTarget.dataset.inf);
url =
'../../../packageA/pages/customerFollowDetail/customerFollowDetail';
break;
}
if (url == '') {
wx.showToast({
title: '暂无详情',
icon: 'none'
});
return;
}
wx.navigateTo({
url: url,
events: {
// 编辑过后刷新页面
refresh: function () {
that.refresh();
}
},
fail: e => {
console.log(e);
}
});
},
lower(e: any) {
console.log(e.detail.direction == 'bottom');
if (this.data.isLast) {
wx.showToast({
title: '已经是最后一页',
icon: 'none'
});
return;
}
if (e.detail.direction == 'bottom' && !this.data.loading) {
// this.data.current += 1
this.setData({
loading: true,
current: (this.data.current += 1)
});
this.getList();
}
},
refresh() {
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
this.getTabBar().setData({
selected: 1
});
}
this.setData({
recordList: [],
current: 1,
isLast: false
});
this.getTabList();
this.getList();
},
/**
* 生命周期函数--监听页面加载
*/
onLoad() {},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
this.refresh();
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
getApp().EventChannel = null;
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
this.setData({
recordList: [],
current: 1,
isLast: false
});
this.getTabList();
this.getList();
//停止下拉刷新
wx.stopPullDownRefresh();
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
});
@@ -0,0 +1,75 @@
<!--pages/backlog/backlogList/backlogList.wxml-->
<!-- <view class="container"> -->
<view class="top">
<view class="tab-container">
<view class="tabs">
<van-tabs color="#4381FC" title-active-color="#4381FC" ellipsis="{{false}}" active="{{ active }}" bind:change="tabOnChange">
<van-tab title-style="font-size:16px" wx:for="{{tabList}}" wx:key="index" title="{{item.name + '(' + item.count + ')' }}"></van-tab>
</van-tabs>
</view>
</view>
</view>
<view class="list">
<scroll-view class="scroll-view_H" scroll-y="true" bindscrolltolower="lower" style="width: 100%">
<view class="item" wx:if="{{flowStatus == 4 || flowStatus == 5}}" wx:for="{{recordList}}" wx:key="index" data-inf="{{item}}" catchtap="toDetailPage">
<view class="row">
<view class="code">{{item.orderNo ? item.orderNo : '-'}}</view>
<view class="number-plate">
<view class="status status1" wx:if="{{item.flowStatus == 2 || item.flowStatus == 3 || item.flowStatus == 6}}">{{item.flowStatusName}}</view>
<view class="status status2" wx:if="{{item.flowStatus == 4 || item.flowStatus == 5 || item.flowStatus == 7 || item.flowStatus == 10}}">{{item.flowStatusName}}</view>
<view class="status status3" wx:if="{{item.flowStatus == 8 || item.flowStatus == 9}}">{{item.flowStatusName}}</view>
<view class="val">{{item.plateNumber}}</view>
</view>
</view>
<view class="row">
<view class="project-name">{{item.projectId_dictText}}</view>
<view class="time">{{item.time}}</view>
</view>
</view>
<view class="item" wx:if="{{flowStatus != 4 && flowStatus != 5 && flowStatus != 7}}" wx:for="{{recordList}}" wx:key="index" data-inf="{{item}}" catchtap="toDetailPage">
<view class="row">
<view class="number-plate">
<view class="val">{{item.plateNumber}}</view>
</view>
<view class="project-name">{{item.projectId_dictText}}</view>
</view>
<view class="row">
<view class="time" wx:if="{{item.type == 1}}">出险时间: {{item.time}}</view>
<view class="time" wx:elif="{{item.type == 2}}">违章时间: {{item.time}}</view>
<view class="time" wx:elif="{{item.type == 4}}">事故时间: {{item.time}}</view>
<view class="time" wx:elif="{{item.type == 6}}">年检有效期: {{item.time}}</view>
<view class="time" wx:else>{{item.time ? item.time : '-'}}</view>
<view class="type-list">
<view wx:if="{{item.type == 1}}"></view>
<view class="type" wx:elif="{{item.type == 2}}">{{item.violationAct_dictText}}</view>
<view class="type" wx:elif="{{item.type == 3}}">{{item.natureEstimate_dictText}}</view>
<view class="color-red" wx:elif="{{item.type == 6}}">
{{item.overdueType ? item.overdueType : '已逾期'}}{{(item.overdueDays ? item.overdueDays : item.daysToOverdue)}}天
</view>
<view wx:else>-</view>
</view>
</view>
</view>
<view class="item" wx:if="{{flowStatus == 7}}" wx:for="{{recordList}}" wx:key="index" data-inf="{{item}}" catchtap="toDetailPage">
<view class="row">
<view class="number-plate">
<view class="val">{{item.projectId_dictText}}</view>
</view>
<view class="project-name">{{item.followType}}</view>
</view>
<view class="row">
<view class="time">计划回访时间:{{item.time ? item.time : '-'}}</view>
<view class="type-list">
<view class="type">{{item.followStatus}}</view>
</view>
</view>
</view>
<view class="is-last" wx:if="{{isLast && recordList.length > 0}}">
<van-divider contentPosition="center">已加载完全部数据</van-divider>
</view>
<view class="no-data" wx:if="{{recordList.length == 0}}">
<van-empty description="无数据" />
</view>
</scroll-view>
</view>
<!-- </view> -->