diff --git a/src/views/workflow/task/TaskForm.vue b/src/views/workflow/task/TaskForm.vue index 7c97e8e..b9a7df8 100644 --- a/src/views/workflow/task/TaskForm.vue +++ b/src/views/workflow/task/TaskForm.vue @@ -57,6 +57,7 @@ :labelCol="{ style: { width: '90px' } }" :wrapperCol="{ style: { width: '100%' } }" :model="state.auditForm" + :rules="state.rulesRef" :scrollToFirstError="true" > @@ -83,7 +84,6 @@
- 审批 + 审批 驳回
@@ -226,10 +225,11 @@ mesCode: string, mesName: string, // 抄送用户ID - userIds: string, + userIds: string[], // 任务代理人ID assignee: string, }, + rulesRef: Recordable; } /** 通用变量统一声明区域 */ @@ -272,8 +272,12 @@ message: '', mesCode: '', mesName: '', - userIds: '', + userIds: [], assignee: '' + }, + rulesRef: { + assignee: [{ required: true, whitespace: true, message: '用户不能为空', validateTrigger: 'blur' }], + userIds: [{ required: true, type: 'array', message: '用户不能为空', validateTrigger: 'blur' }] } }); const { currentRoute, push } = useRouter(); @@ -282,6 +286,7 @@ const { close } = useTabs(); const formPreview = ref(); const workflowChart = ref(); + const auditForm = ref(); const [registerModal, { openModal }] = useModal(); const [registerRollBackTask , { openModal: openRollBackTask }] = useModal(); onActivated(() => { @@ -340,8 +345,8 @@ state.formReadOnly = query.formReadOnly === 'true'; state.isCC = false; state.isAssign = false; - state.auditForm.assignee = ''; - state.auditForm.userIds = ''; + state.auditForm.assignee = '1510539584287346688'; + state.auditForm.userIds = ['1510539584287346688']; state.auditForm.message = ''; } @@ -350,7 +355,7 @@ if (state.isCC && state.auditForm.userIds) { //this.$refs['auditForm'].validate((valid) => { //if (valid) { - saveWorkflowCopy(state.auditForm.userIds, { + saveWorkflowCopy(state.auditForm.userIds.join(','), { processDefId: state.processDefId, processInsId: data.processInsId, processDefName: '', @@ -613,6 +618,10 @@ } } + function test() { + auditForm.value.validate(); + } + diff --git a/src/views/workflow/task/popups/UserPicker/index.vue b/src/views/workflow/task/popups/UserPicker/index.vue index ce25456..1672685 100644 --- a/src/views/workflow/task/popups/UserPicker/index.vue +++ b/src/views/workflow/task/popups/UserPicker/index.vue @@ -68,7 +68,7 @@ fieldMapToTime: [['dateRange', ['beginTime', 'endTime'], 'YYYY-MM-DD']] }, maxHeight: 450, - rowSelection: { type: 'checkbox' }, + rowSelection: { type: props.limit == 1 ? 'radio' : 'checkbox' }, useSearchForm: true, showTableSetting: true, bordered: true,