<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>

          <el-col :span="8">
            <div class="span-sty">单据编号</div>
            <el-form-item><span class="addinputInfo">{{ formobj.billNo }}</span></el-form-item>
          </el-col>
          <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.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.busTypeValue }}</span></el-form-item>
          </el-col>
          <el-col :span="8">
            <div class="span-sty">供应商</div>
            <el-form-item><span class="addinputInfo">{{ formobj.supplierName }}</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.deliveryDate }}</span></el-form-item>
          </el-col>
          <el-col :span="8">
            <div class="span-sty">单据状态</div>
            <el-form-item><span class="addinputInfo">{{ formobj.billStateKey }}</span></el-form-item>
          </el-col>
          <el-col :span="8">
            <div class="span-sty">审核状态</div>
            <el-form-item><span class="addinputInfo">{{ formobj.reviewStatus }}</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.refuseReason }}</span></el-form-item>
          </el-col>

        </el-row>

        <div class="title titleOne">
          <div>商品列表</div>
        </div>
        <el-table v-loading="listLoading" :data="formobj.list" border style="width: 100%;">
          <el-table-column fixed label="序号" type="index" :index="indexMethod" align="center" width="80" />
          <el-table-column fixed label="商品名称" prop="goodsSpuName" align="center"  />
          <el-table-column label="商品编码" prop="goodsSkuCode" align="center" />
          <el-table-column label="规格" prop="goodsSkuOwnSpec" align="center" width="150" />
          <el-table-column label="单位" prop="unit" align="center" width="120" />
        <!--  <el-table-column label="仓库" prop="warehouseName" align="center" width="120" />
          <el-table-column label="库位" prop="warehouseRack" align="center" width="120" /> -->
          <el-table-column label="预约数量" prop="orderCount" align="center" width="120" />
          <el-table-column label="待收货数量" prop="waitInCount" align="center" />
          <el-table-column label="已收货数量" prop="actualInCount" align="center" />
          <el-table-column label="入库单价" prop="cost" align="center" width="100" />
          <el-table-column label="税率" prop="taxAmount" align="center" width="100" />
          <!-- <el-table-column label="含税单价" prop="taxPrice" align="center" width="100" /> -->
          <el-table-column label="采购金额" prop="amount" align="center"  />
        </el-table>

      </el-form>

    </div>


  </div>
</template>

<script>
  import req from '@/api/storage/deliveryNotice.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('doback')
      },

      showAdd() {

      },
      showEdit(row) {

        var params = {
          sid: row.sid
        }
        req.init(row.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);
  }

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