fix : 修复页面细节

This commit is contained in:
2024-05-30 16:05:09 +08:00
parent 2ab4eb1a7e
commit 94528cfa06
18 changed files with 412 additions and 301 deletions

View File

@@ -55,13 +55,18 @@ export const getProjectCheckProcess = (projectId) => {
method: "get" method: "get"
}); });
}; };
export const getImplementationAttachment = (projectId) => { export const getImplementationAttachment = (params) => {
return request({ return request({
url: '/workflow/mosr/project/implementation/tags', url: '/workflow/mosr/project/implementation/attachments',
method: "get", method: "get",
params:{ params:params
projectId:projectId });
} };
export const uploadAttachment= (data) => {
return request({
url: '/workflow/mosr/project/implementation/upload',
method: "post",
data: data
}); });
}; };
export const addLedger = (data) => { export const addLedger = (data) => {
@@ -99,15 +104,3 @@ export const getProjectConclusionProcess = () => {
method: "get" method: "get"
}); });
}; };
//文件查询
export const searchFile = (targetId,tag) => {
return request({
url: '/workflow/process/file/query',
method: "get",
params:{
targetId:targetId,
tag:tag
}
});
};

View File

@@ -12,11 +12,11 @@ const router = useRouter()
const route = useRoute() const route = useRoute()
const searchConfig = reactive([ const searchConfig = reactive([
{ {
label: '名称', label: '需求名称',
prop: 'requirementName', prop: 'requirementName',
component: 'el-input', component: 'el-input',
props: { props: {
placeholder: '请输入名称查询', placeholder: '请输入需求名称查询',
clearable: true, clearable: true,
filterable: true, filterable: true,
checkStrictly: true checkStrictly: true

View File

@@ -11,11 +11,11 @@
const router = useRouter(); const router = useRouter();
const searchConfig = reactive([ const searchConfig = reactive([
{ {
label: '名称', label: '项目名称',
prop: 'projectName', prop: 'projectName',
component: 'el-input', component: 'el-input',
props: { props: {
placeholder: '请输入名称查询', placeholder: '请输入项目名称查询',
clearable: true, clearable: true,
filterable: true, filterable: true,
checkStrictly: true checkStrictly: true
@@ -36,17 +36,17 @@ const tableIns = ref()
const tableConfig = reactive({ const tableConfig = reactive({
columns: [ columns: [
{ {
prop: 'requirementName', prop: 'shareName',
label: '分摊名称', label: '分摊名称',
align: 'center' align: 'center'
}, },
{ {
prop: 'collectType', prop: 'apportionmentMonth',
label: '分摊月份', label: '分摊月份',
align: 'center' align: 'center'
}, },
{ {
prop: 'deadline', prop: 'generationTime',
label: '生成时间', label: '生成时间',
align: 'center' align: 'center'
}, },
@@ -54,9 +54,8 @@ const tableConfig = reactive({
prop: 'state', prop: 'state',
label: '状态', label: '状态',
align: 'center', align: 'center',
width: 200,
showOverflowTooltip: false, showOverflowTooltip: false,
currentRender: ({row, index}) => (<Tag dictType={'demand_collection'} value={row.state}/>) currentRender: ({row, index}) => (<Tag dictType={'special_fund'} value={row.state}/>)
}, },
{ {
prop: 'oper', prop: 'oper',
@@ -65,22 +64,25 @@ const tableConfig = reactive({
showOverflowTooltip: false, showOverflowTooltip: false,
currentRender: ({row, index}) => { currentRender: ({row, index}) => {
let btn = [] let btn = []
let buttons = new Set(Array.from(row.buttons)) let buttons
if (buttons.has("details")) { if(row.buttons){
buttons = new Set(Array.from(row.buttons))
}
// if (buttons.has("details")) {
btn.push({label: '详情', prem: ['mosr:requirement:info'], func: () => handleDetail(row), type: 'primary'}) btn.push({label: '详情', prem: ['mosr:requirement:info'], func: () => handleDetail(row), type: 'primary'})
} // }
if (buttons.has("edit")) { // if (buttons.has("edit")) {
btn.push({label: '编辑', prem: ['mosr:requirement:resubmit'], func: () => handleEdit(row), type: 'primary'}) btn.push({label: '编辑', prem: ['mosr:requirement:resubmit'], func: () => handleEdit(row), type: 'primary'})
} // }
// if (buttons.has("delete")) { // if (buttons.has("delete")) {
// btn.push({label: '删除',prem: ['mosr:requirement:del'], func: () => handleDelete(row), type: 'primary'}) // btn.push({label: '删除',prem: ['mosr:requirement:del'], func: () => handleDelete(row), type: 'primary'})
// } // }
if (buttons.has("report")) { // if (buttons.has("report")) {
btn.push({label: '明细导出', prem: ['mosr:requirement:info'], func: () => handleReport(row), type: 'primary'}) btn.push({label: '明细导出', prem: ['mosr:requirement:info'], func: () => handleReport(row), type: 'primary'})
} // }
if (buttons.has("report")) { // if (buttons.has("report")) {
btn.push({label: '汇总导出', prem: ['mosr:requirement:info'], func: () => handleReport(row), type: 'primary'}) btn.push({label: '汇总导出', prem: ['mosr:requirement:info'], func: () => handleReport(row), type: 'primary'})
} // }
return ( return (
<div style={{width: '100%'}}> <div style={{width: '100%'}}>
{ {
@@ -96,17 +98,18 @@ const tableConfig = reactive({
)) ))
} }
{ {
buttons.has("delete") ? // buttons.has("delete") ?
<popover-delete name={row.requirementName} type={'费用分摊'} btnType={'danger'} <popover-delete name={row.requirementName} type={'费用分摊'} btnType={'danger'}
perm={['mosr:requirement:del']} perm={['mosr:requirement:del']}
onDelete={() => handleDelete(row)}/> : '' onDelete={() => handleDelete(row)}/>
// : ''
} }
</div> </div>
) )
} }
} }
], ],
api: '', api: '/workflow/mosr/cost/allocation',
btns: [ btns: [
{name: '添加分摊', key: 'add', color: '#DED0B2'} {name: '添加分摊', key: 'add', color: '#DED0B2'}
], ],

View File

@@ -2,8 +2,8 @@
<div v-loading="loading" class="add-block"> <div v-loading="loading" class="add-block">
<baseTitle title="需求征集信息录入"></baseTitle> <baseTitle title="需求征集信息录入"></baseTitle>
<el-form :model="formData" inline class="query-form" ref="demandForm" :rules="rules"> <el-form :model="formData" inline class="query-form" ref="demandForm" :rules="rules">
<el-form-item v-if="checkFormPrem('requirementName')" label="名称" prop="requirementName"> <el-form-item v-if="checkFormPrem('requirementName')" label="需求名称" prop="requirementName">
<el-input v-model="formData.requirementName" placeholder="请输入名称" clearable></el-input> <el-input v-model="formData.requirementName" placeholder="请输入需求名称" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item v-if="checkFormPrem('companyIds')" label="所属公司" prop="companyIds"> <el-form-item v-if="checkFormPrem('companyIds')" label="所属公司" prop="companyIds">
<el-tree-select v-model="formData.companyIds" :data="companyOption" style="width: 100%;" <el-tree-select v-model="formData.companyIds" :data="companyOption" style="width: 100%;"
@@ -107,7 +107,7 @@ const processStore = useProcessStore()
const processInstanceData = ref() const processInstanceData = ref()
const formPermMap = ref(new Map()); const formPermMap = ref(new Map());
const rules = reactive({ const rules = reactive({
requirementName: [{required: true, message: '请输入名称', trigger: 'blur'}], requirementName: [{required: true, message: '请输入需求名称', trigger: 'blur'}],
companyIds: [{required: true, message: '请选择所属公司', trigger: 'blur'}], companyIds: [{required: true, message: '请选择所属公司', trigger: 'blur'}],
collectType: [{required: true, message: '请选择征集类型', trigger: 'blur'}], collectType: [{required: true, message: '请选择征集类型', trigger: 'blur'}],
deadline: [{required: true, message: '请选择截止时间', trigger: 'blur'}], deadline: [{required: true, message: '请选择截止时间', trigger: 'blur'}],

View File

@@ -22,7 +22,7 @@ const searchConfig = reactive([
prop: 'requirementName', prop: 'requirementName',
component: 'el-input', component: 'el-input',
props: { props: {
placeholder: '请输入名称查询', placeholder: '请输入需求名称查询',
clearable: true, clearable: true,
filterable: true, filterable: true,
checkStrictly: true checkStrictly: true

View File

@@ -139,16 +139,18 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="产学研联合" prop="industryUniversityResearch"> <el-form-item label="产学研联合" prop="industryUniversityResearch">
<el-radio-group v-model="formData.industryUniversityResearch"> <el-radio-group v-model="formData.industryUniversityResearch">
<el-radio :label="0"></el-radio> <el-radio v-for="item in cacheStore.getDict('industry_university')"
<el-radio :label="1"></el-radio> :key="item.value"
:label="item.value">{{item.label}}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="开展政府申报" prop="governmentDeclaration"> <el-form-item label="开展政府申报" prop="governmentDeclaration">
<el-radio-group v-model="formData.governmentDeclaration"> <el-radio-group v-model="formData.governmentDeclaration">
<el-radio :label="0"></el-radio> <el-radio v-for="item in cacheStore.getDict('government_declaration')"
<el-radio :label="1"></el-radio> :key="item.value"
:label="item.value">{{item.label}}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
@@ -259,11 +261,11 @@ const showTable = ref(true)
const otherFileList = ref([]) const otherFileList = ref([])
const file = ref({}) const file = ref({})
const formData = ref({ const formData = ref({
industryUniversityResearch:0, industryUniversityResearch:'0',
governmentDeclaration:0, governmentDeclaration:'0',
}) })
const rules = reactive({ const rules = reactive({
projectName: [{required: true, message: '请输入名称', trigger: 'blur'}], projectName: [{required: true, message: '请输入项目名称', trigger: 'blur'}],
specialFund: [{required: true, message: '请选择专项资金', trigger: 'blur'}], specialFund: [{required: true, message: '请选择专项资金', trigger: 'blur'}],
startTime: [{required: true, message: '请选择开始时间', trigger: 'blur'}], startTime: [{required: true, message: '请选择开始时间', trigger: 'blur'}],
rdSubject: [{required: true, message: '请输入研发主体', trigger: 'blur'}], rdSubject: [{required: true, message: '请输入研发主体', trigger: 'blur'}],

View File

@@ -7,7 +7,6 @@
import {reactive, ref, shallowRef} from 'vue'; import {reactive, ref, shallowRef} from 'vue';
import fvSelect from '@/fvcomponents/fvSelect/index.vue' import fvSelect from '@/fvcomponents/fvSelect/index.vue'
import {useRouter} from 'vue-router'; import {useRouter} from 'vue-router';
const localData = reactive({}) const localData = reactive({})
const tableIns = ref() const tableIns = ref()
@@ -16,10 +15,12 @@ const router = useRouter()
const searchConfig = reactive([ const searchConfig = reactive([
{ {
label: '名称', label: '需求名称',
prop: 'requirementName', prop: 'requirementName',
props: { props: {
placeholder: '请输入' placeholder: '请输入需求名称',
clearable: true,
checkStrictly: true
}, },
component: 'el-input', component: 'el-input',
colProps: {} colProps: {}
@@ -28,42 +29,52 @@ const searchConfig = reactive([
label: '项目类型', label: '项目类型',
prop: 'projectType', prop: 'projectType',
component: shallowRef(fvSelect), component: shallowRef(fvSelect),
props: {}, props: {
placeholder: '请选择项目类型',
cacheKey: 'project_type',
clearable: true,
filterable: true,
},
colProps: {} colProps: {}
}, },
{ {
label: '研发主体', label: '研发主体',
prop: 'productMainBody', prop: 'productMainBody',
component: shallowRef(fvSelect), component: shallowRef(fvSelect),
props: {}, props: {
colProps: {} placeholder: '请选择研发主体',
}, cacheKey: 'rd_subject',
{ clearable: true,
label: '项目影响', filterable: true
prop: 'projectEffect', },
component: shallowRef(fvSelect),
props: {},
colProps: {}
},
{
label: '起止时间',
prop: 'startTime',
component: 'el-date-picker',
props: {},
colProps: {}
},
{
label: '最小金额',
prop: 'minMoney',
component: 'el-input',
colProps: {}
},
{
label: '最大金额',
prop: 'maxMoney',
component: 'el-input',
colProps: {} colProps: {}
}, },
// {
// label: '项目影响',
// prop: 'projectEffect',
// component: shallowRef(fvSelect),
// props: {},
// colProps: {}
// },
// {
// label: '起止时间',
// prop: 'startTime',
// component: 'el-date-picker',
// props: {},
// colProps: {}
// },
// {
// label: '最小金额',
// prop: 'minMoney',
// component: 'el-input',
// colProps: {}
// },
// {
// label: '最大金额',
// prop: 'maxMoney',
// component: 'el-input',
// colProps: {}
// },
]) ])
const tableConfig = reactive({ const tableConfig = reactive({
@@ -100,7 +111,10 @@ const tableConfig = reactive({
{ {
prop: 'startTime', prop: 'startTime',
label: '起止时间', label: '起止时间',
align: 'center' align: 'center',
currentRender: ({row}) => {
return row.startTime + ' 至 ' + row.endTime
}
}, },
{ {
prop: 'state', prop: 'state',
@@ -108,7 +122,7 @@ const tableConfig = reactive({
align: 'center', align: 'center',
showOverflowTooltip: false, showOverflowTooltip: false,
currentRender: ({row, index}) => { currentRender: ({row, index}) => {
if (row.state !== null&&row.state != 0) { if (row.state !== null && row.state != 0) {
return (<Tag dictType={'demand_summary'} value={row.state}/>) return (<Tag dictType={'demand_summary'} value={row.state}/>)
} else { } else {
return '--' return '--'
@@ -127,13 +141,13 @@ const tableConfig = reactive({
btn.push({label: '详情', prem: ['mosr:collect:info'], func: () => handleDetail(row), type: 'primary'}) btn.push({label: '详情', prem: ['mosr:collect:info'], func: () => handleDetail(row), type: 'primary'})
} }
if (buttons.has("edit")) { if (buttons.has("edit")) {
btn.push({label: '编辑',prem: ['mosr:collect:resubmit'], func: () => handleEdit(row), type: 'primary'}) btn.push({label: '编辑', prem: ['mosr:collect:resubmit'], func: () => handleEdit(row), type: 'primary'})
} }
// if (buttons.has("delete")) { // if (buttons.has("delete")) {
// btn.push({label: '删除',prem: ['mosr:requirement:del'], func: () => handleEdit(row), type: 'primary'}) // btn.push({label: '删除',prem: ['mosr:requirement:del'], func: () => handleEdit(row), type: 'primary'})
// } // }
if (buttons.has("report")) { if (buttons.has("report")) {
btn.push({label: '上报',prem: ['mosr:collect:reported'], func: () => handleAdd(row), type: 'primary'}) btn.push({label: '上报', prem: ['mosr:collect:reported'], func: () => handleAdd(row), type: 'primary'})
} }
return ( return (
<div style={{width: '100%'}}> <div style={{width: '100%'}}>
@@ -175,26 +189,26 @@ const search = (val) => {
const handleAdd = (row) => { const handleAdd = (row) => {
router.push({ router.push({
name:'Summary/add', name: 'Summary/add',
query: { query: {
id:row.requirementId id: row.requirementId
} }
}) })
} }
const handleEdit = (row) => { const handleEdit = (row) => {
router.push({ router.push({
name:'Summary/edit', name: 'Summary/edit',
query: { query: {
id:row.requirementId, id: row.requirementId,
projectId:row.projectId projectId: row.projectId
} }
}) })
} }
const handleDetail = (row) => { const handleDetail = (row) => {
router.push({ router.push({
name:'Summary/detail', name: 'Summary/detail',
query: { query: {
id:row.requirementId, id: row.requirementId,
projectId: row.projectId, projectId: row.projectId,
state: row.state state: row.state
} }

View File

@@ -1,17 +1,16 @@
<template> <template>
<div class="apply-block"> <div class="apply-block">
<el-form :model="formData" ref="applyForm" label-width="auto" :rules="rules"> <baseTitle title="项目结项"></baseTitle>
<baseTitle title="项目结项"></baseTitle> <AttachmentUpload ref="attachment" label="项目结项附件" :showTable="showTable" :otherFileList="otherFileList"
<AttachmentUpload ref="attachment" label="项目结项附件" :showTable="showTable" :otherFileList="otherFileList" @getAttachment="getAttachment"
@getAttachment="getAttachment" @getOtherFile="getOtherFile" :showFileList="true" :formData="formData"
@getOtherFile="getOtherFile" :showFileList="true" :formData="formData" :preview="name === 'Filing/edit'"/> :preview="name === 'Filing/edit'"/>
<div class="approval-record"> <div class="approval-record">
<baseTitle title="流程"></baseTitle> <baseTitle title="流程"></baseTitle>
<process-diagram-viewer mode="view" v-if="processDiagramViewer"/> <process-diagram-viewer mode="view" v-if="processDiagramViewer"/>
</div> </div>
</el-form>
<div class="oper-page-btn"> <div class="oper-page-btn">
<el-button color="#DED0B2" v-if="name==='Filing/conclusion'" @click="handleSubmit(applyForm)">提交</el-button> <el-button color="#DED0B2" v-if="name==='Filing/conclusion'" @click="handleSubmit">提交</el-button>
<el-button color="#DED0B2" v-else @click="handleResubmit">重新提交</el-button> <el-button color="#DED0B2" v-else @click="handleResubmit">重新提交</el-button>
</div> </div>
</div> </div>
@@ -23,19 +22,22 @@ import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.v
import {downloadFile} from "@/api/project-demand"; import {downloadFile} from "@/api/project-demand";
import {ElNotification} from "element-plus"; import {ElNotification} from "element-plus";
import {useProcessStore} from '@/stores/processStore.js'; import {useProcessStore} from '@/stores/processStore.js';
import {getProjectConclusionProcess, projectConclusion,getConclusionDetail, resubmitConclusion} from "@/api/project-manage"; import {
getProjectConclusionProcess,
projectConclusion,
getConclusionDetail,
resubmitConclusion
} from "@/api/project-manage";
const router = useRouter() const router = useRouter()
const route = useRoute() const route = useRoute()
const tagsViewStore = useTagsView() const tagsViewStore = useTagsView()
const formData = ref({}) const formData = ref({})
const rules = reactive({
attachment: [{required: true, message: '请上传项目结项附件', trigger: 'blur'}],
})
const attachment = ref() const attachment = ref()
const name=ref(router.currentRoute.value.name) const name = ref(router.currentRoute.value.name)
const loading = ref(false) const loading = ref(false)
const file = ref({}) const file = ref({})
const applyForm = ref()
const deploymentId = ref() const deploymentId = ref()
const showTable = ref(true) const showTable = ref(true)
const otherFileList = ref([]) const otherFileList = ref([])
@@ -93,7 +95,7 @@ const handleDownload = (row) => {
} }
const compositeParam = (item) => { const compositeParam = (item) => {
let tag = '' let tag = ''
if (name.value === 'Filing/conclusion'||name.value === 'Filing/edit') { if (name.value === 'Filing/conclusion' || name.value === 'Filing/edit') {
tag = '项目结项' tag = '项目结项'
} }
return { return {
@@ -107,7 +109,7 @@ const compositeParam = (item) => {
} }
const getAttachment = (val) => { const getAttachment = (val) => {
console.log('上传文件getAttachment', val) console.log('上传文件getAttachment', val)
file.value=compositeParam(val) file.value = compositeParam(val)
} }
const getOtherFile = (val) => { const getOtherFile = (val) => {
console.log('上传文件getOtherFile', val) console.log('上传文件getOtherFile', val)
@@ -125,82 +127,77 @@ const getFileParam = (item) => {
tag: item.tag tag: item.tag
} }
} }
const handleSubmit = (instance) => { const handleSubmit = async () => {
if (!instance) return if (JSON.stringify(file.value) === "{}") {
instance.validate(async (valid) => { attachment.value.validate()
if (!valid) return } else {
if(JSON.stringify(file.value) === "{}"){ attachment.value.clearValidate()
attachment.value.validate() }
} else { let files = []
attachment.value.clearValidate() let singleFile = {}
} if (file.value.fileId !== undefined) {
if (!valid) return singleFile = {
let files = [] fileId: file.value.fileId
let singleFile={}
if(file.value.fileId!==undefined){
singleFile = {
fileId: file.value.fileId
}
}
otherFileList.value.forEach(item => {
files.push(getFileParam(item))
})
let params = {
deploymentId: deploymentId.value,
requirementId: route.query.id,
fileList: files,
singleFile: singleFile,
projectId:route.query.projectId,
}
console.log('params', params)
let res = await projectConclusion(params)
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) {
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
await router.push({
name: 'Filing'
})
} }
}
otherFileList.value.forEach(item => {
files.push(getFileParam(item))
}) })
let params = {
deploymentId: deploymentId.value,
requirementId: route.query.id,
fileList: files,
singleFile: singleFile,
projectId: route.query.projectId,
}
console.log('params', params)
let res = await projectConclusion(params)
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) {
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
await router.push({
name: 'Filing'
})
}
} }
const handleResubmit = () => { const handleResubmit = () => {
let singleFile = {} let singleFile = {}
let otherFiles = [] let otherFiles = []
let fileArray let fileArray
if (JSON.stringify(file.value) === "{}"||attachment.value.singleFile===null) { if (JSON.stringify(file.value) === "{}" || attachment.value.singleFile === null) {
attachment.value.validate() attachment.value.validate()
} else { } else {
attachment.value.clearValidate() attachment.value.clearValidate()
} }
if(attachment.value.singleFile!==null&&name.value === 'Filing/edit'){ if (attachment.value.singleFile !== null && name.value === 'Filing/edit') {
singleFile = { singleFile = {
fileId: attachment.value.singleFile.fileId fileId: attachment.value.singleFile.fileId
} }
fileArray=attachment.value.allFileList fileArray = attachment.value.allFileList
}else { } else {
if (file.value.fileId !== undefined) { if (file.value.fileId !== undefined) {
singleFile = { singleFile = {
fileId: file.value.fileId fileId: file.value.fileId
} }
} }
fileArray=otherFileList.value fileArray = otherFileList.value
} }
fileArray.forEach(item => { fileArray.forEach(item => {
otherFiles.push(getFileParam(item)) otherFiles.push(getFileParam(item))
}) })
//todo requirementId //todo requirementId
let params={ let params = {
deploymentId: deploymentId.value, deploymentId: deploymentId.value,
requirementId: route.query.id, requirementId: route.query.id,
fileList: otherFiles, fileList: otherFiles,
singleFile: singleFile, singleFile: singleFile,
projectId:route.query.projectId, projectId: route.query.projectId,
} }
console.log('重新提交params',params) console.log('重新提交params', params)
resubmitConclusion(params).then(res => { resubmitConclusion(params).then(res => {
ElNotification({ ElNotification({
title: '提示', title: '提示',
@@ -224,11 +221,11 @@ const getDetailInfo = async () => {
}) })
if (res.code === 1000) { if (res.code === 1000) {
formData.value = res.data.formData formData.value = res.data.formData
loading.value=false loading.value = false
} }
}) })
} }
const init = () => { const init = () => {
getProjectConclusionProcess().then(res => { getProjectConclusionProcess().then(res => {
ElNotification({ ElNotification({
title: '提示', title: '提示',
@@ -238,7 +235,7 @@ const init = () => {
processDiagramViewer.value = false processDiagramViewer.value = false
if (res.code === 1000) { if (res.code === 1000) {
let data = res.data let data = res.data
deploymentId.value=data.deploymentId deploymentId.value = data.deploymentId
processInstanceData.value = data processInstanceData.value = data
processStore.setDesign(data) processStore.setDesign(data)
processStore.runningList.value = data.runningList; processStore.runningList.value = data.runningList;
@@ -255,7 +252,7 @@ const init = () => {
onMounted(async () => { onMounted(async () => {
await init() await init()
if (name.value === 'Filing/edit') { if (name.value === 'Filing/edit') {
loading.value=true loading.value = true
await getDetailInfo() await getDetailInfo()
} }
}) })

View File

@@ -14,11 +14,11 @@ import {reactive, shallowRef} from "vue";
const router = useRouter() const router = useRouter()
const searchConfig = reactive([ const searchConfig = reactive([
{ {
label: '名称', label: '需求名称',
prop: 'requirementName', prop: 'requirementName',
component: 'el-input', component: 'el-input',
props: { props: {
placeholder: '请输入名称查询', placeholder: '请输入需求名称查询',
clearable: true, clearable: true,
filterable: true, filterable: true,
checkStrictly: true checkStrictly: true

View File

@@ -8,13 +8,16 @@
</template> </template>
<script setup lang="jsx"> <script setup lang="jsx">
const router = useRouter()
const route = useRoute()
const searchConfig = reactive([ const searchConfig = reactive([
{ {
label: '名称', label: '项目名称',
prop: 'projectName', prop: 'projectName',
component: 'el-input', component: 'el-input',
props: { props: {
placeholder: '请输入名称查询', placeholder: '请输入项目名称查询',
clearable: true, clearable: true,
filterable: true, filterable: true,
checkStrictly: true checkStrictly: true
@@ -82,13 +85,13 @@ const tableConfig = reactive({
} }
], ],
api: '/workflow/mosr/expense/ledger', api: '/workflow/mosr/expense/ledger',
params: {}, params: {
projectId:route.query.id
},
btns: [ btns: [
{name: '上传费用', key: 'add', color: '#DED0B2',auth: ''} {name: '上传费用', key: 'add', color: '#DED0B2',auth: ''}
] ]
}) })
const router = useRouter()
const route = useRoute()
const tableIns=ref() const tableIns=ref()
const headBtnClick = (key) => { const headBtnClick = (key) => {
switch (key) { switch (key) {

View File

@@ -1,20 +1,11 @@
<template> <template>
<el-form :model="attachment" inline class="query-form" ref="queryForm" rules="rules"> <el-form :model="attachment" inline class="query-form">
<el-form-item label="标签" prop="tag"> <el-form-item label="标签" prop="tag">
<el-select v-model="attachment.tag" placeholder="请选择标签" clearable filterable style="width: 200px"> <el-input v-model="attachment.tag" placeholder="请输入标签" clearable style="width: 200px"/>
<el-option
v-for="item in tagsOption"
:key="item.label"
:label="item.value"
:value="item.label"
/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="handleSearch(queryForm)" color="#DED0B2">搜索</el-button> <el-button @click="handleSearch" color="#DED0B2">搜索</el-button>
<el-button color="#DED0B2" :disabled="!attachment.tag" style="padding: 0" title="请先选择标签再上传附件!"> <el-button color="#DED0B2" @click="handleUpload">上传附件</el-button>
<file-upload @getFile="getFile" :disabled="!attachment.tag"/>
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-card style="width: 100%"> <el-card style="width: 100%">
@@ -29,7 +20,7 @@
<script setup lang="jsx"> <script setup lang="jsx">
import {downloadFile} from "@/api/project-demand"; import {downloadFile} from "@/api/project-demand";
import {getImplementationAttachment,searchFile} from "@/api/project-manage"; import {getImplementationAttachment} from "@/api/project-manage";
import {ElNotification} from "element-plus"; import {ElNotification} from "element-plus";
const route = useRoute() const route = useRoute()
@@ -37,11 +28,6 @@ const router = useRouter()
const attachment = reactive({ const attachment = reactive({
tag: '' tag: ''
}) })
const rules = reactive({
tag: [{required: true, message: '请选择标签', trigger: 'blur'}]
})
const queryForm = ref()
const tagsOption = ref([])
const tableConfig = reactive({ const tableConfig = reactive({
columns: [ columns: [
{ {
@@ -71,6 +57,7 @@ const tableConfig = reactive({
prop: 'oper', prop: 'oper',
label: '操作', label: '操作',
align: 'center', align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) => { currentRender: ({row, index}) => {
return ( return (
<div> <div>
@@ -84,58 +71,39 @@ const tableConfig = reactive({
const showTable = ref(true) const showTable = ref(true)
const otherFileList = ref([]) const otherFileList = ref([])
const compositeParam = (item) => { const handleSearch = () => {
return { let params
fileId: item.id, if (attachment.tag) {
size: item.size, params = {
originalFileName: item.originalFilename, projectId: route.query.id,
fileType: item.fileType, tag: attachment.tag
url: item.url, }
tag: attachment.tag, } else {
params = {
projectId: route.query.id
}
} }
} getImplementationAttachment(params).then(res => {
const getFile = (val) => {
console.log('上传文件', val)
showTable.value = false
let fileObj = compositeParam(val)
otherFileList.value.push(fileObj)
nextTick(() => {
showTable.value = true
})
}
const getTagsOption = (id = route.query.id) => {
if (!route.query.id) return
getImplementationAttachment(id).then(res => {
ElNotification({ ElNotification({
title: '提示', title: '提示',
message: res.msg, message: res.msg,
type: res.code === 1000 ? 'success' : 'error' type: res.code === 1000 ? 'success' : 'error'
}) })
showTable.value = false
if (res.code === 1000) { if (res.code === 1000) {
tagsOption.value = res.data otherFileList.value = res.data
nextTick(() => {
showTable.value = true
})
} }
}) })
} }
const handleUpload = () => {
const handleSearch = (instance) => { router.push({
if (!instance) return name: 'Implementation/upload',
instance.validate(async (valid) => { query: {
if (!valid) return id: route.query.id
let tagName = '' }
tagsOption.value.forEach(item => {
if (item.label === attachment.tag) {
tagName = item.value
}
})
searchFile(route.query.id, tagName).then(res => {
showTable.value = false
if (res.code === 1000) {
otherFileList.value = res.data
nextTick(() => {
showTable.value = true
})
}
})
}) })
} }
const handleDownload = (row) => { const handleDownload = (row) => {
@@ -147,7 +115,7 @@ const handleDownload = (row) => {
a.click() a.click()
}) })
} }
getTagsOption() handleSearch()
</script> </script>
<style scoped> <style scoped>

View File

@@ -14,11 +14,11 @@ import {reactive, shallowRef} from "vue";
const router = useRouter() const router = useRouter()
const searchConfig = reactive([ const searchConfig = reactive([
{ {
label: '名称', label: '项目名称',
prop: 'projectName', prop: 'projectName',
component: 'el-input', component: 'el-input',
props: { props: {
placeholder: '请输入名称查询', placeholder: '请输入项目名称查询',
clearable: true, clearable: true,
filterable: true, filterable: true,
checkStrictly: true checkStrictly: true

View File

@@ -12,11 +12,11 @@ import {reactive} from "vue";
const searchConfig = reactive([ const searchConfig = reactive([
{ {
label: '名称', label: '需求名称',
prop: 'requirementName', prop: 'requirementName',
component: 'el-input', component: 'el-input',
props: { props: {
placeholder: '请输入名称查询', placeholder: '请输入需求名称查询',
clearable: true, clearable: true,
filterable: true, filterable: true,
checkStrictly: true checkStrictly: true

View File

@@ -1,22 +1,46 @@
<template> <template>
<baseTitle title="标签名称"></baseTitle> <baseTitle title="标签名称"></baseTitle>
<el-input v-model="tagName" placeholder="请输入标签名称"/> <el-form :model="formData" ref="tagForm" label-width="auto" :rules="rules">
<el-form-item label="标签名称" prop="tagName">
<el-input v-model="formData.tagName" placeholder="请输入标签名称" style="width: 400px"/>
</el-form-item>
</el-form>
<baseTitle title="其他文件"></baseTitle>
<el-card style="width: 100%;margin: 15px 0"> <el-card style="width: 100%;margin: 15px 0">
<file-upload @getFile="getOtherFile"/> <file-upload @getFile="getFile"/>
<fvTable style="width: 100%;max-height: 250px;height: 250px" v-if="showTable" :tableConfig="tableConfig" <fvTable style="width: 100%;max-height: 250px;height: 250px" v-if="showTable" :tableConfig="tableConfig"
:data="otherFileList" :isSettingCol="false" :pagination="false"> :data="fileList" :isSettingCol="false" :pagination="false">
<template #empty> <template #empty>
<el-empty :image-size="90" description="暂无数据" style="padding: 0"/> <el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
</template> </template>
</fvTable> </fvTable>
</el-card> </el-card>
<div class="oper-page-btn">
<el-button color="#DED0B2" @click="handleSubmit(tagForm)">提交</el-button>
</div>
</template> </template>
<script setup lang="jsx"> <script setup lang="jsx">
const tagName = ref('') import {uploadAttachment} from "@/api/project-manage";
const otherFileList = ref([]) import {ElNotification} from "element-plus";
import {useTagsView} from '@/stores/tagsview.js'
const tagsViewStore = useTagsView()
const route = useRoute()
const router = useRouter()
const fileList = ref([])
const formData = ref({
tagName:''
})
const tableConfig = reactive({ const tableConfig = reactive({
columns: [ columns: [
{
prop: 'index',
type: 'index',
label: '序号',
align: 'center',
width: '80',
},
{ {
prop: 'originalFileName', prop: 'originalFileName',
label: '附件名称', label: '附件名称',
@@ -47,8 +71,70 @@ const tableConfig = reactive({
] ]
}) })
const showTable = ref(true) const showTable = ref(true)
const getOtherFile = () => { const tagForm = ref()
const name = ref(router.currentRoute.value.name)
const rules = reactive({
tagName: [{required: true, message: '请输入标签名称', trigger: 'blur'}],
})
const compositeParam = (item) => {
let tag = ''
if (name.value === 'Implementation/upload') {
tag = '项目实施'
}
return {
fileId: item.id,
size: item.size,
originalFileName: item.originalFilename,
fileType: item.fileType,
url: item.url,
tag: tag,
}
}
const getFile = (val) => {
console.log('上传文件', val)
showTable.value = false
let fileObj = compositeParam(val)
fileList.value.push(fileObj)
nextTick(() => {
showTable.value = true
})
}
const getFileParam = (item) => {
return {
fileId: item.fileId,
tag: item.tag
}
}
const handleSubmit = async (instance) => {
if (!instance) return
instance.validate(async (valid) => {
if (!valid) return
let files = []
fileList.value.forEach(item => {
files.push(getFileParam(item))
})
let params = {
fileList: files,
projectId: route.query.id,
tag: formData.value.tagName
}
console.log('params', params)
let res = await uploadAttachment(params)
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) {
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
await router.push({
name: 'Implementation/attachment',
query:{
id: route.query.id
}
})
}
})
} }
</script> </script>

View File

@@ -1,7 +1,7 @@
<template> <template>
<baseTitle title="上传费用"></baseTitle> <baseTitle title="上传费用"></baseTitle>
<el-form :model="tableForm" :rules="rules"> <el-form :model="tableData" ref="form" :rules="rules">
<el-table :data="tableForm.tableData" style="width: 100%"> <el-table :data="tableData" style="width: 100%">
<el-table-column prop="projectName" label="项目名称"> <el-table-column prop="projectName" label="项目名称">
<template #default="scope"> <template #default="scope">
<el-form-item prop="projectName"> <el-form-item prop="projectName">
@@ -12,38 +12,60 @@
</el-table-column> </el-table-column>
<el-table-column prop="time" label="时间"> <el-table-column prop="time" label="时间">
<template #default="scope"> <template #default="scope">
<el-date-picker <el-form-item prop="time">
v-model="scope.row.time" <el-date-picker
type="date" v-model="scope.row.time"
format="YYYY-MM-DD" type="date"
value-format="YYYY-MM-DD" format="YYYY-MM-DD"
placeholder="选择时间" value-format="YYYY-MM-DD"
> placeholder="选择时间"
</el-date-picker> >
</el-date-picker>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="projectCost" label="项目费用"> <el-table-column prop="projectCost" label="项目费用">
<template #default="scope"> <template #default="scope">
<el-input v-model="scope.row.projectCost" placeholder="请输入项目费用" clearable> <el-form-item prop="projectCost">
</el-input> <el-select v-model="scope.row.projectCost" placeholder="请选择费用性质" clearable filterable>
<el-option
v-for="item in cacheStore.getDict('project_cost')"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="researchStage" label="研发阶段"> <el-table-column prop="researchStage" label="研发阶段">
<template #default="scope"> <template #default="scope">
<el-input v-model="scope.row.researchStage" placeholder="请选择研发阶段" clearable> <el-form-item prop="researchStage">
</el-input> <el-select v-model="scope.row.researchStage" placeholder="请选择研发阶段" clearable filterable>
<el-option
v-for="item in cacheStore.getDict('research_stage')"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="digest" label="摘要"> <el-table-column prop="digest" label="摘要">
<template #default="scope"> <template #default="scope">
<el-input v-model="scope.row.digest" placeholder="请输入摘要" clearable> <el-form-item prop="digest">
</el-input> <el-input v-model="scope.row.digest" placeholder="请输入摘要" clearable>
</el-input>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="afterTax" label="税后余额(元)"> <el-table-column prop="afterTax" label="税后余额(元)">
<template #default="scope"> <template #default="scope">
<el-input v-model="scope.row.afterTax" placeholder="请输入税后余额" clearable> <el-form-item prop="afterTax">
</el-input> <el-input v-model="scope.row.afterTax" placeholder="请输入税后余额" clearable>
</el-input>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="oper" label="操作"> <el-table-column prop="oper" label="操作">
@@ -57,7 +79,7 @@
<el-button type="primary" @click="handleAdd" link style="font-size: 18px">添加一行</el-button> <el-button type="primary" @click="handleAdd" link style="font-size: 18px">添加一行</el-button>
</div> </div>
<div class="oper-page-btn"> <div class="oper-page-btn">
<el-button color="#DED0B2" @click="handleSubmit">提交</el-button> <el-button color="#DED0B2" @click="handleSubmit(form)">提交</el-button>
<el-button @click="handleBack">返回</el-button> <el-button @click="handleBack">返回</el-button>
</div> </div>
</template> </template>
@@ -67,26 +89,45 @@ import {ElNotification} from "element-plus";
import {addLedger} from "@/api/project-manage"; import {addLedger} from "@/api/project-manage";
import {useTagsView} from '@/stores/tagsview.js' import {useTagsView} from '@/stores/tagsview.js'
import {useRoute} from "vue-router"; import {useRoute} from "vue-router";
import {useCacheStore} from '@/stores/cache.js'
const cacheStore = useCacheStore()
const route = useRoute() const route = useRoute()
const tagsViewStore = useTagsView() const tagsViewStore = useTagsView()
const formData = ref({}) const formData = ref({})
const form = ref()
const rules = reactive({ const rules = reactive({
auditOpinion: [{required: true, message: '请输入审核意见', trigger: 'blur'}], projectName: [{required: true, message: '请输入项目名称', trigger:["blur", 'change']}],
}) time: [{required: true, message: '请选择时间', trigger: 'blur'}],
const tableForm = reactive({ projectCost: [{required: true, message: '请输入项目费用', trigger: 'blur'}],
tableData: [ researchStage: [{required: true, message: '请输入研发阶段', trigger: 'blur'}],
{ digest: [{required: true, message: '请输入摘要', trigger: 'blur'}],
projectId: route.query.id, afterTax: [{required: true, message: '请输入税后余额', trigger: 'blur'}]
projectName: '',
time: '',
projectCost: '',
researchStage: '',
digest: '',
afterTax: ''
}
]
}) })
const tableData=ref([
{
projectId: route.query.id,
projectName: '',
time: '',
projectCost: '',
researchStage: '',
digest: '',
afterTax: ''
}
])
// const tableForm = reactive({
// tableData: [
// {
// projectId: route.query.id,
// projectName: '',
// time: '',
// projectCost: '',
// researchStage: '',
// digest: '',
// afterTax: ''
// }
// ]
// })
const handleAdd = () => { const handleAdd = () => {
let row = { let row = {
projectId: route.query.id, projectId: route.query.id,
@@ -97,30 +138,29 @@ const handleAdd = () => {
digest: '', digest: '',
afterTax: '' afterTax: ''
} }
tableForm.tableData.push(row) tableData.value.push(row)
} }
const handleDelete = (index) => { const handleDelete = (index) => {
tableForm.tableData.splice(index, 1) tableData.value.splice(index, 1)
} }
const handleSubmit = (instance) => { const handleSubmit = (instance) => {
// if (!instance) return if (!instance) return
// instance.validate(async (valid) => { instance.validate(async (valid) => {
// if (!valid) return if (!valid) return
let params = {} console.log('params', tableData.value)
console.log('params', tableForm.tableData) // const res = addLedger(tableData.value)
const res = addLedger(tableForm.tableData) // ElNotification({
ElNotification({ // title: '提示',
title: '提示', // message: res.msg,
message: res.msg, // type: res.code === 1000 ? 'success' : 'error'
type: res.code === 1000 ? 'success' : 'error' // })
// if (res.code === 1000) {
// tagsViewStore.delVisitedViews(router.currentRoute.value.path)
// router.push({
// name: 'Implementation'
// })
// }
}) })
if (res.code === 1000) {
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
router.push({
name: 'Implementation'
})
}
// })
} }
const handleBack = () => { const handleBack = () => {
history.back() history.back()

View File

@@ -14,13 +14,12 @@ import {reactive, shallowRef} from "vue";
const router = useRouter() const router = useRouter()
const searchConfig = reactive([ const searchConfig = reactive([
{ {
label: '名称', label: '需求名称',
prop: 'requirementName', prop: 'requirementName',
component: 'el-input', component: 'el-input',
props: { props: {
placeholder: '请输入名称查询', placeholder: '请输入需求名称查询',
clearable: true, clearable: true,
filterable: true,
checkStrictly: true checkStrictly: true
} }
}, },
@@ -30,6 +29,7 @@ const searchConfig = reactive([
component: shallowRef(fvSelect), component: shallowRef(fvSelect),
props: { props: {
placeholder: '请选择项目类型', placeholder: '请选择项目类型',
cacheKey: 'project_type',
clearable: true, clearable: true,
filterable: true, filterable: true,
} }
@@ -39,6 +39,7 @@ const searchConfig = reactive([
prop: 'projectEffect', prop: 'projectEffect',
component: shallowRef(fvSelect), component: shallowRef(fvSelect),
props: { props: {
cacheKey: 'project_impact',
placeholder: '请选择项目影响', placeholder: '请选择项目影响',
clearable: true, clearable: true,
filterable: true, filterable: true,
@@ -51,6 +52,7 @@ const searchConfig = reactive([
component: shallowRef(fvSelect), component: shallowRef(fvSelect),
props: { props: {
placeholder: '请选择研发主体', placeholder: '请选择研发主体',
cacheKey: 'rd_subject',
clearable: true, clearable: true,
filterable: true, filterable: true,
} }
@@ -130,7 +132,10 @@ const tableConfig = reactive({
{ {
prop: 'startTime', prop: 'startTime',
label: '起止时间', label: '起止时间',
align: 'center' align: 'center',
currentRender: ({row}) => {
return row.startTime + ' 至 ' + row.endTime
}
}, },
{ {
prop: 'taskNode', prop: 'taskNode',

View File

@@ -2,8 +2,8 @@
<div v-loading="loading" class="add-block"> <div v-loading="loading" class="add-block">
<baseTitle title="专项资金信息录入"></baseTitle> <baseTitle title="专项资金信息录入"></baseTitle>
<el-form :model="formData" inline class="query-form" ref="fundForm" :rules="rules"> <el-form :model="formData" inline class="query-form" ref="fundForm" :rules="rules">
<el-form-item label="名称" prop="name"> <el-form-item label="专项资金名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入名称" clearable></el-input> <el-input v-model="formData.name" placeholder="请输入专项资金名称" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="金额" prop="fundAmount"> <el-form-item label="金额" prop="fundAmount">
<el-input v-model="formData.fundAmount" placeholder="请输入金额" clearable></el-input> <el-input v-model="formData.fundAmount" placeholder="请输入金额" clearable></el-input>
@@ -98,7 +98,7 @@ const tableConfig = reactive({
}) })
const rules = reactive({ const rules = reactive({
name: [{required: true, message: '请输入名称', trigger: 'blur'}], name: [{required: true, message: '请输入专项资金名称', trigger: 'blur'}],
fundAmount: [{required: true, message: '请输入金额', trigger: 'blur'}], fundAmount: [{required: true, message: '请输入金额', trigger: 'blur'}],
introduce: [{required: true, message: '请输入介绍', trigger: 'blur'}], introduce: [{required: true, message: '请输入介绍', trigger: 'blur'}],
}) })

View File

@@ -18,7 +18,7 @@ const searchConfig = reactive([
prop: 'name', prop: 'name',
component: 'el-input', component: 'el-input',
props: { props: {
placeholder: '请输入名称查询' placeholder: '请输入专项资金名称查询'
} }
}, },
{ {