<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>
      </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 :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">广州格匠机电有限公司</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">广州格匠机电有限公司</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">广州格匠机电有限公司</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>

    <div class="page-footer">
      <div class="footer" :class="classObj">
        <el-button type="primary" icon="el-icon-printer" v-print="printObj">打 印</el-button>
        <el-popconfirm title="确定关闭吗？" @onConfirm="goBack" style="margin-left: 10px">
          <el-button slot="reference">关 闭</el-button>
        </el-popconfirm>
      </div>
    </div>
  </div>
</template>

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

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

  computed: {
    sidebar() {
      return this.$store.state.app.sidebar
    },
    classObj() {
      return {
        hideSidebar: !this.sidebar.opened,
        openSidebar: this.sidebar.opened
      }
    }
  },

  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>
