|
|
@@ -9,91 +9,45 @@
|
|
|
style="width: 100%"
|
|
|
border
|
|
|
>
|
|
|
- <el-table-column prop="orderNum" label="序号" width="80" align="center">
|
|
|
+ <el-table-column label="序号" width="80" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
{{ scope.$index + 1 }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
+ prop="informationTypeName"
|
|
|
+ label="材料分类"
|
|
|
+ min-width="140"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
prop="informationName"
|
|
|
- label="报送资料"
|
|
|
+ label="材料名称"
|
|
|
header-align="center"
|
|
|
align="left"
|
|
|
- min-width="200"
|
|
|
+ min-width="240"
|
|
|
+ show-overflow-tooltip
|
|
|
/>
|
|
|
<el-table-column
|
|
|
- prop="informationTypeName"
|
|
|
- label="资料类型"
|
|
|
- min-width="150"
|
|
|
- align="center"
|
|
|
+ prop="informationRequire"
|
|
|
+ label="材料要求说明"
|
|
|
+ min-width="260"
|
|
|
+ align="left"
|
|
|
+ show-overflow-tooltip
|
|
|
/>
|
|
|
<el-table-column
|
|
|
- prop="isRequired"
|
|
|
- label="是否必项"
|
|
|
- min-width="120"
|
|
|
- align="center"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- {{
|
|
|
- scope.row.isRequired === '1' || scope.row.isRequired === 1
|
|
|
- ? '是'
|
|
|
- : '否'
|
|
|
- }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="isUpload"
|
|
|
- label="是否上传"
|
|
|
+ prop="formatRequiredName"
|
|
|
+ label="格式要求"
|
|
|
min-width="120"
|
|
|
align="center"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- <span
|
|
|
- :class="
|
|
|
- scope.row.isUpload === '1' || scope.row.isUpload === 1
|
|
|
- ? 'status-uploaded'
|
|
|
- : 'status-not-uploaded'
|
|
|
- "
|
|
|
- >
|
|
|
- {{
|
|
|
- scope.row.isUpload === '1' || scope.row.isUpload === 1
|
|
|
- ? '已上传'
|
|
|
- : '未上传'
|
|
|
- }}
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="uploadTime"
|
|
|
- label="上传时间"
|
|
|
- width="150"
|
|
|
- align="center"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ scope.row.uploadTime ? scope.row.uploadTime : '--' }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="auditedStatus"
|
|
|
- label="初审结果"
|
|
|
- min-width="120"
|
|
|
+ :formatter="formatFormatRequired"
|
|
|
+ />
|
|
|
+ <!-- <el-table-column
|
|
|
+ prop="orderNum"
|
|
|
+ label="排序"
|
|
|
+ width="120"
|
|
|
align="center"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ formatAuditStatus(scope.row.auditedStatus) }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作" width="100" align="center" fixed="right">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- size="small"
|
|
|
- @click="handleViewDetail(scope.row)"
|
|
|
- >
|
|
|
- 查看
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ /> -->
|
|
|
</el-table>
|
|
|
</div>
|
|
|
|
|
|
@@ -106,91 +60,45 @@
|
|
|
style="width: 100%"
|
|
|
border
|
|
|
>
|
|
|
- <el-table-column prop="orderNum" label="序号" width="80" align="center">
|
|
|
+ <el-table-column label="序号" width="80" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
{{ scope.$index + 1 }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
+ prop="informationTypeName"
|
|
|
+ label="材料分类"
|
|
|
+ min-width="140"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
prop="informationName"
|
|
|
- label="报送资料"
|
|
|
+ label="材料名称"
|
|
|
header-align="center"
|
|
|
align="left"
|
|
|
- min-width="200"
|
|
|
+ min-width="240"
|
|
|
+ show-overflow-tooltip
|
|
|
/>
|
|
|
<el-table-column
|
|
|
- prop="informationTypeName"
|
|
|
- label="资料类型"
|
|
|
- min-width="150"
|
|
|
- align="center"
|
|
|
+ prop="informationRequire"
|
|
|
+ label="材料要求说明"
|
|
|
+ min-width="260"
|
|
|
+ align="left"
|
|
|
+ show-overflow-tooltip
|
|
|
/>
|
|
|
<el-table-column
|
|
|
- prop="isRequired"
|
|
|
- label="是否必项"
|
|
|
- min-width="120"
|
|
|
- align="center"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- {{
|
|
|
- scope.row.isRequired === '1' || scope.row.isRequired === 1
|
|
|
- ? '是'
|
|
|
- : '否'
|
|
|
- }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="isUpload"
|
|
|
- label="是否上传"
|
|
|
+ prop="formatRequiredName"
|
|
|
+ label="格式要求"
|
|
|
min-width="120"
|
|
|
align="center"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- <span
|
|
|
- :class="
|
|
|
- scope.row.isUpload === '1' || scope.row.isUpload === 1
|
|
|
- ? 'status-uploaded'
|
|
|
- : 'status-not-uploaded'
|
|
|
- "
|
|
|
- >
|
|
|
- {{
|
|
|
- scope.row.isUpload === '1' || scope.row.isUpload === 1
|
|
|
- ? '已上传'
|
|
|
- : '未上传'
|
|
|
- }}
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="uploadTime"
|
|
|
- label="上传时间"
|
|
|
- width="150"
|
|
|
- align="center"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ scope.row.uploadTime ? scope.row.uploadTime : '--' }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="auditedStatus"
|
|
|
- label="初审结果"
|
|
|
- min-width="120"
|
|
|
+ :formatter="formatFormatRequired"
|
|
|
+ />
|
|
|
+ <!-- <el-table-column
|
|
|
+ prop="orderNum"
|
|
|
+ label="排序"
|
|
|
+ width="120"
|
|
|
align="center"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ formatAuditStatus(scope.row.auditedStatus) }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作" width="100" align="center" fixed="right">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- size="small"
|
|
|
- @click="handleViewDetail(scope.row)"
|
|
|
- >
|
|
|
- 查看
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ /> -->
|
|
|
</el-table>
|
|
|
</div>
|
|
|
|
|
|
@@ -203,91 +111,39 @@
|
|
|
style="width: 100%"
|
|
|
border
|
|
|
>
|
|
|
- <el-table-column prop="orderNum" label="序号" width="80" align="center">
|
|
|
+ <el-table-column label="序号" width="80" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
{{ scope.$index + 1 }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
+ prop="informationTypeName"
|
|
|
+ label="材料分类"
|
|
|
+ min-width="140"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
prop="informationName"
|
|
|
- label="报送资料"
|
|
|
+ label="材料名称"
|
|
|
header-align="center"
|
|
|
align="left"
|
|
|
- min-width="200"
|
|
|
+ min-width="240"
|
|
|
+ show-overflow-tooltip
|
|
|
/>
|
|
|
<el-table-column
|
|
|
- prop="informationTypeName"
|
|
|
- label="资料类型"
|
|
|
- min-width="150"
|
|
|
- align="center"
|
|
|
+ prop="informationRequire"
|
|
|
+ label="材料要求说明"
|
|
|
+ min-width="260"
|
|
|
+ align="left"
|
|
|
+ show-overflow-tooltip
|
|
|
/>
|
|
|
<el-table-column
|
|
|
- prop="isRequired"
|
|
|
- label="是否必项"
|
|
|
+ prop="formatRequiredName"
|
|
|
+ label="格式要求"
|
|
|
min-width="120"
|
|
|
align="center"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- {{
|
|
|
- scope.row.isRequired === '1' || scope.row.isRequired === 1
|
|
|
- ? '是'
|
|
|
- : '否'
|
|
|
- }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="isUpload"
|
|
|
- label="是否上传"
|
|
|
- min-width="120"
|
|
|
- align="center"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- <span
|
|
|
- :class="
|
|
|
- scope.row.isUpload === '1' || scope.row.isUpload === 1
|
|
|
- ? 'status-uploaded'
|
|
|
- : 'status-not-uploaded'
|
|
|
- "
|
|
|
- >
|
|
|
- {{
|
|
|
- scope.row.isUpload === '1' || scope.row.isUpload === 1
|
|
|
- ? '已上传'
|
|
|
- : '未上传'
|
|
|
- }}
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="uploadTime"
|
|
|
- label="上传时间"
|
|
|
- width="150"
|
|
|
- align="center"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ scope.row.uploadTime ? scope.row.uploadTime : '--' }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="auditedStatus"
|
|
|
- label="初审结果"
|
|
|
- min-width="120"
|
|
|
- align="center"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ formatAuditStatus(scope.row.auditedStatus) }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作" width="100" align="center" fixed="right">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- size="small"
|
|
|
- @click="handleViewDetail(scope.row)"
|
|
|
- >
|
|
|
- 查看
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ :formatter="formatFormatRequired"
|
|
|
+ />
|
|
|
</el-table>
|
|
|
</div>
|
|
|
|
|
|
@@ -307,10 +163,12 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { getMaterialByTaskId } from '@/api/home'
|
|
|
+ import { getDocumentCatalog } from '@/api/catalogManage.js'
|
|
|
+ import { dictMixin } from '@/mixins/useDict'
|
|
|
|
|
|
export default {
|
|
|
name: 'MaterialTab',
|
|
|
+ mixins: [dictMixin],
|
|
|
props: {
|
|
|
project: {
|
|
|
type: Object,
|
|
|
@@ -320,6 +178,11 @@
|
|
|
type: Boolean,
|
|
|
default: false,
|
|
|
},
|
|
|
+ // 是否自动加载报送资料(默认 true)。如需在父组件切换到页签时再加载,可置为 false。
|
|
|
+ autoLoad: {
|
|
|
+ type: Boolean,
|
|
|
+ default: true,
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -335,7 +198,11 @@
|
|
|
watch: {
|
|
|
project: {
|
|
|
handler(newVal) {
|
|
|
- if (newVal && newVal.taskId) {
|
|
|
+ if (!this.autoLoad) return
|
|
|
+ if (
|
|
|
+ newVal &&
|
|
|
+ (newVal.taskId || newVal.projectId || newVal.catalogId)
|
|
|
+ ) {
|
|
|
this.loadMaterialData()
|
|
|
}
|
|
|
},
|
|
|
@@ -343,32 +210,81 @@
|
|
|
immediate: true,
|
|
|
},
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ // if (
|
|
|
+ // this.autoLoad &&
|
|
|
+ // this.project &&
|
|
|
+ // (this.project.taskId || this.project.projectId || this.project.catalogId)
|
|
|
+ // ) {
|
|
|
+ // this.loadMaterialData()
|
|
|
+ // }
|
|
|
+ },
|
|
|
methods: {
|
|
|
// 加载报送资料数据
|
|
|
async loadMaterialData() {
|
|
|
- if (!this.project || !this.project.taskId) {
|
|
|
+ if (
|
|
|
+ !this.project ||
|
|
|
+ (!this.project.projectId && !this.project.catalogId)
|
|
|
+ ) {
|
|
|
return
|
|
|
}
|
|
|
try {
|
|
|
this.loading = true
|
|
|
- const res = await getMaterialByTaskId({
|
|
|
- taskId: this.project.taskId,
|
|
|
- })
|
|
|
+ const params = {
|
|
|
+ projectId: this.project.projectId || this.project.projectID || '',
|
|
|
+ catalogId:
|
|
|
+ this.project.catalogId ||
|
|
|
+ this.project.catalogid ||
|
|
|
+ this.project.catalogID ||
|
|
|
+ '',
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 500,
|
|
|
+ }
|
|
|
+ const res = await getDocumentCatalog(params)
|
|
|
|
|
|
- if (res && res.state && res.value) {
|
|
|
- // 根据接口返回的数据结构进行处理
|
|
|
- // 如果返回是数组,直接使用;否则获取 records 或 data
|
|
|
- const materialList = Array.isArray(res.value)
|
|
|
- ? res.value
|
|
|
- : res.value.records || res.value.data || []
|
|
|
+ const value = res?.value || {}
|
|
|
+ const records = Array.isArray(value.records)
|
|
|
+ ? value.records
|
|
|
+ : Array.isArray(value?.value?.records)
|
|
|
+ ? value.value.records
|
|
|
+ : Array.isArray(res?.value)
|
|
|
+ ? res.value
|
|
|
+ : []
|
|
|
|
|
|
- this.materialData = materialList
|
|
|
- // 按资料类型分组
|
|
|
- this.groupMaterialData(materialList)
|
|
|
- } else {
|
|
|
- this.materialData = []
|
|
|
- this.resetMaterialGroups()
|
|
|
- }
|
|
|
+ // 归一化字段,便于表格/分组使用
|
|
|
+ const materialList = records.map((item) => ({
|
|
|
+ id: item.id || item.pkVal || '',
|
|
|
+ informationName:
|
|
|
+ item.informationName ||
|
|
|
+ item.informationTitle ||
|
|
|
+ item.materialName ||
|
|
|
+ '',
|
|
|
+ informationType: item.informationType || '',
|
|
|
+ informationTypeName:
|
|
|
+ item.informationTypeName ||
|
|
|
+ this.formatTypeName(item.informationType),
|
|
|
+ informationRequire:
|
|
|
+ item.informationRequire ||
|
|
|
+ item.requireDesc ||
|
|
|
+ item.description ||
|
|
|
+ item.informationDesc ||
|
|
|
+ '',
|
|
|
+ formatRequired: item.formatRequired || '',
|
|
|
+ formatRequiredName: item.formatRequiredName || '',
|
|
|
+ orderNum:
|
|
|
+ item.orderNum ||
|
|
|
+ item.orderNumber ||
|
|
|
+ item.sort ||
|
|
|
+ item.sortNo ||
|
|
|
+ 1,
|
|
|
+ isRequired: item.isRequired != null ? String(item.isRequired) : '0',
|
|
|
+ isUpload: item.isUpload != null ? item.isUpload : item.uploaded,
|
|
|
+ uploadTime: item.uploadTime || item.createTime || '',
|
|
|
+ auditedStatus: item.auditedStatus,
|
|
|
+ }))
|
|
|
+
|
|
|
+ this.materialData = materialList
|
|
|
+ this.groupMaterialData(materialList)
|
|
|
} catch (error) {
|
|
|
console.error('加载报送资料失败:', error)
|
|
|
this.materialData = []
|
|
|
@@ -429,6 +345,24 @@
|
|
|
}
|
|
|
return statusMap[status] || '未知'
|
|
|
},
|
|
|
+ // 简单的类型名称兜底
|
|
|
+ formatTypeName(type) {
|
|
|
+ const map = {
|
|
|
+ 1: '综合性资料',
|
|
|
+ 2: '财务会计资料',
|
|
|
+ 3: '其他资料',
|
|
|
+ }
|
|
|
+ return map[type] || ''
|
|
|
+ },
|
|
|
+ // 格式要求显示与目录管理一致
|
|
|
+ formatFormatRequired(row) {
|
|
|
+ return (
|
|
|
+ row.formatRequiredName ||
|
|
|
+ this.getDictName('formatAsk', row.formatRequired) ||
|
|
|
+ row.formatRequired ||
|
|
|
+ ''
|
|
|
+ )
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
</script>
|