caipin 4 年 前
コミット
4eccd04850
2 ファイル変更5 行追加5 行削除
  1. 2 2
      web/api/contract_api.go
  2. 3 3
      web/viewmodels/contract.go

+ 2 - 2
web/api/contract_api.go

@@ -205,7 +205,6 @@ func (c *ContractApi) GetIncome() {
 // @Param   bidsectionId     path    string     true        "标段ID"
 // @Param   code     path    string     true        "合同编号"
 // @Param   name     path    string     true        "合同名称"
-// @Param   sectionName     path    string     true        "项目节名称"
 // @Param   contractsType     path    int     true        "合同类型(1)"
 // @Param   price     path    string     true        "合同金额"
 // @Success 200 {object} viewmodels.TreeSectionContract "{code:0成功,-1参数类错误,msg:错误信息}"
@@ -239,7 +238,7 @@ func (c *ContractApi) PostIncomeCreate() {
 
 	sectionData := &viewmodels.TreeSectionContract{}
 	sectionData.Id = contractData.TreeId
-	sectionData.Name = contractData.Name
+	sectionData.Name = " "
 	sectionResult, err := c.ServiceContract.SectionAdd(sectionData, bidsectionId, projectIdInt, 0)
 	if err != nil {
 		c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
@@ -379,6 +378,7 @@ func (c *ContractApi) Delete() {
 		return
 	}
 
+	// 删除合同
 	err = c.ServiceContract.Delete(projectIdInt, bidsectionId, treeId, id)
 	if err != nil {
 		c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})

+ 3 - 3
web/viewmodels/contract.go

@@ -34,10 +34,10 @@ type Contracts struct {
 	SignerTime   string `form:"signerTime" json:"signerTime" `
 	Remarks      string `form:"remarks" json:"remarks" `
 
-	SectionName string `form:"sectionName" json:"sectionName" `
+	// SectionName string `form:"sectionName" json:"sectionName" `
 
 	// 前端需要
-	TreeType string `form:"treeType" json:"treeType" `
+	TreeType int `form:"treeType" json:"treeType"`
 }
 
 // 验证方法
@@ -50,7 +50,7 @@ func (l Contracts) ValidateAdd() error {
 		//validation.Field(&l.ContractsType, validation.Required.Error("合同类型不能为空"), validation.In(1, 2).Error("未找到相关合同类型")),
 		validation.Field(&l.Price, validation.Required.Error("合同金额不能为空")),
 
-		validation.Field(&l.SectionName, validation.Required.Error("项目名称不能为空")),
+		// validation.Field(&l.SectionName, validation.Required.Error("项目名称不能为空")),
 	)
 }