Commit d4faf16b by cen

fix: 签约信息

1 parent a83cee68
...@@ -511,7 +511,12 @@ export default { ...@@ -511,7 +511,12 @@ export default {
sellerName: '', sellerName: '',
sellerMerchantId: '', sellerMerchantId: '',
sellerUserId: '', sellerUserId: '',
evalPrice: 0 evalPrice: 0,
// 签署人类型相关字段
handler: '',
orgLicenseNumber: '',
orgLicenseUrl: '',
thirdPartyTransactionVoucher: ''
}, },
formFields: [], formFields: [],
formFields1: [ formFields1: [
...@@ -755,9 +760,33 @@ export default { ...@@ -755,9 +760,33 @@ export default {
console.log('handleRadioChange', value, field) console.log('handleRadioChange', value, field)
// 确保值是数字类型 // 确保值是数字类型
const numValue = Number(value) const numValue = Number(value)
const oldSignerType = Number(this.formData.signerType)
// 使用 $set 确保响应式更新 // 使用 $set 确保响应式更新
this.$set(this.formData, field.targetKey, numValue) this.$set(this.formData, field.targetKey, numValue)
console.log('signerType updated to:', this.formData.signerType) console.log('signerType updated to:', this.formData.signerType)
// 切换签署人类型时,清空不相关的字段,确保字段正确初始化
if (oldSignerType !== numValue) {
// 如果切换到企业(2),清空身份证相关字段
if (numValue === 2) {
this.$set(this.formData, 'idCard', '')
this.$set(this.formData, 'idCardFrontUrl', '')
this.$set(this.formData, 'idCardBackUrl', '')
// 确保 handler 字段存在且为空字符串
if (!this.formData.hasOwnProperty('handler')) {
this.$set(this.formData, 'handler', '')
}
}
// 如果切换到个人(0)或企业委托(1),清空 handler
if (numValue === 0 || numValue === 1) {
this.$set(this.formData, 'handler', '')
}
// 如果切换到个人(0),清空营业执照相关字段
if (numValue === 0) {
this.$set(this.formData, 'orgLicenseNumber', '')
this.$set(this.formData, 'orgLicenseUrl', '')
}
}
}, },
radioChange(e) { radioChange(e) {
console.log('radioChange', e) console.log('radioChange', e)
...@@ -1456,8 +1485,9 @@ export default { ...@@ -1456,8 +1485,9 @@ export default {
return return
} }
} else { } else {
// 其他字段的校验逻辑 // 其他字段的校验逻辑:检查是否为空、0、'0'或仅包含空格
if (!value || value === 0 || value === '0') { const trimmedValue = typeof value === 'string' ? value.trim() : value
if (!trimmedValue || trimmedValue === 0 || trimmedValue === '0') {
uni.showToast({ uni.showToast({
title: `请填写${field.label}`, title: `请填写${field.label}`,
icon: 'none' icon: 'none'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!