|
|
@ -28,7 +28,7 @@ |
|
|
|
<Tabs ref="tabRef" :tabsList="tabsList" :current="current" @change="change" /> |
|
|
|
<div class="flex"> |
|
|
|
<!-- 详情 --> |
|
|
|
<ContentWrap class="w-[100%]" v-show="tabsList[current].label!='附件'&&tabsList[current].label!='备注'&&tabsList[current].label!='变更记录'"> <!-- 列表头部 --> |
|
|
|
<ContentWrap class="w-[100%]" v-show="tabsList[current].label!='附件'&&tabsList[current].label!='备注'&&tabsList[current].label!='变更记录'&&!annexTableData.some(item=>item.label==tabsList[current].label)"> <!-- 列表头部 --> |
|
|
|
<TableHead |
|
|
|
v-if="!isBasic" |
|
|
|
:HeadButttondata="HeadButttondata" |
|
|
@ -97,15 +97,21 @@ |
|
|
|
</DetailTable> |
|
|
|
</ContentWrap> |
|
|
|
<!-- 附件/备注/变更记录 --> |
|
|
|
<ContentWrap class="w-[100%]" v-show="tabsList[current].label=='附件'||tabsList[current].label=='备注'||tabsList[current].label=='变更记录'" :style="{height:remarkHeight+'px'}"> |
|
|
|
<ContentWrap class="w-[100%]" v-show="annexTableData.some(item=>item.label==tabsList[current].label)||tabsList[current].label=='附件'||tabsList[current].label=='备注'||tabsList[current].label=='变更记录'" :style="{height:remarkHeight+'px'}"> |
|
|
|
<!-- 附件组件 --> |
|
|
|
<ElScrollbar ref="scrollbar" :style="{height:(remarkHeight-40)+'px'}"> |
|
|
|
<Annex v-show="tabsList[current].label=='附件'" |
|
|
|
:annexData="annexData" |
|
|
|
@handleAnnexSuccess="handleAnnexSuccess" |
|
|
|
@deleteAnnexSuccess="deleteAnnexSuccess" |
|
|
|
:upData="remarksData.data" |
|
|
|
<Annex v-for="(annexItem ,index) in annexTableData" :key="index" v-show="tabsList[current].label==annexItem.label" |
|
|
|
:annexData="annexItem" |
|
|
|
@handleAnnexSuccess="updateAnnexTableHandle" |
|
|
|
@deleteAnnexSuccess="updateAnnexTableHandle" |
|
|
|
:upData="{...remarksData.data,tableName:annexItem.tableName}" |
|
|
|
/> |
|
|
|
<Annex v-show="tabsList[current].label=='附件'" |
|
|
|
:annexData="annexData" |
|
|
|
@handleAnnexSuccess="handleAnnexSuccess" |
|
|
|
@deleteAnnexSuccess="deleteAnnexSuccess" |
|
|
|
:upData="remarksData.data" |
|
|
|
/> |
|
|
|
<!-- 备注组件 --> |
|
|
|
<Remarks v-show="tabsList[current].label=='备注'" |
|
|
|
:remarksData="remarksData" |
|
|
@ -176,6 +182,12 @@ const props = defineProps({ |
|
|
|
required: true, |
|
|
|
default: null |
|
|
|
}, |
|
|
|
//展示附件组件的tab标签 |
|
|
|
annexTable: { |
|
|
|
type: Array, |
|
|
|
required: false, |
|
|
|
default: ()=>[] |
|
|
|
}, |
|
|
|
// 是否是基础数据 展现详情顶部表单 |
|
|
|
isBasic: { |
|
|
|
type: Boolean, |
|
|
@ -334,7 +346,7 @@ if (props.isBasic == true) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const otherList = [{ |
|
|
|
const otherList = [...props.annexTable,{ |
|
|
|
label:'附件', |
|
|
|
prop:'Annex' |
|
|
|
},{ |
|
|
@ -373,6 +385,8 @@ const remarkHeight = computed(() => { |
|
|
|
const annexData = reactive({ |
|
|
|
annexList: [] |
|
|
|
}) |
|
|
|
// 其他附件默认数据数组 |
|
|
|
const annexTableData = ref<Array<any>>([]) |
|
|
|
|
|
|
|
// 备注数据 |
|
|
|
const remarksData = reactive({ |
|
|
@ -394,6 +408,23 @@ const getFileList = async () => { |
|
|
|
detailLoading.value = false |
|
|
|
} |
|
|
|
} |
|
|
|
// 获取其他附件列表篇 |
|
|
|
const getAnnexFileList = async () => { |
|
|
|
props.annexTable?.forEach(async (item) => { |
|
|
|
let requstData = {...remarksData.data,tableName: item?.tableName} |
|
|
|
const annexList = await FileApi.getFileList(requstData) |
|
|
|
const annexData = annexTableData.value.find(annex=>annex.label === item.label) |
|
|
|
if(annexData){ |
|
|
|
annexData.annexList = annexList |
|
|
|
}else{ |
|
|
|
annexTableData.value.push({ |
|
|
|
label: item.label, |
|
|
|
tableName: item?.tableName || '', |
|
|
|
annexList |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
/** 添加附件 */ |
|
|
|
const handleAnnexSuccess = () => { |
|
|
|
getFileList() |
|
|
@ -404,6 +435,11 @@ const deleteAnnexSuccess = async () => { |
|
|
|
getFileList() |
|
|
|
getChangeRecordList() |
|
|
|
} |
|
|
|
/** 追加的附件 */ |
|
|
|
const updateAnnexTableHandle = () => { |
|
|
|
getAnnexFileList() |
|
|
|
getChangeRecordList() |
|
|
|
} |
|
|
|
|
|
|
|
// Tabs当前选择 |
|
|
|
const current = ref(0) |
|
|
@ -481,6 +517,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: |
|
|
|
detailData.value = row |
|
|
|
getRemarkList() |
|
|
|
getFileList() |
|
|
|
getAnnexFileList() |
|
|
|
getChangeRecordList() |
|
|
|
// 判断详情按钮是否显示 |
|
|
|
let detailButtonFilter: any = [] |
|
|
|