Files
zszq-trs/YLErpWeb/Views/variety/MarginParams.cshtml
T
2024-05-09 14:06:26 +08:00

83 lines
2.7 KiB
Plaintext

@model YLErp.Modules.MarginModule.MarginParamsImportResult
@{
ViewBag.Title = "合约预付金参数";
Layout = "~/Views/Shared/_InfoLayout.cshtml";
}
@section CSS{
<style>
.templateTip dd, .templateTip dt { line-height: 22px; letter-spacing: 2px; margin-bottom: 5px; }
</style>
}
@section JS{
<script>
$(function () {
$('#form1').on('submit', function () {
var fileName = $('#openFile').val();
if (!fileName) {
return main.alert("请选择文件!");
}
return true;
});
});
window.history.replaceState(null, null, "@Url.Action("MarginParams")");
</script>
}
@if (Model != null)
{
<div class="yc-panel">
<p>@(Model.ResultMsg)</p>
</div>
foreach (System.Data.DataTable table in Model.ResultSet.Tables)
{
var index = 2;
var hasLast = false;
<div class="yc-panel">
<div class="mb-2"><strong>@(table.TableName)</strong></div>
<table class="table table-bordered">
<tbody>
<tr>
<td>1</td>
@foreach (System.Data.DataColumn col in table.Columns)
{
if (!hasLast)
{
hasLast = col.ColumnName == "处理结果";
}
<th>@(col.ColumnName)</th>
}
</tr>
@foreach (System.Data.DataRow row in table.Rows)
{
var hasError = !hasLast || !string.IsNullOrEmpty(row["处理结果"]?.ToString());
<tr class="@(hasError?"table-danger":"")">
<td>@(index++)</td>
@foreach (var item in row.ItemArray)
{
<td>@(item)</td>
}
</tr>
}
</tbody>
</table>
</div>
}
return;
}
<div class="yc-panel">
<form id="form1" method="post" action="@Url.Action("ImportMarginParams")" enctype="multipart/form-data">
<input type="file" id="openFile" name="file" accept=".xlsx" style="display:inline;" />
<button type="submit" class="btn btn-primary">导入数据</button>
<a class="btn btn-primary" href="/Download/ImportTemplate/标的品种预付金参数导入模板">模板文件</a>
</form>
</div>
<dl class="yc-panel">
<dt>导入模板说明:</dt>
<dd>--品种代码:必须填写 </dd>
<dd>--变动日期:必须填写 </dd>
</dl>