<?php
/*
 * @Overview 생산오더 등록
 * @History 2024-03-04 / 최승연 / 최초작성
 */
$cate_id = "REG_ORDER";
include_once "{$_SERVER['DOCUMENT_ROOT']}/common.inc.php";
include_once _SVC_INC_PATH_ . "/header.php";
?>

<div class="container">
  <!-- 사이드바 불러오기 -->
  <?php include_once _SVC_INC_PATH_ . "/sidebar.php"; ?>
  <!-- 사이드바 불러오기 종료 // -->

  <!-- 검색 조회 및 저장 -->
  <div class="table-header">
    <div class="inner-container">

      <!-- 검색 조건 (인풋) -->
      <div class="search-container">
        <!-- 파업 인풋 박스 시작 -->
          <div class="input-container flexcol gap06">
            <div class="input-box">
              <input type="text" id="WO_NO" placeholder="생산오더">
            </div>
          </div>
        <div class="input-container flexrow gap06">
          <label for="order_date_st" style="text-wrap:nowrap; display:flex; align-items: center;">지시일:&nbsp</label>
          <div>
            <div class="input-box">
              <input type="date"  max="9999-12-31" id="order_date_st">
            </div>
            <div class="input-box">
              <input type="date" max="9999-12-31" id="order_date_ed">
            </div>
          </div>
        </div>
        <div class="input-container flexrow">
          <div class="input-box">
            <input type="text" id="ITEM_CD" placeholder="품목코드">
            <span onclick="popItem({ITEM_CD:'ITEM_CD',ITEM_NM:'ITEM_NM'});">
              <?php include _SVC_INC_PATH_ . '/img/popupIcon.php' ?>
            </span>
          </div>
          <div class="input-box">
            <label for="ITEM_NM"></label>
            <input type="text" id="ITEM_NM" placeholder="품목명">
          </div>
        </div>
        <div class="input-container flexrow">
          <div class="input-box">
            <input type="text" id="BP_CD" placeholder="거래처코드">
            <span onclick="popClient({BP_CD:'BP_CD',BP_NM:'BP_NM'});">
              <?php include _SVC_INC_PATH_ . '/img/popupIcon.php' ?>
            </span>
          </div>
          <div class="input-box">
            <label for="BP_NM"></label>
            <input type="text" id="BP_NM" placeholder="거래처명">
            <input type="hidden" id="hidden_item_cd">
          </div>
        </div>

        <div class="input-container flexcol gap06">
          <div class="input-box">
              <select id="ITEM_GRP"></select>
          </div>
        </div>

        <div class="input-container flexcol gap06">
          <div class="input-box">
              <select id="WO_STATUS"></select>
          </div>
        </div>
      </div>
      <!-- 검색 조건 종료 // -->

      <!-- 조회 및 저장 버튼 -->
      <div class="button-container">
        <div class="button-box">
          <!-- <button class="point-btn" id="copy_btn">편성</button>
          <button class="point-btn" id="sap_btn">SAP 조회</button> -->
          <button class="point-btn" id="orgna_btn">편성확정</button>
          <button class="point-btn" id="filter_btn">조회</button>
          <button class="point-btn" id="put_btn">저장</button>
        </div>
      </div>
      <!-- 조회 및 저장 버튼 종료 // -->

    </div>
    <!-- 검색 조회 및 저장 종료 // -->
  </div>
  <!-- 테이블 헤더 종료 // -->



  <!-- 컨텐츠 컨테이너 -->
  <div class="contents-container">

    <!-- 테이블 컨테이너 -->
    <div class="table-container">
      <div class="inner-container flexcol gap20"> <!-- 테이블 컨텐츠 나오는 부분 vh로 높이 가로 맞춰놓기 -->

        <!-- 테이블 헤더 (제목, 추가, 삭제, 저장) -->
        <div class="table-box main-table flex-1 " id="order_table">
          <div class="table-title">
            <p class="title">생산 오더</p>

            <!-- 버튼 -->
            <div class="button-box">
              <button class="basic-btn" id="pop_upload_order_btn">생산오더 업로드</button>
              <button class="basic-btn" id="sap_btn">SAP 조회</button>
              <button class="basic-btn" id="copy_btn">공정편성</button>
              <button class="basic-btn" id="copy_order_btn">
                <i class="bi bi-copy"></i>
                복사
              </button>
              <button class="add-btn reverse-btn">
                <?php include _SVC_INC_PATH_ . '/img/add.php' ?>
                추가
              </button>
              <button class="remove-btn reverse-btn">
                <?php include _SVC_INC_PATH_ . '/img/delete.php' ?>
                삭제
              </button>
            </div>
            <!-- 버튼 종료 // -->

          </div>
          <!-- 테이블 헤더 종료 // -->

          <!-- 테이블 -->
          <div class="tb-height-half-col">
            <div class="hy-table"></div>
          </div>
          <!-- 테이블 종료 // -->
        </div>
        <!-- 테이블 종료 // -->

        <div class="sub-table flexrow flex-1 gap20">
          <div class="table-box flex-2" id="order_process_table">
            <!-- 테이블 헤더 (제목, 추가, 삭제, 저장) -->
            <div class="table-title">
              <p class="title">
                공정 순서
