update 驳回备注验证
This commit is contained in:
+12
-1
@@ -279,6 +279,8 @@ export default {
|
||||
},
|
||||
// 获取页面参数
|
||||
async getPageParams (isValidate = true) {
|
||||
// 去除备注必填
|
||||
this.validatorRules.remarks.rules[0].required = false
|
||||
if (this.$refs.inspectionProcessTable.dataSource.length === 0) {
|
||||
this.$message.warning(this.$t('addAtLeastOneRowOfData'))
|
||||
throw new Error('base')
|
||||
@@ -440,6 +442,15 @@ export default {
|
||||
*/
|
||||
handleReject () {
|
||||
if (this.loading) return
|
||||
// 备注设置必填并校验(校验第一次正常,第二次校验就不提示,force配置项解决问题)
|
||||
this.validatorRules.remarks.rules[0].required = true
|
||||
this.$nextTick(() => {
|
||||
this.approvalInfoForm.validateFields(['commitText'], { force: true }, (err) => {
|
||||
if (err) {
|
||||
this.switchChange('base')
|
||||
}
|
||||
})
|
||||
})
|
||||
// 驳回需要填写备注
|
||||
if (!this.approvalInfoForm.getFieldValue('commitText')) {
|
||||
this.$message.warning(this.$t('pleaseEnterRemarks'))
|
||||
@@ -473,7 +484,7 @@ export default {
|
||||
for (const form of formList) {
|
||||
promiseList.push(
|
||||
new Promise((resolve, reject) => {
|
||||
form.validateFields((err, val) => {
|
||||
form.validateFields({ force: true }, (err, val) => {
|
||||
if (!err) {
|
||||
resolve(val)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user