fix : 修复权限按钮细节

This commit is contained in:
2024-05-23 23:42:09 +08:00
parent 43c9cb03d3
commit 549e307b3e
17 changed files with 276 additions and 118 deletions

View File

@@ -195,7 +195,12 @@ const getDetailInfo = async () => {
})
}
const init = () => {
getProjectCheckProcess().then(res => {
getProjectCheckProcess(route.query.projectId).then(res => {
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
processDiagramViewer.value = false
if (res.code === 1000) {
let data = res.data

View File

@@ -2,20 +2,20 @@
<steps :active="'0'" @setDetail="setDetail" @stepChange="stepChange">
<template #content>
<collection-detail
:formData="collectionData.formData"
:data="collectionData"
:formData="commonForm.formData"
:data="commonForm"
:processViewer="commonProvessViewer"
:companyOption="companyOption"
@getInfo="getDemandCollectionInfo"
v-show="showActive == '00'"
:loading="loading"
/>
<summary-detail v-show="showActive == '10'" :formData="summaryData.formData" :data="summaryData" :processViewer="commonProvessViewer"/>
<ApprovalDetail type="approval" v-show="showActive == '20'" :formData="commonForm.formData" :data="commonForm" :processViewer="commonProvessViewer"></ApprovalDetail>
<ApprovalDetail type="execute" v-show="showActive == '40'" :formData="commonForm.formData" :data="commonForm" :processViewer="commonProvessViewer"></ApprovalDetail>
<summary-detail v-show="showActive == '10'" :formData="commonForm.formData" :data="commonForm" :processViewer="commonProvessViewer" :loading="loading"/>
<ApprovalDetail type="approval" v-show="showActive == '20'" :formData="commonForm.formData" :data="commonForm" :processViewer="commonProvessViewer" :loading="loading"></ApprovalDetail>
<ApprovalDetail type="execute" v-show="showActive == '40'" :formData="commonForm.formData" :data="commonForm" :processViewer="commonProvessViewer" :loading="loading"></ApprovalDetail>
</template>
</steps>
<opinion v-if="commonForm.taskId" :formData="formData" :taskId="formData.taskId"/>
<opinion v-if="commonForm.taskId" :formData="commonForm.formData" :taskId="commonForm.taskId"/>
</template>
<script setup lang="jsx">
@@ -42,6 +42,7 @@ const route = useRoute()
const activeName = ref('first')
const collectionData = ref({})
const summaryData = ref({})
const loading = ref(false)
const collectionProcessViewer = ref(true)
const summaryProcessViewer = ref(true)
const processStore = useProcessStore()
@@ -63,12 +64,16 @@ const getAllInfo = async (state) => {
try {
state == '00' && ( await getCompanyOption() )
commonProvessViewer.value = false
loading.value = true
const { data, code } = await getMapProjectStateInfo(route.query.projectId, state)
if(state == '00') {
collectionData.value = data;
} else if(state == '10') {
summaryData.value = data;
}
if(code===1000){
loading.value = false
}
commonForm.value = data
processStore.setDesign(data)
processStore.runningList.value = data.runningList;

View File

@@ -106,6 +106,11 @@ const tableConfig = reactive({
label: '所属公司',
align: 'center'
},
{
prop: 'approveName',
label: '审批人',
align: 'center'
},
{
prop: 'projectType',
label: '项目类型',
@@ -131,6 +136,11 @@ const tableConfig = reactive({
label: '起止时间',
align: 'center'
},
{
prop: 'taskNode',
label: '当前节点',
align: 'center'
},
{
prop: 'state',
label: '状态',
@@ -150,23 +160,36 @@ const tableConfig = reactive({
align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) => {
let btn = [{label: '详情', func: () => handleDetail(row), type: 'primary'}]
// if (row.state === '3') {
btn.push(
{label: '验收', func: () => handleCheck(row), type: 'primary'},
{label: '编辑', func: () => handleEdit(row), type: 'primary'},
{label: '台账', func: () => handleStandingBook(row), type: 'primary'},
{label: '附件', func: () => handleAttachment(row), type: 'primary'},
{label: '查看分摊', func: () => handleShare(row), type: 'primary'}
)
// }
let btn = []
let buttons = new Set(Array.from(row.buttons))
if (buttons.has("details")) {
btn.push({label: '详情', prem: ['mosr:requirement:info'], func: () => handleDetail(row), type: 'primary'})
}
if (buttons.has("check")) {
btn.push({label: '验收',prem: ['mosr:requirement:resubmit'], func: () => handleCheck(row), type: 'primary'})
}
if (buttons.has("edit")) {
btn.push({label: '编辑',prem: ['mosr:requirement:del'], func: () => handleEdit(row), type: 'primary'})
}
if (buttons.has("standing")) {
btn.push({label: '台账',prem: ['mosr:requirement:info'], func: () => handleStandingBook(row), type: 'primary'})
}
if (buttons.has("attachments")) {
btn.push({label: '附件',prem: ['mosr:requirement:info'], func: () => handleAttachment(row), type: 'primary'})
}
if (buttons.has("viewAllocation")) {
btn.push({label: '查看分摊',prem: ['mosr:requirement:info'], func: () => handleShare(row), type: 'primary'})
}
if (buttons.has("phaseChange")) {
btn.push({label: '阶段变更',prem: ['mosr:requirement:info'], func: () => handleChange(row), type: 'primary'})
}
return (
<div style={{width: '100%'}}>
{
btn.map(item => (
<el-button
type={item.type}
// v-perm={item.auth}
v-perm={item.prem}
onClick={() => item.func()}
link
>