diff --git a/README.md b/README.md index 9dbf53d..68b333a 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,7 @@ chaozg chaozg123 -## 测试宝塔 - - -chaozg -chaozg123 - -## 本地服务器(192.168.1.31)linux部署 +## 本地测试服务器(192.168.1.31)linux部署 映射地址 diff --git a/src/store/modules/carts.ts b/src/store/modules/carts.ts index 12154fa..69c4db6 100644 --- a/src/store/modules/carts.ts +++ b/src/store/modules/carts.ts @@ -648,7 +648,7 @@ export const useCartsStore = defineStore("carts", () => { return ElMessage.warning(msg.message || '该商品已存在') } const skuData = getProductDetails({ product_id: msg.data.product_id, sku_id: msg.data.sku_id }) - if (skuData) { + if (skuData || msg.data.is_temporary) { const newGoods = { ...skuData, ...msg.data } console.log('newGoods', newGoods) list.value.push(newGoods) diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 5c6e0be..3e8eabd 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -63,7 +63,7 @@ export const useUserStore = defineStore("user", () => { console.log(userInfo) console.log(data) localStorage.setItem("shopId", "" + data.id); - Object.assign(userInfo.value, { ...data, roles: [], promissionList: [], shopId: userInfo.value.shopId }); + Object.assign(userInfo.value, { ...data, roles: [], promissionList: [], shopId: data.id }); resolve(userInfo.value); }) .catch((error) => { diff --git a/src/views/data/index.vue b/src/views/data/index.vue index 947c3c3..67f15c7 100644 --- a/src/views/data/index.vue +++ b/src/views/data/index.vue @@ -52,7 +52,7 @@ 营业
- +
@@ -67,7 +67,7 @@
@@ -391,7 +391,7 @@ export default { }, ], branchList: [], - storeId: null, + shopId: null, trade: {}, formatDecimal, topData: "", @@ -428,6 +428,8 @@ export default { }, tradeVip: "", tradeCount: "", + isHeadShop: JSON.parse(localStorage.getItem("userInfo")).isHeadShop + }; }, computed: { @@ -486,10 +488,18 @@ export default { // this.initCardUserChart(); }, methods: { + /** + * 获取分店列表 + */ async geiShopList() { let res = await ShopApi.getBranchList() this.branchList = res; }, + shopChange(){ + this.summarytrade(); + this.lineChartTypeChange(this.lineChartType) + this.dateProduct() + }, // 切换时间 timeChange(e) { const format = ["YYYY-MM-DD 00:00:00", "YYYY-MM-DD 23:59:59"]; @@ -539,7 +549,9 @@ export default { break; case "custom": // 自定义 - this.query.createdAt = []; + this.query.createdAt = [ + dayjs().add(-30, "d").format(format[0]), + dayjs().format(format[1]),]; break; default: break; @@ -552,9 +564,13 @@ export default { async summarytrade() { try { this.tradeLoading = true; + if( this.query.createdAt[1] ){ + this.query.createdAt.splice(1,1,this.query.createdAt[1].replace("00:00:00","23:59:59")) + } const res = await dataSummaryApi.trade({ beginDate: this.query.createdAt[0], endDate: this.query.createdAt[1], + shopId: this.shopId }); this.trade = res; this.tradeLoading = false; @@ -878,7 +894,7 @@ export default { async dateAmount() { try { this.saleLoading = true; - const res = await dataSummaryApi.dateAmount({ day: this.saleActive }); + const res = await dataSummaryApi.dateAmount({ day: this.saleActive,shopId: this.shopId }); const data = res.total.map((item) => { return { orderAmount: item.orderAmount, @@ -907,6 +923,7 @@ export default { day: this.saleTableActive, page: this.saleTablePage, size: this.saleTableSize, + shopId: this.shopId }); this.saleTable = res.records; this.saleTableTotal = res.totalRow * 1; @@ -922,7 +939,7 @@ export default { async datePayType() { try { this.payChartLoading = true; - const res = await dataSummaryApi.datePayType({ day: this.saleActive }); + const res = await dataSummaryApi.datePayType({ day: this.saleActive,shopId: this.shopId }); const data = res.countPayType.map((item) => { return { value: item.count, diff --git a/src/views/data/sales.vue b/src/views/data/sales.vue index a20a397..c34d08f 100644 --- a/src/views/data/sales.vue +++ b/src/views/data/sales.vue @@ -11,8 +11,8 @@ - - + + @@ -34,7 +34,7 @@ 自定义 @@ -157,6 +157,7 @@