Browse Source

refactor(postConsult): 优化表单验证逻辑和初始化流程

将表单验证和文件上传初始化的逻辑分开处理,更清晰地根据字段类型和必填状态进行初始化。对于文本输入类型,仅在必填时设置验证提示;对于图片上传类型,无论是否必填都初始化fileMapList数组。
master
前端-胡立永 1 week ago
parent
commit
14a24e7e06
2 changed files with 10 additions and 6 deletions
  1. +9
    -6
      pages_order/work/postConsult.vue
  2. +1
    -0
      uni_modules/employ-front

+ 9
- 6
pages_order/work/postConsult.vue View File

@ -181,15 +181,18 @@
this.formList = res.result.employMaterialList
res.result.employMaterialList.forEach(n => {
if(n.isFill != 1){
return
}
if(n.type == 0){
this.verification[n.keyName] = '请输入' + n.title
//
if(n.isFill == 1){
this.verification[n.keyName] = '请输入' + n.title
}
this.form[n.keyName] = ''
}else{
this.verification[n.keyName] = '请上传' + n.title
// this.fileMapList[n.keyName] = []
//
if(n.isFill == 1){
this.verification[n.keyName] = '请上传' + n.title
}
// fileMapList
this.$set(this.fileMapList, n.keyName, [])
}
})


+ 1
- 0
uni_modules/employ-front

@ -0,0 +1 @@
Subproject commit a2e1192746fcce241cd52ac45b04cc8dc96f8499

Loading…
Cancel
Save