IntroduceProjectList.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <script lang="ts" setup>
  2. import { ref } from 'vue';
  3. import type { SystemItemModel, SystemCwModel } from '@/model/care.model';
  4. import { VxeUI } from 'vxe-pc-ui';
  5. import { getConditioningRecordDetailMethod } from '@/request/api/care.api';
  6. const tableData = ref<SystemItemModel[]>([]);
  7. type FollowModel = Partial<SystemCwModel>;
  8. const props = defineProps<{ data: FollowModel; id: string }>();
  9. // 引入已有项目
  10. async function handleAdd(row: any) {
  11. // 关闭引入服务包弹窗
  12. VxeUI.modal.close(`systemService-list-modal`);
  13. // 关闭引入已有项目弹窗
  14. VxeUI.modal.close(`introduceProjectList-modal`);
  15. }
  16. function handleCancel() {
  17. VxeUI.modal.close(`introduceProjectList-modal`);
  18. }
  19. const dataObj = reactive<SystemCwModel>({
  20. type: 'institution',
  21. id: props.id,
  22. });
  23. onMounted(async () => {
  24. const res: any = await getConditioningRecordDetailMethod(dataObj);
  25. tableData.value = res.items;
  26. });
  27. const checked = ref(true);
  28. </script>
  29. <template>
  30. <div style="background: #fff; border-radius: 6px">
  31. <vxe-table :data="tableData" border :row-class-name="({ row }) => (!row.canImport ? 'highlight-row' : '')">
  32. <vxe-column field="conditioningProgramDetail.name" title="项目名称" width="200" />
  33. <vxe-column field="conditioningProgramDetail.conditioningProgramType" title="方案类型" width="300" />
  34. <vxe-column title="是否可引入" width="200" align="center">
  35. <template #default="{ row }">
  36. <a-checkbox v-if="true" v-model:checked="checked" disabled />
  37. <span v-else style="color: #f5222d; margin-right: 8px; font-size: 8px">{{ row.reason }}</span>
  38. </template>
  39. </vxe-column>
  40. </vxe-table>
  41. <div style="display: flex; justify-content: center; margin-top: 24px">
  42. <a-button style="margin-right: 24px" @click="handleCancel">取消</a-button>
  43. <a-button type="primary" @click="handleAdd">引入已有项目</a-button>
  44. </div>
  45. </div>
  46. </template>
  47. <style scoped>
  48. .highlight-row {
  49. background: #f8f5e6 !important;
  50. }
  51. </style>