{{ header }}
<div id="root">
  <div class="page-loader" v-show="isLoading"></div>
  <validation-observer ref="validationObserver" tag="div" v-slot="{ handleSubmit }">
    <form
      ref="form"
      @submit.prevent="handleSubmit(onSubmit)"
      action="{{ data.action }}"
      method="post">

      <the-header
        title="{{ heading_title }}"
        help="http://manual.futurasistemas.com.br/manual-do-sistema/como-configurar-o-modulo-jadlog/"
        :breadcrumbs='{{ breadcrumbs|json_encode() }}'>

        <base-button
          href="{{ data.back }}"
          apperance="outline">
          {{ button_cancel }}
        </base-button>
        <base-button
          type="submit"
          :disabled="disableForm"
          :loading="btnSubmitLoading">
          {{ button_save }}
        </base-button>

        <template #notification>
          <base-alert
            v-show="alert.type"
            :apperance="alert.type"
            @close="alert = {}">
            <span v-text="alert.message"></span>
          </base-alert>
        </template>
      </the-header>

      <div class="container-fluid">
        <div class="row">
          <div class="col-xs-12 col-sm-8 col-md-6">
            <base-card class="padding-large">

              <validation-provider
                tag="div"
                name="jadlog_nome"
                rules="required"
                v-slot="{ errors, valid }">
                <base-input
                  label="{{ entry_nome_exibicao }}"
                  name="jadlog_nome"
                  v-model="configurations.jadlog_nome"
                  :error="errors[0]"
                  :valid="valid"
                  :disabled="disableForm"
                  required>
                </base-input>
              </validation-provider>

              <validation-provider
                tag="div"
                name="jadlog_cnpj"
                class="top-margin-large"
                rules="required|cnpj"
                v-slot="{ errors, valid }">
                <base-input
                  label="{{ entry_cnpj }}"
                  name="jadlog_cnpj"
                  v-model="configurations.jadlog_cnpj"
                  mask="cnpj"
                  :error="errors[0]"
                  :valid="valid"
                  :disabled="disableForm"
                  required>
                </base-input>
              </validation-provider>

              <validation-provider
                tag="div"
                name="jadlog_senha"
                class="top-margin-large"
                rules="required"
                v-slot="{ errors, valid }">
                <base-input
                  type="password"
                  label="{{ entry_senha }}"
                  name="jadlog_senha"
                  v-model="configurations.jadlog_senha"
                  :error="errors[0]"
                  :valid="valid"
                  :disabled="disableForm"
                  required>
                </base-input>
              </validation-provider>

              <validation-provider
                tag="div"
                name="jadlog_cep"
                class="top-margin-large"
                rules="required|cep"
                v-slot="{ errors, valid }">
                <base-input
                  label="{{ entry_cep }}"
                  name="jadlog_cep"
                  v-model="configurations.jadlog_cep"
                  mask="cep"
                  :error="errors[0]"
                  :valid="valid"
                  :disabled="disableForm"
                  required>
                </base-input>
              </validation-provider>

              <validation-provider
                tag="div"
                name="jadlog_taxa"
                class="top-margin-large"
                rules=""
                v-slot="{ errors, valid }">
                <base-input
                  label="{{ entry_taxa_coleta }}"
                  name="jadlog_taxa"
                  v-model="configurations.jadlog_taxa"
                  mask="number"
                  :error="errors[0]"
                  :valid="valid"
                  :disabled="disableForm">
                </base-input>
              </validation-provider>

              <base-select
                class="top-margin-large"
                label="{{ entry_modalidade }}"
                name="jadlog_mod"
                v-model="configurations.jadlog_mod"
                :disabled="disableForm">
                {% for  key, value in Type_ModJadlog %}
                  <option value="{{ key }}">{{ value }}</option>
                {% endfor %}
              </base-select>


              <base-select
                class="top-margin-large"
                label="{{ entry_tipopeso }}"
                name="jadlog_tipo_peso"
                v-model="configurations.jadlog_tipo_peso"
                :disabled="disableForm">
                {% for  key, value in Type_JadLogPeso %}
                  <option value="{{ key }}">{{ value }}</option>
                {% endfor %}
              </base-select>

              <base-select
                class="top-margin-large"
                label="{{ entry_geo_zone }}"
                name="jadlog_geo_zone_id"
                v-model="configurations.jadlog_geo_zone_id"
                :disabled="disableForm">
                <option value="0">{{ text_all_zones }}</option>
                {% for geo_zone in geo_zones %}
                  <option value="{{ geo_zone.geo_zone_id }}">{{ geo_zone.name }}</option>
                {% endfor %}
              </base-select>
            </base-card>
          </div>

          <div class="col-xs-12 col-sm-4">
            <base-card class="padding-large">
              <base-select
                label="{{ entry_status }}"
                name="jadlog_status"
                v-model="configurations.jadlog_status"
                :disabled="disableForm">
                <option value="1">{{ text_enabled }}</option>
                <option value="0">{{ text_disabled }}</option>
              </base-select>

              <validation-provider
                tag="div"
                name="jadlog_sort_order"
                class="top-margin-large"
                rules="numeric"
                v-slot="{ errors, valid }">
                <base-input
                  label="{{ entry_sort_order }}"
                  name="jadlog_sort_order"
                  v-model="configurations.jadlog_sort_order"
                  mask="integer"
                  :error="errors[0]"
                  :valid="valid"
                  :disabled="disableForm">
                </base-input>
              </validation-provider>
            </base-card>
          </div>

        </div>
      </div>
    </form>
  </validation-observer>
</div>


<script>
  const DATA = {{ data|json_encode() }};
</script>

{{ footer }}
