<template>
    <hc-info-table>
        <tr>
            <hc-info-table-td center is-title>支付项编号：</hc-info-table-td>
            <hc-info-table-td width="120px">{{ formModel?.payNumber }}</hc-info-table-td>
            <hc-info-table-td center is-title>支付项名称：</hc-info-table-td>
            <hc-info-table-td width="120px">{{ formModel?.payName }}</hc-info-table-td>
        </tr>
        <tr>
            <hc-info-table-td center is-title>支付项类型：</hc-info-table-td>
            <hc-info-table-td width="120px">{{ formModel?.payTypeName }}</hc-info-table-td>
            <hc-info-table-td center is-title>是否为扣款项：</hc-info-table-td>
            <hc-info-table-td width="120px">{{ formModel?.isDeduct === 1 ? '是' : '否' }}</hc-info-table-td>
        </tr>
        <tr>
            <hc-info-table-td center is-title>是否合计项：</hc-info-table-td>
            <hc-info-table-td width="120px">{{ formModel?.isTotalTerms === 1 ? '是' : '否' }}</hc-info-table-td>
            <hc-info-table-td center is-title>是否显示百分比：</hc-info-table-td>
            <hc-info-table-td width="120px">{{ formModel?.isShowPercent === 1 ? '是' : '否' }}</hc-info-table-td>
        </tr>
        <tr>
            <hc-info-table-td center is-title>是否手动输入：</hc-info-table-td>
            <hc-info-table-td width="120px">{{ formModel?.isManualInput === 1 ? '是' : '否' }}</hc-info-table-td>
            <hc-info-table-td center is-title>排序号：</hc-info-table-td>
            <hc-info-table-td width="120px">{{ formModel?.sort }}</hc-info-table-td>
        </tr>
        <tr>
            <hc-info-table-td center is-title>合同计算公式名称：</hc-info-table-td>
            <hc-info-table-td width="auto" colspan="3">{{ formModel?.contractFormulaIds }}</hc-info-table-td>
        </tr>
        <tr>
            <hc-info-table-td center is-title>变更计算公式名称：</hc-info-table-td>
            <hc-info-table-td width="auto" colspan="3">{{ formModel?.updateFormulaIds }}</hc-info-table-td>
        </tr>
        <tr>
            <hc-info-table-td center is-title>本期计算公式名称：</hc-info-table-td>
            <hc-info-table-td width="auto" colspan="3">{{ formModel?.currentFormulaIds }}</hc-info-table-td>
        </tr>
        <tr>
            <hc-info-table-td center is-title>备注：</hc-info-table-td>
            <hc-info-table-td width="auto" colspan="3">{{ formModel?.remarks }}</hc-info-table-td>
        </tr>
    </hc-info-table>
</template>

<script setup>
import { ref, watch } from 'vue'
import payApi from '~api/project/debit/project/pay.js'
import { getObjValue } from 'js-fast-way'

const props = defineProps({
    ids: {
        type: [String, Number],
        default: '',
    },
})
//事件

const formModel = ref({})
//获取节点详情
const getDetail = async (id)=>{
    const { error, code, data } = await payApi.getProDetail({
       id,
    })
    if (!error && code === 200) {
        formModel.value = getObjValue(data)
   
    } else {
        formModel.value = {}
    }
}
//监听
watch(() => [
    props.ids,
], ([ids]) => {
    if (ids.length > 0) {
        getDetail(ids)
    }
  
}, { immediate: true })
</script>
