fix : 修复提交/重新提交按钮显示

This commit is contained in:
2024-05-29 21:34:37 +08:00
parent dd3f793ac2
commit 04c1175cf8
6 changed files with 116 additions and 106 deletions

View File

@@ -50,8 +50,8 @@
<!-- </div>--> <!-- </div>-->
</div> </div>
<div class="oper-page-btn"> <div class="oper-page-btn">
<el-button color="#DED0B2" @click="handleSubmit(demandForm)">提交</el-button> <el-button color="#DED0B2" v-if="routerName==='Requirement/add'" @click="handleSubmit(demandForm)">提交</el-button>
<el-button color="#DED0B2" @click="handleResubmit">重新提交</el-button> <el-button color="#DED0B2" v-else @click="handleResubmit">重新提交</el-button>
<el-button @click="handleBack">返回</el-button> <el-button @click="handleBack">返回</el-button>
</div> </div>
</div> </div>
@@ -90,6 +90,7 @@ const formData = ref({
fileList: [] fileList: []
}) })
const showTinymce = ref(true) const showTinymce = ref(true)
const routerName = ref(router.currentRoute.value.name)
const processDiagramViewer = ref(false) const processDiagramViewer = ref(false)
const typeOption = ref([ const typeOption = ref([
{ {
@@ -174,11 +175,10 @@ const handleDownload = (row) => {
}) })
} }
const compositeParam = (item) => { const compositeParam = (item) => {
let name=router.currentRoute.value.name
let tag = '' let tag = ''
if (!formData.value.collectType && name === 'Requirement/add') { if (!formData.value.collectType && routerName.value === 'Requirement/add') {
tag = '需求征集' tag = '需求征集'
}else if(name === 'Requirement/edit'){ }else if(routerName.value === 'Requirement/edit'){
tag = '需求征集' tag = '需求征集'
} }
return { return {

View File

@@ -4,8 +4,8 @@
<el-form :model="formData" ref="summaryForm" :rules="rules"> <el-form :model="formData" ref="summaryForm" :rules="rules">
<el-row gutter="50"> <el-row gutter="50">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="名称" prop="projectName"> <el-form-item label="项目名称" prop="projectName">
<el-input v-model="formData.projectName" placeholder="请输入名称" clearable></el-input> <el-input v-model="formData.projectName" placeholder="请输入项目名称" clearable></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@@ -227,9 +227,9 @@
<!-- </div>--> <!-- </div>-->
</div> </div>
<div class="oper-page-btn"> <div class="oper-page-btn">
<el-button type="primary" @click="staging">存为草稿</el-button> <el-button type="info" @click="staging">存为草稿</el-button>
<el-button type="primary" @click="handleSubmit(summaryForm)">发布</el-button> <el-button color="#DED0B2" v-if="name==='Summary/add'" @click="handleSubmit(summaryForm)">发布</el-button>
<el-button color="#DED0B2" @click="handleResubmit">重新发布</el-button> <el-button color="#DED0B2" v-else @click="handleResubmit">重新发布</el-button>
</div> </div>
</div> </div>
</template> </template>

View File

@@ -11,8 +11,8 @@
</div> </div>
</el-form> </el-form>
<div class="oper-page-btn"> <div class="oper-page-btn">
<el-button color="#DED0B2" @click="handleSubmit(applyForm)">提交</el-button> <el-button color="#DED0B2" v-if="name==='Filing/conclusion'" @click="handleSubmit(applyForm)">提交</el-button>
<el-button color="#DED0B2" @click="handleResubmit">重新提交</el-button> <el-button color="#DED0B2" v-else @click="handleResubmit">重新提交</el-button>
</div> </div>
</div> </div>
</template> </template>

View File

@@ -18,8 +18,8 @@
<process-diagram-viewer mode="view" v-if="processDiagramViewer"/> <process-diagram-viewer mode="view" v-if="processDiagramViewer"/>
</div> </div>
<div class="oper-page-btn"> <div class="oper-page-btn">
<el-button color="#DED0B2" @click="handleSubmit(applyForm)">提交</el-button> <el-button color="#DED0B2" v-if="name==='Implementation/check'" @click="handleSubmit(applyForm)">提交</el-button>
<el-button color="#DED0B2" @click="handleResubmit(applyForm)">重新提交</el-button> <el-button color="#DED0B2" v-else @click="handleResubmit(applyForm)">重新提交</el-button>
</div> </div>
</div> </div>
</template> </template>

View File

@@ -1,54 +1,58 @@
<template> <template>
<baseTitle title="上传费用"></baseTitle> <baseTitle title="上传费用"></baseTitle>
<el-table :data="tableData" style="width: 100%"> <el-form :model="tableForm" :rules="rules">
<el-table-column prop="projectName" label="项目名称"> <el-table :data="tableForm.tableData" style="width: 100%">
<template #default="scope"> <el-table-column prop="projectName" label="项目名称">
<el-input v-model="scope.row.projectName" placeholder="请输入项目名称" clearable> <template #default="scope">
</el-input> <el-form-item prop="projectName">
</template> <el-input v-model="scope.row.projectName" placeholder="请输入项目名称" clearable>
</el-table-column> </el-input>
<el-table-column prop="time" label="时间" width="250"> </el-form-item>
<template #default="scope"> </template>
<el-date-picker </el-table-column>
v-model="scope.row.time" <el-table-column prop="time" label="时间">
type="date" <template #default="scope">
format="YYYY-MM-DD" <el-date-picker
value-format="YYYY-MM-DD" v-model="scope.row.time"
placeholder="选择时间" type="date"
> format="YYYY-MM-DD"
</el-date-picker> value-format="YYYY-MM-DD"
</template> placeholder="选择时间"
</el-table-column> >
<el-table-column prop="projectCost" label="项目费用"> </el-date-picker>
<template #default="scope"> </template>
<el-input v-model="scope.row.projectCost" placeholder="请输入项目费用" clearable> </el-table-column>
</el-input> <el-table-column prop="projectCost" label="项目费用">
</template> <template #default="scope">
</el-table-column> <el-input v-model="scope.row.projectCost" placeholder="请输入项目费用" clearable>
<el-table-column prop="researchStage" label="研发阶段"> </el-input>
<template #default="scope"> </template>
<el-input v-model="scope.row.researchStage" placeholder="请选择研发阶段" clearable> </el-table-column>
</el-input> <el-table-column prop="researchStage" label="研发阶段">
</template> <template #default="scope">
</el-table-column> <el-input v-model="scope.row.researchStage" placeholder="请选择研发阶段" clearable>
<el-table-column prop="digest" label="摘要"> </el-input>
<template #default="scope"> </template>
<el-input v-model="scope.row.digest" placeholder="请输入摘要" clearable> </el-table-column>
</el-input> <el-table-column prop="digest" label="摘要">
</template> <template #default="scope">
</el-table-column> <el-input v-model="scope.row.digest" placeholder="请输入摘要" clearable>
<el-table-column prop="afterTax" label="税后余额(元)"> </el-input>
<template #default="scope"> </template>
<el-input v-model="scope.row.afterTax" placeholder="请输入税后余额" clearable> </el-table-column>
</el-input> <el-table-column prop="afterTax" label="税后余额(元)">
</template> <template #default="scope">
</el-table-column> <el-input v-model="scope.row.afterTax" placeholder="请输入税后余额" clearable>
<el-table-column prop="oper" label="操作"> </el-input>
<template #default="scope"> </template>
<el-button type="primary" @click="handleDelete(scope.$index)" link style="font-size: 18px">删除</el-button> </el-table-column>
</template> <el-table-column prop="oper" label="操作">
</el-table-column> <template #default="scope">
</el-table> <el-button type="primary" @click="handleDelete(scope.$index)" link style="font-size: 18px">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-form>
<div style="width:100%;text-align: center;padding: 10px"> <div style="width:100%;text-align: center;padding: 10px">
<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>
@@ -67,17 +71,22 @@ import {useRoute} from "vue-router";
const route = useRoute() const route = useRoute()
const tagsViewStore = useTagsView() const tagsViewStore = useTagsView()
const formData = ref({}) const formData = ref({})
const tableData = ref([ const rules = reactive({
{ auditOpinion: [{required: true, message: '请输入审核意见', trigger: 'blur'}],
projectId: route.query.id, })
projectName: '', const tableForm = reactive({
time: '', tableData: [
projectCost: '', {
researchStage: '', projectId: route.query.id,
digest: '', projectName: '',
afterTax: '' time: '',
} projectCost: '',
]) researchStage: '',
digest: '',
afterTax: ''
}
]
})
const handleAdd = () => { const handleAdd = () => {
let row = { let row = {
projectId: route.query.id, projectId: route.query.id,
@@ -88,18 +97,18 @@ const handleAdd = () => {
digest: '', digest: '',
afterTax: '' afterTax: ''
} }
tableData.value.push(row) tableForm.tableData.push(row)
} }
const handleDelete = (index) => { const handleDelete = (index) => {
tableData.value.splice(index, 1) tableForm.tableData.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 = {} 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,
@@ -107,7 +116,7 @@ const handleSubmit = (instance) => {
}) })
if (res.code === 1000) { if (res.code === 1000) {
tagsViewStore.delVisitedViews(router.currentRoute.value.path) tagsViewStore.delVisitedViews(router.currentRoute.value.path)
router.push({ router.push({
name: 'Implementation' name: 'Implementation'
}) })
} }

View File

@@ -12,14 +12,15 @@
</el-form> </el-form>
<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" :preview="name === 'Initiation/edit'"/> @getOtherFile="getOtherFile" :showFileList="true" :formData="formData"
:preview="name === 'Initiation/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>
<div class="oper-page-btn"> <div class="oper-page-btn">
<el-button color="#DED0B2" @click="handleSubmit(applyForm)">提交</el-button> <el-button color="#DED0B2" v-if="name==='Initiation/apply'" @click="handleSubmit(applyForm)">提交</el-button>
<el-button color="#DED0B2" @click="handleResubmit">重新提交</el-button> <el-button color="#DED0B2" v-else @click="handleResubmit">重新提交</el-button>
</div> </div>
</div> </div>
</template> </template>
@@ -28,7 +29,7 @@
import {useTagsView} from '@/stores/tagsview.js' import {useTagsView} from '@/stores/tagsview.js'
import {ElMessage, ElNotification} from "element-plus"; import {ElMessage, ElNotification} from "element-plus";
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue'; import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
import {getApplyProcess, projectApply,resubmitApply,getApplyDetail} from "@/api/project-manage"; import {getApplyProcess, projectApply, resubmitApply, getApplyDetail} from "@/api/project-manage";
import {useProcessStore} from '@/stores/processStore.js'; import {useProcessStore} from '@/stores/processStore.js';
const tagsViewStore = useTagsView() const tagsViewStore = useTagsView()
@@ -88,10 +89,10 @@ const tableConfig = reactive({
const loading = ref(false) const loading = ref(false)
const processInstanceData = ref() const processInstanceData = ref()
const processDiagramViewer = ref(true) const processDiagramViewer = ref(true)
const name=ref(router.currentRoute.value.name) const name = ref(router.currentRoute.value.name)
const compositeParam = (item) => { const compositeParam = (item) => {
let tag = '' let tag = ''
if (name.value === 'Initiation/apply'||name.value === 'Initiation/edit') { if (name.value === 'Initiation/apply' || name.value === 'Initiation/edit') {
tag = '项目立项申请' tag = '项目立项申请'
} }
return { return {
@@ -100,12 +101,12 @@ const compositeParam = (item) => {
originalFileName: item.originalFilename, originalFileName: item.originalFilename,
fileType: item.fileType, fileType: item.fileType,
url: item.url, url: item.url,
tag:tag tag: tag
} }
} }
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,15 +126,15 @@ const getFileParam = (item) => {
const handleSubmit = (instance) => { const handleSubmit = (instance) => {
if (!instance) return if (!instance) return
instance.validate(async (valid) => { instance.validate(async (valid) => {
if(JSON.stringify(file.value) === "{}"){ if (JSON.stringify(file.value) === "{}") {
attachment.value.validate() attachment.value.validate()
}else { } else {
attachment.value.clearValidate() attachment.value.clearValidate()
} }
if (!valid) return if (!valid) return
let files = [] let files = []
let singleFile={} let singleFile = {}
if(file.value.fileId!==undefined){ if (file.value.fileId !== undefined) {
singleFile = { singleFile = {
fileId: file.value.fileId fileId: file.value.fileId
} }
@@ -146,9 +147,9 @@ const handleSubmit = (instance) => {
requirementId: route.query.id, requirementId: route.query.id,
fileList: files, fileList: files,
singleFile: singleFile, singleFile: singleFile,
projectId:route.query.projectId, projectId: route.query.projectId,
} }
console.log('params',params) console.log('params', params)
let res = await projectApply(params) let res = await projectApply(params)
ElNotification({ ElNotification({
title: '提示', title: '提示',
@@ -163,27 +164,27 @@ const handleSubmit = (instance) => {
} }
}) })
} }
const handleResubmit =async () => { const handleResubmit = async () => {
let files = [] let files = []
let singleFile={} let singleFile = {}
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 === 'Initiation/edit'){ if (attachment.value.singleFile !== null && name.value === 'Initiation/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 => {
files.push(getFileParam(item)) files.push(getFileParam(item))
@@ -193,9 +194,9 @@ const handleResubmit =async () => {
requirementId: route.query.id, requirementId: route.query.id,
fileList: files, fileList: files,
singleFile: singleFile, singleFile: singleFile,
projectId:route.query.projectId, projectId: route.query.projectId,
} }
console.log('params',params) console.log('params', params)
let res = await resubmitApply(params) let res = await resubmitApply(params)
ElNotification({ ElNotification({
title: '提示', title: '提示',
@@ -218,11 +219,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 = () => {
getApplyProcess(route.query.projectId).then(res => { getApplyProcess(route.query.projectId).then(res => {
ElNotification({ ElNotification({
title: '提示', title: '提示',
@@ -232,7 +233,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;
@@ -250,7 +251,7 @@ init()
onMounted(async () => { onMounted(async () => {
await init() await init()
if (name.value === 'Initiation/edit') { if (name.value === 'Initiation/edit') {
loading.value=true loading.value = true
await getDetailInfo() await getDetailInfo()
} }
}) })