<!--
  @description:项目管理-招标文件/资审文件标书获取记录详情
  @Modifier: 肖文龙
  @routerPath:
  @date: 2020/1/15-11:15
-->
<template>
  <div class="main">
    <div class="main">
      <dl class="projectInfoDetail">
        <dd>
          <table class="tableData">
            <tbody>
              <tr class="singleRow">
                <td>单位名称</td>
                <td>{{ supplierName }}</td>
              </tr>
            </tbody>
          </table>
        </dd>
      </dl>
      <dl class="projectInfoDetail">
        <dt>
          <p class="projectInfoDetail_icon">
            <i class="iconfont icon-biaoduanbaoxinxi" />
          </p>
          联系人信息
        </dt>
        <dd>
          <table class="tableData">
            <tbody>
              <!--<tr>
                <td>姓名</td>
                <td>{{ queryLinkerVo.linker }}</td>
                <td>电话</td>
                <td>{{ queryLinkerVo.phone }}</td>
              </tr>
              <tr>
                <td>手机</td>
                <td>{{ queryLinkerVo.linkerTel }}</td>
                <td>传真</td>
                <td>{{ queryLinkerVo.fax }}</td>
              </tr>-->
              <tr>
                <td>姓名</td>
                <td>{{ queryLinkerVo.linker }}</td>
                <td>手机</td>
                <td>{{ queryLinkerVo.linkerTel }}</td>
              </tr>
              <tr>
                <td>email</td>
                <td colspan="3">
                  {{ queryLinkerVo.linkerEmail }}
                </td>
              </tr>
            </tbody>
          </table>
        </dd>
      </dl>
      <!--<dl class="projectInfoDetail">
        <dt>
          <p class="projectInfoDetail_icon">
            <i class="iconfont icon-biaoduanbaoxinxi"/>
          </p>
          备注信息
        </dt>
        <dd>
          <table class="tableData">
            <tbody>
              <tr class="singleRow">
                <td>备注</td>
                <td>{{ remark }}</td>
              </tr>
            </tbody>
          </table>
        </dd>
      </dl>-->
      <dl class="projectInfoDetail">
        <dt>
          <p class="projectInfoDetail_icon">
            <i class="iconfont icon-biaoduanbaoxinxi" />
          </p>
          邮寄信息
        </dt>
        <dd>
          <table class="tableData">
            <tbody>
              <tr>
                <td>单位名称</td>
                <td colspan="3">
                  {{ queryEmailVo.postDepart }}
                </td>
              </tr>
              <tr>
                <td>收件人名称</td>
                <td>{{ queryEmailVo.postLinker }}</td>
                <td>联系方式</td>
                <td>{{ queryEmailVo.linkerTel }}</td>
              </tr>
              <tr>
                <!--<td>邮政编码</td>
                <td>{{ queryEmailVo.emailCode }}</td>-->
                <td>邮寄地址</td>
                <td colspan="3">
                  {{ queryEmailVo.postLinkerAddress }}
                </td>
              </tr>
            </tbody>
          </table>
        </dd>
      </dl>
      <dl class="projectInfoDetail">
        <dt>
          <p class="projectInfoDetail_icon">
            <i class="iconfont icon-biaoduanbaoxinxi" />
          </p>
          发票信息
        </dt>
        <dd>
          <table class="tableData">
            <tbody>
              <tr>
                <td>发票类型</td>
                <td>
                  <span
                    v-for="(item,index) in invoiceTypeList"
                    v-if="queryInvoiceVo.invoiceType===item.typecode"
                    :key="index"
                  >{{ item.typename }}</span>
                </td>
                <td>发票抬头</td>
                <td>{{ queryInvoiceVo.invoiceTitle }}</td>
              </tr>
              <tr>
                <td>纳税人识别号</td>
                <td>{{ queryInvoiceVo.taxpayerIdentificationNumber }}</td>
                <td>开户银行及账号</td>
                <td>{{ queryInvoiceVo.bank }} {{ queryInvoiceVo.number }}</td>
              </tr>
              <tr>
                <td>地址，电话</td>
                <td colspan="3">
                  {{ queryInvoiceVo.address }} {{ queryInvoiceVo.phone }}
                </td>
              </tr>
            </tbody>
          </table>
        </dd>
      </dl>
      <dl class="projectInfoDetail">
        <dt>
          <p class="projectInfoDetail_icon">
            <i class="iconfont icon-biaoduanbaoxinxi" />
          </p>
          订单详情
        </dt>
        <dd>
          <el-table
            ref="smallTable"
            :data="queryOrderDetailVo"
            size="small"
          >
            <el-table-column
              type="index"
              label="序号"
              align="center"
              width="60"
            />
            <el-table-column

              prop="saleDepart"
              label="发售单位"
              header-align="center"
            />
            <el-table-column

              prop="tenderNo"
              label="项目编号"
              align="center"
            />
            <el-table-column

              prop="tenderName"
              label="项目名称"
              header-align="center"
            />
            <el-table-column

              prop="packNo"
              label="标段（包）编号"
              align="center"
            />
            <el-table-column

              prop="packName"
              header-align="center"
              label="标段（包）名称"
            />
            <el-table-column

              prop="fileType"
              label="文件类型"
              align="center"
            >
              <template slot-scope="scope">
                <span v-for="(item,index) in fileTypeList" v-if="scope.row.fileType===item.typecode" :key="index" :class="item.class">{{ item.typename }}</span>
              </template>
            </el-table-column>
            <el-table-column

              prop="docPrice"
              label="售价（元）"
              header-align="center"
              align="right"
            >
              <template slot-scope="scope">
                {{ scope.row.docPrice?Number(scope.row.docPrice).toFixed(2):scope.row.docPrice }}
              </template>
            </el-table-column>
          </el-table>
        </dd>
      </dl>
      <dl class="projectInfoDetail">
        <dt>
          <p class="projectInfoDetail_icon">
            <i class="iconfont icon-biaoduanbaoxinxi" />
          </p>
          支付
        </dt>
        <dd>
          <table class="tableData">
            <tbody>
              <tr>
                <td>是否邮寄</td>
                <td>
                  <span
                    v-for="(item,index) in isPostInvoiceList"
                    v-if="queryPayDetailVo.isPostInvoice===item.typecode"
                    :key="index"
                  >{{ item.typename }}
                  </span>
                </td>
                <td>付款方式</td>
                <td>
                  <template v-if="queryPayDetailVo.payMode!=='03'">
                    <span
                      v-for="(item,index) in payModeList"
                      v-if="queryPayDetailVo.payMode===item.typecode"
                      :key="index"
                    >{{ item.typename }}
                    </span>
                  </template>
                  <template v-else>
                    {{ payWay | filterPayWay }}
                  </template>
                </td>
              </tr>
              <tr>
                <td>实付合计（元）</td>
                <td colspan="3">
                  {{ queryPayDetailVo.payPrice?Number(queryPayDetailVo.payPrice).toFixed(2):queryPayDetailVo.payPrice }}
                </td>
              </tr>
            </tbody>
          </table>
        </dd>
      </dl>
    </div>
    <div class="but_footer">
      <div class="but_footer-h" />
      <div class="but_footer-but">
        <el-button @click="back()">
          返 回
        </el-button>
      </div>
    </div>
  </div>
