114 lines
4.4 KiB
Plaintext
114 lines
4.4 KiB
Plaintext
@{
|
||
ViewBag.Title = "预付金模板列表";
|
||
Layout = "~/Views/Shared/_MainLayout.cshtml";
|
||
}
|
||
|
||
@section JS{
|
||
<script type="text/javascript">
|
||
var g_grid = {};
|
||
$(function () {
|
||
@Html.Raw(JqGridSimple.OutGrid("/margin_template/margin_templateGroupQuery"));
|
||
g_grid = jQuery('#listGrid');
|
||
function keyEnter(event) {
|
||
try {
|
||
var e = event ? event : (window.event ? window.event : null);
|
||
(e.keyCode == 13) && SearchClick(true);
|
||
} catch (e) { }
|
||
}
|
||
document.onkeydown = keyEnter;
|
||
});
|
||
|
||
var colModelGrid = [{
|
||
name: '', label: '操作', index: '', width: 130, formatter: showToolName,sortable:false
|
||
}, {
|
||
name: 'id', label: 'id', index: 'id', width: 1, hidden: true
|
||
}, {
|
||
name: 'EncryptId', label: 'EncryptId', index: 'EncryptId', width: 1, hidden: true
|
||
}, {
|
||
name: 'Name', label: '名称', index: 'Name', width: 120
|
||
}, {
|
||
name: 'MarginType', label: '类型', index: 'MarginType', width: 180, formatter: marginTypeFormat
|
||
}, {
|
||
name: 'InitialMarginRatio', label: '初始预付金率', index: 'InitialMarginRatio', width: 120, formatter: percentFmt
|
||
}, {
|
||
name: 'PositionMarginRatio', label: '持仓预付金率', index: 'PositionMarginRatio', width: 120, formatter: percentFmt
|
||
}, {
|
||
name: 'Comments', label: '备注', index: 'Comments', width: 120
|
||
}];
|
||
|
||
function showToolName(cellValue, options, rowObject) {
|
||
var imageHtml ="<input type=\"button\" class=\"wentiEdit\" onclick=\"startmargin_templateView('{0}')\" value=\"{1}\" />".template(rowObject.EncryptId, "查看")
|
||
imageHtml += "<input type=\"button\" value=\"删除\" class=\"wentiEdit\" onclick=\"deletemargin_template('" + rowObject.EncryptId + "');\" />";
|
||
return imageHtml;
|
||
}
|
||
|
||
function marginTypeFormat(cellValue, options, rowObject) {
|
||
if (cellValue == 2) {
|
||
return "按固定预付金率";
|
||
}
|
||
else if (cellValue == 3) {
|
||
return "按浮动盈亏和初始名义本金";
|
||
}
|
||
else if (cellValue == 4) {
|
||
return "按浮动盈亏和持仓名义本金";
|
||
} else if (cellValue==5)
|
||
return "Max(0,Span幅度估值)";
|
||
else if (cellValue == 6)
|
||
return "Max(初始预付金,Span幅度估值)";
|
||
return "";
|
||
}
|
||
|
||
function percentFmt(cellvalue, options, rowObject) {
|
||
return cellvalue ? (cellvalue * 100).toFixed(2) + '%' : '';
|
||
}
|
||
|
||
function startAddmargin_template() {
|
||
var addurl = "/margin_template/margin_templateEdit/0";
|
||
main.infopage("新增预付金模板", addurl, { area: ['540px', '60%'] });
|
||
}
|
||
function startmargin_templateView(id) {
|
||
var srcurl = "/margin_template/margin_templateView/?enid=" + id;
|
||
main.infopage("查看预付金模板", srcurl,{ area: ['540px', '60%'] });
|
||
}
|
||
|
||
function deletemargin_template(encryptId) {
|
||
if (confirm("确定删除吗?")) {
|
||
$.ajax({
|
||
type: "Post",
|
||
url: "/margin_template/Deletemargin_template",
|
||
data: { encryptId: encryptId },
|
||
success: function (data) {
|
||
showmiddlemessage(data.msg);
|
||
if (data.success == true) {
|
||
$('#listGrid').trigger('reloadGrid');
|
||
}
|
||
},
|
||
error: function (msg) {
|
||
alert("error:" + msg);
|
||
}
|
||
});
|
||
}
|
||
}
|
||
|
||
function reloadmargin_template() {
|
||
//重新加载
|
||
SearchClick();
|
||
}
|
||
|
||
function SearchClick(isSearchclick) {
|
||
var listGrid = $('#listGrid');
|
||
|
||
if (typeof (isSearchclick) != "undefined" && isSearchclick) {
|
||
//点击搜索时默认第一页
|
||
listGrid.jqGrid('setGridParam', {page: 1});
|
||
}
|
||
listGrid.trigger('reloadGrid');
|
||
}
|
||
</script>
|
||
}
|
||
|
||
<div class="searchdiv">
|
||
@MyControls.SearchBtn()
|
||
@MyControls.Btn("新增", "startAddmargin_template()")
|
||
</div>
|
||
@Html.Raw(JqGridSimple.OutTable()) |