AssociateLossReport.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <div>
  3. <el-dialog
  4. v-model="dialogVisible"
  5. width="500"
  6. align-center
  7. @close="handleCancel"
  8. class="associate-loss-report-dialog"
  9. >
  10. <template #header>
  11. <div class="dialog-header">
  12. <span>关联损失上报记录</span>
  13. </div>
  14. </template>
  15. <el-select v-model="taskId" clearable placeholder="请选择需关联的损失上报记录" style="width: 400px">
  16. <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
  17. </el-select>
  18. <template #footer>
  19. <div class="dialog-footer">
  20. <el-button type="primary" @click="handleSubmit">提交</el-button>
  21. <el-button @click="handleCancel">取消</el-button>
  22. </div>
  23. </template>
  24. </el-dialog>
  25. </div>
  26. </template>
  27. <script setup lang="ts">
  28. import { onMounted, ref } from 'vue';
  29. import { ElDialog, ElSelect, ElOption, ElButton } from 'element-plus';
  30. import { QueryAllDisasterHandleTaskRes, getDisasterHandleTaskList } from '@/api/emergency-procedure';
  31. const emits = defineEmits(['submit', 'cancel']);
  32. const dialogVisible = ref(true);
  33. const taskId = ref<number>();
  34. const options = ref<Array<{ label: string; value: number }>>([]);
  35. const handleSubmit = () => {
  36. emits('submit', taskId.value);
  37. };
  38. const handleCancel = () => {
  39. emits('cancel');
  40. };
  41. onMounted(async () => {
  42. const response = await getDisasterHandleTaskList();
  43. options.value = response.map((item: QueryAllDisasterHandleTaskRes) => ({
  44. label: item.taskName,
  45. value: item.id,
  46. }));
  47. });
  48. </script>
  49. <style scoped lang="scss">
  50. :deep(.associate-loss-report-dialog) {
  51. min-height: 200px;
  52. padding: 20px 30px;
  53. .el-dialog__header {
  54. padding-right: 0;
  55. padding-bottom: 40px;
  56. }
  57. .dialog-header {
  58. font-size: 20px;
  59. font-weight: bold;
  60. display: flex;
  61. justify-content: center;
  62. }
  63. .el-dialog__headerbtn {
  64. font-size: 30px;
  65. width: 60px;
  66. height: 60px;
  67. top: 8px;
  68. right: 8px;
  69. }
  70. .el-dialog__body {
  71. display: flex;
  72. flex-direction: column;
  73. align-items: center;
  74. }
  75. .el-dialog__footer {
  76. padding-top: 40px;
  77. }
  78. }
  79. </style>