Files
xk-admin/apps/web-antd/src/views/system/doctor-input/components/AuditModal.vue
李琦 3e09ba5225
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
1. 业务员查看维度增加
2026-07-11 17:35:33 +08:00

92 lines
2.2 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script lang="ts" setup>
import { ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { message, Radio, RadioGroup, Textarea } from 'ant-design-vue';
import { auditDoctorInput } from '../api';
const auditStatus = ref<number>(1);
const auditRemark = ref<string>('');
const currentRow = ref<any>(null);
const gridApi = ref<any>(null);
const loading = ref(false);
/**
* 提交医生预填审核结果
* 通过 onConfirm 注册,与 Vben Modal 确认按钮对接
*/
const handleAudit = async () => {
if (!currentRow.value) {
message.error('数据错误');
return;
}
loading.value = true;
modalApi.setState({ confirmLoading: true });
try {
await auditDoctorInput({
id: currentRow.value.id,
status: auditStatus.value,
audit_remark: auditRemark.value,
});
message.success('审核成功');
gridApi.value?.reload();
modalApi.close();
auditStatus.value = 1;
auditRemark.value = '';
} catch (error) {
console.error('审核失败:', error);
message.error('审核失败,请稍后重试');
} finally {
loading.value = false;
modalApi.setState({ confirmLoading: false });
}
};
const [ModalComponent, modalApi] = useVbenModal({
fullscreenButton: false,
draggable: true,
onCancel() {
modalApi.close();
},
onConfirm: handleAudit,
onOpenChange(isOpen: boolean) {
if (isOpen) {
const { values, gridApi: api } = modalApi.getData<Record<string, any>>();
currentRow.value = values;
gridApi.value = api;
auditStatus.value = 1;
auditRemark.value = '';
}
},
});
</script>
<template>
<ModalComponent
title="审核医生预填"
class="w-[500px]"
:confirm-loading="loading"
>
<div class="space-y-4 p-4">
<div>
<div class="mb-2 font-semibold">审核结果</div>
<RadioGroup v-model:value="auditStatus">
<Radio :value="1">审核通过</Radio>
<Radio :value="2">审核拒绝</Radio>
</RadioGroup>
</div>
<div>
<div class="mb-2 font-semibold">审核备注</div>
<Textarea
v-model:value="auditRemark"
:rows="4"
placeholder="请输入审核备注(可选)"
/>
</div>
</div>
</ModalComponent>
</template>