demo20230512/Areas/Certification/Views/Home/Index.cshtml

119 lines
6.0 KiB
Plaintext
Raw Normal View History

2023-05-12 10:20:28 +08:00
@using Weee.Models
@using Resources
@model IEnumerable<Weee.ViewModels.CertificationViewModel> /*CFT-30*/
@*@model IEnumerable<Weee.Models.LCA>*@@*CFT-30*@
@{
ViewBag.Title = Resource.HomePage;
Layout = "~/Areas/Certification/Views/Shared/_CertificationLayout.cshtml";
}
<div class="panel panel-default docs-panel">
<div class="tab_header">
<div class="active tab-toggle">
<div class="tab">@Resource.LCAStatusWaiting</div>
</div>
</div>
<div class="tab_content card content_bg">
<div style="align-self:flex-start">
<button class="header-button" id="upload-button-2" onclick="showModel(2)">上傳產品型申請表</button> &nbsp;&nbsp;&nbsp;
<button class="header-button" id="upload-button-1" onclick="showModel(1)">上傳組織型申請表</button> &nbsp;&nbsp;&nbsp;
</div>
<div>
@if (TempData["ErrMsg"] != null)
{
<p class="text-danger">@TempData["ErrMsg"]</p>
}
@if (TempData["SuccessMsg"] != null)
{
<p class="font-weight-bold" style="color: green;">@TempData["SuccessMsg"]</p>
}
</div>
<div style="margin: 20px">
<div class="table-responsive">
<div style="overflow-x:auto;">
<table class="table">
@*<table class="table table-bordered docs-table">*@
<tr style="color: #fff; background-color: #A1A1A1; text-align: center">
@*<tr class="certification_table_header">*@
<th>@Html.DisplayNameFor(x => x.ID)</th>
<th>@Html.DisplayNameFor(x => x.LCAname)</th>
<th>@Html.DisplayNameFor(x => x.LCAType)</th>
<th>@Html.DisplayNameFor(x => x.Description)</th>
<th>@Html.DisplayNameFor(x => x.CreatedDate)</th>
<th>@Html.DisplayNameFor(x => x.LCAitemName)</th> @*CFT-30*@
<th>@Html.DisplayNameFor(x => x.StartDate)</th>
<th>@Html.DisplayNameFor(x => x.EndDate)</th>
<th></th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>@Html.DisplayFor(x => item.ID)</td>
<td>@Html.DisplayFor(x => item.LCAname)</td>
@*<td>@Html.DisplayFor(x => item.LCATypeDisplayName)</td>*@ @*CFT-30*@
<td>@Html.DisplayFor(x => item.LCATypeName)</td> @*CFT_30*@
<td>@Html.DisplayFor(x => item.Description)</td>
<td>@Html.DisplayFor(x => item.CreatedDate)</td>
<td>@Html.DisplayFor(x => item.LCAitemName)</td>
@*CFT-30*@
<td>@item.StartDate.ToShortDateString()</td>
<td>@item.EndDate.ToShortDateString()</td>
@*@if (item.LCAType == typeof(ProductLCA))*@@*CFT-30*@
@if (item.LCATypeName == Resource.StaticLabelProductLCA) /*CFT-30*/
{
<td>@Html.ActionLink("Detail", "ProductLcaDetail", "LCA", new { id = item.ID }, null)</td>
}
//else if (item.LCAType == typeof(OrganizationLCA)) CFT-30
else if (item.LCATypeName == Resource.StaticLabelOrganizationLCA) /*CFT-30*/
{
<td>@Html.ActionLink("Detail", "OrganizationLcaDetail", "LCA", new { id = item.ID }, null)</td>
}
</tr>
}
@if (Model.Count() == 0)
{
<tr><td colspan="8">@Resource.NoData @Resource.Click@Html.ActionLink(Resource.Here, "all")@Resource.SeeHistory</td></tr>
}
</table>
</div>
</div>
</div>
</div>
</div>
@using (Html.BeginForm("UploadFileFA", "Home", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<div class="table_edit_wrap transition show_table_edit" id="file-upload-fa" style="display: none; width: 100%; height: calc(100vh + 150px); background-color: rgb(128,128,128, 0.6); position: fixed; z-index: 1001;margin-top: -150px">
<div>
<div class="edit_form" style="z-index: 1001; position: fixed; margin: auto; left: 0; right: 0; top: 30%; background-color: #eeeeee; width: 500px; border: 1px solid #bbb; border-radius: 5px; padding-bottom: 20px; box-shadow: 1px 1px 1px 1px #ddd; height: 140px;">
<div style="float:right;margin: 10px 10px;cursor: pointer;" onclick="cancel()">
<img src="~/Browser_Local/img/header_image7_1.png" alt="close" />
</div>
<div id="upload-file-result-msg" style="padding: 20px 0 10px 10px;">上傳文件:</div>
<div style="margin-left: 30px;">
<input id="fileUpload" type="file" name="uploadedFile" required/>
<input type="submit" value="@Resource.StaticLabelImport" class="btn btn-default" />
</div>
<p style="color:red;margin-top: 0;margin-left:28px;">僅支持的文件類型zip</p>
</div>
<input type="hidden" id="hdn_upd" name="updType" value=""/>
</div>
</div>
}
<script>
function showModel(updType) {
document.getElementById("hdn_upd").value = updType;
var model = document.getElementById("file-upload-fa");
model.style.display = "block";
}
function cancel() {
let box = document.getElementById('file-upload-fa');
box.style.display = 'none';
}
</script>