年度计划接口

This commit is contained in:
‘huanghaiixia’
2026-04-10 18:04:54 +08:00
parent e5c9f5b13f
commit 7c0f7598ab
7 changed files with 471 additions and 57 deletions

View File

@ -13,7 +13,8 @@
{{ button.name }}
</a-button>
</template>
</template>
<a-alert :message="yearTip" type="info" show-icon style="margin-left: 8px;" />
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'action'">
<TableAction :actions="getActions(record)" />
@ -34,7 +35,7 @@
import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
import { getLngPlanYearDemandHdrPage, deleteLngPlanYearDemandHdr, exportLngPlanYearDemandHdr} from '/@/api/plan/PlanYearDemandHdrEc';
import { getLngPlanYearDemandHdrPage, deleteLngPlanYearDemandHdr, exportLngPlanYearDemandHdr,getPlanYearTip} from '/@/api/plan/PlanYearDemandHdrEc';
import { PageWrapper } from '/@/components/Page';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
@ -50,8 +51,13 @@
import Icon from '/@/components/Icon/index';
import useEventBus from '/@/hooks/event/useEventBus';
import { cloneDeep } from 'lodash-es';
import { useUserStore } from '/@/store/modules/user';
import { getCompDept } from '/@/api/approve/Appro';
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
const userStore = useUserStore();
const userInfo = userStore.getUserInfo;
const curCuCode = ref('')
const yearTip = ref()
const { notification } = useMessage();
const { t } = useI18n();
@ -104,7 +110,7 @@
showResetButton: true,
},
beforeFetch: (params) => {
return { ...params, FormId: formIdComputedRef.value, PK: 'id', page: params.limit };
return { ...params, FormId: formIdComputedRef.value, PK: 'id', page: params.limit, cuCode: curCuCode.value };
},
afterFetch: (res) => {
tableRef.value.setToolBarWidth();
@ -115,7 +121,7 @@
striped: false,
actionColumn: {
width: 160,
width: 180,
title: '操作',
dataIndex: 'action',
slots: { customRender: 'action' },
@ -160,7 +166,8 @@
query: {
formPath: 'plan/PlanYearDemandHdrEc',
formName: '新建'+formName,
formId:currentRoute.value.meta.formId
formId:currentRoute.value.meta.formId,
cuCode: curCuCode.value
}
});
}
@ -214,8 +221,17 @@
dbClickRow(record);
}
function handleUpdate () {
function handleUpdate (record) {
router.push({
path: '/plan/PlanYearDemandHdrEc/createForm',
query: {
formPath: 'plan/PlanYearDemandHdrEc',
formName: '变更'+formName,
formId:currentRoute.value.meta.formId,
id: record.id,
type: 'update'
}
})
}
async function handleExport() {
const res = await exportLngPlanYearDemandHdr({ isTemplate: false });
@ -225,8 +241,12 @@
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
);
}
onMounted(() => {
onMounted(async() => {
const res = await getCompDept(userInfo.id)
curCuCode.value = res?.comp?.cuCode
const data = await getPlanYearTip()
yearTip.value = data?.msg
if (schemaIdComputedRef.value) {
bus.on(FLOW_PROCESSED, handleRefresh);
bus.on(CREATE_FLOW, handleRefresh);