diff --git a/src/service/api/pendingChange.ts b/src/service/api/pendingChange.ts index e39b143..e1dd84c 100644 --- a/src/service/api/pendingChange.ts +++ b/src/service/api/pendingChange.ts @@ -1,6 +1,6 @@ import { request } from '../request'; -// 列表查询 +// 待投用变更列表查询 export function pendingChangeListApi(params:{page_num:number,page_size:number}) { return request({ url: `/api/pssr/pending-use`, @@ -8,3 +8,12 @@ export function pendingChangeListApi(params:{page_num:number,page_size:number}) params, }); } + +// 变更投入和效果列表查询 +export function effectListApi(params:{page_num:number,page_size:number}) { + return request({ + url: `/api/reports/invest-effect`, + method: 'get', + params, + }); +} diff --git a/src/views/my/effect/index.vue b/src/views/my/effect/index.vue index 80b1651..32f63ef 100644 --- a/src/views/my/effect/index.vue +++ b/src/views/my/effect/index.vue @@ -3,44 +3,97 @@ import { ref, onMounted } from 'vue'; import { Icon } from '@iconify/vue' import { useThemeStore } from '@/store/modules/theme'; import { useRouterPush } from '@/hooks/common/router'; +import { tagTextColor, tagBgColor, tagBorderColor } from '@/utils/common'; +import { systemConfigApi } from '@/service/api/system'; +import { effectListApi } from '@/service/api/pendingChange'; const themeStore = useThemeStore(); const { routerPushByKey } = useRouterPush(); const loading = ref(false); const list = ref([]); -const lists = [ - { title: "氮气管网压力分级调整", id: "MOC-2026-R01-0024", applicant: "张工艺", type: "工艺", level: "重要", duration: "永久", applyDate: "2026-05-28", useTime: "2026-06-20", acceptDate: "2026-07-08", cost: 3.2, result: "完全达到" }, - { title: "R-201 搅拌密封改造", id: "MOC-2026-R01-0019", applicant: "张工艺", type: "设备", level: "一般", duration: "永久", applyDate: "2026-03-18", useTime: "2026-04-12", acceptDate: "2026-05-20", cost: 6.8, result: "完全达到" }, - { title: "循环水加药泵冲程临时调整", id: "MOC-2026-R01-0022", applicant: "张工艺", type: "设备", level: "一般", duration: "临时", applyDate: "2026-04-25", useTime: "2026-05-18", acceptDate: "2026-06-30", cost: 1.5, result: "基本达到" }, -]; -// 获取列表数据 -const getList = () => { - loading.value = true; - setTimeout(() => { - list.value = lists; - loading.value = false; - }, 1000); -} +// 总投入 +const totalCost = ref(0); +// 完全达到率 +const fullRate = ref(0); +// 标准列表 +const standardList = ref([]); +// 分页 +const pagination = ref<{page: number, pageSize: number, itemCount: number}>({ + page: 1, + pageSize: 20, + itemCount: 0, +}) +// 变更类型列表 +const typeList = ref([]); +// 变更等级列表 +const levelList = ref([]); // 导出文件 const exportFile = () => { - window.$message?.success(`导出本车间已验收变更投入和效果表(Excel)`) + window.$message?.info('还差接口') } // 查看 const openRow = (r: any) => { - window.$message?.info(`打开变更详情页 ${r.id}(含验收报告与费用明细)`); + routerPushByKey("details_index",{ query: { id: r?.change_id?.toString(),status:r?.status?.toString() || '',key:'my_effect' } }); }; +// 分页改变 +const pageChange = (page: number) => { + pagination.value.page = page; + getList(); +} + +// 匹配对象 +const matchObj= (list:any[],val:any) => { + const item = list.find((item:any) => item.value == val); + return item || null; +} + +// 获取列表数据 +const getList = async () => { + loading.value = true; + const {data,error} = await effectListApi({ + page_num:pagination.value.page, + page_size:pagination.value.pageSize, + }); + if(!error){ + list.value = data?.list || []; + pagination.value.itemCount = data?.total || 0; + totalCost.value = data?.summary?.total_cost || 0; + fullRate.value = data?.summary?.full_rate || 0; + standardList.value = data?.summary?.items || []; + } + loading.value = false; +} + +// 获取配置 +const getConfig = async () => { + loading.value = true; + const {data,error} = await systemConfigApi(); + if(!error){ + // 解析 变更类型设置 + const changeTypeGroup = data.find((group:{group_key:string}) => group.group_key === 'change_type'); + if (changeTypeGroup) { + typeList.value = typeList.value.concat(changeTypeGroup.items); + } + // 解析 变更等级设置 + const changeLevelGroup = data.find((group:{group_key:string}) => group.group_key === 'change_level'); + if (changeLevelGroup) { + levelList.value = levelList.value.concat(changeLevelGroup.items); + } + getList(); + } + loading.value = false; +} onMounted(() => { - getList(); + getConfig(); })