diff --git a/src/views/home/data_record.vue b/src/views/home/data_record.vue index dabd8fe..c9c9622 100644 --- a/src/views/home/data_record.vue +++ b/src/views/home/data_record.vue @@ -127,18 +127,13 @@ export default { this.tableData.loading = true; try { - let lane = null - if (this.query.createdAt.length == 0) { - lane = `/api/tbHandover?page=${this.tableData.page + 1}&size=${this.tableData.size}&shopId=${localStorage.getItem("shopId")}` + let urlData = null + if (this.query.createdAt.length == 0) { // 为什么这么写 因为后端让我有时候传key值有时候不传 为啥不按照框架走后端处理起来太麻烦 前端处理 -- 魏文政 2024.7.30 15:50 + urlData = `/api/tbHandover?page=${this.tableData.page + 1}&size=${this.tableData.size}&shopId=${localStorage.getItem("shopId")}` } else { - lane = `/api/tbHandover?page=${this.tableData.page + 1}&size=${this.tableData.size}&shopId=${localStorage.getItem("shopId")}&tradeDay=${this.query.createdAt[0] ? this.query.createdAt[0] : ''}&tradeDay=${this.query.createdAt[1] ? this.query.createdAt[1] : ''}` + urlData = `/api/tbHandover?page=${this.tableData.page + 1}&size=${this.tableData.size}&shopId=${localStorage.getItem("shopId")}&tradeDay=${this.query.createdAt[0] ? this.query.createdAt[0] : ''}&tradeDay=${this.query.createdAt[1] ? this.query.createdAt[1] : ''}` } - const res = await tbHandoverGet(lane); - // page: this.tableData.page + 1, - // size: this.tableData.size, - // shopId: localStorage.getItem("shopId"), - // tradeDay:this.query.createdAt - // }); + const res = await tbHandoverGet(urlData); this.tableData.loading = false; this.tableData.data = res.content; this.tableData.total = res.totalElements;