<!--
  @description: 财预部服务费开票员-服务费开票信息查看
  @Modifier: sunxinman/郝凤仙
  @routerPath: /fee/serviceCollectFeeDetail
  @date: 2020/04/08-15:25
-->
<template>
  <div>
    <section class="title p0-16 clearfix">
      <!-- 返回 -->
      <div class="title-back pointer" @click="back()">
        <i class="iconfont icon-fanhui mr10" />服务费开票信息查看
      </div>
    </section>
    <div class="p0-16">
      <table class="tableData">
        <tr>
          <td>合同编号</td>
          <td><span class="pointer pointer_a" @click="viewContract">查看合同</span></td>
          <td>开票状态</td>
          <td>
            <span
              v-for="(item,index) in serviceInvoiceRecordStatusList"
              v-if="formData.auditStatus === item.typecode"
              :key="index"
            >{{ item.typename }}</span>
          </td>
        </tr>
        <tr>
          <td>招标项目编号/名称</td>
          <td>{{ formData.tenderNo }}{{ formData.tenderName }}</td>
          <td>标段（包）编号/名称</td>
          <td>{{ formData.packNo }}{{ formData.packName }}</td>
        </tr>
        <tr>
          <td>开票单位</td>
          <td>{{ formData.invoiceParty }}</td>
          <td>招标代理服务费收取对象</td>
          <td>
            <span
              v-for="(item,index) in collectionObjList"
              v-if="formData.paymentParty === item.typecode"
              :key="index"
            >{{ item.typename }}</span>
          </td>
        </tr>
        <tr>
          <td>
            招标代理服务费收取方式
          </td>
          <td>
            <span
              v-for="(item,index) in collectionWayList"
              v-if="formData.paymentMethod === item.typecode"
              :key="index"
            >{{ item.typename }}</span>
          </td>
          <td>项目经理</td>
          <td>{{ formData.tenderManager }}</td>
        </tr>
        <tr>
          <td>投标人</td>
          <td>{{ formData.supplierName }}</td>
          <td>中标额（元）</td>
          <td>{{ formData.winPrice }}</td>
        </tr>
        <tr>
          <td>开票金额（元）</td>
          <td>{{ formData.invoiceAmount }}</td>
          <td>发票抬头</td>
          <td>{{ formData.invoiceTittle }}</td>
        </tr>
        <tr>
          <td>纳税人识别号</td>
          <td>{{ formData.invoiceTax }}</td>
          <td>地址及电话</td>
          <td>{{ formData.invoiceAddress }}</td>
        </tr>
        <tr>
          <td>开户银行及账号</td>
          <td>{{ formData.invoiceBank }}</td>
          <td>开票时间</td>
          <td>{{ formData.createTime && $Moment(formData.createTime).format(momentDateTime) }}</td>
        </tr>
        <tr>
          <td>发票代码</td>
          <td>缺少字段</td>
          <td>发票号码</td>
          <td>{{ formData.djbh }}</td>
        </tr>
        <tr>
          <td>备注发票信息</td>
          <td colspan="3">
            {{ formData.remark }}
          </td>
        </tr>
        <tr>
          <td>收款编号</td>
          <td>{{ formData.djbh }}</td>
          <td>项目分类</td>
          <td>{{ formData.industryName }}</td>
        </tr>
        <tr>
          <td>中标通知书</td>
          <td><span class="pointer pointer_a" @click="viewBook">查看中标通知书</span></td>
          <td>开票级别</td>
          <td>
            <span
              v-for="(item,index) in invoiceLevelList"
              v-if="formData.invoiceLevel === item.typecode"
              :key="index"
            >{{ item.typename }}</span>
          </td>
        </tr>
        <tr>
          <td>发票类型</td>
          <td>
            <span
              v-for="(item,index) in invoiceTypeList"
              v-if="formData.invoiceType === item.typecode"
              :key="index"
            >{{ item.typename }}</span>
          </td>
          <td>项目概算</td>
          <td>缺少字段</td>
        </tr>
        <tr>
          <td>联系人名称</td>
          <td>{{ formData.recipientName }}</td>
          <td>联系人单位</td>
          <td>{{ formData.recipientCompany }}</td>
        </tr>
        <tr>
          <td>联系人电话</td>
          <td>{{ formData.recipientTel }}</td>
          <td>联系人邮箱</td>
          <td>{{ formData.recipientEmail }}</td>
        </tr>
        <tr>
          <td>邮政编码</td>
          <td colspan="3">
            {{ formData.recipientPostcode }}
          </td>
        </tr>
        <tr>
          <td>发票邮寄地址</td>
          <td colspan="3">
            {{ formData.recipientAddress }}
          </td>
        </tr>
        <tr>
          <td>发出时间</td>
          <td>{{ formData.sendTime }}</td>
          <td>邮寄时间</td>
          <td>{{ formData.postTime }}</td>
        </tr>
        <tr>
          <td>运单号</td>
          <td>{{ formData.postCode }}</td>
          <td>备注</td>
          <td>{{ formData.remark }}</td>
        </tr>
      </table>
    </div>
    <!-- 合同弹框组件 -->
    <contractDialog :dialog-data="contractDialog" />
    <!-- 中标通知书组件-->
    <bidWinerNotice :dialog-data="bidWinerNoticeDialog" />
    <!--操作按钮-->
    <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>
