Commit 777da28d by cen

fix: 样式和确认交车交互

1 parent 13449441
......@@ -231,5 +231,12 @@ module.exports = {
},
{ returnAll: true }
)
},
/**省市区 */
apiRegion(data) {
const queryString = Object.keys(data)
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(data[key])}`)
.join('&')
return gscPost(`/evalOrder/apiRegion/search${queryString ? '?' + queryString : ''}`, { ...data }, { returnAll: true })
}
}
......@@ -3,7 +3,7 @@
<template v-for="(i, index) in list">
<view :key="index" @click="choose(i)" :class="['item flex', { active: currentId ? i.id == currentId : i.id == data[params.idKey] }]">
<view class="sprite-icon icon-tag-checked"></view>
{{ i.name }}
{{ i.name + ' | ' + i.conversionPhone }}
</view>
</template>
</view>
......
......@@ -60,7 +60,7 @@
</view>
<view class="upload-section">
<view class="section-title">其他图片</view>
<UploadMedia :upload-fields="uploadOtherFields" :mediaData.sync="otherImagesData" :grid-columns="1" />
<UploadMedia :upload-fields="uploadOtherFields" :mediaData.sync="otherImagesData" :grid-columns="1" class="other-upload" />
</view>
</view>
</view>
......@@ -146,7 +146,7 @@ import { uploadFile } from '@/utils/ossUploadFile/uploadFile.js'
import SelectCity from './components/SelectCity.vue'
import UploadMedia from './components/uploadMedia.vue'
import NoticePopup from '@/components/NoticePopup.vue'
import { debounce } from 'lodash'
import { throttle } from 'lodash'
import dayjs from 'dayjs'
import permision from '@/js_sdk/wa-permission/permission.js'
import { sign, md532, md516 } from 'utils/common'
......@@ -545,7 +545,7 @@ export default {
{ key: 31, label: '发动机工况', required: false, accept: 'video' },
{ key: 32, label: '车况解说', required: false, accept: 'video' }
],
uploadOtherFields: [{ key: 41, label: '其他图片', required: false, accept: 'image', maxCount: 30 }],
uploadOtherFields: [{ key: 41, label: '其他图片', required: false, accept: 'image', maxCount: 30, fullwidth: true }],
currentField: null,
query: {}
}
......@@ -1378,13 +1378,9 @@ export default {
this.scrollToTop()
}
},
bindPickerChange: function (e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.index = e.detail.value
},
// 提交表单逻辑
submitForm: debounce(async function () {
submitForm: throttle(async function () {
// 表单提交验证
if (this.currentStep === 3) {
const leftFront45Image = this.formImagesData['11'] // key为11的是左前45度图片
......@@ -1421,6 +1417,8 @@ export default {
title: '提交中...'
})
console.log('提交的表单数据:', this.formData)
const guidePrice = this.formData.carBaseReqDTO.guidePrice
this.formData.carBaseReqDTO.guidePrice = !isNaN(Number(guidePrice)) ? Number(guidePrice).toFixed(2) : '0.00'
if (this.query.type === 'add') {
uni.showLoading()
const res = await uni.$api.evaluationApi.evalOrderCreate(this.formData)
......
......@@ -6,8 +6,8 @@
<text class="requiredLabel" v-if="field.required">*</text>
</view>
<template v-if="field.type === 'input'" class="flex align-center">
<input class="formInput" :class="field.disabled ? 'formInputDisabled' : ''" :min="field.min" :max="field.max" v-if="field.targetObj" :type="field.inputType" :disabled="field.disabled" :placeholder="field.placeholder || '请输入'" :maxlength="field.maxlength || 100" v-model="formData[field.targetObj][field.targetKey]" :pattern="field.pattern || ''" @input="e => handleInput(e, field)" @blur="e => handleBlur(e, field)" />
<input class="formInput" :class="field.disabled ? 'formInputDisabled' : ''" :min="field.min" :max="field.max" v-else type="text" :type="field.inputType" :disabled="field.disabled" :placeholder="field.placeholder || '请输入'" v-model="formData[field.targetKey]" :maxlength="field.maxlength || 100" :pattern="field.pattern || ''" @input="e => handleInput(e, field)" @blur="e => handleBlur(e, field)" />
<input class="formInput" :class="field.disabled ? 'formInputDisabled' : ''" :min="field.min" :max="field.max" v-if="field.targetObj" :type="field.inputType || 'text'" :disabled="field.disabled" :placeholder="field.placeholder || '请输入'" :maxlength="field.maxlength || 100" v-model="formData[field.targetObj][field.targetKey]" :pattern="field.pattern || ''" @input="e => handleInput(e, field)" @blur="e => handleBlur(e, field)" />
<input class="formInput" :class="field.disabled ? 'formInputDisabled' : ''" :min="field.min" :max="field.max" v-else type="text" :type="field.inputType || 'text'" :disabled="field.disabled" :placeholder="field.placeholder || '请输入'" v-model="formData[field.targetKey]" :maxlength="field.maxlength || 100" :pattern="field.pattern || ''" @input="e => handleInput(e, field)" @blur="e => handleBlur(e, field)" />
<view v-if="field.isScan" class="flex align-center scanBtn justify-center" @click.stop="scan('vinOcr')">
<view class="sprite-icon icon-scanIconX"></view>
</view>
......@@ -149,7 +149,57 @@ export default {
this.$emit('update:formData', data)
},
handleInput(e, field) {
const value = e.detail.value
console.log('e', e)
const value = e.target?._value || e.target?.value
if (field.key === 'vin' || field.key === 'engineNumber' || field.key === 'idCard') {
let filteredValue = value.replace(/[^A-Za-z0-9]/g, '')
console.log('filteredValue', filteredValue)
console.log('value', value)
console.log(filteredValue !== value)
if (filteredValue !== value) {
if (field.targetObj) {
this.formData[field.targetObj][field.targetKey] = filteredValue
// this.$set(this.formData[field.targetObj], field.targetKey, filteredValue)
} else {
this.formData[field.targetKey] = filteredValue
// this.$set(this.formData, field.targetKey, filteredValue)
}
} else {
filteredValue = value
}
}
if (field.key === 'keyCount' || field.key === 'transferCount') {
// 过滤掉所有非数字字符
const filteredValue = value.replace(/[^0-9]/g, '')
// 限制只能输入一位数字
const singleDigitValue = filteredValue.slice(0, 1)
if (singleDigitValue !== value) {
value = singleDigitValue
if (field.targetObj) {
this.formData[field.targetObj][field.targetKey] = value
} else {
this.formData[field.targetKey] = value
}
this.$emit('formDataChange', this.formData)
return
}
}
if (field.key === 'depositPrice') {
// 过滤掉所有非数字字符
const filteredValue = value.replace(/[^1-9]/g, '')
if (filteredValue !== value) {
value = filteredValue
if (field.targetObj) {
this.formData[field.targetObj][field.targetKey] = value
} else {
this.formData[field.targetKey] = value
}
this.$emit('formDataChange', this.formData)
return
}
}
// 如果有正则验证规则,执行验证
if (field.pattern) {
const reg = new RegExp(field.pattern)
......
......@@ -90,15 +90,15 @@ export default {
},
methods: {
open() {
this.$nextTick(() => {
console.log(this.$refs.publishPopup)
if (this.$refs.publishPopup) {
this.$refs.publishPopup.open()
}
})
return new Promise((resolve, reject) => {
this.resolve = resolve
this.reject = reject
this.$nextTick(() => {
console.log(this.$refs.publishPopup)
if (this.$refs.publishPopup) {
this.$refs.publishPopup.open()
}
})
})
},
change(e) {
......
<template>
<GeneralPopup ref="cityPopup" popupClass="cityPopup" :list="list" :title="title" @confirm="handleConfirm">
<GeneralPopup ref="cityPopup" popupClass="cityPopup" :list="list" :title="title" @confirm="handleConfirm" :autoClose="false">
<template v-slot:content>
<view v-if="isLoading" class="loading-container">
<view class="loading-spinner"></view>
......@@ -100,28 +100,30 @@ export default {
loadCityData() {
let that = this
this.isLoading = true
uni.request({
url: 'http://eshield.test.glsx.com.cn/nesi/apiRegion/search?keyword=全国&sub_admin=3&extensions_code=1',
method: 'GET',
data: {},
dataType: 'json',
success(result) {
console.log('请求结果:', JSON.parse(result.data.data))
let { status, districts } = JSON.parse(result.data.data)
if (status === 0 && districts) {
that.provinceData = districts[0].districts
console.log('provinceData', that.provinceData)
that.updateSelectionWithLoadedData()
uni.$api.evaluationApi
.apiRegion({
keyword: '全国',
sub_admin: 3,
extensions_code: 1
})
.then(res => {
console.log('请求结果:', res)
let { data } = res
if (data.code == 0) {
console.log('请求结果:', JSON.parse(data.data))
let { status, districts } = JSON.parse(data.data)
if (status === 0 && districts) {
that.provinceData = districts[0].districts
console.log('provinceData', that.provinceData)
that.updateSelectionWithLoadedData()
} else {
console.error('Invalid city data format:', result)
}
that.isLoading = false
} else {
console.error('Invalid city data format:', result)
that.isLoading = false
}
that.isLoading = false
},
fail(error) {
console.log(error, 'error')
that.isLoading = false
}
})
})
},
updateSelectionWithLoadedData() {
console.log('Updating selection with loaded data...', this.defaultProvince)
......@@ -280,8 +282,15 @@ export default {
}
},
handleConfirm() {
console.log(this.selectionResult)
this.$emit('city-selected', this.selectionResult)
if (this.selectedCity) {
this.$emit('city-selected', this.selectionResult)
this.$refs.cityPopup.closePopup()
} else {
uni.showToast({
title: '请选择城市',
icon: 'none'
})
}
}
}
}
......
......@@ -35,7 +35,7 @@
<text class="common-label flex-shrink-0">工单时间</text>
<view class="common-value text-ellipsis ml-16">{{ carInfo.evalOrderTime }}</view>
</view>
<view class="info-item flex align-center" v-if="carInfo.status != 10 && carInfo.status != 20">
<view class="info-item flex align-center" v-if="(carInfo.status != 10 && carInfo.status != 20 && carInfo.status != -1) || (carInfo.previousStatus != 10 && carInfo.status == -1)">
<text class="common-label flex-shrink-0">签约时间</text>
<view class="common-value text-ellipsis ml-16">{{ carInfo.signingSaleDate }}</view>
</view>
......@@ -44,7 +44,7 @@
<view class="flex">
<text class="common-label">评估价格</text>
<view class="price ml-16" :class="{ 'text-blue': carInfo.evalPriceDisplay && carInfo.status != 10 }">
{{ carInfo.status == 10 ? '评估中' : carInfo.evalPriceDisplay }}
{{ carInfo.status == 10 || (carInfo.previousStatus == 10 && carInfo.status == -1) ? '评估中' : carInfo.evalPriceDisplay }}
<text v-if="carInfo.paymentType == 1 && carInfo.status != 10" class="text-gray ml-16">(定金: {{ carInfo.depositPrice }}元 | 尾款: {{ carInfo.finalPrice }}元)</text>
<text v-if="carInfo.paymentType == 2 && carInfo.status != 10" class="text-gray ml-16">(全款: {{ carInfo.evalPrice }}元 )</text>
</view>
......
......@@ -5,7 +5,7 @@
{{ field.label }}
<text class="requiredLabel" v-if="field.required">*</text>
</view>
<view class="upload-images-wrapper">
<view class="upload-images-wrapper" :class="{ flexWarp: field.fullwidth }">
<!-- 上传按钮,当未达到最大限制时显示 -->
<view v-if="!hasReachedMax(field)" class="upload-item" @click="handleMediaUpload(field)">
<view class="upload-placeholder">
......@@ -451,6 +451,8 @@ export default {
display: flex;
gap: toRpx(16);
flex: 1;
}
.flexWarp {
flex-wrap: wrap;
}
&.fullwidth {
......
......@@ -24,7 +24,7 @@
<text>套</text>
</view>
<view class="flex align-center inputBox" :class="{ fullInput: field.fullInput }" v-if="field.key === 'otherUrl'">
<input type="text" v-model="formData[field.inputKey]" placeholder="请输入" maxlength="100" />
<input type="text" v-model="formData[field.inputKey]" placeholder="请输入" maxlength="28" />
</view>
<view class="upload-images-wrapper">
<!-- 显示已上传的图片列表 -->
......@@ -94,7 +94,7 @@
</view>
</view>
</view>
<GeneralPopup ref="addAgreementPopup" popupClass="addAgreementPopup" type="center" title="补充协议条款">
<GeneralPopup ref="addAgreementPopup" popupClass="addAgreementPopup" type="center" title="补充协议条款" @confirm="confirmAddAgreement">
<template v-slot:content>
<textarea placeholder="请输入 (200字以内)" v-model="formData.supplementaryClauseText" maxlength="200" />
</template>
......@@ -123,7 +123,7 @@ import GeneralPopup from './components/GeneralPopup.vue'
import OrderPopup from '@/components/OrderPopup/index.vue'
import dayjs from 'dayjs'
import NoticePopup from '@/components/NoticePopup.vue'
import { debounce } from 'lodash'
import { throttle } from 'lodash'
import permision from '@/js_sdk/wa-permission/permission.js'
export default {
components: {
......@@ -134,6 +134,7 @@ export default {
},
data() {
return {
currentField: null,
videoProcess: '?x-oss-process=video/snapshot,t_7000,f_jpg,w_800,h_600,m_fast',
bg: require('@/assets/images/boutique/tipsPopupBg.png'),
userInfo: {},
......@@ -143,7 +144,7 @@ export default {
confirmCarImages: {},
custodianName: '',
pdfUrl: '',
showTips: '《车辆交接单》已发送至签约车主,请提醒车主完成签署。',
showTips: '《车辆交接确认单》已发送至签约车主,请提醒车主完成签署。',
successDate: '',
show: false,
value1: dayjs().format('YYYY-MM-DD HH:mm:ss'),
......@@ -280,6 +281,7 @@ export default {
// this.$set(this.formData, 'handoverAddress', res.data.data.evalCarBase.carProvinceName + '-' + res.data.data.evalCarBase.carCityName)
console.log('res.data.data', JSON.parse(res.data.data.custodyContract.electronicContractField))
this.custodianName = JSON.parse(res.data.data.custodyContract.electronicContractField).custodianName || ''
this.formData.handoverTime = dayjs().format('YYYY-MM-DD HH:mm:00')
// this.evalOrderSimpleDetail = res.data.data
} else {
uni.hideLoading()
......@@ -289,43 +291,48 @@ export default {
})
}
},
confirmAddAgreement() {
uni.showLoading()
uni.$api.evaluationApi
.salesAgreementPreview({
evalOrderNo: this.query.evalOrderNo,
supplementaryClauseText: this.formData.supplementaryClauseText
})
.then(res => {
if (res.data.code == 0) {
uni.hideLoading()
this.$refs.addAgreementPopup.closePopup()
this.formFields.forEach(item => {
if (item.key === this.currentField.key) {
item.isShowPreview = true
}
})
this.pdfUrl = res.data.data.fileDownloadUrl
console.log('this.pdfUrl', this.pdfUrl)
} else {
uni.hideLoading()
uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
}
})
},
handleCell(field) {
const that = this
console.log('handleCell', field)
this.currentField = field
that.currentField = field
if (field.type === 'pdf') {
this.$refs.addAgreementPopup.open().then(() => {
console.log('this.supplementaryClauseText', this.supplementaryClauseText)
uni.showLoading()
uni.$api.evaluationApi
.salesAgreementPreview({
evalOrderNo: this.query.evalOrderNo,
supplementaryClauseText: this.formData.supplementaryClauseText
})
.then(res => {
if (res.data.code == 0) {
uni.hideLoading()
this.$refs.addAgreementPopup.closePopup()
this.formFields.forEach(item => {
if (item.key === field.key) {
item.isShowPreview = true
}
})
this.pdfUrl = res.data.data.fileDownloadUrl
console.log('this.pdfUrl', this.pdfUrl)
} else {
uni.hideLoading()
uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
}
})
that.$nextTick(() => {
that.$refs.addAgreementPopup.open()
// that.$set(that.formData, 'supplementaryClauseText', '3243434')
console.log('this.supplementaryClauseText', that.formData.supplementaryClauseText)
})
} else if (field.type === 'calendar') {
this.show = true
that.show = true
}
},
confirmDelivery: debounce(function (e) {
confirmDelivery: throttle(function (e) {
if (!this.formData.handoverTime) {
uni.showToast({ title: '请选择交车时间', icon: 'none' })
return
......@@ -335,7 +342,7 @@ export default {
uni.showToast({ title: '请输入交车地点', icon: 'none' })
return
}
if (this.formData.carKeyCount < 0) {
if (this.formData.carKeyCount < 0 || this.formData.carKeyCount == '') {
uni.showToast({ title: '请输入车钥匙数量', icon: 'none' })
return
}
......@@ -353,7 +360,7 @@ export default {
return
}
}
this.showTips = `《车辆交接单》${this.formData.supplementaryClauseText ? '、《二手车买卖补充协议》' : ''}已发送至签约车主,请提醒车主完成签署。`
this.showTips = `《车辆交接确认单》${this.formData.supplementaryClauseText ? '、《二手车补充协议》' : ''}已发送至签约车主,请提醒车主完成签署。`
this.$refs.tipsPopup.open()
}, 1500),
async confirmTips() {
......@@ -365,7 +372,12 @@ export default {
// 将图片URL数组转换为逗号分隔的字符串
const imagesStr = this.uploadedImages[key].join(',')
// 更新formData中对应的字段
this.formData[key] = imagesStr
if (imagesStr.includes(this.videoProcess)) {
this.formData[key] = imagesStr.replace(this.videoProcess, '')
} else {
this.formData[key] = imagesStr
}
console.log('this.uploadedImages', this.formData)
}
})
......
......@@ -155,21 +155,23 @@
<view class="mb-32 upload-box" v-if="detailsInfo.signingInfo.saleContract">
<view class="tab-panel-title">二手车转让协议</view>
<view class="gridBoxNoPadding">
<view v-for="(item, index) in vehicleItems" :key="index" :class="['flex align-start', { 'full-width': item.fullWidth }, { 'align-center': item.type == 'link' }]">
<view class="title-label-see mr-16">{{ item.label }}</view>
<view v-if="item.type == 'image'">
<image :src="formatValue(item, detailsInfo)" @click.stop="previewMedia(formatValue(item, detailsInfo), 1)"></image>
</view>
<view v-else-if="item.type == 'link'" class="flex-1" @click.stop="pdfPreview(detailsInfo.signingInfo.saleContract.contractNo)">
<view class="pdf-box flex align-center justify-between">
<view class="flex align-center">
<view class="sprite-icon icon-pdf"></view>
<text>二手车转让协议</text>
<template v-for="(item, index) in vehicleItems">
<view v-if="!detailsInfo.signingInfo.saleContract.depositPrice ? item.key !== 'signingInfo.saleContract.depositPrice' && item.key !== 'signingInfo.saleContract.finalPrice' : item.key !== 'signingInfo.saleContract.fullPrice'" :key="index" :class="['flex align-start', { 'full-width': item.fullWidth }, { 'align-center': item.type == 'link' }]">
<view class="title-label-see mr-16">{{ item.label }}</view>
<view v-if="item.type == 'image'">
<image :src="formatValue(item, detailsInfo)" @click.stop="previewMedia(formatValue(item, detailsInfo), 1)"></image>
</view>
<view v-else-if="item.type == 'link'" class="flex-1" @click.stop="pdfPreview(detailsInfo.signingInfo.saleContract.contractNo)">
<view class="pdf-box flex align-center justify-between">
<view class="flex align-center">
<view class="sprite-icon icon-pdf"></view>
<text>二手车转让协议</text>
</view>
</view>
</view>
<view v-else>{{ formatValue(item, detailsInfo) }}</view>
</view>
<view v-else>{{ formatValue(item, detailsInfo) }}</view>
</view>
</template>
</view>
</view>
<view class="mb-32 upload-box">
......@@ -260,8 +262,13 @@
<template v-for="(item, index) in uploadFieldsItems">
<view v-if="formatValue(item, detailsInfo)" :key="index" :class="['flex align-start', { 'full-width': item.fullWidth }, { 'align-center': item.type == 'link' }]">
<view class="title-label-see mr-16">{{ item.label }}</view>
<view v-if="item.type == 'image'">
<image :src="formatValue(item, detailsInfo)" @click.stop="previewMedia(formatValue(item, detailsInfo), 1)"></image>
<view v-if="item.type == 'image'" class="flex-1">
<template v-if="item.key === 'carHandoverInfo.handoverPhotoMore'">
<image @click.stop="previewMedia(url, 1)" v-for="(url, idx) in splitMediaUrls(formatValue(item, detailsInfo))" :key="idx" :src="url" mode="aspectFill" style="margin-right: 10px"></image>
</template>
<template v-else>
<image :src="formatValue(item, detailsInfo)" @click.stop="previewMedia(formatValue(item, detailsInfo), 1)"></image>
</template>
</view>
<view v-else-if="item.type == 'link'" class="flex-1">
<view class="pdf-box flex align-center justify-between">
......@@ -321,9 +328,13 @@
<template v-slot="{ step, indexContent }">
<view class="tableContent">
<view class="gridBoxNoPadding mb-16" v-if="indexContent != detailsInfo.editLogList.length - 1">
<view v-for="(item, index) in editItems" :key="index" :class="['flex align-center', { 'full-width': item.fullWidth }]">
<view class="title-label-see mr-16">{{ item.label }}</view>
<view>{{ detailsInfo.editLogList[indexContent][item.key] || '-' }}</view>
<view :class="['flex align-center']">
<view class="title-label-see mr-16">订单状态</view>
<view :class="['bg-transparent', statusClass(detailsInfo.editLogList[indexContent].status)]">{{ statusMap[detailsInfo.editLogList[indexContent].status].name || '-' }}</view>
</view>
<view :class="['flex align-center']">
<view class="title-label-see mr-16">编辑人员</view>
<view>{{ detailsInfo.editLogList[indexContent].editor || '-' }}</view>
</view>
<view>
<view class="title-label-see mr-16">变更内容</view>
......@@ -500,6 +511,7 @@ export default {
{ label: '签约时间', key: 'signingInfo.saleContract.signTime' },
{ label: '定金金额', key: 'signingInfo.saleContract.depositPrice' },
{ label: '尾款金额', key: 'signingInfo.saleContract.finalPrice' },
{ label: '全款金额', key: 'signingInfo.saleContract.fullPrice' },
{ label: '签约车主', key: 'signingInfo.saleContract.partAName' },
{ label: '手机号码', key: 'signingInfo.saleContract.phone' },
{ label: '身份证号', key: 'signingInfo.saleContract.idCard' },
......@@ -699,6 +711,7 @@ export default {
if (item.map && this[item.map]) {
return this[item.map][rawValue] || rawValue
}
console.log('rawValue:', rawValue, item.key, item)
return rawValue === 0 ? 0 : item.type === 'image' || item.accept === 'video' ? rawValue : rawValue || '-'
},
......@@ -710,6 +723,13 @@ export default {
const obj = this.detailsInfo.images.find(img => img.fileSubtype === subtype) || null
return obj
},
getImageByKey(subtype) {
if (subtype === 41 || subtype === 22) {
return this.detailsInfo.images.filter(img => img.fileSubtype === subtype)
}
const obj = this.detailsInfo.images.find(img => img.fileSubtype === subtype) || null
return obj
},
getImageLabel(fileSubtype) {
return this.fileSuibtype[fileSubtype]?.name || `未知类型(${fileSubtype})`
},
......@@ -1089,7 +1109,11 @@ export default {
height: toRpx(44);
line-height: toRpx(44);
}
.bg-transparent {
background-color: transparent !important;
font-size: toRpx(28);
font-weight: 500;
}
// 状态颜色
.status-10 {
color: #f59619;
......
......@@ -146,7 +146,7 @@
</view>
<view class="checkbox-name">{{ item.name }}</view>
<input class="checkbox-input" v-if="item.isShowInput && item.key != 'other'" v-model="formData[item.inputValue]" placeholder="请输入" type="number" maxlength="1" />
<input class="checkbox-input" @click.stop="" v-if="item.isShowInput && item.key == 'other'" v-model="formData[item.inputValue]" placeholder="请输入" maxlength="100" @blur="e => handleBlur(e, item)" />
<input class="checkbox-input" @click.stop="" v-if="item.isShowInput && item.key == 'other'" v-model="formData[item.inputValue]" placeholder="请输入" maxlength="28" @blur="e => handleBlur(e, item)" />
</label>
</checkbox-group>
</template>
......@@ -175,9 +175,11 @@
<view class="flex align-center">
<view class="title-label-see mr-16">
{{ formData.paymentType == 1 ? '定金金额' : '全款金额' }}
</view>
<view>
{{ formData.paymentType == 1 ? formData.depositPrice : formData.fullPrice }}
<text>元</text>
</view>
<view>{{ formData.paymentType == 1 ? formData.depositPrice : formData.fullPrice }}</view>
</view>
<view class="flex align-center">
<view class="title-label-see mr-16">评估价</view>
......@@ -276,7 +278,7 @@ import { uploadFile } from '@/utils/ossUploadFile/uploadFile.js'
import OrderPopup from '@/components/OrderPopup/index.vue'
import dayjs from 'dayjs'
import NoticePopup from '@/components/NoticePopup.vue'
import { debounce } from 'lodash'
import { throttle } from 'lodash'
import permision from '@/js_sdk/wa-permission/permission.js'
export default {
components: {
......@@ -477,7 +479,7 @@ export default {
label: '开户行',
required: true,
fullWidth: false,
placeholder: '工商银行XXX分行XXX支行',
placeholder: '如:工商银行XXX分行XXX支行',
targetNameKey: 'sellerName',
sourceNameKey: 'staffName',
sourceKey: 'uuid',
......@@ -497,7 +499,9 @@ export default {
'formData.depositPrice': {
handler(newValue) {
console.log(newValue)
this.calculateFinalPrice()
if (newValue) {
this.calculateFinalPrice()
}
},
immediate: true
}
......@@ -523,6 +527,7 @@ export default {
methods: {
init(options) {
this.query = options
this.formData.handoverTime = dayjs().format('YYYY-MM-DD HH:mm:00')
},
async getEvalOrderSimpleDetail() {
uni.showLoading()
......@@ -591,105 +596,109 @@ export default {
console.log('radioChange', e)
const value = Number(e.detail.value)
this.formData.paymentType = value
this.formFields = [
{
key: 'depositPrice',
label: '定金金额',
required: true,
fullWidth: false,
targetNameKey: 'sellerName',
sourceNameKey: 'staffName',
sourceKey: 'uuid',
targetKey: 'depositPrice',
targetObj: '',
type: 'input',
cell: '元',
inputType: 'number',
disabled: false,
isCell: true,
pattern: '^\\d*$' // 只允许数字输入
},
{
key: 'finalPrice',
label: '尾款金额',
required: false,
fullWidth: false,
targetNameKey: 'sellerName',
sourceNameKey: 'staffName',
sourceKey: 'uuid',
targetKey: 'finalPrice',
targetObj: '',
disabled: true,
type: 'input',
cell: '元',
isCell: true,
pattern: '^\\d*$' // 只允许数字输入
},
{
key: 'evalPrice',
label: '评估价',
required: false,
fullWidth: false,
targetNameKey: 'sellerName',
sourceNameKey: 'staffName',
sourceKey: 'uuid',
targetKey: 'evalPrice',
type: 'input',
cell: '元',
isCell: true,
disabled: true
},
{
key: 'partAName',
label: '签约车主',
required: true,
fullWidth: false,
targetNameKey: 'sellerName',
sourceNameKey: 'staffName',
sourceKey: 'uuid',
targetKey: 'partAName',
type: 'input'
},
{
key: 'phone',
label: '手机号',
required: true,
fullWidth: false,
targetNameKey: 'sellerName',
sourceNameKey: 'staffName',
sourceKey: 'uuid',
targetKey: 'phone',
type: 'input',
inputType: 'number',
maxlength: 11
},
{
key: 'idCard',
label: '身份证号',
required: true,
fullWidth: false,
targetNameKey: 'sellerName',
sourceNameKey: 'staffName',
sourceKey: 'uuid',
targetKey: 'idCard',
type: 'input',
maxlength: 18
},
{
key: 'address',
label: '地址',
required: true,
fullWidth: false,
targetNameKey: 'sellerName',
sourceNameKey: 'staffName',
sourceKey: 'uuid',
targetKey: 'address',
type: 'input',
maxlength: 100
}
]
if (value === 1) {
this.formFields = [
{
key: 'depositPrice',
label: '定金金额',
required: true,
fullWidth: false,
targetNameKey: 'sellerName',
sourceNameKey: 'staffName',
sourceKey: 'uuid',
targetKey: 'depositPrice',
targetObj: '',
type: 'input',
cell: '元',
inputType: 'number',
disabled: false,
isCell: true,
pattern: '^\\d*$' // 只允许数字输入
},
{
key: 'finalPrice',
label: '尾款金额',
required: false,
fullWidth: false,
targetNameKey: 'sellerName',
sourceNameKey: 'staffName',
sourceKey: 'uuid',
targetKey: 'finalPrice',
targetObj: '',
disabled: true,
type: 'input',
cell: '元',
isCell: true,
pattern: '^\\d*$' // 只允许数字输入
},
{
key: 'evalPrice',
label: '评估价',
required: false,
fullWidth: false,
targetNameKey: 'sellerName',
sourceNameKey: 'staffName',
sourceKey: 'uuid',
targetKey: 'evalPrice',
type: 'input',
cell: '元',
isCell: true,
disabled: true
},
{
key: 'partAName',
label: '签约车主',
required: true,
fullWidth: false,
targetNameKey: 'sellerName',
sourceNameKey: 'staffName',
sourceKey: 'uuid',
inputType: 'text',
targetKey: 'partAName',
type: 'input',
maxlength: 50,
disabled: false
},
{
key: 'phone',
label: '手机号',
required: true,
fullWidth: false,
targetNameKey: 'sellerName',
sourceNameKey: 'staffName',
sourceKey: 'uuid',
targetKey: 'phone',
type: 'input',
inputType: 'number',
maxlength: 11
},
{
key: 'idCard',
label: '身份证号',
required: true,
fullWidth: false,
targetNameKey: 'sellerName',
sourceNameKey: 'staffName',
sourceKey: 'uuid',
targetKey: 'idCard',
type: 'input',
maxlength: 18
},
{
key: 'address',
label: '地址',
required: true,
fullWidth: false,
targetNameKey: 'sellerName',
sourceNameKey: 'staffName',
sourceKey: 'uuid',
targetKey: 'address',
type: 'input',
maxlength: 100
}
]
this.formData.finalPrice = ''
this.formData.depositPrice = ''
......@@ -711,6 +720,7 @@ export default {
targetKey: 'fullPrice',
targetObj: '',
cell: '元',
isCell: true,
disabled: true,
type: 'input'
},
......@@ -736,8 +746,10 @@ export default {
targetNameKey: 'sellerName',
sourceNameKey: 'staffName',
sourceKey: 'uuid',
inputType: 'text',
targetKey: 'partAName',
type: 'input',
disabled: false,
maxlength: 50
},
{
......@@ -993,7 +1005,8 @@ export default {
})
return
}
if (this.formData.depositPrice >= this.formData.evalPrice) {
console.log('this.formData:', this.formData)
if (Number(this.formData.depositPrice) >= Number(this.formData.evalPrice)) {
uni.showToast({
title: '定金要小于评估价',
icon: 'none'
......@@ -1078,7 +1091,7 @@ export default {
this.title = '确认签约信息'
this.comfirmPage = true
},
comfirm: debounce(function (e) {
comfirm: throttle(function (e) {
console.log('this.formData', this.formData)
if (this.formData.paymentType == 2) {
delete this.formData.depositPrice
......@@ -1117,7 +1130,7 @@ export default {
this.formData.finalPrice = finalPrice
} else {
// 定金不能大于评估价
this.formData.depositPrice = evalPrice
this.formData.depositPrice = ''
this.formData.finalPrice = 0
uni.showToast({
title: '定金不能大于评估价',
......@@ -1127,14 +1140,7 @@ export default {
},
// 处理输入事件
handleInputChange(e, field) {
const value = e.detail.value
// 确保输入为数字
if (['depositPrice', 'finalPrice', 'evalPrice'].includes(field.targetKey)) {
const numValue = parseFloat(value) || 0
this.$set(this.formData, field.targetKey, numValue)
}
},
handleInputChange(e, field) {},
// 处理无效输入
handleInputInvalid(field, originalValue) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!