<template>
  <div class="detail-container">
    <el-page-header @back="goBack" content="详情"></el-page-header>

    <div id="printMe">
      <div class="main-title">
        <div class="title">出库单信息</div>
        <el-button size="small" type="primary" icon="el-icon-printer" v-print="printObj">打印单据</el-button>
      </div>
      <div class="diy-table-1">
        <el-row :gutter="0">
          <el-col :span="8" class="item">
            <div class="label">出库单号</div>
            <div class="value">2022123233435342</div>
          </el-col>
          <el-col :span="8" class="item">
            <div class="label">单据日期</div>
            <div class="value">2022123233435342</div>
          </el-col>
          <el-col :span="8" class="item">
            <div class="label">单据状态</div>
            <div class="value">2022123233435342</div>
          </el-col>
          <el-col :span="8" class="item">
            <div class="label">仓库</div>
            <div class="value">万豪仓</div>
          </el-col>
          <el-col :span="8" class="item">
            <div class="label">发货单号</div>
            <div class="value">2022123233435342</div>
          </el-col>
          <el-col :span="8" class="item">
            <div class="label">经销商</div>
            <div class="value">广州格匠机电有限公司</div>
          </el-col>
          <el-col :xs="24" :sm="24" :lg="24" class="item">
            <div class="label">备注</div>
            <div class="value">2022123233435342</div>
          </el-col>
        </el-row>
      </div>

      <div class="main-title">
        <div class="title">货品信息</div>
      </div>
      <div class="diy-table-2">
        <div class="head">
          <el-row :gutter="20">
            <el-col :span="2">序号</el-col>
            <el-col :span="4">产品编号</el-col>
            <el-col :span="8">产品名称</el-col>
            <el-col :span="2">规格型号</el-col>
            <el-col :span="2">内机编码</el-col>
            <el-col :span="2">外机编码</el-col>
            <el-col :span="2">单位</el-col>
            <el-col :span="2">数量</el-col>
          </el-row>
        </div>
        <div class="body">
          <el-row v-for="(item, index) in goodsList" :key="item.goodsId" :gutter="20">
            <el-col :span="2">{{ index + 1 }}</el-col>
            <el-col :span="4">{{ item.goodsId || 0 }}</el-col>
            <el-col :span="8">{{ item.goodsName || 0 }}</el-col>
            <el-col :span="2">{{ item.salesUnit || 0 }}</el-col>
            <el-col :span="2">{{ item.price || 0 }}</el-col>
            <el-col :span="2">{{ item.saleQty || 0 }}</el-col>
            <el-col :span="2">{{ item.saleValue || 0 }}</el-col>
            <el-col :span="2">{{ item.saleValue || 0 }}</el-col>
          </el-row>
        </div>
        <div class="foot">
          <el-row :gutter="20">
            <el-col :span="24">合计</el-col>
          </el-row>
        </div>
      </div>

      <div class="main-title">
        <div class="title">审批记录</div>
      </div>
      <div class="diy-table-1">
        <el-row :gutter="0">
          <el-col :xs="12" :sm="8" :lg="8" class="item">
            <div class="label">审批人</div>
            <div class="value">2022123233435342</div>
          </el-col>
          <el-col :xs="12" :sm="8" :lg="8" class="item">
            <div class="label">审批结果</div>
            <div class="value">2022123233435342</div>
          </el-col>
          <el-col :xs="12" :sm="8" :lg="8" class="item">
            <div class="label">审批时间</div>
            <div class="value">2022123233435342</div>
          </el-col>
          <el-col :xs="24" :sm="24" :lg="24" class="item">
            <div class="label">审批说明</div>
            <div class="value">2022123233435342</div>
          </el-col>
        </el-row>
      </div>
    </div>
    


  </div>
</template>

<script>
import print from 'vue-print-nb'
import { getList } from "@/api/supply/sales";

export default {
  name: 'SalesDetail',
  componentName: 'SalesDetail',
  props: ['listItem'],
  directives: {
    print
  },
  data() {
    return {
      printObj: {
        id: 'printMe'
      },
      goodsList: [{
        goodsId: 1,
      }]
    }
  },

  created() {

  },

  methods: {
    // 返回列表
    goBack() {
      this.$emit('backListFormDetail');
    },
  }
}
</script>

<style scoped lang="scss">
  .detail-container {
    width: 100%;
    height: 100%;
  }
  .main-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    height: 60px;
    border-bottom: 1px solid #DCDFE6;
    margin-bottom: 20px;
    .title {
      font-size: 16px;
      font-weight: 600;
      padding-left: 10px;
    }
  }
</style>