diff --git a/src/views/home/data_credit.vue b/src/views/home/data_credit.vue index 847b906..a106ba5 100644 --- a/src/views/home/data_credit.vue +++ b/src/views/home/data_credit.vue @@ -112,14 +112,45 @@ export default { size: 10, loading: false, total: 0 - }, - couponId: null + } } }, mounted() { this.getTableData() }, methods: { + + /** + * 获取挂账人列表 + */ + async getTableData() { + this.tableData.loading = true + try { + const res = await getCreditBuyerList({ + page: this.tableData.page, + size: this.tableData.size, + keywords: this.tableData.keywords, + status: this.tableData.status, + shopId: localStorage.getItem('shopId') + }) + this.tableData.loading = false + this.tableData.data = res.content + this.tableData.total = res.totalElements + } catch (error) { + console.log(error) + } + }, + + /** + * 删除挂账人 + * @param id + */ + async delTableHandle(id) { + // eslint-disable-next-line no-unused-vars + const res = await delCreditBuyer(id) + this.getTableData() + }, + /** * 操作 */ @@ -147,46 +178,8 @@ export default { }, // 分页回调 paginationChange(e) { - console.log(e) this.tableData.page = e this.getTableData() - }, - // 获取挂账列表 - async getTableData() { - this.tableData.loading = true - try { - const res = await getCreditBuyerList({ - page: this.tableData.page, - size: this.tableData.size, - keywords: this.tableData.keywords, - status: this.tableData.status, - shopId: localStorage.getItem('shopId') - }) - this.tableData.loading = false - this.tableData.data = res.content - this.tableData.total = res.totalElements - console.log(this.tableData) - } catch (error) { - console.log(error) - } - }, - - /** - * 查看领取详情 - */ - couponDetailsOpen(row) { - this.$refs.couponDetails.show(row) - this.couponId = row.id - }, - - /** - * 删除优惠券 - * @param id - */ - async delTableHandle(id) { - const delRes = await delCreditBuyer(id) - console.log(delRes) - this.getTableData() } } } diff --git a/src/views/home/data_creditDetail.vue b/src/views/home/data_creditDetail.vue index 56d9bec..9bd7d62 100644 --- a/src/views/home/data_creditDetail.vue +++ b/src/views/home/data_creditDetail.vue @@ -302,7 +302,6 @@ export default { default: break } - console.log(this.timeValue) }, /**