<template>
 <div>
   <el-form ref="form" :model="form" label-width="100px">
     <headerTitle title="基本信息"></headerTitle>
     <el-row :gutter="12">
       <el-col :span="12">
         <el-form-item
           label="申请部门："
           prop="applyDeptId"

         >
           {{ form.applyDeptName }}
         </el-form-item>
       </el-col>
       <el-col :span="12">
         <el-form-item
           label="申请人："
           prop="applyUserId"

         >
           {{ form.applyUserName }}
         </el-form-item>
       </el-col>
     </el-row>
     <el-row :gutter="12">
       <el-col :span="12">
         <el-form-item
           label="费用类型："
           prop="feeTypeId"

         >
           {{ form.feeTypeName }}
         </el-form-item>
       </el-col>
       <el-col :span="12">
         <el-form-item
           label="金额："
           prop="amount"
         >
           {{ form.amount }}
         </el-form-item>
       </el-col>
     </el-row>
     <el-row :gutter="12">
       <el-col :span="24">
         <el-form-item
           label="关联类型："
         >
           {{ form.finLinkTypeName }}
         </el-form-item>
       </el-col>
     </el-row>
     <el-row v-if="form.finLinkType==1">
       <el-col :span="12">
         <el-form-item
           label="客户名称："
           prop="contactName"
         >
           {{ form.contactName }}
         </el-form-item>
       </el-col>
     </el-row>
     <el-row v-if="form.finLinkType==2">
       <el-col :span="12">
         <el-form-item
           label="供应商名称："
           prop="contactName"
         >
           {{ form.contactName }}
         </el-form-item>
       </el-col>
     </el-row>
     <el-row v-if="form.finLinkType==3">
       <el-col :span="12">
         <el-form-item
           label="商机名称："
         >
           {{ form.opportunityName }}
         </el-form-item>
       </el-col>
     </el-row>
     <el-row v-if="form.finLinkType==4">
       <el-col :span="12">
         <el-form-item
           label="选择合同："
         >
           {{ form.contractName }}
         </el-form-item>
       </el-col>
     </el-row>
     <el-row v-if="form.finLinkType==5">
     </el-row>
     <el-row v-if="form.finLinkType==6">
       <el-col :span="12">
         <el-form-item
           label="销售订单："
         >
           {{ form.saleOrderCode }}
         </el-form-item>
       </el-col>
       <el-col :span="12">
         <el-form-item
           label="采购订单："
         >
           {{ form.purchaseOrderCode }}
         </el-form-item>
       </el-col>
     </el-row>


     <el-row :gutter="12">
       <el-col :span="24">
         <el-form-item
           label="备注：">
           {{ form.remark }}
         </el-form-item>
       </el-col>
     </el-row>
     <el-row :gutter="12">
       <el-col :span="12">
         <el-form-item prop="" label="附件：">
           <el-link
             v-if="form.files.length"
             v-for="item in form.files"
             type="primary"
             :underline="false"
             @click="downloadFile(item)"
           >
             {{ item.name }}
           </el-link
           >
         </el-form-item>
       </el-col>
     </el-row>


   </el-form>
 </div>
</template>

<script>
import {getFile} from '@/api/system/file';
import dictMixins from '@/mixins/dictMixins';
import bpmDetail from '@/views/bpm/processInstance/detail.vue';
import fileUpload from "@/components/upload/fileUpload.vue";
import {getFeeApplyInfoAPI} from "@/api/bpm/components/financialManage/fee-manage/fee-application";

export default {
  mixins: [dictMixins],
  components: {
    fileUpload,
    bpmDetail
  },
  props:{
    businessId: {
      default: ''
    }
  },
  data() {
    return {
      title: '详情',
      form: {},
    };
  },
  async created() {
    await this.getFeeApplyInfoInfo(this.businessId)
  },
  methods: {
    //获取详情
    async getFeeApplyInfoInfo(id) {
      this.form = await getFeeApplyInfoAPI(id)
    },
    downloadFile(file) {
      getFile({objectName: file.storePath}, file.name);
    },
  }
};
</script>

<style scoped lang="scss">
.ele-dialog-form {
  .el-form-item {
    margin-bottom: 10px;
  }
}

.headbox {
  display: flex;
  justify-content: flex-start;
  align-items: center;

  .amount {
    font-size: 14px;
    font-weight: bold;
    margin-right: 20px;
  }
}
</style>
