diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/CompanyController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/CompanyController.cs index eeca1f1b5..045da684c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/CompanyController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/CompanyController.cs @@ -51,6 +51,11 @@ namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers public ActionResult GetList(string keyword) { var data = companyIBLL.GetList(keyword); + foreach (var item in data) + { + item.F_BriefIntroduction = WebHelper.HtmlDecode(item.F_BriefIntroduction); + item.F_EnrollmentInformation = WebHelper.HtmlDecode(item.F_EnrollmentInformation); + } return JsonResult(data); } /// @@ -101,9 +106,13 @@ namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers [HttpPost] [ValidateAntiForgeryToken] [AjaxOnly] - public ActionResult SaveForm(string keyValue, CompanyEntity entity) + [ValidateInput(false)] + public ActionResult SaveForm(string keyValue, string strEntity) { + CompanyEntity entity = strEntity.ToObject(); entity.SyncFlag = false; + entity.F_BriefIntroduction = WebHelper.HtmlEncode(entity.F_BriefIntroduction); + entity.F_EnrollmentInformation = WebHelper.HtmlEncode(entity.F_EnrollmentInformation); var list = companyIBLL.GetList(); if (!string.IsNullOrEmpty(keyValue)) { @@ -119,6 +128,7 @@ namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers entity.SyncFlag = false; } + list = list.Where(m => m.F_CompanyId != keyValue).ToList(); } if (list.Any(a => a.F_FullName == entity.F_FullName)) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Views/Company/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Views/Company/Form.js index 7314020ad..1605a493b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Views/Company/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Views/Company/Form.js @@ -10,6 +10,8 @@ var acceptClick; var keyValue = ''; var bootstrap = function ($, learun) { "use strict"; + var F_BriefIntroductionUE; + var F_EnrollmentInformationUE; var selectedRow = learun.frameTab.currentIframe().selectedRow; var page = { init: function () { @@ -24,15 +26,32 @@ var bootstrap = function ($, learun) { // 省市区 $('#area').lrAreaSelect(); $('#F_Photo').lrUploader(); - var F_BriefIntroductionUE = UE.getEditor('F_BriefIntroduction'); - $('#F_BriefIntroduction')[0].ue = F_BriefIntroductionUE; - var F_EnrollmentInformationUE = UE.getEditor('F_EnrollmentInformation'); - $('#F_EnrollmentInformation')[0].ue = F_EnrollmentInformationUE; + F_BriefIntroductionUE = UE.getEditor('F_BriefIntroduction'); + //$('#F_BriefIntroduction')[0].ue = F_BriefIntroductionUE; + + F_EnrollmentInformationUE = UE.getEditor('F_EnrollmentInformation'); + //$('#F_EnrollmentInformation')[0].ue = F_EnrollmentInformationUE; }, initData: function () { if (!!selectedRow) { keyValue = selectedRow.F_CompanyId; $('#form').lrSetFormData(selectedRow); + if (selectedRow.F_BriefIntroduction) { + setTimeout(function () { + F_BriefIntroductionUE.ready(function () { + F_BriefIntroductionUE.setContent(selectedRow.F_BriefIntroduction); + }); + }, 100); + + }; + if (selectedRow.F_EnrollmentInformation) { + setTimeout(function () { + F_EnrollmentInformationUE.ready(function () { + F_EnrollmentInformationUE.setContent(selectedRow.F_EnrollmentInformation); + }); + }, 100); + + }; } } }; @@ -45,7 +64,12 @@ var bootstrap = function ($, learun) { if (postData["F_ParentId"] == '' || postData["F_ParentId"] == ' ') { postData["F_ParentId"] = '0'; } - $.lrSaveForm(top.$.rootUrl + '/LR_OrganizationModule/Company/SaveForm?keyValue=' + keyValue, postData, function (res) { + postData["F_BriefIntroduction"] = F_BriefIntroductionUE.getContent(null, null, true); + postData["F_EnrollmentInformation"] = F_EnrollmentInformationUE.getContent(null, null, true); + var postDatas = { + strEntity: JSON.stringify(postData) + }; + $.lrSaveForm(top.$.rootUrl + '/LR_OrganizationModule/Company/SaveForm?keyValue=' + keyValue, postDatas, function (res) { // 保存成功后才回调 if (!!callBack) { callBack();