对接口

This commit is contained in:
THK3121 2023-09-01 21:40:33 +08:00
parent eae3be3381
commit caa99433f1
10 changed files with 517 additions and 219 deletions

View File

@ -14,6 +14,9 @@ export const upVehicleApi = (data) => oahttp.post('/vehicle/rentApply', data)
export const applycarApi = (data) => oahttp.post('/vehicle/rentApply', data)
// 显示轨迹
export const locusApi = (data) => oahttp.post('/vehicle/vehicleTrack', data)
// 当前车辆位置信息
// export const locusApi = (data) => oahttp.post('/vehicle/vehicleTrack', data)
// api / getCarLocal
// 签约列表
export const getAgencyListApi = (data) => oahttp.get('/vehicle/rentApplyList', data)
// 签约公司详情
@ -28,6 +31,13 @@ export const sendcontractApi = (data) => oahttp.post('/vehicle/initiatingRentCar
export const overruleApi = (data) => oahttp.post('/vehicle/rejectRentApply', data)
// 小组公司详情
export const villageCompanyApi = (data) => oahttp.get('/vehicle/villageCompanyIndex', data)
// 重新发送短信
export const sendMsgApi = (data) => oahttp.post('/vehicle/sendSmsAgain', data)
// 解约
export const cancelContractApi = (data) => oahttp.post('/vehicle/cancelContract', data)
// 镇街公司合同列表
export const ContractListApi = (data) => oahttp.get('/vehicle/townCompanyContractList', data)
// 资产详情
// export const getpropertyDetil = (data) => oahttp.get('/lstDetail', data)

View File

@ -562,6 +562,15 @@
"navigationBarTextStyle": "white"
}
}, {
"path": "property/contractList",
"style": {
"navigationBarTitleText": "合同列表",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#0122C7",
"navigationBarTextStyle": "white"
}
}, {
"path": "buyShare/buyShare",
"style": {

View File

@ -12,7 +12,8 @@
<view class="contract_list">
<view class="item">
<view class="personnel_list">
<view class="cards" v-for="(item,index) in list" :key="item.id" @click="navTo('/subpkg/contractDetail/contractDetail?id='+item.id)">
<view class="cards" v-for="(item,index) in list" :key="item.id"
@click="navTo('/subpkg/contractDetail/contractDetail?id='+item.id)">
<view class="cards_head">
<text style="font-size: 32rpx">电子合同</text>
</view>
@ -149,30 +150,30 @@
},
methods: {
navTo(url) {
if(url){
uni.showLoading({
title: '加载中',
mask: true
});
uni.navigateTo({
url: url,
success() {
uni.hideLoading()
}
})
}else Toast('暂未开放')
if (url) {
uni.showLoading({
title: '加载中',
mask: true
});
uni.navigateTo({
url: url,
success() {
uni.hideLoading()
}
})
} else Toast('暂未开放')
},
navToContract (contract_no) {
download_file({
applyNo: contract_no
}).then(res => {
if (res.code != 1) {
Toast(res.msg||'合同未签订')
}
uni.navigateTo({
url: `/subpkg/pdfView/pdfView?url=${res.data.url}`
})
})
navToContract(contract_no) {
download_file({
applyNo: contract_no
}).then(res => {
if (res.code != 1) {
Toast(res.msg || '合同未签订')
}
uni.navigateTo({
url: `/subpkg/pdfView/pdfView?url=${res.data.url}`
})
})
},
initLoadConfig() {
this.loadConfig.page = 1;

View File

@ -12,7 +12,7 @@
</view>
</view>
<view class="" style="margin-top: 20rpx;">
{{item.village_company_name}}提出租赁车辆一辆
{{item.company_b_name}}提出租赁车辆一辆
</view>
</view>
</view>

View File

@ -1,42 +1,62 @@
<template>
<view class="">
<view class="date">
<view class="date" v-if="dataList.type !=2">
<!-- 2022年12月12日提出申请 -->
{{dataList.create_time.slice(0,10)}} 提出申请
</view>
<view class="date" v-else>
<!-- 2022年12月12日提出申请 -->
{{dataList.create_time.slice(0,10)}} 提出解除申请
</view>
<!-- 公司信息 -->
<view class="cards">
<view class="cards_head">
<view class="cards_head_top">
<text><u--image src="../../static/img/company/company.png" width="33.29rpx" height="33.29rpx"
style="margin-right:20rpx"></u--image></text>
<text>{{dataList.village_company_name}}</text>
<text>{{dataList.company_b_name}}</text>
</view>
<text @click="navTo('/subpkg/companySign/companySign?id=')">详情 <uni-icons type="forward"
style="margin-left: 10rpx;" color="white"></uni-icons></text>
<text @click="navTo(`/subpkg/companySign/companySign?id=${dataList.company_b_id}`)">详情 <uni-icons
type="forward" style="margin-left: 10rpx;" color="white"></uni-icons></text>
</view>
<view class="cards_content">
<view class="right">
<view class="is_contract">
<view>
<text>法人姓名 :</text>
<text>{{dataList.village_company_user}}</text>
<text>{{dataList.company_b_user}}</text>
</view>
<view>
<text style="color: green;" v-if="true">已签约</text>
<!-- <text style="color: red;" v-else>未签约</text> -->
</view>
</view>
<view class="" @click="copyPhone()">
<text>联系电话 :</text>
<text>{{dataList.village_company_phone}}</text>
<text>{{dataList.company_b_phone}}</text>
</view>
</view>
</view>
</view>
<view class="car_info">
<!-- 车辆列表 -->
<view class="car_info" v-if="dataList.cars_info">
<view class="car_type">
<text>自有车辆</text>
</view>
<view class="car_li">
车牌号{{dataList.cars_info}}
<view class="" style="float: right;display: flex;">
<text style="margin-right: 10rpx;">自有车辆</text>
<u-radio-group v-model="dataList.cars_info">
<u-radio active-color="#0122C7" shape="square" :name="dataList.cars_info" label=""></u-radio>
</u-radio-group>
</view>
</view>
</view>
<view class="car_info" v-if="carList.length">
<view class="car_type">
<text v-if="true">空闲车辆</text>
<text v-else>自有车辆</text>
@ -53,42 +73,75 @@
</view>
</view>
<!-- 合同 -->
<view class="card" v-if="dataList.type==2">
<view class="contract">
<view class="left">
<u--image :showLoading="true" src="../../static/img/contract/pdf.png" width="80px"
height="80px"></u--image>
<view class="text">
<view class="name">租赁合同</view>
<view>
<text>{{'2023-03-03'}}</text>
</view>
</view>
</view>
<!-- <view class="right" @click="navToContract(dataList.file)"> -->
<view class="right">
<uni-icons type="paperclip" color="#3274F9"></uni-icons>
<view @click="navToContract(dataList.old_file)">查看</view>
</view>
</view>
</view>
{{dataList.status}}
<!-- 按钮 -->
<view class="btns">
<!-- 生成合同 -->
<view class="" v-if="1">
<view class="" v-if="dataList.status==-1">
<u-button :disabled="false" type="primary" @click="showPop=true"
style="margin-bottom: 20rpx;width: 100%;" color="#FF7C32" text="申请驳回"></u-button>
<u-button :disabled="false" type="primary" text="生成合同" @tap="contractFn" color="#0122C7"></u-button>
<u-button :disabled="carList.length<=0 &&!dataList.cars_info.length" type="primary" text="生成合同"
@tap="contractFn" color="#0122C7"></u-button>
</view>
<!-- 审核中 -->
<view class="" v-if="0">
<view class="" v-if="dataList.status==0">
<u-button :disabled="true" type="primary" text="合同已上传,等待审核" @tap="contractFn" color="grey"></u-button>
</view>
<!-- 审核通过 -->
<view class="" v-if="0">
<view class="" v-if="dataList.status==1||dataList.status==2">
<!-- <view class="" v-if="true"> -->
<view class="card">
<view class="contract">
<view class="left">
<image class="contract_img" src="../../static/img/contract/pdf.png"></image>
<u--image :showLoading="true" src="../../static/img/contract/pdf.png" width="80px"
height="80px"></u--image>
<view class="text">
<view class="name">入股合同</view>
<view class="name">{{ dataList.type!=2? "《租赁合同》":"解除合同" }} </view>
<view>
<text>{{'2023-03-03'}}</text>
</view>
</view>
</view>
<view class="right" @click="navToContract('fdsf')">
<!-- <view class="right" @click="navToContract(dataList.file)"> -->
<view class="right">
<uni-icons type="paperclip" color="#3274F9"></uni-icons>
<view>查看</view>
<view @click="navToContract(dataList.file)">查看</view>
</view>
</view>
</view>
<u-button :disabled="false" type="primary" text="发送合同" @tap="sendcontractFn" color="#0122C7"></u-button>
<u-button v-if="flag" :disabled="false" type="primary" text="发送合同" @tap="sendcontractFn"
color="#0122C7"></u-button>
<!-- <u-button v-if="flag" :disabled="false" type="primary" text="发送合同" @tap="sendMsgFn"
color="#0122C7"></u-button> -->
<u-button v-else :disabled="false" type="primary" :text="`重新发送${times}s`" @tap="sendMsgFn"
color="grey"></u-button>
</view>
</view>
<!--uview 组件 -->
<view class="">
<u-modal :show="showPop" @close="showPop=false" @confirm="confirm" :closeOnClickOverlay="true"
title="请输入驳回理由">
@ -105,57 +158,108 @@
getAgencyDetailApi,
contractApi,
overruleApi,
sendcontractApi
sendcontractApi,
sendMsgApi
} from "@/api/property.js"
import {
download_file
} from "@/api/junziqian.js"
import {
Toast
} from "../../libs/uniApi"
export default {
data() {
return {
times: 5,
dataList: {},
overruleValue: "",
showPop: false,
checked: [],
carList: [1, 2]
carList: [],
flag: true,
lg: false,
}
},
onLoad() {
console.log(this.$route.query)
onLoad(options) {
// console.log(this.$route.query)
// console.log(6565)
getAgencyDetailApi({
id: this.$route.query.id
id: options.id
}).then(res => {
// 13043214321
this.dataList = res.data.apply
this.carList = res.data.cars
this.dataList = res.data.vehicleContract
this.carList = res.data.vehicleRentCars
this.dataList.cars_info = JSON.parse(this.dataList.cars_info).license
if (this.dataList.status == 3) {
uni.navigateBack()
}
})
},
methods: {
sendAgainFn() {
sendMsgApi({
id: this.dataList.id
})
},
sendFn() {
sendcontractApi({
id: this.dataList.id
})
},
confirm() {
// console.log(this.overruleValue)
overruleApi({
apply_id: this.dataList.id,
id: this.dataList.id,
content: this.overruleValue,
}).then(res => {
Toast("操作成功")
this.showPop = false
Toast("操作成功")
setTimeout(() => {
uni.navigateBack()
}, 2000)
})
},
timer() {
let that = this
let timers = setInterval(() => {
that.times--
if (that.times <= 0) {
this.flag = true
clearInterval(timers)
}
}, 1000)
},
navToContract(contract_no) {
download_file({
applyNo: contract_no
}).then(res => {
if (res.code != 1) {
Toast(res.msg || '合同未签订')
}
uni.navigateTo({
url: `/subpkg/pdfView/pdfView?url=${res.data.url}`
})
})
},
contractFn() {
console.log(this.checked)
contractApi({
apply_id: this.dataList.id,
car_id: this.checked[0].car_id
id: this.dataList.id,
car_id: this.checked[0]?.car_id ? this.checked[0].car_id : ""
}).then(res => {
this.navTo('/subpkg/property/success')
})
this.navTo('/subpkg/property/success')
},
sendcontractFn() {
// sendcontractApi({
// id:
// })
this.lg ? this.sendAgainFn() : this.sendFn()
Toast("操作成功")
this.flag = false
this.times = 10
this.timer()
this.lg = true
},
navTo(url) {
uni.navigateTo({
@ -173,78 +277,39 @@
}
.card {
margin: 28rpx;
width: 694rpx;
background-color: #fff;
background-color: white;
border-radius: 14rpx;
padding: 20rpx;
.c_title {
color: #0022C7;
font-size: 32rpx;
font-weight: 500;
padding: 28rpx;
}
.c_body {
margin: 28rpx;
padding-bottom: 28rpx;
.contract {
display: flex;
border-bottom: 1px solid #F3F4F8;
justify-content: space-between;
&:last-child {
border-bottom: none;
}
.left {
display: flex;
align-items: center;
.icon {
width: 77rpx;
height: 77rpx;
flex-shrink: 0;
margin-right: 12rpx;
}
.body_text {
flex: 1;
font-size: 25rpx;
.b_title {
font-size: 32rpx;
color: #333;
font-weight: 500;
}
.b_text {
.text {
// background-color: red;
height: 80px;
display: flex;
justify-content: space-between;
padding: 16rpx 0;
font-size: 28rpx;
.b_avatar {
width: 52rpx;
height: 52rpx;
margin-right: 8rpx;
}
&_left {
display: flex;
align-items: center;
}
&_right {
color: #F02828;
display: flex;
align-items: center;
font-size: 35rpx;
}
flex-direction: column;
justify-content: space-around;
margin-left: 15rpx;
}
}
.b_time {
color: #666666;
}
.right {
display: flex;
align-items: center;
}
}
}
.cards {
margin: 28rpx;
width: 694rpx;

View File

@ -0,0 +1,90 @@
<template>
<view class="">
<view class="card" v-for="item,index in datasList " :key="index">
<view class="contract">
<view class="left">
<u--image :showLoading="true" src="../../static/img/contract/pdf.png" width="80px"
height="80px"></u--image>
<view class="text">
<view class="name">租赁合同</view>
<view>
<text>{{item.create_time}}</text>
</view>
</view>
</view>
<!-- <view class="right" @click="navToContract(dataList.file)"> -->
<view class="right" @click="showContractFn(item.file)">
<uni-icons type="paperclip" color="#3274F9"></uni-icons>
<view>查看</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {
ContractListApi
} from "@/api/property.js"
export default {
data() {
return {
datasList: [1, 2, 3],
}
},
onLoad() {
// return
ContractListApi().then(res => {
this.datasList = res.data
})
},
methods: {
showContractFn(url) {
uni.navigateTo({
url: `/subpkg/pdfView/pdfView?url=${url}`
})
}
}
}
</script>
<style lang="scss" scoped>
.card {
background-color: white;
border-radius: 14rpx;
padding: 20rpx;
margin: 20rpx;
.contract {
display: flex;
justify-content: space-between;
.left {
display: flex;
align-items: center;
.text {
// background-color: red;
height: 80px;
display: flex;
flex-direction: column;
justify-content: space-around;
margin-left: 15rpx;
}
}
.right {
display: flex;
align-items: center;
}
}
}
</style>

View File

@ -1,6 +1,6 @@
<template>
<view class="" style="position: relative;">
<view v-if='true'>
<view class="">
<view v-if='showLoading'>
<u-loading-page :loading="showLoading"></u-loading-page>
</view>
<view class="" v-else>
@ -28,8 +28,9 @@
</view>
</u-modal>
</view>
<!-- 等待 -->
<view class="" v-if='step==-1'>
<view class="" v-if='[-1,0,1,2].includes(step)'>
<!-- 上传自有车辆 -->
<view v-if="0">
<view class="loading">
@ -39,19 +40,23 @@
</view>
<!-- 申请用车 -->
<view v-else>
<view class="loading">
<view class="loading" v-if="datas.type !=2">
<span>你已提交用车申请后台正在加快处理中请耐心等待哦</span>
<span class="dots">...</span>
</view>
<view class="loading" v-else>
<span>你已提交解除申请</span>
<span class="dots">...</span>
</view>
</view>
</view>
<!-- 审核结束 -->
<view class="" v-if="step==4">
<view class="">
你的申请于2022年12月12日被驳回
你的申请于{{datas.update_time}}被驳回
</view>
<view class="">
驳回理由:xxxxxxxxxx
驳回理由: {{datas.reject_message}}
</view>
<view class="">
请修改相应内容重新提交哦
@ -75,6 +80,20 @@
</u-modal>
</view>
</view>
<!-- 车辆到期 -->
<!-- 申请 -->
<view class="" v-if="0">
<view class="">
你的车辆已到期,请重新签约
</view>
<view class="" style="margin: 20rpx 0;">
<u-button @tap="applycarFn" type="primary" style="background-color: #0122C7;border: none;"
class="btn">
申请用车</u-button>
</view>
</view>
</view>
<!-- 镇街公司 -->
<view v-if='company_type==16'>
@ -82,7 +101,7 @@
<text>可监管车辆数量 {{datas.monitor_num}}</text>
<view @click="showPop=true" class="not_leased">
<view class="">
租赁 {{datas.rent_num}}
租赁 {{datas.rent_num}}<text v-if="datas.apply_num">(待审核:{{datas.apply_num}})</text>
</view>
<view class="triangle-up" v-if="datas.can_rent_num">
</view>
@ -90,17 +109,17 @@
可再租赁车辆:{{datas.can_rent_num}}
</view>
</view>
<text>自有车辆 {{datas.self_num}}</text>
<text v-if="datas.self_num">自有车辆 {{datas.self_num}}</text>
</view>
<!-- 公告栏 -->
<view class="application_tit">
<view class="application_tit" v-if="applicationList.length">
<!-- <view class="application_tit" v-if="1"> -->
<view class="head" @click="navgo('/subpkg/property/agencyList')">
<text>签约申请</text>
<view style="display: flex;">
<view style="display: flex;" v-if="applicationList.length>3">
<text>更多 </text>
<u-icon name="arrow-right"></u-icon>
</view>
</view>
<view class="content">
<view class="li" @click="navgo(`/subpkg/property/chosseCompany?id=${item.id}`)"
@ -109,7 +128,7 @@
{{item.create_time.slice(0, 10)}}
</view>
<view class="text">
{{item.village_company_name}}提出租赁车辆一台
{{item.company_b_name}}提出租赁车辆一台
</view>
<view class="detail">
<u-icon name="arrow-right"></u-icon>
@ -120,18 +139,18 @@
</view>
<view class="personnel_list">
<view>
<view class="cards" v-for="item,index in dataList" :key="index"
@click="navgo(`/subpkg/property/vehicle_a?id=${item.car_id}`)">
<view class="cards" v-for="item,index in dataList" :key="index">
<view class="cards_head">
<text>{{item.car_license}}</text>
</view>
<view class="cards_content">
<view class="right">
<!-- 已出租 -->
<view v-if="item.status==1">
<view v-if="item.status==2"
@click="navgo(`/subpkg/property/vehicle_a?id=${item.car_id}`)">
<view class="li">
<text>使用人: </text>
<text> {{item.rent_company.master_name}}</text>
<text> {{item.rent_user.user_name}}</text>
<view style="float: right;">
<text style="color: green;" v-if="item.type==1">自有车辆</text>
<text style="color: orange;" v-else>租赁车辆</text>
@ -139,18 +158,16 @@
</view>
<view class="li">
<text>联系方式: </text>
<text>{{item.rent_company.master_phone}}</text>
<text>{{item.rent_user.user_phone}}</text>
</view>
<view class="li">
<text>所属公司: </text>
<text> {{item.rent_company.company_name}} </text>
<text> {{item.rent_user.company_name}} </text>
</view>
<view class="li">
<text>签约时间: </text>
<text> {{item.rent_time}} </text>
</view>
</view>
<!-- 未出租 -->
<view class="" v-else>
@ -162,15 +179,20 @@
<text style="color: orange;" v-else>租赁车辆</text>
</view>
</view>
<view class="li">
暂未出租快去选择承租对象吧
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view style="text-align: center;" v-if="!dataList.length">
<u-empty v-if="!datas.monitor_num" text="你还没有可监管的车辆哦~" icon="../../static/img/empty/data.png">
</u-empty>
<u-empty v-else text="你还没有车辆哦,快去向平台申请用车吧" icon="../../static/img/empty/data.png"> </u-empty>
<!-- 你还没有车辆哦快去向平台申请用车吧 -->
</view>
<u-modal :show="showPop" @close="showPop=false" @confirm="confirm" :closeOnClickOverlay="true"
:title="`请输入您需要租赁的车辆数量(上限为${datas.can_rent_num})`">
<view class="slot-content">
@ -178,8 +200,9 @@
</view>
</u-modal>
</view>
</view>
<mytn text='合同列表' v-if="datas.rent_num" @click="navgo('/subpkg/property/contractList')"></mytn>
</view>
</template>
@ -198,10 +221,11 @@
import {
Toast
} from "../../libs/uniApi";
import mytn from "@/components/mybtn/mybtn.vue"
// Toast("")
export default {
components: {
// mybtn
mytn
},
name: "vehicle",
data() {
@ -217,11 +241,13 @@
datas: {},
dataList: [],
newCarNum: "",
newcarTit: ""
newcarTit: "",
};
},
onLoad() {
let type = (JSON.parse(Cache.get("USER_INFO")).company.company_type)
this.company_type = type
@ -229,13 +255,21 @@
if (type == 18) {
// getvehicleDetailApi().then(res => {})
villageCompanyApi().then(res => {
if (!res.data?.id) {
this.showLoading = false
this.step = 999
return
}
this.showLoading = false
this.step = res.data.status || 999
console.log(res.data.cars_info.id)
this.datas = res.data
this.step = res.data.status
switch (this.step) {
case 3:
uni.navigateTo({
url: `/subpkg/property/vehicle_a?type=2`
uni.redirectTo({
url: `/subpkg/property/vehicle_a?id=${res.data.cars_info.id}`
})
// this.step =
break;
@ -250,9 +284,10 @@
else {
getvehicleListApi().then(res => {
this.datas = res.data
res.data.apply.length >= 2 ? this.applicationList = res.data.apply : this.applicationList = res
.data.apply.slice(0, 2)
this.applicationList = res.data.apply
// this.applicationList = res.data.apply
this.dataList = res.data.car_list
this.showLoading = false
})
@ -282,15 +317,15 @@
applycarFn() {
upVehicleApi().then(res => {
Toast(res.msg)
this.step = 2
})
this.step = 2
},
//
upCarFn() {
upVehicleApi({
license: this.carLicense
}).then(res => {
this.show = false
// this.show = false
this.step = 2
})
// upVehicleApi({
@ -299,7 +334,8 @@
// }).then(res => {
// this.show = false
// })
console.log(this.carLicense)
this.show = false
},
signFn() {
this.toDetail("/subpkg/property/chosseCompany")
@ -353,8 +389,10 @@
}
.noCar {
padding: 50rpx;
padding: 100rpx;
margin-top: 30vh;
word-wrap: break-word;
overflow-wrap: break-word;
// position: absolute;
// width: 80vw;
// height: auto;

View File

@ -12,13 +12,16 @@
</view>
</view>
</view>
</template>
<script>
export default {
onLoad() {
uni.redirectTo({
url: '/subpkg/property/index'
})
}
}
</script>
<style lang="scss" scoped>

View File

@ -1,7 +1,7 @@
<template>
<view>
<view class="content">
<view :class="allMap?'map1':'map2'" style="position: relative;">
<view :class="allMap?'map1':'map2'" style="position: relative;" v-if="showMap">
<map :class="mapClass" id="map" :enable-zoom="true" :polyline="polyline" :markers='markers'
:scale="scale" style="width:100%;height: 100%;" :latitude="markers[0].latitude"
:enable-scroll="true" :longitude="markers[0].longitude" @tap="allMap=!allMap">
@ -20,11 +20,11 @@
<view class="cards_head">
<text>{{datas.car_license}}</text>
</view>
<view class="cards_content">
<view class="cards_content" v-if="datas.company">
<view class="right">
<view class="li">
<view class="li" style="display: flex;justify-content: space-between;">
<text>行驶总里程: {{datas.mileage}}</text>
<text v-if="datas.type" style="color: green;">自有车辆</text>
</view>
<view class="li">
<text>承租公司: </text>
@ -32,11 +32,11 @@
</view>
<view class="li">
<text>负责人: </text>
<text>{{datas.company.master_name}} </text>
<text>{{datas.company.user_name}} </text>
</view>
<view class="li">
<text>联系方式: </text>
<text> {{datas.company.master_phone}} </text>
<text> {{datas.company.user_phone}} </text>
</view>
<view class="li">
<text>所属区域: </text>
@ -46,18 +46,49 @@
<text>签约时间: </text>
<text>{{datas.rent_time}} </text>
</view>
<view class="li">
<view class="li" v-if="datas.type">
<text>到期时间: </text>
<text> {{datas.rent_time}} </text>
</view>
</view>
</view>
<u-button v-if="datas.type" type="primary" class='poline_btn' color="#FF7C32"
@tap="cancelContractFn" text="解除合同"></u-button>
</view>
</view>
</view>
<!-- 合同 -->
<!-- {{datas.contract}} -->
<view class="card">
<view class="contract">
<view class="left">
<u--image :showLoading="true" src="../../static/img/contract/pdf.png" width="80px"
height="80px"></u--image>
<view class="text">
<view class="name">租赁合同</view>
<view>
<text>{{ datas.contract.create_time}}</text>
</view>
</view>
</view>
<!-- <view class="right" @click="navToContract(dataList.file)"> -->
<view class="right" @click="showContractFn( datas.contract.file)">
<uni-icons type="paperclip" color="#3274F9"></uni-icons>
<view>查看</view>
</view>
</view>
</view>
</view>
<u-calendar @close='showDate=false' :minDate="minDate" :maxDate="maxDate" color="#0122C7" :show="showDate"
@confirm="dateFn"></u-calendar>
<web-view style="height: 100vh;" :src="pdfUrl" v-if="showPDF"></web-view>
<!-- u_view组件 -->
<view class="">
<u-calendar @close='showDate=false' :minDate="minDate" :maxDate="maxDate" color="#0122C7" :show="showDate"
@confirm="dateFn"></u-calendar>
</view>
</view>
</template>
<script>
@ -65,24 +96,23 @@
import {
getvehicleDetailApi,
locusApi,
villageCompanyApi
villageCompanyApi,
cancelContractApi
} from "@/api/property.js"
import {
Toast
} from "../../libs/uniApi";
const d = new Date()
const year = d.getFullYear()
let month = d.getMonth() + 1
month = month < 10 ? `0${month}` : month
const date = d.getDate()
export default {
components: {
mybtn
},
data() {
return {
minDate: `${year}-${month}-${date -30}`,
maxDate: `${year}-${month}-${date }`,
showMap: true,
pdfUrl: "",
showPDF: false,
minDate: '',
maxDate: '',
allMap: false,
showDate: false,
showPop: false,
@ -100,59 +130,87 @@
}
},
onLoad(options) {
if (this.$route.query.type) {
villageCompanyApi().then(res => {
this.datas = res.data
})
return
}
// console.log(this.$route.query.id)
// if (this.$route.query.type) {
// villageCompanyApi().then(res => {
// this.datas = res.data
// })
// return
// }
// console.log(this.$route.query.id)
getvehicleDetailApi({
car_id: this.$route.query.id
// car_id: this.$route.query.id
car_id: options.id
}).then(res => {
this.datas = res.data
console.log()
})
this.minDateFn()
// console.log(date - 7)
},
methods: {
showContractFn(url) {
uni.navigateTo({
url: `/subpkg/pdfView/pdfView?url=${url}`
})
},
cancelContractFn() {
cancelContractApi({
car_id: this.datas.car_id
}).then(res => {
Toast("解除成功")
setTimeout(() => {
uni.navigateBack()
}, 2000)
})
},
minDateFn() {
const today = new Date();
const sevenDaysAgo = new Date(today.getTime() - 7 * 24 * 60 * 60 * 1000);
const nowDate = new Date()
const year = sevenDaysAgo.getFullYear();
const month = String(sevenDaysAgo.getMonth() + 1).padStart(2, '0');
const day = String(sevenDaysAgo.getDate()).padStart(2, '0');
this.minDate = `${year}-${month}-${day}`
this.maxDate = `${nowDate.getFullYear()}-${nowDate.getMonth() + 1}-${nowDate.getDate()}`
},
dateFn(e) {
// console.log(e)
this.queryData = e[0]
this.showDate = false
},
showPloyline() {
console.log(this.queryData)
return
// this.queryData
locusApi({
// car_id: 7,
// start_time: `${this.queryData} 00:00:00`,
// end_time: `${this.queryData} 23:59:59`,
car_id: 7,
end_time: '2023-08-29 23:59:59',
start_time: '2023-08-29 00:00:00',
}).then(res => {
console.log(res)
})
let points = [{
latitude: 28.916722,
longitude: 105.443274,
},
{
latitude: 28.916762,
latitude: 28.936762,
longitude: 105.443132,
},
]
locusApi({
car_id: 7,
end_time: `${this.queryData} 23:59:59`,
start_time: `${this.queryData} 00:00:00`,
}).then(res => {
console.log(res.data)
this.markers[0].latitude = res.data[0].latitude
this.markers[0].longitude = res.data[0].longitude
this.polyline = [{
points: res.data,
color: "#0091ff",
dottedLine: true,
width: 10,
}]
})
// locusApi().then(res => {
// points=res
// })
this.polyline = [{
points: points,
color: "#0091ff",
dottedLine: true,
width: 30,
}]
// console.log(this.polyline)
},
},
onPullDownRefresh() {
@ -199,12 +257,13 @@
margin-left: 20rpx;
background-color: $theme-oa-color;
border: none;
/* color: black; */
}
}
.personnel_list {
padding: 28rpx 0;
margin-bottom: 130rpx;
.empty {
padding-top: 200rpx;
@ -249,7 +308,7 @@
.left {
text-align: center;
// padding: 15rpx 25rpx;
padding-top: 20rpx;
width: 160rpx;
@ -276,20 +335,13 @@
margin: 10rpx 0;
width: 85vw;
.check_box {
// background-color: #ff0000;
// color: red;
}
// background-color: red;
text:nth-child(1) {
margin-right: 20rpx;
}
}
}
}
}
}
@ -312,8 +364,40 @@
}
.map2 {
height: 30vh;
height: 20vh;
border-radius: 2vw;
overflow: hidden;
}
.card {
background-color: white;
border-radius: 14rpx;
padding: 20rpx;
.contract {
display: flex;
justify-content: space-between;
.left {
display: flex;
align-items: center;
.text {
// background-color: red;
height: 80px;
display: flex;
flex-direction: column;
justify-content: space-around;
margin-left: 15rpx;
}
}
.right {
display: flex;
align-items: center;
}
}
}
</style>

View File

@ -51,10 +51,8 @@ function baseRequestTwo(url, method, data, {
url: Url + '/api' + url,
method: method || 'GET',
header: {
...header,
...{
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
}
...header
},
data: method != 'GET' ? data || {} : {},
params: method == 'GET' ? data : {},