diff --git a/components/JeepayNavigation/JeepayNavigation.vue b/components/JeepayNavigation/JeepayNavigation.vue index f49fc48..53795bd 100644 --- a/components/JeepayNavigation/JeepayNavigation.vue +++ b/components/JeepayNavigation/JeepayNavigation.vue @@ -78,7 +78,7 @@ // 点击事件 async function clickFunc(nav) { - if (nav.pageUrl == "PAGES_SALES_SUMMARY") { + if (nav.pageUrl == "PAGES_DATA_SUMMARY") { let res = await hasPermission('允许查看经营数据') if (!res) return } diff --git a/http/api/order/summary.js b/http/api/order/summary.js index 285125a..c56a727 100644 --- a/http/api/order/summary.js +++ b/http/api/order/summary.js @@ -20,4 +20,14 @@ export function saleSummaryPage(data) { ...data, }, }); + } + + export function saleSummaryCount(data) { + return request({ + url: `${urlType}/admin/sale/summary/count`, + method: "GET", + data: { + ...data, + }, + }); } \ No newline at end of file diff --git a/pageSalesSummary/index.vue b/pageSalesSummary/index.vue index 98c9620..f5fbb6e 100644 --- a/pageSalesSummary/index.vue +++ b/pageSalesSummary/index.vue @@ -15,7 +15,7 @@ 实收金额(元) - {{ list.saleAmount ? list.saleAmount : 0 }} + {{ list.payAmount ? list.payAmount : 0 }} 优惠金额(元) @@ -26,7 +26,7 @@ 客单价(元) - {{ list.customerUnitPrice ? list.customerUnitPrice : 0 }} + {{ list.avgPayAmount ? list.avgPayAmount : 0 }} @@ -44,7 +44,7 @@ 翻台率(%) - {{ list.tableTurnoverRate ? list.tableTurnoverRate : 0 }} + {{ list.turnoverRate ? list.turnoverRate : 0 }} @@ -97,6 +97,8 @@ 更多 @@ -111,9 +113,23 @@ import { getTrade } from "@/http/api/summary.js"; import { saleSummaryPage } from "@/http/api/order/summary.js"; import { timeList } from "@/data/index.js"; +function resetDatePicker() { + datePickerData.value.beginDate = ""; + datePickerData.value.endDate = ""; +} + +function datePickerClose() { + console.log("datePickerClose"); + if (!datePickerData.value.beginDate && !datePickerData.value.endDate) { + selected.value = oldSelected; + } +} + const datePicker = ref(); let selected = ref("today"); +let oldSelected = selected.value; + let list = ref({}); let tableList = ref([]); let day = ref(1); @@ -157,9 +173,13 @@ function gettableData(beginDate, endDate) { */ function changeTime(e) { selected.value = e; + resetDatePicker(); + if (e == "custom") { datePicker.value.toggle(); } else { + oldSelected = e; + getData(); } } diff --git a/pageSalesSummary/sales.vue b/pageSalesSummary/sales.vue new file mode 100644 index 0000000..22c4305 --- /dev/null +++ b/pageSalesSummary/sales.vue @@ -0,0 +1,411 @@ + + + + + + + + diff --git a/pages.json b/pages.json index e0e95d8..17b838e 100644 --- a/pages.json +++ b/pages.json @@ -390,12 +390,20 @@ { "root": "pageSalesSummary", "pages": [{ - "pageId": "PAGES_SALES_SUMMARY", + "pageId": "PAGES_DATA_SUMMARY", "path": "index", "style": { - "navigationBarTitleText": "销售汇总" + "navigationBarTitleText": "数据统计" } - }, { + }, + { + "pageId": "PAGES_SALES_SUMMARY", + "path": "sales", + "style": { + "navigationBarTitleText": "销量统计" + } + }, + { "pageId": "PAGES_PRODUCT_SALES_RANKING", "path": "productSalesRanking", "style": { diff --git a/pages/index/components/statistics.vue b/pages/index/components/statistics.vue index 4c08745..026e7d1 100644 --- a/pages/index/components/statistics.vue +++ b/pages/index/components/statistics.vue @@ -47,7 +47,7 @@ size="14" bold mode="price" - :text="refundCount" + :text="refundAmount" > @@ -180,7 +180,7 @@ onShow((options) => { }); const yingyeE = ref(0); -const refundCount = ref(0); +const refundAmount = ref(0); /** * 获取统计数据 * @param {Object} start @@ -202,7 +202,7 @@ function getlist(start, end) { shopId: uni.getStorageSync("shopId"), rangeType: rangeType, }).then((res) => { - refundCount.value = res.refundCount; + refundAmount.value = res.refundAmount; for (var key in res) { pageData.list.map((item) => { if (item.key == key) {