|  | @@ -206,8 +206,8 @@ func (d *ContractDao) Delete(projectId int, bidsectionId int, treeId int, id int
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	// 2.删除项目节上合同信息-需求变更-删除项目节
 | 
	
		
			
				|  |  | -	_, err = session.Exec("DELETE FROM `cm_tree_contracts` WHERE tree_id=?  ",
 | 
	
		
			
				|  |  | -		treeId)
 | 
	
		
			
				|  |  | +	_, err = session.Exec("DELETE FROM `cm_tree_contracts` WHERE tree_id=? and project_id = ? and bidsection_id = ? ",
 | 
	
		
			
				|  |  | +		treeId, projectId, bidsectionId)
 | 
	
		
			
				|  |  |  	if err != nil {
 | 
	
		
			
				|  |  |  		session.Rollback()
 | 
	
		
			
				|  |  |  		return errors.New("编辑合同出错-项目节删除失败")
 | 
	
	
		
			
				|  | @@ -260,21 +260,27 @@ func (d *ContractDao) DeleteExpenditure(projectId int, bidsectionId int, treeId
 | 
	
		
			
				|  |  |  		return errors.New("合同数据异常,删除失败")
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -	// 2.删除项目节上合同信息
 | 
	
		
			
				|  |  | -	_, err = session.Exec("UPDATE  cm_tree_contracts SET `contract_name` = '',`contract_code` = '',`contract_price` = 0,`contract_id` = 0,`contract_returned` = 0,`contracts_paid` = 0,`contract_status` = 0 "+
 | 
	
		
			
				|  |  | -		",contract_locking=0 where tree_id = ? and project_id = ? and bidsection_id = ? ",
 | 
	
		
			
				|  |  | +	// 2.删除项目节上合同信息--移除项目节需求变更
 | 
	
		
			
				|  |  | +	_, err = session.Exec("DELETE FROM `cm_tree_contracts` WHERE tree_id=? and project_id = ? and bidsection_id = ?  ",
 | 
	
		
			
				|  |  |  		treeId, projectId, bidsectionId)
 | 
	
		
			
				|  |  |  	if err != nil {
 | 
	
		
			
				|  |  |  		session.Rollback()
 | 
	
		
			
				|  |  | -		return errors.New("删除合同出错-项目节更新失败")
 | 
	
		
			
				|  |  | +		return errors.New("编辑合同出错-删除项目节失败")
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  | +	// _, err = session.Exec("UPDATE  cm_tree_contracts SET `contract_name` = '',`contract_code` = '',`contract_price` = 0,`contract_id` = 0,`contract_returned` = 0,`contracts_paid` = 0,`contract_status` = 0 "+
 | 
	
		
			
				|  |  | +	// 	",contract_locking=0 where tree_id = ? and project_id = ? and bidsection_id = ? ",
 | 
	
		
			
				|  |  | +	// 	treeId, projectId, bidsectionId)
 | 
	
		
			
				|  |  | +	// if err != nil {
 | 
	
		
			
				|  |  | +	// 	session.Rollback()
 | 
	
		
			
				|  |  | +	// 	return errors.New("删除合同出错-项目节更新失败")
 | 
	
		
			
				|  |  | +	// }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	// 3.删除已支付信息
 | 
	
		
			
				|  |  |  	_, err = session.Exec("DELETE FROM `cm_contracts_paid` WHERE contracts_id=? and project_id=? and bidsection_id=? ",
 | 
	
		
			
				|  |  |  		id, projectId, bidsectionId)
 | 
	
		
			
				|  |  |  	if err != nil {
 | 
	
		
			
				|  |  |  		session.Rollback()
 | 
	
		
			
				|  |  | -		return errors.New("编辑合同出错-项目节更新失败")
 | 
	
		
			
				|  |  | +		return errors.New("编辑合同出错-删除已支付失败")
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	// 4.删除附件-TODO
 |