</template>

<script>
/* api*/
import { queryTenderRecordDetail } from '@api/bidding/biddocfee'
/* 混合开发*/
import { tenderDoc } from './../mixins/tenderDoc'// 招标文件/资审文件
import { tenderDocGroupMixin } from './../mixins/tenderDocGroupMixin'// 招标文件/标书获取-公用字典
export default {
  name: 'TenderDocTakeRecordsDetail',
  filters: {
    filterPayWay(payWayType) {
      const statusMap = {
        '0': '支付宝',
        '1': '微信',
        '2': '银联'
      }
      return statusMap[payWayType]
    }
  },
  mixins: [tenderDoc, tenderDocGroupMixin],
  data() {
    return {
      isTenderDoc: this.$route.query.isTenderDoc, // 是否从招标文件进来的-布尔值
      queryEmailVo: {
        postLinker: '', // 收件人名称
        postDepart: '', // 单位名称
        linkerTel: '', // 联系方式
        postLinkerAddress: '', // 邮寄地址
        emailCode: '' // 邮政编码
      }, // 邮寄信息
      queryInvoiceVo: {
        invoiceTitle: '', // 发票抬头
        code: '', // 纳税人识别号
        address: '', // 地址
        phone: '', // 电话
        bank: '', // 开户银行
        number: '' // 账号
      }, // 发票信息
      // 联系人信息
      queryLinkerVo: {
        linker: '',
        phone: '',
        linkerTel: '',
        fax: '',
        linkerEmail: ''
      },
      queryOrderDetailVo: [], // 订单详情
      queryPayDetailVo: {
        payWay: '', // 0支付宝 1微信 2银联--payMode为02广发是支付方式根据payWay显示
        payMode: '' // 00支付宝 01微信 02银联 03广发 04中金
      }, // 支付
      remark: '', // 备注
      supplierName: ''// 单位名称
    }
  },
  created() {
    this.initData()// 初始化
  },
  methods: {
    // 初始化
    initData() {
      const data = {
        stageId: this.$route.query.stageId, // 阶段Id
        supplierId: this.$route.query.supplierId// 供应商Id
      }
      queryTenderRecordDetail(data).then(res => {
        this.supplierName = res.data.supplierName
        this.remark = res.data.remark // 备注
        if (res.data.queryEmailVo) {
          this.queryEmailVo = res.data.queryEmailVo
        }
        // 发票信息
        if (res.data.queryInvoiceVo) {
          this.queryInvoiceVo = res.data.queryInvoiceVo
        }
        // 联系人信息
        if (res.data.queryLinkerVo) {
          this.queryLinkerVo = res.data.queryLinkerVo
        }
        if (res.data.queryOrderDetailVo) {
          this.queryOrderDetailVo = res.data.queryOrderDetailVo
        }
        if (res.data.queryPayDetailVo) {
          this.queryPayDetailVo = res.data.queryPayDetailVo
        }
      })
    },
    // 返回
    back() {
      const query = { ...this.$route.query }
      if (this.isTenderDoc) { // 招标文件
        this.$router.push({
          path: '/bidding/projectDrive/tenderDoc/tenderDocTakeRecordsList-detail',
          query: {
            id: query.id, // 项目id
            tenderName: query.tenderName, // 项目名称
            stageIds: query.stageIds, // 阶段Id
            packId: query.packId// 标段Id
          }
        })
      } else { // 标书获取
        this.$router.push({
          path: '/bidding/projectDrive/tenderBid/bidObtainList',
          query: {
            id: query.id, // 项目id
            tenderName: query.tenderName, // 项目名称
            packId: query.packId// 标段Id
          }
        })
      }
    }
  }
}
</script>

<style lang="less" scoped>

</style>
