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,13 @@
{
"usingComponents": {
"van-picker": "@vant/weapp/picker/index",
"van-popup": "@vant/weapp/popup/index",
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index",
"van-empty": "@vant/weapp/empty/index",
"van-divider": "@vant/weapp/divider/index",
"van-search": "@vant/weapp/search/index"
},
"enablePullDownRefresh": true,
"navigationBarTitleText": "采购交车验收"
}
@@ -0,0 +1,238 @@
/* pages/handoverVehicle/handoverVehicleRecord/handoverVehicleRecord.wxss */
.container {
height: 100vh;
background: #EFF1F4;
overflow: hidden;
position: relative;
.van-tabs {
height: 100%;
.van-tabs__content {
height: calc(100% - 44px);
}
}
.search-container {
padding: 10px 8px;
border-top: 1px solid #DBDBDB;
background: #ffffff;
.row {
margin-bottom: 8px;
display: flex;
justify-content: space-between;
align-items: center;
>.project-select {
width: calc((100% - 6px) / 3);
height: 36px;
padding: 8px 10px;
box-sizing: border-box;
border-radius: 4px;
border: 1px solid #E6EAF2;
display: flex;
align-items: center;
picker {
width: 100%;
position: relative;
.picker {
width: 100%;
height: 38px;
// padding-left: 14px;
box-sizing: border-box;
// border: 1px solid #E6EAF2;
border-radius: 4px;
font-size: 14px;
display: flex;
// justify-content: space-between;
align-items: center;
}
.picker::after {
content: '';
width: 0;
height: 0;
border-top: 6px solid #636B83;
border-right: 6px solid transparent;
border-bottom: 6px solid transparent;
border-left: 6px solid transparent;
position: absolute;
top: 50%;
right: 14px;
transform: translateY(-2px);
}
}
&.selectItem {
// width: 100%;
justify-content: space-between;
.val {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 14px;
}
.placeholder {
color: #949CB5;
font-size: 14px;
white-space: nowrap;
}
}
.arrow {
width: 0;
height: 0;
border-left: 13rpx solid transparent;
border-right: 13rpx solid transparent;
border-top: 15rpx solid #636B83;
margin-left: 18rpx;
}
}
.line {
width: 10px;
height: 1px;
background: #949CB5;
}
}
}
.list-content {
.list {
// height: calc(100vh - 44px - 65px - 88px);
height: calc(100vh - 44px - 65px);
padding: 8px 0;
box-sizing: border-box;
// overflow-y: auto;
.scroll-view_H {
height: 100%;
// padding: 0 8px;
box-sizing: border-box;
}
.item {
padding: 12px 10px;
margin: 0 8px 8px;
background: #FFFFFF;
border-radius: 8px;
// box-shadow: 0 0 4px 0 rgba(0,0,0,.4);
.row {
margin-bottom: 4px;
color: #2E3A4F;
font-size: 28rpx;
display: flex;
align-items: center;
justify-content: space-between;
.title {
font-size: 30rpx;
font-weight: bold;
}
.time {
color: #858CA0;
}
.val {
display: flex;
align-items: center;
.type {
width: 104rpx;
height: 32rpx;
padding: 4rpx;
margin-left: 16rpx;
line-height: 32rpx;
background: linear-gradient(270deg, #4CDBAD 0%, #2FCBAB 100%);
border-radius: 2px;
color: #fff;
text-align: center;
}
.type-g {
background: linear-gradient(270deg, #A1A8BB 0%, #838EAA 100%);
}
.type-b {
background: #4381FC;
}
.type-bb {
background: #FFFFFF;
border-radius: 2px;
border: 1px solid #4F88FC;
color: #4381FC;
}
}
.status {
width: 104rpx;
color: #2E3A4F;
font-weight: bold;
text-align: center;
}
.status1 {
width: 104rpx;
color: #4381FC;
font-weight: bold;
text-align: center;
}
}
}
}
}
.nodata {
text-align: center;
margin: 60px;
font-size: 26px;
}
.bottom {
width: 100%;
padding: 16px 12px 30px;
background: #fff;
box-sizing: border-box;
border-radius: 8px 8px 0 0;
box-shadow: 0px -2px 12px 0px rgba(0, 0, 0, 0.2);
position: absolute;
bottom: 0;
left: 0;
.btn-box {
width: 100%;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
.btn {
width: 100%;
height: 40px;
line-height: 40px;
border-radius: 8px;
background: linear-gradient(90deg, #3B7CFC 0%, #548BFC 100%);
color: #fff;
font-size: 30rpx;
font-weight: bold;
text-align: center;
}
}
}
}
.searchBox {
position: absolute;
width: 100%;
left: 0;
top: 80rpx;
z-index: 63;
}
@@ -0,0 +1,404 @@
// pages/handoverVehicle/handoverVehicleRecord/handoverVehicleRecord.ts
import { getAction } from '../../../api/base';
const dayjs = require('dayjs');
Page({
/**
* 页面的初始数据
*/
data: {
tabActive: 0,
current: 1,
isLast: false,
loading: false,
projectOptions: [
{
text: '全部',
value: ''
}
],
filterProjectOptions: [
{
text: '全部',
value: ''
}
],
projectSearchVal: '',
selectProjectIndex: 0,
selectProject: {} as any,
vehicleTypeOptions: [
{
text: '全部',
value: ''
}
],
vehicleTypeIndex: 0,
vehicleType: {} as any,
checkStatusOptions: [
{
text: '全部',
value: ''
}
],
checkStatusIndex: 0,
checkStatus: {} as any,
receiveStatusOptions: [
{
text: '全部',
value: ''
},
{
text: '未交车',
value: '0'
},
{
text: '未收车',
value: '0.5'
},
{
text: '已收车',
value: '1'
}
],
receiveStatusIndex: 0,
receiveStatus: {} as any,
projectShow: false,
vehicleTypeShow: false,
checkStatusShow: false,
receiveStatusShow: false,
list1: [],
list2: [],
list3: []
},
tabOnClick(event: any) {
console.log(event.detail.name);
// 采购
if (event.detail.name === 0) this.getProjectOptions(4);
// 租赁
else if (event.detail.name === 1) this.getProjectOptions(1);
// 看情况要不要重置查询条件
this.setData({
current: 1,
isLast: false,
list1: [],
list2: [],
list3: [],
tabActive: event.detail.name,
receiveStatusIndex: 0,
receiveStatus: {},
checkStatusIndex: 0,
checkStatus: {},
selectProjectIndex: 0,
selectProject: {},
vehicleTypeIndex: 0,
vehicleType: {}
});
// 查询
this.getList();
},
getProjectOptions(type: number) {
// 改成合同的接口其他不动
getAction('api/contract/list', { contractType: type }).then((res: any) => {
if (res.code == 200) {
res.result.unshift({
id: '',
name: '全部'
});
let arr = [] as any;
res.result.forEach((item: any) => {
arr.push({
text: item.name,
value: item.id
});
});
this.setData({
projectOptions: arr,
filterProjectOptions: arr,
selectProjectIndex: 0,
projectSearchVal: ''
// selectProject: res.result[0]
});
} else {
wx.showToast({
title: res.message,
icon: 'none'
});
}
});
},
getDictOptions(dictCode: string) {
getAction('api/sys/dict/getDictItems/' + dictCode).then((res: any) => {
if (res.code == 200) {
if (dictCode == 'vehicle_type') {
this.setData({
vehicleTypeOptions: this.data.vehicleTypeOptions.concat(res.result),
vehicleTypeIndex: 0
// vehicleType: res.result[0]
});
} else {
this.setData({
checkStatusOptions: this.data.checkStatusOptions.concat(res.result),
checkStatusIndex: 0
// checkStatus: res.result[0]
});
}
} else {
wx.showToast({
title: res.message,
icon: 'none'
});
}
});
},
getList() {
console.log(this.data);
let parms = {
checkType: this.data.tabActive + 1,
contractId: this.data.selectProject.value,
templateId: '',
vehicleType: this.data.vehicleType.value,
checkStatus: this.data.checkStatus.value, // 验收结果(1合格,0不合格)
receiveStatus: this.data.receiveStatus.value, // 验收结果(1合格,0不合格)
pageNo: this.data.current,
pageSize: 10
};
wx.showLoading({
title: '加载中'
});
if (!this.data.loading) {
this.setData({
loading: true
});
}
getAction('api/vehicleCheck/page', parms).then((res: any) => {
wx.hideLoading();
this.setData({
loading: false
});
if (res.code == 200) {
let data: any = { ...this.data };
// data['list' + (this.data.tabActive + 1)] = res.result;
data['list' + (this.data.tabActive + 1)] = data[
'list' + (this.data.tabActive + 1)
].concat(res.result.records);
console.log(data);
this.setData(data);
if (
data['list' + (this.data.tabActive + 1)].length == res.result.total
) {
this.setData({
isLast: true
});
}
} else {
wx.showToast({
title: res.message,
icon: 'none'
});
}
});
},
pickerChange(event: any) {
//下拉框切换是否展示
let fieldName: any = event.currentTarget.dataset.fieldname;
let data: any = { ...this.data };
data[fieldName] = true;
this.setData(data);
},
hidePicker() {
this.setData({
projectShow: false,
vehicleTypeShow: false,
checkStatusShow: false,
receiveStatusShow: false
});
},
pickerConfirm(event: any) {
console.log(event);
//下拉框点击确认
let { fieldname } = event.currentTarget.dataset;
let detail = event.detail;
let data: any = { ...this.data };
data[fieldname] = detail.value;
data[fieldname + 'Index'] = detail.index;
// 初始化列表
data.current = 1;
data.isLast = false;
data.list1 = [];
data.list2 = [];
data.list3 = [];
this.setData(data);
this.hidePicker();
this.getList();
},
toDetail(e: any) {
let that = this;
if (this.data.tabActive == 0) {
wx.navigateTo({
url: '../procurementDelivery/procurementDelivery',
success: function (res) {
// 通过eventChannel向被打开页面传送数据
res.eventChannel.emit('eventName', {
...e.currentTarget.dataset.inf
});
},
fail: e => {
console.log(e);
}
});
} else if (this.data.tabActive == 1) {
wx.navigateTo({
url: '../rentalDelivery/rentalDelivery',
success: function (res) {
// 通过eventChannel向被打开页面传送数据
res.eventChannel.emit('eventName', {
...e.currentTarget.dataset.inf
});
},
fail: e => {
console.log(e);
}
});
} else {
wx.navigateTo({
url: '../rentalRetrieve/rentalRetrieve',
success: function (res) {
// 通过eventChannel向被打开页面传送数据
res.eventChannel.emit('eventName', {
...e.currentTarget.dataset.inf
});
},
fail: e => {
console.log(e);
}
});
}
},
eventReportAdd() {
// let that = this;
let url = '';
if (this.data.tabActive == 0) {
url = '../procurementDeliveryEdit/procurementDeliveryEdit';
} else if (this.data.tabActive == 1) {
url = '../rentalDeliveryEdit/rentalDeliveryEdit';
} else {
}
wx.navigateTo({
url: url,
success: function (res) {
// 通过eventChannel向被打开页面传送数据
res.eventChannel.emit('eventName', {
isAdd: true
});
},
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();
}
},
filterProject(event: any) {
console.log(123, event.detail);
let list = [] as any;
this.data.projectOptions.forEach((item: any) => {
if (item.text.toLowerCase().indexOf(event.detail.toLowerCase()) >= 0) {
list.push(item);
}
});
this.setData({
filterProjectOptions: list,
projectSearchVal: event.detail
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad() {},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
this.getProjectOptions(4);
this.getDictOptions('vehicle_type');
this.getDictOptions('check_status');
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.setData({
current: 1,
isLast: false,
list1: [],
list2: [],
list3: []
});
this.getList();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
this.setData({
selectProject: {},
vehicleType: {},
checkStatus: {}, // 验收结果(1合格,0不合格)
receiveStatusIndex: 0,
receiveStatus: {}, // 状态
checkStatusIndex: 0,
vehicleTypeIndex: 0,
selectProjectIndex: 0,
list1: [],
list2: [],
list3: [],
current: 1,
isLast: false
});
this.getList();
// 手动控制回弹
wx.stopPullDownRefresh();
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
});
@@ -0,0 +1,189 @@
<!--pages/handoverVehicle/handoverVehicleRecord/handoverVehicleRecord.wxml-->
<view class="container">
<van-tabs color="#4381FC" title-active-color="#4381FC" bind:click="tabOnClick">
<van-tab title="采购交车验收">
<view class="search-container">
<view class="row">
<view class="project-select selectItem" data-fieldName="projectShow" catch:tap="pickerChange">
<view class="val" wx:if="{{selectProjectIndex > 0}}">{{selectProject.text}}</view>
<view class="placeholder" wx:else>合同</view>
<view class="arrow"></view>
</view>
<view class="project-select selectItem" data-fieldName="vehicleTypeShow" catch:tap="pickerChange">
<view class="val" wx:if="{{vehicleTypeIndex > 0}}">{{vehicleType.text}}</view>
<view class="placeholder" wx:else>车辆种类</view>
<view class="arrow"></view>
</view>
<view class="project-select selectItem" data-fieldName="checkStatusShow" catch:tap="pickerChange">
<view class="val" wx:if="{{checkStatusIndex > 0}}">{{checkStatus.text}}</view>
<view class="placeholder" wx:else>验收结果</view>
<view class="arrow"></view>
</view>
</view>
</view>
<view class="list-content">
<view class="list">
<scroll-view class="scroll-view_H" scroll-y="true" bindscrolltolower="lower" style="width: 100%">
<view class="item" wx:for="{{list1}}" wx:key="index" data-inf="{{item}}" catchtap="toDetail">
<view class="row">
<!-- <view class="title">{{item.vehicleType_dictText ? item.vehicleType_dictText : '/'}}</view> -->
<view class="val">{{item.checkTime ? item.checkTime : '/'}}</view>
<view class="status1" wx:if="{{item.status == 0}}">未提交</view>
<view class="status" wx:else>已提交</view>
</view>
<view class="row">
<view class="val" style="font-weight: bold;">
车辆数:{{item.vehicleList.length ? item.vehicleList.length : '0'}}
</view>
<view class="val">
<view class="type" wx:if="{{item.checkStatus == 1}}">{{item.checkStatus_dictText}}</view>
<view class="type type-g" wx:else="">{{item.checkStatus_dictText}}</view>
</view>
</view>
</view>
<view class="is-last" wx:if="{{isLast && list1.length > 0}}">
<van-divider contentPosition="center">已加载完全部数据</van-divider>
</view>
<view class="no-data" wx:if="{{list1.length == 0}}">
<van-empty description="无数据" />
</view>
</scroll-view>
</view>
</view>
<!-- <view class="bottom">
<view class="btn-box">
<view class="btn" catch:tap="eventReportAdd">新增验收</view>
</view>
</view> -->
</van-tab>
<van-tab title="租赁交车收车验收">
<view class="search-container">
<view class="row">
<view class="project-select selectItem" data-fieldName="projectShow" catch:tap="pickerChange">
<view class="val" wx:if="{{selectProjectIndex > 0}}">{{selectProject.text}}</view>
<view class="placeholder" wx:else>合同</view>
<view class="arrow"></view>
</view>
<view class="project-select selectItem" data-fieldName="vehicleTypeShow" catch:tap="pickerChange">
<view class="val" wx:if="{{vehicleTypeIndex > 0}}">{{vehicleType.text}}</view>
<view class="placeholder" wx:else>车辆种类</view>
<view class="arrow"></view>
</view>
<view class="project-select selectItem" data-fieldName="receiveStatusShow" catch:tap="pickerChange">
<view class="val" wx:if="{{receiveStatusIndex > 0}}">{{receiveStatus.text}}</view>
<view class="placeholder" wx:else>状态</view>
<view class="arrow"></view>
</view>
</view>
</view>
<view class="list-content">
<view class="list">
<scroll-view class="scroll-view_H" scroll-y="true" bindscrolltolower="lower" style="width: 100%">
<view class="item" wx:for="{{list2}}" wx:key="index" data-inf="{{item}}" catchtap="toDetail">
<view class="row">
<view class="val">{{item.checkTime ? item.checkTime : '/'}}</view>
<view class="val">
{{item.projectId_dictText ? item.projectId_dictText : '/'}}
</view>
</view>
<view class="row">
<view class="title">
车辆数:{{item.vehicleList.length ? item.vehicleList.length : '0'}}
</view>
<view class="val">
{{item.vehicleType_dictText ? item.vehicleType_dictText : '/'}}
<view class="type type-b" wx:if="{{item.receiveStatus == 1}}">{{item.receiveStatus_dictText}}</view>
<view class="type type-bb" wx:elif="{{item.receiveStatus == 0.5}}">{{item.receiveStatus_dictText}}</view>
<view class="type" wx:else="">{{item.receiveStatus_dictText}}</view>
</view>
</view>
</view>
<view class="is-last" wx:if="{{isLast && list2.length > 0}}">
<van-divider contentPosition="center">已加载完全部数据</van-divider>
</view>
<view class="no-data" wx:if="{{list2.length == 0}}">
<van-empty description="无数据" />
</view>
</scroll-view>
</view>
</view>
<!-- <view class="bottom">
<view class="btn-box">
<view class="btn" catch:tap="eventReportAdd">新增验收</view>
</view>
</view> -->
</van-tab>
<!-- <van-tab title="租赁收车验收">
<view class="search-container">
<view class="row">
<view class="project-select selectItem" data-fieldName="projectShow" catch:tap="pickerChange">
<view class="val" wx:if="{{selectProjectIndex > 0}}">{{selectProject.text}}</view>
<view class="placeholder" wx:else>合同</view>
<view class="arrow"></view>
</view>
<view class="project-select selectItem" data-fieldName="vehicleTypeShow" catch:tap="pickerChange">
<view class="val" wx:if="{{vehicleTypeIndex > 0}}">{{vehicleType.text}}</view>
<view class="placeholder" wx:else>车辆种类</view>
<view class="arrow"></view>
</view>
<view class="project-select selectItem" data-fieldName="checkStatusShow" catch:tap="pickerChange">
<view class="val" wx:if="{{checkStatusIndex > 0}}">{{checkStatus.text}}</view>
<view class="placeholder" wx:else>验收结果</view>
<view class="arrow"></view>
</view>
</view>
</view>
<view class="list-content">
<view class="list">
<scroll-view class="scroll-view_H" scroll-y="true" bindscrolltolower="lower" style="width: 100%">
<view class="item" wx:for="{{list3}}" wx:key="index" data-inf="{{item}}" catchtap="toDetail">
<view class="row">
<view class="title">{{item.vehicleType_dictText ? item.vehicleType_dictText : '/'}}</view>
<view class="time">{{item.checkTime ? item.checkTime : '/'}}</view>
</view>
<view class="row">
<view class="val">{{item.projectId_dictText ? item.projectId_dictText : '/'}}</view>
<view class="val">
车辆数:{{item.vehicleList.length ? item.vehicleList.length : '0'}}
<view class="type" wx:if="{{item.checkStatus == 1}}">{{item.checkStatus_dictText}}</view>
<view class="type type-g" wx:else="">{{item.checkStatus_dictText}}</view>
</view>
</view>
</view>
<view class="is-last" wx:if="{{isLast && list3.length > 0}}">
<van-divider contentPosition="center">已加载完全部数据</van-divider>
</view>
<view class="no-data" wx:if="{{list3.length == 0}}">
<van-empty description="无数据" />
</view>
</scroll-view>
</view>
</view>
<view class="bottom">
<view class="btn-box">
<view class="btn" catch:tap="eventReportAdd">新增验收</view>
</view>
</view>
</van-tab> -->
</van-tabs>
<van-popup show="{{projectShow}}" position="bottom" bind:close="hidePicker">
<view class="searchBox">
<van-search value="{{ projectSearchVal }}" placeholder="请输入合同" bind:search="filterProject" />
</view>
<van-picker default-index="{{selectProjectIndex}}" data-fieldname="selectProject" show-toolbar columns="{{filterProjectOptions}}" bind:confirm="pickerConfirm" bind:cancel="hidePicker">
</van-picker>
</van-popup>
<van-popup show="{{vehicleTypeShow}}" position="bottom" bind:close="hidePicker">
<van-picker default-index="{{vehicleTypeIndex}}" data-fieldname="vehicleType" show-toolbar columns="{{vehicleTypeOptions}}" bind:confirm="pickerConfirm" bind:cancel="hidePicker">
</van-picker>
</van-popup>
<van-popup show="{{checkStatusShow}}" position="bottom" bind:close="hidePicker">
<van-picker default-index="{{checkStatusIndex}}" data-fieldname="checkStatus" show-toolbar columns="{{checkStatusOptions}}" bind:confirm="pickerConfirm" bind:cancel="hidePicker">
</van-picker>
</van-popup>
<van-popup show="{{receiveStatusShow}}" position="bottom" bind:close="hidePicker">
<van-picker default-index="{{receiveStatusIndex}}" data-fieldname="receiveStatus" show-toolbar columns="{{receiveStatusOptions}}" bind:confirm="pickerConfirm" bind:cancel="hidePicker">
</van-picker>
</van-popup>
</view>