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

    <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 :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 :span="12" class="item">
          <div class="label">审批人</div>
          <div class="value">2022123233435342</div>
        </el-col>
        <el-col :span="12" class="item">
          <div class="label">审批结果</div>
          <div class="value">
            <el-radio-group v-model="examineForm.status">
              <el-radio :label="true">通过</el-radio>
              <el-radio :label="false">驳回</el-radio>
            </el-radio-group>
          </div>
        </el-col>
        <el-col :span="24" class="item">
          <div class="label">审批说明</div>
          <div class="value">
            <el-input v-model="examineForm.remark" placeholder="请输入内容"></el-input>
          </div>
        </el-col>
      </el-row>
    </div>
    
    <div class="page-footer">
      <div class="footer" :class="classObj">
        <el-button type="primary" @click="clickSubmitForm" :loading="formLoading">{{ formLoading ? '提交中 ...' : '提 交' }}</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 { getList } from "@/api/supply/sales";

export default {
  name: 'SalesDetail',
  componentName: 'SalesDetail',
  props: ['listItem'],
  data() {
    return {
      goodsList: [{
        goodsId: 1,
      }],
      formLoading: false,
      examineForm: {
        status: true,
        remark: '',
      }
    }
  },

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

  created() {

  },

  methods: {
    // 返回列表
    goBack() {
      this.$emit('backListFormExamine');
    },

    clickSubmitForm() {

    },
  }
}
</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>