7
0

2 Ревизии eaf5371a57 ... ae62b696d7

Автор SHA1 Съобщение Дата
  shiyanyu ae62b696d7 Merge branch 'master' of http://1.71.9.215:3000/feiyi/cbjsxt-front-master преди 1 седмица
  shiyanyu 34eee61f53 fix: 修改bug преди 1 седмица
променени са 1 файла, в които са добавени 14 реда и са изтрити 3 реда
  1. 14 3
      src/views/costAudit/auditInfo/auditManage/auditDocumentsMain.vue

+ 14 - 3
src/views/costAudit/auditInfo/auditManage/auditDocumentsMain.vue

@@ -1213,8 +1213,18 @@
           documentType,
           permissionType: '0',
         }).then((res) => {
-          let records = res.value.value.records
-          this.documentData.list = records.filter((item) => {
+          console.log('res', res)
+
+          // 按接口固定返回层级取值(主层级:res.value.value,兼容多包一层 value 的情况)
+          const fixed = (res && res.value && res.value.value) || {}
+          const fixed2 = (fixed && fixed.value) || {}
+
+          const records = fixed.records || fixed2.records || []
+          const total = fixed.total || fixed2.total || 0
+
+          this.documentData.list = (
+            Array.isArray(records) ? records : []
+          ).filter((item) => {
             const excludeTypes = [
               '成本监审工作底稿-送达回证',
               '成本监审提取资料登记表-送达回证',
@@ -1223,7 +1233,8 @@
             ]
             return !excludeTypes.includes(item.documentName)
           })
-          this.documentData.pagination.total = res.value.value.total
+
+          this.documentData.pagination.total = Number(total) || 0
         })
       },
       getEnterpriseName(row) {