Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-boutique-work-wechat
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 9ca5546e
authored
Nov 24, 2025
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化字段校验逻辑,增加空值支持并调整相关提示信息
1 parent
557ccd21
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
6 deletions
components/GLCustForm/ruleFn.js
tabWorkOrder/pages/supervisorDaily/ruleFnObj.js
tabWorkOrder/pages/supervisorDaily/supervisorDaily.js
components/GLCustForm/ruleFn.js
View file @
9ca5546
...
@@ -27,7 +27,7 @@ const checkRequired = function (obj, formRule) {
...
@@ -27,7 +27,7 @@ const checkRequired = function (obj, formRule) {
attr
attr
}
}
}
}
if
(
validFn
)
{
if
(
validFn
&&
obj
[
attr
]
!=
null
)
{
let
validObj
=
validFn
.
validator
({},
obj
[
attr
],
obj
)
let
validObj
=
validFn
.
validator
({},
obj
[
attr
],
obj
)
if
(
validObj
)
{
if
(
validObj
)
{
return
{
return
{
...
...
tabWorkOrder/pages/supervisorDaily/ruleFnObj.js
View file @
9ca5546
This diff is collapsed.
Click to expand it.
tabWorkOrder/pages/supervisorDaily/supervisorDaily.js
View file @
9ca5546
...
@@ -112,14 +112,21 @@ Page({
...
@@ -112,14 +112,21 @@ Page({
item
.
isHide
=
tmlpFormData
[
attr
]
==
'否'
?
true
:
false
item
.
isHide
=
tmlpFormData
[
attr
]
==
'否'
?
true
:
false
}
}
})
})
if
(
allRuleObj
[
pAttr
]
&&
pAttr
==
(
'organizeTraining'
+
trainTmlpSuffix
))
{
const
pAttrList
=
Object
.
keys
(
allRuleObj
)
let
keyList
=
Object
.
keys
(
allRuleObj
[
pAttr
])
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
=>
{
keyList
.
forEach
(
item
=>
{
if
(
item
!=
(
'isTrainingOrganized'
+
trainTmlpSuffix
)
&&
allRuleObj
[
pAttr
][
item
])
{
if
(
item
!=
'dayOffStatus'
&&
allRuleObj
[
pAttrItem
][
item
])
{
allRuleObj
[
pAttr
][
item
][
0
].
required
=
tmlpFormData
[
attr
]
==
'否
'
?
false
:
true
allRuleObj
[
pAttr
Item
][
item
][
0
].
required
=
tmlpFormData
[
'dayOffStatus'
]
==
'是
'
?
false
:
true
}
}
})
})
}
})
console
.
log
(
tmlpObj
,
attr
)
this
.
setData
({
this
.
setData
({
tmlpObj
tmlpObj
})
})
...
@@ -732,6 +739,11 @@ Page({
...
@@ -732,6 +739,11 @@ Page({
formJson
:
this
.
dealParams
()
formJson
:
this
.
dealParams
()
}
}
console
.
log
(
JSON
.
parse
(
params
.
formJson
),
'params-----'
)
console
.
log
(
JSON
.
parse
(
params
.
formJson
),
'params-----'
)
// 删----要给新字段加校验++++
// this.setData({
// isConfirm: false
// })
// wx.$util.showToast('提交成功')
this
.
secondConfirm
(
params
)
this
.
secondConfirm
(
params
)
},
},
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment