435 lines
9.4 KiB
Vue
Raw Normal View History

2023-08-22 16:01:58 +08:00
<template>
2023-08-30 11:28:35 +08:00
<view class="">
<!-- 没有测含量 -->
<view class="noCar" v-if='dataList.length==0'>
<!-- 申请 -->
<view class="" v-if="step==1">
2023-08-29 11:11:19 +08:00
<view class="">
2023-08-30 11:28:35 +08:00
你还没有所属车辆哦,请向镇公司申请用车或使用自有车辆并绑定系统
2023-08-29 11:11:19 +08:00
</view>
2023-08-30 11:28:35 +08:00
<view class="" style="margin: 20rpx 0;">
<u-button @tap="applycarFn" type="primary" style="background-color: #0122C7;border: none;"
class="btn">
申请用车</u-button>
2023-08-29 11:11:19 +08:00
</view>
2023-08-30 11:28:35 +08:00
<view class="">
<u-button @tap="show=true" type="primary" style="background-color: #0122C7;border: none;"
class="btn">
上传自有车辆</u-button>
2023-08-29 11:11:19 +08:00
</view>
2023-08-30 11:28:35 +08:00
<u-modal :show="show" @close="show=false" @confirm="upCarFn" :closeOnClickOverlay="true" title="车辆上传">
<view class="slot-content">
<u--input placeholder="请输入您的车牌号" v-model="carLicense"></u--input>
</view>
</u-modal>
2023-08-29 11:11:19 +08:00
</view>
2023-08-30 11:28:35 +08:00
<!-- 等待 -->
<view class="" v-if='step==2'>
<view class="">
您已上传自用车辆,系统正在审核中,请耐心等待
2023-08-29 11:11:19 +08:00
</view>
</view>
2023-08-30 11:28:35 +08:00
</view>
<view v-else>
<!-- <view class="serch">
<u-search placeholder="输入车牌号进行搜索" :show-action="true" bg-color="white" v-model="keywords" @search="serchFn"
@custom="serchFn"></u-search>
</view> -->
<view class="info">
<text>可监管车辆数量 10</text>
<view @click="showPop=true" class="not_leased">
<view class="">
租赁 10
</view>
<view class="triangle-up" v-if="1">
2023-08-29 11:11:19 +08:00
</view>
2023-08-30 11:28:35 +08:00
<view class="message_bottom" v-if="1">
可再租赁车辆:2
2023-08-29 11:11:19 +08:00
</view>
2023-08-30 11:28:35 +08:00
</view>
<text>自有车辆 10</text>
</view>
<!-- 公告栏 -->
<view class="application_tit">
<view class="head" @click="navgo('/subpkg/property/agencyList')">
<text>签约申请</text>
<view style="display: flex;">
<text>更多 </text>
2023-08-29 11:11:19 +08:00
<u-icon name="arrow-right"></u-icon>
</view>
2023-08-30 11:28:35 +08:00
2023-08-29 11:11:19 +08:00
</view>
2023-08-30 11:28:35 +08:00
<view class="content">
<view class="li" @click="navgo('/subpkg/property/chosseCompany')"
v-for="item,index in applicationList.slice(0, 2)">
<view class="date">
<!-- {{item.}} -->
</view>
<view class="text">
<!-- {{item.}} -->
</view>
<view class="detail">
<u-icon name="arrow-right"></u-icon>
</view>
</view>
2023-08-22 16:01:58 +08:00
2023-08-30 11:28:35 +08:00
</view>
2023-08-29 11:11:19 +08:00
</view>
2023-08-30 11:28:35 +08:00
<view v-if="true" class="personnel_list">
<view v-if="dataList.length">
<view class="cards" v-for="item,index in dataList" :key="index"
@click="navgo('/subpkg/property/vehicle_a')">
<view class="cards_head">
<text><!-- {{item.}} --></text>
</view>
<view class="cards_content">
<view class="right">
<!-- 已出租 -->
<view v-if="1">
<view class="li">
<text>使用人: </text>
<text> <!-- {{item.}} --></text>
<view style="float: right;">
<text style="color: green;" v-if="true">自有车辆</text>
<text style="color: orange;" v-else>租赁车辆</text>
</view>
</view>
<view class="li">
<text>联系方式: </text>
<text><!-- {{item.}} --></text>
</view>
<view class="li">
<text>所属公司: </text>
<text> <!-- {{item.}} --> </text>
</view>
<view class="li">
<text>签约时间: </text>
<text> <!-- {{item.}} --> </text>
2023-08-29 11:11:19 +08:00
</view>
</view>
2023-08-30 11:28:35 +08:00
<!-- 未出租 -->
<view class="" v-else>
<view class="li">
<text>车牌号: </text>
<text> <!-- {{item.}} --></text>
<view style="float: right;">
<text style="color: green;" v-if="true">自有车辆</text>
<text style="color: orange;" v-else>租赁车辆</text>
</view>
</view>
<view class="li">
暂未出租快去选择承租对象吧
</view>
2023-08-29 11:11:19 +08:00
</view>
2023-08-22 16:01:58 +08:00
</view>
</view>
2023-08-23 11:35:09 +08:00
</view>
</view>
2023-08-30 11:28:35 +08:00
<view v-if="dataList.length==0&&!isNewCheck">
<view class="empty">
<!-- <view>
当前没有可以签约的的车辆,快去签约新车吧!
</view> -->
<!-- <u-button @click="showPop=true" type="primary" style="background-color: #0122C7;border: none;"
class="btn">
签约新车</u-button> -->
2023-08-22 16:01:58 +08:00
</view>
</view>
2023-08-30 11:28:35 +08:00
<!-- <view style="padding: 0 60rpx;" v-if="isNewCheck">
你已发起租赁{{newCarNum}}两新车的申请,后台正在为您加急处理中,请稍后~~
</view> -->
2023-08-22 16:01:58 +08:00
</view>
2023-08-30 11:28:35 +08:00
<u-modal :show="showPop" @close="showPop=false" @confirm="confirm" :closeOnClickOverlay="true"
:title="`请输入您需要租赁的车辆数量(上限为${dataList[0]})`">
<view class="slot-content">
<u--input placeholder="请输入内容" type="number" v-model="newCarNum"></u--input>
</view>
</u-modal>
<!-- <u-modal @close="show=false" @cancel="show=false" @confirm="relieveFn" :show="show" :showCancelButton="true"
:showConfirmButton='true' :content='content'></u-modal> -->
2023-08-24 18:32:34 +08:00
</view>
2023-08-22 16:01:58 +08:00
</view>
</template>
<script>
2023-08-29 11:11:19 +08:00
import {
2023-08-30 11:28:35 +08:00
getvehicleListApi,
getAgencyListApi,
leaseApi,
upVehicleApi
2023-08-29 11:11:19 +08:00
} from "@/api/property.js"
// import mybtn from "@/components/mybtn/mybtn.vue"
2023-08-23 11:35:09 +08:00
import {
Toast
} from "../../libs/uniApi";
// Toast("请至少选择一辆车")
2023-08-22 16:01:58 +08:00
export default {
components: {
2023-08-29 11:11:19 +08:00
// mybtn
2023-08-22 16:01:58 +08:00
},
name: "vehicle",
data() {
return {
2023-08-30 11:28:35 +08:00
step: 1,
2023-08-29 11:11:19 +08:00
applicationList: [1, 1],
2023-08-29 16:45:34 +08:00
// isNewCheck: true,
2023-08-30 11:28:35 +08:00
show: false,
carLicense: "",
2023-08-24 18:32:34 +08:00
showPop: false,
2023-08-30 11:28:35 +08:00
dataList: [],
2023-08-22 16:01:58 +08:00
tabLists: [{
name: '未出租',
}, {
name: '已出租'
}, ],
curNow: 0,
keywords: "",
2023-08-24 18:32:34 +08:00
newCarNum: "",
2023-08-29 11:11:19 +08:00
newcarTit: "请输入您需要租赁的车辆数量(上限为2)"
2023-08-22 16:01:58 +08:00
};
},
2023-08-29 11:11:19 +08:00
onLoad() {
2023-08-30 11:28:35 +08:00
getvehicleListApi().then(res => {
console.log(res)
2023-08-29 11:11:19 +08:00
// this.getvehicleList = res
})
2023-08-30 11:28:35 +08:00
getAgencyListApi().then(res => {
2023-08-29 11:11:19 +08:00
// this.applicationList=res
})
},
2023-08-22 16:01:58 +08:00
methods: {
2023-08-30 11:28:35 +08:00
applycarFn() {
this.step = 2
},
upCarFn() {
upVehicleApi({
license: this.carLicense
}).then(res => {
this.show = false
})
console.log(this.carLicense)
},
2023-08-22 16:01:58 +08:00
signFn() {
2023-08-29 11:11:19 +08:00
this.toDetail("/subpkg/property/chosseCompany")
2023-08-22 16:01:58 +08:00
},
2023-08-24 18:32:34 +08:00
confirm() {
if (!this.newCarNum) return
2023-08-30 11:28:35 +08:00
leaseApi({
num: Number(this.newCarNum)
}).then(res => {
this.newCarNum = ""
Toast(res.msg)
})
2023-08-24 18:32:34 +08:00
this.showPop = false
2023-08-30 11:28:35 +08:00
2023-08-29 16:45:34 +08:00
// this.isNewCheck = true
2023-08-29 11:11:19 +08:00
2023-08-22 16:01:58 +08:00
2023-08-24 18:32:34 +08:00
},
2023-08-29 11:11:19 +08:00
navgo(url) {
2023-08-22 16:01:58 +08:00
uni.navigateTo({
url
})
},
sectionChange(index) {
this.curNow = index.index;
console.log(this.curNow)
// this.getOrderList()
},
}
}
</script>
<style lang="scss">
.serch {
margin: 28rpx 28rpx 0 28rpx;
}
2023-08-30 11:28:35 +08:00
.noCar {
// background-color: red;
padding: 50rpx;
}
2023-08-29 11:11:19 +08:00
.info {
display: flex;
justify-content: space-around;
margin: 10rpx 0 0 0;
.not_leased {
display: flex;
align-items: center;
// background-color: red;
flex-direction: column;
}
.triangle-up {
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-bottom: 10px solid rgba(0, 0, 0, .5);
}
.message_bottom {
background-color: rgba(0, 0, 0, .5);
color: white;
// transform: translateX();
padding: 20rpx;
border-radius: 30rpx;
}
}
.application_tit {
background-color: white;
padding: 20rpx;
width: 694rpx;
border-radius: 20rpx;
margin: 20rpx auto 0;
.head {
display: flex;
justify-content: space-between;
}
.content {
.li {
margin: 10rpx 0;
display: flex;
justify-content: space-between;
.date {
background-color: #FF7C32;
color: white;
padding: 0 10rpx;
border-radius: 15rpx;
// width: 170rpx;
}
.text {
// background-color: lightyellow;
max-width: 450rpx;
white-space: nowrap;
/* 让文本不换行 */
overflow: hidden;
/* 隐藏溢出的文本 */
text-overflow: ellipsis;
}
.detail {
// background-color: black;
// width: 50rpx;
}
}
}
2023-08-24 18:32:34 +08:00
}
2023-08-29 11:11:19 +08:00
2023-08-22 16:01:58 +08:00
.personnel_list {
padding: 28rpx 0;
margin-bottom: 130rpx;
2023-08-23 11:35:09 +08:00
.empty {
2023-08-24 18:32:34 +08:00
padding-top: 200rpx;
2023-08-23 11:35:09 +08:00
text-align: center;
.btn {
width: 30vw;
margin-top: 10rpx;
2023-08-24 18:32:34 +08:00
margin: 10rpx auto;
2023-08-23 11:35:09 +08:00
}
// height: 80vh;
// background-color: red;
}
2023-08-22 16:01:58 +08:00
.cards {
margin: 0 auto;
margin-bottom: 28rpx;
width: 694rpx;
background: #ffffff;
border-radius: 30rpx;
opacity: 1;
overflow: hidden;
// box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
.cards_head {
padding: 28rpx;
background-color: $theme-oa-color;
color: white;
height: 100rpx;
display: flex;
justify-content: space-between;
}
.cards_content {
padding: 10rpx 28rpx;
display: flex;
justify-content: space-between;
.left {
text-align: center;
// padding: 15rpx 25rpx;
padding-top: 20rpx;
width: 160rpx;
background-color: $theme-oa-color;
color: white;
border-radius: 40rpx;
.cir {
width: 120rpx;
height: 120rpx;
background-color: #ffffff;
margin-left: 25rpx;
border-radius: 120rpx;
position: relative;
}
}
.right {
display: flex;
flex-direction: column;
justify-content: space-between;
.li {
margin: 10rpx 0;
width: 85vw;
.check_box {
// background-color: #ff0000;
// color: red;
}
2023-08-29 11:11:19 +08:00
2023-08-22 16:01:58 +08:00
text:nth-child(1) {
margin-right: 20rpx;
}
}
}
}
}
}
</style>