新增了前端OA节点管理保存时的约束条件

This commit is contained in:
WenG 2022-04-06 23:42:15 +08:00
parent fa31875ed1
commit 1115c76216
2 changed files with 66 additions and 6 deletions

View File

@ -61,7 +61,6 @@ var FormSelectController = ['$scope', function($scope) {
$scope.property.value = '';
$scope.property.value = $scope.form.formId;
$scope.updatePropertyInModel($scope.property);
$scope.$hide();
$scope.close();
};
@ -72,7 +71,7 @@ var FormSelectController = ['$scope', function($scope) {
// Close button handler
$scope.close = function() {
$scope.$hide();
$scope.property.mode = 'read';
$scope.$hide();
};
}];

View File

@ -10,12 +10,13 @@ var OaNodeManageCtrl = ['$scope', '$modal', '$timeout', '$translate', function (
var OaNodeManagePopupCtrl = ['$scope', '$timeout', '$http', function ($scope, $timeout, $http) {
// console.log($scope.selectedItem);
// console.log($scope.editor);
console.log($scope.editor);
// console.log($scope.editor.modelMetaData.model.childShapes);
// console.log($scope.stencilItemGroups)
// 获取流程中的配置
var model = $scope.editor.modelMetaData.model;
var childShapes = model.childShapes;
var modelJson = $scope.editor.getJSON();
console.log(modelJson);
var childShapes = modelJson.childShapes;
// 关联到的属性
var multiInstanceType = $scope.selectedItem.properties[7];
var multiInstanceCollection = $scope.selectedItem.properties[9];
@ -170,7 +171,7 @@ var OaNodeManagePopupCtrl = ['$scope', '$timeout', '$http', function ($scope, $t
// 选择用户
$scope.selectAssignee = function () {
var assignee = $scope.oaNodeManage.assignee;
top.dialog.dialogData.selectedUserIds = assignee.multipleAssignees;
top.dialog.dialogData.selectedUserIds = assignee.assignee;
top.dialog.open({
url: top.restAjax.path('route/department/user/select-user', []),
title: '选择代理人【单选】',
@ -522,6 +523,66 @@ var OaNodeManagePopupCtrl = ['$scope', '$timeout', '$http', function ($scope, $t
// Click handler for save button
$scope.save = function () {
var assignee = $scope.oaNodeManage.assignee;
// 验证输入内容是否设置
if(assignee.nodeType === 'normal') {
if(assignee.assigneeType === 'appoint') {
if(assignee.assigneeCount === 'single') {
if(!assignee.assignee) {
top.dialog.msg('请选择代理人');
return;
}
}
if(assignee.assigneeCount === 'candidate') {
if(!assignee.candidates) {
top.dialog.msg('请选择候选人');
return;
}
}
}
}
if(assignee.nodeType === 'multiple') {
if(assignee.multipleType === 'parallel') {
if(assignee.completeCondition === 'customPass') {
if(!assignee.completeCount) {
top.dialog.msg('请输入完成条件中的通过人数');
return;
}
}
}
if(assignee.assigneeType === 'appoint') {
if(!assignee.multipleAssignees) {
top.dialog.msg('请选择(多实例)代理人');
return;
}
}
}
if(assignee.autoAssignType === 'scope') {
if(assignee.departmentType === 'appoint') {
if(!assignee.departments && !assignee.roles && !assignee.positions) {
top.dialog.msg('请选择部门、角色、职位中的至少一个类型');
return;
}
}
if(assignee.departmentType === 'belong') {
if(!assignee.roles && !assignee.positions) {
top.dialog.msg('请选择角色、职位中的至少一个类型');
return;
}
}
}
if(assignee.assigneeType === 'auto') {
if(assignee.autoAssignType === 'quick') {
if(assignee.quickAssignee === 'previousNStepAssigneeSubordinatePosition') {
if(!assignee.previousNStep) {
top.dialog.msg('请确认获取前哪一步的代理人');
return;
}
}
}
}
$scope.property.value = {};
$scope.property.value = $scope.oaNodeManage;
$scope.updatePropertyInModel($scope.property);