fix : 前置流程多选

This commit is contained in:
2024-06-18 23:46:24 +08:00
parent 820349877c
commit 91f21409f6

View File

@@ -4,10 +4,12 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="前置流程" :required="preProcessRequired" prop="requestName"> <el-form-item label="前置流程" :required="preProcessRequired" prop="requestName">
<a :href="localFormData.preProcess?.baseUrl" target="_blank" <div v-for="item in localFormData.preProcess" :key="item.requestId">
style="color: #2a99ff;margin-right: 10px;cursor: pointer">{{ localFormData.preProcess?.requestName }}</a> <a :href="item.baseUrl" target="_blank"
style="color: #2a99ff;margin-right: 10px;cursor: pointer">{{ item.requestName }}</a>
</div>
<el-button color="#DED0B2" @click="handleShowPreTable"> <el-button color="#DED0B2" @click="handleShowPreTable">
{{ localFormData.preProcess?.requestName ? '更改' : '请选择' }} {{ localFormData.preProcess ? '更改' : '请选择' }}
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
@@ -32,29 +34,30 @@
</div> </div>
</div> </div>
<div class="process"> <div class="process">
<operation-render v-if="mode === 'resubmit'&&!changeDiagram" :operation-list="data.operationList" :state="data.state"/> <operation-render v-if="mode === 'resubmit'&&!changeDiagram" :operation-list="data.operationList"
:state="data.state"/>
<process-diagram-viewer mode="view" :idName="title" v-if="processDiagramViewer&&changeDiagram"/> <process-diagram-viewer mode="view" :idName="title" v-if="processDiagramViewer&&changeDiagram"/>
</div> </div>
</div> </div>
</div> </div>
<!-- <div v-if="changeDiagram">--> <!-- <div v-if="changeDiagram">-->
<!-- <div class="approval-record">--> <!-- <div class="approval-record">-->
<!-- <div class="approval-title">--> <!-- <div class="approval-title">-->
<!-- <baseTitle title="流程图"></baseTitle>--> <!-- <baseTitle title="流程图"></baseTitle>-->
<!-- <div class="diagram">--> <!-- <div class="diagram">-->
<!--&lt;!&ndash; <div class="base-title">流程图</div>&ndash;&gt;--> <!--&lt;!&ndash; <div class="base-title">流程图</div>&ndash;&gt;-->
<!--&lt;!&ndash; <el-switch&ndash;&gt;--> <!--&lt;!&ndash; <el-switch&ndash;&gt;-->
<!--&lt;!&ndash; v-model="changeDiagram"&ndash;&gt;--> <!--&lt;!&ndash; v-model="changeDiagram"&ndash;&gt;-->
<!--&lt;!&ndash; style="&#45;&#45;el-switch-on-color: #13ce66; &#45;&#45;el-switch-off-color:#BEA266"&ndash;&gt;--> <!--&lt;!&ndash; style="&#45;&#45;el-switch-on-color: #13ce66; &#45;&#45;el-switch-off-color:#BEA266"&ndash;&gt;-->
<!--&lt;!&ndash; />&ndash;&gt;--> <!--&lt;!&ndash; />&ndash;&gt;-->
<!-- </div>--> <!-- </div>-->
<!-- </div>--> <!-- </div>-->
<!-- </div>--> <!-- </div>-->
<!-- <div class="process">--> <!-- <div class="process">-->
<!-- <process-diagram-viewer mode="view" :idName="title" v-if="processDiagramViewer"/>--> <!-- <process-diagram-viewer mode="view" :idName="title" v-if="processDiagramViewer"/>-->
<!-- </div>--> <!-- </div>-->
<!-- </div>--> <!-- </div>-->
<div class="oper-page-btn"> <div class="oper-page-btn">
<el-button color="#DED0B2" v-if="mode === 'submit'" @click="handleSubmit">提交</el-button> <el-button color="#DED0B2" v-if="mode === 'submit'" @click="handleSubmit">提交</el-button>
<el-button color="#DED0B2" v-else-if="mode === 'resubmit'" @click="handleSubmit">重新提交</el-button> <el-button color="#DED0B2" v-else-if="mode === 'resubmit'" @click="handleSubmit">重新提交</el-button>
@@ -71,7 +74,9 @@
<el-button @click="handleReset">重置</el-button> <el-button @click="handleReset">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table :data="preProcessList" stripe v-loading="loading"> <el-table :data="preProcessList" stripe v-loading="loading"
@select="handleSelect" row-key="requestId">
<el-table-column type="selection" width="55" :reserve-selection="true"/>
<el-table-column prop="requestId" label="请求id"></el-table-column> <el-table-column prop="requestId" label="请求id"></el-table-column>
<el-table-column prop="requestName" label="请求名称"></el-table-column> <el-table-column prop="requestName" label="请求名称"></el-table-column>
<el-table-column prop="lastOperatorName" label="最后操作人名称"></el-table-column> <el-table-column prop="lastOperatorName" label="最后操作人名称"></el-table-column>
@@ -81,15 +86,17 @@
<el-table-column prop="createTime" label="创建时间"></el-table-column> <el-table-column prop="createTime" label="创建时间"></el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template #default="scope"> <template #default="scope">
<div style="display: flex;align-items: center"> <!-- <el-button type="primary" @click="choosePreProcess(scope.row)" link>选择</el-button>-->
<el-button type="primary" @click="chooseProProcess(scope.row)" link>选择</el-button> <a :href="scope.row.baseUrl" target="_blank" style="color: #2a99ff;margin-left: 10px">查看流程</a>
<a :href="scope.row.baseUrl" target="_blank" style="color: #2a99ff;margin-left: 10px">查看流程</a>
</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<paging :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :page-sizes="[10, 20, 30, 40,50]" <paging :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :page-sizes="[10, 20, 30, 40,50]"
:total="total" @changeSize="handleSizeChange" @goPage="handleCurrentChange"/> :total="total" @changeSize="handleSizeChange" @goPage="handleCurrentChange"/>
<div class="oper">
<el-button color="#DED0B2" @click="choosePreProcess">确定</el-button>
<el-button @click="handleCancel">取消</el-button>
</div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@@ -163,11 +170,13 @@ const tagsViewStore = useTagsView()
const processStore = useProcessStore() const processStore = useProcessStore()
const otherFileList = ref([]) const otherFileList = ref([])
const localFormData = ref({ const localFormData = ref({
preProcess: { preProcess: [
requestId: null, // {
requestName: '', // requestId: null,
baseUrl: '' // requestName: '',
} // baseUrl: ''
// }
]
}) })
const attachment = ref() const attachment = ref()
const deploymentData = ref({}) const deploymentData = ref({})
@@ -177,7 +186,24 @@ const loading = ref(false)
const processDiagramViewer = ref(false) const processDiagramViewer = ref(false)
const name = ref(router.currentRoute.value.name) const name = ref(router.currentRoute.value.name)
const deploymentId = ref() const deploymentId = ref()
const selectRows = ref([])
const projectId = ref(route.query.projectId) const projectId = ref(route.query.projectId)
const getPreProcessUrl = (list) => {
// list.map(item => {
// item.baseUrl = getPreProcessUrl(item.preProcess)
// })
// let baseUrl=
// list.forEach(item => {
// baseUrl=item.baseUrl
// })
// return baseUrl
}
const handleSelect = async (selection) => {
selectRows.value = selection
}
const handleCancel = () => {
showPreTable.value = false
}
const searchPreProcess = () => { const searchPreProcess = () => {
getPreProcessList() getPreProcessList()
@@ -207,12 +233,19 @@ const getPreProcessList = () => {
preProcessList.value = currentList.value.slice(0, 10) preProcessList.value = currentList.value.slice(0, 10)
}) })
} }
const chooseProProcess = (item) => { const choosePreProcess = () => {
localFormData.value.preProcess = { let preProcessObj = {}
requestId: item.requestId, let preProcessArray = []
requestName: item.requestName, selectRows.value.forEach((item) => {
baseUrl: item.baseUrl preProcessObj = {
} requestId: item.requestId,
requestName: item.requestName,
baseUrl: item.baseUrl
}
preProcessArray.push(preProcessObj)
})
localFormData.value.preProcess = preProcessArray
console.log('localFormData.value.preProcess', localFormData.value.preProcess)
showPreTable.value = false showPreTable.value = false
} }
@@ -252,11 +285,11 @@ const compositeParam = (item) => {
} }
} }
const getAttachment = (val) => { const getAttachment = (val) => {
console.log('上传文件getAttachment', val) // console.log('上传文件getAttachment', val)
localFormData.value.singleFile = compositeParam(val) localFormData.value.singleFile = compositeParam(val)
} }
const getOtherFile = (val) => { const getOtherFile = (val) => {
console.log('上传文件getOtherFile', val) // console.log('上传文件getOtherFile', val)
showTable.value = false showTable.value = false
let fileObj = compositeParam(val) let fileObj = compositeParam(val)
otherFileList.value.push(fileObj) otherFileList.value.push(fileObj)
@@ -271,7 +304,7 @@ const getFileParam = (item) => {
} }
} }
const handleSubmit = async () => { const handleSubmit = async () => {
if(deploymentData.value.deploymentName==='重大项目立项'||deploymentData.value.deploymentName==='重大项目验收'){ if (deploymentData.value.deploymentName === '重大项目立项' || deploymentData.value.deploymentName === '重大项目验收') {
if (localFormData.value.preProcess === undefined) { if (localFormData.value.preProcess === undefined) {
ElNotification({ ElNotification({
title: '提示', title: '提示',
@@ -320,46 +353,46 @@ const handleSubmit = async () => {
} }
console.log('params', params) console.log('params', params)
let res let res
if (props.step === '20') { // if (props.step === '20') {
if (props.mode === 'resubmit') { // if (props.mode === 'resubmit') {
res = await resubmitApply(params) // res = await resubmitApply(params)
} else { // } else {
res = await projectApply(params) // res = await projectApply(params)
} // }
} else if (props.step === '40') { // } else if (props.step === '40') {
if (props.mode === 'resubmit') { // if (props.mode === 'resubmit') {
res = await resubmitCheck(params) // res = await resubmitCheck(params)
} else { // } else {
res = await projectCheck(params) // res = await projectCheck(params)
} // }
} else if (props.step === '50') { // } else if (props.step === '50') {
if (props.mode === 'resubmit') { // if (props.mode === 'resubmit') {
res = await resubmitConclusion(params) // res = await resubmitConclusion(params)
} else { // } else {
res = await projectConclusion(params) // res = await projectConclusion(params)
} // }
} // }
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) { // if (res.code === 1000) {
tagsViewStore.delVisitedViews(router.currentRoute.value.path) // tagsViewStore.delVisitedViews(router.currentRoute.value.path)
if (props.step === '20') { // if (props.step === '20') {
await router.push({ // await router.push({
name: 'Initiation' // name: 'Initiation'
}) // })
} else if (props.step === '40') { // } else if (props.step === '40') {
await router.push({ // await router.push({
name: 'Implementation' // name: 'Implementation'
}) // })
} else if (props.step === '50') { // } else if (props.step === '50') {
await router.push({ // await router.push({
name: 'Filing' // name: 'Filing'
}) // })
} // }
} // }
} }
const init = async () => { const init = async () => {
let id = projectId.value let id = projectId.value
@@ -377,7 +410,7 @@ const init = async () => {
let data = res.data let data = res.data
deploymentId.value = data.deploymentId deploymentId.value = data.deploymentId
deploymentData.value = data deploymentData.value = data
preProcessRequired.value = data.deploymentName === '重大项目立项'||data.deploymentName === '重大项目验收'; preProcessRequired.value = data.deploymentName === '重大项目立项' || data.deploymentName === '重大项目验收';
processStore.setDesign(data) processStore.setDesign(data)
processStore.runningList.value = data.runningList; processStore.runningList.value = data.runningList;
processStore.endList.value = data.endList; processStore.endList.value = data.endList;
@@ -406,5 +439,9 @@ onMounted(async () => {
</script> </script>
<style scoped> <style scoped>
.oper {
margin-top: 20px;
display: flex;
justify-content: flex-end;
}
</style> </style>