Commit 76b266a5 by cen

fix: 确认交车

1 parent b1719d5c
<template>
<view class="date-list">
<picker-view
class="picker picker_max"
:value="dateValues"
indicator-class="indicator"
@change="changeDate"
>
<picker-view class="picker picker_max" :value="dateValues" indicator-class="indicator" @change="changeDate">
<picker-view-column>
<template v-for="(item,index) in days">
<view
class="view"
:key="index"
>{{item}}</view>
<template v-for="(item, index) in days">
<view class="view" :key="index">{{ item }}</view>
</template>
</picker-view-column>
</picker-view>
<picker-view
class="picker"
:value="hourValues"
indicator-class="indicator"
@change="changeHour"
>
<picker-view class="picker" :value="hourValues" indicator-class="indicator" @change="changeHour">
<picker-view-column>
<template v-for="(item,index) in hours">
<view
class="view"
:key="index"
>{{item}}</view>
<template v-for="(item, index) in hours">
<view class="view" :key="index">{{ item }}</view>
</template>
</picker-view-column>
</picker-view>
<picker-view
class="picker"
:value="minuteValues"
indicator-class="indicator"
@change="changeMinutes"
>
<picker-view class="picker" :value="minuteValues" indicator-class="indicator" @change="changeMinutes">
<picker-view-column>
<template v-for="(item,index) in minutes">
<view
class="view"
:key="index"
>{{item}}</view>
<template v-for="(item, index) in minutes">
<view class="view" :key="index">{{ item }}</view>
</template>
</picker-view-column>
</picker-view>
</view>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
import dayjs from 'dayjs'
export default {
name: 'DateTime',
......@@ -208,7 +184,7 @@ export default {
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
.date-list {
height: 100%;
display: grid;
......@@ -224,8 +200,8 @@ export default {
height: toRpx(72);
}
}
/deep/.indicator{
/deep/.indicator {
height: toRpx(72);
}
}
</style>
\ No newline at end of file
</style>
<template>
<view class="date-list">
<picker-view class="picker picker_max" :value="dateValues" indicator-class="indicator" @change="changeDate">
<picker-view-column>
<template v-for="(item, index) in days">
<view class="view" :key="index">{{ item }}</view>
</template>
</picker-view-column>
</picker-view>
<picker-view class="picker" :value="hourValues" indicator-class="indicator" @change="changeHour">
<picker-view-column>
<template v-for="(item, index) in hours">
<view class="view" :key="index">{{ item }}</view>
</template>
</picker-view-column>
</picker-view>
<picker-view class="picker" :value="minuteValues" indicator-class="indicator" @change="changeMinutes">
<picker-view-column>
<template v-for="(item, index) in minutes">
<view class="view" :key="index">{{ item }}</view>
</template>
</picker-view-column>
</picker-view>
</view>
</template>
<script type="text/ecmascript-6">
import dayjs from 'dayjs'
export default {
name: 'DateTimeChange',
inject: ['userInfo'],
data () {
return {
hours: [],
days: [],
minutes: [],
dateValues: [],
hourValues: [],
minuteValues: [],
loading: true
}
},
props: {
},
mounted () {
this.initDate()
},
methods: {
initDate () {
console.log('initDate')
this.dateValues = []
this.hourValues = []
this.minuteValues = []
const today = new Date()
this.getDateList('2019/01/01','2029/01/01')
},
getDateList (starDay, endDay) {
const arr = [];
const dates = [];
// 设置两个日期UTC时间
const db = new Date(starDay);
const de = new Date(endDay);
// 获取两个日期GTM时间
const s = db.getTime() - 24 * 60 * 60 * 1000;
const d = de.getTime() - 24 * 60 * 60 * 1000;
console.log(db,de)
// 获取到两个日期之间的每一天的毫秒数
for (let i = s; i <= d;) {
i = i + 24 * 60 * 60 * 1000;
arr.push(parseInt(String(i)));
}
// 获取每一天的时间 YY-MM-DD
for (const j in arr) {
const time = new Date(arr[j]);
const year = time.getFullYear();
const mouth = time.getMonth() + 1 >= 10 ? time.getMonth() + 1 : '0' + (time.getMonth() + 1);
const day = time.getDate() >= 10 ? time.getDate() : '0' + time.getDate();
const YYMMDD = year + '/' + mouth + '/' + day;
dates.push(YYMMDD);
}
this.getHourList(dates)
},
getHourList (days) {
const hours = [], today = new Date();
for (let hour = 0; hour < today.getHours() + 1; hour++) {
hours.push(hour.toString().padStart(2, '0'));
}
this.getMinuteList(days, hours)
},
getMinuteList (days, hours) {
const minutes = [];
const today = new Date()
for (let minute = 0; minute < today.getMinutes() + 1; minute++) {
minutes.push(minute.toString().padStart(2, '0'));
}
// 设置默认时间
let { dateValues, hourValues, minuteValues } = this
const HOUR_STR = today.getHours().toString().padStart(2, '0')
const MUNTUE_STR = today.getMinutes().toString().padStart(2, '0')
// const defalutHIndex = hours.indexOf(HOUR_STR)
// const defalutMIndex = minutes.indexOf(MUNTUE_STR)
dateValues.push(days.length + 1)
hourValues.push(hours.length + 1)
minuteValues.push(minutes.length + 1)
this.currentDate = dayjs().format('YYYY/MM/DD')
this.currentHour = HOUR_STR
this.currentMinute = MUNTUE_STR
this.hours = hours
this.days = days
this.minutes = minutes
this.dateValues = dateValues
this.hourValues = hourValues
this.minuteValues = minuteValues
this.loading = false
setTimeout(() => {
this.minuteValues = minuteValues
this.loading = false
}, 100)
this.$emit('onComplete')
},
changeDate (e) {
const { days } = this
const { value } = e.detail
const index = value[0]
this.currentDate = days[index]
// 选择过去时间需要重新初始化时分
const today = dayjs().format('YYYY/MM/DD')
const timeType = this.currentDate != today ? 1 : 0
this.getAllTimeOrPartTime(timeType)
},
changeHour (e) {
const { hours, days, dateValues } = this
const { value } = e.detail
const index = value[0]
this.currentHour = hours[index]
// 处理当前天切换别的小时,别的分不能选后面分到60的问题
// const dayIndex = dateValues[0]
// this.currentDate = days[dayIndex]
const today = dayjs().format('YYYY/MM/DD')
const timeType = this.currentDate != today ? 1 : 0
this.getAllTimeOrPartTimeMinute(timeType)
},
changeMinutes (e) {
const { minutes } = this
const { value } = e.detail
const index = value[0]
this.currentMinute = minutes[index]
},
getAllTimeOrPartTime (type) {
const today = new Date()
const hours = [], minutes = [], hour_len = type == 1 ? 24 : today.getHours() + 1, minute_len = type == 1 ? 60 : today.getMinutes() + 1;
for (let hour = 0; hour < hour_len; hour++) {
hours.push(hour.toString().padStart(2, '0'));
}
for (let minute = 0; minute < minute_len; minute++) {
minutes.push(minute.toString().padStart(2, '0'));
}
this.hours = hours
this.minutes = minutes
},
getAllTimeOrPartTimeMinute (type) {
const today = new Date()
const currentHour = today.getHours()
const timeType = this.currentHour != currentHour ? 1 : 0
const minutes = [], minute_len = type == 1 || timeType == 1 ? 60 : today.getMinutes() + 1;
for (let minute = 0; minute < minute_len; minute++) {
minutes.push(minute.toString().padStart(2, '0'));
}
this.minutes = minutes
},
getResult () {
let str = ''
str = this.currentDate + ' ' + this.currentHour + ':' + this.currentMinute + ":00"
const result = dayjs(str).format('YYYY/MM/DD HH:mm:ss')
return result
}
}
}
</script>
<style scoped lang="scss">
.date-list {
height: 100%;
display: grid;
grid-template-columns: repeat(3, 1fr);
.picker {
height: 100%;
text-align: center;
.view {
display: flex;
align-items: center;
justify-content: center;
font-size: toRpx(32);
height: toRpx(72);
}
}
/deep/.indicator {
height: toRpx(72);
}
}
</style>
......@@ -173,6 +173,12 @@ const componentConfig = {
loadComplete: false,
hideSearch: true,
noData: false
},
15: {
name: 'DateTimeChange',
title: '选择时间',
hideSearch: true,
loadComplete: false
}
}
export default { componentConfig }
......@@ -41,6 +41,7 @@ import PackageList from './components/PackageList.vue'
import SkuGoodsList from './components/SkuGoodsList.vue'
import SkuPopup from './components/SkuPopup.vue'
import DateTime from './components/DateTime.vue'
import DateTimeChange from './components/DateTimeChange.vue'
import AgreementList from './components/AgreementList.vue'
export default {
components: {
......@@ -54,7 +55,8 @@ export default {
SkuGoodsList,
SkuPopup,
DateTime,
AgreementList
AgreementList,
DateTimeChange
},
name: '',
props: {
......@@ -167,7 +169,7 @@ export default {
confirm () {
try {
let { chooseContent, popupType, componentObject } = this
if (popupType == 13) {
if (popupType == 13 || popupType == 15) {
chooseContent = this.componentRef().getResult()
}
if (chooseContent) {
......
......@@ -736,6 +736,13 @@ export default {
})
return
}
if (vin.length != 17) {
uni.showToast({
title: '车架号必须为17位',
icon: 'none'
})
return
}
// 表显里程验证 - 数字,0-999999
const mileage = this.formData.carBaseReqDTO.mileage
......
......@@ -92,7 +92,7 @@
<view class="pdf-box flex align-center justify-between" v-if="field.isShowPreview">
<view class="flex align-center">
<view class="sprite-icon icon-pdf"></view>
<text>二手车买卖补充协议</text>
<text>二手车补充协议</text>
</view>
<view class="flex align-center">
<view class="btn" @click.stop="previewPdf(field)">预览</view>
......
......@@ -68,24 +68,25 @@
</view>
<view class="upload-box mb-32" v-if="hasCertificateImage">
<view class="tab-panel-title">证件图片</view>
<view class="upload-grid">
<template v-for="field in uploadCertificateFields" >
<view class="flex upload-item-container" :key="field.key" v-if="getImageBySubtype(field.key)">
<view class="upload-label" >
<view class="tab-panel-title">证件资料</view>
<view class="upload-grid two-columns">
<template v-for="field in uploadCertificateFields">
<view class="flex upload-item-container" :class="{ 'two-thirds': field.key === 22 && getImageBySubtype(field.key) && Array.isArray(getImageBySubtype(field.key)) && getImageBySubtype(field.key).length > 1 }" :key="field.key" v-if="getImageBySubtype(field.key)">
<view class="upload-label">
{{ field.label }}
</view>
<view class="upload-images-wrapper">
<view class="uploaded-media-container">
<template v-if="field.maxCount > 1">
<template v-for="(item, index) in getImageBySubtype(field.key)">
<image :src="item.fileUrl" mode="aspectFill" class="uploaded-media" @click.stop="previewMedia(item.fileUrl, 1)"></image>
</template>
</template>
<template v-else>
<image :src="getImageBySubtype(field.key).fileUrl" mode="aspectFill" class="uploaded-media" @click.stop="previewMedia(getImageBySubtype(field.key).fileUrl, 1)"></image>
</template>
</view>
<template v-if="field.key === 22 && Array.isArray(getImageBySubtype(field.key))">
<view class="uploaded-media-container" v-for="(img, index) in getImageBySubtype(field.key)" :key="index">
<image :src="img.fileUrl" @click.stop="previewMedia(img.fileUrl, 1)" mode="aspectFill" class="uploaded-media"></image>
</view>
</template>
<!-- 对于其他类型的图片,保持原有显示方式 -->
<template v-else-if="!Array.isArray(getImageBySubtype(field.key))">
<view class="uploaded-media-container">
<image :src="getImageBySubtype(field.key).fileUrl" @click.stop="previewMedia(getImageBySubtype(field.key).fileUrl, 1)" mode="aspectFill" class="uploaded-media"></image>
</view>
</template>
</view>
</view>
</template>
......@@ -93,7 +94,7 @@
</view>
<view class="upload-box mb-32" v-if="hasAnyVideo">
<view class="tab-panel-title">视频信息</view>
<view class="tab-panel-title">车辆视频</view>
<view class="upload-grid">
<view class="flex upload-item-container" v-for="field in uploadVideoFields" :key="field.key">
<view class="upload-label" v-if="getImageBySubtype(field.key)">
......@@ -144,7 +145,7 @@
<view class="gridBox mb-48 padBox">
<view v-for="(item, index) in priceItems" :key="index" :class="['flex align-center', { 'full-width': item.fullWidth }]">
<view class="title-label-see mr-16">{{ item.label }}</view>
<view class="flex-1">{{ detailsInfo.priceHistory[indexContent][item.key] || '-' }}</view>
<view class="flex-1">{{ detailsInfo.priceHistory[indexContent][item.key] || '-' }} {{ item.cell || '' }}</view>
</view>
</view>
</template>
......@@ -481,7 +482,7 @@ export default {
{ label: '原车主住址', key: 'carLicense.previousOwnerAddress', fullWidth: true }
],
priceItems: [
{ label: '评估价格', key: 'evalPrice' },
{ label: '评估价格', key: 'evalPrice', cell: '元' },
{ label: '客户意向报价', key: 'customerTargetPrice' },
{ label: '报价反馈', key: 'customerTargetPriceFeedback', fullWidth: true },
{ label: '评估意见', key: 'evalOpinion', fullWidth: true }
......@@ -564,7 +565,7 @@ export default {
{ key: 12, label: '主驾驶全景', maxCount: 1, accept: 'image' },
{ key: 13, label: '仪表盘', maxCount: 1, accept: 'image' },
{ key: 14, label: '后排座椅', maxCount: 1, accept: 'image' },
{ key: 15, label: '中控台', maxCount: 1, accept: 'image' },
{ key: 15, label: '中控台全景', maxCount: 1, accept: 'image' },
{ key: 16, label: '右后45度', maxCount: 1, accept: 'image' },
{ key: 17, label: '铭牌', maxCount: 1, accept: 'image' }
......@@ -949,6 +950,9 @@ export default {
grid-template-columns: repeat(3, 1fr);
border-radius: toRpx(16);
}
.upload-grid.two-columns {
grid-template-columns: repeat(2, 1fr);
}
.upload-item-container {
align-items: flex-start;
......@@ -986,6 +990,12 @@ export default {
}
}
}
.upload-item-container.two-thirds {
grid-column: span 2;
.upload-images-wrapper {
width: 100%;
}
}
.upload-item {
height: toRpx(240);
......
......@@ -77,7 +77,7 @@
</view>
</template>
</GeneralPopup>
<GeneralPopup ref="addSignAgreementPopup" popupClass="requotePopup" title="新增保管人" confirmText="新增" type="center" :showClose="true">
<GeneralPopup ref="addSignAgreementPopup" popupClass="requotePopup" title="新增保管人" confirmText="新增" type="center" :showClose="true" @confirm="confirmAddSignAgreement" :autoClose="false">
<template #content>
<view class="requote-content">
<view class="requote-label mb-24">
......@@ -89,17 +89,17 @@
身份证号
<text class="requiredLabel">*</text>
</view>
<input class="intention-input mb-48" placeholder="请输入" v-model="addSignAgreementObj.custodianIdentityCode" />
<input class="intention-input mb-48" placeholder="请输入18位身份证号" :value="addSignAgreementObj.custodianIdentityCode" maxlength="18" @input="validateIdCard" type="text" />
<view class="requote-label mb-24">
手机号
<text class="requiredLabel">*</text>
</view>
<input class="intention-input mb-48" type="number" placeholder="请输入" v-model="addSignAgreementObj.custodianPhone" />
<input class="intention-input mb-48" type="number" maxlength="11" placeholder="请输入" v-model="addSignAgreementObj.custodianPhone" />
<view class="requote-label mb-24">
地址
<text class="requiredLabel">*</text>
</view>
<input class="intention-input mb-48" placeholder="请输入" v-model="addSignAgreementObj.custodianAddress" />
<input class="intention-input mb-48" placeholder="请输入" maxlength="10" v-model="addSignAgreementObj.custodianAddress" />
</view>
</template>
</GeneralPopup>
......@@ -315,6 +315,18 @@ export default {
}
})
},
validateIdCard(e) {
// 从事件对象中获取输入值,处理不同环境下的兼容性
let value = e.target ? e.target.value : e.detail ? e.detail.value : ''
// 移除非数字和字母的字符
value = value.replace(/[^a-zA-Z0-9]/g, '')
// 限制长度为18位
if (value.length > 18) {
value = value.slice(0, 18)
}
// 使用this.$set确保响应式更新
this.$set(this.addSignAgreementObj, 'custodianIdentityCode', value)
},
handlePriceInput(e) {
console.log(e)
const value = e.target ? e.target.value.replace(/[^0-9]/g, '') : e.detail.value.replace(/[^0-9]/g, '')
......@@ -562,38 +574,43 @@ export default {
this.$refs.orderPopup.open()
},
async addSignAgreement() {
this.$refs.addSignAgreementPopup.open().then(() => {
if (!this.addSignAgreementObj.custodianName) {
uni.showToast({ title: '请输入签约保管人', icon: 'none' })
return Promise.reject()
}
if (!this.addSignAgreementObj.custodianIdentityCode) {
uni.showToast({ title: '请输入身份证号', icon: 'none' })
return Promise.reject()
}
if (!this.addSignAgreementObj.custodianPhone) {
uni.showToast({ title: '请输入手机号', icon: 'none' })
return Promise.reject()
}
if (!this.addSignAgreementObj.custodianAddress) {
uni.showToast({ title: '请输入地址', icon: 'none' })
return Promise.reject()
this.$refs.addSignAgreementPopup.open()
},
confirmAddSignAgreement() {
if (!this.addSignAgreementObj.custodianName) {
uni.showToast({ title: '请输入签约保管人', icon: 'none' })
return
}
if (!this.addSignAgreementObj.custodianIdentityCode) {
uni.showToast({ title: '请输入身份证号', icon: 'none' })
return
}
if (!this.addSignAgreementObj.custodianPhone) {
uni.showToast({ title: '请输入手机号', icon: 'none' })
return
}
if (this.addSignAgreementObj.custodianPhone.length != 11) {
uni.showToast({ title: '请输入正确的手机号', icon: 'none' })
return
}
if (!this.addSignAgreementObj.custodianAddress) {
uni.showToast({ title: '请输入地址', icon: 'none' })
return
}
uni.showLoading()
uni.$api.evaluationApi.addCustodyAgreement(this.addSignAgreementObj).then(res => {
if (res.data.code == 0) {
uni.hideLoading()
console.log('res:', res)
this.$refs.addSignAgreementPopup.closePopup()
} else {
uni.hideLoading()
uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
}
uni.showLoading()
uni.$api.evaluationApi.addCustodyAgreement(this.addSignAgreementObj).then(res => {
if (res.data.code == 0) {
uni.hideLoading()
console.log('res:', res)
this.currentPage = 1
this.search()
} else {
uni.hideLoading()
uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
}
})
})
},
onConfirm(e) {
......@@ -755,6 +772,9 @@ export default {
background: #f4f5f7;
padding: toRpx(24);
box-sizing: border-box;
.uni-input-placeholder {
margin-left: toRpx(24);
}
}
}
.intention-input-cell {
......
......@@ -258,7 +258,7 @@
</view>
</view>
</view>
<order-popup ref="openDate" popupType="13" @onConfirm="confirmDate" />
<order-popup ref="openDate" popupType="15" @onConfirm="confirmDate" />
<NoticePopup ref="notice" title="重要提示" text="当前页面暂未保存,是否确认退出" type="warning"></NoticePopup>
</view>
</template>
......@@ -527,8 +527,8 @@ export default {
this.$set(this.formData, 'partAName', res.data.data.evalCarLicense.previousOwnerName)
this.$set(this.formData, 'payeeName', res.data.data.evalCarLicense.previousOwnerName)
this.$set(this.formData, 'phone', res.data.data.evalCarLicense.previousOwnerPhone)
this.$set(this.formData, 'address', res.data.data.evalCarBase.registrationProvinceName + '-' + res.data.data.evalCarBase.registrationCityName)
this.$set(this.formData, 'handoverAddress', res.data.data.evalCarBase.registrationProvinceName + '-' + res.data.data.evalCarBase.registrationCityName)
this.$set(this.formData, 'address', res.data.data.evalCarBase.carProvinceName + '-' + res.data.data.evalCarBase.carCityName)
this.$set(this.formData, 'handoverAddress', res.data.data.evalCarBase.carProvinceName + '-' + res.data.data.evalCarBase.carCityName)
// this.evalOrderSimpleDetail = res.data.data
} else {
uni.hideLoading()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!