234 lines
12 KiB
HTML
234 lines
12 KiB
HTML
<div class="modal-dialog modal-lg">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h5 class="modal-title">Редактирование скидки</h5>
|
||
</div>
|
||
<div class="modal-body text-center p-lg">
|
||
<form role="form" class="ng-pristine ng-valid container">
|
||
<div class="form-group row">
|
||
<div class="col-sm-12">
|
||
<input class="form-control" placeholder="Название" type="text" ng-model="currentDiscount.name">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group row">
|
||
<div class="col-sm-6">
|
||
<select class="form-control" ng-model="currentDiscount.value_type">
|
||
<option value="0">Процент</option>
|
||
<option value="1">Сумма</option>
|
||
</select>
|
||
</div>
|
||
|
||
<div class="col-sm-6">
|
||
<input class="form-control" placeholder="Значение" type="text" ng-model="currentDiscount.value">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group row" style="text-align: left">
|
||
<div class="col-sm-12">
|
||
<div class="checkbox-group" style="display: inline-block; width: auto; margin-right: 50px">
|
||
<label class="ui-switch ui-switch-md m-t-xs">
|
||
<input type="checkbox" ng-model="currentDiscount.is_enable">
|
||
<i></i>
|
||
</label>
|
||
|
||
<label class="ui-switch-info">Активна</label>
|
||
</div>
|
||
|
||
<div class="checkbox-group" style="display: inline-block; width: auto">
|
||
<label class="ui-switch ui-switch-md m-t-xs">
|
||
<input type="checkbox" ng-model="currentDiscount.is_check_all">
|
||
<i></i>
|
||
</label>
|
||
|
||
<label class="ui-switch-info">Проверять все условия</label>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<hr/>
|
||
|
||
<div class="form-group row">
|
||
<div class="col-sm-12">
|
||
<label>Время действия скидки</label>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group row">
|
||
<div class="col-sm-6">
|
||
<div class='input-group date' ui-jp="datetimepicker" ui-options="{
|
||
format: 'DD.MM.YYYY',
|
||
icons: {
|
||
time: 'fa fa-clock-o',
|
||
date: 'fa fa-calendar',
|
||
up: 'fa fa-chevron-up',
|
||
down: 'fa fa-chevron-down',
|
||
previous: 'fa fa-chevron-left',
|
||
next: 'fa fa-chevron-right',
|
||
today: 'fa fa-screenshot',
|
||
clear: 'fa fa-trash',
|
||
close: 'fa fa-remove'
|
||
}
|
||
}">
|
||
<input type='text' class="form-control" placeholder="С" ng-model="currentDiscount.start_date" />
|
||
<span class="input-group-addon">
|
||
<i class="material-icons"></i>
|
||
</span>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="col-sm-6">
|
||
<div class='input-group date' ui-jp="datetimepicker" ui-options="{
|
||
format: 'DD.MM.YYYY',
|
||
icons: {
|
||
time: 'fa fa-clock-o',
|
||
date: 'fa fa-calendar',
|
||
up: 'fa fa-chevron-up',
|
||
down: 'fa fa-chevron-down',
|
||
previous: 'fa fa-chevron-left',
|
||
next: 'fa fa-chevron-right',
|
||
today: 'fa fa-screenshot',
|
||
clear: 'fa fa-trash',
|
||
close: 'fa fa-remove'
|
||
}
|
||
}">
|
||
<input type='text' class="form-control" placeholder="По" ng-model="currentDiscount.end_date" />
|
||
<span class="input-group-addon">
|
||
<i class="material-icons"></i>
|
||
</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<hr/>
|
||
|
||
<div class="form-group row">
|
||
<label>Условия</label>
|
||
</div>
|
||
|
||
<div class="form-group row">
|
||
<div class="col-sm-9">
|
||
<select ng-model="currentDiscount.new_term_type" class="form-control">
|
||
<option ng-repeat="term in terms" value="{{ term.code }}">{{ term.name }}</option>
|
||
</select>
|
||
</div>
|
||
|
||
<div class="col-sm-3">
|
||
<button class="btn" style="width: 100%" ng-click="addTerm()">Добавить</button>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group row" ng-repeat="term in currentTerms">
|
||
<div class="col-sm-12">
|
||
<div class="term-item">
|
||
<div style="height: 30px" class="term-header" onclick="toggleTerm(this)">
|
||
<strong>
|
||
<i class="material-icons term-icon"></i> {{ term.discount_type_name }}</strong>
|
||
<button class="btn btn-xs btn-danger pull-right" ng-click="askDeleteTerm(term)" onclick="event.stopPropagation()">
|
||
<i class="material-icons"></i>
|
||
</button>
|
||
</div>
|
||
|
||
<div class="term-content">
|
||
<div class="form-group row">
|
||
<div class="col-sm-{{ 12 / term.params.length }}" ng-repeat="param in term.params">
|
||
<label>{{ param.name }}</label>
|
||
|
||
<input type="text" class="form-control" ng-model="param.value" ng-if="param.type == 'Integer'" />
|
||
|
||
<select class="form-control" ng-model="param.value" ng-if="param.type == 'Select'">
|
||
<option value="">Выбрать</option>
|
||
<option ng-repeat="option in param.options" value="{{ option.code }}">{{ option.name }}
|
||
</option>
|
||
</select>
|
||
|
||
<div ng-if="param.type == 'Time'" class='input-group date' ui-jp="datetimepicker" style="border-right: 1px solid rgba(120, 130, 140, 0.2)"
|
||
ui-options="{
|
||
format: 'LT',
|
||
icons: {
|
||
time: 'fa fa-clock-o',
|
||
date: 'fa fa-calendar',
|
||
up: 'fa fa-chevron-up',
|
||
down: 'fa fa-chevron-down',
|
||
previous: 'fa fa-chevron-left',
|
||
next: 'fa fa-chevron-right',
|
||
today: 'fa fa-screenshot',
|
||
clear: 'fa fa-trash',
|
||
close: 'fa fa-remove'
|
||
}
|
||
}">
|
||
<input type='text' class="form-control" ng-model="param.value" />
|
||
|
||
<span class="input-group-addon">
|
||
<i class="material-icons"></i>
|
||
</span>
|
||
|
||
<script type="text/javascript">
|
||
$('.date').on('dp.change', function () {
|
||
$(this).find('input').trigger('change');
|
||
});
|
||
</script>
|
||
</div>
|
||
|
||
<div ng-if="param.type == 'SelectMenuItem' || param.type == 'SelectClientItem'">
|
||
<div class="row">
|
||
<div class="col-sm-9" style="padding-right: 0">
|
||
<div style="border: 1px solid #efefef; min-height: 38px" class="form-control">
|
||
{{ param.info }}
|
||
</div>
|
||
</div>
|
||
|
||
<div class="col-sm-3" style="padding-left: 0">
|
||
<button class="btn" style="width: 100%" ng-click="editTermParam(param)">
|
||
<i class="material-icons"></i>
|
||
</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<hr/>
|
||
|
||
<div class="form-group" style="text-align: left">
|
||
<div class="checkbox-group">
|
||
<label class="ui-switch danger ui-switch-md m-t-xs">
|
||
<input type="checkbox" ng-model="term.is_term">
|
||
<i></i>
|
||
</label>
|
||
|
||
<label class="ui-switch-info">Исключающее условие</label>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn danger p-x-md pull-left" data-toggle="modal" data-target="#edit-discount-confirm-delete">
|
||
<i class="material-icons"></i>
|
||
</button>
|
||
|
||
<button type="button" class="btn dark-white p-x-md" data-dismiss="modal">Отмена</button>
|
||
<button type="button" class="btn success p-x-md" ng-click="save()">Сохранить</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<script type="text/javascript" src="/libs/js/moment/locale/ru.js"></script>
|
||
|
||
<script type="text/javascript">
|
||
function toggleTerm(el) {
|
||
var content = $(el).parent().find('.term-content');
|
||
|
||
if (content.css('display') !== 'block') {
|
||
content.slideDown('normal');
|
||
}
|
||
else {
|
||
content.slideUp('fast');
|
||
}
|
||
}
|
||
</script> |