<template>
  <div>
    <div class="content_table">
      <div class="item rx-sc">
        <div class="rx ww25">
          <div class="lable rx-cc">报工类型</div>
          <div class="content" v-if="workOrderInfo.singleReport == 0"
            >批量报工</div
          >
          <div class="content" v-if="workOrderInfo.singleReport == 1"
            >单个报工</div
          >
        </div>
      </div>

      <div class="item rx-sc">
        <div class="rx ww25">
          <div class="lable rx-cc">生产工单号</div>
          <div class="content">
            {{ workOrderInfo.code }}
          </div>
        </div>
      </div>

      <div class="item rx-sc">
        <div class="rx ww25">
          <div class="lable rx-cc">生产订单号</div>
          <div class="content">{{ workOrderInfo.apsWorkOrderCode }}</div>
        </div>
      </div>

      <div class="item rx-sc">
        <div class="rx ww25">
          <div class="lable rx-cc">计划编码</div>
          <div class="content">{{ workOrderInfo.productionPlanCode }}</div>
        </div>
      </div>

      <div class="item rx-sc">
        <div class="rx ww25">
          <div class="lable rx-cc">编码</div>
          <div class="content">{{ workOrderInfo.productCode }}</div>
        </div>
      </div>

      <div class="item rx-sc">
        <div class="rx ww25">
          <div class="lable rx-cc">名称</div>
          <div class="content" :title="workOrderInfo.productName">{{
            workOrderInfo.productName
          }}</div>
        </div>
      </div>

      <div class="item rx-sc">
        <div class="rx ww25">
          <div class="lable rx-cc">规格</div>
          <div class="content" :title="workOrderInfo.specification">{{
            workOrderInfo.specification
          }}</div>
        </div>
      </div>

      <div class="item rx-sc">
        <div class="rx ww25">
          <div class="lable rx-cc" :title="workOrderInfo.model">型号</div>
          <div class="content">{{ workOrderInfo.model }}</div>
        </div>
      </div>

      <div class="item rx-sc">
        <div class="rx ww25">
          <div class="lable rx-cc">牌号</div>
          <div class="content" :title="workOrderInfo.brandNo">{{
            workOrderInfo.brandNo
          }}</div>
        </div>
      </div>

      <div class="item rx-sc">
        <div class="rx ww25">
          <div class="lable rx-cc">批次号</div>
          <div class="content">{{ workOrderInfo.batchNo }}</div>
        </div>
      </div>

      <div class="item rx-sc">
        <div class="rx ww25">
          <div class="lable rx-cc">生产数量</div>
          <div class="content rx-sc">
            <div>{{ workOrderInfo.formingNum }}</div>
            <div class="unit">{{ workOrderInfo.unit }}</div>
          </div>
        </div>
      </div>

      <div class="item rx-sc">
        <div class="rx ww25">
          <div class="lable rx-cc">重量</div>
          <div class="content content_num">
            <div>{{ workOrderInfo.formingWeight }}</div>
            <div class="unit">{{ workOrderInfo.weightUnit }}</div>
          </div>
        </div>
      </div>

      <div class="item rx-sc">
        <div class="rx ww25">
          <div class="lable rx-cc">已生产数量</div>
          <div class="content content_num">
            <div>{{ workOrderInfo.formedNum }}</div>
            <div class="unit">{{ workOrderInfo.unit }}</div>
          </div>
        </div>
      </div>

      <div class="item rx-sc">
        <div class="rx ww25">
          <div class="lable rx-cc">已生产重量</div>
          <div class="content content_num">
            <div>{{ workOrderInfo.formedWeight || 0 }}</div>
            <div class="unit">{{ workOrderInfo.weightUnit }}</div>
          </div>
        </div>
      </div>

      <div class="item rx-sc">
        <div class="rx ww25">
          <div class="lable rx-cc">生产编号</div>
          <div class="content" :title="workOrderInfo.productionCodes">{{
            workOrderInfo.productionCodes
          }}</div>
        </div>
      </div>

      <div class="item rx-sc">
        <div class="rx ww25">
          <div class="lable rx-cc">委外状态</div>
          <div v-if="workOrderInfo.outsourceStatus">
            <div class="content" v-if="workOrderInfo.outsourceStatus == 1"
              >未委外</div
            >
            <div class="content" v-if="workOrderInfo.outsourceStatus == 2"
              >委外中</div
            >
            <div class="content" v-if="workOrderInfo.outsourceStatus == 3"
              >完成委外-未质检</div
            >
          </div>
          <div v-else>
            <div class="content">{{ '' }}</div>
          </div>
        </div>
      </div>

      <div class="item rx-sc">
        <div class="rx ww25">
          <div class="lable rx-cc">计划开始时间</div>
          <div class="content">{{ workOrderInfo.planStartTime }}</div>
        </div>
      </div>

      <div class="item rx-sc">
        <div class="rx ww25">
          <div class="lable rx-cc">计划结束时间</div>
          <div class="content">{{ workOrderInfo.planCompleteTime }}</div>
        </div>
      </div>

      <div class="item rx-sc">
        <div class="rx ww25">
          <div class="lable rx-cc">实际开始时间</div>
          <div class="content">{{ workOrderInfo.startTime }}</div>
        </div>
      </div>

      <div class="item rx-sc">
        <div class="rx ww25">
          <div class="lable rx-cc">实际结束时间</div>
          <div class="content">{{ workOrderInfo.endTime }}</div>
        </div>
      </div>

      <div class="item rx-sc">
        <div class="rx ww25">
          <div class="lable rx-cc">创建时间</div>
          <div class="content">{{ workOrderInfo.createTime }}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    props: {
      workOrderInfo: {
        type: Object,
        default: () => ({})
      }
    },
    data() {
      return {};
    },

    methods: {}
  };
</script>

<style lang="scss" scoped>
  .content_table {
    width: 100%;
    border: 1px solid #e3e5e5;
    position: relative;

    .item {
      // display: flex;
      // border-bottom: 1px solid #e3e5e5;

      .lable {
        width: 82px !important;
        text-align: center;
        background-color: #f7f9fa;
        font-size: 12px;
        border-right: 1px solid #e3e5e5;
        flex-shrink: 0;
      }

      .content {
        min-width: 250px;
        min-height: 32px;
        font-size: 14px;
        line-height: 14px;
        font-style: normal;
        font-weight: 400;
        padding: 9px 4px;
        box-sizing: border-box;
        word-wrap: break-word;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex-grow: 1 !important;

        .unit {
          padding: 0 2px;
          font-size: 12px;
          color: #404446;
        }
      }

      .content_num {
        display: flex;
        align-items: center;
        padding: 2px;
        --input-background-color: #f0f8f2;
      }

      &:last-child {
        border-bottom: none;
      }
    }

    .ww25 {
      width: 25%;
    }
  }

  .title_box {
    .name {
      font-size: 14px;
      font-style: normal;
      font-weight: 400;
      color: #157a2c;
      padding-left: 5px;
      position: relative;

      &:before {
        position: absolute;
        content: '';
        left: 0px;
        top: 0px;
        bottom: 0px;
        width: 2px;
        height: 14px;
        background: #157a2c;
        margin: auto;
      }
    }
  }
</style>
