混凝土运输管理微信小程序、替班
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

304 lines
7.0 KiB

<template>
<view class="content">
<navbar title="企业设备" leftClick @leftClick="$utils.navigateBack" />
<view class="mt40">
<view v-for="(item, index) in carList" :key="index" class="re-card-p32">
<view v-if="isEmpty" class="re-empty">
<view>暂无数据</view>
</view>
<view class="flex-sb">
<view class="flex">
<image class="re-from-car" src="/static/icons/icon11.png"></image>
<text>{{ item.name }}</text>
</view>
<view v-if="item.isReviewing" class="re-card-show">
<text style="color:limegreen">系统审核中</text>
</view>
<view v-if="item.isRejected" class="re-card-show">
<text style="color:#F40000">未通过审核</text>
</view>
</view>
<!-- 车辆种类 -->
<view class="flex-sb re-card-select mt20" @click="selectCarType(item)">
<view>种类</view>
<view class="flex" style="color:#9E9E9E">
<text v-if="item.showTypePlaceholder">请选择</text>
<view v-if="item.showTypeValue" style="color:#0d0d0d">{{ item.carType }}</view>
<uv-icon v-if="item.showTypeIcon" name="arrow-right" size="16" color="#999"></uv-icon>
</view>
</view>
<!-- 轴数 -->
<view class="flex-sb re-card-select" @click="selectAxleCount(item)">
<view>轴数</view>
<view class="flex" style="color:#9E9E9E">
<text v-if="item.showAxlePlaceholder">请选择</text>
<view v-if="item.showAxleValue" style="color:#0d0d0d">{{ item.axleCount }}</view>
<uv-icon v-if="item.showAxleIcon" name="arrow-right" size="16" color="#999"></uv-icon>
</view>
</view>
<!-- 上传证件 -->
<view class="flex-sb re-card-select" @click="uploadDocuments(item)">
<view>上传证件</view>
<view v-if="item.showUploadPlaceholder" class="flex" style="color:#9E9E9E">
<text>未上传</text>
<uv-icon name="arrow-right" size="16" color="#999"></uv-icon>
</view>
<view v-if="item.showUploadValue" class="flex" style="color:#0d0d0d">
<text>已上传</text>
<uv-icon name="checkmark" size="16" color="#4cd964"></uv-icon>
</view>
</view>
<!-- 操作按钮 -->
<view class="action-buttons mt20">
<button class="btn-edit" @click="editCar(item)">编辑</button>
<button class="btn-delete" @click="deleteCar(item)">删除</button>
</view>
</view>
<!-- 添加车辆按钮 -->
<view class="add-car-btn" @click="addCar">
<uv-icon name="plus" size="24" color="#007AFF"></uv-icon>
<text>添加车辆</text>
</view>
</view>
</view>
</template>
<script>
import navbar from '@/components/base/navbar.vue'
export default {
components: {
navbar
},
name: 'StaffCars',
data() {
return {
isEmpty: false,
carList: [
{
id: 1,
name: '湘A12345',
isReviewing: true,
isRejected: false,
showTypePlaceholder: false,
showTypeValue: true,
showTypeIcon: true,
carType: '泵车',
showAxlePlaceholder: false,
showAxleValue: true,
showAxleIcon: true,
axleCount: '4轴',
showUploadPlaceholder: false,
showUploadValue: true
},
{
id: 2,
name: '湘A67890',
isReviewing: false,
isRejected: true,
showTypePlaceholder: false,
showTypeValue: true,
showTypeIcon: true,
carType: '搅拌车',
showAxlePlaceholder: false,
showAxleValue: true,
showAxleIcon: true,
axleCount: '3轴',
showUploadPlaceholder: true,
showUploadValue: false
},
{
id: 3,
name: '湘A11111',
isReviewing: false,
isRejected: false,
showTypePlaceholder: true,
showTypeValue: false,
showTypeIcon: true,
carType: '',
showAxlePlaceholder: true,
showAxleValue: false,
showAxleIcon: true,
axleCount: '',
showUploadPlaceholder: true,
showUploadValue: false
}
]
}
},
methods: {
selectCarType(item) {
uni.showActionSheet({
itemList: ['泵车', '搅拌车', '车载泵'],
success: (res) => {
const types = ['泵车', '搅拌车', '车载泵'];
item.carType = types[res.tapIndex];
item.showTypePlaceholder = false;
item.showTypeValue = true;
}
});
},
selectAxleCount(item) {
uni.showActionSheet({
itemList: ['2轴', '3轴', '4轴', '5轴', '6轴'],
success: (res) => {
const axles = ['2轴', '3轴', '4轴', '5轴', '6轴'];
item.axleCount = axles[res.tapIndex];
item.showAxlePlaceholder = false;
item.showAxleValue = true;
}
});
},
uploadDocuments(item) {
uni.chooseImage({
count: 3,
sizeType: ['compressed'],
sourceType: ['camera', 'album'],
success: (res) => {
uni.showToast({
title: '上传成功',
icon: 'success'
});
item.showUploadPlaceholder = false;
item.showUploadValue = true;
}
});
},
editCar(item) {
uni.navigateTo({
url: `/pages_order/staff/car?id=${item.id}&mode=edit`
});
},
deleteCar(item) {
uni.showModal({
title: '确认删除',
content: `确定要删除车辆 ${item.name} 吗?`,
success: (res) => {
if (res.confirm) {
const index = this.carList.findIndex(car => car.id === item.id);
if (index > -1) {
this.carList.splice(index, 1);
uni.showToast({
title: '删除成功',
icon: 'success'
});
}
}
}
});
},
addCar() {
uni.navigateTo({
url: '/pages_order/staff/car?mode=add'
});
}
}
}
</script>
<style scoped lang="scss">
.content {
padding: 20rpx;
min-height: 100vh;
background-color: #f5f5f5;
}
.mt40 {
margin-top: 40rpx;
}
.mt20 {
margin-top: 20rpx;
}
.re-card-p32 {
background-color: #fff;
border-radius: 10rpx;
padding: 32rpx;
margin-bottom: 20rpx;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
}
.re-empty {
text-align: center;
padding: 100rpx 0;
color: #999;
font-size: 28rpx;
}
.flex {
display: flex;
align-items: center;
gap: 10rpx;
}
.flex-sb {
display: flex;
justify-content: space-between;
align-items: center;
}
.re-from-car {
width: 40rpx;
height: 40rpx;
}
.re-card-show {
padding: 8rpx 16rpx;
border-radius: 20rpx;
background-color: #f0f0f0;
font-size: 24rpx;
}
.re-card-select {
padding: 25rpx 0;
border-bottom: 1rpx solid #f0f0f0;
font-size: 28rpx;
&:last-child {
border-bottom: none;
}
}
.action-buttons {
display: flex;
gap: 20rpx;
justify-content: flex-end;
button {
padding: 15rpx 25rpx;
border-radius: 25rpx;
font-size: 26rpx;
border: none;
&.btn-edit {
background-color: #007AFF;
color: #fff;
}
&.btn-delete {
background-color: #ff3b30;
color: #fff;
}
}
}
.add-car-btn {
display: flex;
align-items: center;
justify-content: center;
gap: 10rpx;
background-color: #fff;
border: 2rpx dashed #007AFF;
border-radius: 10rpx;
padding: 60rpx;
margin-top: 20rpx;
color: #007AFF;
font-size: 28rpx;
}
</style>