页面修改

This commit is contained in:
THK3121 2023-09-07 18:19:27 +08:00
parent 4171abc1fe
commit a3f460f02a
5 changed files with 182 additions and 48 deletions

View File

@ -38,6 +38,8 @@ export const sendMsgApi = (data) => oahttp.post('/vehicle/sendSmsAgain', data)
export const cancelContractApi = (data) => oahttp.post('/vehicle/cancelContract', data) export const cancelContractApi = (data) => oahttp.post('/vehicle/cancelContract', data)
// 镇街公司合同列表 // 镇街公司合同列表
export const ContractListApi = (data) => oahttp.get('/vehicle/townCompanyContractList', data) export const ContractListApi = (data) => oahttp.get('/vehicle/townCompanyContractList', data)
// 图片上传
export const upLoadImage = (data) => oahttp.post('/upload/image', data)
// 资产详情 // 资产详情
// export const getpropertyDetil = (data) => oahttp.get('/lstDetail', data) // export const getpropertyDetil = (data) => oahttp.get('/lstDetail', data)

View File

@ -43,7 +43,8 @@
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" label="身份证号" required prop="id_card" borderBottom> <u-form-item labelWidth="auto" label="身份证号" required prop="id_card" borderBottom>
<u--input v-model="formData.id_card" placeholder="请输入身份证号" @input="c_idcard" type="idcard"></u--input> <u--input v-model="formData.id_card" placeholder="请输入身份证号" @input="c_idcard"
type="idcard"></u--input>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" label="是否为小队长" required prop="is_captain" borderBottom> <u-form-item labelWidth="auto" label="是否为小队长" required prop="is_captain" borderBottom>
<u-radio-group v-model="formData.is_captain" style="margin: 16rpx;"> <u-radio-group v-model="formData.is_captain" style="margin: 16rpx;">
@ -286,7 +287,8 @@
</u-upload> </u-upload>
</u-form-item> --> </u-form-item> -->
</u--form> </u--form>
<button @click="$u.throttle(addAcountNum, 2000)" type="primary" class="btn" style="margin: 28rpx;">创建</button> <button @click="$u.throttle(addAcountNum, 2000)" type="primary" class="btn"
style="margin: 28rpx;">创建</button>
</view> </view>
</view> </view>
</template> </template>
@ -300,7 +302,9 @@
} from "@/api/oaUser.js" } from "@/api/oaUser.js"
import districtSelector from "@/components/districtSelector/districtSelector.vue" // import districtSelector from "@/components/districtSelector/districtSelector.vue" //
import districtSelectorTow from "@/components/districtSelector/districtSelectorTow.vue" // import districtSelectorTow from "@/components/districtSelector/districtSelectorTow.vue" //
import { Toast } from "../../libs/uniApi" import {
Toast
} from "../../libs/uniApi"
export default { export default {
components: { components: {
districtSelector, districtSelector,
@ -399,11 +403,11 @@ import { Toast } from "../../libs/uniApi"
}, },
onShow() {}, onShow() {},
methods: { methods: {
c_idcard(e){ c_idcard(e) {
this.$nextTick(()=>{ this.$nextTick(() => {
this.formData.id_card = e.replace(/[^0-9X]/g, '') this.formData.id_card = e.replace(/[^0-9X]/g, '')
}) })
}, },
// //
async afterReadAvatar(event) { async afterReadAvatar(event) {
upLoadImage({ upLoadImage({
@ -428,10 +432,11 @@ import { Toast } from "../../libs/uniApi"
}, },
// //
addAcountNum() { addAcountNum() {
if(!this.formData.avatar)return Toast('头像未上传'); if (!this.formData.avatar) return Toast('头像未上传');
let flag = this.$refs.districtSelectorRef.validate(); let flag = this.$refs.districtSelectorRef.validate();
if(!this.formData.qualification.id_card||!this.formData.qualification.id_card_b)return Toast('身份证未上传'); if (!this.formData.qualification.id_card || !this.formData.qualification.id_card_b) return Toast('身份证未上传');
if(!this.formData.qualification.bank_account||!this.formData.qualification.bank_account_b)return Toast('银行卡未上传'); if (!this.formData.qualification.bank_account || !this.formData.qualification.bank_account_b) return Toast(
'银行卡未上传');
this.$refs.uForm.validate().then(async (e) => { this.$refs.uForm.validate().then(async (e) => {
if (e && flag) { if (e && flag) {
uni.showLoading() uni.showLoading()
@ -530,6 +535,9 @@ import { Toast } from "../../libs/uniApi"
color: transparent; color: transparent;
} }
} }
} }
.title { .title {

View File

@ -47,13 +47,29 @@
<text>自有车辆</text> <text>自有车辆</text>
</view> </view>
<view class="car_li"> <view class="car_li">
车牌号{{dataList.cars_info}} <view class="" style="display: flex;justify-content: space-between;align-items: center;">
<view class="" style="float: right;display: flex;"> <view class="" style="display: flex;align-items: center;">
<text style="margin-right: 10rpx;">自有车辆</text> <u--image :src="dataList.cars_info.pic" width="100rpx" height="100rpx"></u--image>
<u-radio-group v-model="dataList.cars_info"> <view class="" style="margin-left: 10rpx;">
<u-radio active-color="#0122C7" shape="square" :name="dataList.cars_info" label=""></u-radio> 车牌号1111111
</u-radio-group> </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>
</view> </view>
<!-- <view class="">
车辆图片:
<view style="display: flex;justify-content: space-around;">
</view>
</view> -->
</view> </view>
</view> </view>
<view class="car_info" v-if="dataList.type==0"> <view class="car_info" v-if="dataList.type==0">
@ -185,14 +201,13 @@
// 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.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 = JSON.parse(this.dataList.cars_info) || ""
"" // if (this.dataList.status == 3) {
if (this.dataList.status == 3) { // uni.navigateBack()
uni.navigateBack() // }
} console.log(this.dataList.cars_info.pic)
if (this.carList.length > 0 || this.dataList.cars_info) { if (this.carList.length > 0 || this.dataList.cars_info) {
console.log(this.dataList.cars_info)
this.flag1 = false this.flag1 = false
} }
// console.log(this.dataList) // console.log(this.dataList)

View File

@ -19,12 +19,49 @@
<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"
:closeOnClickOverlay="true" @cancel="show=false" title="车辆上传"> :closeOnClickOverlay="true" @cancel="show=false" title="车辆上传">
<view class="slot-content"> <view class="slot-content">
<u--input placeholder="请输入车牌号" v-model="carLicense"></u--input> <view class="">
<view style="display: flex;align-items: center;">
<text>车牌号</text> <u--input placeholder="请输入车牌号" v-model="carLicense"></u--input>
</view>
<view style="color: red;font-size: 20rpx;" v-if="noInfo">
车牌号不能为空
</view>
</view>
<view class="">
<view style="display: flex;align-items: center;">
<text>车辆图片</text>
<view class="">
<view class="" v-if="imgUrl">
<!-- {{formData.avatar}} -->
<image :src="imgUrl" alt=""
style="width:150rpx;height:150rpx;margin-left: 30rpx;">
</image>
</view>
<view class="uplode" v-else>
<u-icon name="plus-circle-fill" color="#0022C7" size="28"></u-icon>
上传头像
<view class="up" style="opacity: 0;">
<u-upload :fileList="imgUrl?[{url:imgUrl}]:[]"
@afterRead="afterReadAvatar" :maxCount="1">
</u-upload>
</view>
</view>
</view>
</view>
<view style="color: red;font-size: 20rpx;" v-if="noInfo">
请上传车辆图片
</view>
</view>
</view> </view>
</u-modal> </u-modal>
</view> </view>
<!-- 等待 --> <!-- 等待 -->
@ -43,8 +80,8 @@
</view> </view>
</view> </view>
<!-- 申请用车 --> <!-- 申请用车 -->
<view v-else> <view v-if="datas.type ==0">
<view class="loading" v-if="datas.type ==0"> <view class="loading">
<span>你已提交用车申请后台正在加快处理中请耐心等待哦</span> <span>你已提交用车申请后台正在加快处理中请耐心等待哦</span>
<span class="dots">...</span> <span class="dots">...</span>
</view> </view>
@ -74,15 +111,46 @@
<mytn text='申请用车' :position="false" class="upCar" @click="applycarFn"></mytn> <mytn text='申请用车' :position="false" class="upCar" @click="applycarFn"></mytn>
</view> </view>
<u-modal :show="show" @close="show=false" @confirm="upCarFn" :closeOnClickOverlay="true" <u-modal :show="show" @close="show=false" :showCancelButton="true" @confirm="upCarFn"
title="车辆上传"> :closeOnClickOverlay="true" @cancel="show=false" title="车辆上传">
<view class="slot-content"> <view class="slot-content">
<u--input placeholder="请输入您的车牌号" v-model="carLicense"></u--input> <view class="">
<view style="color: red;font-size: 20rpx;" v-if="noInfo"> <view style="display: flex;align-items: center;">
车牌号不能为空 <text>车牌号</text> <u--input placeholder="请输入车牌号" v-model="carLicense"></u--input>
</view>
<view style="color: red;font-size: 20rpx;" v-if="noInfo">
车牌号不能为空
</view>
</view>
<view class="">
<view style="display: flex;align-items: center;">
<text>车辆图片</text>
<view class="">
<view class="" v-if="imgUrl">
<!-- {{formData.avatar}} -->
<image :src="imgUrl" alt=""
style="width:150rpx;height:150rpx;margin-left: 30rpx;">
</image>
</view>
<view class="uplode" v-else>
<u-icon name="plus-circle-fill" color="#0022C7" size="28"></u-icon>
上传头像
<view class="up" style="opacity: 0;">
<u-upload :fileList="imgUrl?[{url:imgUrl}]:[]"
@afterRead="afterReadAvatar" :maxCount="1">
</u-upload>
</view>
</view>
</view>
</view>
<view style="color: red;font-size: 20rpx;" v-if="noInfo">
请上传车辆图片
</view>
</view> </view>
</view> </view>
</u-modal> </u-modal>
</view> </view>
</view> </view>
@ -235,8 +303,12 @@
upVehicleApi, upVehicleApi,
getAgencyDetailApi, getAgencyDetailApi,
getvehicleDetailApi, getvehicleDetailApi,
villageCompanyApi villageCompanyApi,
} from "@/api/property.js" } from "@/api/property.js"
import {
upLoadImage
} from "@/api/file.js"
import Cache from '@/utils/cache'; import Cache from '@/utils/cache';
// import mybtn from "@/components/mybtn/mybtn.vue" // import mybtn from "@/components/mybtn/mybtn.vue"
import { import {
@ -261,6 +333,7 @@
applicationList: [1], applicationList: [1],
show: false, show: false,
carLicense: "", carLicense: "",
imgUrl: "",
showPop: false, showPop: false,
datas: {}, datas: {},
dataList: [], dataList: [],
@ -333,26 +406,32 @@
methods: { methods: {
async afterReadAvatar(event) {
upLoadImage({
filePath: event.file.url,
}).then(res => {
this.imgUrl = res.data.uri
// this.formData.avatar = res.data.uri
})
},
confirmFn() { confirmFn() {
uni.reLaunch({ uni.reLaunch({
url: '/subpkg/property/index' // url: '/subpkg/property/index' //
}); });
}, },
test() {
this.aaa = 1;
this.showpopp = true;
// uni.reLaunch({
// url: '/subpkg/property/index' //
// });
},
// //
applycarFn() { applycarFn() {
Toast("操作成功") upVehicleApi({
this.step = -1 type: 0
return }).then(res => {
upVehicleApi().then(res => {
Toast("操作成功") Toast("操作成功")
this.step = -1 setTimeout(() => {
uni.redirectTo({
url: '/subpkg/property/index'
})
}, 1000)
}) })
}, },
// //
@ -362,10 +441,16 @@
return return
} }
upVehicleApi({ upVehicleApi({
license: this.carLicense license: this.carLicense,
pic: this.imgUrl,
type: 1
}).then(res => { }).then(res => {
this.step = 2
Toast("上传成功") Toast("上传成功")
setTimeout(() => {
uni.redirectTo({
url: '/subpkg/property/index'
})
}, 2000)
}) })
this.show = false this.show = false
@ -427,6 +512,28 @@
} }
} }
.uplode {
width: 243.57rpx;
height: 173.48rpx;
box-sizing: border-box;
padding-top: 30rpx;
border-radius: 15rpx;
border: 1px solid $theme-oa-color;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
color: $theme-oa-color;
position: relative;
margin-left: 20rpx;
.up {
position: absolute;
color: transparent;
}
}
.noCar { .noCar {
padding: 100rpx; padding: 100rpx;
margin-top: 10vh; margin-top: 10vh;

View File

@ -57,7 +57,9 @@
</view> </view>
</view> </view>
</view> </view>
<view class="">
<!-- <u--image width="100rpx" height="100rpx" style="margin-right:20rpx"></u--image> -->
</view>
<!-- 合同 --> <!-- 合同 -->
<!-- {{datas.contract}} --> <!-- {{datas.contract}} -->
<view class="card" v-if="showCont"> <view class="card" v-if="showCont">