From 9560a964e745964a23912713eb5cdbed6d7ad26f Mon Sep 17 00:00:00 2001 From: dj <1042039504@qq.com> Date: Sun, 27 Jul 2025 20:39:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(filling):=20=E4=BF=AE=E6=94=B9=E4=B8=8B?= =?UTF-8?q?=E5=B1=9E=E5=85=AC=E5=8F=B8=E5=BD=92=E6=A1=A3=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/project-management/filing/index.vue | 133 +++++++++++------- 1 file changed, 84 insertions(+), 49 deletions(-) diff --git a/src/views/project-management/filing/index.vue b/src/views/project-management/filing/index.vue index 023401b..2d979ed 100644 --- a/src/views/project-management/filing/index.vue +++ b/src/views/project-management/filing/index.vue @@ -12,7 +12,7 @@ import fvSelect from '@/fvcomponents/fvSelect/index.vue' import {toThousands} from '@/utils/changePrice.js' import {switchAttachmentState} from "@/api/project-manage/attachment"; import {ElMessageBox, ElNotification} from "element-plus"; -import { getSubCompOpt } from '@/api/user/user.js'; +import {getSubCompOpt} from '@/api/user/user.js'; import {filterProjectName} from "@/api/project-manage"; import {filterRequirementName} from "@/api/project-demand"; @@ -57,16 +57,16 @@ const searchConfig = ref([ filterable: true, options: [], remote: true, - remoteMethod:async (val)=>{ - if(val){ - const res=await filterRequirementName(val) - if(res.code==1000){ - let optionObj={} - let options=[] - res.data.forEach(item=>{ - optionObj={ - value:item, - label:item + remoteMethod: async (val) => { + if (val) { + const res = await filterRequirementName(val) + if (res.code == 1000) { + let optionObj = {} + let options = [] + res.data.forEach(item => { + optionObj = { + value: item, + label: item } options.push(optionObj) }) @@ -86,7 +86,7 @@ const searchConfig = ref([ data: [], filterable: true, checkStrictly: true, - remote:true + remote: true } }, { @@ -99,16 +99,16 @@ const searchConfig = ref([ filterable: true, options: [], remote: true, - remoteMethod:async (val)=>{ - if(val){ - const res=await filterProjectName(val,'50') - if(res.code==1000){ - let optionObj={} - let options=[] - res.data.forEach(item=>{ - optionObj={ - value:item, - label:item + remoteMethod: async (val) => { + if (val) { + const res = await filterProjectName(val, '50') + if (res.code == 1000) { + let optionObj = {} + let options = [] + res.data.forEach(item => { + optionObj = { + value: item, + label: item } options.push(optionObj) }) @@ -211,7 +211,7 @@ const tableConfig = reactive({ type: 'index', label: '序号', align: 'center', - width:85, + width: 85, index: index => { return (tableIns.value.getQuery().pageNum - 1) * tableIns.value.getQuery().pageSize + index + 1 } @@ -284,7 +284,7 @@ const tableConfig = reactive({ label: '预估经费预算(元)', align: 'center', width: 150, - currentRender:({row})=>{ + currentRender: ({row}) => { return {toThousands(row.economicEstimate)} } }, @@ -302,11 +302,11 @@ const tableConfig = reactive({ align: 'center', width: 120, currentRender: ({row, index}) => { - if(row.state=='3'||row.state=='4'){ + if (row.state == '3' || row.state == '4') { return {row.taskNode} - }else if(row.state=='1'){ + } else if (row.state == '1') { return {row.approveName} - }else { + } else { return -- } } @@ -319,12 +319,17 @@ const tableConfig = reactive({ showOverflowTooltip: false, currentRender: ({row, index}) => { let buttons = new Set(Array.from(row.buttons)) - if (!buttons.has("openFileSwitch")&&row.state!=1) { - console.log('row',row) - return () - }else if (buttons.has("openFileSwitch")) { + if (!buttons.has("openFileSwitch") && row.state != 1) { + console.log('row', row) + if (!buttons.has("openFileSwitch") && !buttons.has("closeFileSwitch") && row.state == 4) { + //下属公司, 没这两个按钮时, 状态为4 + return () + } else { + return () + } + } else if (buttons.has("openFileSwitch")) {//科创部, 有这权限时 return () - }else{ + } else { if (row.state !== null) { return () } else { @@ -337,29 +342,59 @@ const tableConfig = reactive({ prop: 'oper', label: '操作', align: 'center', - fixed:'right', + fixed: 'right', width: 150, showOverflowTooltip: false, currentRender: ({row, index}) => { let btn = [] let buttons = new Set(Array.from(row.buttons)) if (buttons.has("details")) { - btn.push({label: '详情', prem: ['project:management:filing:detail'], func: () => handleDetail(row), type: 'primary'}) + btn.push({ + label: '详情', + prem: ['project:management:filing:detail'], + func: () => handleDetail(row), + type: 'primary' + }) } if (buttons.has("attachments")) { - btn.push({label: '附件', prem: ['project:management:filing:attachment'], func: () => handleAttachment(row), type: 'primary'}) + btn.push({ + label: '附件', + prem: ['project:management:filing:attachment'], + func: () => handleAttachment(row), + type: 'primary' + }) } if (buttons.has("entry")) { - btn.push({label: '结项', prem: ['project:management:filing:conclusion'], func: () => handleConclusion(row), type: 'primary'}) + btn.push({ + label: '结项', + prem: ['project:management:filing:conclusion'], + func: () => handleConclusion(row), + type: 'primary' + }) } if (buttons.has("edit")) { - btn.push({label: '编辑', prem: ['project:management:filing:conclusion'], func: () => handleEdit(row), type: 'primary'}) + btn.push({ + label: '编辑', + prem: ['project:management:filing:conclusion'], + func: () => handleEdit(row), + type: 'primary' + }) } if (buttons.has("openFileSwitch")) { - btn.push({label: '开启上传', prem: ['filing:attachment:switch'], func: () => handleOpenUpload(row,true), type: 'primary'}) + btn.push({ + label: '开启上传', + prem: ['filing:attachment:switch'], + func: () => handleOpenUpload(row, true), + type: 'primary' + }) } if (buttons.has("closeFileSwitch")) { - btn.push({label: '关闭上传', prem: ['filing:attachment:switch'], func: () => handleOpenUpload(row,false), type: 'primary'}) + btn.push({ + label: '关闭上传', + prem: ['filing:attachment:switch'], + func: () => handleOpenUpload(row, false), + type: 'primary' + }) } return (
@@ -411,7 +446,7 @@ const handleAttachment = (row) => { name: 'Filing/attachment', query: { id: row.projectId, - requirementId:row.requirementId + requirementId: row.requirementId } }) } @@ -433,21 +468,21 @@ const handleEdit = (row) => { } }) } -const handleOpenUpload=(row,flag)=>{ - console.log('tableIns',tableIns.value) - ElMessageBox.confirm(`是否确认${flag?'开启':'关闭'}上传文件?`, '提示', { +const handleOpenUpload = (row, flag) => { + console.log('tableIns', tableIns.value) + ElMessageBox.confirm(`是否确认${flag ? '开启' : '关闭'}上传文件?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { - let params={ + let params = { open: flag, - projectId: row.projectId + projectId: row.projectId } - switchAttachmentState(params).then(res=>{ - if(res.code==1000){ + switchAttachmentState(params).then(res => { + if (res.code == 1000) { tableIns.value.refresh() - }else{ + } else { ElNotification({ title: '提示', message: res.msg, @@ -459,7 +494,7 @@ const handleOpenUpload=(row,flag)=>{ } const init = async () => { const res = await getSubCompOpt() - searchConfig.value.find(item=>item.prop == 'affiliatedCompanyId').props.data = res.data + searchConfig.value.find(item => item.prop == 'affiliatedCompanyId').props.data = res.data } init()