Преглед изворни кода

修复第一次保存失败报错后第二次直接会update

临城职教中职
liangkun пре 2 година
committed by ndbs
родитељ
комит
0ba95cb616
2 измењених фајлова са 20 додато и 7 уклоњено
  1. +14
    -5
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_FormModule/Controllers/CustmerformController.cs
  2. +6
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/NWFProcess/NWFContainerForm.js

+ 14
- 5
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_FormModule/Controllers/CustmerformController.cs Прегледај датотеку

@@ -1,4 +1,5 @@
using Learun.Application.Form;
using System;
using Learun.Application.Form;
using Learun.Util; using Learun.Util;
using System.Collections.Generic; using System.Collections.Generic;
using System.Web.Mvc; using System.Web.Mvc;
@@ -331,12 +332,20 @@ namespace Learun.Application.Web.Areas.LR_FormModule.Controllers
[ValidateInput(false)] [ValidateInput(false)]
public ActionResult SaveInstanceForms(string data) public ActionResult SaveInstanceForms(string data)
{ {
List<SaveModel> list = data.ToObject<List<SaveModel>>();
foreach (var item in list)
try
{ {
formSchemeIBLL.SaveInstanceForm(item.schemeInfoId, item.processIdName, item.keyValue, item.formData);
List<SaveModel> list = data.ToObject<List<SaveModel>>();
foreach (var item in list)
{
formSchemeIBLL.SaveInstanceForm(item.schemeInfoId, item.processIdName, item.keyValue, item.formData);
}
return Success("保存成功!");
} }
return Success("保存成功!");
catch (Exception e)
{
return Fail("sql执行错误,数据溢出");
}
} }
/// <summary> /// <summary>
/// 删除自定义表单数据 /// 删除自定义表单数据


+ 6
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/NWFProcess/NWFContainerForm.js Прегледај датотеку

@@ -1730,14 +1730,18 @@ var bootstrap = function ($, learun) {
formData[_item.field] = processId; formData[_item.field] = processId;
point.formData = JSON.stringify(formData); point.formData = JSON.stringify(formData);
formDataList.push(point); formDataList.push(point);
_item.isUpdate = true;
//liangkun 修复第一次保存失败报错后第二次直接会update
//_item.isUpdate = true;
} }
}); });


if (formDataList.length > 0) { if (formDataList.length > 0) {
$.lrSaveForm(top.$.rootUrl + '/LR_FormModule/Custmerform/SaveInstanceForms', { data: JSON.stringify(formDataList) }, function (res) { $.lrSaveForm(top.$.rootUrl + '/LR_FormModule/Custmerform/SaveInstanceForms', { data: JSON.stringify(formDataList) }, function (res) {
if (res.code == 200) { if (res.code == 200) {
//liangkun 修复第一次保存失败报错后第二次直接会update
$.each(nwfForms, function (_index, _item) {
_item.isUpdate = true;
});
monitorSave(); monitorSave();
} }
else { else {


Loading…
Откажи
Сачувај