ziwen 2 years ago
parent
commit
921ffeca1a
2 changed files with 13 additions and 4 deletions
  1. 9 4
      controller/contract/register.go
  2. 4 0
      models/fms/contract_register.go

+ 9 - 4
controller/contract/register.go

@@ -344,13 +344,14 @@ func (rg *RegisterController) Add(c *gin.Context) {
 	ob.Remark = req.Remark
 	ob.ServiceRemark = req.ServiceRemark
 	ob.HasPayment = req.HasPayment
-	ob.ActualPayCompanies = req.ActualPayCompanies
+	ob.HasInvoice = req.HasInvoice
+	ob.ActualCompanyName = req.ActualCompanyName
 	ob.Set()
 	updateCols := []string{
 		"ContractCode", "RelateContractCode", "RelateContractMainCode", "CrmContractId", "ContractSource",
 		"ProductIds", "CompanyName", "SellerId", "SellerName", "StartDate", "EndDate",
 		"RaiSellerId", "RaiSellerName", "ModifyTime", "ContractType", "ContractAmount", "CurrencyUnit", "RMBRate",
-		"SignDate", "AgreedPayTime", "ContractStatus", "RegisterStatus", "Remark", "HasPayment",
+		"SignDate", "AgreedPayTime", "ContractStatus", "RegisterStatus", "Remark", "HasPayment","HasInvoice", "ActualCompanyName",
 	}
 	// 不需要开票到款的代付直接完成登记, 且不允许进行开票/到款登记
 	if req.HasInvoice == 0 || req.ContractStatus == fms.ContractStatusEnd {
@@ -656,7 +657,7 @@ func (rg *RegisterController) Edit(c *gin.Context) {
 	updateCols := []string{
 		"ProductIds", "ContractCode", "RelateContractCode", "CrmContractId", "ContractSource", "CompanyName",
 		"SellerId", "SellerName", "ContractType", "ContractAmount", "StartDate", "EndDate", "SignDate", "AgreedPayTime", "RaiSellerId", "RaiSellerName",
-		"ContractStatus", "RegisterStatus", "Remark", "ServiceRemark", "ActualPayCompanies", "HasPayment", "ModifyTime",
+		"ContractStatus", "RegisterStatus", "Remark", "ServiceRemark", "HasPayment", "ModifyTime","HasInvoice","ActualCompanyName",
 	}
 	nowTime := time.Now().Local()
 	item.ProductIds = req.ProductIds
@@ -681,7 +682,8 @@ func (rg *RegisterController) Edit(c *gin.Context) {
 	item.Remark = req.Remark
 	item.ServiceRemark = req.ServiceRemark
 	item.HasPayment = req.HasPayment
-	item.ActualPayCompanies = req.ActualPayCompanies
+	item.HasInvoice = req.HasInvoice
+	item.ActualCompanyNames = req.ActualCompanyName
 	item.ModifyTime = nowTime
 
 	// 不需要开票到款的直接完成登记, 且不允许进行开票/到款登记
@@ -1789,6 +1791,9 @@ func (rg *RegisterController) Export(c *gin.Context) {
 		dataRow.AddCell().SetString(newCompanyMap[v.NewCompany])
 		dataRow.AddCell().SetString(fmt.Sprint(contractTMap[v.HasPayment]))
 		dataRow.AddCell().SetString(fmt.Sprint(contractSubTMap[v.ContractType]))
+		dataRow.AddCell().SetString(v.ActualCompanyName)
+		dataRow.AddCell().SetString("")
+		dataRow.AddCell().SetString("")
 		dataRow.AddCell().SetString(v.SellerName)
 		dataRow.AddCell().SetString(v.RaiSellerName)
 

+ 4 - 0
models/fms/contract_register.go

@@ -37,6 +37,7 @@ type ContractRegister struct {
 	Remark                 string    `gorm:"column:remark" json:"remark" description:"备注信息"`
 	ServiceRemark          string    `gorm:"column:service_remark" json:"service_remark" description:"套餐备注信息"`
 	HasPayment             int       `gorm:"column:has_payment" json:"has_payment" description:"是否有代付: 0-无; 1-有"`
+	HasInvoice             int       `gorm:"column:has_invoice" json:"has_invoice" description:"是否需要开票到款: 0-无; 1-有"`
 	NewCompany             int       `gorm:"column:new_company" json:"new_company" description:"是否为新客户: 0-否; 1-是"`
 	IsDeleted              int       `gorm:"column:is_deleted" json:"is_deleted" description:"是否已删除: 0-正常; 1-已删除"`
 	ActualPayCompanies string    `gorm:"column:actual_pay_companies" json:"actual_pay_companies" description:"合同关联的所有代付方名称, 英文逗号拼接"`
@@ -139,6 +140,7 @@ type ContractRegisterItem struct {
 	Remark             string  `json:"remark" description:"备注信息"`
 	ServiceRemark      string  `json:"service_remark" description:"套餐备注信息"`
 	HasPayment         int     `json:"has_payment" description:"是否有代付: 0-无; 1-有"`
+	HasInvoice         int     `json:"has_invoice" description:"是否需要开票到款: 0-无; 1-有"`
 	NewCompany         int     `json:"new_company" description:"是否为新客户: 0-否; 1-是"`
 	ActualPayCompanies string  `json:"actual_pay_companies" description:"合同关联的所有代付方名称, 英文逗号拼接"`
 	CreateTime         string  `json:"create_time" description:"登记时间"`
@@ -189,6 +191,7 @@ type ContractRegisterAddReq struct {
 	HasInvoice             int                           `json:"has_invoice" description:"是否需要开票到款流程: 0-无; 1-有"`
 	Supplement             int                           `json:"supplement" description:"是否为补录合同: 0-否; 1-是"`
 	ContractRegisterId     int                           `json:"contract_register_id" description:"登记ID"`
+	ActualCompanyName      string                        `json:"actual_company_name" description:"实际使用方"`
 	Services               []ContractServiceAddReq       `json:"services" description:"服务套餐内容"`
 	ServiceAmount          []ContractServiceAmountAddReq `json:"service_amount" description:"服务套餐金额"`
 	ActualPayCompanies string                  `json:"actual_pay_companies" description:"合同关联的所有代付方名称, 英文逗号拼接"`
@@ -425,6 +428,7 @@ func formatContractRegister2Item(item *ContractRegister) (formatItem *ContractRe
 	formatItem.Remark = item.Remark
 	formatItem.ServiceRemark = item.ServiceRemark
 	formatItem.HasPayment = item.HasPayment
+	formatItem.HasInvoice = item.HasInvoice
 	formatItem.NewCompany = item.NewCompany
 	formatItem.ActualPayCompanies = item.ActualPayCompanies
 	formatItem.CreateTime = utils.TimeTransferString(utils.FormatDateTime, item.CreateTime)