Compare commits

..

4 Commits

3 changed files with 52 additions and 11 deletions

3
.gitignore vendored
View File

@@ -1,7 +1,8 @@
.DS_Store .DS_Store
node_modules node_modules
/dist /dist
/.kaifa
/.summaries
# local env files # local env files
.env.local .env.local

View File

@@ -875,7 +875,7 @@ export default {
this.vehicleLicenseInfo.address = frontInfo?.address; this.vehicleLicenseInfo.address = frontInfo?.address;
this.vehicleLicenseInfo.useNature = frontInfo?.useCharacter; this.vehicleLicenseInfo.useNature = frontInfo?.useCharacter;
this.vehicleLicenseInfo.model = frontInfo?.model; this.vehicleLicenseInfo.model = frontInfo?.model;
this.vehicleLicenseInfo.vinCode = frontInfo?.vin; this.vehicleLicenseInfo.vinCode = String(frontInfo?.vin || '').toUpperCase().replace(/O/g, '0');
this.vehicleLicenseInfo.engineNumber = frontInfo?.engineNo; this.vehicleLicenseInfo.engineNumber = frontInfo?.engineNo;
this.vehicleLicenseInfo.registrationDate = frontInfo?.registerDate; this.vehicleLicenseInfo.registrationDate = frontInfo?.registerDate;
this.vehicleLicenseInfo.issueDate = frontInfo?.issueDate; this.vehicleLicenseInfo.issueDate = frontInfo?.issueDate;
@@ -1219,7 +1219,8 @@ export default {
this.insuranceChange=false this.insuranceChange=false
}, },
back() { back() {
if( this.supplierId ) { this.$router.back();
/*if( this.supplierId ) {
this.$router.back(); this.$router.back();
} else { } else {
this.$router.push({ this.$router.push({
@@ -1228,10 +1229,55 @@ export default {
id: this.id id: this.id
} }
}) })
} }*/
}, },
validatePlateNumber(value) {
if (!value) {
return { valid: false, message: '请输入车牌号' }
}
const provinceList = ['京','津','冀','晋','蒙','辽','吉','黑','沪','苏','浙','皖','闽','赣','鲁','豫','鄂','湘','粤','桂','琼','渝','川','贵','云','藏','陕','甘','青','宁','新']
const firstChar = value.charAt(0)
if (!provinceList.includes(firstChar)) {
return { valid: false, message: '车牌号首位必须是省级简称(京/沪/津/渝/冀/晋/辽/吉/黑/苏/浙/皖/闽/赣/鲁/豫/鄂/湘/粤/琼/川/贵/云/陕/甘/青/蒙/桂/藏/宁/新)' }
}
if (!/^[\u4e00-\u9fa5][A-Z0-9]+$/.test(value)) {
return { valid: false, message: '车牌号只能包含汉字、字母和数字' }
}
if (![7, 8].includes(value.length)) {
return { valid: false, message: `车牌号必须为 7 位或 8 位(当前 ${value.length} 位)` }
}
return { valid: true, message: '' }
},
validateVinNo(value) {
const normalizedValue = String(value || '').toUpperCase()
if (!normalizedValue) {
return { valid: false, message: '车架号识别错误,请重新拍照上传。' }
}
if (!/^[A-NP-Z0-9]{17}$/.test(normalizedValue)) {
if (normalizedValue.includes('O')) {
return { valid: false, message: '车架号识别错误,请重新拍照上传。' }
}
if (!/^[A-NP-Z0-9]+$/.test(normalizedValue)) {
return { valid: false, message: '车架号识别错误,请重新拍照上传。' }
}
return { valid: false, message: `车架号识别错误,请重新拍照上传。` }
}
return { valid: true, message: '' }
},
async submitBtn(){ async submitBtn(){
const plateResult = this.validatePlateNumber(this.carNum)
if (!plateResult.valid) {
Dialog.alert({ message: plateResult.message })
return
}
const vinCode = String(this.vehicleLicenseInfo.vinCode || '')
const vinResult = this.validateVinNo(vinCode)
if (!vinResult.valid) {
Dialog.alert({ message: vinResult.message })
return
}
this.vehicleLicenseInfo.vinCode = vinCode
if( !this.vehicleLicenseFront ) { if( !this.vehicleLicenseFront ) {
this.$toast('行驶证主页照片不能为空') this.$toast('行驶证主页照片不能为空')
return return

View File

@@ -498,13 +498,7 @@ export default {
console.log("ii", i) console.log("ii", i)
}, },
goback() { goback() {
this.$router.push({ this.$router.back()
name: "workOrderReconciliation",
params: {
activeIndex: this.index,
queryTime: this.queryTime,
}
})
}, },
async compute() { async compute() {
if(this.orderInfo.contractSettleTypeString == '车主现收'){ if(this.orderInfo.contractSettleTypeString == '车主现收'){