OfficeApp/subpkg/property/chosseCompany.vue

460 lines
10 KiB
Vue
Raw Normal View History

2023-08-22 16:01:58 +08:00
<template>
2023-08-29 11:11:19 +08:00
<view class="">
2023-09-01 21:40:33 +08:00
<view class="date" v-if="dataList.type !=2">
2023-08-31 10:44:45 +08:00
<!-- 2022年12月12日提出申请 -->
2023-09-02 13:18:15 +08:00
{{dataList.create_time}} 提出申请
2023-09-01 21:40:33 +08:00
2023-08-22 16:01:58 +08:00
</view>
2023-09-01 21:40:33 +08:00
<view class="date" v-else>
<!-- 2022年12月12日提出申请 -->
2023-09-02 13:18:15 +08:00
{{dataList.create_time}} 提出解除申请
2023-09-01 21:40:33 +08:00
</view>
<!-- 公司信息 -->
2023-08-29 11:11:19 +08:00
<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>
2023-09-01 21:40:33 +08:00
<text>{{dataList.company_b_name}}</text>
2023-08-29 11:11:19 +08:00
</view>
2023-09-01 21:40:33 +08:00
<text @click="navTo(`/subpkg/companySign/companySign?id=${dataList.company_b_id}`)">详情 <uni-icons
type="forward" style="margin-left: 10rpx;" color="white"></uni-icons></text>
2023-08-29 11:11:19 +08:00
</view>
<view class="cards_content">
<view class="right">
<view class="is_contract">
<view>
<text>法人姓名 :</text>
2023-09-01 21:40:33 +08:00
<text>{{dataList.company_b_user}}</text>
2023-08-29 11:11:19 +08:00
</view>
<view>
<text style="color: green;" v-if="true">已签约</text>
</view>
2023-08-22 16:01:58 +08:00
</view>
2023-08-29 11:11:19 +08:00
<view class="" @click="copyPhone()">
<text>联系电话 :</text>
2023-09-01 21:40:33 +08:00
<text>{{dataList.company_b_phone}}</text>
2023-08-23 11:35:09 +08:00
</view>
2023-08-31 10:44:45 +08:00
2023-08-22 16:01:58 +08:00
</view>
2023-08-29 11:11:19 +08:00
</view>
</view>
2023-09-01 21:40:33 +08:00
<!-- 车辆列表 -->
2023-09-06 11:36:48 +08:00
<view class="car_info" v-if="dataList.type==1">
2023-09-01 21:40:33 +08:00
<view class="car_type">
<text>自有车辆</text>
</view>
2023-10-18 16:26:54 +08:00
<view class="car_li" v-for="(item,index) in dataList.cars_info">
2023-09-07 18:19:27 +08:00
<view class="" style="display: flex;justify-content: space-between;align-items: center;">
<view class="" style="display: flex;align-items: center;">
2023-10-18 16:26:54 +08:00
<u--image :src="item.pic" width="100rpx" height="100rpx"></u--image>
2023-09-07 18:19:27 +08:00
<view class="" style="margin-left: 10rpx;">
2023-10-18 16:26:54 +08:00
车牌号{{item.license}}
2023-09-07 18:19:27 +08:00
</view>
</view>
<view class="">
<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>
2023-09-01 21:40:33 +08:00
</view>
2023-09-07 18:19:27 +08:00
<!-- <view class="">
车辆图片:
<view style="display: flex;justify-content: space-around;">
</view>
</view> -->
2023-09-01 21:40:33 +08:00
</view>
</view>
2023-09-06 11:36:48 +08:00
<view class="car_info" v-if="dataList.type==0">
2023-08-29 11:11:19 +08:00
<view class="car_type">
2023-09-05 18:09:37 +08:00
<text v-if="true">租赁车辆</text>
2023-08-29 11:11:19 +08:00
</view>
<view class="car_li" v-for="item,index in carList">
2023-08-31 10:44:45 +08:00
车牌号{{item.car_license}}
2023-08-29 11:11:19 +08:00
<view class="" style="float: right;display: flex;">
<text style="margin-right: 10rpx;">租赁车辆</text>
<u-checkbox-group v-model="checked">
2023-09-07 08:59:24 +08:00
<u-checkbox active-color="#0122C7" :name="item.car_id" shape="square" label=""></u-checkbox>
2023-08-29 11:11:19 +08:00
</u-checkbox-group>
2023-08-22 16:01:58 +08:00
</view>
</view>
</view>
2023-09-01 21:40:33 +08:00
<!-- 合同 -->
<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">
2023-09-02 13:18:15 +08:00
<view class="name">解除合同</view>
2023-09-01 21:40:33 +08:00
<view>
2023-09-02 13:18:15 +08:00
<text>{{dataList.create_time}}</text>
2023-09-01 21:40:33 +08:00
</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>
2023-09-04 15:38:48 +08:00
<!-- 车辆信息为空 -->
<u-empty v-if="flag1" text="你还没有车辆哦,快去向平台申请用车吧" icon="../../static/img/empty/data.png"> </u-empty>
2023-09-01 21:40:33 +08:00
<!-- 按钮 -->
2023-08-29 11:11:19 +08:00
<view class="btns">
2023-08-31 10:44:45 +08:00
<!-- 生成合同 -->
2023-09-01 21:40:33 +08:00
<view class="" v-if="dataList.status==-1">
2023-09-04 15:38:48 +08:00
<u-button type="primary" @click="showPop=true" style="margin-bottom: 20rpx;width: 100%;" color="#FF7C32"
text="申请驳回"></u-button>
2023-09-02 13:18:15 +08:00
<u-button :disabled="flag1" type="primary" text="生成合同" @tap="contractFn" color="#0122C7"></u-button>
2023-08-31 10:44:45 +08:00
</view>
<!-- 审核中 -->
2023-09-01 21:40:33 +08:00
<view class="" v-if="dataList.status==0">
2023-09-05 18:09:37 +08:00
<u-button :disabled="true" type="primary" text="合同已上传,等待审核" color="grey"></u-button>
2023-08-31 10:44:45 +08:00
</view>
<!-- 审核通过 -->
2023-09-01 21:40:33 +08:00
<view class="" v-if="dataList.status==1||dataList.status==2">
<!-- <view class="" v-if="true"> -->
2023-08-31 10:44:45 +08:00
<view class="card">
<view class="contract">
<view class="left">
2023-09-01 21:40:33 +08:00
<u--image :showLoading="true" src="../../static/img/contract/pdf.png" width="80px"
height="80px"></u--image>
2023-08-31 10:44:45 +08:00
<view class="text">
2023-09-02 13:18:15 +08:00
<view class="name">{{typeFn( dataList.type) }}
</view>
2023-08-31 10:44:45 +08:00
<view>
2023-10-18 16:26:54 +08:00
<text>{{dataList.update_time}}</text>
2023-08-31 10:44:45 +08:00
</view>
</view>
</view>
2023-09-01 21:40:33 +08:00
<!-- <view class="right" @click="navToContract(dataList.file)"> -->
<view class="right">
2023-08-31 10:44:45 +08:00
<uni-icons type="paperclip" color="#3274F9"></uni-icons>
2023-09-01 21:40:33 +08:00
<view @click="navToContract(dataList.file)">查看</view>
2023-08-31 10:44:45 +08:00
</view>
</view>
</view>
2023-09-02 13:18:15 +08:00
<u-button v-if="dataList.status==1" :disabled="false" type="primary" text="发送合同" @tap="sendFn"
2023-09-01 21:40:33 +08:00
color="#0122C7"></u-button>
2023-09-02 13:18:15 +08:00
<u-button v-else :disabled="times" type="primary" :text="`重新发送${times?times+'s':''}`" @tap="sendAgainFn"
color="#0122C7"></u-button>
2023-08-31 10:44:45 +08:00
</view>
2023-08-29 11:11:19 +08:00
</view>
2023-09-04 15:38:48 +08:00
<!--uview 组件 -->
2023-08-29 11:11:19 +08:00
<view class="">
<u-modal :show="showPop" @close="showPop=false" @confirm="confirm" :closeOnClickOverlay="true"
title="请输入驳回理由">
<view class="slot-content">
<u--textarea v-model="overruleValue" placeholder="请输入内容" class="textarea_cls"></u--textarea>
2023-09-06 14:18:52 +08:00
<view style="color: red;font-size: 20rpx;" v-show="noValue">
驳回理由不能为空
</view>
2023-08-29 11:11:19 +08:00
</view>
</u-modal>
</view>
2023-08-22 16:01:58 +08:00
</view>
</template>
<script>
2023-08-29 11:11:19 +08:00
import {
2023-08-31 10:44:45 +08:00
getAgencyDetailApi,
2023-08-29 11:11:19 +08:00
contractApi,
2023-08-31 10:44:45 +08:00
overruleApi,
2023-09-01 21:40:33 +08:00
sendcontractApi,
sendMsgApi
2023-08-29 11:11:19 +08:00
} from "@/api/property.js"
2023-09-01 21:40:33 +08:00
import {
download_file
} from "@/api/junziqian.js"
2023-08-29 16:45:34 +08:00
import {
Toast
} from "../../libs/uniApi"
2023-08-29 11:11:19 +08:00
export default {
data() {
return {
2023-09-06 14:18:52 +08:00
noValue: false,
2023-09-02 13:18:15 +08:00
flag1: true,
times: 0,
2023-08-31 10:44:45 +08:00
dataList: {},
2023-08-29 11:11:19 +08:00
overruleValue: "",
showPop: false,
checked: [],
2023-09-01 21:40:33 +08:00
carList: [],
flag: true,
lg: false,
2023-08-29 11:11:19 +08:00
}
},
2023-09-01 21:40:33 +08:00
onLoad(options) {
2023-08-31 10:44:45 +08:00
getAgencyDetailApi({
2023-09-01 21:40:33 +08:00
id: options.id
2023-08-31 10:44:45 +08:00
}).then(res => {
// 13043214321
2023-09-01 21:40:33 +08:00
this.dataList = res.data.vehicleContract
this.carList = res.data.vehicleRentCars
2023-09-07 18:19:27 +08:00
this.checked = [this.carList[0]?.car_id] || ''
2023-10-18 16:26:54 +08:00
2023-09-07 18:19:27 +08:00
// if (this.dataList.status == 3) {
// uni.navigateBack()
// }
2023-10-18 16:26:54 +08:00
2023-09-04 15:38:48 +08:00
if (this.carList.length > 0 || this.dataList.cars_info) {
2023-09-02 13:18:15 +08:00
this.flag1 = false
}
// console.log(this.dataList)
2023-08-30 11:28:35 +08:00
})
2023-09-02 13:18:15 +08:00
// console.log(this.dataList.cars_info)
2023-08-30 11:28:35 +08:00
},
2023-08-29 11:11:19 +08:00
methods: {
2023-09-01 21:40:33 +08:00
sendAgainFn() {
2023-09-02 13:18:15 +08:00
let that = this
2023-09-01 21:40:33 +08:00
sendMsgApi({
2023-09-02 13:18:15 +08:00
id: this.dataList.id,
}).then(res => {
Toast("发送成功")
that.times = 10
that.timer()
// that.num = 10
2023-09-01 21:40:33 +08:00
})
},
sendFn() {
2023-09-02 13:18:15 +08:00
let that = this
2023-09-01 21:40:33 +08:00
sendcontractApi({
id: this.dataList.id
2023-09-02 13:18:15 +08:00
}).then(res => {
Toast("操作成功")
that.times = 10
that.timer()
that.dataList.status = 2
2023-09-01 21:40:33 +08:00
})
},
2023-09-02 13:18:15 +08:00
typeFn(status) {
if (status == 0) {
return "租赁合同"
}
if (status == 1) {
2023-10-18 16:26:54 +08:00
return "自有车辆"
2023-09-02 13:18:15 +08:00
}
if (status == 2) {
"解除合同"
}
},
2023-08-29 11:11:19 +08:00
confirm() {
2023-09-06 14:18:52 +08:00
if (!this.overruleValue) {
this.noValue = true
return
}
2023-08-30 11:28:35 +08:00
// console.log(this.overruleValue)
2023-08-31 10:44:45 +08:00
overruleApi({
2023-09-01 21:40:33 +08:00
id: this.dataList.id,
2023-08-31 10:44:45 +08:00
content: this.overruleValue,
}).then(res => {
2023-08-29 16:45:34 +08:00
this.showPop = false
2023-09-06 14:18:52 +08:00
this.noValue = false
2023-09-01 21:40:33 +08:00
Toast("操作成功")
setTimeout(() => {
2023-09-06 14:18:52 +08:00
uni.redirectTo({
url: "/subpkg/property/index"
})
}, 1000)
2023-09-01 21:40:33 +08:00
})
},
timer() {
let that = this
let timers = setInterval(() => {
that.times--
if (that.times <= 0) {
clearInterval(timers)
}
}, 1000)
},
navToContract(contract_no) {
2023-09-02 13:18:15 +08:00
uni.navigateTo({
url: `/subpkg/pdfView/pdfView?url=${contract_no}`
2023-08-29 16:45:34 +08:00
})
2023-09-02 13:18:15 +08:00
2023-08-29 16:45:34 +08:00
},
contractFn() {
2023-09-07 08:59:24 +08:00
2023-08-31 10:44:45 +08:00
contractApi({
2023-09-01 21:40:33 +08:00
id: this.dataList.id,
2023-09-07 09:04:07 +08:00
car_id: this.checked[0] || ""
2023-08-31 10:44:45 +08:00
}).then(res => {
this.navTo('/subpkg/property/success')
2023-08-29 16:45:34 +08:00
})
2023-09-05 18:09:37 +08:00
// this.navTo('/subpkg/property/success')
2023-08-31 10:44:45 +08:00
},
2023-09-02 13:18:15 +08:00
// sendcontractFn() {
// // this.sendFn()
2023-09-06 14:18:52 +08:00
// Toast("操作成功")
2023-09-02 13:18:15 +08:00
// this.times = 10
// this.timer()
// },
2023-08-29 11:11:19 +08:00
navTo(url) {
uni.navigateTo({
url
})
}
}
}
2023-08-22 16:01:58 +08:00
</script>
<style lang="scss" scoped>
2023-08-29 11:11:19 +08:00
.date {
padding: 10rpx 28rpx 0;
}
2023-08-31 10:44:45 +08:00
.card {
2023-09-01 21:40:33 +08:00
background-color: white;
2023-08-31 10:44:45 +08:00
border-radius: 14rpx;
2023-09-01 21:40:33 +08:00
padding: 20rpx;
2023-08-31 10:44:45 +08:00
2023-09-01 21:40:33 +08:00
.contract {
2023-08-31 10:44:45 +08:00
display: flex;
2023-09-01 21:40:33 +08:00
justify-content: space-between;
2023-08-31 10:44:45 +08:00
2023-09-01 21:40:33 +08:00
.left {
display: flex;
align-items: center;
2023-08-31 10:44:45 +08:00
2023-09-01 21:40:33 +08:00
.text {
// background-color: red;
height: 80px;
2023-08-31 10:44:45 +08:00
display: flex;
2023-09-01 21:40:33 +08:00
flex-direction: column;
justify-content: space-around;
margin-left: 15rpx;
2023-08-31 10:44:45 +08:00
}
2023-09-01 21:40:33 +08:00
}
2023-08-31 10:44:45 +08:00
2023-09-01 21:40:33 +08:00
.right {
display: flex;
align-items: center;
2023-08-31 10:44:45 +08:00
}
}
2023-09-01 21:40:33 +08:00
2023-08-31 10:44:45 +08:00
}
2023-09-01 21:40:33 +08:00
2023-08-22 16:01:58 +08:00
.cards {
margin: 28rpx;
width: 694rpx;
background: #ffffff;
border-radius: 30rpx;
overflow: hidden;
.cards_head {
padding: 28rpx;
background-color: $theme-oa-color;
color: white;
display: flex;
justify-content: space-between;
.cards_head_top {
display: flex;
width: 70vw;
}
}
.cards_content {
padding: 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;
.is_contract {
width: 85vw;
display: flex;
justify-content: space-between;
height: 40rpx;
}
view {
margin-bottom: 10rpx;
text:nth-child(2) {
margin-left: 20rpx;
}
}
}
}
.u_avatar {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
2023-08-29 11:11:19 +08:00
.car_info {
padding: 10rpx 28rpx 0;
.car_type {
margin-bottom: 20rpx;
}
.car_li {
background-color: white;
margin-bottom: 17.54rpx;
padding: 20rpx;
border-radius: 10rpx;
}
}
.btns {
position: fixed;
bottom: 5rpx;
width: 100%;
padding: 10rpx 28rpx 0;
}
.textarea_cls {
width: 70vw;
border: 1px solid #DADBDE;
}
2023-08-22 16:01:58 +08:00
</style>