{% extends 'base/module.twig' %}

{% block attributes_the_header %}
help="http://manual.futurasistemas.com.br/manual-do-sistema/processo-de-vendas-na-loja-virtual-faq91/"
{% endblock %}

{% block content %}

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

          <div v-if="!errorCeo">
            <validation-provider
              tag="div"
              name="processo_venda_status"
              v-slot="{ errors, valid }">
              <base-select
                name="processo_venda_status"
                label="{{ entry_processo_venda_status }}"
                v-model="configurations.processo_venda_status"
                :valid="valid"
                :disabled="disableForm"
                @change="handleConfigurations">
                <option v-for="(value, key) in Type_DsimDnao.getEnumList()" :value="key">{ value }</option>
              </base-select>
            </validation-provider>

            <validation-provider
              v-if="configurations.processo_venda_status == 1"
              tag="div"
              class="top-padding-large"
              name="processo_venda_order_status_started"
              v-slot="{ errors, valid }">
              <base-select
                name="processo_venda_order_status_started"
                label="{{ entry_sales_order_status }}"
                v-model="configurations.processo_venda_order_status_started"
                :valid="valid"
                :disabled="disableForm">
                <option
                  v-for="order_status in order_statuses"
                  :key="order_status.order_status_id"
                  :value="order_status.order_status_id"
                >
                  { order_status.name }
                </option>
              </base-select>
            </validation-provider>

            <validation-provider
              tag="div"
              class="top-padding-large"
              name="processo_venda_id"
              v-slot="{ errors, valid }">
              <base-select
                name="processo_venda_id"
                label="{{ entry_sales_process_store }}"
                v-model="configurations.processo_venda_id"
                :valid="valid"
                :disabled="disableForm">
                <option
                  v-for="processoVenda in processosVenda"
                  :key="processoVenda.id_processo_ecommerce"
                  :value="processoVenda.id_processo_ecommerce"
                >
                  { processoVenda.id_empresa } - { processoVenda.razao_social }
                </option>
              </base-select>
            </validation-provider>
          </div>

          <div v-if="errorCeo">
            <span class="text-large text-dark visible-block">{{ text_error_search }}</span>
            <span class="text-small text-gray visible-block top-padding-small">{{ text_search_info }}</span>
            <div class="top-padding-medium">
              <a class="cursor-pointer text-decoration-none text-error text-small" @click.prevent="showError">
                <i class="fas fa-exclamation-triangle"></i>
                {{ text_show_error }}
              </a>
              <div v-if="showCeoError" class="padding-medium background-error rounded-x-small top-margin-medium">
                <span class="text-error text-small">{{ error_ceo.message }}</span>
              </div>
            </div>
          </div>

        </base-card>
      </div>
    </div>
  </div>

{% endblock %}

