FE-61: edit shop fix (#24)

This commit is contained in:
Ildar Galeev 2016-10-26 11:58:44 +03:00 committed by GitHub
parent cc85491634
commit 8fad5bd4d3
2 changed files with 10 additions and 29 deletions

View File

@ -42,35 +42,16 @@ shops.component('editShop', {
if (form.category.$dirty) { if (form.category.$dirty) {
args.categoryRef = form.category.$modelValue; args.categoryRef = form.category.$modelValue;
} }
if (form.shopDetailsName.$dirty) { if (form.shopDetailsName.$dirty || form.shopDetailsDescription.$dirty || form.shopDetailsLocation.$dirty) {
if (!args.shopDetails) { args.shopDetails = {};
args.shopDetails = {};
}
args.shopDetails.name = form.shopDetailsName.$modelValue; args.shopDetails.name = form.shopDetailsName.$modelValue;
}
if (form.shopDetailsDescription.$dirty) {
if (!args.shopDetails) {
args.shopDetails = {};
}
args.shopDetails.description = form.shopDetailsDescription.$modelValue; args.shopDetails.description = form.shopDetailsDescription.$modelValue;
}
if (form.shopDetailsLocation.$dirty) {
if (!args.shopDetails) {
args.shopDetails = {};
}
args.shopDetails.location = form.shopDetailsLocation.$modelValue; args.shopDetails.location = form.shopDetailsLocation.$modelValue;
} }
if (form.contractorRegisteredName.$dirty) { if (form.contractorRegisteredName.$dirty) {
if (!args.contractor) { args.contractor = {};
args.contractor = {};
}
args.contractor.registeredName = form.contractorRegisteredName.$modelValue; args.contractor.registeredName = form.contractorRegisteredName.$modelValue;
} args.contractor.legalEntity = '';
if (form.contractorLegalEntity.$dirty) {
if (!args.contractor) {
args.contractor = {};
}
args.contractor.legalEntity = form.contractorLegalEntity.$modelValue;
} }
return args; return args;
} }

View File

@ -8,9 +8,9 @@
form.form-horizontal.form-label-left.css-form(novalidate name="form") form.form-horizontal.form-label-left.css-form(novalidate name="form")
.form-group .form-group
label.control-label.col-md-3 Название магазина * label.control-label.col-md-3 Название магазина
.col-md-6 .col-md-6
input.form-control(type="text" ng-model="$ctrl.shopDetails.name" name="shopDetailsName" required) input.form-control(type="text" ng-model="$ctrl.shopDetails.name" name="shopDetailsName")
.form-group .form-group
label.control-label.col-md-3 Описание магазина label.control-label.col-md-3 Описание магазина
.col-md-6 .col-md-6
@ -21,18 +21,18 @@
input.form-control(type="text" ng-model="$ctrl.shopDetails.location" name="shopDetailsLocation") input.form-control(type="text" ng-model="$ctrl.shopDetails.location" name="shopDetailsLocation")
.form-group .form-group
label.control-label.col-md-3 Наименование организации * label.control-label.col-md-3 Наименование организации
.col-md-6 .col-md-6
input.form-control(type="text" ng-model="$ctrl.contractor.registeredName" name="contractorRegisteredName" required) input.form-control(type="text" ng-model="$ctrl.contractor.registeredName" name="contractorRegisteredName")
//.form-group //.form-group
// label.control-label.col-md-3 Тип юридического лица // label.control-label.col-md-3 Тип юридического лица
// .col-md-6 // .col-md-6
// input.form-control(type="text" ng-model="$ctrl.contractor.legalEntity" name="contractorLegalEntity") // input.form-control(type="text" ng-model="$ctrl.contractor.legalEntity" name="contractorLegalEntity")
.form-group .form-group
label.control-label.col-md-3 Категория * label.control-label.col-md-3 Категория
.col-md-6 .col-md-6
select.select2_multiple.form-control.custom_select(select2 ng-model="$ctrl.categoryRef" required name="category" select.select2_multiple.form-control.custom_select(select2 ng-model="$ctrl.categoryRef" name="category"
ng-options="category.categoryRef as category.name for category in $ctrl.categories") ng-options="category.categoryRef as category.name for category in $ctrl.categories")
.ln_solid .ln_solid
.form-group .form-group