suhp 1 месяц назад
Родитель
Сommit
87dfaf7fc8

+ 21 - 27
src/views/costAudit/auditInfo/auditManage/collectiveMain.vue

@@ -438,21 +438,25 @@
 
         getCollectiveDeliberateList(queryParams)
           .then((res) => {
-            if (res && res.success) {
+            if (res && res.state && res.code === 200) {
+              // 根据新的接口返回格式,从res.value中获取数据
+              const data = res.value || []
               // 处理返回的数据,转换为前端表格需要的格式
-              this.recordList = res.data.map((item) => ({
-                id: item.id,
-                reviewForm: item.deliberationForm,
-                location: item.location,
-                hostName: item.hostPerson,
-                reviewTime: item.beginTime,
-                attachments: item.attachmentIds
-                  ? item.attachmentIds.split(',').map((attachmentId) => ({
-                      name: `附件_${attachmentId}`,
-                      url: '#', // 实际应该根据附件ID获取完整URL
-                    }))
-                  : [],
-              }))
+              this.recordList = Array.isArray(data)
+                ? data.map((item) => ({
+                    id: item.id,
+                    reviewForm: item.deliberationForm,
+                    location: item.location,
+                    hostName: item.hostPerson,
+                    reviewTime: item.beginTime,
+                    attachments: item.attachmentIds
+                      ? item.attachmentIds.split(',').map((attachmentId) => ({
+                          name: `附件_${attachmentId}`,
+                          url: '#', // 实际应该根据附件ID获取完整URL
+                        }))
+                      : [],
+                  }))
+                : []
             } else {
               this.$message.error(res.message || '获取记录列表失败')
               // 如果API调用失败,使用模拟数据
@@ -462,16 +466,6 @@
           .catch((error) => {
             this.$message.error('获取记录列表失败:' + error.message)
             // 错误时使用模拟数据
-            this.recordList = [
-              {
-                id: 1,
-                reviewForm: '现场会议',
-                location: '*****会议室',
-                hostName: '张****',
-                reviewTime: '2025-5-21 15:30',
-                attachments: [{ name: '审议记录.doc', url: '#' }],
-              },
-            ]
           })
       },
 
@@ -531,7 +525,7 @@
             // 调用API进行删除操作
             deleteCollectiveDeliberate(row.id)
               .then((res) => {
-                if (res && res.success) {
+                if (res && res.state && res.code === 200) {
                   this.$message.success('删除成功')
                   this.loadRecordList() // 重新加载记录列表
                 } else {
@@ -611,7 +605,7 @@
           // 添加新记录
           addCollectiveDeliberate(saveData)
             .then((res) => {
-              if (res && res.success) {
+              if (res && res.state && res.code === 200) {
                 this.$message.success('新增成功')
                 this.loadRecordList() // 重新加载记录列表
                 this.showRecordDialog = false
@@ -627,7 +621,7 @@
           // 更新现有记录
           updateCollectiveDeliberate(saveData)
             .then((res) => {
-              if (res && res.success) {
+              if (res && res.state && res.code === 200) {
                 this.$message.success('修改成功')
                 this.loadRecordList() // 重新加载记录列表
                 this.showRecordDialog = false

+ 1 - 0
src/views/costAudit/auditInfo/auditManage/index.vue

@@ -237,6 +237,7 @@
         // cbjsInfo弹窗相关
         cbjsInfoVisible: false,
         cbjsInfoData: null,
+        mainDetailsVisible: false,
       }
     },