demo20230512/Views/Partial/LCA/DetailSurveyForm/Kitchen.cshtml
2023-05-12 10:20:28 +08:00

501 lines
24 KiB
Plaintext

<style type="text/css">
.summary {
margin-top: 80px;
}
</style>
@* the select function is provided by select-row directive*@
<div ng-controller="LCAKitchenCtrl" select-row lca-detail>
@* header *@
@* header's button style is controlled by header-content-layout, the business logic(ng-show) is controlled here *@
<div class="body_content container" style="margin-top: 0px;">
<div header-content-layout>
<div style="display:none">
<table style="width:70%">
<tr>
<td nowrap style="width: 33%">
<input class="col-sm-2" id="kitchen-own" type="radio" name="kitchenType" value="0" ng-model="kitchenType" ng-change="currentPage = 1" />
<label class="col-sm-2" for="kitchen-own">@Resource.KitchenOwn</label>
</td>
<td nowrap style="width: 33%">
<input class="col-sm-2" id="kitchen-out-source" type="radio" name="kitchenType" value="1" ng-model="kitchenType" ng-change="currentPage = 1" />
<label class="col-sm-2" for="kitchen-out-source">@Resource.KitchenOutSourcing</label>
</td>
<td nowrap style="width: 33%">
<input class="col-sm-2" id="kitchen-other" type="radio" name="kitchenType" value="2" ng-model="kitchenType" ng-change="currentPage = 1" />
<label class="col-sm-2" for="kitchen-other">@Resource.KitchenOther</label>
</td>
</tr>
</table>
</div>
<div>
<label for="yearSelect">@Resource.WarmGasType : </label>
<select name="WarmGasTypeN" id="WarmGasType"
ng-model="WarmGasType" style="width:130px"
@*ng-options="value for (key, value) in activityOptions"*@
ng-change="onWarmGasTypeChange(WarmGasType)"
class="table_text_select">
<option value="0">-- @Resource.StaticLabelGlobal_Select --</option>
<option ng-repeat="value in WarmGasTypes"
value="{{value.Id}}">
{{value.Text}}
</option>
</select>
<div style="margin: 10px 0 0 0;" ng-show="lcaDetail.isProductLCA">
<label for="Allocation">@Resource.Allocation</label>
<select name="AllocationN" id="Allocation"
ng-model="Allocation" style="width:130px"
ng-change="onAllocationChange(Allocation)"
ng-disabled="lcaDetail.Status ==5"
class="table_text_select">
<option value="-1">-- @Resource.StaticLabelGlobal_Select --</option>
<option value="99">@Resource.AllocationNon</option>
<option value="0">@Resource.AllocationWeight</option>
<option value="1">@Resource.AllocationAreaSize</option>
<option value="2">@Resource.AllocationPcsPerYear</option>
<option value="3">@Resource.AllocationEconomic</option>
<option value="4">@Resource.AllocationWorkHour</option>
</select>
<label for="Ratio">@Resource.Ratio {{Ratio}} </label>
</div>
</div>
</div>
<div header-content-layout style="margin-top: 10px;">
@*header content layout provide the general function like mouse over and background image*@
<div class="header_image_button"
ng-style="{ backgroundImage: headerLayout.header_image1 }"
ng-show="lcaDetail.Status < 5"
ng-click="createProcess()"
ng-mouseover="headerLayout.headerImageChange(1, 2)"
ng-mouseleave="headerLayout.headerImageChange(1, 1)">
<div class="tooltip" ng-show="headerLayout.show1">
<div ng-style="{ width: headerLayout.tooltipWidth(1) }">
@Resource.StaticLabelAddNew
</div>
</div>
</div>
<div class="header_image_button" ng-style="{ backgroundImage: headerLayout.header_image4 }"
ng-click="editProcess(selectRow.getSelected())"
ng-mouseover="headerLayout.headerImageChange(4, 2)"
ng-mouseleave="headerLayout.headerImageChange(4, 1)"
ng-show="selectRow.getSelected() != null">
<div class="tooltip" ng-show="headerLayout.show4">
<div ng-style="{ width: headerLayout.tooltipWidth(4) }">
@Resource.StaticLabelGlobal_Edit
</div>
</div>
</div>
<div class="header_image_button" ng-style="{ backgroundImage: headerLayout.header_image6 }"
ng-click="deleteProcess(selectRow.getSelected())"
ng-mouseover="headerLayout.headerImageChange(6, 2)"
ng-mouseleave="headerLayout.headerImageChange(6, 1)"
ng-show="selectRow.getSelected() != null">
<div class="tooltip" ng-show="headerLayout.show6">
<div ng-style="{ width: headerLayout.tooltipWidth(6) }">
@Resource.StaticLabelGlobal_Delete
</div>
</div>
</div>
<div class="header_image_button"
ng-style="{backgroundImage: headerLayout.header_image8}"
ng-click="modelBuilder.export((model | filter : { Type: kitchenType }))"
ng-mouseover="headerLayout.headerImageChange(8, 2)"
ng-mouseleave="headerLayout.headerImageChange(8, 1)">
<div class="tooltip" ng-show="headerLayout.show8">
<div ng-style="{width: tooltipWidth(8)}">
@Resource.StaticLabelExportBOM
</div>
</div>
</div>
<div class="header_image_button"
ng-style="{ backgroundImage: headerLayout.header_image9 }"
ng-click="fileImportModal.show = true;"
ng-mouseover="headerLayout.headerImageChange(9, 2)"
ng-mouseleave="headerLayout.headerImageChange(9, 1)">
<div class="tooltip" ng-show="headerLayout.show9">
<div ng-style="{ width: tooltipWidth(9) }">
@Resource.StaticLabelImprotBOM
</div>
</div>
</div>
<div class="header_image_button"
ng-style="{ backgroundImage: headerLayout.header_image17 }"
ng-click="quoteModal.show = true;"
ng-mouseover="headerLayout.headerImageChange(17, 2)"
ng-mouseleave="headerLayout.headerImageChange(17, 1)">
<div class="tooltip" ng-show="headerLayout.show17">
<div ng-style="{ width: tooltipWidth(17) }">
@Resource.StaticLabelReferenceData
</div>
</div>
</div>
<div class="header_image_button"
ng-style="{ backgroundImage: headerLayout.header_image11 }"
ng-click="search_box = !search_box"
ng-mouseover="headerLayout.headerImageChange(11, 2)"
ng-mouseleave="headerLayout.headerImageChange(11, 1)">
<div class="tooltip" ng-show="headerLayout.show11">
<div ng-style="{width: tooltipWidth(11)}">
@Resource.StaticLabelGlobal_Search
</div>
</div>
</div>
<div class="header_search" ng-show="!Table_Edit_State">
<input type="text" class="transition" ng-model="modelBuilder.searchText" ng-class="{ expand: search_box }" />
</div>
</div>
</div>
@* end of header *@
@* the body of index *@
<div class="body_content" ng-model="currentPage" ng-init="currentPage = 1">
<div class="table_overflow">
<table class="table" style="table-layout: fixed;">
<thead>
<tr class="table-active" style="text-align:center">
<th>@Resource.FactoryAndProcessItems</th>
<th>@Resource.ResponsibleUnit</th>
<th>@Resource.DeviceName</th>
<th>@Resource.Area</th>
<th>@Resource.FuelType</th>
<th>@Resource.StaticLabelGlobal_Years</th>
<th>@Resource.UsageAmount</th>
<th>@Resource.EmitPara</th>
<th>@Resource.KgCO2e</th>
</tr>
</thead>
<tbody ng-mouseleave="setHoverColumnRow(-1, -1, -1)">
<tr class="survey_order_table_row"
ng-class="{ selected: row == selectRow.getSelected() }"
ng-click="selectRow.select(row)"
ng-dblclick="editProcess(row)"
ng-repeat="row in model | filter : {Type:kitchenType} | filter : modelBuilder.searchText | smarterLimitTo : 10 : (currentPage - 1) * 10">
<td ng-bind="row.ProcessName"></td>
<td ng-bind="row.ResponsibleUnit"></td>
<td ng-bind="row.Name"></td>
<td ng-bind="row.Area"></td>
<td ng-bind="row.FuelType"></td>
<td ng-bind="row.Year" align="right"></td>
<td align="right">{{row.Scalar|number:4}}</td>
<td align="right">{{row.ParameterValue|number:10}}</td>
<td align="right">{{row.KgCO2e|number:4}}</td>
</tr>
<tr style="background-color: #F5F5F5" ng-show="(model | filter : {Type : kitchenType}).length != 0" align="right">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td align="right">{{sumKgCO2e | number:4}}</td>
</tr>
<tr style="border-bottom: solid 1px rgb(214, 214, 214);">
<td ng-show="(model | filter : {Type : kitchenType}).length == 0">
@Resource.NoData
</td>
</tr>
</tbody>
</table>
</div>
@* end of the body of index *@
<page passed-total-page="Math.ceil((model | filter : {Type : kitchenType}).length / 10)" passed-current-page="currentPage"></page>
<div class="summary">
<table class="table" style="table-layout: fixed;">
<thead>
<tr class="table-active">
<th></th>
<th></th>
<th></th>
<th></th>
<th>@Resource.FuelType</th>
<th>@Resource.KgCO2e</th>
<th ng-show="lcaDetail.isProductLCA">@Resource.AllocatedKgCO2e</th>
</tr>
</thead>
<tbody>
<tr ng-show="model.length > 0" style="background-color: #F5F5F5"
ng-repeat="sum in summary">
<td></td>
<td></td>
<td></td>
<td></td>
<td ng-bind="sum.fuelType"></td>
<td align="right">{{sum.totalKgCO2e|number:4}}</td>
<td ng-show="lcaDetail.isProductLCA" align="right">{{sum.totalKgCO2e * Ratio |number:4}}</td>
</tr>
</tbody>
</table>
</div>
@* the detail modal form *@
<form name="editForm">
<table-edit-modal display-option="modalFormOption" passed-form="editForm">
<div class="row">
<label class="col-sm-4 col-form-label">@Resource.FactoryAndProcessItems</label>
<div class="col col-sm-8">
<input type="text" ng-model="selectRow.toBeEdit.ProcessName">
</div>
<div class="validation_block"></div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">@Resource.ResponsibleUnit</label>
<div class="col col-sm-8">
<input type="text" ng-model="selectRow.toBeEdit.ResponsibleUnit">
</div>
<div class="validation_block"></div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">@Resource.DeviceName</label>
<div class="col col-sm-8">
<input type="text" ng-model="selectRow.toBeEdit.Name">
</div>
<div class="validation_block"></div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">@Resource.Area</label>
<div class="col col-sm-8">
<select name="area"
required
ng-model="selectRow.toBeEdit.Area"
ng-options="value for (key, value) in areas">
<option value="">-- @Resource.StaticLabelGlobal_Select --</option>
</select>
</div>
<div class="validation_block">
<div ng-show="editForm.area.$dirty">
<small ng-show="editForm.area.$error.required">
@Resource.SelectValidateMsg
</small>
</div>
</div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">@Resource.FuelType</label>
<div class="col col-sm-8">
<select name="fuelType"
required
ng-model="selectRow.toBeEdit.FuelType"
ng-options="value for (key, value) in fuelTypes">
<option value="">-- @Resource.StaticLabelGlobal_Select --</option>
</select>
</div>
<div class="validation_block">
<div ng-show="editForm.fuelType.$dirty">
<small ng-show="editForm.fuelType.$error.required">
@Resource.SelectValidateMsg
</small>
</div>
</div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">@Resource.ActivityDataType</label>
<div class="col col-sm-8">
<select name="activityDataType" id="activityDataType"
ng-model="selectRow.toBeEdit.activityDataType"
@*ng-options="value for (key, value) in activityOptions"*@
class="form-select">
<option value="0">-- @Resource.StaticLabelGlobal_Select --</option>
<option ng-repeat="(key, value) in activityOptions"
value="{{key}}">
{{value}}
</option>
</select>
</div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">@Resource.EmitParaType</label>
<div class="col col-sm-8">
<select name="emitParaType" id="emitParaType"
ng-model="selectRow.toBeEdit.emitParaType"
@*ng-options="value for (key, value) in emitParaOptions"*@
class="form-select">
<option value="0">-- @Resource.StaticLabelGlobal_Select --</option>
<option ng-repeat="(key, value) in emitParaOptions"
value="{{key}}">
{{value}}
</option>
</select>
</div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">@Resource.StaticLabelGlobal_Years</label>
<div class="col col-sm-8">
<select name="year"
id="edit_year"
required
ng-model="selectRow.toBeEdit.Year">
<option value="">-- @Resource.StaticLabelGlobal_Select --</option>
<option ng-repeat="year in years"
value="{{year}}">
{{year}}
</option>
</select>
</div>
<div class="validation_block">
<div ng-show="editForm.year.$dirty">
<small ng-show="editForm.year.$error.required">
@Resource.SelectValidateMsg
</small>
</div>
</div>
</div>
<div class="row" ng-show="selectRow.toBeEdit.OriHeatValue != null && selectRow.toBeEdit.OriHeatValue.trim() != ''">
<label class="col-sm-4 col-form-label">@Resource.OriHeatValue</label>
<div class="col col-sm-8">
{{selectRow.toBeEdit.OriHeatValue}}
</div>
</div>
<div class="row" ng-show="selectRow.toBeEdit.OriHeatValue != null && selectRow.toBeEdit.OriHeatValue.trim() != ''">
<label class="col-sm-4 col-form-label">@Resource.heatValue</label>
<div class="col col-sm-8">
<input type="text" ng-model="selectRow.toBeEdit.heatValue">
</div>
<div class="validation_block"></div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">@Resource.FuelConsumptionDuringInterrogation</label>
<div class="col col-sm-8">
<span class="col-sm-8 p-0">
<input name="scalar"
type="number" step="any"
placeholder="@Resource.RequiredMessage"
required
ng-model="selectRow.toBeEdit.Scalar">
</span>
<span class="col-sm-4 h-100">{{selectedUnit}}</span>
</div>
<div class="validation_block">
<div ng-show="editForm.scalar.$dirty">
<small ng-show="editForm.scalar.$error.required">
@Resource.RequiredMessage
</small>
@*<small ng-show="editForm.scalar.$error.number">
@Resource.NumberValidateMsg
</small>*@
</div>
</div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">@Resource.SupportDocumentOfUsageAmount</label>
<div class="col col-sm-8">
<input type="file" file read-file="selectFile(file)" display-option="modalFormOption">
<a class="inline_link" target="_blank"
ng-href="{{ selectRow.toBeEdit.ReferenceFileUrl }}"
ng-show="selectRow.toBeEdit.ReferenceFileUrl">
{{selectRow.toBeEdit.ReferenceFileUrl|getFileName}} @Resource.DownloadLink
</a>
</div>
<div class="validation_block"></div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">@Resource.EquipmentAndPhoto</label>
<div class="col col-sm-8">
<input type="file" file read-file="selectPhoto(file)" display-option="modalFormOption">
<a class="inline_link" target="_blank"
ng-href="{{ selectRow.toBeEdit.ReferencePhotoUrl }}"
ng-show="selectRow.toBeEdit.ReferencePhotoUrl">
{{selectRow.toBeEdit.ReferenceFileUrl|getFileName}} @Resource.DownloadLink
</a>
</div>
<div class="validation_block"></div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">@Resource.EmitPara</label>
<div class="col col-sm-8">
{{selectRow.toBeEdit.ParameterValue|number:10}}
</div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">@Resource.KgCO2e</label>
<div class="col col-sm-8">
{{selectRow.toBeEdit.KgCO2e|number:4}}
@*<input type="number" step="any" readonly="readonly" ng-model="selectRow.toBeEdit.KgCO2e">*@
</div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">@Resource.Evidence</label>
<div class="col col-sm-8">
<input type="text" ng-model="selectRow.toBeEdit.Evidence">
</div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">@Resource.Remark</label>
<div class="col col-sm-8">
<input type="text" ng-model="selectRow.toBeEdit.Description">
</div>
</div>
<div class="survey_btn_wrap">
<div class="survey_content" style="float: right">
<div class="row">
<button class="header_button"
style="float: left; margin-left: 16px;"
ng-click="dataQualityShow(selectRow.getSelected())"
ng-if="isEdit && lcaDetail.isProductLCA">
@Resource.DataQualityLevel
</button>
<button class="header_button"
style="float: left; margin-left: 16px;"
ng-click="save()"
ng-show="lcaDetail.Status < 5"
ng-disabled="editForm.$invalid">
@Resource.StaticLabelGlobal_Save
</button>
</div>
</div>
</div>
</table-edit-modal>
</form>
@* end of the detail modal form *@
<table-edit-modal display-option="fileImportModal">
<div file-import-process import-option="fileImportOptions"></div>
</table-edit-modal>
<quality display-option="dataQualityOption">
</quality>
<table-edit-modal display-option="quoteModal">
<div></div>
<div quote quote-options="quoteOptions"></div>
</table-edit-modal>
<div class="footnote">
@Html.Raw(@Resource.FootnoteKitchen.Replace("\r\n", "<br>"))
</div>
</div>
</div>