caipin 4 年之前
父节点
当前提交
1e48124caf
共有 1 个文件被更改,包括 21 次插入21 次删除
  1. 21 21
      services/contract_section_tree_service.go

+ 21 - 21
services/contract_section_tree_service.go

@@ -86,9 +86,9 @@ func (s *contractService) SectionAdd(sectionData *viewmodels.TreeSectionContract
 		return errors.New("未找到合同项目节")
 	}
 	// 1-1 深度为>=2才能新增项目节
-	if sectionFather.Depth < 3 {
-		return errors.New("请在项目节第三层开始编辑")
-	}
+	// if sectionFather.Depth < 3 {
+	// 	return errors.New("请在项目节第三层开始编辑")
+	// }
 	// 1-2 项目节是否有合同
 	if sectionFather.ContractId != 0 {
 		return errors.New("该项目节已存在合同")
@@ -140,9 +140,9 @@ func (s *contractService) SectionSave(sectionData *viewmodels.TreeSectionContrac
 	}
 
 	// 1-1 深度为>=2才能新增项目节
-	if section.Depth < 2 {
-		return errors.New("请在项目节第三层开始编辑")
-	}
+	// if section.Depth < 2 {
+	// 	return errors.New("请在项目节第三层开始编辑")
+	// }
 
 	// 2.保存
 	sectionCM := &models.CmTreeContracts{}
@@ -169,9 +169,9 @@ func (s *contractService) UpdateSerial(sectionData *viewmodels.TreeSectionContra
 	}
 
 	// 1-1 深度为>=2才能新增项目节
-	if section.Depth < 2 {
-		return errors.New("请在项目节第三层开始编辑")
-	}
+	// if section.Depth < 2 {
+	// 	return errors.New("请在项目节第三层开始编辑")
+	// }
 
 	err = s.treeContractDao.UpdateSerial(section, sectionData.Serial)
 	if err != nil {
@@ -189,9 +189,9 @@ func (s *contractService) SectionDelete(treeId int, bidsectionId int, projectId
 	}
 
 	// 1-1 深度为>=2才能新增项目节
-	if section.Depth < 2 {
-		return errors.New("请在项目节第三层开始编辑")
-	}
+	// if section.Depth < 2 {
+	// 	return errors.New("请在项目节第三层开始编辑")
+	// }
 	// 1-2 有合同的不能编辑(包含孩子节点)
 	contractList := s.GetSectionTreeContract(section.Attribution, section.BidsectionId, section.ProjectId)
 	if len(contractList) != 0 {
@@ -217,9 +217,9 @@ func (s *contractService) MoveDepth(sectionData *viewmodels.TreeSectionContract,
 		return errors.New("未找到合同项目节")
 	}
 	// 1-1 深度为>=2才能新增项目节
-	if section.Depth < 2 {
-		return errors.New("请在项目节第三层开始编辑")
-	}
+	// if section.Depth < 2 {
+	// 	return errors.New("请在项目节第三层开始编辑")
+	// }
 	// 1-2 有合同的不能编辑(包含孩子节点)
 	contractList := s.GetSectionTreeContract(section.Attribution, section.BidsectionId, section.ProjectId)
 	if len(contractList) != 0 {
@@ -237,9 +237,9 @@ func (s *contractService) MoveDepth(sectionData *viewmodels.TreeSectionContract,
 		elderBrother = &elderBrotherList[0]
 	} else if sectionData.Operation == "upDepth" { // 3.层级升级-只要有父亲都能升级
 		// 2-1 父节点深度为2不能升级
-		if (section.Depth - 1) < 2 {
-			return errors.New("请在项目节第三层开始编辑")
-		}
+		// if (section.Depth - 1) < 2 {
+		// 	return errors.New("请在项目节第三层开始编辑")
+		// }
 		// 获得父亲节点
 		if section.ParentId == 0 {
 			return errors.New("项目节不能升级")
@@ -269,9 +269,9 @@ func (s *contractService) MoveSerial(sectionData *viewmodels.TreeSectionContract
 		return errors.New("未找到合同项目节")
 	}
 	// 1-1 深度为>=2才能新增项目节
-	if section.Depth < 2 {
-		return errors.New("请在项目节第三层开始编辑")
-	}
+	// if section.Depth < 2 {
+	// 	return errors.New("请在项目节第三层开始编辑")
+	// }
 	// 1-2 有合同的不能编辑(包含孩子节点)
 	contractList := s.GetSectionTreeContract(section.Attribution, section.BidsectionId, section.ProjectId)
 	if len(contractList) != 0 {