<!--                <span> ※마우스로 끌어 순서를 변경할 수 있습니다.</span>-->
              </p>

              <!-- 버튼 -->
              <div class="button-box">
<!--                <button class="up-btn basic-btn">위로</button>-->
<!--                <button class="down-btn basic-btn">아래로</button>-->

<!--                <button class="basic-btn" id="insp_copy_btn">편성</button>-->
                <button class="add-btn reverse-btn">
                  <?php include _SVC_INC_PATH_ . '/img/add.php' ?>
                  추가
                </button>
                <button class="remove-btn reverse-btn">
                  <?php include _SVC_INC_PATH_ . '/img/delete.php' ?>
                  삭제
                </button>
              </div>
              <!-- 버튼 종료 // -->

            </div>
            <!-- 테이블 헤더 종료 // -->

            <!-- 테이블 -->
            <div class="tb-height-half-col">
              <div class="hy-table"></div>
            </div>
            <!-- 테이블 종료 // -->
          </div>


          <div class="table-box flex-3" id="order_check_table">
            <!-- 테이블 헤더 (제목, 추가, 삭제, 저장) -->
            <div class="table-title">
              <p class="title">공정 별 검사항목</p>

              <!-- 버튼 -->
              <div class="button-box">
                
                <button class="add-btn reverse-btn" id="add_order_check">
                  <?php include _SVC_INC_PATH_ . '/img/add.php' ?>
                  추가
                </button>
                <button class="remove-btn reverse-btn" id="remove_order_check">
                  <?php include _SVC_INC_PATH_ . '/img/delete.php' ?>
                  삭제
                </button>
              </div>
              <!-- 버튼 종료 // -->

            </div>
            <!-- 테이블 헤더 종료 // -->

            <!-- 테이블 -->
            <div class="tb-height-half-col">
              <div class="hy-table"></div>
            </div>
            <!-- 테이블 종료 // -->
          </div>
        </div>

      </div>
    </div>
    <!-- 테이블 컨테이너 종료 // -->

  </div>
  <!-- 컨텐츠 컨테이너 종료 // -->

</div>
<!-- 메인 섹션 종료 // -->
</div>


<?php include_once _SVC_INC_PATH_ . "/footer_common.php"; ?>
<script src="./reg_order.js"></script>
<script src="./popUploadOrder.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.5/xlsx.full.min.js"></script>
<!--<script src="./order_excel.js"></script>-->
<?php
include_once _SVC_INC_PATH_ . "/footer.php";
include_once _SVC_INC_PATH_ . "/menualBtn.php";
