/// <summary> /// 根据计划来源显示发布人信息 /// </summary> /// <param name="sourceId"></param> /// <param name="operatorInfo"></param> /// <param name="ShowPublisher"></param> /// <returns></returns> protected string GetOperatorInfo(object sourceId, object operatorInfo, object sourceCompanyName) { string str = "<a data-class='paopao' data-sourceId='{1}' data-operId='{2}'>{0}</a>"; if (sourceId == null || sourceId.ToString().Trim() == "") { if (operatorInfo != null) { EyouSoft.Model.TourStructure.MOperatorInfo info = (EyouSoft.Model.TourStructure.MOperatorInfo)operatorInfo; str = string.Format(str, info.Name, "", info.OperatorId); } } else { if (sourceCompanyName != null) { str = string.Format(str, sourceCompanyName, sourceId, ""); } } return(str); }
/// <summary> /// 保存新的报价 /// </summary> /// <returns></returns> private string PageSave() { string msg = string.Empty; #region 获取表单 //线路区域编号 int areaID = Utils.GetInt(Utils.GetFormValue("sltArea")); //线路编号 string routeID = Utils.GetFormValue(this.hideRouteID.UniqueID); //线路名称 string routeName = Utils.GetFormValue(this.txt_RouteName.UniqueID); //天数 int days = Utils.GetInt(Utils.GetFormValue(this.txt_Days.UniqueID)); //客源地 国家 int countryID = Utils.GetInt(Utils.GetFormValue("sltCountry")); //客源地 省份 int provinceID = Utils.GetInt(Utils.GetFormValue("sltProvince")); //询价单位 编号 string buyCompanyID = Utils.GetFormValue(this.UC_CustomerUnitSelect.ClientNameKHBH); //询价单位 名称 string buyCompanyName = Utils.GetFormValue(this.UC_CustomerUnitSelect.ClientNameKHMC); //联系人 string contactName = Utils.GetFormValue(this.txt_Contact.UniqueID); //联系电话 string contactTel = Utils.GetFormValue(this.txt_ConTel.UniqueID); //销售员编号 string sellsID = Utils.GetFormValue(this.UC_SellsSelect.SellsIDClient); //销售员名称 string sellsName = Utils.GetFormValue(this.UC_SellsSelect.SellsNameClient); //报价员 取当前登录用户 EyouSoft.Model.TourStructure.MOperatorInfo operatorModel = new EyouSoft.Model.TourStructure.MOperatorInfo(); operatorModel.OperatorId = this.SiteUserInfo.UserId; operatorModel.Name = this.SiteUserInfo.Name; operatorModel.Phone = this.SiteUserInfo.Telephone; //成人数 int adultCount = Utils.GetInt(Utils.GetFormValue(this.txt_Adult.UniqueID)); //成人价格 decimal adultPrice = Utils.GetDecimal(Utils.GetFormValue(this.txtAdultPrice.UniqueID)); //儿童数 int childCount = Utils.GetInt(Utils.GetFormValue(this.txt_Child.UniqueID)); //儿童价格 decimal childPrice = Utils.GetDecimal(Utils.GetFormValue(this.txtChildPrice.UniqueID)); //其它价格 decimal otherPrice = Utils.GetDecimal(Utils.GetFormValue(this.txtOtherPrice.UniqueID)); //行程特色 string planContent = Utils.EditInputText(Request.Form[this.txtPlanContent.UniqueID]); //价格备注 string quoteRemark = Utils.GetFormValue(this.txtQuoteRemark.UniqueID); //合计金额 decimal sumPrice = Utils.GetDecimal(Utils.GetFormValue(this.txtSumPrice.UniqueID)); //询价员 string toOper = Utils.GetFormValue("hideToOperID"); #region 未超限表单获取 //出团时间 DateTime successDateBegin = Utils.GetDateTime(Utils.GetFormValue(this.txtSuccessDateBegin.UniqueID), DateTime.Now); //出发交通 string successsStraffBegin = Utils.GetFormValue(this.txtSuccesssStraffBegin.UniqueID); //返回交通 string successsStraffEnd = Utils.GetFormValue(this.txtSuccesssStraffEnd.UniqueID); //集合方式 string successGather = Utils.GetFormValue(this.txtSuccessGather.UniqueID); //增加费用 decimal successAddPrice = Utils.GetDecimal(Utils.GetFormValue(this.txtSuccessAddPrice.UniqueID), 0); //增加费用备注 string successAddPriceRemark = Utils.GetFormValue(this.txtSuccessAddPriceRemark.UniqueID); //减少费用 decimal successReducePrice = Utils.GetDecimal(Utils.GetFormValue(this.txtSuccessReducePrice.UniqueID)); //减少费用备注 string successReducePriceRemark = Utils.GetFormValue(this.txtSuccessReducePriceRemark.UniqueID); //导游现收 decimal successGuideIncome = Utils.GetDecimal(Utils.GetFormValue(this.txtSuccessGuideIncome.UniqueID)); //订单备注 string successOrderRemark = Utils.GetFormValue(this.txtSuccessOrderRemark.UniqueID); //是否询价 bool isPlanerQuote = Utils.GetFormValue(this.cbxJdxj.UniqueID) == "on" ? true : false; //签证附件(新) string[] visaUpload = Utils.GetFormValues(this.UploadControl1.ClientHideID); string[] oldVisaUpload = Utils.GetFormValues("hideVisaFile"); //联系人部门编号 string contactDeptId = Utils.GetFormValue(this.hideContactDeptId.UniqueID); #endregion #endregion //1=保存,2=报价超限,3=报价未超,4=保存新报价 string saveType = Utils.GetQueryStringValue("saveType"); //如果是保存和保存新报价 则不做控制 if (saveType == "1" || saveType == "4") { #region 表单后台验证 if (areaID == 0) { msg = "请选择线路区域!"; } if (routeName == "") { msg += "<br />请输入线路名称!"; } if (days == 0) { msg += "<br />请输入天数!"; } if (buyCompanyID == "") { msg += "<br />请输入询价单位!"; } if (sellsID == "") { msg += "<br />请输入销售员!"; } if (adultCount == 0) { msg += "<br />请输入成人数!"; } if (adultPrice == 0) { msg += "<br />请输入成人价!"; } if (msg != "") { return(UtilsCommons.AjaxReturnJson("0", msg)); } #endregion } EyouSoft.BLL.TourStructure.BQuote bll = new EyouSoft.BLL.TourStructure.BQuote(); EyouSoft.Model.TourStructure.MTourQuoteInfo model = new EyouSoft.Model.TourStructure.MTourQuoteInfo(); string act = Utils.GetQueryStringValue("act"); string qid = Utils.GetQueryStringValue("id"); model.AdultPrice = adultPrice; model.Adults = adultCount; model.AdvanceApp = null; model.AreaId = areaID; model.BuyCompanyID = buyCompanyID; model.BuyCompanyName = buyCompanyName; model.IsPlanerQuote = isPlanerQuote; model.ChildPrice = childPrice; model.Childs = childCount; model.CompanyId = SiteUserInfo.CompanyId; model.CompanyInfo = new EyouSoft.Model.TourStructure.MCompanyInfo() { CompanyId = buyCompanyID, CompanyName = buyCompanyName, Contact = contactName, Phone = contactTel }; model.Contact = contactName; string costCalculation = string.Empty; EyouSoft.Model.TourStructure.MTourService tourService = UtilsCommons.GetTourService(out costCalculation); model.TourService = tourService; model.CostCalculation = costCalculation; model.CountryId = countryID; model.Days = days; model.InquiryTime = DateTime.Now; model.IsPlanerQuote = false; model.MTourQuoteTourInfo = null; model.OperatorInfo = new EyouSoft.Model.TourStructure.MOperatorInfo(); model.OperatorInfo.OperatorId = this.SiteUserInfo.UserId; model.OperatorInfo.Name = this.SiteUserInfo.Name; model.OperatorInfo.Phone = this.SiteUserInfo.Telephone; model.OtherCost = otherPrice; if (isPlanerQuote) { model.PlanerId = toOper; } #region 签证附件 IList <EyouSoft.Model.ComStructure.MComAttach> visaList = null; if (visaUpload.Length > 0) { visaList = new List <EyouSoft.Model.ComStructure.MComAttach>(); for (int i = 0; i < visaUpload.Length; i++) { if (visaUpload[i].Trim() != "") { if (visaUpload[i].Split('|').Length > 1) { EyouSoft.Model.ComStructure.MComAttach visaModel = new EyouSoft.Model.ComStructure.MComAttach(); visaModel.Downloads = 0; visaModel.FilePath = visaUpload[i].Split('|')[1]; visaModel.ItemType = EyouSoft.Model.EnumType.ComStructure.AttachItemType.报价签证资料; visaModel.Name = visaUpload[i].Split('|')[0]; visaModel.Size = 0; visaList.Add(visaModel); } } } } if (oldVisaUpload.Length > 0) { if (visaList == null) { visaList = new List <EyouSoft.Model.ComStructure.MComAttach>(); } for (int i = 0; i < oldVisaUpload.Length; i++) { EyouSoft.Model.ComStructure.MComAttach visaModel = new EyouSoft.Model.ComStructure.MComAttach(); visaModel.Downloads = Utils.GetInt(oldVisaUpload[i].Split('|')[2]); visaModel.FilePath = oldVisaUpload[i].Split('|')[1]; visaModel.ItemType = EyouSoft.Model.EnumType.ComStructure.AttachItemType.报价签证资料; visaModel.Name = oldVisaUpload[i].Split('|')[0]; visaModel.Size = 0; visaList.Add(visaModel); } } model.VisaFileList = visaList; #endregion Dictionary <string, object> quoteType = UtilsCommons.GetServiceType(); bool IsTourOrSubentry = (bool)quoteType["IsTourOrSubentry"]; if (IsTourOrSubentry) { //整团 model.ServiceStandard = quoteType["Service"].ToString(); model.OutQuoteType = EyouSoft.Model.EnumType.TourStructure.TourQuoteType.整团; } else { //分项 model.TourTeamPrice = (IList <EyouSoft.Model.TourStructure.MTourTeamPrice>)quoteType["Service"]; model.OutQuoteType = EyouSoft.Model.EnumType.TourStructure.TourQuoteType.分项; } model.Phone = contactTel; model.ContactDepartId = contactDeptId; model.PlanFeature = planContent; model.ProvinceId = provinceID; model.QuotePlan = UtilsCommons.GetPlanList(); model.QuoteRemark = quoteRemark; model.QuoteState = EyouSoft.Model.EnumType.TourStructure.QuoteState.未处理; model.QuoteType = (EyouSoft.Model.EnumType.TourStructure.ModuleType)(type - 1); model.RouteId = routeID; model.RouteName = routeName; model.TotalPrice = sumPrice; model.QuoteId = qid; //获得销售员信息实体 EyouSoft.Model.ComStructure.MComUser sellsModel = new EyouSoft.BLL.ComStructure.BComUser().GetModel(sellsID, SiteUserInfo.CompanyId); if (sellsModel != null) { model.SaleInfo = new EyouSoft.Model.TourStructure.MSaleInfo(); model.SaleInfo.SellerId = sellsID; model.SaleInfo.Name = sellsName; model.SaleInfo.Phone = sellsModel.ContactMobile; model.SaleInfo.DeptId = sellsModel.DeptId; } bool result = false; //新增,修改,复制 if (saveType == "1") { if (act == "add" || act == "copy") { model.ParentId = "0"; result = bll.AddTourQuote(model); msg = UtilsCommons.AjaxReturnJson("1", "新增报价成功,正在跳转.."); } if (act == "update") { model.QuoteId = qid; model.UpdateTime = DateTime.Now; result = bll.UpdateTourQuote(model); msg = UtilsCommons.AjaxReturnJson("1", "修改成功,正在跳转.."); } } //超限实体赋值 if (saveType == "2") { model.AdvanceApp = new EyouSoft.Model.TourStructure.MAdvanceApp(); model.AdvanceApp.Applier = this.SiteUserInfo.Name; model.AdvanceApp.ApplierId = this.SiteUserInfo.UserId; //model.AdvanceApp.DisburseAmount = applyPrice; //model.AdvanceApp.ApplyTime = applyDateTime; model.AdvanceApp.DeptId = this.SiteUserInfo.DeptId; //model.AdvanceApp.Remark = applyRemarks; model.MTourQuoteTourInfo = null; int r = bll.SuccessTourQuote(model); result = (r == 1 || r == 3) ? true : false; msg = UtilsCommons.AjaxReturnJson("1", "成功提交垫付申请,等待审核!"); } //未超限实体赋值 if (saveType == "3") { model.MTourQuoteTourInfo = new EyouSoft.Model.TourStructure.MTourQuoteTourInfo(); model.MTourQuoteTourInfo.AddCostRemark = successAddPriceRemark; model.MTourQuoteTourInfo.Gather = successGather; model.MTourQuoteTourInfo.GuideIncome = successGuideIncome; model.MTourQuoteTourInfo.LDate = successDateBegin; model.MTourQuoteTourInfo.LTraffic = successsStraffBegin; model.MTourQuoteTourInfo.OrderRemark = successOrderRemark; model.MTourQuoteTourInfo.ReduceCostRemark = successReducePriceRemark; model.MTourQuoteTourInfo.RTraffic = successsStraffEnd; model.MTourQuoteTourInfo.SaleAddCost = successAddPrice; model.MTourQuoteTourInfo.SaleReduceCost = successReducePrice; model.MTourQuoteTourInfo.SalerIncome = sumPrice - successGuideIncome; model.AdvanceApp = null; switch (type) { case 1: model.MTourQuoteTourInfo.TourType = EyouSoft.Model.EnumType.TourStructure.TourType.组团团队; model.MTourQuoteTourInfo.Traveller = UtilsCommons.GetTravelList(); break; case 2: model.MTourQuoteTourInfo.TourType = EyouSoft.Model.EnumType.TourStructure.TourType.地接团队; model.MTourQuoteTourInfo.Traveller = UtilsCommons.GetTravelList(); break; case 3: model.MTourQuoteTourInfo.TourType = EyouSoft.Model.EnumType.TourStructure.TourType.出境团队; model.MTourQuoteTourInfo.Traveller = UtilsCommons.GetTravelListS(); break; } model.MTourQuoteTourInfo.TourStatus = EyouSoft.Model.EnumType.TourStructure.TourStatus.销售未派计划; model.UpdateTime = DateTime.Now; int successState = bll.SuccessTourQuote(model); switch (successState) { case 2: msg = UtilsCommons.AjaxReturnJson("1", "报价成功!"); result = true; break; case 4: msg = UtilsCommons.AjaxReturnJson("0", "操作失败!"); break; case 5: msg = UtilsCommons.AjaxReturnJson("2", "报价成功,但销售员超限!,是否需要进行收款操作?"); result = true; break; case 6: msg = UtilsCommons.AjaxReturnJson("2", "报价成功,但客户单位超限!,是否需要进行收款操作?"); result = true; break; case 7: msg = UtilsCommons.AjaxReturnJson("2", "报价成功,但销售员和客户单位超限!,是否需要进行收款操作?"); result = true; break; default: msg = UtilsCommons.AjaxReturnJson("0", "操作失败!"); break; } if (successState == 1) { msg = UtilsCommons.AjaxReturnJson("0", "超限、垫付申请中,不能报价!"); } if (successState == 2) { msg = UtilsCommons.AjaxReturnJson("1", "报价成功!"); result = true; } } if (saveType == "4") { model.ParentId = Utils.GetFormValue(this.hideFristQuoteId.UniqueID); result = bll.AddNewTourQuote(model); msg = UtilsCommons.AjaxReturnJson("1", "新增新报价成功,正在跳转.."); } if (saveType == "5") { result = bll.CalcelTourQuote(qid, Utils.GetFormValue("txtCanelRemark")); msg = UtilsCommons.AjaxReturnJson("1", "取消成功,正在跳转.."); } if (!result) { msg = UtilsCommons.AjaxReturnJson("0", "操作失败,请稍后尝试!"); } return(msg); //model.CancelReason = ""; //model.IsLatest //model.OrderCode = ""; //model.OrderId = ""; //model.Planer //model.TimeCount //model.TotalPrice //model.TourPrice //model.TourQuoteNo //model.UpdateTime //model.VisaFileList }