Files
geg-gas-web/src/components/common/approStatusModal.vue

73 lines
2.4 KiB
Vue
Raw Normal View History

2026-01-14 17:44:36 +08:00
<template>
<div>
2026-01-20 17:32:35 +08:00
<BasicModal v-bind="$attrs" @register="registerModal" width="60%" :title="getTitle" :showOkBtn="false" :showCancelBtn="false" @visible-change="handleVisibleChange">
2026-01-14 17:44:36 +08:00
<BasicTable @register="registerTable"></BasicTable>
</BasicModal>
</div>
</template>
<script lang="ts" setup>
import { ref, computed, unref, nextTick } from 'vue';
import { BasicModal, useModalInner, useModal } from '/@/components/Modal';
import { BasicForm, useForm } from '/@/components/Form/index';
import { BasicTable, useTable, FormSchema, BasicColumn, TableAction } from '/@/components/Table';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
2026-01-16 17:28:00 +08:00
import { getLngPngApproRecords} from '/@/api/dayPlan/PngAppro';
2026-01-14 17:44:36 +08:00
const { t } = useI18n();
const columns: BasicColumn[] = [
2026-01-20 17:32:35 +08:00
{ dataIndex: 'userName', title: '审批人', align: 'left', sorter: true },
{ dataIndex: 'createDate', title: '审批时间', align: 'left', sorter: true },
{ dataIndex: 'cfmRej', title: '通过/驳回', align: 'left', sorter: true },
{ dataIndex: 'reply', title: '驳回原因', align: 'left', sorter: true },
2026-01-14 17:44:36 +08:00
];
const emit = defineEmits(['success', 'register']);
const isUpdate = ref(true);
2026-01-16 17:28:00 +08:00
const id = ref('')
2026-01-14 17:44:36 +08:00
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
2026-01-16 17:28:00 +08:00
id.value = data.id
2026-01-14 17:44:36 +08:00
});
2026-01-20 17:32:35 +08:00
const [registerTable, {reload}] = useTable({
2026-01-14 17:44:36 +08:00
title: t('审批状态'),
2026-01-16 17:28:00 +08:00
api: getLngPngApproRecords,
2026-01-14 17:44:36 +08:00
columns,
formConfig: {
rowProps: {
gutter: 16,
},
schemas: [],
showResetButton: false,
showSubmitButton: false
},
bordered: true,
pagination: false,
canResize: false,
useSearchForm: false,
showTableSetting: false,
2026-01-20 17:32:35 +08:00
immediate: false, // 设置为不立即调用
2026-01-14 17:44:36 +08:00
beforeFetch: (params) => {
2026-01-16 17:28:00 +08:00
return (id.value);
2026-01-14 17:44:36 +08:00
},
});
2026-01-20 17:32:35 +08:00
const handleVisibleChange = (visible: boolean) => {
if (visible) {
nextTick(() => {
reload();
});
}
};
2026-01-14 17:44:36 +08:00
const getTitle = computed(() => (!unref(isUpdate) ? t('审批状态') : t('')));
</script>
<style lang="less" scoped>
:deep(.ant-table-title) {
display: none !important;
}
</style>