<div
  ng-controller="RDRCtrl"
  class="wrapper"
  anc-bac-controle-common-logic
  apptype="bac"
>
  <controle-form-cfg
    type="currentControle.properties.type"
    ng-if="!ctrl_clos"
    form-data="cdata"
    validation="ctrlCfgValid.values"
    apptype="'bac'"
  ></controle-form-cfg>
  <div class="mainFormTitle">
    <span>Réception d'une demande de raccordement</span>
  </div>

  <div class="mainFormSubTitle condensedInfos">
    <div class="row">
      <div class="col-xs-4">
        <label data-for="cdata.reference_rdr">
          N° d'arrêté du branchement
        </label>
      </div>
      <div class="col-xs-8">
        <input
          type="text"
          class="form-control"
          ng-model="cdata.reference_rdr"
          ng-disabled="ctrl_clos"
        />
      </div>
    </div>
    <div class="row">
      <div class="col-xs-4">
        <label data-for="cdata.datesDossier.date_encadre">
          Date de l'arrêté
        </label>
      </div>
      <div class="col-xs-8">
        <div
          javautildate
          model-date-format="'no_hours'"
          gcatt="{name:'date_encadre'}"
          result="cdata.datesDossier"
          ng-init="cdata.datesDossier.date_encadre = cdata.datesDossier.date_encadre ? cdata.datesDossier.date_encadre : {}"
          data-ng-model="cdata.datesDossier.date_encadre"
          data-type="date"
          field-data="{disabled:ctrl_clos}"
        ></div>
      </div>
    </div>
    <div class="row">
      <div class="col-xs-4">
        <label data-for="cdata.datesDossier.date_reception">
          Date de la réception
        </label>
      </div>
      <div class="col-xs-8">
        <div
          javautildate
          model-date-format="'no_hours'"
          gcatt="{name:'date_reception'}"
          result="cdata.datesDossier"
          ng-init="cdata.datesDossier.date_reception = cdata.datesDossier.date_reception ? cdata.datesDossier.date_reception : {}"
          data-ng-model="cdata.datesDossier.date_reception"
          data-type="date"
          field-data="{disabled:ctrl_clos}"
        ></div>
      </div>
    </div>
    <div class="row">
      <div class="col-xs-4">
        <label data-for="cdata.info_generales.num_dau">
          Numéro de demande d'autorisation d'urbanisme
        </label>
      </div>
      <div class="col-xs-8">
        <select
          class="form-control"
          ng-init="getDau()"
          ng-options="o for o in num_dau"
          ng-model="cdata.info_generales.num_dau"
          ng-change="getAttributeValue(data.selectedAttribute)"
        >
        </select>
      </div>
    </div>
    <div class="row">
      <div class="col-xs-4">
        <label data-for="cdata.info_generales.autre_num_dau">
          Autre numéro de demande d'autorisation d'urbanisme
        </label>
      </div>
      <div class="col-xs-8">
        <input
          type="text"
          class="form-control"
          ng-model="cdata.info_generales.autre_num_dau"
          ng-disabled="ctrl_clos"
        />
      </div>
    </div>

    <div
        class="row spbrow"
        ng-if="allowChangementAvis && cdata.general.statut_rdv && cdata.general.statut_rdv!='present' && !ctrl_clos"
    >
      <div class="input-group">
        <div class="col-xs-4">
          <label data-for="cdata.general.origine_du_report_annulation">Origine du report/annulation</label>
        </div>
        <div class="col-xs-8">
          <div class="input-group">
            <div form-field
                 fti="kis_bac_listes_deroulantes_controles"
                 attname="'origine_du_report_annulation'"
                 ng-model="cdata.general.origine_du_report_annulation"
                 res="cdata.general"
                 field-data="{disabled:ctrl_clos}">
            </div>
          </div>
        </div>
      </div>

      <div class="input-group">
        <div class="col-xs-4">
          <label data-for="cdata.general.statut_rdv_commnentaire">Commentaire</label>
        </div>
        <div class="col-xs-8">
          <textarea class="form-control" ng-model="cdata.general.statut_rdv_commnentaire"></textarea>
        </div>
        <br /><br /><br />
      </div>

      <div class="col-xs-12 text-right">
        <div class="btn btn-danger" ng-click="pre_appliquerAvisControle(1)">
          Appliquer ce statut à la demande
        </div>
      </div>

    </div>
  </div>

  <anc-bac-extra-form-fields
    apptype="'bac'"
    cdata="cdata"
    current-controle="currentControle"
    ctrl-clos="ctrl_clos"
  ></anc-bac-extra-form-fields>

  <div
    class="panel-group"
    data-allow-multiple="true"
    data-start-collapsed="true"
    bs-collapse
  >
    <div class="panel panel-info ">
      <div class="panel-heading">
        <a bs-collapse-toggle> Informations générales </a>
      </div>
      <div class="panel-collapse" bs-collapse-target>
        <div class="panel-body">
          <ng-include
            src="'js/XG/widgets/bacapp/main/views/controle/RDR/informations_generales.html'"
          />
        </div>
      </div>
    </div>

    <div class="panel panel-info">
      <div class="panel-heading">
        <a bs-collapse-toggle> Dossier </a>
      </div>
      <div class="panel-collapse" bs-collapse-target>
        <div class="panel-body">
          <ng-include
            src="'js/XG/widgets/bacapp/main/views/controle/RDR/dossier.html'"
          />
        </div>
      </div>
    </div>

    <div class="panel panel-info">
      <div class="panel-heading">
        <a bs-collapse-toggle> Avis </a>
      </div>
      <div class="panel-collapse" bs-collapse-target>
        <div class="panel-body">
          <ng-include
            src="'js/XG/widgets/bacapp/main/views/controle/RDR/avis_tech.html'"
          />
        </div>
      </div>
    </div>
  </div>
</div>
