Commit 5c1dde0b by chenwq

优化模版表单数据验证逻辑,仅在特定模版下处理 dayOffStatus 字段

1 parent 0afbd300
...@@ -122,19 +122,21 @@ Page({ ...@@ -122,19 +122,21 @@ Page({
} }
const pAttrList = Object.keys(allRuleObj) const pAttrList = Object.keys(allRuleObj)
console.log(tmlpCode, 'pAttrList---') console.log(tmlpCode, 'pAttrList---')
pAttrList.forEach(pAttrItem => { if (tmlpCode == 'uuid-temp-001') {
tmlpObj[pAttrItem].forEach(item => { pAttrList.forEach(pAttrItem => {
if (!item.name.includes('dayOffStatus')) { tmlpObj[pAttrItem].forEach(item => {
item.required = tmlpFormData['dayOffStatus'] == '是' ? false : true if (!item.name.includes('dayOffStatus')) {
} item.required = tmlpFormData['dayOffStatus'] == '是' ? false : true
}) }
let keyList = Object.keys(allRuleObj[pAttrItem]) })
keyList.forEach(item => { let keyList = Object.keys(allRuleObj[pAttrItem])
if (item != 'dayOffStatus' && allRuleObj[pAttrItem][item]) { keyList.forEach(item => {
allRuleObj[pAttrItem][item][0].required = tmlpFormData['dayOffStatus'] == '是' ? false : true if (item != 'dayOffStatus' && allRuleObj[pAttrItem][item]) {
} allRuleObj[pAttrItem][item][0].required = tmlpFormData['dayOffStatus'] == '是' ? false : true
}
})
}) })
}) }
console.log(tmlpObj, attr) console.log(tmlpObj, attr)
this.setData({ this.setData({
tmlpObj tmlpObj
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!