|
@@ -19,6 +19,7 @@ import WorkTable from './WorkTable.vue'
|
|
|
import FamilyTable from './familyTable.vue'
|
|
|
import SchoolTable from './SchoolTable.vue'
|
|
|
import PerformanceTable from './performanceTable.vue'
|
|
|
+import { FormRequiredValidate } from '@/utils/formRequiredValidate'
|
|
|
|
|
|
const formConfigList = getConfigDict()
|
|
|
|
|
@@ -98,17 +99,54 @@ const { mutate: generateStaffNumber } = useMutation({
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+const message = useMessage()
|
|
|
+const ruleFields = [
|
|
|
+ {
|
|
|
+ name: 'khyh',
|
|
|
+ message: '开户行不能为空!'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'yhzh',
|
|
|
+ message: '银行卡号不能为空!'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'cardid',
|
|
|
+ message: '证件号码不能为空!'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'sfzyxq',
|
|
|
+ message: '有效期不能为空!'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'jjlxrxm',
|
|
|
+ message: '紧急联系人姓名不能为空!'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'jjlxrhm',
|
|
|
+ message: '紧急联系人电话不能为空!'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'jjlxrgx',
|
|
|
+ message: '紧急联系人关系不能为空!'
|
|
|
+ }
|
|
|
+]
|
|
|
/**表单保存 */
|
|
|
const submitForm = (formEl: FormInstance | undefined) => {
|
|
|
// console.log('formData.value', formData.value)
|
|
|
// return
|
|
|
if (!formEl) return
|
|
|
- formEl.validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- addUserMutate(formData.value)
|
|
|
- } else {
|
|
|
- return false
|
|
|
+
|
|
|
+ FormRequiredValidate.validate(ruleFields)(formData.value, (state, obj) => {
|
|
|
+ if (state) {
|
|
|
+ formEl.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ addUserMutate(formData.value)
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
+ obj && message.error(obj['message'])
|
|
|
})
|
|
|
}
|
|
|
|