fix: 认领结果回写/流水同步 0 条时提示 NaN——unwrapData 判空改 ?? 保留合法数字 0

This commit is contained in:
刘泉佳
2026-09-29 01:33:58 +08:00
parent 9b42551bcd
commit 730c4e2a6a
2 changed files with 6 additions and 4 deletions
+3 -2
View File
@@ -202,8 +202,9 @@ export default {
}, },
methods: { methods: {
unwrapData(response) { unwrapData(response) {
const body = response?.data || response || {}; // 数字 0 是合法返回值(如回写/同步 0 条),须用 ?? 判空避免 0 被信封对象顶掉导致 Number() 得 NaN
return body?.data || body; const body = response?.data ?? response ?? {};
return body?.data ?? body;
}, },
queryParams() { queryParams() {
const transactionRange = this.query.transactionDateRange || []; const transactionRange = this.query.transactionDateRange || [];
+3 -2
View File
@@ -295,8 +295,9 @@ export default {
}, },
methods: { methods: {
unwrapData(response) { unwrapData(response) {
const body = response?.data || response || {}; // 数字 0 是合法返回值(如回写/同步 0 条),须用 ?? 判空避免 0 被信封对象顶掉导致 Number() 得 NaN
return body?.data || body; const body = response?.data ?? response ?? {};
return body?.data ?? body;
}, },
async loadTable() { async loadTable() {
this.loading = true; this.loading = true;