Commit f8b0de28 by 张立顺

Merge branch 'SAAS+V5.4.2-1130' of http://192.168.3.233:8090/saas_plus/dj-car-bo…

…utique-work-wechat into SAAS+V5.4.2-1130
2 parents bd96d7bd edc4a55b
...@@ -77,6 +77,10 @@ export const tempRuleFnObj = { ...@@ -77,6 +77,10 @@ export const tempRuleFnObj = {
/** 本月二拓门店 */ /** 本月二拓门店 */
monthlySecondExpansionStore: { monthlySecondExpansionStore: {
ruleFn: (rule, value) => { ruleFn: (rule, value) => {
const maxValue = 1000
if (value < 0 || value > maxValue) {
return { message: `本月二拓门店请输入0-${maxValue}` }
}
return /^$|^\d{1}$|^[1-9]\d{0,3}$/.test(value) ? null : { message: '本月二拓门店请输入四位数字' } return /^$|^\d{1}$|^[1-9]\d{0,3}$/.test(value) ? null : { message: '本月二拓门店请输入四位数字' }
} }
}, },
......
...@@ -106,26 +106,37 @@ Page({ ...@@ -106,26 +106,37 @@ Page({
let { let {
attr attr
} = e.detail } = e.detail
let { tmlpFormData, tmlpObj, trainTmlpSuffix } = this.data let { tmlpFormData, tmlpObj, trainTmlpSuffix, tmlpCode } = this.data
tmlpObj['organizeTraining' + trainTmlpSuffix]?.forEach(item => { tmlpObj['organizeTraining' + trainTmlpSuffix]?.forEach(item => {
if (!item.name.includes('isTrainingOrganized')) { if (!item.name.includes('isTrainingOrganized')) {
item.isHide = tmlpFormData[attr] == '否' ? true : false item.isHide = tmlpFormData[attr] == '否' ? true : false
} }
}) })
const pAttrList = Object.keys(allRuleObj) if (allRuleObj[pAttr] && pAttr == ('organizeTraining' + trainTmlpSuffix)) {
pAttrList.forEach(pAttrItem => { let keyList = Object.keys(allRuleObj[pAttr])
tmlpObj[pAttrItem].forEach(item => {
if (!item.name.includes('dayOffStatus')) {
item.required = tmlpFormData['dayOffStatus'] == '是' ? false : true
}
})
let keyList = Object.keys(allRuleObj[pAttrItem])
keyList.forEach(item => { keyList.forEach(item => {
if (item != 'dayOffStatus' && allRuleObj[pAttrItem][item]) { if (item != ('isTrainingOrganized' + trainTmlpSuffix) && allRuleObj[pAttr][item]) {
allRuleObj[pAttrItem][item][0].required = tmlpFormData['dayOffStatus'] == '是' ? false : true allRuleObj[pAttr][item][0].required = tmlpFormData[attr] == '否' ? false : true
} }
}) })
}) }
const pAttrList = Object.keys(allRuleObj)
console.log(tmlpCode, 'pAttrList---')
if (tmlpCode == 'uuid-temp-001') {
pAttrList.forEach(pAttrItem => {
tmlpObj[pAttrItem].forEach(item => {
if (!item.name.includes('dayOffStatus')) {
item.required = tmlpFormData['dayOffStatus'] == '是' ? false : true
}
})
let keyList = Object.keys(allRuleObj[pAttrItem])
keyList.forEach(item => {
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!