This commit is contained in:
weipengfei 2023-09-07 09:06:45 +08:00
commit edab952d33
4 changed files with 42 additions and 25 deletions

View File

@ -59,15 +59,13 @@
<view class="car_info" v-if="dataList.type==0"> <view class="car_info" v-if="dataList.type==0">
<view class="car_type"> <view class="car_type">
<text v-if="true">租赁车辆</text> <text v-if="true">租赁车辆</text>
<text v-else>自有车辆</text>
</view> </view>
<view class="car_li" v-for="item,index in carList"> <view class="car_li" v-for="item,index in carList">
车牌号{{item.car_license}} 车牌号{{item.car_license}}
<view class="" style="float: right;display: flex;"> <view class="" style="float: right;display: flex;">
<text style="margin-right: 10rpx;">租赁车辆</text> <text style="margin-right: 10rpx;">租赁车辆</text>
<u-checkbox-group v-model="checked"> <u-checkbox-group v-model="checked">
<u-checkbox active-color="#0122C7" :label="id" :name="item" shape="square" <u-checkbox active-color="#0122C7" :name="item.car_id" shape="square" label=""></u-checkbox>
label=""></u-checkbox>
</u-checkbox-group> </u-checkbox-group>
</view> </view>
</view> </view>
@ -142,6 +140,9 @@
title="请输入驳回理由"> title="请输入驳回理由">
<view class="slot-content"> <view class="slot-content">
<u--textarea v-model="overruleValue" placeholder="请输入内容" class="textarea_cls"></u--textarea> <u--textarea v-model="overruleValue" placeholder="请输入内容" class="textarea_cls"></u--textarea>
<view style="color: red;font-size: 20rpx;" v-show="noValue">
驳回理由不能为空
</view>
</view> </view>
</u-modal> </u-modal>
</view> </view>
@ -165,6 +166,7 @@
export default { export default {
data() { data() {
return { return {
noValue: false,
flag1: true, flag1: true,
times: 0, times: 0,
dataList: {}, dataList: {},
@ -183,6 +185,7 @@
// 13043214321 // 13043214321
this.dataList = res.data.vehicleContract this.dataList = res.data.vehicleContract
this.carList = res.data.vehicleRentCars this.carList = res.data.vehicleRentCars
this.checked = [this.carList[0].car_id] || ''
this.dataList.cars_info ? this.dataList.cars_info = JSON.parse(this.dataList.cars_info).license : this.dataList.cars_info ? this.dataList.cars_info = JSON.parse(this.dataList.cars_info).license :
"" ""
if (this.dataList.status == 3) { if (this.dataList.status == 3) {
@ -233,16 +236,23 @@
} }
}, },
confirm() { confirm() {
if (!this.overruleValue) {
this.noValue = true
return
}
// console.log(this.overruleValue) // console.log(this.overruleValue)
overruleApi({ overruleApi({
id: this.dataList.id, id: this.dataList.id,
content: this.overruleValue, content: this.overruleValue,
}).then(res => { }).then(res => {
this.showPop = false this.showPop = false
this.noValue = false
Toast("操作成功") Toast("操作成功")
setTimeout(() => { setTimeout(() => {
uni.navigateBack() uni.redirectTo({
}, 2000) url: "/subpkg/property/index"
})
}, 1000)
}) })
}, },
timer() { timer() {
@ -262,10 +272,10 @@
}, },
contractFn() { contractFn() {
console.log(this.checked)
contractApi({ contractApi({
id: this.dataList.id, id: this.dataList.id,
car_id: this.checked[0]?.car_id ? this.checked[0].car_id : "" car_id: this.checked[0] || ""
}).then(res => { }).then(res => {
this.navTo('/subpkg/property/success') this.navTo('/subpkg/property/success')
}) })

View File

@ -8,22 +8,15 @@
<view class="noCar" v-if='company_type==18'> <view class="noCar" v-if='company_type==18'>
<!-- 申请 --> <!-- 申请 -->
<view class="" v-if="step==-2"> <view class="" v-if="step==-2">
<!-- <view class="">
你还没有所属车辆哦,请向镇公司申请用车或使用自有车辆并绑定系统
</view> -->
<u-empty text="你还没有所属车辆哦,请向镇公司申请用车或使用自有车辆并绑定系统~" icon="../../static/img/empty/data.png"> <u-empty text="你还没有所属车辆哦,请向镇公司申请用车或使用自有车辆并绑定系统~" icon="../../static/img/empty/data.png">
</u-empty> </u-empty>
<view> <view>
<mytn text='申请用车' class="upCar" :position="false" @click="applycarFn"></mytn> <mytn text='申请用车' class="upCar" :position="false" @click="applycarFn"></mytn>
<!-- <u-button @tap="applycarFn" type="primary" style="background-color: #0122C7;border: none;"
class="btn">
申请用车</u-button> -->
</view> </view>
<view class=""> <view class="">
<!-- <u-button @tap="show=true" type="primary" style="background-color: #0122C7;border: none;"
class="btn">
上传自有车辆</u-button> -->
<mytn text='上传自有车辆' @click="show=true"></mytn> <mytn text='上传自有车辆' @click="show=true"></mytn>
</view> </view>
<u-modal :show="show" @close="show=false" :showCancelButton="true" @confirm="upCarFn" <u-modal :show="show" @close="show=false" :showCancelButton="true" @confirm="upCarFn"
@ -210,6 +203,15 @@
:title="`请输入您需要租赁的车辆数量(上限为${datas.can_rent_num})`"> :title="`请输入您需要租赁的车辆数量(上限为${datas.can_rent_num})`">
<view class="slot-content"> <view class="slot-content">
<u--input placeholder="请输入内容" type="number" v-model="newCarNum"></u--input> <u--input placeholder="请输入内容" type="number" v-model="newCarNum"></u--input>
<view style="color: red;font-size: 20rpx;" v-show="novalue">
<view class="" v-if="newCarNum>datas.can_rent_num">
数量超过上限
</view>
<view class="" v-else>
数量不能为空
</view>
</view>
</view> </view>
</u-modal> </u-modal>
<u-modal :show="showpopp" title="提示" @confirm="confirmFn" @close="showpopp=false" <u-modal :show="showpopp" title="提示" @confirm="confirmFn" @close="showpopp=false"
@ -249,6 +251,7 @@
name: "vehicle", name: "vehicle",
data() { data() {
return { return {
novalue: false,
noInfo: false, noInfo: false,
aaa: 0, aaa: 0,
showLoading: true, showLoading: true,
@ -344,8 +347,11 @@
}, },
// //
applycarFn() { applycarFn() {
Toast("操作成功")
this.step = -1
return
upVehicleApi().then(res => { upVehicleApi().then(res => {
Toast(res.msg) Toast("操作成功")
this.step = -1 this.step = -1
}) })
}, },
@ -370,13 +376,16 @@
this.toDetail("/subpkg/property/chosseCompany") this.toDetail("/subpkg/property/chosseCompany")
}, },
confirm() { confirm() {
if (!this.newCarNum) return if (!this.newCarNum || this.newCarNum > this.datas.can_rent_num) {
this.novalue = true
return
}
this.showPop = false this.showPop = false
leaseApi({ leaseApi({
num: Number(this.newCarNum) num: Number(this.newCarNum)
}).then(res => { }).then(res => {
this.newCarNum = "" this.newCarNum = ""
// Toast(res.msg) // Toast("")
this.showpopp = true this.showpopp = true
}) })
}, },

View File

@ -21,12 +21,10 @@
uni.redirectTo({ uni.redirectTo({
url: '/subpkg/property/index' url: '/subpkg/property/index'
}) })
}, 3000) }, 2000)
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.box { .box {

View File

@ -21,8 +21,8 @@ function baseRequestTwo(url, method, data, {
noAuth = false, noAuth = false,
noVerify = false noVerify = false
}) { }) {
let Url = "https://logistics.lihaink.cn", //正式环境 // let Url = "https://logistics.lihaink.cn", //正式环境
// let Url = "https://ceshi-logistics.lihaink.cn", //测试环境 let Url = "https://ceshi-logistics.lihaink.cn", //测试环境
header = HEADER; header = HEADER;
if (!noAuth) { if (!noAuth) {
// 已经未登录了,禁止请求 // 已经未登录了,禁止请求