Browse Source

fix: [表单签名] 弹窗验证

luojie
memorylkf 4 weeks ago
parent
commit
f4d8c923d5
7 changed files with 24 additions and 9 deletions
  1. +2
    -0
      src/main.js
  2. +12
    -4
      src/utils/ruoyi.js
  3. +2
    -1
      src/views/business/comps/common/sign.vue
  4. +1
    -1
      src/views/business/comps/template/dialog/EditSign.vue
  5. +2
    -1
      src/views/business/form/drug/comp/sign.vue
  6. +2
    -1
      src/views/business/form/nonTrial/comp/sign.vue
  7. +3
    -1
      src/views/business/study/comp/sign.vue

+ 2
- 0
src/main.js View File

@ -21,6 +21,7 @@ import { getConfigKey } from '@/api/system/config'
import { import {
parseTime, parseTime,
resetForm, resetForm,
clearFormValidate,
addDateRange, addDateRange,
selectDictLabel, selectDictLabel,
selectDictLabels, selectDictLabels,
@ -50,6 +51,7 @@ Vue.prototype.getDicts = getDicts
Vue.prototype.getConfigKey = getConfigKey Vue.prototype.getConfigKey = getConfigKey
Vue.prototype.parseTime = parseTime Vue.prototype.parseTime = parseTime
Vue.prototype.resetForm = resetForm Vue.prototype.resetForm = resetForm
Vue.prototype.clearFormValidate = clearFormValidate
Vue.prototype.addDateRange = addDateRange Vue.prototype.addDateRange = addDateRange
Vue.prototype.selectDictLabel = selectDictLabel Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.selectDictLabels = selectDictLabels Vue.prototype.selectDictLabels = selectDictLabels

+ 12
- 4
src/utils/ruoyi.js View File

@ -56,13 +56,21 @@ export function resetForm(refName) {
} }
} }
// 表单重置- 延时
export function resetFormTime(refName) {
// 表单清除验证
export function clearFormValidate(refName) {
setTimeout(() => { setTimeout(() => {
if (this.$refs[refName]) { if (this.$refs[refName]) {
this.$refs[refName].resetFields()
this.$refs[refName].clearValidate()
} }
}, 1000)
}, 100)
// if (this.$refs[refName]) {
// this.$refs[refName].clearValidate()
// }
// else {
// setTimeout(() => {
// this.clearFormValidate(refName)
// }, 100)
// }
} }
// 添加日期范围 // 添加日期范围

+ 2
- 1
src/views/business/comps/common/sign.vue View File

@ -106,7 +106,7 @@ export default {
jyksrq: selectedDate && selectedDate.length > 0 ? selectedDate[0] : '', jyksrq: selectedDate && selectedDate.length > 0 ? selectedDate[0] : '',
jyjsrq: selectedDate && selectedDate.length > 0 ? selectedDate[1] : '' jyjsrq: selectedDate && selectedDate.length > 0 ? selectedDate[1] : ''
} }
this.resetForm("signForm")
this.open = true this.open = true
this.isReson = isReson || false this.isReson = isReson || false
@ -142,6 +142,7 @@ export default {
}] }]
} }
} }
this.clearFormValidate("signForm")
}, },
cancel() { cancel() {
this.open = false this.open = false

+ 1
- 1
src/views/business/comps/template/dialog/EditSign.vue View File

@ -98,8 +98,8 @@ export default {
qmrmm:'', qmrmm:'',
} }
this.isChecked = false this.isChecked = false
this.resetForm("formEditSignForm")
this.open = true this.open = true
this.clearFormValidate("formEditSignForm")
}, },
cancel() { cancel() {
this.open = false this.open = false

+ 2
- 1
src/views/business/form/drug/comp/sign.vue View File

@ -114,7 +114,7 @@ export default {
startDate:selectedDate&&selectedDate.length>0?selectedDate[0]:'', startDate:selectedDate&&selectedDate.length>0?selectedDate[0]:'',
endDate:selectedDate&&selectedDate.length>1?selectedDate[1]:'' endDate:selectedDate&&selectedDate.length>1?selectedDate[1]:''
} }
this.resetForm("signForm")
this.open = true this.open = true
this.isReson = isReson || false this.isReson = isReson || false
@ -150,6 +150,7 @@ export default {
}] }]
} }
} }
this.clearFormValidate("signForm")
}, },
cancel() { cancel() {
this.open = false this.open = false

+ 2
- 1
src/views/business/form/nonTrial/comp/sign.vue View File

@ -114,7 +114,7 @@ export default {
startDate:selectedDate&&selectedDate.length>0?selectedDate[0]:'', startDate:selectedDate&&selectedDate.length>0?selectedDate[0]:'',
endDate:selectedDate&&selectedDate.length>1?selectedDate[1]:'' endDate:selectedDate&&selectedDate.length>1?selectedDate[1]:''
} }
this.resetForm("signForm")
this.open = true this.open = true
this.isReson = isReson || false this.isReson = isReson || false
@ -150,6 +150,7 @@ export default {
}] }]
} }
} }
this.clearFormValidate("signForm")
}, },
cancel() { cancel() {
this.open = false this.open = false

+ 3
- 1
src/views/business/study/comp/sign.vue View File

@ -114,7 +114,7 @@ export default {
startDate:selectedDate&&selectedDate.length>0?selectedDate[0]:'', startDate:selectedDate&&selectedDate.length>0?selectedDate[0]:'',
endDate:selectedDate&&selectedDate.length>1?selectedDate[1]:'' endDate:selectedDate&&selectedDate.length>1?selectedDate[1]:''
} }
this.resetForm("signForm")
this.open = true this.open = true
this.isReson = isReson || false this.isReson = isReson || false
@ -150,6 +150,8 @@ export default {
}] }]
} }
} }
this.clearFormValidate("signForm")
}, },
cancel() { cancel() {
this.open = false this.open = false

Loading…
Cancel
Save