Merge pull request 'master' (#1098) from master into prod

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/1098
This commit is contained in:
2025-07-27 12:40:09 +00:00

View File

@@ -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 <span>{toThousands(row.economicEstimate)}</span>
}
},
@@ -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 <span>{row.taskNode}</span>
}else if(row.state=='1'){
} else if (row.state == '1') {
return <span>{row.approveName}</span>
}else {
} else {
return <span>--</span>
}
}
@@ -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 (<Tag dictType={'project_filing'} value={'0'}/>)
}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 (<Tag dictType={'project_filing'} value={'4'}/>)
} else {
return (<Tag dictType={'project_filing'} value={'0'}/>)
}
} else if (buttons.has("openFileSwitch")) {//科创部, 有这权限时
return (<Tag dictType={'project_filing'} value={'4'}/>)
}else{
} else {
if (row.state !== null) {
return (<Tag dictType={'project_filing'} value={row.state}/>)
} 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 (
<div style={{width: '100%'}}>
@@ -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()