demo20230512/Views/Partial/Product/Create.cshtml
2023-05-12 10:20:28 +08:00

162 lines
8.6 KiB
Plaintext

<style>
.required:after {
content: "*";
color: red;
}
</style>
<div class="survey_form" ng-style="{ height: (Survey_Height + 2) * 28 + 24 + 'px' }" style="padding: 0 16px;">
<form name="form" style="position: relative; margin: 0 auto;" novalidate>
<div class="add_survey_body">
<div class="add_survey_header_title"></div>
<div class="survey_info">
<div class="title">
@Resource.StaticLabelProductInfo
</div>
<div class="survey_content">
<div class="row">
<label class="col-sm-2 col-form-label">@Resource.ProductName</label>
<div class="col">
<input type="text"
name="name"
placeholder="@Resource.RequiredMessage"
required
ng-model="product.Name" />
</div>
<div ng-show="form.name.$invalid && form.name.$dirty">
<small style="color:red;" ng-show="form.name.$error.required">@Resource.RequiredMessage</small>
</div>
</div>
<div class="row">
<label class="col-sm-2 col-form-label">@Resource.ProductWeight</label>
<div class="col input-group" style="flex-wrap: nowrap !important">
<input type="number" step="any" name="weight" min="0" ng-model="product.Weight" />
<div class="input-group-append">
<span class="unit">kg</span>
</div>
</div>
<div ng-show="form.weight.$invalid && form.weight.$dirty">
<small style="color:red;" ng-show="form.weight.$error.min">@Resource.PositiveNumberValidateMsg</small>
<small style="color:red;" ng-show="form.weight.$error.number">@Resource.NumberValidateMsg</small>
</div>
</div>
<div class="row">
<label class="col-sm-2 col-form-label">@Resource.ProductAreaSize</label>
<div class="col input-group" style="flex-wrap: nowrap !important">
<input type="number" step="any" name="size" min="0" ng-model="product.AreaSize" />
<div class="input-group-append">
<span class="unit">m2</span>
</div>
</div>
<div ng-show="form.size.$invalid && form.size.$dirty">
<small style="color:red;" ng-show="form.size.$error.min">@Resource.PositiveNumberValidateMsg</small>
<small style="color:red;" ng-show="form.size.$error.number">@Resource.NumberValidateMsg</small>
</div>
</div>
<div class="row">
<label class="col-sm-2 col-form-label">@Resource.ProductSerialNumber</label>
<div class="col">
<input type="text" name="serialNumber" phone-number ng-model="product.SerialNumber" />
</div>
</div>
<div class="row">
<label class="col-sm-2 col-form-label">@Resource.ProductSpec</label>
<div class="col">
<input type="text"
name="spec"
placeholder="@Resource.RequiredMessage"
required
ng-model="product.SpecDescription" />
</div>
<div ng-show="form.spec.$invalid && form.spec.$dirty">
<small style="color:red;" ng-show="form.spec.$error.required">@Resource.RequiredMessage</small>
</div>
</div>
<div class="row">
<label class="col-sm-2 col-form-label">@Resource.FunctionalUnit</label>
<div class="col">
<input type="text"
name="funUnit"
placeholder="@Resource.RequiredMessage"
required
ng-model="product.FunctionalUnit" />
</div>
<div ng-show="form.funUnit.$invalid && form.funUnit.$dirty">
<small style="color:red;" ng-show="form.funUnit.$error.required">@Resource.RequiredMessage</small>
</div>
</div>
<div class="row">
<label class="col-sm-2 col-form-label">@Resource.ProductAge</label>
<div class="col input-group" style="flex-wrap: nowrap !important">
<input type="number" step="any" placeholder="@Resource.RequiredMessage" name="age" min="0" required ng-model="product.ProductAge" />
</div>
<div ng-show="form.age.$invalid && form.age.$dirty">
<small style="color:red;" ng-show="form.age.$error.required">@Resource.RequiredMessage</small>
<small style="color:red;" ng-show="form.age.$error.min">@Resource.PositiveNumberValidateMsg</small>
<small style="color:red;" ng-show="form.age.$error.number">@Resource.NumberValidateMsg</small>
</div>
</div>
<div class="row">
<label class="col-sm-2 col-form-label">@Resource.ProductEcoFriendlySymbol</label>
<div class="col">
<input type="text" name="ecoSymbol" ng-model="product.EcoFriendlySymbol" />
</div>
</div>
<div class="row">
<label class="col-sm-2 col-form-label">@Resource.ProductEcoFriendlyDescription</label>
<div class="col">
<input type="text" name="ecoDescription" ng-model="product.EcoFriendlyDescription" />
</div>
</div>
<div class="row">
<label class="col-sm-2 col-form-label">@Resource.ProductPicture</label>
<div class="col">
<img style="cursor: pointer;"
title="upload"
ng-src="{{'@ViewBag.baseUrl/Browser_Local/img/upload_' + up + '.png'}}"
ng-init="up = 1"
ng-mouseenter="up = 2"
ng-mouseleave="up = 1"
ng-click="uploadFile()"
ng-model="productPicture" />
<input id="product-photo" type="file" style="display: none;" file read-file="selectPhoto(file)" />
</div>
</div>
<div class="row">
@*<label class="col-sm-2 col-form-label">@Resource.Browse</label>*@
<label class="col-sm-2 col-form-label"></label>
<div class="col">
<div style="width: 100%; height: 200px; text-align: center;">
<img style="max-width: 50%; max-height: 50%;" ng-show="product.PhotoUrl" ng-src="{{ product.PhotoUrl }}" />
</div>
</div>
</div>
</div>
</div>
<div class="survey_info survey_btn_wrap">
<div class="survey_content">
<div class="row">
<button class="header_button" style="float: left; margin-left: 16px;" ng-click="saveProduct()" ng-disabled="form.$invalid">
@Resource.StaticLabelGlobal_Save
</button>
<button class="header_button" style="margin-left: 16px;" ng-click="cancel()">
@Resource.StaticLabelGlobal_Cancel
</button>
</div>
</div>
</div>
</div>
</form>
</div>