<template>
  <div class="app-container">
    <el-card>
      <div slot="header" class="card-title">申请特价</div>
      <!-- 列表 -->
      <div class="offer-header">
        <span style="font-size: 15px;">订单号：{{ offer.number }}</span>
      </div>

      <el-table v-loading="loading" :data="offer.offerProdRespVOList">
        <el-table-column label="序号" align="center" prop="id" type="index"></el-table-column>
        <el-table-column
          prop="prodTitleZh"
          label="品名">
        </el-table-column>
        <el-table-column
          prop="prodAttrIds"
          label="填单货物属性">
        </el-table-column>
        <el-table-column
          prop="address"
          label="入库货物属性">
        </el-table-column>
        <el-table-column
          prop="address"
          label="最后操作时间">
        </el-table-column>
        <el-table-column
          label="原价">
          <template v-slot="{row}">
            运费：{{ row.originalSeaFreight }}美元/立方米   清关费：{{ row.originalClearanceFreight }}奈拉/立方米
          </template>
        </el-table-column>
        <el-table-column
          prop="address"
          label="成本价">
          <template v-slot="{row}">
            运费：{{ row.seaFreight }}美元/立方米   清关费：{{ row.clearanceFreight }}奈拉/立方米
          </template>
        </el-table-column>
        <el-table-column
          prop="address"
          label="销售价">
          <template v-slot="{row}">
            运费：{{ row.seaFreight }}美元/立方米   清关费：{{ row.clearanceFreight }}奈拉/立方米
          </template>
        </el-table-column>
        <el-table-column
          prop="address"
          label="操作">
          <template v-slot="{row}">
          <el-button size="mini" type="text" v-hasPermi="['ecw:offer:update']" @click="$router.push(`/offer/discount?offerId=${row.offerId}&offerProdId=${row.offerProdId}`)">优惠申请</el-button>
<!--            <el-button size="mini" type="text" v-hasPermi="['ecw:offer:update']">佣金规则</el-button>-->
<!--            <el-button size="mini" type="text" v-hasPermi="['ecw:offer:update']">管理折扣</el-button>-->
          </template>
        </el-table-column>

      </el-table>

      <div style="text-align: center;margin-top: 80px">
        <el-button type="primary">申请重货优惠</el-button>
        <el-button type="primary">申请泡货优惠</el-button>
        <el-button type="primary">关闭窗口</el-button>
      </div>
    </el-card>
  </div>
</template>

<script>
import {getOfferLogPage} from "@/api/ecw/offerLog";
import {DICT_TYPE} from  '@/utils/dict'
import {getOffer} from '@/api/ecw/offer'
export default {
  name: "OfferSpecial",
  components: {

  },
  props: {
    offerId: String
  },
  data() {
    return {
      // 遮罩层
      loading: true,
      list: [],
      total:0,
      params:{
        page:1,
        rows:20,
        offerId:0,
        type:2
      },
      relationId:0,
      creatorName:'test',
      offer: {
        number: '',
        offerProdRespVOList: []
      }
    };
  },
  created() {
    if(this.offerId){
      this.params.offerId = this.offerId
      this.getOffer()
    }
  },
  methods: {
    getOffer(){
      this.loading = true
      getOffer(this.offerId).then(response => {
        this.loading = false
        this.offer = response.data
      })
    }
  }
};
</script>
<style>
.card-title{
  font-size: 18px;
  font-weight: bold;
}
.offer-header{
  padding-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
</style>
