Commit e79774ac by 岑成威

fix: 签约信息字符限制

1 parent f17e9f31
...@@ -153,7 +153,7 @@ export default { ...@@ -153,7 +153,7 @@ export default {
handleSwitchChange(e, field) { handleSwitchChange(e, field) {
const switchValue = e.detail.value ? 1 : 0 const switchValue = e.detail.value ? 1 : 0
this.$set(this.formData, field.switchKey, switchValue) this.$set(this.formData, field.switchKey, switchValue)
if (switchValue === 0) { if (switchValue === 0 && field.clearRemarkOnSwitchOff !== false) {
this.$set(this.formData, field.remarkKey, '') this.$set(this.formData, field.remarkKey, '')
} }
this.$emit('switchChange', switchValue, field) this.$emit('switchChange', switchValue, field)
......
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
</template> </template>
</view> </view>
</view> </view>
<FormCell :formFields="formFields2" :formData="formData" @handleCell="handleCell" /> <FormCell :formFields="formFields2" :formData="formData" @handleCell="handleCell" @switchChange="handleSwitchChange" @blurChange="blurChange" />
<view class="upload-container"> <view class="upload-container">
<view class="form-item flex align-start justify-between"> <view class="form-item flex align-start justify-between">
<view class="from-label">身份证国徽面</view> <view class="from-label">身份证国徽面</view>
...@@ -605,7 +605,8 @@ export default { ...@@ -605,7 +605,8 @@ export default {
targetKey: 'returnSummarySwitch', targetKey: 'returnSummarySwitch',
placeholder: '请输入回单摘要', placeholder: '请输入回单摘要',
type: 'switchInput', type: 'switchInput',
maxlength: 36 maxlength: 35,
clearRemarkOnSwitchOff: false
} }
], ],
formFields3: [ formFields3: [
...@@ -623,7 +624,10 @@ export default { ...@@ -623,7 +624,10 @@ export default {
], ],
query: null, query: null,
show: false, show: false,
value1: dayjs().format('YYYY-MM-DD HH:mm:ss') value1: dayjs().format('YYYY-MM-DD HH:mm:ss'),
defaultReturnSummaryRemark: '',
returnSummaryRemarkCustomized: false,
savedReturnSummaryRemark: ''
} }
}, },
computed: { computed: {
...@@ -688,6 +692,12 @@ export default { ...@@ -688,6 +692,12 @@ export default {
console.log('signerType changed:', oldValue, '->', newValue, 'type:', typeof newValue) console.log('signerType changed:', oldValue, '->', newValue, 'type:', typeof newValue)
}, },
immediate: true immediate: true
},
'formData.returnSummaryRemark'(val) {
if (Number(this.formData.returnSummarySwitch) !== 1) {
return
}
this.syncReturnSummaryRemarkCustomized(val)
} }
}, },
onLoad(options) { onLoad(options) {
...@@ -721,10 +731,16 @@ export default { ...@@ -721,10 +731,16 @@ export default {
}) })
if (res.data.code == 0) { if (res.data.code == 0) {
uni.hideLoading() uni.hideLoading()
this.$set(this.formData, 'partAName', res.data.data.evalCarLicense.previousOwnerName) const data = res.data.data
this.$set(this.formData, 'payeeName', res.data.data.evalCarLicense.previousOwnerName) const licensePlate = data.licensePlate || (data.evalCarBase && data.evalCarBase.licensePlate) || ''
this.$set(this.formData, 'phone', res.data.data.evalCarLicense.previousOwnerPhone) this.defaultReturnSummaryRemark = licensePlate
this.$set(this.formData, 'address', res.data.data.evalCarBase.registrationProvinceName + '-' + res.data.data.evalCarBase.registrationCityName) if (Number(this.formData.returnSummarySwitch) === 1 && !this.returnSummaryRemarkCustomized) {
this.$set(this.formData, 'returnSummaryRemark', licensePlate)
}
this.$set(this.formData, 'partAName', data.evalCarLicense.previousOwnerName)
this.$set(this.formData, 'payeeName', data.evalCarLicense.previousOwnerName)
this.$set(this.formData, 'phone', data.evalCarLicense.previousOwnerPhone)
this.$set(this.formData, 'address', data.evalCarBase.registrationProvinceName + '-' + data.evalCarBase.registrationCityName)
// this.$set(this.formData, 'handoverAddress', 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 // this.evalOrderSimpleDetail = res.data.data
} else { } else {
...@@ -1124,7 +1140,40 @@ export default { ...@@ -1124,7 +1140,40 @@ export default {
this.current = this.radioList.findIndex(item => Number(item.value) === value) this.current = this.radioList.findIndex(item => Number(item.value) === value)
console.log('this.current', this.current) console.log('this.current', this.current)
}, },
handleSwitchChange(switchValue, field) {
if (field.remarkKey !== 'returnSummaryRemark') {
return
}
if (switchValue === 0) {
const current = (this.formData.returnSummaryRemark || '').trim()
if (current) {
const defaultRemark = (this.defaultReturnSummaryRemark || '').trim()
this.returnSummaryRemarkCustomized = current !== defaultRemark
if (this.returnSummaryRemarkCustomized) {
this.savedReturnSummaryRemark = this.formData.returnSummaryRemark
}
}
this.$set(this.formData, 'returnSummaryRemark', '')
return
}
const remark = this.returnSummaryRemarkCustomized ? this.savedReturnSummaryRemark || '' : this.defaultReturnSummaryRemark || ''
this.$set(this.formData, 'returnSummaryRemark', remark)
},
syncReturnSummaryRemarkCustomized(value) {
const trimmed = (value || '').trim()
const defaultRemark = (this.defaultReturnSummaryRemark || '').trim()
if (trimmed && trimmed !== defaultRemark) {
this.returnSummaryRemarkCustomized = true
this.savedReturnSummaryRemark = trimmed
} else if (!trimmed) {
this.returnSummaryRemarkCustomized = false
this.savedReturnSummaryRemark = ''
}
},
blurChange(value, field) { blurChange(value, field) {
if (field.targetKey === 'returnSummaryRemark' || field.remarkKey === 'returnSummaryRemark') {
this.syncReturnSummaryRemarkCustomized(value)
}
const signerType = Number(this.formData.signerType) const signerType = Number(this.formData.signerType)
// 个人(0)和企业委托(1):校验身份证号 // 个人(0)和企业委托(1):校验身份证号
...@@ -1739,6 +1788,10 @@ export default { ...@@ -1739,6 +1788,10 @@ export default {
delete submitData.idCardBackUrl delete submitData.idCardBackUrl
} }
if (Number(submitData.returnSummarySwitch) !== 1) {
submitData.returnSummaryRemark = ''
}
uni.showLoading() uni.showLoading()
uni.$api.evaluationApi.evalOrderSignContract({ ...submitData, evalOrderNo: this.query.evalOrderNo }).then(res => { uni.$api.evaluationApi.evalOrderSignContract({ ...submitData, evalOrderNo: this.query.evalOrderNo }).then(res => {
console.log('res:', res) console.log('res:', res)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!