<template>
  <div>

    <div class="tab-header webtop">
      <!-- 标题 -->
      <div>上架单详情</div>
      <!-- start 添加修改按钮 -->
      <div>
        <el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
      </div>
      <!-- end 添加修改按钮 -->
      <!-- end 详情按钮 -->
    </div>

    <div class="listconadd">

      <el-form ref="form_obj" :model="formobj" class="formaddcopy02">
        <div class="title">
          <div>基础信息</div>
        </div>
        <el-row class="first_row">
          <el-col :span="8">
            <div class="span-sty">制单人</div>
            <el-form-item><span class="addinputInfo">{{ formobj.createByName }}</span></el-form-item>
          </el-col>
          <el-col :span="8">

            <div class="span-sty">制单部门</div>
            <el-form-item><span class="addinputInfo">{{ formobj.deptName }}</span></el-form-item>
          </el-col>

          <el-col :span="8">
            <div class="span-sty">单据日期</div>
            <el-form-item><span class="addinputInfo">{{ formobj.createTime }}</span></el-form-item>
          </el-col>
        </el-row>

        <el-row>

          <el-col :span="8">
            <div class="span-sty">来源单号</div>
            <el-form-item><span class="addinputInfo">{{ formobj.sourceBillNo }}</span></el-form-item>
          </el-col>
          <el-col :span="8">
            <div class="span-sty">单据状态</div>
            <el-form-item><span class="addinputInfo">{{ formobj.billState }}</span></el-form-item>
          </el-col>

          <el-col :span="8">
            <div class="span-sty">上架人</div>
            <el-form-item><span class="addinputInfo">{{ formobj.upShelfName }}</span></el-form-item>
          </el-col>


        </el-row>

        <el-row>

          <el-col :span="24">
            <div class="span-sty">备注</div>
            <el-form-item><span class="addinputInfo">{{ formobj.remarks }}</span></el-form-item>
          </el-col>

        </el-row>

        <div class="title">
          <div>商品列表</div>
        </div>

        <el-table v-loading="listLoading" :data="formobj.list" border>
          <el-table-column fixed label="序号" type="index" :index="indexMethod" align="center" width="80" />
          <el-table-column fixed label="商品名称" prop="goodsSpuName" align="center" width="200" />
          <el-table-column label="商品编码" prop="goodsSkuCode" align="center" />
          <el-table-column label="规格" prop="goodsSkuOwnSpec" align="center" />
          <el-table-column label="单位" prop="unit" align="center" />
          <!-- <el-table-column label="批次号" prop="batchNumber" align="center" />
          <el-table-column label="仓库" prop="warehouseName" align="center" />
          <el-table-column label="库位" prop="warehouseRackCode" align="center" /> -->
          <el-table-column label="需上架数量" prop="count" align="center" />
          <el-table-column label="已上架数量" prop="actualCount" align="center" />
          <el-table-column label="未上架数量" prop="noShelfCount" align="center" />
          <el-table-column label="载具编号" prop="packageNo" align="center" />
        </el-table>

      </el-form>

    </div>


  </div>
</template>

<script>
  import req from '@/api/storage/upShelf.js'

  export default {
    components: {},
    data() {
      return {
        listLoading: false,
        submitdisabled: false,
        formobj: {},
      }
    },
    methods: {
      indexMethod(index) {
        return index + 1
      },

      handleReturn(isreload) {
        if (isreload === 'true') this.$emit('reloadlist')
        this.$emit('doback2')
      },

      showAdd() {

      },
      showEdit(sid) {

        req.init(sid)
          .then(resp => {
            if (resp.success) {
              this.formobj = resp.data
            }
          })
          .catch(e => {
            this.formobj = {}
          })
      }
    }
  }
</script>
<style scoped>
  .span-sty {
    width: 130px !important;
  }

  .addinputInfo {
    margin-left: 120px !important;
  }

  .formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
    margin-left: 120px !important;
    width: calc(100% - 115px);
  }

  .first_row {
    border-top: 1px solid #E0E3EB;
  }

  .titleOne {
    padding: 7px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
</style>
