fix : 修复页面细节

This commit is contained in:
2024-05-31 20:56:58 +08:00
parent 5a1e1848cb
commit 5ae8e4be78
32 changed files with 550 additions and 167 deletions

View File

@@ -29,13 +29,35 @@
/>
</el-config-provider>
</el-form-item>
<el-row>
<el-col :span="5">
<el-form-item label="是否专项资金" prop="isSpecialFund">
<el-radio-group v-model="formData.isSpecialFund" size="mini">
<el-radio :label="true"></el-radio>
<el-radio :label="false"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="6" v-if="formData.isSpecialFund">
<el-form-item label="专项资金" prop="specialFund">
<el-select v-model="formData.specialFund" placeholder="请选择专项资金" clearable filterable>
<el-option
v-for="item in specialFundOption"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<baseTitle title="征集说明"></baseTitle>
<Tinymce v-if="showTinymce" image-url="/notice/file" file-url="/notice/file"
v-model:value="formData.collectExplain" height="300" />
v-model:value="formData.collectExplain" />
<baseTitle title="申请文件"></baseTitle>
<file-upload v-if="checkFormPrem('fileList')" @getFile="getFile"/>
<fvTable style="width: 100%;max-height: 200px" v-if="showTable"
<fvTable style="width: 100%;max-height: 650px;" v-if="showTable"
:tableConfig="tableConfig" :data="formData.fileList"
:isSettingCol="false" :pagination="false">
<template #empty>
@@ -74,6 +96,7 @@ import {ElMessage, ElMessageBox, ElNotification} from "element-plus";
import {useRoute, useRouter} from 'vue-router'
import {getSubCompOpt} from '@/api/user/user.js'
import {useTagsView} from '@/stores/tagsview.js'
import {getFundOption} from "@/api/special-fund";
const tagsViewStore = useTagsView()
const authStore = useAuthStore()
@@ -87,7 +110,8 @@ const formData = ref({
collectType: '',
deadline: '',
collectExplain: '',
fileList: []
fileList: [],
isSpecialFund:false
})
const showTinymce = ref(true)
const routerName = ref(router.currentRoute.value.name)
@@ -99,6 +123,7 @@ const typeOption = ref([
}
])
const companyOption = ref([])
const specialFundOption = ref([])
const form = ref(null)
const fileList = ref([])
const loading = ref(false)
@@ -111,6 +136,7 @@ const rules = reactive({
companyIds: [{required: true, message: '请选择所属公司', trigger: 'blur'}],
collectType: [{required: true, message: '请选择征集类型', trigger: 'blur'}],
deadline: [{required: true, message: '请选择截止时间', trigger: 'blur'}],
specialFund: [{required: true, message: '请选择专项资金', trigger: 'blur'}],
})
const tableConfig = reactive({
@@ -178,8 +204,10 @@ const compositeParam = (item) => {
let tag = ''
if (!formData.value.collectType && routerName.value === 'Requirement/add') {
tag = '需求征集'
}else if(routerName.value === 'Requirement/edit'){
}else if(!formData.value.collectType &&routerName.value === 'Requirement/edit'){
tag = '需求征集'
}if (formData.value.collectType) {
tag = formData.value.collectType
}
return {
fileId: item.id,
@@ -205,6 +233,8 @@ const getFile = (val) => {
const init = async () => {
const res = await getSubCompOpt()
companyOption.value = res.data
const resFund = await getFundOption()
specialFundOption.value = resFund.data
getWorkflowInfo().then(res => {
ElNotification({
title: '提示',
@@ -247,7 +277,9 @@ const submitParam = (item) => {
requirementId: item.requirementId ? item.requirementId : 0,
requirementName: item.requirementName,
fileList: files,
deploymentId: processInstanceData.value.deploymentId
deploymentId: processInstanceData.value.deploymentId,
isSpecialFund:item.isSpecialFund,
specialFund:item.specialFund
}
}
const handleSubmit = async (instance) => {
@@ -334,7 +366,9 @@ onMounted(async () => {
:deep(.el-empty__description) {
margin-top: 0;
}
:deep(.el-table--fit ){
height: 400px;
}
.add-block {
//display: flex;
//justify-content: space-between;

View File

@@ -23,6 +23,11 @@
<span>{{ formData.deadline }}</span>
</el-form-item>
</el-col>
<el-col :span="24" v-if="formData.isSpecialFund">
<el-form-item label="专项资金">
<span>{{ formData.specialFund }}</span>
</el-form-item>
</el-col>
<baseTitle title="征集说明"></baseTitle>
<el-col :span="24" v-if="checkFormPrem('collectExplain')">
<el-form-item>
@@ -43,6 +48,16 @@
</fvTable>
</el-form-item>
</el-col>
<el-col :span="24">
<div class="approval-record">
<baseTitle title="审批记录"></baseTitle>
<div class="process">
<operation-render v-if="processDiagramViewer" :operation-list="processInstanceData.operationList"
:state="processInstanceData.state"/>
<process-diagram-viewer v-if="processDiagramViewer"/>
</div>
</div>
</el-col>
<el-col :span="24">
<div v-if="processInstanceData.taskId">
<baseTitle title="审核意见"></baseTitle>
@@ -57,14 +72,6 @@
</div>
</el-col>
</el-row>
<div class="approval-record">
<baseTitle title="审批记录"></baseTitle>
<div class="process">
<operation-render v-if="processDiagramViewer" :operation-list="processInstanceData.operationList"
:state="processInstanceData.state"/>
<process-diagram-viewer v-if="processDiagramViewer"/>
</div>
</div>
</el-form>
<div class="oper-page-btn" v-if="processInstanceData.state === '1' && processInstanceData.taskId">
<el-button @click="handleReject(demandForm)">驳回</el-button>
@@ -82,6 +89,7 @@ import {getSubCompOpt} from '@/api/user/user.js'
import {ElMessage} from "element-plus";
import {useTagsView} from '@/stores/tagsview.js'
import {matterTree} from '@/utils/matterTree.js';
import {getFundOption} from "@/api/special-fund";
const tagsViewStore = useTagsView()
const router = useRouter()
@@ -91,6 +99,7 @@ const loading = ref(false)
const demandForm = ref()
const processStore = useProcessStore()
const companyOption = ref([])
const specialFundOption = ref([])
const formPermMap = ref(new Map());
const processInstanceData = ref({})
const showTable = ref(false)
@@ -197,6 +206,10 @@ const getCompanyOption = async () => {
const res = await getSubCompOpt()
companyOption.value = res.data
}
const getFundOptions = async () => {
const res = await getFundOption()
specialFundOption.value = res.data
}
const getDataSourceOptionItem = (val) => {
if (val !== undefined) {
@@ -219,11 +232,19 @@ const handleDownload = (row) => {
const init = async () => {
if (!route.query.id) return;
await getCompanyOption()
await getFundOptions()
getInfo(route.query.id).then(res => {
loading.value = false
let data = res.data
formData.value = data.formData;
data.formData.companyIds = getDataSourceOptionItem(data.formData.companyIds)
if(data.formData.specialFund){
specialFundOption.value.forEach(item => {
if(data.formData.specialFund==item.value){
data.formData.specialFund = item.label
}
})
}
processInstanceData.value = data
processStore.setDesign(data)
processStore.runningList.value = data.runningList;

View File

@@ -115,9 +115,9 @@ const tableConfig = reactive({
// if (buttons.has("delete")) {
// btn.push({label: '删除',prem: ['mosr:requirement:del'], func: () => handleDelete(row), type: 'primary'})
// }
if (buttons.has("report")) {
btn.push({label: '需求上报',prem: ['mosr:requirement:info'], func: () => handleReport(row), type: 'primary'})
}
// if (buttons.has("report")) {
btn.push({label: '需求上报', prem: ['mosr:requirement:info'], func: () => handleReport(row), type: 'primary'})
// }
return (
<div style={{width: '100%'}}>
{
@@ -134,7 +134,8 @@ const tableConfig = reactive({
}
{
buttons.has("delete") ?
<popover-delete name={row.requirementName} type={'需求征集'} btnType={'danger'} perm={['mosr:requirement:del']}
<popover-delete name={row.requirementName} type={'需求征集'} btnType={'danger'}
perm={['mosr:requirement:del']}
onDelete={() => handleDelete(row)}/> : ''
}
</div>
@@ -154,23 +155,17 @@ const search = (val) => {
tableConfig.params = {...val}
tableIns.value.refresh()
}
const handleAdd = () => {
try{
router.push({
name:'Requirement/add',
query:{}
})
}catch (err){
// ElNotification({
// title: '提示',
// message: '该用户无新增权限',
// type: 'warning'
// })
}
const handleAdd = (row) => {
router.push({
name: 'Requirement/add',
query: {
id: row.requirementId
}
})
}
const handleEdit = (row) => {
router.push({
name:'Requirement/edit',
name: 'Requirement/edit',
query: {
id: row.requirementId
}
@@ -188,7 +183,7 @@ const handleDelete = (row) => {
}
const handleDetail = (row) => {
router.push({
name:'Requirement/detail',
name: 'Requirement/detail',
query: {
id: row.requirementId
}
@@ -196,9 +191,9 @@ const handleDetail = (row) => {
}
const handleReport = (row) => {
router.push({
name:'Summary/add',
name: 'Summary/add',
query: {
id:row.requirementId
id: row.requirementId
}
})
}

View File

@@ -8,11 +8,19 @@
<el-input v-model="formData.projectName" placeholder="请输入项目名称" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="专项资金" prop="specialFund">
<el-col :span="5">
<el-form-item label="是否专项资金" prop="isSpecialFund">
<el-radio-group v-model="formData.isSpecialFund" >
<el-radio :label="true"></el-radio>
<el-radio :label="false"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="专项资金" prop="specialFund" v-if="formData.isSpecialFund">
<el-select v-model="formData.specialFund" placeholder="请选择专项资金" clearable filterable>
<el-option
v-for="item in cacheStore.getDict('todo_type')"
v-for="item in specialFundOption"
:key="item.value"
:label="item.label"
:value="item.value"
@@ -46,11 +54,11 @@
</el-config-provider>
</el-form-item>
</el-col>
<!-- <el-form-item label="所属公司" prop="affiliatedCompanyId">-->
<!-- <el-tree-select v-model="formData.affiliatedCompanyId" :data="companyOption" style="width: 100%;"-->
<!-- filterable clearable :check-strictly="true"/>-->
<!-- </el-form-item>-->
<!-- </el-col> <el-col :span="12">-->
<!-- <el-form-item label="所属公司" prop="affiliatedCompanyId">-->
<!-- <el-tree-select v-model="formData.affiliatedCompanyId" :data="companyOption" style="width: 100%;"-->
<!-- filterable clearable :check-strictly="true"/>-->
<!-- </el-form-item>-->
<!-- </el-col> <el-col :span="12">-->
<el-col :span="12">
<el-form-item label="项目类型" prop="projectType">
@@ -139,18 +147,20 @@
<el-col :span="12">
<el-form-item label="产学研联合" prop="industryUniversityResearch">
<el-radio-group v-model="formData.industryUniversityResearch">
<el-radio v-for="item in cacheStore.getDict('industry_university')"
:key="item.value"
:label="item.value">{{item.label}}</el-radio>
<el-radio v-for="item in cacheStore.getDict('industry_university')"
:key="item.value"
:label="item.value">{{ item.label }}
</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="开展政府申报" prop="governmentDeclaration">
<el-radio-group v-model="formData.governmentDeclaration">
<el-radio v-for="item in cacheStore.getDict('government_declaration')"
:key="item.value"
:label="item.value">{{item.label}}</el-radio>
<el-radio v-for="item in cacheStore.getDict('government_declaration')"
:key="item.value"
:label="item.value">{{ item.label }}
</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
@@ -230,13 +240,14 @@
</div>
<div class="oper-page-btn">
<el-button type="info" @click="staging">存为草稿</el-button>
<el-button color="#DED0B2" v-if="name==='Summary/add'" @click="handleSubmit(summaryForm)">发布</el-button>
<el-button color="#DED0B2" v-else @click="handleResubmit">重新发布</el-button>
<el-button color="#DED0B2" v-if="name==='Summary/add'" @click="handleSubmit(summaryForm)">发布</el-button>
<el-button color="#DED0B2" v-else @click="handleResubmit">重新发布</el-button>
</div>
</div>
</template>
<script setup lang="jsx">
import {debounce} from 'lodash'
import {getDetail, getProcessInfo, requirementReported, resubmitReported} from "./api";
import {ElMessage, ElNotification} from "element-plus";
import {useTagsView} from '@/stores/tagsview.js'
@@ -244,6 +255,8 @@ import {useCacheStore} from '@/stores/cache.js'
import {useProcessStore} from '@/stores/processStore.js';
import {getSubCompOpt} from "@/api/user/user";
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
import {getFormInfo} from "@/api/project-demand";
import {getFundOption} from "@/api/special-fund";
const cacheStore = useCacheStore()
const processStore = useProcessStore()
@@ -257,12 +270,14 @@ const tagsViewStore = useTagsView()
const companyOption = ref([])
const summaryForm = ref()
const deploymentId = ref()
const specialFundOption = ref([])
const isSpecialFund = ref()
const showTable = ref(true)
const otherFileList = ref([])
const file = ref({})
const formData = ref({
industryUniversityResearch:'0',
governmentDeclaration:'0',
industryUniversityResearch: '0',
governmentDeclaration: '0',
})
const rules = reactive({
projectName: [{required: true, message: '请输入项目名称', trigger: 'blur'}],
@@ -290,6 +305,16 @@ const rules = reactive({
serviceDescription: [{required: true, message: '请输入现有业务描述', trigger: 'blur'}],
contentDescription: [{required: true, message: '请输入研发项目关键内容描述', trigger: 'blur'}]
})
const getIsFund = async () => {
getFormInfo(route.query.id).then(res => {
if (res.code === 1000) {
formData.value.isSpecialFund = res.data.isSpecialFund
if(res.data.isSpecialFund){
formData.value.specialFund = Number(res.data.specialFund)
}
}
})
}
const compositeParam = (item, type) => {
let tag = ''
if (name.value === 'Summary/add' || name.value === 'Summary/edit') {
@@ -304,12 +329,11 @@ const compositeParam = (item, type) => {
tag: tag
}
}
const getEditOtherFile = (val) => {
console.log('getEditOtherFile', val)
}
const getAttachment = (val) => {
console.log('上传文件getAttachment', val)
file.value = compositeParam(val)
formData.value.singleFile = compositeParam(val)
}
const getOtherFile = (val) => {
console.log('上传文件getOtherFile', val)
@@ -326,15 +350,16 @@ const getFileParam = (item) => {
tag: item.tag
}
}
const handleSubmit = async (instance) => {
// if (!instance) return
// instance.validate(async (valid, fields) => {
// if(JSON.stringify(file.value) == "{}"){
// attachment.value.validate()
// } else {
// attachment.value.clearValidate()
// }
// if (!valid) return
const handleSubmit = debounce(async (instance) => {
console.log('formData.value',formData.value)
if (!instance) return
instance.validate(async (valid, fields) => {
if (JSON.stringify(file.value) === "{}") {
attachment.value.validate()
} else {
attachment.value.clearValidate()
}
if (!valid) return
let singleFile = {}
if (file.value.fileId !== undefined) {
singleFile = {
@@ -394,15 +419,21 @@ const handleSubmit = async (instance) => {
name: 'Summary'
})
}
// })
}
const handleResubmit = () => {
})
})
const handleResubmit = debounce(() => {
let singleFile = {}
let otherFiles = []
let fileArray
if (name.value === 'Summary/edit') {
console.log('attachment.value', attachment.value.singleFile)
if (attachment.value.singleFile === null) {
attachment.value.validate()
} else {
attachment.value.clearValidate()
}
singleFile = {
fileId: attachment.value.singleFile.fileId
fileId: attachment.value.singleFile?.fileId
}
fileArray = attachment.value.allFileList
} else {
@@ -438,7 +469,7 @@ const handleResubmit = () => {
})
}
})
}
})
const getDetailInfo = async () => {
getDetail(route.query.projectId).then(res => {
ElNotification({
@@ -453,6 +484,9 @@ const getDetailInfo = async () => {
})
}
const init = async () => {
const resFund = await getFundOption()
specialFundOption.value = resFund.data
await getIsFund()
const res = await getSubCompOpt()
companyOption.value = res.data
getProcessInfo().then(res => {

View File

@@ -143,9 +143,6 @@ const tableConfig = reactive({
if (buttons.has("edit")) {
btn.push({label: '编辑', prem: ['mosr:collect:resubmit'], func: () => handleEdit(row), type: 'primary'})
}
// if (buttons.has("delete")) {
// btn.push({label: '删除',prem: ['mosr:requirement:del'], func: () => handleEdit(row), type: 'primary'})
// }
if (buttons.has("report")) {
btn.push({label: '上报', prem: ['mosr:collect:reported'], func: () => handleAdd(row), type: 'primary'})
}
@@ -163,6 +160,12 @@ const tableConfig = reactive({
</el-button>
))
}
{
buttons.has("delete") ?
<popover-delete name={row.requirementName} type={'需求'} btnType={'danger'}
perm={['mosr:collect:del']} onDelete={() => handleDelete(row)}/>
: ''
}
</div>
)
}