| | |
| | | return |
| | | } |
| | | |
| | | if quotation.MemberId == 0 { |
| | | userInfo := utils.GetUserInfo(c) |
| | | if userInfo.UserType == constvar.UserTypeSub { |
| | | quotation.MemberId = userInfo.CrmUserId |
| | | } |
| | | } |
| | | |
| | | errCode = quotationService.AddQuotation("ation) |
| | | if errCode != ecode.OK { |
| | | ctx.Fail(errCode) |
| | | return |
| | | } |
| | | |
| | | if params.CodeRule.Method == 1 { |
| | | autoCode := model.GetAutoCode(quotation.Id, ¶ms.CodeRule) |
| | | m := map[string]interface{}{ |
| | | "number": autoCode, |
| | | } |
| | | _ = model.NewQuotationSearch(nil).SetId(quotation.Id).Updates(m) |
| | | } |
| | | |
| | | ctx.Ok() |
| | |
| | | quotationModel.Conditions = quotation.Conditions |
| | | quotationModel.File = quotation.File |
| | | quotationModel.Products = quotation.Products |
| | | quotationModel.CodeStandID = quotation.CodeStandID |
| | | quotationModel.QuotationName = quotation.QuotationName |
| | | |
| | | return ecode.OK, quotationModel |
| | | |