<template>
  <div class="p-2">
    <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
      <div v-show="showSearch" v-loading="loading" class="mb-[10px]">
        <el-card shadow="never">
          <template #header>
            <div>
              <span>对账数据</span>
            </div>
          </template>
          <el-table v-loading="loading" :data="recDetailList">
            <el-table-column label="来源系统" align="center" prop="sourceCode">
              <template #default="scope">
                <dict-tag :options="bfs_buss_system" :value="scope.row.sourceCode" />
              </template>
            </el-table-column>
            <el-table-column label="业务场景类别编码" align="center" prop="bussType" width="100px" />
            <el-table-column label="业务场景类别名称" align="center" prop="bussName" width="120px" />
            <el-table-column label="保单险种" align="center" prop="policyProductId" width="200px" />
            <el-table-column label="团单号" align="center" prop="policyNo" width="200px" />
            <el-table-column label="保单号" align="center" prop="singlePolicyNo" width="200px" />
            <el-table-column label="险种代码" align="center" prop="productCode" />
            <el-table-column label="总金额" align="center" prop="amount" width="100px" />
            <el-table-column label="不含税金额" align="center" prop="income" width="100px" />
            <el-table-column label="税额" align="center" prop="tax" width="100px" />
            <el-table-column label="交易日期" align="center" prop="businessDate" width="150px">
              <template #default="scope">
                <span>{{ parseTime(scope.row.businessDate, '{y}-{m}-{d}') }}</span>
              </template>
            </el-table-column>
            <el-table-column label="案件ID" align="center" prop="claimId" width="200px" />
            <el-table-column label="应付号" align="center" prop="actugetno" width="200px" />
            <el-table-column label="理赔回退标识" align="center" prop="isBack" />
            <el-table-column label="业务渠道" align="center" prop="channelCode" />
            <el-table-column label="销售渠道" align="center" prop="salesChannel" />
            <el-table-column label="收付机构" align="center" prop="subManageCom" width="200px" />
            <el-table-column label="银行账户代码" align="center" prop="bankAccount" width="200px" />
            <el-table-column label="银行账户名称" align="center" prop="bankAccountName" />
            <el-table-column label="支付方式" align="center" prop="payMode" />
            <el-table-column label="保单业务交易号码" align="center" prop="transactionNo" width="200px" />
            <el-table-column label="保单管理机构" align="center" prop="policyOrgCode" width="200px" />
            <el-table-column label="首年标志" align="center" prop="snflag" />
            <el-table-column label="首期标志" align="center" prop="sqflag" />
            <el-table-column label="缴别" align="center" prop="payIntervalType" />
            <el-table-column label="缴费期限" align="center" prop="payInterval" />
            <el-table-column label="缴费期限标志" align="center" prop="payIntervalFlag" />
            <el-table-column label="业务来源" align="center" prop="businessSource" />
            <el-table-column label="费用类型" align="center" prop="expenseType" />
            <el-table-column label="健康险业务标识" align="center" prop="healthLabel" />
            <el-table-column label="银行记账码" align="center" prop="matchCode" width="200px" />
            <el-table-column label="开户行" align="center" prop="hbkId" />
            <el-table-column label="账户标示" align="center" prop="hktId" />
            <el-table-column label="业务性质" align="center" prop="operSourceType" />
            <el-table-column label="税率" align="center" prop="taxRate" />
            <el-table-column label="统一社会信用代码" align="center" prop="taxregno" width="200px" />
            <el-table-column label="税码" align="center" prop="taxCode" />
            <el-table-column label="佣金大类编码" align="center" prop="cwCode" />
            <el-table-column label="佣金项编码" align="center" prop="cwItem" />
            <el-table-column label="承诺项目" align="center" prop="budgetCode" />
            <el-table-column label="业务号码" align="center" prop="businessNo" width="200px" />
          </el-table>
        </el-card>

        <el-card shadow="never">
          <template #header>
            <div>
              <span>业务源数据</span>
            </div>
          </template>
          <el-table v-loading="loading" :data="busDetailList">
            <el-table-column label="来源系统" align="center" prop="sourceCode">
              <template #default="scope">
                <dict-tag :options="bfs_buss_system" :value="scope.row.sourceCode" />
              </template>
            </el-table-column>
            <el-table-column label="业务场景类别编码" align="center" prop="bussType" width="100px" />
            <el-table-column label="业务场景类别名称" align="center" prop="bussName" width="120px" />
            <el-table-column label="保单险种" align="center" prop="policyProductId" width="200px" />
            <el-table-column label="团单号" align="center" prop="policyNo" width="200px" />
            <el-table-column label="保单号" align="center" prop="singlePolicyNo" width="200px" />
            <el-table-column label="险种代码" align="center" prop="productCode" />
            <el-table-column label="总金额" align="center" prop="amount" width="100px" />
            <el-table-column label="不含税金额" align="center" prop="income" width="100px" />
            <el-table-column label="税额" align="center" prop="tax" width="100px" />
            <el-table-column label="交易日期" align="center" prop="businessDate" width="150px">
              <template #default="scope">
                <span>{{ parseTime(scope.row.businessDate, '{y}-{m}-{d}') }}</span>
              </template>
            </el-table-column>
            <el-table-column label="案件ID" align="center" prop="claimId" width="200px" />
            <el-table-column label="应付号" align="center" prop="actugetno" width="200px" />
            <el-table-column label="理赔回退标识" align="center" prop="isBack" />
            <el-table-column label="业务渠道" align="center" prop="channelCode" />
            <el-table-column label="销售渠道" align="center" prop="salesChannel" />
            <el-table-column label="收付机构" align="center" prop="subManageCom" width="200px" />
            <el-table-column label="银行账户代码" align="center" prop="bankAccount" width="200px" />
            <el-table-column label="银行账户名称" align="center" prop="bankAccountName" />
            <el-table-column label="支付方式" align="center" prop="payMode" />
            <el-table-column label="保单业务交易号码" align="center" prop="transactionNo" width="200px" />
            <el-table-column label="保单管理机构" align="center" prop="policyOrgCode" width="200px" />
            <el-table-column label="首年标志" align="center" prop="snflag" />
            <el-table-column label="首期标志" align="center" prop="sqflag" />
            <el-table-column label="缴别" align="center" prop="payIntervalType" />
            <el-table-column label="缴费期限" align="center" prop="payInterval" />
            <el-table-column label="缴费期限标志" align="center" prop="payIntervalFlag" />
            <el-table-column label="业务来源" align="center" prop="businessSource" />
            <el-table-column label="费用类型" align="center" prop="expenseType" />
            <el-table-column label="健康险业务标识" align="center" prop="healthLabel" />
            <el-table-column label="银行记账码" align="center" prop="matchCode" width="200px" />
            <el-table-column label="开户行" align="center" prop="hbkId" />
            <el-table-column label="账户标示" align="center" prop="hktId" />
            <el-table-column label="业务性质" align="center" prop="operSourceType" />
            <el-table-column label="税率" align="center" prop="taxRate" />
            <el-table-column label="统一社会信用代码" align="center" prop="taxregno" width="200px" />
            <el-table-column label="税码" align="center" prop="taxCode" />
            <el-table-column label="佣金大类编码" align="center" prop="cwCode" />
            <el-table-column label="佣金项编码" align="center" prop="cwItem" />
            <el-table-column label="承诺项目" align="center" prop="budgetCode" />
            <el-table-column label="业务号码" align="center" prop="businessNo" width="200px" />
          </el-table>
        </el-card>
      </div>
    </transition>
  </div>
</template>
<script setup name="BFSReconciliationDetail" lang="ts">
import { parseTime } from '@/utils/ruoyi';
import { getRecDetailList } from '@/api/bfs/reconciliation';

const { proxy } = getCurrentInstance() as ComponentInternalInstance;

const { bfs_rec_datatype } = toRefs<any>(proxy?.useDict('bfs_rec_datatype'));
const { bfs_buss_system } = toRefs<any>(proxy?.useDict('bfs_buss_system'));

const showSearch = ref(true);
const loading = ref(false);
const total = ref(0);
const recDetailList = ref([]);
const busDetailList = ref([]);
const recId = ref('');

const data = reactive({
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    id: undefined,
    params: {}
  }
});
const { queryParams } = toRefs(data);

const getList = async () => {
  loading.value = true;
  queryParams.value.id = recId.value;
  const res = await getRecDetailList(queryParams.value);
  recDetailList.value = res.data.recDetail;
  busDetailList.value = res.data.busDetail;
  loading.value = false;
};

onMounted(() => {
  const route = useRoute();
  const _recId = route.query.recId;
  recId.value = _recId;
  getList();
});

</script>

<style scoped lang="scss">

</style>
