<?php
include_once "{$_SERVER['DOCUMENT_ROOT']}/common.inc.php";
?>

<!-- 생산실적 등록 팝업 -->

<div id="popup_prod_rslt">
  <div class="awn-popup-confirm awn-form custom-popup">
    <div class="awn-popup-search popup-form mb-block btn-ksmain-inject-block">

      <form id="form" name="frmPrslt" method="post">
        <!-- popup title -->
        <div class="title-container flexrow">
          <div class="awn-popup-title"><i class="bi bi-card-heading"></i> 생산실적 등록</div>
          <div class="mt-3 text-end button-box">
            <button class="basic-btn add-btn">저 장</button>
          </div>
        </div>

        <!-- form 내용 -->
        <div class="form-contents flexcol gap20">

          <!-- form-box 시작 -->
          <div class="form-box flexcol gap10 flex-4">

            <!-- input-container 시작 -->
            <div class="input-container flexrow gap06">

              <div class="input-box flex-1">
                <label for="WO_NO">생산오더</label>
                <input type="text" id="WO_NO" name="WO_NO"
                  onclick="popRegOrder({WO_NO:'WO_NO',WO_SEQ:'WO_SEQ',OP_SEQ:'OP_SEQ',OP_CD:'OP_CD',ITEM_CD:'ITEM_CD',ITEM_NM:'ITEM_NM',DRAW_NO:'DRAW_NO',PRV_OP_CD:'PRV_OP_CD',ORD_QTY:'ORD_QTY',OP_WRK_QTY:'OP_WRK_QTY'})"
                  class="form-control form-control-sm"></input>
                <input type="hidden" id="WO_SEQ" name="WO_SEQ" class="form-control form-control-sm"></input>

              </div>

              <div class="input-box flex-1">

                <label for="도면번호">도면번호</label>
                <input type="text" id="DRAW_NO" name="DRAW_NO" class="form-control form-control-sm" readonly></input>
              </div>

            </div>
            <!-- input-container 종료 // -->
            <!-- input-container 시작 -->
            <div class="input-container flexrow gap06">

              <div class="input-box flex-1">
                <label for="ITEM_CD">품목</label>
                <input type="text" id="ITEM_CD" name="ITEM_CD" class="form-control form-control-sm" readonly></input>
              </div>

              <div class="input-box flex-1">
                <input type="text" id="ITEM_NM" name="ITEM_NM" class="form-control form-control-sm sub-input"
                  readonly></input>
              </div>

            </div>
            <!-- input-container 종료 // -->
            <!-- input-container 시작 -->
            <div class="input-container flexrow gap06">

              <div class="input-box flex-1">
                <label for="OP_CD">공정</label>
                <input type="text" id="OP_CD" name="OP_CD" class="form-control form-control-sm"></input>
                <input type="hidden" name="OP_SEQ" id="OP_SEQ" value=""></input>
              </div>

              <div class="input-box flex-1">
                <label for="ORD_QTY">지시수량</label>
                <input type="text" id="ORD_QTY" name="ORD_QTY" class="form-control form-control-sm" readonly></input>
              </div>

            </div>
            <!-- input-container 종료 // -->
            <!-- input-container 시작 -->
            <div class="input-container flexrow gap06">

              <div class="input-box flex-1">
                <label for="PRV_OP_CD">이전공정</label>
                <input type="text" id="PRV_OP_CD" name="PRV_OP_CD" class="form-control form-control-sm"
                  readonly></input>
              </div>

              <div class="input-box flex-1">
                <label for="OP_WRK_QTY">이전공정양품</label>
                <input type="text" id="OP_WRK_QTY" name="OP_WRK_QTY" class="form-control form-control-sm"
                  readonly></input>
              </div>

            </div>
            <!-- input-container 종료 // -->

          </div>
          <!-- form-box 종료 // -->

          <!-- form-box 시작 -->
          <div class="form-box flexcol gap10 flex-4">

            <!-- input-container 시작 -->
            <div class="input-container flexrow gap06">

              <div class="input-box flex-1">
                <label for="FACLT_CD">설비</label>
                <input type="text" id="FACLT_CD" name="FACLT_CD"
                  onclick="popRegFacility({FACLT_CD:'FACLT_CD', FACLT_NM:'FACLT_NM'})"
                  class="form-control form-control-sm"></input>

              </div>

              <div class="input-box flex-1">
                <input type="text" id="FACLT_NM" name="FACLT_NM" class="form-control form-control-sm sub-input"></input>
              </div>

            </div>
            <!-- input-container 종료 // -->
            <!-- input-container 시작 -->
            <div class="input-container flexrow gap06">
              <!--크기줄이기 -->
              <div class="input-box flex-1">
                <label for="WRK_EMP_NO">작업자</label>
                <input type="hidden" name="WRK_EMP_NO" id="WRK_EMP_NO" value="">
                <input type="text" id="EMP_NM" name="EMP_NM" onclick="popWorker({EMP_NO:'WRK_EMP_NO',EMP_NM:'EMP_NM'})"
                  class="form-control form-control-sm"></input>
              </div>
              <div class="input-box flex-1">
                <label for="RSLT_GRP">실적그룹</label>
                <select name="RSLT_GRP" id="RSLT_GRP" class="form-control form-control-sm">
                  <option value="AM">오전[AM]</option>
                  <option value="PM">오후[PM]</option>
                  <option value="NI">저녁[NI]</option>
                </select>
              </div>


            </div>
            <!-- input-container 종료 // -->
            <!-- input-container 시작 -->
            <div class="input-container flexrow gap06">

              <div class="input-box flex-1">
                <label for="ST_TM">시작시간</label>
                <!-- <input type="text" id="MAKE_TM" name="MAKE_TM" class="form-control form-control-sm"
                  value="<?php //echo date('Y-m-d h:i') ?>">

                </input> -->
                <input type="datetime-local" id="ST_TM" name="ST_TM" value="<?php echo date('Y-m-d\TH:i') ?>"
                  min="1999-01-01T00:00" max="9999-12-31T23:59" />
              </div>

              <div class="input-box flex-1">
                <label for="ED_TM">작업완료</label>
                <input type="datetime-local" id="ED_TM" name="ED_TM" value="<?php echo date('Y-m-d\TH:i') ?>"
                  min="1999-01-01T00:00" max="9999-12-31T23:59" />
              </div>

            </div>
            <!-- input-container 종료 // -->
            <!-- input-container 시작 -->
            <div class="input-container flexrow gap06">
              <!--크기줄이기 -->
              <div class="input-box flex-1">
                <label for="">작업수량</label>
                <input type="text" id="WRK_QTY" name="WRK_QTY" class="form-control form-control-sm" readonly></input>
              </div>

            </div>
            <!-- input-container 종료 // -->
            <!-- input-container 시작 -->
            <div class="input-container flexrow gap06">

              <div class="input-box flex-1">
                <label for="">양품수량</label>
                <input type="text" id="PRD_QTY" name="PRD_QTY" class="form-control form-control-sm"></input>
              </div>

              <div class="input-box flex-1">
                <label for="">불량수량</label>
                <input type="text" id="DEF_QTY" name="DEF_QTY" class="form-control form-control-sm" readonly></input>
              </div>

            </div>
            <!-- input-container 종료 // -->

          </div>
          <!-- form-box 종료 // -->

          <!-- form-box 시작 -->
          <!-- <div class="form-box flexcol gap10 flex-4 add-row-container"> -->

            <!-- input-container 시작 -->
            <!-- <div class="input-container flexrow gap06">
              <div class="input-box flex-1 flexrow gap06">
                <p class="input-title"><input type="button" class="add-btn basic-btn" value="추가" @click="addRow"></p>
              </div>

              <div class="input-box flex-7 flexrow gap06">
                <p class="input-title"></p>
                <p class="input-text">불량수량</p>
                <p class="input-text">불량사유</p>
              </div> -->


           <!-- </div> -->
            <!-- input-container 종료 // -->
            <!-- input-container 시작 -->
            <!-- <div class="input-container flexrow gap06" v-for="(row, index) in rows" :key="index">
              <div class="input-box flex-1 flexrow gap06">
                <p class="input-title"><input type="hidden" class="add-btn basic-btn" value="추가" ></p>
                <input type="text" :name="'DEF_QTY[]'" v-model="row.DEF_QTY" :id="'DEF_QTY_' + index"
                  class="form-control form-control-sm input-text"  v-if="index > 0" >
                <input type="text" :name="'DEF_CD[]'" v-model="row.DEF_CD + index" :id="'DEF_CD_' + index"
                  class="form-control form-control-sm input-text"  @click="openPop(index)"  v-if="index > 0">
              </div>
            </div> -->
            <!-- input-container 종료 // -->

            <input type="hidden" name="WO_NO_PK" id="WO_NO_PK" value="">
            <input type="hidden" name="RSLT_NO" id="RSLT_NO" value="">
            <input type="hidden" name="WORKER_WRK_NO" id="WORKER_WRK_NO" value="">
            <input type="hidden" name="DEF_NO" id="DEF_NO" value="">

          </div>
          <!-- form-box 종료 // -->
        </div>

      </form>
    </div>

  </div>
</div>