@@ -113,10 +113,9 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers | |||||
[HttpPost] | [HttpPost] | ||||
[ValidateAntiForgeryToken] | [ValidateAntiForgeryToken] | ||||
[AjaxOnly] | [AjaxOnly] | ||||
public ActionResult SaveList(string mainEntity, List<FormulaChildEntity> strEntity) | |||||
public ActionResult SaveList(string MainId, List<FormulaChildEntity> strEntity) | |||||
{ | { | ||||
FormulaChildEntity model = mainEntity.ToObject<FormulaChildEntity>(); | |||||
formulaChildIBLL.SaveList(model.MainId, strEntity); | |||||
formulaChildIBLL.SaveList(MainId, strEntity); | |||||
return Success("保存成功!"); | return Success("保存成功!"); | ||||
} | } | ||||
#endregion | #endregion | ||||
@@ -86,10 +86,9 @@ var bootstrap = function ($, learun) { | |||||
}}, | }}, | ||||
{ label: "值", name: "Value", width: 100, align: "left"}, | { label: "值", name: "Value", width: 100, align: "left"}, | ||||
{ label: "排序", name: "Sort", width: 100, align: "left"}, | { label: "排序", name: "Sort", width: 100, align: "left"}, | ||||
{ label: "状态", name: "IsEnable", width: 100, align: "left", | |||||
{ label: "是否启用", name: "IsEnable", width: 100, align: "left", | |||||
formatter: function (cellvalue) { | formatter: function (cellvalue) { | ||||
return cellvalue == 0 ? "<span class=\"label label-danger\">禁用</span>" : "<span class=\"label label-success\">启用</span>"; | |||||
return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>"; | |||||
}}, | }}, | ||||
], | ], | ||||
mainId:'Id', | mainId:'Id', | ||||
@@ -19,7 +19,7 @@ var bootstrap = function ($, learun) { | |||||
bind: function () { | bind: function () { | ||||
$('#MainId').lrDataSourceSelect({ code: 'FormulaMain', value: 'id', text: 'name' }); | $('#MainId').lrDataSourceSelect({ code: 'FormulaMain', value: 'id', text: 'name' }); | ||||
$('#ProjectId').lrDataSourceSelect({ code: 'CalculateProject', value: 'id', text: 'name' }); | $('#ProjectId').lrDataSourceSelect({ code: 'CalculateProject', value: 'id', text: 'name' }); | ||||
$('#MainId').lrselectSet(keyValue); | |||||
// 新增 | // 新增 | ||||
$('#lr_add').on('click', function () { | $('#lr_add').on('click', function () { | ||||
page.addcontent(); | page.addcontent(); | ||||
@@ -61,7 +61,6 @@ var bootstrap = function ($, learun) { | |||||
$('#content1').html(''); | $('#content1').html(''); | ||||
var html = ''; | var html = ''; | ||||
if (data) { | if (data) { | ||||
$('#MainId').lrselectSet(data[0].MainId); | |||||
for (var i = 0; i < data.length; i++) { | for (var i = 0; i < data.length; i++) { | ||||
var id = learun.newGuid(); | var id = learun.newGuid(); | ||||
var html = ''; | var html = ''; | ||||
@@ -161,10 +160,10 @@ var bootstrap = function ($, learun) { | |||||
var strEntity = JSON.stringify($('body').lrGetFormData()); | var strEntity = JSON.stringify($('body').lrGetFormData()); | ||||
var postData = { | var postData = { | ||||
mainEntity: strEntity, | |||||
//mainEntity: strEntity, | |||||
strEntity: arr | strEntity: arr | ||||
}; | }; | ||||
$.lrSaveForm(top.$.rootUrl + '/LR_Desktop/FormulaChild/SaveList', postData, function (res) { | |||||
$.lrSaveForm(top.$.rootUrl + '/LR_Desktop/FormulaChild/SaveList?MainId=' + keyValue, postData, function (res) { | |||||
// 保存成功后才回调 | // 保存成功后才回调 | ||||
if (!!callBack) { | if (!!callBack) { | ||||
callBack(); | callBack(); | ||||
@@ -25,7 +25,7 @@ | |||||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | <div class=" btn-group btn-group-sm" learun-authorize="yes"> | ||||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | <a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | ||||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | <a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | ||||
<a id="lr_editgs" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑公式</a> | |||||
<a id="lr_editgs" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 设置公式</a> | |||||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | <a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | ||||
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i> 打印</a> | <a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i> 打印</a> | ||||
</div> | </div> | ||||
@@ -49,13 +49,13 @@ var bootstrap = function ($, learun) { | |||||
}); | }); | ||||
} | } | ||||
}); | }); | ||||
// 编辑公式 | |||||
// 设置公式 | |||||
$('#lr_editgs').on('click', function () { | $('#lr_editgs').on('click', function () { | ||||
var keyValue = $('#gridtable').jfGridValue('Id'); | var keyValue = $('#gridtable').jfGridValue('Id'); | ||||
if (learun.checkrow(keyValue)) { | if (learun.checkrow(keyValue)) { | ||||
learun.layerForm({ | learun.layerForm({ | ||||
id: 'form', | id: 'form', | ||||
title: '编辑', | |||||
title: '设置公式', | |||||
url: top.$.rootUrl + '/LR_Desktop/FormulaMain/FormChild?keyValue=' + keyValue, | url: top.$.rootUrl + '/LR_Desktop/FormulaMain/FormChild?keyValue=' + keyValue, | ||||
width: 600, | width: 600, | ||||
height: 500, | height: 500, | ||||
@@ -88,17 +88,16 @@ var bootstrap = function ($, learun) { | |||||
$('#gridtable').jfGrid({ | $('#gridtable').jfGrid({ | ||||
url: top.$.rootUrl + '/LR_Desktop/FormulaMain/GetPageList', | url: top.$.rootUrl + '/LR_Desktop/FormulaMain/GetPageList', | ||||
headData: [ | headData: [ | ||||
{ label: "名称", name: "Name", width: 100, align: "left" }, | |||||
{ label: "名称", name: "Name", width: 150, align: "left" }, | |||||
{ label: "公式", name: "Result", width: 250, align: "left" }, | |||||
{ label: "排序", name: "Sort", width: 100, align: "left" }, | { label: "排序", name: "Sort", width: 100, align: "left" }, | ||||
{ label: "描述", name: "Desc", width: 200, align: "left" }, | |||||
{ | { | ||||
label: "状态", name: "IsEnable", width: 100, align: "left", | label: "状态", name: "IsEnable", width: 100, align: "left", | ||||
formatter: function (cellvalue) { | formatter: function (cellvalue) { | ||||
return cellvalue == 0 ? "<span class=\"label label-danger\">禁用</span>" : "<span class=\"label label-success\">启用</span>"; | |||||
return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>"; | |||||
} | } | ||||
}, | |||||
{ label: "公式", name: "Result", width: 250, align: "left" }, | |||||
{ label: "描述", name: "Desc", width: 100, align: "left" } | |||||
} | |||||
], | ], | ||||
mainId: 'Id', | mainId: 'Id', | ||||
isPage: true | isPage: true | ||||