From 9682a02cd84fde6095000f899208356b93f10fe9 Mon Sep 17 00:00:00 2001 From: xk_chenlianjie <15255791639@163.com> Date: Sun, 4 Feb 2024 10:12:21 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/order/orderInfo.js | 2 +- src/views/dashboard/admin/index.scss | 11 ++-- src/views/dashboard/admin/index.vue | 6 +-- src/views/order/orderList.vue | 4 +- src/views/order/orderListDetail.vue | 4 +- src/views/product/productList/index.vue | 38 +++++++------- .../statistics/productStatisticsList.vue | 50 ++++++++++++++++--- 7 files changed, 79 insertions(+), 36 deletions(-) diff --git a/src/api/order/orderInfo.js b/src/api/order/orderInfo.js index 3c92d7a..3d8d86a 100644 --- a/src/api/order/orderInfo.js +++ b/src/api/order/orderInfo.js @@ -79,7 +79,7 @@ export default { exportExcel(page) { // 导出 return request({ - url: `/${service_name}/${group_name}/exportWeb`, + url: `/${service_name}/${group_name}/getByPageExport`, method: 'post', data: page, responseType: 'blob' diff --git a/src/views/dashboard/admin/index.scss b/src/views/dashboard/admin/index.scss index 65d02df..19b1056 100644 --- a/src/views/dashboard/admin/index.scss +++ b/src/views/dashboard/admin/index.scss @@ -84,7 +84,10 @@ font-size: 20px; font-weight: 600; } -.page{ - height:calc(100vh - 144px); - box-sizing: border-box; -} \ No newline at end of file +.mt{ + margin-top: 30px; +} +// .page{ +// height:calc(100vh - 144px); +// box-sizing: border-box; +// } \ No newline at end of file diff --git a/src/views/dashboard/admin/index.vue b/src/views/dashboard/admin/index.vue index 7ccc561..5662b4f 100644 --- a/src/views/dashboard/admin/index.vue +++ b/src/views/dashboard/admin/index.vue @@ -104,14 +104,14 @@ 订单统计
-
+
本月订单总数
10000
10% 同比上周
-
-
本月订单总数
+
+
本周订单数量
10000
10% 同比上周
diff --git a/src/views/order/orderList.vue b/src/views/order/orderList.vue index 80f17a1..fdda7e9 100644 --- a/src/views/order/orderList.vue +++ b/src/views/order/orderList.vue @@ -60,7 +60,7 @@ @@ -283,7 +283,7 @@ export default { const searchParam = { ...this.page } searchParam.pageSize = endIndex searchParam.currentPage = this.output.startPage - orderInfoApi.getByPage(searchParam).then(res => { + orderInfoApi.exportExcel(searchParam).then(res => { const link = document.createElement('a') // 创建Blob对象,设置文件类型 const blob = new Blob([res], { type: 'application/vnd.ns-excel' }) // MIME类型 diff --git a/src/views/order/orderListDetail.vue b/src/views/order/orderListDetail.vue index 96ec758..fc2abd4 100644 --- a/src/views/order/orderListDetail.vue +++ b/src/views/order/orderListDetail.vue @@ -6,7 +6,7 @@
{{ detailData.orderCode }} - {{ detailData.acctId }} + {{ detailData.customerPhone }} {{ detailData.integral }} {{ detailData.createTime }} {{ detailData.takeSiteName }} @@ -112,7 +112,7 @@ export default { case '0': return '待支付' case '1': - return '已经发' + return '已支付' case '2': return '退款申请' case '3': diff --git a/src/views/product/productList/index.vue b/src/views/product/productList/index.vue index fd7beed..eb4374e 100644 --- a/src/views/product/productList/index.vue +++ b/src/views/product/productList/index.vue @@ -41,8 +41,8 @@
- - + + - - - + + + 批量上架 批量下架
@@ -128,7 +128,7 @@ @@ -591,18 +591,20 @@ export default { // 批量上下架 batchShelves(productStatus) { let selected = this.$refs.table.selection - if (selected&&selected.length>0){ - let selectedIds = selected.map(item=>item.id) - productApi.batchShelves({ - list:selectedIds, - productStatus:productStatus - }).then(res=>{ - if (res.code===20000){ - this.$message.success(res.msg) - this.getDataList() - } - }) - }else { + if (selected && selected.length > 0) { + let selectedIds = selected.map(item => item.id) + productApi + .batchShelves({ + list: selectedIds, + productStatus: productStatus + }) + .then(res => { + if (res.code === 20000) { + this.$message.success(res.msg) + this.getDataList() + } + }) + } else { this.$message.error('请选择需要操作的数据') } }, diff --git a/src/views/statistics/productStatisticsList.vue b/src/views/statistics/productStatisticsList.vue index 2dca2ca..6007fa8 100644 --- a/src/views/statistics/productStatisticsList.vue +++ b/src/views/statistics/productStatisticsList.vue @@ -45,7 +45,7 @@ @@ -56,7 +56,7 @@ @@ -391,12 +391,22 @@ export default { }) console.log('tableList', this.tableList) }, + // 表格搜索 productSearchs() { - console.log(this.Time) + console.log('time', this.Time) if (this.Time !== null && this.Time.length !== 0) { - this.createTime = this.Time[0] + '/' + this.Time[1] + if (this.isDate(this.Time[0])) { + this.createTime = this.Time[0] + '/' + this.Time[1] + console.log('-----') + } else { + var time1 = this.getSimpleDate(this.Time[0]) + var time2 = this.getSimpleDate(this.Time[1]) + this.createTime = time1 + '/' + time2 + } + console.log('createTime------', this.createTime) + this.getChartList() } else { this.$message.error('请选择要查询的时间段!') @@ -404,15 +414,43 @@ export default { }, // 表格搜索 userSearchs() { + console.log('createTime2', this.createTime2) this.page.currentPage = 1 + if (this.createTime2 !== null && this.createTime2.length !== 0) { - this.page.params.startTime = this.createTime2[0] - this.page.params.endTime = this.createTime2[1] + if (this.isDate(this.createTime2[0])) { + this.page.params.startTime = this.createTime2[0] + this.page.params.endTime = this.createTime2[1] + } else { + var time1 = this.getSimpleDate(this.createTime2[0]) + var time2 = this.getSimpleDate(this.createTime2[1]) + this.page.params.startTime = time1 + this.page.params.endTime = time2 + } + this.getList() } else { this.$message.error('请选择要查询的时间段!') } }, + + isDate(dateStr) { + var pattern = /^\d{4}-\d{2}-\d{2}$/ + return pattern.test(dateStr) + }, + getSimpleDate(date) { + var y = date.getFullYear() + var m = date.getMonth() + 1 + m = m < 10 ? '0' + m : m + var d = date.getDate() + d = d < 10 ? '0' + d : d + // var h = date.getHours() + // var minute = date.getMinutes() + // minute = minute < 10 ? '0' + minute : minute + // var s = date.getSeconds() + // s = s < 10 ? '0' + s : s + return y + '-' + m + '-' + d + }, // 数据导出; exportData: function() {},