<script setup lang="ts">
import { VxeUI } from 'vxe-pc-ui';
import type { SystemItemModel } from '@/model/care.model';
import { getConditioningSchemeDetailMethod } from '@/request/api/care.api';

const props = defineProps<{
  data: SystemItemModel;
}>();
onMounted(async () => {
  try {
    const res = await getConditioningSchemeDetailMethod(props.data);
    Object.assign(props.data, res);
  } catch (error) {
    console.log(error, 'getCpDetailMethod-error');
  }
})

function onCancel() {
  // 关闭弹窗或返回
  VxeUI.modal.close(`see-health-evaluation-modal`);
}
function onOk() {
  // 提交逻辑
  VxeUI.modal.close(`see-health-evaluation-modal`);
}
</script>

<template>
  <div style="padding: 32px 0 0 32px; min-height: 500px">
    <div style="margin-bottom: 24px">
      <span style="font-weight: bold">项目名称：</span>
      <span>{{ data?.name }}</span>
    </div>
    <div style="display: flex; align-items: center; margin-bottom: 24px">
      <span style="width: 80px">单价：</span>
      <a-input v-model:value="data.cpFixedPricingRule.unitPrice" placeholder="请输入" style="width: 180px; margin-right: 8px" disabled />
      <span style="margin-right: 8px">元</span>
    </div>
    <div style="display: flex; align-items: center; margin-bottom: 24px">
      <span style="width: 80px">计价单位：</span>
      <a-input v-model:value="data.cpFixedPricingRule.pricingUnit" placeholder="次" style="width: 180px" disabled />
    </div>
    <div style="margin-bottom: 24px">
      <span style="font-weight: bold">机构：</span>
      <span>{{ data?.institutionName }}</span>
    </div>
    <div style="display: flex; justify-content: center; margin-top: 100px">
      <a-button style="margin-right: 48px" @click="onCancel">取消</a-button>
      <a-button type="primary" style="background: #faad14; border: none" @click="onOk">确定</a-button>
    </div>
  </div>
</template>

<style scoped>
/* 可根据需要自定义样式 */
</style>
