diff --git a/src/utils/exportData.js b/src/utils/exportData.js index f9f1fd30..2ef66adb 100644 --- a/src/utils/exportData.js +++ b/src/utils/exportData.js @@ -21,7 +21,7 @@ export function exportExcel(columnList = [], listData = [], name = 'excel') { if (blackArr.includes(val.label) || val.head) continue; if (j === 0) headers.push(val.label); - arr.push(item[val.prop] || ''); + arr.push(item[val.prop] || item[val.prop] === 0 ? item[val.prop] : ''); } console.log('arr :>> ', arr); data.push(arr); diff --git a/src/views/basic/coderule/basicTenantCode.vue b/src/views/basic/coderule/basicTenantCode.vue index 64fd444b..f6b5ff61 100644 --- a/src/views/basic/coderule/basicTenantCode.vue +++ b/src/views/basic/coderule/basicTenantCode.vue @@ -48,6 +48,7 @@
+ @@ -192,6 +193,7 @@ import { columnList } from '@/option/finance/MerchantDepositSlip'; import { useRouter } from 'vue-router'; import { deepClone } from '@/utils/util'; import { ElMessage, ElMessageBox } from 'element-plus'; +import { exportExcel } from '@/utils/exportData'; // 获取路由实例 const $router = useRouter(); @@ -584,6 +586,11 @@ const handleBatchDelete = async () => { ElMessage.info('已取消删除'); }); }; + +/** 导出表格数据 */ +const handleExportData = () => { + exportExcel(details.columnList, details.data, '系统编码规则 - ' + new Date().getTime()); +};