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

576 lines
29 KiB
Plaintext

@*
this view is responsible for product lca that do not select pcr
*@
<div ng-controller="LCABOMController" select-row lca-detail>
@*the 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: 10px;">
<div header-content-layout>
@*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-click="createProcess()"
ng-mouseover="headerLayout.headerImageChange(1, 2)"
ng-mouseleave="headerLayout.headerImageChange(1, 1)"
ng-show="lcaDetail.Status==1 && lcaDetail.HasProductLifeCycle_MaterialsObtained">
<div class="tooltip" ng-show="headerLayout.show1"><div ng-style="{width: headerLayout.tooltipWidth(1)}">@Resource.StaticLabelAddNew</div><div></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 && lcaDetail.HasProductLifeCycle_MaterialsObtained">
<div class="tooltip" ng-show="headerLayout.show4"><div ng-style="{width: headerLayout.tooltipWidth(4)}">@Resource.StaticLabelGlobal_Edit</div><div></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 &&
model.materials.indexOf(selectRow.getSelected()) !== -1 &&
lcaDetail.Status == 1 && lcaDetail.HasProductLifeCycle_MaterialsObtained">
<div class="tooltip" ng-show="headerLayout.show6"><div ng-style="{width: headerLayout.tooltipWidth(6)}">@Resource.StaticLabelGlobal_Delete</div><div></div></div>
</div>
<div class="header_image_button" ng-style="{backgroundImage: headerLayout.header_image3}"
ng-click="selectSimaproProcess(selectRow.getSelected())"
ng-mouseover="headerLayout.headerImageChange(3, 2)"
ng-mouseleave="headerLayout.headerImageChange(3, 1)"
ng-show="selectRow.getSelected()!=null&&selectRow.getSelected().ID!=0&& selectRow.getSelected().MaterialComposites.length==0 && lcaDetail.HasProductLifeCycle_MaterialsObtained">
<div class="tooltip" ng-show="headerLayout.show3"><div ng-style="{width: headerLayout.tooltipWidth(3)}">@Resource.StaticLabelSelectSimapro</div><div></div></div>
</div>
<div class="header_image_button" ng-style="{backgroundImage: headerLayout.header_image8}"
ng-click="modelFactory.export((model.materials|filter:searchText|orderBy:predicate:reverse),model.materialTypeOptions, 'csv', '-Direct')"
ng-mouseover="headerLayout.headerImageChange(8, 2)"
ng-mouseleave="headerLayout.headerImageChange(8, 1)"
ng-show="lcaDetail.HasProductLifeCycle_MaterialsObtained">
<div class="tooltip" ng-show="headerLayout.show8"><div ng-style="{width: headerLayout.tooltipWidth(8)}">@Resource.StaticLabelExportBOM</div><div></div></div>
</div>
<div class="header_image_button" ng-style="{backgroundImage: headerLayout.header_image9}"
ng-click="fileImportOption.show = true;"
ng-mouseover="headerLayout.headerImageChange(9, 2)"
ng-mouseleave="headerLayout.headerImageChange(9, 1)"
ng-show="lcaDetail.Status==1 && lcaDetail.HasProductLifeCycle_MaterialsObtained">
<div class="tooltip" ng-show="headerLayout.show9"><div ng-style="{ width: headerLayout.tooltipWidth(9) }">@Resource.StaticLabelImprotBOM</div><div></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)"
ng-show="lcaDetail.Status==1 && lcaDetail.HasProductLifeCycle_MaterialsObtained">
<div class="tooltip" ng-show="headerLayout.show17">
<div ng-style="{ width: headerLayout.tooltipWidth(17) }">@Resource.StaticLabelReferenceData</div><div></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)"
ng-show="lcaDetail.HasProductLifeCycle_MaterialsObtained">
<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" ng-model="searchText" ng-class="{ expand: search_box }" class="transition" />
</div>
</div>
@*<br /><br /><br />
<div class="header_title" style="line-height: 36px;">
@Resource.ProductName : {{ lcaDetail.productName }} | BOM表材料總數: {{model.materials.length}}
</div>*@
</div>
@*end of header*@
<div class="body_content" style="margin-top: 20px;">
<div class="header_title" style="line-height: 36px; float: left;">
@Resource.ProductName : {{ lcaDetail.productName }}
</div>
<div class="survey_order_btn"
ng-click="reNumber(2)">
@Resource.ReNumber
</div>
</div>
@*the body of index*@
<div class="body_content">
<div class="table_overflow">
<table class="table">
<thead>
<tr class="table-active" style="text-align:center">
<th>
@Resource.PartNumber
</th>
<th>
@Resource.MaterialName
</th>
<th>
@Resource.OrderNo
</th>
<th>
@Resource.MaterialSupplierCompany
</th>
<th>
@Resource.MaterialScalar
</th>
<th>
@Resource.StaticLabelGlobal_Unit
</th>
<th>
@Resource.UsedQuantity_BOM
</th>
<th>
@Resource.MaterialParameterValue
</th>
<th>
@Resource.ParameterUnit
</th>
<th>
@Resource.KgCO2ePerUnit
</th>
</tr>
</thead>
<tbody ng-mouseleave="setHoverColumnRow(-1, -1, -1)">
<tr class="survey_order_table_row"
ng-repeat="row in model.materials | filter: searchText"
ng-click="selectRow.select(row,null,model.materials)"
ng-dblclick="editProcess(row);"
ng-class="{ selected: row==selectRow.getSelected() }">
<td>{{ row.PartNumber }}</td>
<td>{{ row.Name }}</td>
<td>{{ row.orderNo }}</td>
<td>{{ row.SupplierCompanyName }}</td>
<td align="right">{{ row.Scalar | number : 4 }}</td>
<td>
<div ng-show="row.WeightUnit == 'mg'">@Resource.Weight_mg</div>
<div ng-show="row.WeightUnit == 'g'">@Resource.Weight_g</div>
<div ng-show="row.WeightUnit == 'kg'">@Resource.Weight_kg</div>
<div ng-show="row.WeightUnit == 't'">@Resource.Weight_t</div>
</td>
<td align="right">{{ row.Quantity }}</td>
<td align="right">{{ row.ParameterValue | number : 10 }}</td>
<td>{{ row.Unit }}</td>
<td align="right">{{ (row.KgCO2e | number : 4) == 0 ? row.KgCO2e.toExponential(4) : (row.KgCO2e | number : 4) }}</td>
</tr>
<tr style="background-color: #F5F5F5" ng-show="model.materials.length != 0" align="right">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>{{ (materialsSumKgCO2e | number : 4) == 0 ? materialsSumKgCO2e.toExponential(4) : (materialsSumKgCO2e | number : 4)}}</td>
</tr>
<tr style="border-bottom: solid 1px rgb(214, 214, 214);">
<td ng-show="model.materials.length == 0">
@Resource.NoData
</td>
</tr>
</tbody>
</table>
</div>
@*end of the body of index*@
@*the detail modal form*@
<form name="editForm">
<table-edit-modal display-option="modalFormOption" passed-form="editForm">
<div class="row" ng-show="selectRow.toBeEdit.isChild">
<label class="col-sm-4 col-form-label">@Resource.NameOfParentMaterial</label>
<div class="col col-sm-8">
{{ selectRow.toBeEdit.parentName }}
</div>
<div class="validation_block">
<div ng-show="editForm.materialType.$dirty">
<small ng-show="editForm.materialType.$error.required">
@Resource.RequiredMessage
</small>
</div>
</div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">
@Resource.Level
</label>
<div class="col col-sm-8">
<input type="text" ng-model="toBeEdit.Level">
</div>
<div class="validation_block"></div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">
@Resource.PartNumber
<span tooltip-placement="right" class="tooltip-directive" tooltip="@Resource.TooltipPartNumber"></span>
</label>
<div class="col col-sm-8">
<input type="text" required placeholder="@Resource.RequiredMessage" ng-model="toBeEdit.PartNumber">
</div>
<div class="validation_block"></div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">
@Resource.MaterialName
</label>
<div class="col col-sm-8">
<input type="text" ng-model="toBeEdit.Name">
</div>
<div class="validation_block"></div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">
@Resource.OrderNo
</label>
<div class="col col-sm-8">
<input type="text" ng-model="toBeEdit.orderNo">
</div>
<div class="validation_block"></div>
</div>
<div class="row">
<label class="col-sm-2 col-form-label">
@Resource.Length (m)
</label>
<div class="col col-sm-4">
<input name="Length"
type="number" step="any"
step="0.000001"
ng-model="toBeEdit.Length">
</div>
<label class="col-sm-2 col-form-label">
@Resource.StaticLabelGlobal_MeasureOfArea (m2)
</label>
<div class="col col-sm-4">
<input name="Area"
type="number" step="any"
step="0.000001"
ng-model="toBeEdit.Area">
</div>
</div>
<div class="row">
<label class="col-sm-2 col-form-label">
@Resource.Weight
@*<span tooltip-placement="right" class="tooltip-directive" tooltip="@Resource.TooltipMaterialScalar"></span>*@
</label>
<div class="col-sm-2 col">
<input name="Scalar"
type="number" step="any"
placeholder="@Resource.RequiredMessage"
required
step="0.000001"
ng-model="toBeEdit.Scalar"
ng-change="updateScalar()">
</div>
<div class="col-sm-2 col">
<select name="WeightUnit"
placeholder="@Resource.RequiredMessage"
ng-model="toBeEdit.WeightUnit"
ng-change="updateScalar()">
<option value="mg">mg</option>
<option value="g">g</option>
<option value="kg">kg</option>
<option value="t">t</option>
</select>
</div>
<div class="validation_block">
<div ng-show="editForm.Scalar.$dirty">
<small ng-show="editForm.Scalar.$error.required &&
!editForm.Scalar.$error.number">
@Resource.RequiredMessage
</small>
<small ng-show="editForm.Scalar.$error.number">
@Resource.NumberValidateMsg
</small>
</div>
</div>
</div>
<div class="row">
<label class="col-sm-2 col-form-label">
@Resource.StaticLabelGlobal_MeasureOfVolume
</label>
<div class="col-sm-2 col">
<input name="Volume_ml"
type="number" step="any"
step="0.000001"
ng-model="toBeEdit.Volume"
ng-change="updateDensity()">
</div>
<div class="col-sm-2 col">
<select name="WeightUnit"
placeholder="@Resource.RequiredMessage"
ng-model="toBeEdit.VolumeUnit"
ng-change="updateDensity()">
<option value="ml">ml</option>
<option value="L">L</option>
<option value="m3">m3</option>
</select>
</div>
<label class="col-sm-2 col-form-label">
@Resource.StaticLabelGlobal_MeasureOfDensity (kg/m3)
</label>
<div class="col-sm-4 col">
<input name="Density"
type="number" step="any"
step="0.000001"
readonly
ng-model="toBeEdit.Density">
<div class="validation_block">
<div ng-show="editForm.Density.$dirty">
<small ng-show="editForm.Density.$error.number">
@Resource.NumberValidateMsg
</small>
</div>
</div>
</div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">
@Resource.MaterialComposition
</label>
<div class="col col-sm-8">
<button ng-click="addComposite()" style="border: none;">@Resource.StaticLabelGlobal_New</button>
</div>
</div>
<div ng-repeat="row in toBeEdit.MaterialComposites" class="col-sm-12" style="border: ridge">
<input type="text" ng-show="false" ng-model="row.ID">
<input type="text" ng-show="false" ng-model="row.materialID">
<div class="row">
<label class="col-sm-2 col-form-label">
@Resource.MaterialComposition1
</label>
<div class="col col-sm-4">
<input type="text" required placeholder="@Resource.RequiredMessage" ng-model="row.materialComposite">
</div>
<div class="col col-sm-6">
<button ng-click="deleteComposite($index)" style="float: right; border: none;">X</button>
</div>
</div>
<div class="row">
<label class="col-sm-2 col-form-label">
@Resource.MaterialCASNumber
</label>
<div class="col col-sm-4">
<input type="text" ng-model="row.CASNo">
</div>
<label class="col-sm-2 col-form-label">
@Resource.MaterialRatio (%)
</label>
<div class="col col-sm-4">
<input type="number" required placeholder="@Resource.RequiredMessage" min="0" max="100" step="0.0001" ng-model="row.compositePercentage" ng-change="updateParameter()">
</div>
</div>
<div class="row">
<label class="col-sm-2 col-form-label">
@Resource.Parameter
</label>
<div class="col col-sm-4">
<input type="number" step="any" required placeholder="@Resource.RequiredMessage" ng-model="row.parameterValue" style="width:auto" ng-change="updateParameter()">
<div class="header_image_button simapro-image-button" style="right:0px;position:relative;float:right;margin-right:0px;width:27px"
ng-click="selectSimaproProcess_Composition(row, null, false)">
</div>
</div>
<label class="col-sm-2 col-form-label">
@Resource.ParaDesc
</label>
<div class="col col-sm-4">
<input type="text" required placeholder="@Resource.RequiredMessage" ng-model="row.parameterDescription">
</div>
</div>
</div>
<br />
<div class="row">
<label class="col-sm-4 col-form-label">
@Resource.UsedQuantity_BOM
<span tooltip-placement="right" class="tooltip-directive" tooltip="@Resource.TooltipQuantity"></span>
</label>
<div class="col col-sm-8">
<input name="Quantity"
type="number" step="any"
placeholder="@Resource.RequiredMessage"
required
ng-model="toBeEdit.Quantity"
ng-change="updateActivityIntensity();updateKgCO2e(toBeEdit);">
</div>
<div class="validation_block">
<div ng-show="editForm.Quantity.$dirty">
<small ng-show="editForm.Quantity.$error.required &&
!editForm.Quantity.$error.number">
@Resource.RequiredMessage
</small>
<small ng-show="editForm.Quantity.$error.number">
@Resource.NumberValidateMsg
</small>
</div>
</div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">
@Resource.ActivityIntensity_BOM
</label>
<div class="col col-sm-8">
<input type="text" readonly ng-model="toBeEdit.ActivityIntensity">
</div>
<div class="validation_block"></div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">
@Resource.MaterialSupplierCompany
</label>
<div class="col col-sm-8">
<input type="text" ng-model="toBeEdit.SupplierCompanyName">
</div>
<div class="validation_block"></div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">
@Resource.MaterialSupplierCompanyType
</label>
<div class="col col-sm-8">
<input type="text" ng-model="toBeEdit.SupplierCompanyType">
</div>
<div class="validation_block"></div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">
@Resource.Parameter
</label>
<div class="col col-sm-8">
<input type="number" step="any" ng-model="toBeEdit.ParameterValue" ng-readonly="toBeEdit.MaterialComposites.length>0" placeholder="@Resource.RequiredMessage" required ng-change="updateKgCO2e(toBeEdit)">
<div class="header_image_button simapro-image-button" ng-show="toBeEdit.MaterialComposites.length==0"
ng-click="selectSimaproProcess(toBeEdit, null, false)">
</div>
</div>
<div class="validation_block"></div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">
@Resource.KgCO2ePerUnit
</label>
<div class="col col-sm-8">
<input type="text" readonly ng-model="toBeEdit.KgCO2e">
</div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">
@Resource.ParameterUnit
</label>
<div class="col col-sm-8">
<input name="Unit"
type="text"
ng-model="toBeEdit.Unit">
</div>
<div class="validation_block">
</div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">
@Resource.ParaDesc
</label>
<div class="col col-sm-8">
<input type="text" ng-model="toBeEdit.ParameterDescription">
</div>
<div class="validation_block"></div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">
@Resource.ParameterSourceDesc
</label>
<div class="col col-sm-8">
<input type="text" ng-model="toBeEdit.ParaSourceDesc">
</div>
<div class="validation_block"></div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">
@Resource.MataDataDQI
</label>
<div class="col col-sm-8">
<select name="dqi"
required
ng-model="toBeEdit.DQI">
<option value="">-- @Resource.StaticLabelGlobal_Select --</option>
<option value="0">@Resource.MetaDataDQI1</option>
<option value="1">@Resource.MetaDataDQI2</option>
<option value="2">@Resource.MetaDataDQI3</option>
</select>
</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="toBeEdit.Description">
</div>
<div class="validation_block"></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">
@Resource.DataQualityLevel
</button>
<button class="header_button"
style="float: left; margin-left: 16px;"
ng-click="save()"
ng-show="lcaDetail.Status==1"
ng-disabled="editForm.$invalid">
@Resource.StaticLabelGlobal_Save
</button>
</div>
</div>
</div>
</table-edit-modal>
</form>
<table-edit-modal display-option="fileImportOption">
<div file-import-process import-option="fileImportOption"></div>
</table-edit-modal>
@*end of the detail modal form*@
@*the simapro select modal form*@
<quality display-option="dataQualityOption">
</quality>
<simapro display-option="simaproOption">
<div>@Resource.PartNumber : <span ng-bind="selectRow.getSelected().PartNumber"></span></div>
<div>@Resource.MaterialName : <span ng-bind="selectRow.getSelected().Name"></span></div>
</simapro>
<table-edit-modal display-option="quoteModal">
<p class="h4">@Resource.ReferencedMaterial</p>
<div quote quote-options="quoteOptions">
</div>
</table-edit-modal>
<div class="footnote">
@Html.Raw(@Resource.FootnoteDirectMaterial.Replace("\r\n", "<br>"))
</div>
</div>
</div>