/* 接口*/
import { detailTenderFeeWinServiceInvoiceInfo } from '@/api/fee/servicefee'
/* 组件*/
import contractDialog from './contract-dialog' // 合同弹框组件
import bidWinerNotice from './bidWinerNotice-dialog' // 中标通知书组件
/* 混合开发方法-参数字段*/
import { ServiceGroupMixin } from '../../mixins/serviceFeeGroupMixin'
export default {
  name: 'ServiceCollectFeeDetail',
  components: {
    contractDialog,
    bidWinerNotice
  },
  mixins: [ServiceGroupMixin],
  data() {
    return {
      formData: {
        auditStatus: '', // 审批状态
        createTime: '', // 创建日期
        createUser: '', // 创建人名称
        djbh: '', // 单据编号
        excludTaxAmount: 0, // 不含税金额
        industryCode: '', // 行业分类代码
        industryName: '', // 行业分类
        invoiceAddress: '', // 地址电话
        invoiceAmount: 0, // 开票金额
        invoiceBank: '', // 银行行号
        invoiceLevel: '', // 开票级别
        invoiceParty: '', // 开票单位
        invoiceTax: '', // 发票税号
        invoiceTittle: '', // 发票抬头
        invoiceType: '', // 发票类型
        outId: '', // 退款申请ID
        outTime: '', // 退款日期
        packId: '', // 标段ID
        packName: '', // 标段名称
        packNo: '', // 标段编号
        paymentMethod: '', // 服务费支付方式00差额定率累进制 01固定金额 02固定比例
        paymentParty: '', // 服务费支付方服务费支付方00中标人 01招标人
        postCode: '', // 运单号
        postStatus: '', // 邮寄状态
        postTime: '', // 邮寄时间
        recipientAddress: '', // 收件人地址
        recipientCompany: '', // 收件人单位
        recipientEmail: '', // 收件人邮箱
        recipientName: '', // 收件人名称
        recipientPostcode: '', // 收件人邮编
        recipientTel: '', // 收件人电话
        remark: '', // 备注
        sendTime: '', // 审批发送时间
        stageId: '', // 阶段ID
        supplierId: '', // 付费单位id
        supplierLinker: '', // 付费单位联系人
        supplierName: '', // 付费单位名称
        supplierTel: '', // 付费单位联系电话
        taxAmount: 0, // 税额
        taxRate: 0, // 税率%
        tenderDepart: '', // 业务部门
        tenderDepartId: '', // 业务部门ID
        tenderId: '', // 项目id
        tenderManager: '', // 项目经理
        tenderManagerId: '', // 项目经理ID
        tenderName: '', // 项目名称
        tenderNo: '', // 项目编号
        updateTime: '', // 更新日期
        updateUser: '', // 更新人名称
        useStatus: '', // 使用状态00开票申请01开票02退款申请03退款开票
        winPrice: 0, // 中标价格
        winServiceId: '' // 服务费开票信息ID
      },
      contractDialog: {
        dialog: false // 委托合同弹框
      },
      bidWinerNoticeDialog: {
        dialog: false // 中标通知书
      }
    }
  },
  created() {
    this.getTenderFeeWinServiceOutDetail()
  },
  methods: {
    // 查看服务费开票信息
    getTenderFeeWinServiceOutDetail() {
      const winServiceId = this.$route.query.winServiceId // 服务费开票信息ID
      detailTenderFeeWinServiceInvoiceInfo(winServiceId).then(res => {
        this.formData = res.data
      }).catch(() => {
      })
    },
    // 返回
    back() {
      this.$router.push({
        path: '/fee/serviceCollectFee'
      })
    },
    // 查看中标通知书
    viewBook() {
      this.bidWinerNoticeDialog.dialog = true
    },
    // 查看合同
    viewContract() {
      this.contractDialog.dialog = true
    }
  }
}
</script>

<style lang="less" scoped>
.pointer_a{
  color: #00A9F2;
}
</style>
